gemi 0.131.0 → 0.133.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/AgentController.d.ts +73 -0
- package/dist/ai/AgentController.d.ts.map +1 -1
- package/dist/ai/AgentProvider.d.ts +25 -0
- package/dist/ai/AgentProvider.d.ts.map +1 -1
- package/dist/ai/VoiceBridge.d.ts +365 -0
- package/dist/ai/VoiceBridge.d.ts.map +1 -0
- package/dist/ai/index.d.ts +13 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +18 -18
- package/dist/ai/index.js.map +11 -6
- package/dist/ai/providers/endpoints.d.ts +19 -0
- package/dist/ai/providers/endpoints.d.ts.map +1 -1
- package/dist/ai/providers/realtime.d.ts +272 -0
- package/dist/ai/providers/realtime.d.ts.map +1 -0
- package/dist/ai/providers/sideband.d.ts +254 -0
- package/dist/ai/providers/sideband.d.ts.map +1 -0
- package/dist/ai/runtime.d.ts.map +1 -1
- package/dist/ai/types.d.ts +15 -0
- package/dist/ai/types.d.ts.map +1 -1
- package/dist/ai/voice/index.d.ts +23 -0
- package/dist/ai/voice/index.d.ts.map +1 -0
- package/dist/ai/voice/index.js +433 -0
- package/dist/ai/voice/index.js.map +1 -0
- package/dist/ai/voice/state.d.ts +34 -0
- package/dist/ai/voice/state.d.ts.map +1 -0
- package/dist/ai/voice/useVoiceSession.d.ts +82 -0
- package/dist/ai/voice/useVoiceSession.d.ts.map +1 -0
- package/dist/ai/voice/voiceCall.d.ts +57 -0
- package/dist/ai/voice/voiceCall.d.ts.map +1 -0
- package/dist/ai/voice/wire.d.ts +66 -0
- package/dist/ai/voice/wire.d.ts.map +1 -0
- package/dist/ai/voiceConfig.d.ts +70 -0
- package/dist/ai/voiceConfig.d.ts.map +1 -0
- package/dist/ai/voiceMcp.d.ts +89 -0
- package/dist/ai/voiceMcp.d.ts.map +1 -0
- package/dist/ai/voiceStore.d.ts +52 -0
- package/dist/ai/voiceStore.d.ts.map +1 -0
- package/dist/app/index.js +1 -1
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-4gmhx2ba.js → chunk-0eamc2tr.js} +2 -2
- package/dist/{chunk-4gmhx2ba.js.map → chunk-0eamc2tr.js.map} +1 -1
- package/dist/{chunk-2x0n3ze1.js → chunk-0gg4e94v.js} +2 -2
- package/dist/{chunk-2x0n3ze1.js.map → chunk-0gg4e94v.js.map} +1 -1
- package/dist/{chunk-p642ja42.js → chunk-0rhf4g12.js} +3 -3
- package/dist/{chunk-p642ja42.js.map → chunk-0rhf4g12.js.map} +1 -1
- package/dist/{chunk-dxm5gxqk.js → chunk-1awxdnb6.js} +1 -1
- package/dist/{chunk-2senwsdq.js → chunk-2cnawkke.js} +12 -12
- package/dist/{chunk-2senwsdq.js.map → chunk-2cnawkke.js.map} +3 -3
- package/dist/{chunk-fxm8fqh9.js → chunk-33hdxe7v.js} +1 -1
- package/dist/{chunk-63xekerg.js → chunk-3g5q0cj5.js} +2 -2
- package/dist/{chunk-63xekerg.js.map → chunk-3g5q0cj5.js.map} +1 -1
- package/dist/{chunk-xjs72pb0.js → chunk-3h37f124.js} +2 -2
- package/dist/{chunk-xjs72pb0.js.map → chunk-3h37f124.js.map} +1 -1
- package/dist/{chunk-65fq5a9d.js → chunk-4278e429.js} +2 -2
- package/dist/{chunk-65fq5a9d.js.map → chunk-4278e429.js.map} +1 -1
- package/dist/chunk-47e7fbsp.js +5 -0
- package/dist/{chunk-mvka90rq.js.map → chunk-47e7fbsp.js.map} +1 -1
- package/dist/{chunk-p6b0cyf8.js → chunk-4pvv8qs0.js} +2 -2
- package/dist/{chunk-p6b0cyf8.js.map → chunk-4pvv8qs0.js.map} +1 -1
- package/dist/{chunk-rjyw1thg.js → chunk-4t41m5f1.js} +2 -2
- package/dist/{chunk-rjyw1thg.js.map → chunk-4t41m5f1.js.map} +1 -1
- package/dist/{chunk-f21v4n2v.js → chunk-53rr32zm.js} +1 -1
- package/dist/{chunk-xhvknqvn.js → chunk-5pdgh9a1.js} +2 -2
- package/dist/{chunk-xhvknqvn.js.map → chunk-5pdgh9a1.js.map} +1 -1
- package/dist/{chunk-e4ay1vg9.js → chunk-65j32dtn.js} +2 -2
- package/dist/{chunk-e4ay1vg9.js.map → chunk-65j32dtn.js.map} +1 -1
- package/dist/{chunk-jxvec7jc.js → chunk-6fr6j338.js} +2 -2
- package/dist/{chunk-jxvec7jc.js.map → chunk-6fr6j338.js.map} +1 -1
- package/dist/{chunk-jd1afbrs.js → chunk-6hz63ts4.js} +4 -4
- package/dist/{chunk-jd1afbrs.js.map → chunk-6hz63ts4.js.map} +1 -1
- package/dist/{chunk-4z0rt6ws.js → chunk-6qty7at2.js} +2 -2
- package/dist/{chunk-4z0rt6ws.js.map → chunk-6qty7at2.js.map} +1 -1
- package/dist/{chunk-pzb3agv9.js → chunk-7nxnyw7x.js} +2 -2
- package/dist/{chunk-pzb3agv9.js.map → chunk-7nxnyw7x.js.map} +1 -1
- package/dist/{chunk-7n0zn5h4.js → chunk-8ryrjtn0.js} +2 -2
- package/dist/{chunk-7n0zn5h4.js.map → chunk-8ryrjtn0.js.map} +1 -1
- package/dist/{chunk-c1gq2ttb.js → chunk-8sde8337.js} +2 -2
- package/dist/{chunk-c1gq2ttb.js.map → chunk-8sde8337.js.map} +1 -1
- package/dist/{chunk-cggywjzz.js → chunk-99a4e6zf.js} +2 -2
- package/dist/{chunk-cggywjzz.js.map → chunk-99a4e6zf.js.map} +1 -1
- package/dist/chunk-b6yb3svm.js +6 -0
- package/dist/{chunk-539w9yt3.js.map → chunk-b6yb3svm.js.map} +2 -2
- package/dist/{chunk-822p54vc.js → chunk-beb265c9.js} +2 -2
- package/dist/{chunk-822p54vc.js.map → chunk-beb265c9.js.map} +1 -1
- package/dist/{chunk-hdgbh8hn.js → chunk-cxsvzqd4.js} +2 -2
- package/dist/{chunk-hdgbh8hn.js.map → chunk-cxsvzqd4.js.map} +1 -1
- package/dist/{chunk-pahr13xg.js → chunk-dt95z6et.js} +2 -2
- package/dist/{chunk-pahr13xg.js.map → chunk-dt95z6et.js.map} +1 -1
- package/dist/{chunk-hr8annr1.js → chunk-feajsgns.js} +2 -2
- package/dist/{chunk-hr8annr1.js.map → chunk-feajsgns.js.map} +1 -1
- package/dist/{chunk-2tda49mv.js → chunk-ff60bzvf.js} +2 -2
- package/dist/{chunk-2tda49mv.js.map → chunk-ff60bzvf.js.map} +1 -1
- package/dist/{chunk-b00z33zg.js → chunk-gng5e7pd.js} +1 -1
- package/dist/{chunk-mz73066c.js → chunk-gqgpwb88.js} +2 -2
- package/dist/{chunk-mz73066c.js.map → chunk-gqgpwb88.js.map} +1 -1
- package/dist/{chunk-h0xye69a.js → chunk-ha15x5ns.js} +2 -2
- package/dist/{chunk-h0xye69a.js.map → chunk-ha15x5ns.js.map} +1 -1
- package/dist/{chunk-d5g1caxb.js → chunk-hb9hm8za.js} +3 -3
- package/dist/{chunk-d5g1caxb.js.map → chunk-hb9hm8za.js.map} +1 -1
- package/dist/{chunk-8fvt7kys.js → chunk-hf492gg2.js} +1 -1
- package/dist/{chunk-fgtr9cds.js → chunk-hj88dcss.js} +3 -3
- package/dist/{chunk-fgtr9cds.js.map → chunk-hj88dcss.js.map} +1 -1
- package/dist/{chunk-hnf11jhc.js → chunk-j5g7qc5f.js} +2 -2
- package/dist/{chunk-hnf11jhc.js.map → chunk-j5g7qc5f.js.map} +1 -1
- package/dist/{chunk-e1fhy2h5.js → chunk-jgx8ggbz.js} +2 -2
- package/dist/{chunk-e1fhy2h5.js.map → chunk-jgx8ggbz.js.map} +1 -1
- package/dist/{chunk-35zw2s61.js → chunk-jx2mgvvt.js} +3 -3
- package/dist/{chunk-35zw2s61.js.map → chunk-jx2mgvvt.js.map} +1 -1
- package/dist/{chunk-w26cw41m.js → chunk-jx5zx48j.js} +2 -2
- package/dist/{chunk-w26cw41m.js.map → chunk-jx5zx48j.js.map} +1 -1
- package/dist/{chunk-z1gjgr1c.js → chunk-jy9dkgt0.js} +2 -2
- package/dist/{chunk-z1gjgr1c.js.map → chunk-jy9dkgt0.js.map} +1 -1
- package/dist/{chunk-7j48ymk1.js → chunk-k2xeskp6.js} +2 -2
- package/dist/{chunk-7j48ymk1.js.map → chunk-k2xeskp6.js.map} +1 -1
- package/dist/{chunk-jxmc33m9.js → chunk-ka991yx4.js} +2 -2
- package/dist/{chunk-jxmc33m9.js.map → chunk-ka991yx4.js.map} +1 -1
- package/dist/{chunk-65s63bdh.js → chunk-krk880my.js} +2 -2
- package/dist/{chunk-65s63bdh.js.map → chunk-krk880my.js.map} +1 -1
- package/dist/{chunk-x4yq0c9v.js → chunk-m9vwg9j1.js} +3 -3
- package/dist/{chunk-x4yq0c9v.js.map → chunk-m9vwg9j1.js.map} +1 -1
- package/dist/{chunk-x07rp3fc.js → chunk-mpqvmge4.js} +1 -1
- package/dist/{chunk-n7sbwpce.js → chunk-mw7ft5bs.js} +2 -2
- package/dist/{chunk-n7sbwpce.js.map → chunk-mw7ft5bs.js.map} +1 -1
- package/dist/{chunk-v5esvs66.js → chunk-njpnstck.js} +2 -2
- package/dist/{chunk-v5esvs66.js.map → chunk-njpnstck.js.map} +1 -1
- package/dist/{chunk-p320fd3g.js → chunk-p82868xx.js} +2 -2
- package/dist/{chunk-p320fd3g.js.map → chunk-p82868xx.js.map} +1 -1
- package/dist/{chunk-jbd723h1.js → chunk-pm8wjatv.js} +3 -3
- package/dist/{chunk-jbd723h1.js.map → chunk-pm8wjatv.js.map} +1 -1
- package/dist/{chunk-t227jn4b.js → chunk-q15f5g86.js} +2 -2
- package/dist/{chunk-t227jn4b.js.map → chunk-q15f5g86.js.map} +1 -1
- package/dist/{chunk-838cdh6v.js → chunk-qfra7gah.js} +2 -2
- package/dist/{chunk-838cdh6v.js.map → chunk-qfra7gah.js.map} +1 -1
- package/dist/{chunk-aprjvzrz.js → chunk-rnp5k8m3.js} +2 -2
- package/dist/{chunk-aprjvzrz.js.map → chunk-rnp5k8m3.js.map} +1 -1
- package/dist/{chunk-qz89m7ss.js → chunk-rzqft8q8.js} +2 -2
- package/dist/{chunk-qz89m7ss.js.map → chunk-rzqft8q8.js.map} +1 -1
- package/dist/{chunk-zc5962gh.js → chunk-s025aycr.js} +2 -2
- package/dist/{chunk-zc5962gh.js.map → chunk-s025aycr.js.map} +1 -1
- package/dist/{chunk-y14weak4.js → chunk-s21kn0x8.js} +2 -2
- package/dist/{chunk-y14weak4.js.map → chunk-s21kn0x8.js.map} +1 -1
- package/dist/{chunk-3wnczt5w.js → chunk-s55t7rxw.js} +2 -2
- package/dist/{chunk-3wnczt5w.js.map → chunk-s55t7rxw.js.map} +1 -1
- package/dist/{chunk-fzs7g6mc.js → chunk-s782bzeq.js} +2 -2
- package/dist/{chunk-fzs7g6mc.js.map → chunk-s782bzeq.js.map} +1 -1
- package/dist/{chunk-77ymcf7q.js → chunk-sa6cxt3g.js} +2 -2
- package/dist/{chunk-77ymcf7q.js.map → chunk-sa6cxt3g.js.map} +1 -1
- package/dist/{chunk-dz76qhx8.js → chunk-swwkdm75.js} +2 -2
- package/dist/{chunk-dz76qhx8.js.map → chunk-swwkdm75.js.map} +1 -1
- package/dist/{chunk-58mg4rpd.js → chunk-t33yh84d.js} +2 -2
- package/dist/{chunk-58mg4rpd.js.map → chunk-t33yh84d.js.map} +1 -1
- package/dist/{chunk-mym7egdq.js → chunk-vnw91fe1.js} +2 -2
- package/dist/{chunk-mym7egdq.js.map → chunk-vnw91fe1.js.map} +1 -1
- package/dist/{chunk-4wda9teq.js → chunk-w1cksc5z.js} +3 -3
- package/dist/{chunk-4wda9teq.js.map → chunk-w1cksc5z.js.map} +1 -1
- package/dist/chunk-wevj4981.js +122 -0
- package/dist/{chunk-fx7r6pdf.js.map → chunk-wevj4981.js.map} +3 -3
- package/dist/{chunk-ayjfs5mm.js → chunk-wrsf2abe.js} +2 -2
- package/dist/{chunk-ayjfs5mm.js.map → chunk-wrsf2abe.js.map} +1 -1
- package/dist/{chunk-j1wc4afr.js → chunk-x16ckgq1.js} +2 -2
- package/dist/{chunk-j1wc4afr.js.map → chunk-x16ckgq1.js.map} +1 -1
- package/dist/{chunk-gnaxedwh.js → chunk-x51tegk3.js} +2 -2
- package/dist/{chunk-gnaxedwh.js.map → chunk-x51tegk3.js.map} +1 -1
- package/dist/{chunk-qspam5cf.js → chunk-x5hj0mqp.js} +2 -2
- package/dist/{chunk-qspam5cf.js.map → chunk-x5hj0mqp.js.map} +1 -1
- package/dist/{chunk-dp2yz8bj.js → chunk-x9bk5s21.js} +2 -2
- package/dist/{chunk-dp2yz8bj.js.map → chunk-x9bk5s21.js.map} +1 -1
- package/dist/{chunk-p462p2xe.js → chunk-xvvsc58s.js} +2 -2
- package/dist/{chunk-p462p2xe.js.map → chunk-xvvsc58s.js.map} +1 -1
- package/dist/{chunk-0g5f8ymy.js → chunk-xymr3asa.js} +2 -2
- package/dist/{chunk-0g5f8ymy.js.map → chunk-xymr3asa.js.map} +1 -1
- package/dist/{chunk-j4y0sjdc.js → chunk-ysc7ykss.js} +2 -2
- package/dist/{chunk-j4y0sjdc.js.map → chunk-ysc7ykss.js.map} +1 -1
- package/dist/{chunk-3xy41vc0.js → chunk-z61dj480.js} +3 -3
- package/dist/{chunk-3xy41vc0.js.map → chunk-z61dj480.js.map} +1 -1
- package/dist/{chunk-0q68t71d.js → chunk-z9xxthp1.js} +3 -3
- package/dist/{chunk-0q68t71d.js.map → chunk-z9xxthp1.js.map} +1 -1
- package/dist/{chunk-47eav3ex.js → chunk-zv5qyrqg.js} +2 -2
- package/dist/{chunk-47eav3ex.js.map → chunk-zv5qyrqg.js.map} +1 -1
- package/dist/{chunk-asmszzkp.js → chunk-zyhmn3hy.js} +3 -3
- package/dist/{chunk-asmszzkp.js.map → chunk-zyhmn3hy.js.map} +1 -1
- package/dist/{chunk-zzgt759n.js → chunk-zypmy8yq.js} +2 -2
- package/dist/{chunk-zzgt759n.js.map → chunk-zypmy8yq.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/ApiRouter.d.ts +27 -5
- package/dist/http/ApiRouter.d.ts.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/defaults.d.ts.map +1 -1
- package/dist/orm/index.js +3 -3
- package/dist/orm/index.js.map +3 -3
- 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 +2 -1
- package/dist/chunk-539w9yt3.js +0 -6
- package/dist/chunk-fx7r6pdf.js +0 -122
- package/dist/chunk-mvka90rq.js +0 -5
- /package/dist/{chunk-dxm5gxqk.js.map → chunk-1awxdnb6.js.map} +0 -0
- /package/dist/{chunk-fxm8fqh9.js.map → chunk-33hdxe7v.js.map} +0 -0
- /package/dist/{chunk-f21v4n2v.js.map → chunk-53rr32zm.js.map} +0 -0
- /package/dist/{chunk-b00z33zg.js.map → chunk-gng5e7pd.js.map} +0 -0
- /package/dist/{chunk-8fvt7kys.js.map → chunk-hf492gg2.js.map} +0 -0
- /package/dist/{chunk-x07rp3fc.js.map → chunk-mpqvmge4.js.map} +0 -0
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * Thrown when the compiler is handed an argument it does not implement yet.\n *\n * Every public operation accepts the full Prisma argument type from iteration 1\n * — signatures are final, capability grows underneath them. The price of that is\n * that anything unimplemented has to fail loudly: silently dropping a `take: 10`\n * and returning the whole table is the worst failure mode this ORM has.\n */\nexport class UnsupportedQueryError extends Error {\n constructor(\n public readonly argument: string,\n public readonly model: string,\n public readonly operation: string,\n /**\n * What cannot work, and what to do instead.\n *\n * **Required**, which is the second half of #61 — the first being the\n * `UnsupportedByDesignError` split beside this. It was optional, and the\n * refusals that omitted it were the highest-traffic ones: an argument the\n * operation does not accept, on the path a typo takes. Those said only\n * *that* something was refused, to the reader least likely to know why.\n *\n * Required rather than conventionally-supplied for the reason five other\n * parameters here are — `render`'s `origin`, `changedFields`' `schema`,\n * `RelationExecutor.exec`'s `preScoped`, `resolveLink`'s `operation`,\n * `assertPageArgument`'s reported name: where omitting an argument produces\n * a *worse* result rather than an error, `tsc` is the only thing that keeps\n * a convention. Ninety-five of a hundred call sites already passed one; the\n * five that did not are exactly the ones nobody revisited.\n *\n * `UnknownFieldError` and `UnknownRelationError` set the standard this\n * meets: both enumerate the valid names rather than only rejecting the\n * invalid one.\n */\n detail: string,\n ) {\n super(\n `gemi ORM does not support '${argument}' yet (${model}.${operation}). ` +\n detail,\n );\n this.name = \"UnsupportedQueryError\";\n }\n}\n\n/**\n * An argument the ORM has **decided not to implement**, as opposed to one it has\n * not implemented yet.\n *\n * The distinction is the whole point, and it is a distinction a caller can act\n * on: \"yet\" means wait for a release, \"will not\" means change the code. Sharing\n * one error for both meant `docs/orm.md` could list `omit` under *Not in scope*\n * while the runtime said \"yet\" — a contradiction a reader has no way to\n * resolve, and the one #68 exists to end.\n *\n * A subclass rather than a sibling, so `catch (e) { if (e instanceof\n * UnsupportedQueryError) … }` keeps working for callers that do not care which\n * kind it is.\n */\n/**\n * An argument the ORM **does** implement, given a value it cannot mean.\n *\n * The third category, and the one that made \"yet\" wrong four separate times —\n * #82, #88, #100 and #101 each corrected it at their own call site before #61\n * was found to own the problem. The taxonomy the three classes now draw:\n *\n * not implemented yet UnsupportedQueryError wait for a release\n * decided against UnsupportedByDesignError change the call (#78)\n * implemented, bad value InvalidArgumentError fix the value\n *\n * `take: \"-2\"` is the clearest case. `take` is implemented; `\"-2\"` is not a\n * take. Telling that caller the ORM \"does not support 'take' yet\" is wrong on\n * both halves — it does, and there is nothing to wait for — and it sends them\n * to a changelog when the fix is one character in their own code.\n *\n * **Extends `UnsupportedQueryError`**, so every existing `catch` and every test\n * asserting the base class keeps working. That is the same choice\n * `UnsupportedByDesignError` made, and it is what lets a taxonomy be added to a\n * shipped ORM without a breaking change: the specific classes are for the\n * reader, the base class is for the handler.\n *\n * **Where the taxonomy stops, and why it stops there.** An argument that is not\n * in the grammar at all keeps the base class and its \"yet\" — `{ nope: 1 }`\n * reports \"does not support 'nope' yet\". That is right for half of what reaches\n * that path and wrong for the other half: the same check refuses a typo and a\n * real Prisma argument this ORM has genuinely not implemented, and nothing at\n * that point can tell them apart. Splitting it would mean carrying Prisma's\n * full argument grammar per operation, which is a large amount of duplicated\n * schema for a small gain.\n *\n * What makes it tolerable is the sentence after it. Since #61's other half made\n * `detail` mandatory, that refusal always continues *\"findMany takes include,\n * omit, orderBy, select, skip, take, where\"* — so a caller who typed `nope`\n * learns it is not coming from the very next clause, without the class having\n * to know. Recorded here rather than left to be re-derived, because \"the third\n * class did not cover this one\" is the obvious first reading and it is not the\n * interesting part.\n */\nexport class InvalidArgumentError extends UnsupportedQueryError {\n constructor(\n argument: string,\n model: string,\n operation: string,\n /** What is wrong with the value, and what a good one looks like. */\n reason: string,\n ) {\n super(argument, model, operation, reason);\n this.name = \"InvalidArgumentError\";\n this.message = `Invalid '${argument}' (${model}.${operation}). ${reason}`;\n }\n}\n\nexport class UnsupportedByDesignError extends UnsupportedQueryError {\n constructor(\n argument: string,\n model: string,\n operation: string,\n /** What to use instead. Required — see #61: a refusal owes the caller a next step. */\n reason: string,\n ) {\n super(argument, model, operation, reason);\n this.name = \"UnsupportedByDesignError\";\n this.message =\n `gemi ORM does not implement '${argument}' (${model}.${operation}), ` +\n `and this is a decision rather than a gap. ${reason}`;\n }\n}\n\n/**\n * Thrown when an argument names something that is not a field on the model. A\n * `where` key with no matching field is an error, never a passthrough — that is\n * the rule that keeps user input out of the identifier positions in the SQL.\n */\nexport class UnknownFieldError extends Error {\n constructor(\n public readonly field: string,\n public readonly model: string,\n known: string[],\n ) {\n super(\n `'${field}' is not a field on model ${model}. ` +\n `Known fields: ${known.join(\", \")}.`,\n );\n this.name = \"UnknownFieldError\";\n }\n}\n\n/**\n * Thrown when a column holds something the generated schema says it cannot —\n * an unparseable timestamp, a fractional value in a `BigInt` column, malformed\n * JSON. Every dialect needs it, which is why it lives here rather than beside\n * one of them.\n *\n * It exists so those cases fail rather than decode into a plausible wrong\n * value: `new Date(\"nonsense\")` is an `Invalid Date`, not an error, and it\n * would travel a long way before anyone noticed.\n */\nexport class DecodeError extends Error {\n constructor(\n public readonly field: { column: string; type: string },\n public readonly value: unknown,\n ) {\n super(\n `Could not decode the value ${JSON.stringify(String(value))} from column ` +\n `'${field.column}' as ${field.type}. The column's contents do not match ` +\n `the Prisma schema — was it written by something other than Prisma or ` +\n `the gemi ORM?`,\n );\n this.name = \"DecodeError\";\n }\n}\n\n/**\n * Thrown by the `*OrThrow` operations when the query matched nothing. Prisma\n * raises `NotFoundError` / `P2025` for the same case; the differential harness\n * compares the fact of throwing, not the error type.\n */\nexport class RecordNotFoundError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n ) {\n super(`No ${model} found (${model}.${operation}).`);\n this.name = \"RecordNotFoundError\";\n }\n}\n\n/**\n * The dispatchers' test for a lookup that matched nothing and should be\n * answered with a 404.\n *\n * Matches the name as well as the class for the reason `isPolicyDeniedError`\n * and `isUniqueConstraintError` do: `instanceof` compares against *this*\n * module instance's class object, so a second copy of `gemi/orm` — two\n * versions in one dependency tree, a linked package beside a bundled one —\n * throws an error this would not recognise, and the request would go back to\n * being a 500 carrying the model's name in its body.\n *\n * The name is the identity here, so an application error that calls itself\n * `RecordNotFoundError` is deliberately matched too. That is the same bargain\n * the other two predicates make, and the failure it trades against — a 500\n * where a 404 was meant — is the worse one.\n */\nexport function isRecordNotFoundError(error: unknown): error is RecordNotFoundError {\n if (error instanceof RecordNotFoundError) return true;\n\n return (\n typeof error === \"object\" &&\n error !== null &&\n (error as { name?: unknown }).name === \"RecordNotFoundError\"\n );\n}\n\n/**\n * Thrown when a write violates a unique constraint.\n *\n * DECISION — gemi defines its own error rather than mirroring Prisma's codes.\n *\n * Prisma raises `PrismaClientKnownRequestError` with code `P2002` and\n * `meta.target` holding the field names. Mirroring that would ease a migration\n * for code already branching on `P2002`.\n *\n * **The premise this note used to rest on was wrong, and the conclusion is\n * unchanged.** It said \"nothing in this repository does (checked)\", which was\n * true of *this* repository and was never the question — the code that branches\n * on `P2002` lives in the applications the ORM is for. The first real port\n * measured four such guards, every one of them in concurrency-recovery code\n * (catch the collision, re-read, retry), and every one of them silently dead the\n * moment the write moved onto gemi: the `catch` still ran, the condition was\n * false, the recovery did not happen. Nor was the repository itself clean —\n * `templates/saas-starter/app/models/differential.ts:621` branches on `P2002`\n * today, and did when this was written.\n *\n * What the premise was doing was answering \"would anyone notice?\", and the\n * answer is that four people noticed at once. The decision never depended on it.\n * Carrying a `P` code implies the rest of the taxonomy is implemented too:\n * `P2003`, `P2025`, and the fifty others an application might reasonably then\n * expect to catch. Claiming a compatibility surface we have not built is worse\n * than asking the call sites that need it to catch a gemi error instead —\n * *especially* when the code in question is a retry loop, because a\n * compatibility surface that covers `P2002` and not `P2034` fails in exactly\n * the same silent way, one layer further in.\n *\n * A porter reaches for `isUniqueConstraintError` below. `UPGRADE.md` carries\n * the temporary `|| error.code === \"P2002\"` bridge, for a codebase halfway\n * through the move, with the marker that says when to delete it; it is\n * deliberately not exported, because a Prisma code in gemi's permanent surface\n * is the thing this note declined.\n *\n * What the contract does promise is the part that matters: the error is typed,\n * catchable, and names the fields — as *field* names, the way Prisma's\n * `meta.target` does, not as the database columns the driver reported.\n */\nexport class UniqueConstraintError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n /** Field names, mapped back through the schema from the driver's columns. */\n public readonly fields: string[],\n /** The constraint's own name, when the dialect reports one. */\n public readonly constraint?: string,\n options?: { cause?: unknown },\n ) {\n super(\n `Unique constraint violated on ${model}.${operation}` +\n (fields.length > 0 ? ` for ${fields.join(\", \")}` : \"\") +\n (constraint ? ` (constraint '${constraint}')` : \"\") +\n `. A ${model} with those values already exists.`,\n options,\n );\n this.name = \"UniqueConstraintError\";\n }\n}\n\n/**\n * The guard to write in a retry-on-collision `catch`, which is where a\n * `code === \"P2002\"` test almost always was:\n *\n * try {\n * return await Invite.create({ data: { token } })\n * } catch (error) {\n * if (!isUniqueConstraintError(error)) throw error\n * return await Invite.findUniqueOrThrow({ where: { token } })\n * }\n *\n * **Why this is worth shipping rather than telling people to write\n * `instanceof`**, which is the obvious objection and the reason it nearly was\n * not shipped. The second half of the test is the whole of it:\n *\n * error instanceof UniqueConstraintError || error.name === \"UniqueConstraintError\"\n *\n * `instanceof` compares against *this module instance's* class object, so it is\n * false across a duplicate copy of `gemi/orm` — two versions in one dependency\n * tree, a bundled build alongside a linked one, a monorepo package resolving\n * its own. The error is the right error, thrown by the right code, and the\n * guard silently does not fire. That is not a hypothetical: duck-typing rather\n * than importing the class is precisely what the ported application had already\n * done for Prisma's error, for precisely this reason, and shipping a predicate\n * that only does `instanceof` would hand it back the same trap under a new\n * name.\n *\n * So the name is load-bearing rather than a convenience: it is the identity\n * that survives module duplication, which is why every error in this file sets\n * `this.name` explicitly instead of relying on the class name surviving\n * minification.\n *\n * **The narrowing is a claim, and this is what it rests on.** The name branch\n * asserts `UniqueConstraintError` on the strength of a string — a second copy\n * of this module really does carry `model`, `operation` and `fields`, so the\n * claim holds for the case it exists for. An unrelated object named\n * `\"UniqueConstraintError\"` would defeat it, and that is not something that\n * happens by accident.\n *\n * **It deliberately does not match `code === \"P2002\"`.** See the DECISION\n * above: the temporary bridge for a half-ported codebase is in `UPGRADE.md`,\n * where it can carry a delete-me marker, rather than in gemi's permanent\n * surface, where it would have neither.\n */\nexport function isUniqueConstraintError(\n error: unknown,\n): error is UniqueConstraintError {\n if (error instanceof UniqueConstraintError) return true;\n\n return (\n typeof error === \"object\" &&\n error !== null &&\n (error as { name?: unknown }).name === \"UniqueConstraintError\"\n );\n}\n\n/**\n * Thrown when a write needs `RETURNING` and the dialect has none.\n *\n * Unreachable on SQLite and Postgres, which both support it. It exists so that\n * the MySQL / MariaDB path is a named gap rather than a wrong answer: the\n * fallback there is `lastInsertRowid` plus a re-select, which is a different\n * statement shape and is not implemented.\n */\nexport class ReturningUnsupportedError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n public readonly dialect: string,\n ) {\n super(\n `${model}.${operation} needs RETURNING to report its result, and the ` +\n `'${dialect}' dialect does not support it. The fallback — ` +\n `lastInsertRowid plus a re-select — is not implemented.`,\n );\n this.name = \"ReturningUnsupportedError\";\n }\n}\n\n/**\n * Thrown when a policy denies an operation.\n *\n * Two ways to get here, and the message distinguishes them because the fixes\n * are different: a policy's `before` returned false, or the model is policied\n * and there is no user in scope at all.\n *\n * The second is the deny-by-default rule, and it is the reason this error is\n * loud. A cron tick or a queue worker reading a policied model has no user, and\n * the alternative — treating \"no user\" as \"no policy\" — means the dangerous\n * case is the silent one: a request whose auth middleware was misconfigured\n * would read every tenant's rows rather than failing. So unscoped access is\n * always a decision written at the call site, through `Model.asSystem`.\n */\nexport class PolicyDeniedError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n public readonly reason: \"denied\" | \"no-user\" = \"denied\",\n ) {\n super(\n reason === \"no-user\"\n ? `${model}.${operation} is governed by a policy and there is no user ` +\n `in scope. If this is a cron tick, a queue worker or a script, say ` +\n `so at the call site: Model.asSystem(() => ...). Policies are ` +\n `never skipped just because a user failed to turn up.`\n : `${model}.${operation} was denied by ${model}'s policy.`,\n );\n this.name = \"PolicyDeniedError\";\n }\n}\n\n/**\n * The api dispatcher's test for a denial it should answer with a 403. It\n * matches the name as well as the class for the reason\n * `isUniqueConstraintError` does: a second copy of `gemi/orm` throws an error\n * that is not `instanceof` this class, and a denial that failed the test would\n * go back to being a 500 that carries the policy's message.\n */\nexport function isPolicyDeniedError(error: unknown): error is PolicyDeniedError {\n if (error instanceof PolicyDeniedError) return true;\n\n return (\n typeof error === \"object\" &&\n error !== null &&\n (error as { name?: unknown }).name === \"PolicyDeniedError\"\n );\n}\n\n/**\n * Thrown when an `update` writes to a column its own policy's `scope` selects on,\n * and the policy has no `onUpdate` saying what that should mean.\n *\n * The shape it catches:\n *\n * scope: (ctx) => ({ organizationId: ctx.user.organizationId })\n * // ...and then\n * User.update({ where: { id }, data: { organizationId: 999 } })\n *\n * The scope did its job — only rows in the caller's own tenant could be selected\n * — and the statement still hands one of them to another tenant. Afterwards the\n * row is outside the scope, so it cannot be read back and cannot be put right by\n * the same caller: a one-way door rather than a visible failure. The usual way in\n * is not malice but mass assignment, a handler forwarding request fields into\n * `data`.\n *\n * This is `assertCreateCovered`'s question asked of the other write. There it is\n * \"you scoped reads but never said what an insert means\"; here it is \"you scoped\n * reads but never said whether an update may move a row out\". Both are answered\n * by writing the hook, including when the answer is \"allow it\" —\n * `onUpdate: (_ctx, data) => data` is a complete and legitimate answer, and\n * saying it out loud is the point.\n *\n * **What it cannot see.** The scope-owned columns are read off the top level of\n * the fragment the policy returned, so `{ organizationId: 7 }` is understood and\n * `{ OR: [...] }` is not — a scope built from combinators is not attributed to\n * any column and an update through it is not checked. Narrowing that would mean\n * either interpreting arbitrary `where` grammar or refusing every update on such\n * a model, and neither is worth it: the guard is a rail on the common shape, not\n * a proof.\n */\nexport class ScopeEscapeError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n public readonly fields: readonly string[],\n ) {\n const named = fields.map((field) => `'${field}'`).join(\", \");\n super(\n `${model}.${operation} writes ${named}, which ${model}'s policy also ` +\n `scopes on — so this update can move a row outside the scope that ` +\n `selected it, where the caller can no longer read or repair it.\\n\\n` +\n `Add an onUpdate to that policy. It may reassert the column ` +\n `(data => ({ ...data, ${fields[0]}: ctx.user.${fields[0]} })), reject ` +\n `the write, or allow it explicitly with (_ctx, data) => data — all ` +\n `three are fine, and the point is that the policy says which.`,\n );\n this.name = \"ScopeEscapeError\";\n }\n}\n\n/**\n * Thrown when a model class carries policies but is not the class the registry\n * resolves its name to.\n *\n * This exists because of a cross-tenant leak that shipped past review. The\n * generated `index.ts` registers the *generated* base — `register(\"Account\",\n * AccountModel)` — while an application authors its policy on a subclass:\n *\n * export class Account extends AccountModel {\n * static $policies = [{ scope: (ctx) => ({ organizationId: … }) }]\n * }\n *\n * A root query goes through `Account`, so `policiesFor(this)` finds the policy\n * and the scope applies. A **nested** relation read resolves through the\n * registry, gets `AccountModel`, and walks a prototype chain the policy is not\n * on — so `User.findMany({ include: { accounts: true } })` returned every\n * tenant's accounts. Root queries scoped, nested reads unscoped: exactly the\n * Prisma behaviour policies exist to fix, and silent.\n *\n * Raised at the first query through the unregistered class, naming the one-line\n * fix, because the alternative is data crossing a tenant boundary with nothing\n * to notice it.\n *\n * It fires on a divergence in the resolved policy *chain*, not merely on the two\n * classes differing. A plain subclass that adds no policy of its own inherits\n * the same policy objects in the same order, so a nested read resolving to its\n * parent applies exactly what the root query applied — no divergence, nothing\n * to refuse. An earlier version compared class identity and rejected\n * `class AdminUser extends User {}` for policies it had not written.\n */\nexport class UnregisteredPolicyClassError extends Error {\n constructor(\n public readonly model: string,\n /**\n * Under `carries: \"narrowing\"` this is the *ancestor* — the class the model\n * belongs to — rather than whatever the registry currently holds. The two\n * classes are on one prototype chain there, and which of them is registered\n * is the thing in question, so naming them by their relationship is what\n * makes the message readable.\n */\n public readonly registered: string,\n /** Under `carries: \"narrowing\"`, the descendant: the view that narrows. */\n public readonly queried: string,\n /**\n * Which side carries the policies that would be skipped, and therefore what\n * the author should do about it. Three, because they need three different\n * answers: a missing registration, a query through the wrong class, and a\n * view that should not be competing for the name at all.\n */\n public readonly carries: \"queried\" | \"registered\" | \"narrowing\" = \"queried\",\n ) {\n super(\n carries === \"narrowing\"\n ? `${queried} extends ${registered}, which owns the model '${model}', ` +\n `and carries policies of its own on top of it. A class that ` +\n `narrows an existing model is a view, and the registry holds one ` +\n `class per name — so registering ${queried} would apply its ` +\n `narrowing to every nested read of ${model}, and leaving ` +\n `${registered} registered would skip ${queried}'s policies ` +\n `entirely. Neither is a thing to choose for you.\\n\\n` +\n `Keep the view out of the modules you hand to Kernel.models, and ` +\n `query it directly where you want it:\\n\\n` +\n ` ${queried}.findMany(…) // narrowed, at the call site\\n\\n` +\n `If it is not a view but the model itself, move the policies onto ` +\n `${registered} — the class the model's name resolves to — and ` +\n `${queried} inherits them everywhere.\\n`\n : carries === \"queried\"\n ? `${queried} carries policies but the registry resolves '${model}' to ` +\n `${registered}. Nested relation reads go through the registry, so ` +\n `they would run on ${registered} and skip every policy on ` +\n `${queried} — scoped at the root, unscoped inside an include. ` +\n `Register the class that carries the policy:\\n\\n` +\n ` import { register } from \"gemi/orm\"\\n` +\n ` export class ${queried} extends ${registered} { … }\\n` +\n ` register(\"${model}\", ${queried})\\n`\n : `This query goes through ${queried}, but the registry resolves ` +\n `'${model}' to ${registered}, which carries policies ${queried} ` +\n `does not. Nested relation reads would be scoped and this query is ` +\n `not — the same policy applying to some queries and not others. ` +\n `Query ${registered} instead:\\n\\n` +\n ` ${registered}.findMany(…)\\n\\n` +\n `If skipping policies is intended, say so at the call site — that ` +\n `is what Model.asSystem() is for, and it is the only way to do it ` +\n `that a reader can see.\\n`,\n );\n this.name = \"UnregisteredPolicyClassError\";\n }\n}\n\n/**\n * Thrown when a `$policies` array holds something that is not a usable policy.\n *\n * Every case it covers is refused today — by `tsc`, at the class declaration,\n * with `TS2417`, because `Model` declares `static $policies?: readonly\n * PolicyEntry[]` and `ModelPolicy`'s members are all optional, so a typo'd key\n * trips weak-type detection. This is therefore a guard on the paths that import\n * user code *without* having type-checked it: `registerModels` at boot, and\n * `gemi check models`, whose whole job is to find mistakes in a file somebody is\n * still writing.\n *\n * Two failures, and the second is the one that matters.\n *\n * **A function the ORM cannot get a policy out of.** `resolveEntry` instantiates\n * every function entry with no arguments, and there are two ways that goes\n * wrong. A factory nobody called — `softDeletes` rather than\n * `softDeletes({ field })` — is not constructable at all and reached `new entry`\n * to produce `TypeError: function is not a constructor`. A class that *is*\n * constructable and whose constructor wants an argument gets through that check\n * and dies inside its own body instead, with\n * `TypeError: undefined is not an object (evaluating 'opts.field')`. Both are\n * loud and neither named the model, the index or the file, which on a 79-model\n * app leaves the first question unanswered; the second is the case that survived\n * a first pass at this error, because \"constructable\" is a fact about\n * `[[Construct]]` and says nothing about what the constructor then does.\n *\n * **An entry with no recognised hook.** `{ scopes: … }` and\n * `{ default: { scope: … } }` were accepted in silence: `applyPolicies`\n * dispatches on `before` / `scope` / `onCreate` / `onUpdate` and\n * `applyRedaction` on `redact`, so an entry spelling none of them contributes\n * nothing. The model then carries a visible `$policies` array, passes\n * `gemi check models` as correctly registered, and **reads unscoped** — the same\n * written-believed-not-in-effect shape `UnregisteredPolicyClassError` exists\n * for, arriving through a typo instead of through the registry.\n *\n * The line between *empty but valid* and *malformed* is drawn at \"would this\n * ever run\": an entry with at least one recognised hook that is callable is\n * accepted whatever else it carries, because a factory's return value and a\n * policy class routinely hold configuration and helpers beside the hooks, and\n * refusing unknown *extra* keys would reject code that works. An entry with no\n * callable hook at all is refused, `{}` included — it is indistinguishable from\n * a policy that was meant to do something, and a conditional policy belongs in\n * the array rather than in the entry.\n */\nexport class InvalidPolicyEntryError extends Error {\n constructor(\n /**\n * The class whose **own** `$policies` array holds the entry — the class the\n * author wrote the array on, which is not necessarily the model being\n * queried when the array is on a base.\n */\n public readonly model: string,\n /** The entry's index in that array. */\n public readonly index: number,\n public readonly reason:\n | \"not-a-policy\"\n | \"not-constructable\"\n | \"constructor-threw\"\n | \"no-hooks\"\n | \"hook-not-callable\",\n /** What was found in the entry's place, rendered for a human. */\n public readonly found: string,\n /**\n * The hook names the runtime dispatches on, supplied by `policy.ts` so the\n * list lives beside the code that reads it rather than being restated here.\n */\n hooks: readonly string[],\n /**\n * A key the entry actually spells and the hook it is within one edit of.\n *\n * **The pair, not the hook alone.** An unattributed \"Did you mean `scope`?\"\n * after a list of five keys does not say which of them was read as a\n * misspelling, so a reader who can see that none of them are has no way to\n * dismiss it — and this error is about an authorization rule that is not in\n * effect, where a suggestion followed wrongly costs a rename of something\n * that was never the problem.\n */\n public readonly suggestion?: { key: string; hook: string },\n options?: { cause?: unknown },\n ) {\n const where = `${model}.$policies[${index}]`;\n const named =\n hooks.length > 1\n ? `${hooks.slice(0, -1).join(\", \")} or ${hooks[hooks.length - 1]}`\n : (hooks[0] ?? \"\");\n\n super(\n reason === \"not-a-policy\"\n ? `${where} is ${found}, which is not a policy. An entry is either a ` +\n `policy object — { scope, onCreate, … } — or a class the ORM ` +\n `constructs with no arguments.\\n\\n` +\n `A policy that only sometimes applies belongs in the array rather ` +\n `than in the entry:\\n\\n` +\n ` static $policies = [...(multiTenant ? [tenantScope] : [])]\\n`\n : reason === \"not-constructable\"\n ? `${where} is ${found}, and a function entry is instantiated with ` +\n `no arguments — so an arrow function, a plain function, or a ` +\n `factory that was never called cannot be one.\\n\\n` +\n `If it is a factory, call it:\\n\\n` +\n ` static $policies = [softDeletes({ field: \"deletedAt\" })]\\n`\n : reason === \"constructor-threw\"\n ? `${where} is ${found}\\n\\n` +\n `A class entry is constructed with no arguments. If this one ` +\n `needs some, construct it yourself and put the instance in the ` +\n `array:\\n\\n` +\n ` static $policies = [new TenantPolicy({ field: \"orgId\" })]\\n\\n` +\n `If the constructor reaches for something that is not ready yet, ` +\n `note that it runs on the first query through this model, not at ` +\n `boot.\\n`\n : reason === \"hook-not-callable\"\n ? `${where} has a ${found}, and every hook is called — so this ` +\n `would throw on the first query that reached it rather than ` +\n `doing whatever it was meant to do. Give it a function, or ` +\n `leave the key out.\\n`\n : `${where} has none of ${named}, so it would never run. The ` +\n `model carries a visible $policies array and nothing in it ` +\n `applies to any query — which for a scope means the model ` +\n `reads unscoped. ${found}` +\n (suggestion\n ? ` Is '${suggestion.key}' meant to be \\`${suggestion.hook}\\`?`\n : \"\") +\n `\\n`,\n options,\n );\n this.name = \"InvalidPolicyEntryError\";\n }\n}\n\n/**\n * Thrown when `registerModels` finds two unrelated classes in one module both\n * claiming the same model name.\n *\n * Deriving registration from a module namespace works because the candidates\n * are normally a chain — a generated base, the application's subclass, perhaps\n * a typed view over it — and a chain has a least element to elect. Two classes\n * that extend the same base without extending each other do not: both were\n * written for this model, and only the author knows which one nested reads\n * should run.\n *\n * Refused rather than guessed at, because both guesses are silent. Picking\n * either would scope every `include` of the model by one class's policies while\n * the other's code keeps reading as though its own applied.\n *\n * **\"In one module\" is the exact scope, and the asymmetry is deliberate.**\n * Election happens per module, so two unrelated claims split across *different*\n * modules never meet inside one — the later import simply wins. What catches\n * that is the audit at the end of `registerModels` rather than this error, and\n * only when the two diverge in policies. Two unrelated *unpolicied* claims on\n * one name resolve by import order and nothing reports it, which is tolerable\n * for the same reason it is invisible: with no policies on either, the choice\n * changes no query's scope.\n */\nexport class AmbiguousModelRegistrationError extends Error {\n constructor(\n public readonly model: string,\n public readonly candidates: readonly string[],\n ) {\n const named = candidates.map((candidate) => `'${candidate}'`).join(\", \");\n super(\n `Two classes in one module claim the model '${model}' — ${named} — and ` +\n `neither extends the other, so there is no way to tell which one ` +\n `nested relation reads should run.\\n\\n` +\n `Say which, and registerModels will leave it alone:\\n\\n` +\n ` import { register } from \"gemi/orm\"\\n` +\n ` register(\"${model}\", ${candidates[0]})\\n\\n` +\n `A class that is only a typed view over the same rows belongs in a ` +\n `module you do not hand to registerModels.`,\n );\n this.name = \"AmbiguousModelRegistrationError\";\n }\n}\n\n/**\n * Thrown when a statement would bind more parameters than the driver's wire\n * protocol can carry.\n *\n * Three shapes reach it, all of them scaling with the caller's *data* rather\n * than with the query's shape: `createMany` at `rows × columns`, an `in` list on\n * SQLite (one placeholder per element, and such a list is routinely\n * request-derived), and a to-many `include` on SQLite, which batches an `in`\n * over the parent keys. Both limits are hard and low enough to hit with an\n * ordinary import — Postgres counts parameters in an int16 (65535), SQLite\n * defaults `SQLITE_MAX_VARIABLE_NUMBER` to 32766. Postgres escapes the last two\n * either way: `= any($1)` is one parameter however long the array.\n *\n * Prisma chunks the insert automatically. Doing that here means several\n * statements, which without a transaction is a partially-applied `createMany`\n * on failure — so it waits for iteration 5, and until then this is a named gap\n * rather than a driver error naming neither the model nor the cause. Same\n * treatment as `ReturningUnsupportedError`, for the same reason.\n */\nexport class ParameterLimitError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n public readonly required: number,\n public readonly limit: number,\n public readonly dialect: string,\n detail: string,\n ) {\n super(\n `${model}.${operation} would bind ${required} parameters, and the ` +\n `'${dialect}' driver accepts at most ${limit} in one statement. ` +\n `${detail}` +\n (operation === \"createMany\"\n ? ` A createMany over the ceiling is normally split across statements ` +\n `inside one transaction, so reaching this means splitting cannot ` +\n `help: a single row binds more than the driver accepts.`\n : ` Splitting is not something this operation can do for you — one ` +\n `statement has to carry one answer. Narrow the query.`),\n );\n this.name = \"ParameterLimitError\";\n }\n}\n\n/**\n * Thrown when a write omits a column that has no value to fall back on: not\n * supplied, no client-side default, no database default, and not nullable.\n *\n * Raised in the compiler rather than left to the database so the message names\n * the field and the model, instead of surfacing as `NOT NULL constraint failed`\n * with a column name and no context.\n */\nexport class MissingRequiredValueError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n public readonly field: string,\n ) {\n super(\n `${model}.${operation} is missing a value for '${field}', which is ` +\n `required and has no default.`,\n );\n this.name = \"MissingRequiredValueError\";\n }\n}\n\n/**\n * Thrown when an `include` — or a relation-shaped key inside a `select` — names\n * something the model does not declare as a relation.\n */\nexport class UnknownRelationError extends Error {\n constructor(\n public readonly relation: string,\n public readonly model: string,\n known: string[],\n ) {\n super(\n `'${relation}' is not a relation on model ${model}. ` +\n (known.length > 0\n ? `Known relations: ${known.join(\", \")}.`\n : `${model} declares no relations.`),\n );\n this.name = \"UnknownRelationError\";\n }\n}\n\n/**\n * Thrown when an include tree nests deeper than the guard allows.\n *\n * A cyclic include is legal and finite — `user -> accounts -> user` terminates\n * because the caller wrote a finite tree. What this catches is an *unbounded*\n * one: an argument tree built by a loop, or forwarded from a request body, that\n * describes a thousand levels. Under the batched planner every level is at least\n * one query, so the guard is what stops a malformed argument from becoming a\n * self-inflicted denial of service.\n */\nexport class RelationDepthExceededError extends Error {\n constructor(\n public readonly model: string,\n public readonly limit: number,\n ) {\n super(\n `The include tree nests more than ${limit} relations deep (at model ` +\n `${model}). Deeply nested includes are legal, so this is a guard ` +\n `against a generated or malformed argument tree rather than a limit on ` +\n `modelling — every level costs at least one query.`,\n );\n this.name = \"RelationDepthExceededError\";\n }\n}\n\n/**\n * Thrown when a relation names a model the registry does not hold. Every\n * relation in a generated artifact was emitted from a model in the same\n * `schema.prisma`, so this can only mean the artifact and the registry disagree.\n */\nexport class UnregisteredRelationTargetError extends Error {\n constructor(\n public readonly model: string,\n public readonly relation: string,\n public readonly target: string,\n known: string[],\n ) {\n super(\n `${model}.${relation} points at model '${target}', which nothing has ` +\n `registered. The generated artifact and the registry disagree: re-run ` +\n `\\`prisma generate\\`, and check that app/models/generated/index.ts is ` +\n `imported. ` +\n (known.length > 0\n ? `Registered models: ${known.join(\", \")}.`\n : `Nothing is registered at all.`),\n );\n this.name = \"UnregisteredRelationTargetError\";\n }\n}\n\n/**\n * Thrown when a relation is registered on both sides but the two sides do not\n * describe a link the planner can follow: no matching `relationName` on the\n * other model, or a `from` / `to` naming a field that is not there. Like\n * `UnregisteredRelationTargetError`, it means a stale generated artifact — a\n * consistent one cannot produce it.\n */\nexport class MalformedRelationError extends Error {\n constructor(\n public readonly model: string,\n public readonly relation: string,\n detail: string,\n ) {\n super(\n `Cannot resolve how ${model}.${relation} joins: ${detail} This means ` +\n `app/models/generated is stale or hand-edited — re-run ` +\n `\\`prisma generate\\`.`,\n );\n this.name = \"MalformedRelationError\";\n }\n}\n\n/** Thrown when a relation resolves to a model name nothing registered. */\nexport class ModelNotRegisteredError extends Error {\n constructor(name: string, known: string[]) {\n super(\n `No model is registered under the name '${name}'. ` +\n (known.length > 0\n ? `Registered models: ${known.join(\", \")}.`\n : `Nothing is registered — is app/models/generated/index.ts imported?`),\n );\n this.name = \"ModelNotRegisteredError\";\n }\n}\n\n/** Thrown when a model class is used before the generator has given it a schema. */\nexport class MissingModelSchemaError extends Error {\n constructor(className: string) {\n super(\n `${className} has no $schema. Model subclasses must extend a generated ` +\n `base class from app/models/generated/models.ts.`,\n );\n this.name = \"MissingModelSchemaError\";\n }\n}\n\n/**\n * A `lock` asked for outside a transaction.\n *\n * A row lock is held until the transaction that took it ends. Outside one, the\n * statement is its own transaction, so the lock is released the moment the row\n * comes back — before the write it was meant to guard has even been issued. The\n * read would succeed and protect nothing, which is the failure this refuses: the\n * race the lock was written to close stays open, silently.\n *\n * Raised on SQLite too, where the lock itself compiles to nothing, so code that\n * forgot its transaction fails in development rather than first on Postgres.\n */\nexport class LockOutsideTransactionError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n ) {\n super(\n `${model}.${operation} was given 'lock' outside a transaction. A row ` +\n `lock lasts until the transaction that took it ends, so outside one it ` +\n `is released as soon as the row is read and protects nothing. Run the ` +\n `read and the writes it guards inside Model.transaction(async () => { ` +\n `... }).`,\n );\n this.name = \"LockOutsideTransactionError\";\n }\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AAQO,MAAM,UAA8B,KAAM,CAE7B,SACA,MACA,UAHlB,WAAW,CACO,EACA,EACA,EAsBhB,EACA,CACA,MACE,8BAA8B,WAAkB,KAAS,OACvD,CACJ,EA7BgB,gBACA,aACA,iBA4BhB,KAAK,KAAO,wBAEhB,CAuDO,MAAM,UAA6B,CAAsB,CAC9D,WAAW,CACT,EACA,EACA,EAEA,EACA,CACA,MAAM,EAAU,EAAO,EAAW,CAAM,EACxC,KAAK,KAAO,uBACZ,KAAK,QAAU,YAAY,OAAc,KAAS,OAAe,IAErE,CAEO,MAAM,UAAiC,CAAsB,CAClE,WAAW,CACT,EACA,EACA,EAEA,EACA,CACA,MAAM,EAAU,EAAO,EAAW,CAAM,EACxC,KAAK,KAAO,2BACZ,KAAK,QACH,gCAAgC,OAAc,KAAS,iDACV,IAEnD,CAOO,MAAM,UAA0B,KAAM,CAEzB,MACA,MAFlB,WAAW,CACO,EACA,EAChB,EACA,CACA,MACE,IAAI,8BAAkC,oBACnB,EAAM,KAAK,IAAI,IACpC,EAPgB,aACA,aAOhB,KAAK,KAAO,oBAEhB,CAYO,MAAM,UAAoB,KAAM,CAEnB,MACA,MAFlB,WAAW,CACO,EACA,EAChB,CACA,MACE,8BAA8B,KAAK,UAAU,OAAO,CAAK,CAAC,kBACpD,EAAM,cAAc,EAAM,4CAC9B,6EACA,eACJ,EARgB,aACA,aAQhB,KAAK,KAAO,cAEhB,CAOO,MAAM,UAA4B,KAAM,CAE3B,MACA,UAFlB,WAAW,CACO,EACA,EAChB,CACA,MAAM,MAAM,YAAgB,KAAS,KAAa,EAHlC,aACA,iBAGhB,KAAK,KAAO,sBAEhB,CAkBO,SAAS,CAAqB,CAAC,EAA8C,CAClF,GAAI,aAAiB,EAAqB,MAAO,GAEjD,OACE,OAAO,IAAU,UACjB,IAAU,MACT,EAA6B,OAAS,sBA4CpC,MAAM,UAA8B,KAAM,CAE7B,MACA,UAEA,OAEA,WANlB,WAAW,CACO,EACA,EAEA,EAEA,EAChB,EACA,CACA,MACE,iCAAiC,KAAS,KACvC,EAAO,OAAS,EAAI,QAAQ,EAAO,KAAK,IAAI,IAAM,KAClD,EAAa,iBAAiB,MAAiB,IAChD,OAAO,sCACT,CACF,EAdgB,aACA,iBAEA,cAEA,kBAUhB,KAAK,KAAO,wBAEhB,CA8CO,SAAS,CAAuB,CACrC,EACgC,CAChC,GAAI,aAAiB,EAAuB,MAAO,GAEnD,OACE,OAAO,IAAU,UACjB,IAAU,MACT,EAA6B,OAAS,wBAYpC,MAAM,UAAkC,KAAM,CAEjC,MACA,UACA,QAHlB,WAAW,CACO,EACA,EACA,EAChB,CACA,MACE,GAAG,KAAS,oDACN,uDACJ,6DACJ,EARgB,aACA,iBACA,eAOhB,KAAK,KAAO,4BAEhB,CAgBO,MAAM,UAA0B,KAAM,CAEzB,MACA,UACA,OAHlB,WAAW,CACO,EACA,EACA,EAA+B,SAC/C,CACA,MACE,IAAW,UACP,GAAG,KAAS,qOAIZ,GAAG,KAAS,mBAA2B,aAC7C,EAXgB,aACA,iBACA,cAUhB,KAAK,KAAO,oBAEhB,CASO,SAAS,CAAmB,CAAC,EAA4C,CAC9E,GAAI,aAAiB,EAAmB,MAAO,GAE/C,OACE,OAAO,IAAU,UACjB,IAAU,MACT,EAA6B,OAAS,oBAoCpC,MAAM,UAAyB,KAAM,CAExB,MACA,UACA,OAHlB,WAAW,CACO,EACA,EACA,EAChB,CACA,IAAM,EAAQ,EAAO,IAAI,CAAC,IAAU,IAAI,IAAQ,EAAE,KAAK,IAAI,EAC3D,MACE,GAAG,KAAS,YAAoB,YAAgB,mBAC9C,yEACA;AAAA;AAAA,kFAEwB,EAAO,gBAAgB,EAAO,kBACtD,0EACA,8DACJ,EAbgB,aACA,iBACA,cAYhB,KAAK,KAAO,mBAEhB,CAgCO,MAAM,UAAqC,KAAM,CAEpC,MAQA,WAEA,QAOA,QAlBlB,WAAW,CACO,EAQA,EAEA,EAOA,EAAkD,UAClE,CACA,MACE,IAAY,YACR,GAAG,aAAmB,4BAAqC,kIAGzD,wCAAkC,uDACG,kBAClC,2BAAoC;AAAA;AAAA;AAAA;AAAA,MAIhC;AAAA;AAAA,EACP,oEACG,8DACH,GAAG;AAAA,EACL,IAAY,UACV,GAAG,iDAAuD,SACvD,0EACkB,8BAClB,4DACH;AAAA;AAAA;AAAA,mBAEoB,aAAmB;AAAA,EACvC,iBAAiB,OAAW;AAAA,EAC5B,2BAA2B,iCACvB,SAAa,6BAAsC,uEAEvD,uEACA,SAAS;AAAA;AAAA,MACF;AAAA;AAAA,EACP,yEACA;AAAA,CAER,EApDgB,aAQA,kBAEA,eAOA,eAoChB,KAAK,KAAO,+BAEhB,CA8CO,MAAM,UAAgC,KAAM,CAO/B,MAEA,MACA,OAOA,MAgBA,WAhClB,WAAW,CAMO,EAEA,EACA,EAOA,EAKhB,EAWgB,EAChB,EACA,CACA,IAAM,EAAQ,GAAG,eAAmB,KAC9B,EACJ,EAAM,OAAS,EACX,GAAG,EAAM,MAAM,EAAG,EAAE,EAAE,KAAK,IAAI,QAAQ,EAAM,EAAM,OAAS,KAC3D,EAAM,IAAM,GAEnB,MACE,IAAW,eACP,GAAG,QAAY,kDACb,8EACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAIF,IAAW,oBACT,GAAG,QAAY,gDACf,oEACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAGA,IAAW,oBACT,GAAG,QAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQf,IAAW,oBACT,GAAG,WAAe,8CAClB;AAAA,EAGA,GAAG,iBAAqB,2FAExB,iEACA,mBAAmB,KAClB,EACG,QAAQ,EAAW,sBAAsB,EAAW,UACpD,IACJ;AAAA,EACV,CACF,EAxEgB,aAEA,aACA,cAOA,aAgBA,kBA+ChB,KAAK,KAAO,0BAEhB,CA0BO,MAAM,UAAwC,KAAM,CAEvC,MACA,WAFlB,WAAW,CACO,EACA,EAChB,CACA,IAAM,EAAQ,EAAW,IAAI,CAAC,IAAc,IAAI,IAAY,EAAE,KAAK,IAAI,EACvE,MACE,8CAA8C,aAAW,gBACvD;AAAA;AAAA;AAAA;AAAA;AAAA,gBAIiB,OAAW,EAAW;AAAA;AAAA,4GAG3C,EAbgB,aACA,kBAahB,KAAK,KAAO,kCAEhB,CAqBO,MAAM,UAA4B,KAAM,CAE3B,MACA,UACA,SACA,MACA,QALlB,WAAW,CACO,EACA,EACA,EACA,EACA,EAChB,EACA,CACA,MACE,GAAG,KAAS,gBAAwB,0BAC9B,6BAAmC,uBACpC,KACF,IAAc,aACX,4LAGA,wEACA,uDACR,EAjBgB,aACA,iBACA,gBACA,aACA,eAchB,KAAK,KAAO,sBAEhB,CAUO,MAAM,UAAkC,KAAM,CAEjC,MACA,UACA,MAHlB,WAAW,CACO,EACA,EACA,EAChB,CACA,MACE,GAAG,KAAS,6BAAqC,2CAEnD,EAPgB,aACA,iBACA,aAMhB,KAAK,KAAO,4BAEhB,CAMO,MAAM,UAA6B,KAAM,CAE5B,SACA,MAFlB,WAAW,CACO,EACA,EAChB,EACA,CACA,MACE,IAAI,iCAAwC,OACzC,EAAM,OAAS,EACZ,oBAAoB,EAAM,KAAK,IAAI,KACnC,GAAG,2BACX,EATgB,gBACA,aAShB,KAAK,KAAO,uBAEhB,CAYO,MAAM,UAAmC,KAAM,CAElC,MACA,MAFlB,WAAW,CACO,EACA,EAChB,CACA,MACE,oCAAoC,8BAC/B,kIAEH,wDACJ,EARgB,aACA,aAQhB,KAAK,KAAO,6BAEhB,CAOO,MAAM,UAAwC,KAAM,CAEvC,MACA,SACA,OAHlB,WAAW,CACO,EACA,EACA,EAChB,EACA,CACA,MACE,GAAG,KAAS,sBAA6B,8KAItC,EAAM,OAAS,EACZ,sBAAsB,EAAM,KAAK,IAAI,KACrC,gCACR,EAbgB,aACA,gBACA,cAYhB,KAAK,KAAO,kCAEhB,CASO,MAAM,UAA+B,KAAM,CAE9B,MACA,SAFlB,WAAW,CACO,EACA,EAChB,EACA,CACA,MACE,sBAAsB,KAAS,YAAmB,gBAChD,8DACA,oBACJ,EARgB,aACA,gBAQhB,KAAK,KAAO,yBAEhB,CAGO,MAAM,UAAgC,KAAM,CACjD,WAAW,CAAC,EAAc,EAAiB,CACzC,MACE,0CAA0C,QACvC,EAAM,OAAS,EACZ,sBAAsB,EAAM,KAAK,IAAI,KACrC,0EACR,EACA,KAAK,KAAO,0BAEhB,CAGO,MAAM,UAAgC,KAAM,CACjD,WAAW,CAAC,EAAmB,CAC7B,MACE,GAAG,4GAEL,EACA,KAAK,KAAO,0BAEhB,CAcO,MAAM,UAAoC,KAAM,CAEnC,MACA,UAFlB,WAAW,CACO,EACA,EAChB,CACA,MACE,GAAG,KAAS,yQAKd,EATgB,aACA,iBAShB,KAAK,KAAO,8BAEhB",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "02F9E26370CF4E2364756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{P as ye}from"./chunk-
|
|
2
|
+
import{P as ye}from"./chunk-njpnstck.js";import{W as Ze,X as Te}from"./chunk-6fr6j338.js";import{Z as en}from"./chunk-j5g7qc5f.js";import{$ as At}from"./chunk-0eamc2tr.js";import{la as Hi}from"./chunk-k2xeskp6.js";import{bl as _,el as D}from"./chunk-rnp5k8m3.js";var Rt=_((Gs)=>{var Pt=At(),Xs=(e)=>e[Pt.SMITHY_CONTEXT_KEY]||(e[Pt.SMITHY_CONTEXT_KEY]={}),Zs=(e)=>{if(typeof e==="function")return e;let t=Promise.resolve(e);return()=>t};Gs.getSmithyContext=Xs;Gs.normalizeProvider=Zs});var It=_((rn)=>{var Ut=en(),tn=(e)=>{if(typeof e==="object"){if("url"in e){let t=Ut.parseUrl(e.url);if(e.headers){t.headers={};for(let[r,s]of Object.entries(e.headers))t.headers[r.toLowerCase()]=s.join(", ")}return t}return e}return Ut.parseUrl(e)};rn.toEndpointV1=tn});var Qe=_((wn)=>{var nn=ye(),Dt=Rt(),on=It(),de=(e)=>{if(typeof e==="function")return e();return e},Ye=(e,t,r,s,n)=>({name:t,namespace:e,traits:r,input:s,output:n}),cn=(e)=>(t,r)=>async(s)=>{let{response:n}=await t(s),{operationSchema:o}=Dt.getSmithyContext(r),[,i,c,a,l,d]=o??[];try{let f=await e.protocol.deserializeResponse(Ye(i,c,a,l,d),{...e,...r},n);return{response:n,output:f}}catch(f){if(Object.defineProperty(f,"$response",{value:n,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in f)){try{f.message+=`
|
|
3
3
|
Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`}catch(h){if(!r.logger||r.logger?.constructor?.name==="NoOpLogger")console.warn("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.");else r.logger?.warn?.("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.")}if(typeof f.$responseBodyText<"u"){if(f.$response)f.$response.body=f.$responseBodyText}try{if(nn.HttpResponse.isInstance(n)){let{headers:h={}}=n,p=Object.entries(h);f.$metadata={httpStatusCode:n.statusCode,requestId:Je(/^x-[\w-]+-request-?id$/,p),extendedRequestId:Je(/^x-[\w-]+-id-2$/,p),cfId:Je(/^x-[\w-]+-cf-id$/,p)}}}catch(h){}}throw f}},Je=(e,t)=>{return(t.find(([r])=>{return r.match(e)})||[void 0,void 0])[1]},an=(e)=>(t,r)=>async(s)=>{let{operationSchema:n}=Dt.getSmithyContext(r),[,o,i,c,a,l]=n??[],d=r.endpointV2?async()=>on.toEndpointV1(r.endpointV2):e.endpoint,f=await e.protocol.serializeRequest(Ye(o,i,c,a,l),s.input,{...e,...r,endpoint:d});return t({...s,request:f})},Bt={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Lt={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function fn(e){return{applyToStack:(t)=>{t.add(an(e),Lt),t.add(cn(e),Bt),e.protocol.setSerdeContext(e)}}}class A{name;namespace;traits;static assign(e,t){return Object.assign(e,t)}static[Symbol.hasInstance](e){let t=this.prototype.isPrototypeOf(e);if(!t&&typeof e==="object"&&e!==null)return e.symbol===this.symbol;return t}getName(){return this.namespace+"#"+this.name}}class be extends A{static symbol=Symbol.for("@smithy/lis");name;traits;valueSchema;symbol=be.symbol}var un=(e,t,r,s)=>A.assign(new be,{name:t,namespace:e,traits:r,valueSchema:s});class we extends A{static symbol=Symbol.for("@smithy/map");name;traits;keySchema;valueSchema;symbol=we.symbol}var hn=(e,t,r,s,n)=>A.assign(new we,{name:t,namespace:e,traits:r,keySchema:s,valueSchema:n});class ge extends A{static symbol=Symbol.for("@smithy/ope");name;traits;input;output;symbol=ge.symbol}var dn=(e,t,r,s,n)=>A.assign(new ge,{name:t,namespace:e,traits:r,input:s,output:n});class re extends A{static symbol=Symbol.for("@smithy/str");name;traits;memberNames;memberList;symbol=re.symbol}var ln=(e,t,r,s,n)=>A.assign(new re,{name:t,namespace:e,traits:r,memberNames:s,memberList:n});class _e extends re{static symbol=Symbol.for("@smithy/err");ctor;symbol=_e.symbol}var pn=(e,t,r,s,n,o)=>A.assign(new _e,{name:t,namespace:e,traits:r,memberNames:s,memberList:n,ctor:null}),le=[];function te(e){if(typeof e==="object")return e;if(e=e|0,le[e])return le[e];let t={},r=0;for(let s of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])if((e>>r++&1)===1)t[s]=1;return le[e]=t}var K={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},pe=[],me={};class q{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=q.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,t){this.ref=e,this.memberName=t;let r=[],s=e,n=e;this._isMemberSchema=!1;while(ve(s))r.push(s[1]),s=s[0],n=de(s),this._isMemberSchema=!0;if(r.length>0){this.memberTraits={};for(let o=r.length-1;o>=0;--o){let i=r[o];Object.assign(this.memberTraits,te(i))}}else this.memberTraits=0;if(n instanceof q){let o=this.memberTraits;Object.assign(this,n),this.memberTraits=Object.assign({},o,n.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=t??n.memberName;return}if(this.schema=de(n),Nt(this.schema))this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3];else this.name=this.memberName??String(n),this.traits=0;if(this._isMemberSchema&&!t)throw Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){let t=this.prototype.isPrototypeOf(e);if(!t&&typeof e==="object"&&e!==null)return e.symbol===this.symbol;return t}static of(e){let t=typeof e==="function"||typeof e==="object"&&e!==null;if(typeof e==="number"){if(pe[e])return pe[e]}else if(typeof e==="string"){if(me[e])return me[e]}else if(t){if(e[K.ns])return e[K.ns]}let r=de(e);if(r instanceof q)return r;if(ve(r)){let[n,o]=r;if(n instanceof q)return Object.assign(n.getMergedTraits(),te(o)),n;throw Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}let s=new q(r);if(t)return e[K.ns]=s;if(typeof r==="string")return me[r]=s;if(typeof r==="number")return pe[r]=s;return s}getSchema(){let e=this.schema;if(Array.isArray(e)&&e[0]===0)return e[4];return e}getName(e=!1){let{name:t}=this;return!e&&t&&t.includes("#")?t.split("#")[1]:t||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){let e=this.getSchema();return typeof e==="number"?e>=64&&e<128:e[0]===1}isMapSchema(){let e=this.getSchema();return typeof e==="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){let e=this.getSchema();if(typeof e!=="object")return!1;let t=e[0];return t===3||t===-3||t===4}isUnionSchema(){let e=this.getSchema();if(typeof e!=="object")return!1;return e[0]===4}isBlobSchema(){let e=this.getSchema();return e===21||e===42}isTimestampSchema(){let e=this.getSchema();return typeof e==="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){let{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return te(this.memberTraits)}getOwnTraits(){return te(this.traits)}getKeySchema(){let[e,t]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!t)throw Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);let r=this.getSchema(),s=e?15:r[4]??0;return ee([s,0],"key")}getValueSchema(){let e=this.getSchema(),[t,r,s]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],n=typeof e==="number"?63&e:e&&typeof e==="object"&&(r||s)?e[3+e[0]]:t?15:void 0;if(n!=null)return ee([n,0],r?"value":"member");throw Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){let t=this.getSchema();if(this.isStructSchema()&&t[4].includes(e)){let r=t[4].indexOf(e),s=t[5][r];return ee(ve(s)?s:[s,0],e)}if(this.isDocumentSchema())return ee([15,0],e);throw Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){let e={};try{for(let[t,r]of this.structIterator())e[t]=r}catch(t){}return e}getEventStreamMember(){if(this.isStructSchema()){for(let[e,t]of this.structIterator())if(t.isStreaming()&&t.isStructSchema())return e}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw Error("@smithy/core/schema - cannot iterate non-struct schema.");let e=this.getSchema(),t=e[4].length,r=e[K.it];if(r&&t===r.length){yield*r;return}r=Array(t);for(let s=0;s<t;++s){let n=e[4][s],o=ee([e[5][s],0],n);yield r[s]=[n,o]}e[K.it]=r}}function ee(e,t){if(e instanceof q)return Object.assign(e,{memberName:t,_isMemberSchema:!0});return new q(e,t)}var ve=(e)=>Array.isArray(e)&&e.length===2,Nt=(e)=>Array.isArray(e)&&e.length>=5;class se extends A{static symbol=Symbol.for("@smithy/sim");name;schemaRef;traits;symbol=se.symbol}var mn=(e,t,r,s)=>A.assign(new se,{name:t,namespace:e,traits:s,schemaRef:r}),yn=(e,t,r,s)=>A.assign(new se,{name:t,namespace:e,traits:r,schemaRef:s}),bn={BLOB:21,STREAMING_BLOB:42,BOOLEAN:2,STRING:0,NUMERIC:1,BIG_INTEGER:17,BIG_DECIMAL:19,DOCUMENT:15,TIMESTAMP_DEFAULT:4,TIMESTAMP_DATE_TIME:5,TIMESTAMP_HTTP_DATE:6,TIMESTAMP_EPOCH_SECONDS:7,LIST_MODIFIER:64,MAP_MODIFIER:128};class N{namespace;schemas;exceptions;static registries=new Map;constructor(e,t=new Map,r=new Map){this.namespace=e,this.schemas=t,this.exceptions=r}static for(e){if(!N.registries.has(e))N.registries.set(e,new N(e));return N.registries.get(e)}copyFrom(e){let{schemas:t,exceptions:r}=this;for(let[s,n]of e.schemas)if(!t.has(s))t.set(s,n);for(let[s,n]of e.exceptions)if(!r.has(s))r.set(s,n)}register(e,t){let r=this.normalizeShapeId(e);for(let s of[this,N.for(r.split("#")[0])])s.schemas.set(r,t)}getSchema(e){let t=this.normalizeShapeId(e);if(!this.schemas.has(t))throw Error(`@smithy/core/schema - schema not found for ${t}`);return this.schemas.get(t)}registerError(e,t){let r=e,s=r[1];for(let n of[this,N.for(s)])n.schemas.set(s+"#"+r[2],r),n.exceptions.set(r,t)}getErrorCtor(e){let t=e;if(this.exceptions.has(t))return this.exceptions.get(t);return N.for(t[1]).exceptions.get(t)}getBaseException(){for(let e of this.exceptions.keys())if(Array.isArray(e)){let[,t,r]=e,s=t+"#"+r;if(s.startsWith("smithy.ts.sdk.synthetic.")&&s.endsWith("ServiceException"))return e}return}find(e){return[...this.schemas.values()].find(e)}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){if(e.includes("#"))return e;return this.namespace+"#"+e}}wn.ErrorSchema=_e;wn.ListSchema=be;wn.MapSchema=we;wn.NormalizedSchema=q;wn.OperationSchema=ge;wn.SCHEMA=bn;wn.Schema=A;wn.SimpleSchema=se;wn.StructureSchema=re;wn.TypeRegistry=N;wn.deref=de;wn.deserializerMiddlewareOption=Bt;wn.error=pn;wn.getSchemaSerdePlugin=fn;wn.isStaticSchema=Nt;wn.list=un;wn.map=hn;wn.op=dn;wn.operation=Ye;wn.serializerMiddlewareOption=Lt;wn.sim=mn;wn.simAdapter=yn;wn.simpleSchemaCacheN=pe;wn.simpleSchemaCacheS=me;wn.struct=ln;wn.traitsCache=le;wn.translateTraits=te});var Ct=_((vn)=>{var W=(e,t)=>{let r=[];if(e)r.push(e);if(t)for(let s of t)r.push(s);return r},z=(e,t)=>{return`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`},Xe=()=>{let e=[],t=[],r=!1,s=new Set,n=(f)=>f.sort((u,h)=>qt[h.step]-qt[u.step]||jt[h.priority||"normal"]-jt[u.priority||"normal"]),o=(f)=>{let u=!1,h=(p)=>{let b=W(p.name,p.aliases);if(b.includes(f)){u=!0;for(let y of b)s.delete(y);return!1}return!0};return e=e.filter(h),t=t.filter(h),u},i=(f)=>{let u=!1,h=(p)=>{if(p.middleware===f){u=!0;for(let b of W(p.name,p.aliases))s.delete(b);return!1}return!0};return e=e.filter(h),t=t.filter(h),u},c=(f)=>{return e.forEach((u)=>{f.add(u.middleware,{...u})}),t.forEach((u)=>{f.addRelativeTo(u.middleware,{...u})}),f.identifyOnResolve?.(d.identifyOnResolve()),f},a=(f)=>{let u=[];return f.before.forEach((h)=>{if(h.before.length===0&&h.after.length===0)u.push(h);else u.push(...a(h))}),u.push(f),f.after.reverse().forEach((h)=>{if(h.before.length===0&&h.after.length===0)u.push(h);else u.push(...a(h))}),u},l=(f=!1)=>{let u=[],h=[],p={};return e.forEach((y)=>{let m={...y,before:[],after:[]};for(let w of W(m.name,m.aliases))p[w]=m;u.push(m)}),t.forEach((y)=>{let m={...y,before:[],after:[]};for(let w of W(m.name,m.aliases))p[w]=m;h.push(m)}),h.forEach((y)=>{if(y.toMiddleware){let m=p[y.toMiddleware];if(m===void 0){if(f)return;throw Error(`${y.toMiddleware} is not found when adding ${z(y.name,y.aliases)} middleware ${y.relation} ${y.toMiddleware}`)}if(y.relation==="after")m.after.push(y);if(y.relation==="before")m.before.push(y)}}),n(u).map(a).reduce((y,m)=>{return y.push(...m),y},[])},d={add:(f,u={})=>{let{name:h,override:p,aliases:b}=u,y={step:"initialize",priority:"normal",middleware:f,...u},m=W(h,b);if(m.length>0){if(m.some((w)=>s.has(w))){if(!p)throw Error(`Duplicate middleware name '${z(h,b)}'`);for(let w of m){let S=e.findIndex((O)=>O.name===w||O.aliases?.some((I)=>I===w));if(S===-1)continue;let g=e[S];if(g.step!==y.step||y.priority!==g.priority)throw Error(`"${z(g.name,g.aliases)}" middleware with ${g.priority} priority in ${g.step} step cannot be overridden by "${z(h,b)}" middleware with ${y.priority} priority in ${y.step} step.`);e.splice(S,1)}}for(let w of m)s.add(w)}e.push(y)},addRelativeTo:(f,u)=>{let{name:h,override:p,aliases:b}=u,y={middleware:f,...u},m=W(h,b);if(m.length>0){if(m.some((w)=>s.has(w))){if(!p)throw Error(`Duplicate middleware name '${z(h,b)}'`);for(let w of m){let S=t.findIndex((O)=>O.name===w||O.aliases?.some((I)=>I===w));if(S===-1)continue;let g=t[S];if(g.toMiddleware!==y.toMiddleware||g.relation!==y.relation)throw Error(`"${z(g.name,g.aliases)}" middleware ${g.relation} "${g.toMiddleware}" middleware cannot be overridden by "${z(h,b)}" middleware ${y.relation} "${y.toMiddleware}" middleware.`);t.splice(S,1)}}for(let w of m)s.add(w)}t.push(y)},clone:()=>c(Xe()),use:(f)=>{f.applyToStack(d)},remove:(f)=>{if(typeof f==="string")return o(f);else return i(f)},removeByTag:(f)=>{let u=!1,h=(p)=>{let{tags:b,name:y,aliases:m}=p;if(b&&b.includes(f)){let w=W(y,m);for(let S of w)s.delete(S);return u=!0,!1}return!0};return e=e.filter(h),t=t.filter(h),u},concat:(f)=>{let u=c(Xe());return u.use(f),u.identifyOnResolve(r||u.identifyOnResolve()||(f.identifyOnResolve?.()??!1)),u},applyToStack:c,identify:()=>{return l(!0).map((f)=>{let u=f.step??f.relation+" "+f.toMiddleware;return z(f.name,f.aliases)+" - "+u})},identifyOnResolve(f){if(typeof f==="boolean")r=f;return r},resolve:(f,u)=>{for(let h of l().map((p)=>p.middleware).reverse())f=h(f,u);if(r)console.log(d.identify());return f}};return d},qt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},jt={high:3,normal:2,low:1};vn.constructStack=Xe});var zt=_((Ft)=>{Object.defineProperty(Ft,"__esModule",{value:!0});Ft.fromBase64=void 0;var Qn=Ze(),Xn=/^[A-Za-z0-9+/]*={0,2}$/,Zn=(e)=>{if(e.length*3%4!==0)throw TypeError("Incorrect padding on base64 string.");if(!Xn.exec(e))throw TypeError("Invalid base64 string.");let t=(0,Qn.fromString)(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};Ft.fromBase64=Zn});var Jt=_((Wt)=>{Object.defineProperty(Wt,"__esModule",{value:!0});Wt.toBase64=void 0;var Gn=Ze(),Vn=Te(),Kn=(e)=>{let t;if(typeof e==="string")t=(0,Vn.fromUtf8)(e);else t=e;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return(0,Gn.fromArrayBuffer)(t.buffer,t.byteOffset,t.byteLength).toString("base64")};Wt.toBase64=Kn});var k=_((j)=>{var Ee=zt(),Se=Jt();Object.prototype.hasOwnProperty.call(Ee,"__proto__")&&!Object.prototype.hasOwnProperty.call(j,"__proto__")&&Object.defineProperty(j,"__proto__",{enumerable:!0,value:Ee.__proto__});Object.keys(Ee).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(j,e))j[e]=Ee[e]});Object.prototype.hasOwnProperty.call(Se,"__proto__")&&!Object.prototype.hasOwnProperty.call(j,"__proto__")&&Object.defineProperty(j,"__proto__",{enumerable:!0,value:Se.__proto__});Object.keys(Se).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(j,e))j[e]=Se[e]})});var Ge=_((Yt)=>{Object.defineProperty(Yt,"__esModule",{value:!0});Yt.ChecksumStream=void 0;var eo=k(),to=D("stream");class vt extends to.Duplex{expectedChecksum;checksumSourceLocation;checksum;source;base64Encoder;pendingCallback=null;constructor({expectedChecksum:e,checksum:t,source:r,checksumSourceLocation:s,base64Encoder:n}){super();if(typeof r.pipe==="function")this.source=r;else throw Error(`@smithy/util-stream: unsupported source type ${r?.constructor?.name??r} in ChecksumStream.`);this.base64Encoder=n??eo.toBase64,this.expectedChecksum=e,this.checksum=t,this.checksumSourceLocation=s,this.source.pipe(this)}_read(e){if(this.pendingCallback){let t=this.pendingCallback;this.pendingCallback=null,t()}}_write(e,t,r){try{if(this.checksum.update(e),!this.push(e)){this.pendingCallback=r;return}}catch(s){return r(s)}return r()}async _final(e){try{let t=await this.checksum.digest(),r=this.base64Encoder(t);if(this.expectedChecksum!==r)return e(Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${r}" in response header "${this.checksumSourceLocation}".`))}catch(t){return e(t)}return this.push(null),e()}}Yt.ChecksumStream=vt});var C=_((Xt)=>{Object.defineProperty(Xt,"__esModule",{value:!0});Xt.isBlob=Xt.isReadableStream=void 0;var ro=(e)=>typeof ReadableStream==="function"&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream);Xt.isReadableStream=ro;var so=(e)=>{return typeof Blob==="function"&&(e?.constructor?.name===Blob.name||e instanceof Blob)};Xt.isBlob=so});var er=_((Vt)=>{Object.defineProperty(Vt,"__esModule",{value:!0});Vt.ChecksumStream=void 0;var oo=typeof ReadableStream==="function"?ReadableStream:function(){};class Gt extends oo{}Vt.ChecksumStream=Gt});var sr=_((tr)=>{Object.defineProperty(tr,"__esModule",{value:!0});tr.createChecksumStream=void 0;var io=k(),co=C(),ao=er(),fo=({expectedChecksum:e,checksum:t,source:r,checksumSourceLocation:s,base64Encoder:n})=>{if(!(0,co.isReadableStream)(r))throw Error(`@smithy/util-stream: unsupported source type ${r?.constructor?.name??r} in ChecksumStream.`);let o=n??io.toBase64;if(typeof TransformStream!=="function")throw Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let i=new TransformStream({start(){},async transform(a,l){t.update(a),l.enqueue(a)},async flush(a){let l=await t.digest(),d=o(l);if(e!==d){let f=Error(`Checksum mismatch: expected "${e}" but received "${d}" in response header "${s}".`);a.error(f)}else a.terminate()}});r.pipeThrough(i);let c=i.readable;return Object.setPrototypeOf(c,ao.ChecksumStream.prototype),c};tr.createChecksumStream=fo});var or=_((nr)=>{Object.defineProperty(nr,"__esModule",{value:!0});nr.createChecksumStream=po;var uo=C(),ho=Ge(),lo=sr();function po(e){if(typeof ReadableStream==="function"&&(0,uo.isReadableStream)(e.source))return(0,lo.createChecksumStream)(e);return new ho.ChecksumStream(e)}});var Ve=_((cr)=>{Object.defineProperty(cr,"__esModule",{value:!0});cr.ByteArrayCollector=void 0;class ir{allocByteArray;byteLength=0;byteArrays=[];constructor(e){this.allocByteArray=e}push(e){this.byteArrays.push(e),this.byteLength+=e.byteLength}flush(){if(this.byteArrays.length===1){let r=this.byteArrays[0];return this.reset(),r}let e=this.allocByteArray(this.byteLength),t=0;for(let r=0;r<this.byteArrays.length;++r){let s=this.byteArrays[r];e.set(s,t),t+=s.byteLength}return this.reset(),e}reset(){this.byteArrays=[],this.byteLength=0}}cr.ByteArrayCollector=ir});var pr=_((dr)=>{Object.defineProperty(dr,"__esModule",{value:!0});dr.createBufferedReadable=void 0;dr.createBufferedReadableStream=fr;dr.merge=ur;dr.flush=xe;dr.sizeOf=Y;dr.modeOf=hr;var yo=Ve();function fr(e,t,r){let s=e.getReader(),n=!1,o=0,i=["",new yo.ByteArrayCollector((l)=>new Uint8Array(l))],c=-1,a=async(l)=>{let{value:d,done:f}=await s.read(),u=d;if(f){if(c!==-1){let h=xe(i,c);if(Y(h)>0)l.enqueue(h)}l.close()}else{let h=hr(u,!1);if(c!==h){if(c>=0)l.enqueue(xe(i,c));c=h}if(c===-1){l.enqueue(u);return}let p=Y(u);o+=p;let b=Y(i[c]);if(p>=t&&b===0)l.enqueue(u);else{let y=ur(i,c,u);if(!n&&o>t*2)n=!0,r?.warn(`@smithy/util-stream - stream chunk size ${p} is below threshold of ${t}, automatically buffering.`);if(y>=t)l.enqueue(xe(i,c));else await a(l)}}};return new ReadableStream({pull:a})}dr.createBufferedReadable=fr;function ur(e,t,r){switch(t){case 0:return e[0]+=r,Y(e[0]);case 1:case 2:return e[t].push(r),Y(e[t])}}function xe(e,t){switch(t){case 0:let r=e[0];return e[0]="",r;case 1:case 2:return e[t].flush()}throw Error(`@smithy/util-stream - invalid index ${t} given to flush()`)}function Y(e){return e?.byteLength??e?.length??0}function hr(e,t=!0){if(t&&typeof Buffer<"u"&&e instanceof Buffer)return 2;if(e instanceof Uint8Array)return 1;if(typeof e==="string")return 0;return-1}});var br=_((yr)=>{Object.defineProperty(yr,"__esModule",{value:!0});yr.createBufferedReadable=xo;var Eo=D("stream"),mr=Ve(),F=pr(),So=C();function xo(e,t,r){if((0,So.isReadableStream)(e))return(0,F.createBufferedReadableStream)(e,t,r);let s=new Eo.Readable({read(){}}),n=!1,o=0,i=["",new mr.ByteArrayCollector((a)=>new Uint8Array(a)),new mr.ByteArrayCollector((a)=>Buffer.from(new Uint8Array(a)))],c=-1;return e.on("data",(a)=>{let l=(0,F.modeOf)(a,!0);if(c!==l){if(c>=0)s.push((0,F.flush)(i,c));c=l}if(c===-1){s.push(a);return}let d=(0,F.sizeOf)(a);o+=d;let f=(0,F.sizeOf)(i[c]);if(d>=t&&f===0)s.push(a);else{let u=(0,F.merge)(i,c,a);if(!n&&o>t*2)n=!0,r?.warn(`@smithy/util-stream - stream chunk size ${d} is below threshold of ${t}, automatically buffering.`);if(u>=t)s.push((0,F.flush)(i,c))}}),e.on("end",()=>{if(c!==-1){let a=(0,F.flush)(i,c);if((0,F.sizeOf)(a)>0)s.push(a)}s.push(null)}),s}});var _r=_((wr)=>{Object.defineProperty(wr,"__esModule",{value:!0});wr.getAwsChunkedEncodingStream=void 0;var Oo=(e,t)=>{let{base64Encoder:r,bodyLengthChecker:s,checksumAlgorithmFn:n,checksumLocationName:o,streamHasher:i}=t,c=r!==void 0&&s!==void 0&&n!==void 0&&o!==void 0&&i!==void 0,a=c?i(n,e):void 0,l=e.getReader();return new ReadableStream({async pull(d){let{value:f,done:u}=await l.read();if(u){if(d.enqueue(`0\r
|
|
4
4
|
`),c){let h=r(await a);d.enqueue(`${o}:${h}\r
|
|
5
5
|
`),d.enqueue(`\r
|
|
@@ -15,7 +15,7 @@ See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-confi
|
|
|
15
15
|
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){this.configProvider=new Promise((t,r)=>{if(typeof e==="function")e().then((s)=>{t(this.resolveDefaultConfig(s))}).catch(r);else t(this.resolveDefaultConfig(e))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:t,requestTimeout:r}={}){if(!this.config)this.config=await this.configProvider;let s=this.config,n=e.protocol==="https:";if(!n&&!this.config.httpAgent)this.config.httpAgent=await this.config.httpAgentProvider();return new Promise((o,i)=>{let c=void 0,a=[],l=async(E)=>{await c,a.forEach(P.clearTimeout),o(E)},d=async(E)=>{await c,a.forEach(P.clearTimeout),i(E)};if(t?.aborted){let E=Me(t);d(E);return}let f=e.headers??{},u=(f.Expect??f.expect)==="100-continue",h=n?s.httpsAgent:s.httpAgent;if(u&&!this.externalAgent)h=new(n?$e.Agent:Oe)({keepAlive:!1,maxSockets:1/0});a.push(P.setTimeout(()=>{this.socketWarningTimestamp=Pe.checkSocketUsage(h,this.socketWarningTimestamp,s.logger)},s.socketAcquisitionWarningTimeout??(s.requestTimeout??2000)+(s.connectionTimeout??1000)));let p=Nr.buildQueryString(e.query||{}),b=void 0;if(e.username!=null||e.password!=null){let E=e.username??"",x=e.password??"";b=`${E}:${x}`}let y=e.path;if(p)y+=`?${p}`;if(e.fragment)y+=`#${e.fragment}`;let m=e.hostname??"";if(m[0]==="["&&m.endsWith("]"))m=e.hostname.slice(1,-1);else m=e.hostname;let w={headers:e.headers,host:m,method:e.method,path:y,port:e.port,agent:h,auth:b},g=(n?$e.request:Br)(w,(E)=>{let x=new Lr.HttpResponse({statusCode:E.statusCode||-1,reason:E.statusMessage,headers:jr(E.headers),body:E});l({response:x})});if(g.on("error",(E)=>{if(vo.includes(E.code))d(Object.assign(E,{name:"TimeoutError"}));else d(E)}),t){let E=()=>{g.destroy();let x=Me(t);d(x)};if(typeof t.addEventListener==="function"){let x=t;x.addEventListener("abort",E,{once:!0}),g.once("close",()=>x.removeEventListener("abort",E))}else t.onabort=E}let O=r??s.requestTimeout;a.push(Yo(g,d,s.connectionTimeout)),a.push(Qo(g,d,O,s.throwOnRequestTimeout,s.logger??console)),a.push(Go(g,d,s.socketTimeout));let I=w.agent;if(typeof I==="object"&&"keepAlive"in I)a.push(Zo(g,{keepAlive:I.keepAlive,keepAliveMsecs:I.keepAliveMsecs}));c=Cr(g,e,O,this.externalAgent).catch((E)=>{return a.forEach(P.clearTimeout),i(E)})})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return{...r,[e]:t}})}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:t,connectionTimeout:r,socketTimeout:s,socketAcquisitionWarningTimeout:n,httpAgent:o,httpsAgent:i,throwOnRequestTimeout:c,logger:a}=e||{},l=!0,d=50;return{connectionTimeout:r,requestTimeout:t,socketTimeout:s,socketAcquisitionWarningTimeout:n,throwOnRequestTimeout:c,httpAgentProvider:async()=>{let{Agent:f,request:u}=await import("http");if(Br=u,Oe=f,o instanceof Oe||typeof o?.destroy==="function")return this.externalAgent=!0,o;return new Oe({keepAlive:!0,maxSockets:50,...o})},httpsAgent:(()=>{if(i instanceof $e.Agent||typeof i?.destroy==="function")return this.externalAgent=!0,i;return new $e.Agent({keepAlive:!0,maxSockets:50,...i})})(),logger:a}}}class Fr{sessions=[];constructor(e){this.sessions=e??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(e){this.sessions.push(e)}contains(e){return this.sessions.includes(e)}remove(e){this.sessions=this.sessions.filter((t)=>t!==e)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(e){for(let t of this.sessions)if(t===e){if(!t.destroyed)t.destroy()}}}class Hr{constructor(e){if(this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw RangeError("maxConcurrency must be greater than zero.")}config;sessionCache=new Map;lease(e,t){let r=this.getUrlString(e),s=this.sessionCache.get(r);if(s){let c=s.poll();if(c&&!this.config.disableConcurrency)return c}let n=tt.connect(r);if(this.config.maxConcurrency)n.settings({maxConcurrentStreams:this.config.maxConcurrency},(c)=>{if(c)throw Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+e.destination.toString())});n.unref();let o=()=>{n.destroy(),this.deleteSession(r,n)};if(n.on("goaway",o),n.on("error",o),n.on("frameError",o),n.on("close",()=>this.deleteSession(r,n)),t.requestTimeout)n.setTimeout(t.requestTimeout,o);let i=this.sessionCache.get(r)||new Fr;return i.offerLast(n),this.sessionCache.set(r,i),n}deleteSession(e,t){let r=this.sessionCache.get(e);if(!r)return;if(!r.contains(t))return;r.remove(t),this.sessionCache.set(e,r)}release(e,t){let r=this.getUrlString(e);this.sessionCache.get(r)?.offerLast(t)}destroy(){for(let[e,t]of this.sessionCache){for(let r of t){if(!r.destroyed)r.destroy();t.remove(r)}this.sessionCache.delete(e)}}setMaxConcurrentStreams(e){if(e&&e<=0)throw RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=e}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}getUrlString(e){return e.destination.toString()}}class rt{config;configProvider;metadata={handlerProtocol:"h2"};connectionManager=new Hr({});static create(e){if(typeof e?.handle==="function")return e;return new rt(e)}constructor(e){this.configProvider=new Promise((t,r)=>{if(typeof e==="function")e().then((s)=>{t(s||{})}).catch(r);else t(e||{})})}destroy(){this.connectionManager.destroy()}async handle(e,{abortSignal:t,requestTimeout:r}={}){if(!this.config){if(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams)this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams)}let{requestTimeout:s,disableConcurrentStreams:n}=this.config,o=r??s;return new Promise((i,c)=>{let a=!1,l=void 0,d=async($)=>{await l,i($)},f=async($)=>{await l,c($)};if(t?.aborted){a=!0;let $=Me(t);f($);return}let{hostname:u,method:h,port:p,protocol:b,query:y}=e,m="";if(e.username!=null||e.password!=null){let $=e.username??"",B=e.password??"";m=`${$}:${B}@`}let w=`${b}//${m}${u}${p?`:${p}`:""}`,S={destination:new URL(w)},g=this.connectionManager.lease(S,{requestTimeout:this.config?.sessionTimeout,disableConcurrentStreams:n||!1}),O=($)=>{if(n)this.destroySession(g);a=!0,f($)},I=Nr.buildQueryString(y||{}),E=e.path;if(I)E+=`?${I}`;if(e.fragment)E+=`#${e.fragment}`;let x=g.request({...e.headers,[tt.constants.HTTP2_HEADER_PATH]:E,[tt.constants.HTTP2_HEADER_METHOD]:h});if(g.ref(),x.on("response",($)=>{let B=new Lr.HttpResponse({statusCode:$[":status"]||-1,headers:jr($),body:x});if(a=!0,d({response:B}),n)g.close(),this.connectionManager.deleteSession(w,g)}),o)x.setTimeout(o,()=>{x.close();let $=Error(`Stream timed out because of no activity for ${o} ms`);$.name="TimeoutError",O($)});if(t){let $=()=>{x.close();let B=Me(t);O(B)};if(typeof t.addEventListener==="function"){let B=t;B.addEventListener("abort",$,{once:!0}),x.once("close",()=>B.removeEventListener("abort",$))}else t.onabort=$}x.on("frameError",($,B,Qs)=>{O(Error(`Frame type id ${$} in stream id ${Qs} has failed with code ${B}.`))}),x.on("error",O),x.on("aborted",()=>{O(Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${x.rstCode}.`))}),x.on("close",()=>{if(g.unref(),n)g.destroy();if(!a)O(Error("Unexpected error: http2 request did not get a response"))}),l=Cr(x,e,o)})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return{...r,[e]:t}})}httpHandlerConfigs(){return this.config??{}}destroySession(e){if(!e.destroyed)e.destroy()}}class zr extends qr.Writable{bufferedBytes=[];_write(e,t,r){this.bufferedBytes.push(e),r()}}var ei=(e)=>{if(ti(e))return ri(e);return new Promise((t,r)=>{let s=new zr;e.pipe(s),e.on("error",(n)=>{s.end(),r(n)}),s.on("error",r),s.on("finish",function(){let n=new Uint8Array(Buffer.concat(this.bufferedBytes));t(n)})})},ti=(e)=>typeof ReadableStream==="function"&&e instanceof ReadableStream;async function ri(e){let t=[],r=e.getReader(),s=!1,n=0;while(!s){let{done:c,value:a}=await r.read();if(a)t.push(a),n+=a.length;s=c}let o=new Uint8Array(n),i=0;for(let c of t)o.set(c,i),i+=c.length;return o}si.DEFAULT_REQUEST_TIMEOUT=Ko;si.NodeHttp2Handler=rt;si.NodeHttpHandler=Pe;si.streamCollector=ei});var Yr=_((mi)=>{var kr=ye(),ai=et(),fi=k();function Jr(e,t){return new Request(e,t)}function ui(e=0){return new Promise((t,r)=>{if(e)setTimeout(()=>{let s=Error(`Request did not complete within ${e} ms`);s.name="TimeoutError",r(s)},e)})}var Ae={supported:void 0};class st{config;configProvider;static create(e){if(typeof e?.handle==="function")return e;return new st(e)}constructor(e){if(typeof e==="function")this.configProvider=e().then((t)=>t||{});else this.config=e??{},this.configProvider=Promise.resolve(this.config);if(Ae.supported===void 0)Ae.supported=Boolean(typeof Request<"u"&&"keepalive"in Jr("https://[::1]"))}destroy(){}async handle(e,{abortSignal:t,requestTimeout:r}={}){if(!this.config)this.config=await this.configProvider;let s=r??this.config.requestTimeout,n=this.config.keepAlive===!0,o=this.config.credentials;if(t?.aborted){let m=vr(t);return Promise.reject(m)}let i=e.path,c=ai.buildQueryString(e.query||{});if(c)i+=`?${c}`;if(e.fragment)i+=`#${e.fragment}`;let a="";if(e.username!=null||e.password!=null){let m=e.username??"",w=e.password??"";a=`${m}:${w}@`}let{port:l,method:d}=e,f=`${e.protocol}//${a}${e.hostname}${l?`:${l}`:""}${i}`,u=d==="GET"||d==="HEAD"?void 0:e.body,h={body:u,headers:new Headers(e.headers),method:d,credentials:o};if(this.config?.cache)h.cache=this.config.cache;if(u)h.duplex="half";if(typeof AbortController<"u")h.signal=t;if(Ae.supported)h.keepalive=n;if(typeof this.config.requestInit==="function")Object.assign(h,this.config.requestInit(e));let p=()=>{},b=Jr(f,h),y=[fetch(b).then((m)=>{let w=m.headers,S={};for(let O of w.entries())S[O[0]]=O[1];if(m.body==null)return m.blob().then((O)=>({response:new kr.HttpResponse({headers:S,reason:m.statusText,statusCode:m.status,body:O})}));return{response:new kr.HttpResponse({headers:S,reason:m.statusText,statusCode:m.status,body:m.body})}}),ui(s)];if(t)y.push(new Promise((m,w)=>{let S=()=>{let g=vr(t);w(g)};if(typeof t.addEventListener==="function"){let g=t;g.addEventListener("abort",S,{once:!0}),p=()=>g.removeEventListener("abort",S)}else t.onabort=S}));return Promise.race(y).finally(p)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return r[e]=t,r})}httpHandlerConfigs(){return this.config??{}}}function vr(e){let t=e&&typeof e==="object"&&"reason"in e?e.reason:void 0;if(t){if(t instanceof Error){let n=Error("Request aborted");return n.name="AbortError",n.cause=t,n}let s=Error(String(t));return s.name="AbortError",s}let r=Error("Request aborted");return r.name="AbortError",r}var hi=async(e)=>{if(typeof Blob==="function"&&e instanceof Blob||e.constructor?.name==="Blob"){if(Blob.prototype.arrayBuffer!==void 0)return new Uint8Array(await e.arrayBuffer());return di(e)}return li(e)};async function di(e){let t=await pi(e),r=fi.fromBase64(t);return new Uint8Array(r)}async function li(e){let t=[],r=e.getReader(),s=!1,n=0;while(!s){let{done:c,value:a}=await r.read();if(a)t.push(a),n+=a.length;s=c}let o=new Uint8Array(n),i=0;for(let c of t)o.set(c,i),i+=c.length;return o}function pi(e){return new Promise((t,r)=>{let s=new FileReader;s.onloadend=()=>{if(s.readyState!==2)return r(Error("Reader aborted too early"));let n=s.result??"",o=n.indexOf(","),i=o>-1?o+1:n.length;t(n.substring(i))},s.onabort=()=>r(Error("Read aborted")),s.onerror=()=>r(s.error),s.readAsDataURL(e)})}mi.FetchHttpHandler=st;mi.keepAliveSupport=Ae;mi.streamCollector=hi});var Xr=_((Ti)=>{var Qr={},nt={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();if(t.length===1)t=`0${t}`;Qr[e]=t,nt[t]=e}function gi(e){if(e.length%2!==0)throw Error("Hex encoded strings must have an even number length");let t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){let s=e.slice(r,r+2).toLowerCase();if(s in nt)t[r/2]=nt[s];else throw Error(`Cannot decode unrecognized sequence ${s} as hexadecimal`)}return t}function _i(e){let t="";for(let r=0;r<e.byteLength;r++)t+=Qr[e[r]];return t}Ti.fromHex=gi;Ti.toHex=_i});var ts=_((Kr)=>{Object.defineProperty(Kr,"__esModule",{value:!0});Kr.sdkStreamMixin=void 0;var xi=Yr(),$i=k(),Oi=Xr(),Mi=Te(),Zr=C(),Gr="The stream has already been transformed.",Pi=(e)=>{if(!Vr(e)&&!(0,Zr.isReadableStream)(e)){let n=e?.__proto__?.constructor?.name||e;throw Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${n}`)}let t=!1,r=async()=>{if(t)throw Error(Gr);return t=!0,await(0,xi.streamCollector)(e)},s=(n)=>{if(typeof n.stream!=="function")throw Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
|
|
16
16
|
If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return n.stream()};return Object.assign(e,{transformToByteArray:r,transformToString:async(n)=>{let o=await r();if(n==="base64")return(0,$i.toBase64)(o);else if(n==="hex")return(0,Oi.toHex)(o);else if(n===void 0||n==="utf8"||n==="utf-8")return(0,Mi.toUtf8)(o);else if(typeof TextDecoder==="function")return new TextDecoder(n).decode(o);else throw Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw Error(Gr);if(t=!0,Vr(e))return s(e);else if((0,Zr.isReadableStream)(e))return e;else throw Error(`Cannot transform payload to web stream, got ${e}`)}})};Kr.sdkStreamMixin=Pi;var Vr=(e)=>typeof Blob==="function"&&e instanceof Blob});var os=_((ss)=>{Object.defineProperty(ss,"__esModule",{value:!0});ss.sdkStreamMixin=void 0;var Ai=Wr(),Ri=Ze(),ot=D("stream"),Ui=ts(),rs="The stream has already been transformed.",Ii=(e)=>{if(!(e instanceof ot.Readable))try{return(0,Ui.sdkStreamMixin)(e)}catch(s){let n=e?.__proto__?.constructor?.name||e;throw Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${n}`)}let t=!1,r=async()=>{if(t)throw Error(rs);return t=!0,await(0,Ai.streamCollector)(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async(s)=>{let n=await r();if(s===void 0||Buffer.isEncoding(s))return(0,Ri.fromArrayBuffer)(n.buffer,n.byteOffset,n.byteLength).toString(s);else return new TextDecoder(s).decode(n)},transformToWebStream:()=>{if(t)throw Error(rs);if(e.readableFlowing!==null)throw Error("The stream has been consumed by other callbacks.");if(typeof ot.Readable.toWeb!=="function")throw Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return t=!0,ot.Readable.toWeb(e)}})};ss.sdkStreamMixin=Ii});var cs=_((is)=>{Object.defineProperty(is,"__esModule",{value:!0});is.splitStream=Di;async function Di(e){if(typeof e.stream==="function")e=e.stream();return e.tee()}});var hs=_((us)=>{Object.defineProperty(us,"__esModule",{value:!0});us.splitStream=Ni;var as=D("stream"),Li=cs(),fs=C();async function Ni(e){if((0,fs.isReadableStream)(e)||(0,fs.isBlob)(e))return(0,Li.splitStream)(e);let t=new as.PassThrough,r=new as.PassThrough;return e.pipe(t),e.pipe(r),[t,r]}});var ms=_((T)=>{var ds=k(),ls=Te(),Re=Ge(),Ue=or(),Ie=br(),De=Er(),Be=Pr(),Le=os(),Ne=hs(),ps=C();class ne extends Uint8Array{static fromString(e,t="utf-8"){if(typeof e==="string"){if(t==="base64")return ne.mutate(ds.fromBase64(e));return ne.mutate(ls.fromUtf8(e))}throw Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,ne.prototype),e}transformToString(e="utf-8"){if(e==="base64")return ds.toBase64(this);return ls.toUtf8(this)}}T.isBlob=ps.isBlob;T.isReadableStream=ps.isReadableStream;T.Uint8ArrayBlobAdapter=ne;Object.prototype.hasOwnProperty.call(Re,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:Re.__proto__});Object.keys(Re).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=Re[e]});Object.prototype.hasOwnProperty.call(Ue,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:Ue.__proto__});Object.keys(Ue).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=Ue[e]});Object.prototype.hasOwnProperty.call(Ie,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:Ie.__proto__});Object.keys(Ie).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=Ie[e]});Object.prototype.hasOwnProperty.call(De,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:De.__proto__});Object.keys(De).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=De[e]});Object.prototype.hasOwnProperty.call(Be,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:Be.__proto__});Object.keys(Be).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=Be[e]});Object.prototype.hasOwnProperty.call(Le,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:Le.__proto__});Object.keys(Le).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=Le[e]});Object.prototype.hasOwnProperty.call(Ne,"__proto__")&&!Object.prototype.hasOwnProperty.call(T,"__proto__")&&Object.defineProperty(T,"__proto__",{enumerable:!0,value:Ne.__proto__});Object.keys(Ne).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(T,e))T[e]=Ne[e]})});var gs=_((bs)=>{Object.defineProperty(bs,"__esModule",{value:!0});bs.randomUUID=void 0;var zi=Hi(),ys=zi.__importDefault(D("crypto"));bs.randomUUID=ys.default.randomUUID.bind(ys.default)});var Ts=_((ki)=>{var _s=gs(),M=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),Wi=()=>{if(_s.randomUUID)return _s.randomUUID();let e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,M[e[0]]+M[e[1]]+M[e[2]]+M[e[3]]+"-"+M[e[4]]+M[e[5]]+"-"+M[e[6]]+M[e[7]]+"-"+M[e[8]]+M[e[9]]+"-"+M[e[10]]+M[e[11]]+M[e[12]]+M[e[13]]+M[e[14]]+M[e[15]]};ki.v4=Wi});var bt=_((Fc)=>{var vi=Ts(),Yi=(e,t,r=(s)=>s)=>e,Qi=(e)=>{switch(e){case"true":return!0;case"false":return!1;default:throw Error(`Unable to parse boolean value "${e}"`)}},Xi=(e)=>{if(e===null||e===void 0)return;if(typeof e==="number"){if(e===0||e===1)ae.warn(je(`Expected boolean, got ${typeof e}: ${e}`));if(e===0)return!1;if(e===1)return!0}if(typeof e==="string"){let t=e.toLowerCase();if(t==="false"||t==="true")ae.warn(je(`Expected boolean, got ${typeof e}: ${e}`));if(t==="false")return!1;if(t==="true")return!0}if(typeof e==="boolean")return e;throw TypeError(`Expected boolean, got ${typeof e}: ${e}`)},ie=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string"){let t=parseFloat(e);if(!Number.isNaN(t)){if(String(t)!==String(e))ae.warn(je(`Expected number but observed string: ${e}`));return t}}if(typeof e==="number")return e;throw TypeError(`Expected number, got ${typeof e}: ${e}`)},Zi=Math.ceil(340282346638528860000000000000000000000),qe=(e)=>{let t=ie(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0){if(Math.abs(t)>Zi)throw TypeError(`Expected 32-bit float, got ${e}`)}return t},ce=(e)=>{if(e===null||e===void 0)return;if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw TypeError(`Expected integer, got ${typeof e}: ${e}`)},Gi=ce,ct=(e)=>ut(e,32),at=(e)=>ut(e,16),ft=(e)=>ut(e,8),ut=(e,t)=>{let r=ce(e);if(r!==void 0&&Vi(r,t)!==r)throw TypeError(`Expected ${t}-bit integer, got ${e}`);return r},Vi=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},Ki=(e,t)=>{if(e===null||e===void 0){if(t)throw TypeError(`Expected a non-null value for ${t}`);throw TypeError("Expected a non-null value")}return e},Ss=(e)=>{if(e===null||e===void 0)return;if(typeof e==="object"&&!Array.isArray(e))return e;let t=Array.isArray(e)?"array":typeof e;throw TypeError(`Expected object, got ${t}: ${e}`)},ec=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string")return e;if(["boolean","number","bigint"].includes(typeof e))return ae.warn(je(`Expected string, got ${typeof e}: ${e}`)),String(e);throw TypeError(`Expected string, got ${typeof e}: ${e}`)},tc=(e)=>{if(e===null||e===void 0)return;let t=Ss(e),r=Object.entries(t).filter(([,s])=>s!=null).map(([s])=>s);if(r.length===0)throw TypeError("Unions must have exactly one non-null member. None were found.");if(r.length>1)throw TypeError(`Unions must have exactly one non-null member. Keys ${r} were not null.`);return t},ht=(e)=>{if(typeof e=="string")return ie(Z(e));return ie(e)},rc=ht,xs=(e)=>{if(typeof e=="string")return qe(Z(e));return qe(e)},sc=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,Z=(e)=>{let t=e.match(sc);if(t===null||t[0].length!==e.length)throw TypeError("Expected real number, got implicit NaN");return parseFloat(e)},dt=(e)=>{if(typeof e=="string")return $s(e);return ie(e)},nc=dt,oc=dt,ic=(e)=>{if(typeof e=="string")return $s(e);return qe(e)},$s=(e)=>{switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw Error(`Unable to parse float value: ${e}`)}},Os=(e)=>{if(typeof e==="string")return ce(Z(e));return ce(e)},cc=Os,ac=(e)=>{if(typeof e==="string")return ct(Z(e));return ct(e)},Q=(e)=>{if(typeof e==="string")return at(Z(e));return at(e)},Ms=(e)=>{if(typeof e==="string")return ft(Z(e));return ft(e)},je=(e)=>{return String(TypeError(e).stack||e).split(`
|
|
17
17
|
`).slice(0,5).filter((t)=>!t.includes("stackTraceWarning")).join(`
|
|
18
|
-
`)},ae={warn:console.warn},fc=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],lt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function uc(e){let t=e.getUTCFullYear(),r=e.getUTCMonth(),s=e.getUTCDay(),n=e.getUTCDate(),o=e.getUTCHours(),i=e.getUTCMinutes(),c=e.getUTCSeconds(),a=n<10?`0${n}`:`${n}`,l=o<10?`0${o}`:`${o}`,d=i<10?`0${i}`:`${i}`,f=c<10?`0${c}`:`${c}`;return`${fc[s]}, ${a} ${lt[r]} ${t} ${l}:${d}:${f} GMT`}var hc=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),dc=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw TypeError("RFC-3339 date-times must be expressed as strings");let t=hc.exec(e);if(!t)throw TypeError("Invalid RFC-3339 date-time value");let[r,s,n,o,i,c,a,l]=t,d=Q(X(s)),f=L(n,"month",1,12),u=L(o,"day",1,31);return oe(d,f,u,{hours:i,minutes:c,seconds:a,fractionalMilliseconds:l})},lc=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),pc=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw TypeError("RFC-3339 date-times must be expressed as strings");let t=lc.exec(e);if(!t)throw TypeError("Invalid RFC-3339 date-time value");let[r,s,n,o,i,c,a,l,d]=t,f=Q(X(s)),u=L(n,"month",1,12),h=L(o,"day",1,31),p=oe(f,u,h,{hours:i,minutes:c,seconds:a,fractionalMilliseconds:l});if(d.toUpperCase()!="Z")p.setTime(p.getTime()-Mc(d));return p},mc=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),yc=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),bc=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),wc=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw TypeError("RFC-7231 date-times must be expressed as strings");let t=mc.exec(e);if(t){let[r,s,n,o,i,c,a,l]=t;return oe(Q(X(o)),it(n),L(s,"day",1,31),{hours:i,minutes:c,seconds:a,fractionalMilliseconds:l})}if(t=yc.exec(e),t){let[r,s,n,o,i,c,a,l]=t;return Ec(oe(_c(o),it(n),L(s,"day",1,31),{hours:i,minutes:c,seconds:a,fractionalMilliseconds:l}))}if(t=bc.exec(e),t){let[r,s,n,o,i,c,a,l]=t;return oe(Q(X(l)),it(s),L(n.trimLeft(),"day",1,31),{hours:o,minutes:i,seconds:c,fractionalMilliseconds:a})}throw TypeError("Invalid RFC-7231 date-time value")},gc=(e)=>{if(e===null||e===void 0)return;let t;if(typeof e==="number")t=e;else if(typeof e==="string")t=ht(e);else if(typeof e==="object"&&e.tag===1)t=e.value;else throw TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1000))},oe=(e,t,r,s)=>{let n=t-1;return xc(e,n,r),new Date(Date.UTC(e,n,r,L(s.hours,"hour",0,23),L(s.minutes,"minute",0,59),L(s.seconds,"seconds",0,60),Oc(s.fractionalMilliseconds)))},_c=(e)=>{let t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+Q(X(e));if(r<t)return r+100;return r},Tc=1576800000000,Ec=(e)=>{if(e.getTime()-new Date().getTime()>Tc)return new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()));return e},it=(e)=>{let t=lt.indexOf(e);if(t<0)throw TypeError(`Invalid month: ${e}`);return t+1},Sc=[31,28,31,30,31,30,31,31,30,31,30,31],xc=(e,t,r)=>{let s=Sc[t];if(t===1&&$c(e))s=29;if(r>s)throw TypeError(`Invalid day for ${lt[t]} in ${e}: ${r}`)},$c=(e)=>{return e%4===0&&(e%100!==0||e%400===0)},L=(e,t,r,s)=>{let n=Ms(X(e));if(n<r||n>s)throw TypeError(`${t} must be between ${r} and ${s}, inclusive`);return n},Oc=(e)=>{if(e===null||e===void 0)return 0;return xs("0."+e)*1000},Mc=(e)=>{let t=e[0],r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw TypeError(`Offset direction, ${t}, must be "+" or "-"`);let s=Number(e.substring(1,3)),n=Number(e.substring(4,6));return r*(s*60+n)*60*1000},X=(e)=>{let t=0;while(t<e.length-1&&e.charAt(t)==="0")t++;if(t===0)return e;return e.slice(t)},J=function(t){return Object.assign(new String(t),{deserializeJSON(){return JSON.parse(String(t))},toString(){return String(t)},toJSON(){return String(t)}})};J.from=(e)=>{if(e&&typeof e==="object"&&(e instanceof J||("deserializeJSON"in e)))return e;else if(typeof e==="string"||Object.getPrototypeOf(e)===String.prototype)return J(String(e));return J(JSON.stringify(e))};J.fromObject=J.from;function Pc(e){if(e.includes(",")||e.includes('"'))e=`"${e.replace(/"/g,"\\\"")}"`;return e}var pt="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",mt="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",yt="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",Ps="(\\d?\\d)",As="(\\d{4})",Ac=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),Rc=new RegExp(`^${pt}, ${Ps} ${mt} ${As} ${yt} GMT$`),Uc=new RegExp(`^${pt}, ${Ps}-${mt}-(\\d\\d) ${yt} GMT$`),Ic=new RegExp(`^${pt} ${mt} ( [1-9]|\\d\\d) ${yt} ${As}$`),Dc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Bc=(e)=>{if(e==null)return;let t=NaN;if(typeof e==="number")t=e;else if(typeof e==="string"){if(!/^-?\d*\.?\d+$/.test(e))throw TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else if(typeof e==="object"&&e.tag===1)t=e.value;if(isNaN(t)||Math.abs(t)===1/0)throw TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(t*1000))},Lc=(e)=>{if(e==null)return;if(typeof e!=="string")throw TypeError("RFC3339 timestamps must be strings");let t=Ac.exec(e);if(!t)throw TypeError(`Invalid RFC3339 timestamp format ${e}`);let[,r,s,n,o,i,c,,a,l]=t;H(s,1,12),H(n,1,31),H(o,0,23),H(i,0,59),H(c,0,60);let d=new Date(Date.UTC(Number(r),Number(s)-1,Number(n),Number(o),Number(i),Number(c),Number(a)?Math.round(parseFloat(`0.${a}`)*1000):0));if(d.setUTCFullYear(Number(r)),l.toUpperCase()!="Z"){let[,f,u,h]=/([+-])(\d\d):(\d\d)/.exec(l)||[void 0,"+",0,0],p=f==="-"?1:-1;d.setTime(d.getTime()+p*(Number(u)*60*60*1000+Number(h)*60*1000))}return d},Nc=(e)=>{if(e==null)return;if(typeof e!=="string")throw TypeError("RFC7231 timestamps must be strings.");let t,r,s,n,o,i,c,a;if(a=Rc.exec(e))[,t,r,s,n,o,i,c]=a;else if(a=Uc.exec(e))[,t,r,s,n,o,i,c]=a,s=(Number(s)+1900).toString();else if(a=Ic.exec(e))[,r,t,n,o,i,c,s]=a;if(s&&i){let l=Date.UTC(Number(s),Dc.indexOf(r),Number(t),Number(n),Number(o),Number(i),c?Math.round(parseFloat(`0.${c}`)*1000):0);H(t,1,31),H(n,0,23),H(o,0,59),H(i,0,60);let d=new Date(l);return d.setUTCFullYear(Number(s)),d}throw TypeError(`Invalid RFC7231 date-time value ${e}.`)};function H(e,t,r){let s=Number(e);if(s<t||s>r)throw Error(`Value ${s} out of range [${t}, ${r}]`)}function qc(e,t,r){if(r<=0||!Number.isInteger(r))throw Error("Invalid number of delimiters ("+r+") for splitEvery.");let s=e.split(t);if(r===1)return s;let n=[],o="";for(let i=0;i<s.length;i++){if(o==="")o=s[i];else o+=t+s[i];if((i+1)%r===0)n.push(o),o=""}if(o!=="")n.push(o);return n}var jc=(e)=>{let t=e.length,r=[],s=!1,n=void 0,o=0;for(let i=0;i<t;++i){let c=e[i];switch(c){case'"':if(n!=="\\")s=!s;break;case",":if(!s)r.push(e.slice(o,i)),o=i+1;break}n=c}return r.push(e.slice(o)),r.map((i)=>{i=i.trim();let c=i.length;if(c<2)return i;if(i[0]==='"'&&i[c-1]==='"')i=i.slice(1,c-1);return i.replace(/\\"/g,'"')})},Es=/^-?\d*(\.\d+)?$/;class Ce{string;type;constructor(e,t){if(this.string=e,this.type=t,!Es.test(e))throw Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!=="object")return!1;let t=e;return Ce.prototype.isPrototypeOf(e)||t.type==="bigDecimal"&&Es.test(t.string)}}function Cc(e){return new Ce(String(e),"bigDecimal")}Fc.generateIdempotencyToken=vi.v4;Fc.LazyJsonString=J;Fc.NumericValue=Ce;Fc._parseEpochTimestamp=Bc;Fc._parseRfc3339DateTimeWithOffset=Lc;Fc._parseRfc7231DateTime=Nc;Fc.copyDocumentWithTransform=Yi;Fc.dateToUtcString=uc;Fc.expectBoolean=Xi;Fc.expectByte=ft;Fc.expectFloat32=qe;Fc.expectInt=Gi;Fc.expectInt32=ct;Fc.expectLong=ce;Fc.expectNonNull=Ki;Fc.expectNumber=ie;Fc.expectObject=Ss;Fc.expectShort=at;Fc.expectString=ec;Fc.expectUnion=tc;Fc.handleFloat=nc;Fc.limitedParseDouble=dt;Fc.limitedParseFloat=oc;Fc.limitedParseFloat32=ic;Fc.logger=ae;Fc.nv=Cc;Fc.parseBoolean=Qi;Fc.parseEpochTimestamp=gc;Fc.parseRfc3339DateTime=dc;Fc.parseRfc3339DateTimeWithOffset=pc;Fc.parseRfc7231DateTime=wc;Fc.quoteHeader=Pc;Fc.splitEvery=qc;Fc.splitHeader=jc;Fc.strictParseByte=Ms;Fc.strictParseDouble=ht;Fc.strictParseFloat=rc;Fc.strictParseFloat32=xs;Fc.strictParseInt=cc;Fc.strictParseInt32=ac;Fc.strictParseLong=Os;Fc.strictParseShort=Q});var Ls=_((Ra)=>{var Fe=ms(),R=Qe(),U=bt(),fe=ye(),He=k(),wt=Te(),v=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return Fe.Uint8ArrayBlobAdapter.mutate(e);if(!e)return Fe.Uint8ArrayBlobAdapter.mutate(new Uint8Array);let r=t.streamCollector(e);return Fe.Uint8ArrayBlobAdapter.mutate(await r)};function ue(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}class G{serdeContext;setSerdeContext(e){this.serdeContext=e}}class ze extends G{options;compositeErrorRegistry;constructor(e){super();this.options=e,this.compositeErrorRegistry=R.TypeRegistry.for(e.defaultNamespace);for(let t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return fe.HttpRequest}getResponseType(){return fe.HttpResponse}setSerdeContext(e){if(this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec())this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){if(e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,!e.query)e.query={};for(let[r,s]of t.url.searchParams.entries())e.query[r]=s;if(t.headers)for(let[r,s]of Object.entries(t.headers))e.headers[r]=s.join(", ");return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(let[r,s]of Object.entries(t.headers))e.headers[r]=s;return e}}setHostPrefix(e,t,r){if(this.serdeContext?.disableHostPrefix)return;let s=R.NormalizedSchema.of(t.input),n=R.translateTraits(t.traits??{});if(n.endpoint){let o=n.endpoint?.[0];if(typeof o==="string"){let i=[...s.structIterator()].filter(([,c])=>c.getMergedTraits().hostLabel);for(let[c]of i){let a=r[c];if(typeof a!=="string")throw Error(`@smithy/core/schema - ${c} in input must be a string as hostLabel.`);o=o.replace(`{${c}}`,a)}e.hostname=o+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:r}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:r})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:r}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:r})}async loadEventStreamCapability(){let{EventStreamSerde:e}=await import("./chunk-qz89m7ss.js");return new e({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,r,s,n){return[]}getEventStreamMarshaller(){let e=this.serdeContext;if(!e.eventStreamMarshaller)throw Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class Rs extends ze{async serializeRequest(e,t,r){let s={...t??{}},n=this.serializer,o={},i={},c=await r.endpoint(),a=R.NormalizedSchema.of(e?.input),l=[],d=[],f=!1,u,h=new fe.HttpRequest({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:o,headers:i,body:void 0});if(c){this.updateServiceEndpoint(h,c),this.setHostPrefix(h,e,s);let p=R.translateTraits(e.traits);if(p.http){h.method=p.http[0];let[b,y]=p.http[1].split("?");if(h.path=="/")h.path=b;else h.path+=b;let m=new URLSearchParams(y??"");Object.assign(o,Object.fromEntries(m))}}for(let[p,b]of a.structIterator()){let y=b.getMergedTraits()??{},m=s[p];if(m==null&&!b.isIdempotencyToken()){if(y.httpLabel){if(h.path.includes(`{${p}+}`)||h.path.includes(`{${p}}`))throw Error(`No value provided for input HTTP label: ${p}.`)}continue}if(y.httpPayload){if(b.isStreaming())if(b.isStructSchema()){if(s[p])u=await this.serializeEventStream({eventStream:s[p],requestSchema:a})}else u=m;else n.write(b,m),u=n.flush();delete s[p]}else if(y.httpLabel){n.write(b,m);let w=n.flush();if(h.path.includes(`{${p}+}`))h.path=h.path.replace(`{${p}+}`,w.split("/").map(ue).join("/"));else if(h.path.includes(`{${p}}`))h.path=h.path.replace(`{${p}}`,ue(w));delete s[p]}else if(y.httpHeader)n.write(b,m),i[y.httpHeader.toLowerCase()]=String(n.flush()),delete s[p];else if(typeof y.httpPrefixHeaders==="string"){for(let[w,S]of Object.entries(m)){let g=y.httpPrefixHeaders+w;n.write([b.getValueSchema(),{httpHeader:g}],S),i[g.toLowerCase()]=n.flush()}delete s[p]}else if(y.httpQuery||y.httpQueryParams)this.serializeQuery(b,m,o),delete s[p];else f=!0,l.push(p),d.push(b)}if(f&&s){let[p,b]=(a.getName(!0)??"#Unknown").split("#"),y=a.getSchema()[6],m=[3,p,b,a.getMergedTraits(),l,d,void 0];if(y)m[6]=y;else m.pop();n.write(m,s),u=n.flush()}return h.headers=i,h.query=o,h.body=u,h}serializeQuery(e,t,r){let s=this.serializer,n=e.getMergedTraits();if(n.httpQueryParams){for(let[o,i]of Object.entries(t))if(!(o in r)){let c=e.getValueSchema();Object.assign(c.getMergedTraits(),{...n,httpQuery:o,httpQueryParams:void 0}),this.serializeQuery(c,i,r)}return}if(e.isListSchema()){let o=!!e.getMergedTraits().sparse,i=[];for(let c of t){s.write([e.getValueSchema(),n],c);let a=s.flush();if(o||a!==void 0)i.push(a)}r[n.httpQuery]=i}else s.write([e,n],t),r[n.httpQuery]=s.flush()}async deserializeResponse(e,t,r){let s=this.deserializer,n=R.NormalizedSchema.of(e.output),o={};if(r.statusCode>=300){let c=await v(r.body,t);if(c.byteLength>0)Object.assign(o,await s.read(15,c));throw await this.handleError(e,t,r,o,this.deserializeMetadata(r)),Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(let c in r.headers){let a=r.headers[c];delete r.headers[c],r.headers[c.toLowerCase()]=a}let i=await this.deserializeHttpMessage(n,t,r,o);if(i.length){let c=await v(r.body,t);if(c.byteLength>0){let a=await s.read(n,c);for(let l of i)if(a[l]!=null)o[l]=a[l]}}else if(i.discardResponseBody)await v(r.body,t);return o.$metadata=this.deserializeMetadata(r),o}async deserializeHttpMessage(e,t,r,s,n){let o;if(s instanceof Set)o=n;else o=s;let i=!0,c=this.deserializer,a=R.NormalizedSchema.of(e),l=[];for(let[d,f]of a.structIterator()){let u=f.getMemberTraits();if(u.httpPayload){if(i=!1,f.isStreaming())if(f.isStructSchema())o[d]=await this.deserializeEventStream({response:r,responseSchema:a});else o[d]=Fe.sdkStreamMixin(r.body);else if(r.body){let p=await v(r.body,t);if(p.byteLength>0)o[d]=await c.read(f,p)}}else if(u.httpHeader){let h=String(u.httpHeader).toLowerCase(),p=r.headers[h];if(p!=null)if(f.isListSchema()){let b=f.getValueSchema();b.getMergedTraits().httpHeader=h;let y;if(b.isTimestampSchema()&&b.getSchema()===4)y=U.splitEvery(p,",",2);else y=U.splitHeader(p);let m=[];for(let w of y)m.push(await c.read(b,w.trim()));o[d]=m}else o[d]=await c.read(f,p)}else if(u.httpPrefixHeaders!==void 0){o[d]={};for(let[h,p]of Object.entries(r.headers))if(h.startsWith(u.httpPrefixHeaders)){let b=f.getValueSchema();b.getMergedTraits().httpHeader=h,o[d][h.slice(u.httpPrefixHeaders.length)]=await c.read(b,p)}}else if(u.httpResponseCode)o[d]=r.statusCode;else l.push(d)}return l.discardResponseBody=i,l}}class Us extends ze{async serializeRequest(e,t,r){let s=this.serializer,n={},o={},i=await r.endpoint(),c=R.NormalizedSchema.of(e?.input),a=c.getSchema(),l,d=new fe.HttpRequest({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:n,headers:o,body:void 0});if(i)this.updateServiceEndpoint(d,i),this.setHostPrefix(d,e,t);let f={...t};if(t){let u=c.getEventStreamMember();if(u){if(f[u]){let h={};for(let[p,b]of c.structIterator())if(p!==u&&f[p])s.write(b,f[p]),h[p]=s.flush();l=await this.serializeEventStream({eventStream:f[u],requestSchema:c,initialRequest:h})}}else s.write(a,f),l=s.flush()}return d.headers=Object.assign(d.headers,o),d.query=n,d.body=l,d.method="POST",d}async deserializeResponse(e,t,r){let s=this.deserializer,n=R.NormalizedSchema.of(e.output),o={};if(r.statusCode>=300){let c=await v(r.body,t);if(c.byteLength>0)Object.assign(o,await s.read(15,c));throw await this.handleError(e,t,r,o,this.deserializeMetadata(r)),Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(let c in r.headers){let a=r.headers[c];delete r.headers[c],r.headers[c.toLowerCase()]=a}let i=n.getEventStreamMember();if(i)o[i]=await this.deserializeEventStream({response:r,responseSchema:n,initialResponseContainer:o});else{let c=await v(r.body,t);if(c.byteLength>0)Object.assign(o,await s.read(n,c))}return o.$metadata=this.deserializeMetadata(r),o}}var Is=(e,t,r,s,n,o)=>{if(t!=null&&t[r]!==void 0){let i=s();if(i==null||i.length<=0)throw Error("Empty value provided for input HTTP label: "+r+".");e=e.replace(n,o?i.split("/").map((c)=>ue(c)).join("/"):ue(i))}else throw Error("No value provided for input HTTP label: "+r+".");return e};function Aa(e,t){return new gt(e,t)}class gt{input;context;query={};method="";headers={};path="";body=null;hostname="";resolvePathStack=[];constructor(e,t){this.input=e,this.context=t}async build(){let{hostname:e,protocol:t="https",port:r,path:s}=await this.context.endpoint();this.path=s;for(let n of this.resolvePathStack)n(this.path);return new fe.HttpRequest({protocol:t,hostname:this.hostname||e,port:r,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push((t)=>{this.path=`${t?.endsWith("/")?t.slice(0,-1):t||""}`+e}),this}p(e,t,r,s){return this.resolvePathStack.push((n)=>{this.path=Is(n,this.input,e,t,r,s)}),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}function _t(e,t){if(t.timestampFormat.useTrait){if(e.isTimestampSchema()&&(e.getSchema()===5||e.getSchema()===6||e.getSchema()===7))return e.getSchema()}let{httpLabel:r,httpPrefixHeaders:s,httpHeader:n,httpQuery:o}=e.getMergedTraits();return(t.httpBindings?typeof s==="string"||Boolean(n)?6:Boolean(o)||Boolean(r)?5:void 0:void 0)??t.timestampFormat.default}class Tt extends G{settings;constructor(e){super();this.settings=e}read(e,t){let r=R.NormalizedSchema.of(e);if(r.isListSchema())return U.splitHeader(t).map((s)=>this.read(r.getValueSchema(),s));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??He.fromBase64)(t);if(r.isTimestampSchema())switch(_t(r,this.settings)){case 5:return U._parseRfc3339DateTimeWithOffset(t);case 6:return U._parseRfc7231DateTime(t);case 7:return U._parseEpochTimestamp(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(r.isStringSchema()){let s=r.getMergedTraits().mediaType,n=t;if(s){if(r.getMergedTraits().httpHeader)n=this.base64ToUtf8(n);if(s==="application/json"||s.endsWith("+json"))n=U.LazyJsonString.from(n);return n}}if(r.isNumericSchema())return Number(t);if(r.isBigIntegerSchema())return BigInt(t);if(r.isBigDecimalSchema())return new U.NumericValue(t,"bigDecimal");if(r.isBooleanSchema())return String(t).toLowerCase()==="true";return t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??wt.toUtf8)((this.serdeContext?.base64Decoder??He.fromBase64)(e))}}class Ds extends G{codecDeserializer;stringDeserializer;constructor(e,t){super();this.codecDeserializer=e,this.stringDeserializer=new Tt(t)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,t){let r=R.NormalizedSchema.of(e),s=r.getMergedTraits(),n=this.serdeContext?.utf8Encoder??wt.toUtf8;if(s.httpHeader||s.httpResponseCode)return this.stringDeserializer.read(r,n(t));if(s.httpPayload){if(r.isBlobSchema()){let o=this.serdeContext?.utf8Decoder??wt.fromUtf8;if(typeof t==="string")return o(t);return t}else if(r.isStringSchema()){if("byteLength"in t)return n(t);return t}}return this.codecDeserializer.read(r,t)}}class Et extends G{settings;stringBuffer="";constructor(e){super();this.settings=e}write(e,t){let r=R.NormalizedSchema.of(e);switch(typeof t){case"object":if(t===null){this.stringBuffer="null";return}if(r.isTimestampSchema()){if(!(t instanceof Date))throw Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${r.getName(!0)}`);switch(_t(r,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=U.dateToUtcString(t);break;case 7:this.stringBuffer=String(t.getTime()/1000);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1000)}return}if(r.isBlobSchema()&&"byteLength"in t){this.stringBuffer=(this.serdeContext?.base64Encoder??He.toBase64)(t);return}if(r.isListSchema()&&Array.isArray(t)){let o="";for(let i of t){this.write([r.getValueSchema(),r.getMergedTraits()],i);let c=this.flush(),a=r.getValueSchema().isTimestampSchema()?c:U.quoteHeader(c);if(o!=="")o+=", ";o+=a}this.stringBuffer=o;return}this.stringBuffer=JSON.stringify(t,null,2);break;case"string":let s=r.getMergedTraits().mediaType,n=t;if(s){if(s==="application/json"||s.endsWith("+json"))n=U.LazyJsonString.from(n);if(r.getMergedTraits().httpHeader){this.stringBuffer=(this.serdeContext?.base64Encoder??He.toBase64)(n.toString());return}}this.stringBuffer=t;break;default:if(r.isIdempotencyToken())this.stringBuffer=U.generateIdempotencyToken();else this.stringBuffer=String(t)}}flush(){let e=this.stringBuffer;return this.stringBuffer="",e}}class Bs{codecSerializer;stringSerializer;buffer;constructor(e,t,r=new Et(t)){this.codecSerializer=e,this.stringSerializer=r}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,t){let r=R.NormalizedSchema.of(e),s=r.getMergedTraits();if(s.httpHeader||s.httpLabel||s.httpQuery){this.stringSerializer.write(r,t),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(r,t)}flush(){if(this.buffer!==void 0){let e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}Ra.FromStringShapeDeserializer=Tt;Ra.HttpBindingProtocol=Rs;Ra.HttpInterceptingShapeDeserializer=Ds;Ra.HttpInterceptingShapeSerializer=Bs;Ra.HttpProtocol=ze;Ra.RequestBuilder=gt;Ra.RpcProtocol=Us;Ra.SerdeContext=G;Ra.ToStringShapeSerializer=Et;Ra.collectBody=v;Ra.determineTimestampFormat=_t;Ra.extendedEncodeURIComponent=ue;Ra.requestBuilder=Aa;Ra.resolvedPath=Is});var Ff=_((he)=>{var qs=Ct(),Ot=Ls(),We=At(),Ja=Qe(),ke=bt();class js{config;middlewareStack=qs.constructStack();initConfig;handlers;constructor(e){this.config=e;let{protocol:t,protocolSettings:r}=e;if(r){if(typeof t==="function")e.protocol=new t(r)}}send(e,t,r){let s=typeof t!=="function"?t:void 0,n=typeof t==="function"?t:r,o=s===void 0&&this.config.cacheMiddleware===!0,i;if(o){if(!this.handlers)this.handlers=new WeakMap;let c=this.handlers;if(c.has(e.constructor))i=c.get(e.constructor);else i=e.resolveMiddleware(this.middlewareStack,this.config,s),c.set(e.constructor,i)}else delete this.handlers,i=e.resolveMiddleware(this.middlewareStack,this.config,s);if(n)i(e).then((c)=>n(null,c.output),(c)=>n(c)).catch(()=>{});else return i(e).then((c)=>c.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var St="***SensitiveInformation***";function xt(e,t){if(t==null)return t;let r=Ja.NormalizedSchema.of(e);if(r.getMergedTraits().sensitive)return St;if(r.isListSchema()){if(!!r.getValueSchema().getMergedTraits().sensitive)return St}else if(r.isMapSchema()){if(!!r.getKeySchema().getMergedTraits().sensitive||!!r.getValueSchema().getMergedTraits().sensitive)return St}else if(r.isStructSchema()&&typeof t==="object"){let s=t,n={};for(let[o,i]of r.structIterator())if(s[o]!=null)n[o]=xt(i,s[o]);return n}return t}class Mt{middlewareStack=qs.constructStack();schema;static classBuilder(){return new Cs}resolveMiddlewareWithContext(e,t,r,{middlewareFn:s,clientName:n,commandName:o,inputFilterSensitiveLog:i,outputFilterSensitiveLog:c,smithyContext:a,additionalContext:l,CommandCtor:d}){for(let b of s.bind(this)(d,e,t,r))this.middlewareStack.use(b);let f=e.concat(this.middlewareStack),{logger:u}=t,h={logger:u,clientName:n,commandName:o,inputFilterSensitiveLog:i,outputFilterSensitiveLog:c,[We.SMITHY_CONTEXT_KEY]:{commandInstance:this,...a},...l},{requestHandler:p}=t;return f.resolve((b)=>p.handle(b.request,r||{}),h)}}class Cs{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,r={}){return this._smithyContext={service:e,operation:t,...r},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=(r)=>r,t=(r)=>r){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){let e=this,t;return t=class extends Mt{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[r]){super();this.input=r??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(r,s,n){let o=e._operationSchema,i=o?.[4]??o?.input,c=o?.[5]??o?.output;return this.resolveMiddlewareWithContext(r,s,n,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(o?xt.bind(null,i):(a)=>a),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(o?xt.bind(null,c):(a)=>a),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}var va="***SensitiveInformation***",Ya=(e,t,r)=>{for(let[o,i]of Object.entries(e)){let c=async function(l,d,f){let u=new i(l);if(typeof d==="function")this.send(u,d);else if(typeof f==="function"){if(typeof d!=="object")throw Error(`Expected http options but got ${typeof d}`);this.send(u,d||{},f)}else return this.send(u,d)},a=(o[0].toLowerCase()+o.slice(1)).replace(/Command$/,"");t.prototype[a]=c}let{paginators:s={},waiters:n={}}=r??{};for(let[o,i]of Object.entries(s))if(t.prototype[o]===void 0)t.prototype[o]=function(c={},a,...l){return i({...a,client:this},c,...l)};for(let[o,i]of Object.entries(n))if(t.prototype[o]===void 0)t.prototype[o]=async function(c={},a,...l){let d=a;if(typeof a==="number")d={maxWaitTime:a};return i({...d,client:this},c,...l)}};class V extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message);Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;let t=e;return V.prototype.isPrototypeOf(t)||Boolean(t.$fault)&&Boolean(t.$metadata)&&(t.$fault==="client"||t.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;let t=e;if(this===V)return V.isInstance(e);if(V.isInstance(e)){if(t.name&&this.name)return this.prototype.isPrototypeOf(e)||t.name===this.name;return this.prototype.isPrototypeOf(e)}return!1}}var Fs=(e,t={})=>{Object.entries(t).filter(([,s])=>s!==void 0).forEach(([s,n])=>{if(e[s]==null||e[s]==="")e[s]=n});let r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e},Hs=({output:e,parsedBody:t,exceptionCtor:r,errorCode:s})=>{let n=Xa(e),o=n.httpStatusCode?n.httpStatusCode+"":void 0,i=new r({name:t?.code||t?.Code||s||o||"UnknownError",$fault:"client",$metadata:n});throw Fs(i,t)},Qa=(e)=>{return({output:t,parsedBody:r,errorCode:s})=>{Hs({output:t,parsedBody:r,exceptionCtor:e,errorCode:s})}},Xa=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Za=(e)=>{switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}},Ns=!1,Ga=(e)=>{if(e&&!Ns&&parseInt(e.substring(1,e.indexOf(".")))<16)Ns=!0},zs=Object.values(We.AlgorithmId),Va=(e)=>{let t=[];for(let r in We.AlgorithmId){let s=We.AlgorithmId[r];if(e[s]===void 0)continue;t.push({algorithmId:()=>s,checksumConstructor:()=>e[s]})}for(let[r,s]of Object.entries(e.checksumAlgorithms??{}))t.push({algorithmId:()=>r,checksumConstructor:()=>s});return{addChecksumAlgorithm(r){e.checksumAlgorithms=e.checksumAlgorithms??{};let s=r.algorithmId(),n=r.checksumConstructor();if(zs.includes(s))e.checksumAlgorithms[s.toUpperCase()]=n;else e.checksumAlgorithms[s]=n;t.push(r)},checksumAlgorithms(){return t}}},Ka=(e)=>{let t={};return e.checksumAlgorithms().forEach((r)=>{let s=r.algorithmId();if(zs.includes(s))t[s]=r.checksumConstructor()}),t},ef=(e)=>{return{setRetryStrategy(t){e.retryStrategy=t},retryStrategy(){return e.retryStrategy}}},tf=(e)=>{let t={};return t.retryStrategy=e.retryStrategy(),t},Ws=(e)=>{return Object.assign(Va(e),ef(e))},rf=Ws,sf=(e)=>{return Object.assign(Ka(e),tf(e))},nf=(e)=>Array.isArray(e)?e:[e],ks=(e)=>{for(let r in e)if(e.hasOwnProperty(r)&&e[r]["#text"]!==void 0)e[r]=e[r]["#text"];else if(typeof e[r]==="object"&&e[r]!==null)e[r]=ks(e[r]);return e},of=(e)=>{return e!=null};class Js{trace(){}debug(){}info(){}warn(){}error(){}}function vs(e,t,r){let s,n,o;if(typeof t>"u"&&typeof r>"u")s={},o=e;else if(s=e,typeof t==="function")return n=t,o=r,ff(s,n,o);else o=t;for(let i of Object.keys(o)){if(!Array.isArray(o[i])){s[i]=o[i];continue}Ys(s,null,o,i)}return s}var cf=(e)=>{let t={};for(let[r,s]of Object.entries(e||{}))t[r]=[,s];return t},af=(e,t)=>{let r={};for(let s in t)Ys(r,e,t,s);return r},ff=(e,t,r)=>{return vs(e,Object.entries(r).reduce((s,[n,o])=>{if(Array.isArray(o))s[n]=o;else if(typeof o==="function")s[n]=[t,o()];else s[n]=[t,o];return s},{}))},Ys=(e,t,r,s)=>{if(t!==null){let i=r[s];if(typeof i==="function")i=[,i];let[c=uf,a=hf,l=s]=i;if(typeof c==="function"&&c(t[l])||typeof c!=="function"&&!!c)e[s]=a(t[l]);return}let[n,o]=r[s];if(typeof o==="function"){let i,c=n===void 0&&(i=o())!=null,a=typeof n==="function"&&!!n(void 0)||typeof n!=="function"&&!!n;if(c)e[s]=i;else if(a)e[s]=o()}else{let i=n===void 0&&o!=null,c=typeof n==="function"&&!!n(o)||typeof n!=="function"&&!!n;if(i||c)e[s]=o}},uf=(e)=>e!=null,hf=(e)=>e,df=(e)=>{if(e!==e)return"NaN";switch(e){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return e}},lf=(e)=>e.toISOString().replace(".000Z","Z"),$t=(e)=>{if(e==null)return{};if(Array.isArray(e))return e.filter((t)=>t!=null).map($t);if(typeof e==="object"){let t={};for(let r of Object.keys(e)){if(e[r]==null)continue;t[r]=$t(e[r])}return t}return e};he.collectBody=Ot.collectBody;he.extendedEncodeURIComponent=Ot.extendedEncodeURIComponent;he.resolvedPath=Ot.resolvedPath;he.Client=js;he.Command=Mt;he.NoOpLogger=Js;he.SENSITIVE_STRING=va;he.ServiceException=V;he._json=$t;he.convertMap=cf;he.createAggregatedClient=Ya;he.decorateServiceException=Fs;he.emitWarningIfUnsupportedVersion=Ga;he.getArrayIfSingleItem=nf;he.getDefaultClientConfiguration=rf;he.getDefaultExtensionConfiguration=Ws;he.getValueFromTextNode=ks;he.isSerializableHeaderValue=of;he.loadConfigsForDefaultMode=Za;he.map=vs;he.resolveDefaultRuntimeConfig=sf;he.serializeDateTime=lf;he.serializeFloat=df;he.take=af;he.throwDefaultError=Hs;he.withBaseException=Qa;Object.prototype.hasOwnProperty.call(ke,"__proto__")&&!Object.prototype.hasOwnProperty.call(he,"__proto__")&&Object.defineProperty(he,"__proto__",{enumerable:!0,value:ke.__proto__});Object.keys(ke).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(he,e))he[e]=ke[e]})});
|
|
18
|
+
`)},ae={warn:console.warn},fc=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],lt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function uc(e){let t=e.getUTCFullYear(),r=e.getUTCMonth(),s=e.getUTCDay(),n=e.getUTCDate(),o=e.getUTCHours(),i=e.getUTCMinutes(),c=e.getUTCSeconds(),a=n<10?`0${n}`:`${n}`,l=o<10?`0${o}`:`${o}`,d=i<10?`0${i}`:`${i}`,f=c<10?`0${c}`:`${c}`;return`${fc[s]}, ${a} ${lt[r]} ${t} ${l}:${d}:${f} GMT`}var hc=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),dc=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw TypeError("RFC-3339 date-times must be expressed as strings");let t=hc.exec(e);if(!t)throw TypeError("Invalid RFC-3339 date-time value");let[r,s,n,o,i,c,a,l]=t,d=Q(X(s)),f=L(n,"month",1,12),u=L(o,"day",1,31);return oe(d,f,u,{hours:i,minutes:c,seconds:a,fractionalMilliseconds:l})},lc=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),pc=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw TypeError("RFC-3339 date-times must be expressed as strings");let t=lc.exec(e);if(!t)throw TypeError("Invalid RFC-3339 date-time value");let[r,s,n,o,i,c,a,l,d]=t,f=Q(X(s)),u=L(n,"month",1,12),h=L(o,"day",1,31),p=oe(f,u,h,{hours:i,minutes:c,seconds:a,fractionalMilliseconds:l});if(d.toUpperCase()!="Z")p.setTime(p.getTime()-Mc(d));return p},mc=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),yc=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),bc=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),wc=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw TypeError("RFC-7231 date-times must be expressed as strings");let t=mc.exec(e);if(t){let[r,s,n,o,i,c,a,l]=t;return oe(Q(X(o)),it(n),L(s,"day",1,31),{hours:i,minutes:c,seconds:a,fractionalMilliseconds:l})}if(t=yc.exec(e),t){let[r,s,n,o,i,c,a,l]=t;return Ec(oe(_c(o),it(n),L(s,"day",1,31),{hours:i,minutes:c,seconds:a,fractionalMilliseconds:l}))}if(t=bc.exec(e),t){let[r,s,n,o,i,c,a,l]=t;return oe(Q(X(l)),it(s),L(n.trimLeft(),"day",1,31),{hours:o,minutes:i,seconds:c,fractionalMilliseconds:a})}throw TypeError("Invalid RFC-7231 date-time value")},gc=(e)=>{if(e===null||e===void 0)return;let t;if(typeof e==="number")t=e;else if(typeof e==="string")t=ht(e);else if(typeof e==="object"&&e.tag===1)t=e.value;else throw TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1000))},oe=(e,t,r,s)=>{let n=t-1;return xc(e,n,r),new Date(Date.UTC(e,n,r,L(s.hours,"hour",0,23),L(s.minutes,"minute",0,59),L(s.seconds,"seconds",0,60),Oc(s.fractionalMilliseconds)))},_c=(e)=>{let t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+Q(X(e));if(r<t)return r+100;return r},Tc=1576800000000,Ec=(e)=>{if(e.getTime()-new Date().getTime()>Tc)return new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()));return e},it=(e)=>{let t=lt.indexOf(e);if(t<0)throw TypeError(`Invalid month: ${e}`);return t+1},Sc=[31,28,31,30,31,30,31,31,30,31,30,31],xc=(e,t,r)=>{let s=Sc[t];if(t===1&&$c(e))s=29;if(r>s)throw TypeError(`Invalid day for ${lt[t]} in ${e}: ${r}`)},$c=(e)=>{return e%4===0&&(e%100!==0||e%400===0)},L=(e,t,r,s)=>{let n=Ms(X(e));if(n<r||n>s)throw TypeError(`${t} must be between ${r} and ${s}, inclusive`);return n},Oc=(e)=>{if(e===null||e===void 0)return 0;return xs("0."+e)*1000},Mc=(e)=>{let t=e[0],r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw TypeError(`Offset direction, ${t}, must be "+" or "-"`);let s=Number(e.substring(1,3)),n=Number(e.substring(4,6));return r*(s*60+n)*60*1000},X=(e)=>{let t=0;while(t<e.length-1&&e.charAt(t)==="0")t++;if(t===0)return e;return e.slice(t)},J=function(t){return Object.assign(new String(t),{deserializeJSON(){return JSON.parse(String(t))},toString(){return String(t)},toJSON(){return String(t)}})};J.from=(e)=>{if(e&&typeof e==="object"&&(e instanceof J||("deserializeJSON"in e)))return e;else if(typeof e==="string"||Object.getPrototypeOf(e)===String.prototype)return J(String(e));return J(JSON.stringify(e))};J.fromObject=J.from;function Pc(e){if(e.includes(",")||e.includes('"'))e=`"${e.replace(/"/g,"\\\"")}"`;return e}var pt="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",mt="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",yt="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",Ps="(\\d?\\d)",As="(\\d{4})",Ac=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),Rc=new RegExp(`^${pt}, ${Ps} ${mt} ${As} ${yt} GMT$`),Uc=new RegExp(`^${pt}, ${Ps}-${mt}-(\\d\\d) ${yt} GMT$`),Ic=new RegExp(`^${pt} ${mt} ( [1-9]|\\d\\d) ${yt} ${As}$`),Dc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Bc=(e)=>{if(e==null)return;let t=NaN;if(typeof e==="number")t=e;else if(typeof e==="string"){if(!/^-?\d*\.?\d+$/.test(e))throw TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else if(typeof e==="object"&&e.tag===1)t=e.value;if(isNaN(t)||Math.abs(t)===1/0)throw TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(t*1000))},Lc=(e)=>{if(e==null)return;if(typeof e!=="string")throw TypeError("RFC3339 timestamps must be strings");let t=Ac.exec(e);if(!t)throw TypeError(`Invalid RFC3339 timestamp format ${e}`);let[,r,s,n,o,i,c,,a,l]=t;H(s,1,12),H(n,1,31),H(o,0,23),H(i,0,59),H(c,0,60);let d=new Date(Date.UTC(Number(r),Number(s)-1,Number(n),Number(o),Number(i),Number(c),Number(a)?Math.round(parseFloat(`0.${a}`)*1000):0));if(d.setUTCFullYear(Number(r)),l.toUpperCase()!="Z"){let[,f,u,h]=/([+-])(\d\d):(\d\d)/.exec(l)||[void 0,"+",0,0],p=f==="-"?1:-1;d.setTime(d.getTime()+p*(Number(u)*60*60*1000+Number(h)*60*1000))}return d},Nc=(e)=>{if(e==null)return;if(typeof e!=="string")throw TypeError("RFC7231 timestamps must be strings.");let t,r,s,n,o,i,c,a;if(a=Rc.exec(e))[,t,r,s,n,o,i,c]=a;else if(a=Uc.exec(e))[,t,r,s,n,o,i,c]=a,s=(Number(s)+1900).toString();else if(a=Ic.exec(e))[,r,t,n,o,i,c,s]=a;if(s&&i){let l=Date.UTC(Number(s),Dc.indexOf(r),Number(t),Number(n),Number(o),Number(i),c?Math.round(parseFloat(`0.${c}`)*1000):0);H(t,1,31),H(n,0,23),H(o,0,59),H(i,0,60);let d=new Date(l);return d.setUTCFullYear(Number(s)),d}throw TypeError(`Invalid RFC7231 date-time value ${e}.`)};function H(e,t,r){let s=Number(e);if(s<t||s>r)throw Error(`Value ${s} out of range [${t}, ${r}]`)}function qc(e,t,r){if(r<=0||!Number.isInteger(r))throw Error("Invalid number of delimiters ("+r+") for splitEvery.");let s=e.split(t);if(r===1)return s;let n=[],o="";for(let i=0;i<s.length;i++){if(o==="")o=s[i];else o+=t+s[i];if((i+1)%r===0)n.push(o),o=""}if(o!=="")n.push(o);return n}var jc=(e)=>{let t=e.length,r=[],s=!1,n=void 0,o=0;for(let i=0;i<t;++i){let c=e[i];switch(c){case'"':if(n!=="\\")s=!s;break;case",":if(!s)r.push(e.slice(o,i)),o=i+1;break}n=c}return r.push(e.slice(o)),r.map((i)=>{i=i.trim();let c=i.length;if(c<2)return i;if(i[0]==='"'&&i[c-1]==='"')i=i.slice(1,c-1);return i.replace(/\\"/g,'"')})},Es=/^-?\d*(\.\d+)?$/;class Ce{string;type;constructor(e,t){if(this.string=e,this.type=t,!Es.test(e))throw Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!=="object")return!1;let t=e;return Ce.prototype.isPrototypeOf(e)||t.type==="bigDecimal"&&Es.test(t.string)}}function Cc(e){return new Ce(String(e),"bigDecimal")}Fc.generateIdempotencyToken=vi.v4;Fc.LazyJsonString=J;Fc.NumericValue=Ce;Fc._parseEpochTimestamp=Bc;Fc._parseRfc3339DateTimeWithOffset=Lc;Fc._parseRfc7231DateTime=Nc;Fc.copyDocumentWithTransform=Yi;Fc.dateToUtcString=uc;Fc.expectBoolean=Xi;Fc.expectByte=ft;Fc.expectFloat32=qe;Fc.expectInt=Gi;Fc.expectInt32=ct;Fc.expectLong=ce;Fc.expectNonNull=Ki;Fc.expectNumber=ie;Fc.expectObject=Ss;Fc.expectShort=at;Fc.expectString=ec;Fc.expectUnion=tc;Fc.handleFloat=nc;Fc.limitedParseDouble=dt;Fc.limitedParseFloat=oc;Fc.limitedParseFloat32=ic;Fc.logger=ae;Fc.nv=Cc;Fc.parseBoolean=Qi;Fc.parseEpochTimestamp=gc;Fc.parseRfc3339DateTime=dc;Fc.parseRfc3339DateTimeWithOffset=pc;Fc.parseRfc7231DateTime=wc;Fc.quoteHeader=Pc;Fc.splitEvery=qc;Fc.splitHeader=jc;Fc.strictParseByte=Ms;Fc.strictParseDouble=ht;Fc.strictParseFloat=rc;Fc.strictParseFloat32=xs;Fc.strictParseInt=cc;Fc.strictParseInt32=ac;Fc.strictParseLong=Os;Fc.strictParseShort=Q});var Ls=_((Ra)=>{var Fe=ms(),R=Qe(),U=bt(),fe=ye(),He=k(),wt=Te(),v=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return Fe.Uint8ArrayBlobAdapter.mutate(e);if(!e)return Fe.Uint8ArrayBlobAdapter.mutate(new Uint8Array);let r=t.streamCollector(e);return Fe.Uint8ArrayBlobAdapter.mutate(await r)};function ue(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}class G{serdeContext;setSerdeContext(e){this.serdeContext=e}}class ze extends G{options;compositeErrorRegistry;constructor(e){super();this.options=e,this.compositeErrorRegistry=R.TypeRegistry.for(e.defaultNamespace);for(let t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return fe.HttpRequest}getResponseType(){return fe.HttpResponse}setSerdeContext(e){if(this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec())this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){if(e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,!e.query)e.query={};for(let[r,s]of t.url.searchParams.entries())e.query[r]=s;if(t.headers)for(let[r,s]of Object.entries(t.headers))e.headers[r]=s.join(", ");return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(let[r,s]of Object.entries(t.headers))e.headers[r]=s;return e}}setHostPrefix(e,t,r){if(this.serdeContext?.disableHostPrefix)return;let s=R.NormalizedSchema.of(t.input),n=R.translateTraits(t.traits??{});if(n.endpoint){let o=n.endpoint?.[0];if(typeof o==="string"){let i=[...s.structIterator()].filter(([,c])=>c.getMergedTraits().hostLabel);for(let[c]of i){let a=r[c];if(typeof a!=="string")throw Error(`@smithy/core/schema - ${c} in input must be a string as hostLabel.`);o=o.replace(`{${c}}`,a)}e.hostname=o+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:r}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:r})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:r}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:r})}async loadEventStreamCapability(){let{EventStreamSerde:e}=await import("./chunk-rzqft8q8.js");return new e({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,r,s,n){return[]}getEventStreamMarshaller(){let e=this.serdeContext;if(!e.eventStreamMarshaller)throw Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class Rs extends ze{async serializeRequest(e,t,r){let s={...t??{}},n=this.serializer,o={},i={},c=await r.endpoint(),a=R.NormalizedSchema.of(e?.input),l=[],d=[],f=!1,u,h=new fe.HttpRequest({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:o,headers:i,body:void 0});if(c){this.updateServiceEndpoint(h,c),this.setHostPrefix(h,e,s);let p=R.translateTraits(e.traits);if(p.http){h.method=p.http[0];let[b,y]=p.http[1].split("?");if(h.path=="/")h.path=b;else h.path+=b;let m=new URLSearchParams(y??"");Object.assign(o,Object.fromEntries(m))}}for(let[p,b]of a.structIterator()){let y=b.getMergedTraits()??{},m=s[p];if(m==null&&!b.isIdempotencyToken()){if(y.httpLabel){if(h.path.includes(`{${p}+}`)||h.path.includes(`{${p}}`))throw Error(`No value provided for input HTTP label: ${p}.`)}continue}if(y.httpPayload){if(b.isStreaming())if(b.isStructSchema()){if(s[p])u=await this.serializeEventStream({eventStream:s[p],requestSchema:a})}else u=m;else n.write(b,m),u=n.flush();delete s[p]}else if(y.httpLabel){n.write(b,m);let w=n.flush();if(h.path.includes(`{${p}+}`))h.path=h.path.replace(`{${p}+}`,w.split("/").map(ue).join("/"));else if(h.path.includes(`{${p}}`))h.path=h.path.replace(`{${p}}`,ue(w));delete s[p]}else if(y.httpHeader)n.write(b,m),i[y.httpHeader.toLowerCase()]=String(n.flush()),delete s[p];else if(typeof y.httpPrefixHeaders==="string"){for(let[w,S]of Object.entries(m)){let g=y.httpPrefixHeaders+w;n.write([b.getValueSchema(),{httpHeader:g}],S),i[g.toLowerCase()]=n.flush()}delete s[p]}else if(y.httpQuery||y.httpQueryParams)this.serializeQuery(b,m,o),delete s[p];else f=!0,l.push(p),d.push(b)}if(f&&s){let[p,b]=(a.getName(!0)??"#Unknown").split("#"),y=a.getSchema()[6],m=[3,p,b,a.getMergedTraits(),l,d,void 0];if(y)m[6]=y;else m.pop();n.write(m,s),u=n.flush()}return h.headers=i,h.query=o,h.body=u,h}serializeQuery(e,t,r){let s=this.serializer,n=e.getMergedTraits();if(n.httpQueryParams){for(let[o,i]of Object.entries(t))if(!(o in r)){let c=e.getValueSchema();Object.assign(c.getMergedTraits(),{...n,httpQuery:o,httpQueryParams:void 0}),this.serializeQuery(c,i,r)}return}if(e.isListSchema()){let o=!!e.getMergedTraits().sparse,i=[];for(let c of t){s.write([e.getValueSchema(),n],c);let a=s.flush();if(o||a!==void 0)i.push(a)}r[n.httpQuery]=i}else s.write([e,n],t),r[n.httpQuery]=s.flush()}async deserializeResponse(e,t,r){let s=this.deserializer,n=R.NormalizedSchema.of(e.output),o={};if(r.statusCode>=300){let c=await v(r.body,t);if(c.byteLength>0)Object.assign(o,await s.read(15,c));throw await this.handleError(e,t,r,o,this.deserializeMetadata(r)),Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(let c in r.headers){let a=r.headers[c];delete r.headers[c],r.headers[c.toLowerCase()]=a}let i=await this.deserializeHttpMessage(n,t,r,o);if(i.length){let c=await v(r.body,t);if(c.byteLength>0){let a=await s.read(n,c);for(let l of i)if(a[l]!=null)o[l]=a[l]}}else if(i.discardResponseBody)await v(r.body,t);return o.$metadata=this.deserializeMetadata(r),o}async deserializeHttpMessage(e,t,r,s,n){let o;if(s instanceof Set)o=n;else o=s;let i=!0,c=this.deserializer,a=R.NormalizedSchema.of(e),l=[];for(let[d,f]of a.structIterator()){let u=f.getMemberTraits();if(u.httpPayload){if(i=!1,f.isStreaming())if(f.isStructSchema())o[d]=await this.deserializeEventStream({response:r,responseSchema:a});else o[d]=Fe.sdkStreamMixin(r.body);else if(r.body){let p=await v(r.body,t);if(p.byteLength>0)o[d]=await c.read(f,p)}}else if(u.httpHeader){let h=String(u.httpHeader).toLowerCase(),p=r.headers[h];if(p!=null)if(f.isListSchema()){let b=f.getValueSchema();b.getMergedTraits().httpHeader=h;let y;if(b.isTimestampSchema()&&b.getSchema()===4)y=U.splitEvery(p,",",2);else y=U.splitHeader(p);let m=[];for(let w of y)m.push(await c.read(b,w.trim()));o[d]=m}else o[d]=await c.read(f,p)}else if(u.httpPrefixHeaders!==void 0){o[d]={};for(let[h,p]of Object.entries(r.headers))if(h.startsWith(u.httpPrefixHeaders)){let b=f.getValueSchema();b.getMergedTraits().httpHeader=h,o[d][h.slice(u.httpPrefixHeaders.length)]=await c.read(b,p)}}else if(u.httpResponseCode)o[d]=r.statusCode;else l.push(d)}return l.discardResponseBody=i,l}}class Us extends ze{async serializeRequest(e,t,r){let s=this.serializer,n={},o={},i=await r.endpoint(),c=R.NormalizedSchema.of(e?.input),a=c.getSchema(),l,d=new fe.HttpRequest({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:n,headers:o,body:void 0});if(i)this.updateServiceEndpoint(d,i),this.setHostPrefix(d,e,t);let f={...t};if(t){let u=c.getEventStreamMember();if(u){if(f[u]){let h={};for(let[p,b]of c.structIterator())if(p!==u&&f[p])s.write(b,f[p]),h[p]=s.flush();l=await this.serializeEventStream({eventStream:f[u],requestSchema:c,initialRequest:h})}}else s.write(a,f),l=s.flush()}return d.headers=Object.assign(d.headers,o),d.query=n,d.body=l,d.method="POST",d}async deserializeResponse(e,t,r){let s=this.deserializer,n=R.NormalizedSchema.of(e.output),o={};if(r.statusCode>=300){let c=await v(r.body,t);if(c.byteLength>0)Object.assign(o,await s.read(15,c));throw await this.handleError(e,t,r,o,this.deserializeMetadata(r)),Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(let c in r.headers){let a=r.headers[c];delete r.headers[c],r.headers[c.toLowerCase()]=a}let i=n.getEventStreamMember();if(i)o[i]=await this.deserializeEventStream({response:r,responseSchema:n,initialResponseContainer:o});else{let c=await v(r.body,t);if(c.byteLength>0)Object.assign(o,await s.read(n,c))}return o.$metadata=this.deserializeMetadata(r),o}}var Is=(e,t,r,s,n,o)=>{if(t!=null&&t[r]!==void 0){let i=s();if(i==null||i.length<=0)throw Error("Empty value provided for input HTTP label: "+r+".");e=e.replace(n,o?i.split("/").map((c)=>ue(c)).join("/"):ue(i))}else throw Error("No value provided for input HTTP label: "+r+".");return e};function Aa(e,t){return new gt(e,t)}class gt{input;context;query={};method="";headers={};path="";body=null;hostname="";resolvePathStack=[];constructor(e,t){this.input=e,this.context=t}async build(){let{hostname:e,protocol:t="https",port:r,path:s}=await this.context.endpoint();this.path=s;for(let n of this.resolvePathStack)n(this.path);return new fe.HttpRequest({protocol:t,hostname:this.hostname||e,port:r,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push((t)=>{this.path=`${t?.endsWith("/")?t.slice(0,-1):t||""}`+e}),this}p(e,t,r,s){return this.resolvePathStack.push((n)=>{this.path=Is(n,this.input,e,t,r,s)}),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}function _t(e,t){if(t.timestampFormat.useTrait){if(e.isTimestampSchema()&&(e.getSchema()===5||e.getSchema()===6||e.getSchema()===7))return e.getSchema()}let{httpLabel:r,httpPrefixHeaders:s,httpHeader:n,httpQuery:o}=e.getMergedTraits();return(t.httpBindings?typeof s==="string"||Boolean(n)?6:Boolean(o)||Boolean(r)?5:void 0:void 0)??t.timestampFormat.default}class Tt extends G{settings;constructor(e){super();this.settings=e}read(e,t){let r=R.NormalizedSchema.of(e);if(r.isListSchema())return U.splitHeader(t).map((s)=>this.read(r.getValueSchema(),s));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??He.fromBase64)(t);if(r.isTimestampSchema())switch(_t(r,this.settings)){case 5:return U._parseRfc3339DateTimeWithOffset(t);case 6:return U._parseRfc7231DateTime(t);case 7:return U._parseEpochTimestamp(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(r.isStringSchema()){let s=r.getMergedTraits().mediaType,n=t;if(s){if(r.getMergedTraits().httpHeader)n=this.base64ToUtf8(n);if(s==="application/json"||s.endsWith("+json"))n=U.LazyJsonString.from(n);return n}}if(r.isNumericSchema())return Number(t);if(r.isBigIntegerSchema())return BigInt(t);if(r.isBigDecimalSchema())return new U.NumericValue(t,"bigDecimal");if(r.isBooleanSchema())return String(t).toLowerCase()==="true";return t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??wt.toUtf8)((this.serdeContext?.base64Decoder??He.fromBase64)(e))}}class Ds extends G{codecDeserializer;stringDeserializer;constructor(e,t){super();this.codecDeserializer=e,this.stringDeserializer=new Tt(t)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,t){let r=R.NormalizedSchema.of(e),s=r.getMergedTraits(),n=this.serdeContext?.utf8Encoder??wt.toUtf8;if(s.httpHeader||s.httpResponseCode)return this.stringDeserializer.read(r,n(t));if(s.httpPayload){if(r.isBlobSchema()){let o=this.serdeContext?.utf8Decoder??wt.fromUtf8;if(typeof t==="string")return o(t);return t}else if(r.isStringSchema()){if("byteLength"in t)return n(t);return t}}return this.codecDeserializer.read(r,t)}}class Et extends G{settings;stringBuffer="";constructor(e){super();this.settings=e}write(e,t){let r=R.NormalizedSchema.of(e);switch(typeof t){case"object":if(t===null){this.stringBuffer="null";return}if(r.isTimestampSchema()){if(!(t instanceof Date))throw Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${r.getName(!0)}`);switch(_t(r,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=U.dateToUtcString(t);break;case 7:this.stringBuffer=String(t.getTime()/1000);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1000)}return}if(r.isBlobSchema()&&"byteLength"in t){this.stringBuffer=(this.serdeContext?.base64Encoder??He.toBase64)(t);return}if(r.isListSchema()&&Array.isArray(t)){let o="";for(let i of t){this.write([r.getValueSchema(),r.getMergedTraits()],i);let c=this.flush(),a=r.getValueSchema().isTimestampSchema()?c:U.quoteHeader(c);if(o!=="")o+=", ";o+=a}this.stringBuffer=o;return}this.stringBuffer=JSON.stringify(t,null,2);break;case"string":let s=r.getMergedTraits().mediaType,n=t;if(s){if(s==="application/json"||s.endsWith("+json"))n=U.LazyJsonString.from(n);if(r.getMergedTraits().httpHeader){this.stringBuffer=(this.serdeContext?.base64Encoder??He.toBase64)(n.toString());return}}this.stringBuffer=t;break;default:if(r.isIdempotencyToken())this.stringBuffer=U.generateIdempotencyToken();else this.stringBuffer=String(t)}}flush(){let e=this.stringBuffer;return this.stringBuffer="",e}}class Bs{codecSerializer;stringSerializer;buffer;constructor(e,t,r=new Et(t)){this.codecSerializer=e,this.stringSerializer=r}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,t){let r=R.NormalizedSchema.of(e),s=r.getMergedTraits();if(s.httpHeader||s.httpLabel||s.httpQuery){this.stringSerializer.write(r,t),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(r,t)}flush(){if(this.buffer!==void 0){let e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}Ra.FromStringShapeDeserializer=Tt;Ra.HttpBindingProtocol=Rs;Ra.HttpInterceptingShapeDeserializer=Ds;Ra.HttpInterceptingShapeSerializer=Bs;Ra.HttpProtocol=ze;Ra.RequestBuilder=gt;Ra.RpcProtocol=Us;Ra.SerdeContext=G;Ra.ToStringShapeSerializer=Et;Ra.collectBody=v;Ra.determineTimestampFormat=_t;Ra.extendedEncodeURIComponent=ue;Ra.requestBuilder=Aa;Ra.resolvedPath=Is});var Ff=_((he)=>{var qs=Ct(),Ot=Ls(),We=At(),Ja=Qe(),ke=bt();class js{config;middlewareStack=qs.constructStack();initConfig;handlers;constructor(e){this.config=e;let{protocol:t,protocolSettings:r}=e;if(r){if(typeof t==="function")e.protocol=new t(r)}}send(e,t,r){let s=typeof t!=="function"?t:void 0,n=typeof t==="function"?t:r,o=s===void 0&&this.config.cacheMiddleware===!0,i;if(o){if(!this.handlers)this.handlers=new WeakMap;let c=this.handlers;if(c.has(e.constructor))i=c.get(e.constructor);else i=e.resolveMiddleware(this.middlewareStack,this.config,s),c.set(e.constructor,i)}else delete this.handlers,i=e.resolveMiddleware(this.middlewareStack,this.config,s);if(n)i(e).then((c)=>n(null,c.output),(c)=>n(c)).catch(()=>{});else return i(e).then((c)=>c.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var St="***SensitiveInformation***";function xt(e,t){if(t==null)return t;let r=Ja.NormalizedSchema.of(e);if(r.getMergedTraits().sensitive)return St;if(r.isListSchema()){if(!!r.getValueSchema().getMergedTraits().sensitive)return St}else if(r.isMapSchema()){if(!!r.getKeySchema().getMergedTraits().sensitive||!!r.getValueSchema().getMergedTraits().sensitive)return St}else if(r.isStructSchema()&&typeof t==="object"){let s=t,n={};for(let[o,i]of r.structIterator())if(s[o]!=null)n[o]=xt(i,s[o]);return n}return t}class Mt{middlewareStack=qs.constructStack();schema;static classBuilder(){return new Cs}resolveMiddlewareWithContext(e,t,r,{middlewareFn:s,clientName:n,commandName:o,inputFilterSensitiveLog:i,outputFilterSensitiveLog:c,smithyContext:a,additionalContext:l,CommandCtor:d}){for(let b of s.bind(this)(d,e,t,r))this.middlewareStack.use(b);let f=e.concat(this.middlewareStack),{logger:u}=t,h={logger:u,clientName:n,commandName:o,inputFilterSensitiveLog:i,outputFilterSensitiveLog:c,[We.SMITHY_CONTEXT_KEY]:{commandInstance:this,...a},...l},{requestHandler:p}=t;return f.resolve((b)=>p.handle(b.request,r||{}),h)}}class Cs{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,r={}){return this._smithyContext={service:e,operation:t,...r},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=(r)=>r,t=(r)=>r){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){let e=this,t;return t=class extends Mt{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[r]){super();this.input=r??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(r,s,n){let o=e._operationSchema,i=o?.[4]??o?.input,c=o?.[5]??o?.output;return this.resolveMiddlewareWithContext(r,s,n,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(o?xt.bind(null,i):(a)=>a),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(o?xt.bind(null,c):(a)=>a),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}var va="***SensitiveInformation***",Ya=(e,t,r)=>{for(let[o,i]of Object.entries(e)){let c=async function(l,d,f){let u=new i(l);if(typeof d==="function")this.send(u,d);else if(typeof f==="function"){if(typeof d!=="object")throw Error(`Expected http options but got ${typeof d}`);this.send(u,d||{},f)}else return this.send(u,d)},a=(o[0].toLowerCase()+o.slice(1)).replace(/Command$/,"");t.prototype[a]=c}let{paginators:s={},waiters:n={}}=r??{};for(let[o,i]of Object.entries(s))if(t.prototype[o]===void 0)t.prototype[o]=function(c={},a,...l){return i({...a,client:this},c,...l)};for(let[o,i]of Object.entries(n))if(t.prototype[o]===void 0)t.prototype[o]=async function(c={},a,...l){let d=a;if(typeof a==="number")d={maxWaitTime:a};return i({...d,client:this},c,...l)}};class V extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message);Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;let t=e;return V.prototype.isPrototypeOf(t)||Boolean(t.$fault)&&Boolean(t.$metadata)&&(t.$fault==="client"||t.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;let t=e;if(this===V)return V.isInstance(e);if(V.isInstance(e)){if(t.name&&this.name)return this.prototype.isPrototypeOf(e)||t.name===this.name;return this.prototype.isPrototypeOf(e)}return!1}}var Fs=(e,t={})=>{Object.entries(t).filter(([,s])=>s!==void 0).forEach(([s,n])=>{if(e[s]==null||e[s]==="")e[s]=n});let r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e},Hs=({output:e,parsedBody:t,exceptionCtor:r,errorCode:s})=>{let n=Xa(e),o=n.httpStatusCode?n.httpStatusCode+"":void 0,i=new r({name:t?.code||t?.Code||s||o||"UnknownError",$fault:"client",$metadata:n});throw Fs(i,t)},Qa=(e)=>{return({output:t,parsedBody:r,errorCode:s})=>{Hs({output:t,parsedBody:r,exceptionCtor:e,errorCode:s})}},Xa=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Za=(e)=>{switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}},Ns=!1,Ga=(e)=>{if(e&&!Ns&&parseInt(e.substring(1,e.indexOf(".")))<16)Ns=!0},zs=Object.values(We.AlgorithmId),Va=(e)=>{let t=[];for(let r in We.AlgorithmId){let s=We.AlgorithmId[r];if(e[s]===void 0)continue;t.push({algorithmId:()=>s,checksumConstructor:()=>e[s]})}for(let[r,s]of Object.entries(e.checksumAlgorithms??{}))t.push({algorithmId:()=>r,checksumConstructor:()=>s});return{addChecksumAlgorithm(r){e.checksumAlgorithms=e.checksumAlgorithms??{};let s=r.algorithmId(),n=r.checksumConstructor();if(zs.includes(s))e.checksumAlgorithms[s.toUpperCase()]=n;else e.checksumAlgorithms[s]=n;t.push(r)},checksumAlgorithms(){return t}}},Ka=(e)=>{let t={};return e.checksumAlgorithms().forEach((r)=>{let s=r.algorithmId();if(zs.includes(s))t[s]=r.checksumConstructor()}),t},ef=(e)=>{return{setRetryStrategy(t){e.retryStrategy=t},retryStrategy(){return e.retryStrategy}}},tf=(e)=>{let t={};return t.retryStrategy=e.retryStrategy(),t},Ws=(e)=>{return Object.assign(Va(e),ef(e))},rf=Ws,sf=(e)=>{return Object.assign(Ka(e),tf(e))},nf=(e)=>Array.isArray(e)?e:[e],ks=(e)=>{for(let r in e)if(e.hasOwnProperty(r)&&e[r]["#text"]!==void 0)e[r]=e[r]["#text"];else if(typeof e[r]==="object"&&e[r]!==null)e[r]=ks(e[r]);return e},of=(e)=>{return e!=null};class Js{trace(){}debug(){}info(){}warn(){}error(){}}function vs(e,t,r){let s,n,o;if(typeof t>"u"&&typeof r>"u")s={},o=e;else if(s=e,typeof t==="function")return n=t,o=r,ff(s,n,o);else o=t;for(let i of Object.keys(o)){if(!Array.isArray(o[i])){s[i]=o[i];continue}Ys(s,null,o,i)}return s}var cf=(e)=>{let t={};for(let[r,s]of Object.entries(e||{}))t[r]=[,s];return t},af=(e,t)=>{let r={};for(let s in t)Ys(r,e,t,s);return r},ff=(e,t,r)=>{return vs(e,Object.entries(r).reduce((s,[n,o])=>{if(Array.isArray(o))s[n]=o;else if(typeof o==="function")s[n]=[t,o()];else s[n]=[t,o];return s},{}))},Ys=(e,t,r,s)=>{if(t!==null){let i=r[s];if(typeof i==="function")i=[,i];let[c=uf,a=hf,l=s]=i;if(typeof c==="function"&&c(t[l])||typeof c!=="function"&&!!c)e[s]=a(t[l]);return}let[n,o]=r[s];if(typeof o==="function"){let i,c=n===void 0&&(i=o())!=null,a=typeof n==="function"&&!!n(void 0)||typeof n!=="function"&&!!n;if(c)e[s]=i;else if(a)e[s]=o()}else{let i=n===void 0&&o!=null,c=typeof n==="function"&&!!n(o)||typeof n!=="function"&&!!n;if(i||c)e[s]=o}},uf=(e)=>e!=null,hf=(e)=>e,df=(e)=>{if(e!==e)return"NaN";switch(e){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return e}},lf=(e)=>e.toISOString().replace(".000Z","Z"),$t=(e)=>{if(e==null)return{};if(Array.isArray(e))return e.filter((t)=>t!=null).map($t);if(typeof e==="object"){let t={};for(let r of Object.keys(e)){if(e[r]==null)continue;t[r]=$t(e[r])}return t}return e};he.collectBody=Ot.collectBody;he.extendedEncodeURIComponent=Ot.extendedEncodeURIComponent;he.resolvedPath=Ot.resolvedPath;he.Client=js;he.Command=Mt;he.NoOpLogger=Js;he.SENSITIVE_STRING=va;he.ServiceException=V;he._json=$t;he.convertMap=cf;he.createAggregatedClient=Ya;he.decorateServiceException=Fs;he.emitWarningIfUnsupportedVersion=Ga;he.getArrayIfSingleItem=nf;he.getDefaultClientConfiguration=rf;he.getDefaultExtensionConfiguration=Ws;he.getValueFromTextNode=ks;he.isSerializableHeaderValue=of;he.loadConfigsForDefaultMode=Za;he.map=vs;he.resolveDefaultRuntimeConfig=sf;he.serializeDateTime=lf;he.serializeFloat=df;he.take=af;he.throwDefaultError=Hs;he.withBaseException=Qa;Object.prototype.hasOwnProperty.call(ke,"__proto__")&&!Object.prototype.hasOwnProperty.call(he,"__proto__")&&Object.defineProperty(he,"__proto__",{enumerable:!0,value:ke.__proto__});Object.keys(ke).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(he,e))he[e]=ke[e]})});
|
|
19
19
|
export{Rt as D,k as E,Rr as F,Wr as G,Xr as H,ms as I,It as J,Qe as K,Ts as L,bt as M,Ls as N,Ff as O};
|
|
20
20
|
|
|
21
|
-
//# debugId=
|
|
21
|
+
//# debugId=6CC51C1750C4E86C64756E2164756E21
|