@bilal-fazlani/mock-server 0.2.1 → 0.3.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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/bundle-full.mjs +41 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/engine-oniguruma.mjs +8 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/index.mjs +29 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/langs-bundle-full-4noeO3oH.mjs +1283 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/rolldown-runtime-BBjsoOtd.mjs +27 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/themes.mjs +396 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/dist/wasm.mjs +3 -0
- package/.next/standalone/.next/node_modules/shiki-43d062b67f27bbdc/package.json +73 -0
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +4 -1
- package/.next/standalone/.next/server/app/[...path]/route.js +2 -2
- package/.next/standalone/.next/server/app/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/[...notFound]/page.js +1 -1
- package/.next/standalone/.next/server/app/ui/[...notFound]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/[...notFound]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/catalog/route.js +2 -2
- package/.next/standalone/.next/server/app/ui/api/catalog/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/global-mocks/[system]/[endpoint]/route.js +2 -2
- package/.next/standalone/.next/server/app/ui/api/global-mocks/[system]/[endpoint]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/global-mocks/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/global-mocks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/health/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/health/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/logs/[logId]/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/logs/[logId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/logs/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/logs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/profiles/[profileId]/reset/route.js +1 -1
- package/.next/standalone/.next/server/app/ui/api/profiles/[profileId]/reset/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/api/profiles/[profileId]/route.js +2 -2
- package/.next/standalone/.next/server/app/ui/api/profiles/[profileId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/catalog/[system]/[endpoint]/page.js +8 -7
- package/.next/standalone/.next/server/app/ui/catalog/[system]/[endpoint]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/catalog/[system]/[endpoint]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/catalog/page.js +5 -5
- package/.next/standalone/.next/server/app/ui/catalog/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/catalog/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/environment/page.js +4 -4
- package/.next/standalone/.next/server/app/ui/environment/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/environment/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/global-mocks/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/ui/global-mocks/page.js +4 -4
- package/.next/standalone/.next/server/app/ui/global-mocks/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/global-mocks/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/logs/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/ui/logs/page.js +5 -5
- package/.next/standalone/.next/server/app/ui/logs/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/logs/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/page.js +4 -4
- package/.next/standalone/.next/server/app/ui/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/[profileId]/page/server-reference-manifest.json +4 -4
- package/.next/standalone/.next/server/app/ui/profiles/[profileId]/page.js +6 -6
- package/.next/standalone/.next/server/app/ui/profiles/[profileId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/[profileId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new/page/server-reference-manifest.json +4 -4
- package/.next/standalone/.next/server/app/ui/profiles/new/page.js +5 -5
- package/.next/standalone/.next/server/app/ui/profiles/new/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.html +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.rsc +31 -31
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/_full.segment.rsc +31 -31
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/ui/profiles/new/__PAGE__.segment.rsc +18 -17
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/ui/profiles/new.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/ui/profiles.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/ui/profiles/new.segments/ui.segment.rsc +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_w4w88._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0eo49or._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0om7kg8._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s6drot._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t8o5f7._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__14hrty_._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1d3vxpt._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1e407ve._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1islaxo._.js +3 -0
- package/.next/standalone/.next/server/chunks/{_01xbyam._.js → _0qbx9v1._.js} +6 -6
- package/.next/standalone/.next/server/chunks/{_0022gwg._.js → _16q11je._.js} +6 -6
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_1hi1g43.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__095ld3v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0c_8sxb._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__131d-3a._.js → [root-of-the-server]__0ok8mg5._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0uln_1r._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xmt17v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16y93ju._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__18_kqdp._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__18z_8pt._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ac328a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ffkjjl._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1gmmta4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1k-7k5k._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1po4if1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r99_25._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1xkfxwl._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__20xpe3a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0ceyznt._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_1s8xzfs._.js → _0dcewjo._.js} +5 -5
- package/.next/standalone/.next/server/chunks/ssr/_0dp2bez._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0hv6b4i._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0txvxmw._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_13ez5qw._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_142--49._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1nyvjoj._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_1s6weq_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_ui_logs_LogRow_tsx_1mzipt8._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/static/chunks/12ny879muwkxw.js +1 -0
- package/.next/standalone/.next/static/chunks/18hh57jv94a5e.js +1 -0
- package/.next/standalone/.next/static/chunks/1rml3lmlc_-1c.js +1 -0
- package/.next/standalone/.next/static/chunks/1zxhmuljxo270.js +1 -0
- package/.next/standalone/.next/static/chunks/2bqfpygv3x9-k.js +1 -0
- package/.next/standalone/.next/static/chunks/3fpjbzbf26aey.js +1 -0
- package/.next/standalone/.next/static/chunks/3ivfq435-2tni.css +3 -0
- package/.next/standalone/next.config.ts +32 -0
- package/.next/standalone/node_modules/@shikijs/core/dist/index.mjs +1406 -0
- package/.next/standalone/node_modules/@shikijs/core/package.json +60 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs +47 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/dist/engine-raw.mjs +27 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/dist/index.mjs +4 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/dist/scanner-DX8LRFGE.mjs +77 -0
- package/.next/standalone/node_modules/@shikijs/engine-javascript/package.json +42 -0
- package/.next/standalone/node_modules/@shikijs/engine-oniguruma/dist/index.mjs +449 -0
- package/.next/standalone/node_modules/@shikijs/engine-oniguruma/dist/wasm-inlined.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/engine-oniguruma/package.json +45 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/abap.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/actionscript-3.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ada.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-expression.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-html.mjs +16 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-inline-style.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-inline-template.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-let-declaration.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-template-blocks.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-template.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/angular-ts.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/apache.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/apex.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/apl.mjs +16 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/applescript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ara.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/asciidoc.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/asm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/astro.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/awk.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ballerina.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bat.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/beancount.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/berry.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bibtex.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bicep.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bird2.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/blade.mjs +20 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/bsl.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/c.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/c3.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cadence.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cairo.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/clarity.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/clojure.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cmake.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cobol.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/codeowners.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/codeql.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/coffee.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/common-lisp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/coq.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cpp-macro.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cpp.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/crystal.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/csharp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/css.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/csv.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cue.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/cypher.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/d.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/dart.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/dax.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/desktop.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/diff.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/docker.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/dotenv.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/dream-maker.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/edge.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/elixir.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/elm.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/emacs-lisp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/erb.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/erlang.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-css.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-glsl.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-html.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-sql.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/es-tag-xml.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fennel.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fish.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fluent.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fortran-fixed-form.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fortran-free-form.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/fsharp.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gdresource.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gdscript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gdshader.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/genie.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gherkin.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/git-commit.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/git-rebase.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gleam.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/glimmer-js.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/glimmer-ts.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/glsl.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gn.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/gnuplot.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/go.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/graphql.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/groovy.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hack.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/haml.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/handlebars.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/haskell.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/haxe.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hcl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hjson.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hlsl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/html-derivative.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/html.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/http.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hurl.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hxml.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/hy.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/imba.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ini.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/java.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/javascript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jinja-html.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jinja.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jison.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/json.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/json5.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jsonc.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jsonl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jsonnet.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jssm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/jsx.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/julia.mjs +16 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/just.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/kdl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/kotlin.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/kusto.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/latex.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/lean.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/less.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/liquid.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/llvm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/log.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/logo.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/lua.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/luau.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/make.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/markdown-nix.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/markdown-vue.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/markdown.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/marko.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/matlab.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mdc.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mdx.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mermaid.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mipsasm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/mojo.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/moonbit.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/move.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/narrat.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nextflow-groovy.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nextflow.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nginx.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nim.mjs +20 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nix.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/nushell.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/objective-c.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/objective-cpp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ocaml.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/odin.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/openscad.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/pascal.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/perl.mjs +16 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/php.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/pkl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/plsql.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/po.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/polar.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/postcss.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/powerquery.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/powershell.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/prisma.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/prolog.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/proto.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/pug.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/puppet.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/purescript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/python.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/qml.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/qmldir.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/qss.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/r.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/racket.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/raku.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/razor.mjs +10 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/reg.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/regexp.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/rel.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/riscv.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ron.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/rosmsg.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/rst.mjs +22 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ruby.mjs +30 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/rust.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sas.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sass.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/scala.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/scheme.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/scss.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sdbl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/shaderlab.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/shellscript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/shellsession.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/smalltalk.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/solidity.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/soy.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sparql.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/splunk.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/sql.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ssh-config.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/stata.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/stylus.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/surrealql.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/svelte.mjs +14 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/swift.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/system-verilog.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/systemd.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/talonscript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tasl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tcl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/templ.mjs +12 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/terraform.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tex.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/toml.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/ts-tags.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tsv.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/tsx.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/turtle.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/twig.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/typescript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/typespec.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/typst.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/v.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vala.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vb.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/verilog.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vhdl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/viml.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-directives.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-html.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-interpolations.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-sfc-style-variable-injection.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue-vine.mjs +18 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vue.mjs +26 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/vyper.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wasm.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wenyan.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wgsl.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wikitext.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wit.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/wolfram.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/xml.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/xsl.mjs +8 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/yaml.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/zenscript.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/dist/zig.mjs +5 -0
- package/.next/standalone/node_modules/@shikijs/langs/package.json +387 -0
- package/.next/standalone/node_modules/@shikijs/primitive/dist/index.mjs +834 -0
- package/.next/standalone/node_modules/@shikijs/primitive/package.json +56 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/andromeeda.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/aurora-x.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/ayu-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/ayu-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/ayu-mirage.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/catppuccin-frappe.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/catppuccin-latte.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/catppuccin-macchiato.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/catppuccin-mocha.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/dark-plus.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/dracula-soft.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/dracula.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/everforest-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/everforest-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-dark-default.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-dark-dimmed.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-dark-high-contrast.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-light-default.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-light-high-contrast.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/github-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-dark-hard.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-dark-medium.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-dark-soft.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-light-hard.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-light-medium.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/gruvbox-light-soft.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/horizon-bright.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/horizon.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/houston.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/kanagawa-dragon.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/kanagawa-lotus.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/kanagawa-wave.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/laserwave.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/light-plus.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme-darker.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme-lighter.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme-ocean.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme-palenight.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/material-theme.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/min-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/min-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/monokai.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/night-owl-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/night-owl.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/nord.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/one-dark-pro.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/one-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/plastic.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/poimandres.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/red.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/rose-pine-dawn.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/rose-pine-moon.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/rose-pine.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/slack-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/slack-ochin.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/snazzy-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/solarized-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/solarized-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/synthwave-84.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/tokyo-night.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/vesper.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/vitesse-black.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/vitesse-dark.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/dist/vitesse-light.mjs +2 -0
- package/.next/standalone/node_modules/@shikijs/themes/package.json +106 -0
- package/.next/standalone/node_modules/@shikijs/types/dist/index.mjs +9 -0
- package/.next/standalone/node_modules/@shikijs/types/package.json +39 -0
- package/.next/standalone/node_modules/@shikijs/vscode-textmate/dist/index.js +3216 -0
- package/.next/standalone/node_modules/@shikijs/vscode-textmate/package.json +46 -0
- package/.next/standalone/node_modules/ccount/index.js +27 -0
- package/.next/standalone/node_modules/ccount/package.json +71 -0
- package/.next/standalone/node_modules/character-entities-html4/index.js +259 -0
- package/.next/standalone/node_modules/character-entities-html4/package.json +79 -0
- package/.next/standalone/node_modules/character-entities-legacy/index.js +113 -0
- package/.next/standalone/node_modules/character-entities-legacy/package.json +77 -0
- package/.next/standalone/node_modules/comma-separated-tokens/index.js +74 -0
- package/.next/standalone/node_modules/comma-separated-tokens/package.json +72 -0
- package/.next/standalone/node_modules/hast-util-to-html/index.js +8 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/comment.js +52 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/doctype.js +27 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/element.js +265 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/index.js +47 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/raw.js +27 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/root.js +22 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/handle/text.js +38 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/index.js +257 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/omission/closing.js +358 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/omission/omission.js +44 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/omission/opening.js +148 -0
- package/.next/standalone/node_modules/hast-util-to-html/lib/omission/util/siblings.js +50 -0
- package/.next/standalone/node_modules/hast-util-to-html/package.json +106 -0
- package/.next/standalone/node_modules/hast-util-whitespace/index.js +1 -0
- package/.next/standalone/node_modules/hast-util-whitespace/lib/index.js +34 -0
- package/.next/standalone/node_modules/hast-util-whitespace/package.json +83 -0
- package/.next/standalone/node_modules/html-void-elements/index.js +27 -0
- package/.next/standalone/node_modules/html-void-elements/package.json +79 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/parser/node-utils.js +2 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/parser/parse.js +2 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/tokenizer/tokenize.js +34 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/traverser/traverse.js +2 -0
- package/.next/standalone/node_modules/oniguruma-parser/dist/utils.js +2 -0
- package/.next/standalone/node_modules/oniguruma-parser/package.json +64 -0
- package/.next/standalone/node_modules/oniguruma-to-es/dist/esm/index.js +1878 -0
- package/.next/standalone/node_modules/oniguruma-to-es/dist/esm/package.json +1 -0
- package/.next/standalone/node_modules/oniguruma-to-es/package.json +61 -0
- package/.next/standalone/node_modules/property-information/index.js +17 -0
- package/.next/standalone/node_modules/property-information/lib/aria.js +61 -0
- package/.next/standalone/node_modules/property-information/lib/find.js +97 -0
- package/.next/standalone/node_modules/property-information/lib/hast-to-react.js +30 -0
- package/.next/standalone/node_modules/property-information/lib/html.js +332 -0
- package/.next/standalone/node_modules/property-information/lib/normalize.js +12 -0
- package/.next/standalone/node_modules/property-information/lib/svg.js +569 -0
- package/.next/standalone/node_modules/property-information/lib/util/case-insensitive-transform.js +13 -0
- package/.next/standalone/node_modules/property-information/lib/util/case-sensitive-transform.js +11 -0
- package/.next/standalone/node_modules/property-information/lib/util/create.js +69 -0
- package/.next/standalone/node_modules/property-information/lib/util/defined-info.js +60 -0
- package/.next/standalone/node_modules/property-information/lib/util/info.js +32 -0
- package/.next/standalone/node_modules/property-information/lib/util/merge.js +27 -0
- package/.next/standalone/node_modules/property-information/lib/util/schema.js +29 -0
- package/.next/standalone/node_modules/property-information/lib/util/types.js +13 -0
- package/.next/standalone/node_modules/property-information/lib/xlink.js +17 -0
- package/.next/standalone/node_modules/property-information/lib/xml.js +9 -0
- package/.next/standalone/node_modules/property-information/lib/xmlns.js +9 -0
- package/.next/standalone/node_modules/property-information/package.json +84 -0
- package/.next/standalone/node_modules/regex/package.json +60 -0
- package/.next/standalone/node_modules/regex/src/atomic.js +224 -0
- package/.next/standalone/node_modules/regex/src/internals.js +2 -0
- package/.next/standalone/node_modules/regex/src/subclass.js +98 -0
- package/.next/standalone/node_modules/regex/src/utils-internals.js +33 -0
- package/.next/standalone/node_modules/regex-recursion/package.json +47 -0
- package/.next/standalone/node_modules/regex-recursion/src/index.js +365 -0
- package/.next/standalone/node_modules/regex-utilities/package.json +35 -0
- package/.next/standalone/node_modules/regex-utilities/src/index.js +170 -0
- package/.next/standalone/node_modules/shiki/dist/bundle-full.mjs +41 -0
- package/.next/standalone/node_modules/shiki/dist/engine-oniguruma.mjs +8 -0
- package/.next/standalone/node_modules/shiki/dist/index.mjs +29 -0
- package/.next/standalone/node_modules/shiki/dist/langs-bundle-full-4noeO3oH.mjs +1283 -0
- package/.next/standalone/node_modules/shiki/dist/rolldown-runtime-BBjsoOtd.mjs +27 -0
- package/.next/standalone/node_modules/shiki/dist/themes.mjs +396 -0
- package/.next/standalone/node_modules/shiki/dist/wasm.mjs +3 -0
- package/.next/standalone/node_modules/shiki/package.json +73 -0
- package/.next/standalone/node_modules/space-separated-tokens/index.js +24 -0
- package/.next/standalone/node_modules/space-separated-tokens/package.json +67 -0
- package/.next/standalone/node_modules/stringify-entities/index.js +6 -0
- package/.next/standalone/node_modules/stringify-entities/lib/constant/dangerous.js +16 -0
- package/.next/standalone/node_modules/stringify-entities/lib/core.js +117 -0
- package/.next/standalone/node_modules/stringify-entities/lib/index.js +36 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/format-basic.js +9 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/format-smart.js +69 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/to-decimal.js +16 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/to-hexadecimal.js +16 -0
- package/.next/standalone/node_modules/stringify-entities/lib/util/to-named.js +57 -0
- package/.next/standalone/node_modules/stringify-entities/package.json +86 -0
- package/.next/standalone/node_modules/zwitch/index.js +118 -0
- package/.next/standalone/node_modules/zwitch/package.json +72 -0
- package/.next/standalone/package-lock.json +719 -672
- package/.next/standalone/package.json +2 -1
- package/.next/standalone/release-please-config.json +1 -0
- package/.next/standalone/scripts/validate-catalog.ts +38 -0
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/src/app/[...path]/route.ts +41 -0
- package/.next/standalone/src/app/ui/api/catalog/route.ts +32 -0
- package/.next/standalone/src/app/ui/api/global-mocks/[system]/[endpoint]/route.ts +53 -0
- package/.next/standalone/src/app/ui/api/global-mocks/route.ts +8 -0
- package/.next/standalone/src/app/ui/api/health/route.ts +47 -0
- package/.next/standalone/src/app/ui/api/logs/[logId]/route.ts +15 -0
- package/.next/standalone/src/app/ui/api/logs/route.ts +24 -0
- package/.next/standalone/src/app/ui/api/profiles/[profileId]/reset/route.ts +25 -0
- package/.next/standalone/src/app/ui/api/profiles/[profileId]/route.ts +64 -0
- package/.next/standalone/src/app/ui/catalog/highlight.ts +12 -0
- package/.next/standalone/src/app/ui/catalog/scenario-view.ts +68 -0
- package/.next/standalone/src/app/ui/global-mocks/actions.ts +50 -0
- package/.next/standalone/src/app/ui/logs/actions.ts +11 -0
- package/.next/standalone/src/app/ui/logs/list-state.ts +64 -0
- package/.next/standalone/src/app/ui/logs/types.ts +17 -0
- package/.next/standalone/src/app/ui/profiles/actions.ts +60 -0
- package/.next/standalone/src/lib/build-info.ts +13 -0
- package/.next/standalone/src/lib/catalog/find.ts +17 -0
- package/.next/standalone/src/lib/catalog/load.ts +226 -0
- package/.next/standalone/src/lib/catalog/path-template.ts +63 -0
- package/.next/standalone/src/lib/catalog/request-example.ts +96 -0
- package/.next/standalone/src/lib/catalog/schema.ts +154 -0
- package/.next/standalone/src/lib/catalog/selector.ts +153 -0
- package/.next/standalone/src/lib/catalog/types.ts +43 -0
- package/.next/standalone/src/lib/catalog/validate.ts +290 -0
- package/.next/standalone/src/lib/config.ts +93 -0
- package/.next/standalone/src/lib/dynamic/history-store.ts +68 -0
- package/.next/standalone/src/lib/environment.ts +155 -0
- package/.next/standalone/src/lib/format.ts +3 -0
- package/.next/standalone/src/lib/logs/admin-log.ts +27 -0
- package/.next/standalone/src/lib/logs/store.ts +153 -0
- package/.next/standalone/src/lib/mock-engine/fixtures.ts +38 -0
- package/.next/standalone/src/lib/mock-engine/resolver.ts +110 -0
- package/.next/standalone/src/lib/mock-engine/template.ts +71 -0
- package/.next/standalone/src/lib/mongo/embedded.ts +40 -0
- package/.next/standalone/src/lib/profiles/api-scenarios.ts +69 -0
- package/.next/standalone/src/lib/profiles/form.ts +64 -0
- package/.next/standalone/src/lib/profiles/stale.ts +56 -0
- package/.next/standalone/src/lib/profiles/store.ts +420 -0
- package/.next/standalone/src/lib/router/handler.ts +187 -0
- package/.next/standalone/src/lib/router/passthrough.ts +86 -0
- package/.next/standalone/src/lib/router/route-request.ts +645 -0
- package/.next/standalone/src/lib/runtime.ts +150 -0
- package/.next/standalone/src/lib/scenarios.ts +52 -0
- package/.next/standalone/src/lib/utils.ts +6 -0
- package/.next/standalone/tests/api/catalog-route.test.ts +72 -0
- package/.next/standalone/tests/api/global-mocks-route.test.ts +171 -0
- package/.next/standalone/tests/api/profiles-reset-route.test.ts +50 -0
- package/.next/standalone/tests/api/profiles-route.test.ts +132 -0
- package/.next/standalone/tests/bin/args.test.ts +42 -0
- package/.next/standalone/tests/catalog/find.test.ts +40 -0
- package/.next/standalone/tests/catalog/load.test.ts +258 -0
- package/.next/standalone/tests/catalog/path-template.test.ts +79 -0
- package/.next/standalone/tests/catalog/request-example.test.ts +86 -0
- package/.next/standalone/tests/catalog/schema.test.ts +249 -0
- package/.next/standalone/tests/catalog/selector.test.ts +175 -0
- package/.next/standalone/tests/catalog/validate.test.ts +462 -0
- package/.next/standalone/tests/dynamic/history-store.test.ts +82 -0
- package/.next/standalone/tests/global-mocks/actions.test.ts +192 -0
- package/.next/standalone/tests/lib/config-catalog-dir.test.ts +17 -0
- package/.next/standalone/tests/lib/config.test.ts +99 -0
- package/.next/standalone/tests/lib/environment.test.ts +115 -0
- package/.next/standalone/tests/lib/format.test.ts +8 -0
- package/.next/standalone/tests/lib/runtime.test.ts +153 -0
- package/.next/standalone/tests/lib/scenarios.test.ts +88 -0
- package/.next/standalone/tests/logs/admin-log.test.ts +51 -0
- package/.next/standalone/tests/logs/store.test.ts +233 -0
- package/.next/standalone/tests/mock-engine/fixtures.test.ts +33 -0
- package/.next/standalone/tests/mock-engine/resolver.test.ts +117 -0
- package/.next/standalone/tests/mock-engine/template.test.ts +74 -0
- package/.next/standalone/tests/mongo/embedded.test.ts +78 -0
- package/.next/standalone/tests/profiles/actions.test.ts +183 -0
- package/.next/standalone/tests/profiles/api-scenarios.test.ts +105 -0
- package/.next/standalone/tests/profiles/form.test.ts +181 -0
- package/.next/standalone/tests/profiles/request-log-ttl-index.test.ts +62 -0
- package/.next/standalone/tests/profiles/stale.test.ts +174 -0
- package/.next/standalone/tests/profiles/store.test.ts +470 -0
- package/.next/standalone/tests/router/dynamic.e2e.test.ts +147 -0
- package/.next/standalone/tests/router/handler.e2e.test.ts +97 -0
- package/.next/standalone/tests/router/handler.test.ts +344 -0
- package/.next/standalone/tests/router/passthrough.test.ts +100 -0
- package/.next/standalone/tests/router/route-request.test.ts +1147 -0
- package/.next/standalone/tests/testdata/fixtures/test-system/hello_world/by_amount.ts +3 -0
- package/.next/standalone/tests/testdata/fixtures/test-system/resolver_default/hold.json +1 -0
- package/.next/standalone/tests/testdata/fixtures/test-system/resolver_default/success.json +1 -0
- package/.next/standalone/tests/ui/list-state.test.ts +84 -0
- package/.next/standalone/tests/ui/log-summary-view.test.ts +24 -0
- package/.next/standalone/tests/ui/scenario-view.test.ts +138 -0
- package/.next/standalone/vitest.config.ts +19 -0
- package/package.json +2 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0668hgm._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__078olc9._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0f-_c79._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0geqpjb._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uudiqz._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wg041t._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__19qak1g._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1eiw7ks._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qb7sih._.js +0 -3
- package/.next/standalone/.next/server/chunks/_095ilyi._.js +0 -11
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05255v2._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dmadib._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jey74_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0nj8b73._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12oahit._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__14u5l1_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1bbz1wr._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1eoh3gn._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1kd5kn_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1kie6ah._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1u6i1bm._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ypwv93._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0a347_9._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0btcklf._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0exg_3l._.js +0 -11
- package/.next/standalone/.next/server/chunks/ssr/_1_7ssjl._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1hdkp-g._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1jfkfx-._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_10liiot._.js +0 -3
- package/.next/standalone/.next/static/chunks/08ghjqetuoc_b.js +0 -1
- package/.next/standalone/.next/static/chunks/19w2nv_pvssix.js +0 -1
- package/.next/standalone/.next/static/chunks/1ljc320o2yhky.js +0 -1
- package/.next/standalone/.next/static/chunks/2akx4rvdzbimg.css +0 -3
- package/.next/standalone/.next/static/chunks/2kg3qe34tmgob.js +0 -1
- package/.next/standalone/.next/static/chunks/2nlgh2oq4eg96.js +0 -1
- package/.next/standalone/.next/static/chunks/30olthhuj56a1.js +0 -1
- /package/.next/standalone/.next/static/{SV1UWx8kQm3m26f1jMoBU → 8CkjRpETX_8CM0X2xtdJ7}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{SV1UWx8kQm3m26f1jMoBU → 8CkjRpETX_8CM0X2xtdJ7}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{SV1UWx8kQm3m26f1jMoBU → 8CkjRpETX_8CM0X2xtdJ7}/_ssgManifest.js +0 -0
- /package/.next/standalone/catalog/hello-system/account_balance/{_dynamic.ts → dynamic.ts} +0 -0
|
@@ -0,0 +1,645 @@
|
|
|
1
|
+
import { matchPath, parsePathTemplate } from '../catalog/path-template'
|
|
2
|
+
import { schemaKey, type SchemaRegistry } from '../catalog/schema'
|
|
3
|
+
import {
|
|
4
|
+
extractProfileIdValue,
|
|
5
|
+
extractValue,
|
|
6
|
+
parseProfileIdSelector,
|
|
7
|
+
parseSelector,
|
|
8
|
+
RequestContext,
|
|
9
|
+
} from '../catalog/selector'
|
|
10
|
+
import type { Catalog, EndpointDef, SystemDef } from '../catalog/types'
|
|
11
|
+
import type { UnmockedUsers } from '../config'
|
|
12
|
+
import type { DynamicOwnerType } from '../dynamic/history-store'
|
|
13
|
+
import type { LogOutcome, LogTraceData } from '../logs/store'
|
|
14
|
+
import { FixtureError, type Fixture } from '../mock-engine/fixtures'
|
|
15
|
+
import {
|
|
16
|
+
DEFAULT_DYNAMIC_TIMEOUT_MS,
|
|
17
|
+
ResolverTimeoutError,
|
|
18
|
+
type CompiledResolver,
|
|
19
|
+
type ResolverInput,
|
|
20
|
+
} from '../mock-engine/resolver'
|
|
21
|
+
import { PlaceholderError, resolveTemplate } from '../mock-engine/template'
|
|
22
|
+
import {
|
|
23
|
+
ProfileKeyMappingConflictError,
|
|
24
|
+
type MockProfile,
|
|
25
|
+
type ProfileKeyMapping,
|
|
26
|
+
type ProfileKeyMappingCaptureInput,
|
|
27
|
+
type ScenarioSelection,
|
|
28
|
+
} from '../profiles/store'
|
|
29
|
+
import { DEFAULT_SCENARIO, implicitScenario, REAL_SCENARIO } from '../scenarios'
|
|
30
|
+
import type { PassthroughRequest, ProxiedResponse } from './passthrough'
|
|
31
|
+
|
|
32
|
+
export interface IncomingRequest {
|
|
33
|
+
method: string
|
|
34
|
+
path: string
|
|
35
|
+
search: string
|
|
36
|
+
headers: Record<string, string>
|
|
37
|
+
rawBody: Buffer | null
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface RouteResult {
|
|
41
|
+
status: number
|
|
42
|
+
headers: Record<string, string>
|
|
43
|
+
bodyBytes: Buffer
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Mutable per-request decision trace. The caller passes an empty object via
|
|
48
|
+
* RouterDeps.trace; each routing stage annotates it as it runs, so the
|
|
49
|
+
* resulting log entry is the actual decision path, not a reconstruction.
|
|
50
|
+
*/
|
|
51
|
+
export interface RouteTrace extends LogTraceData {
|
|
52
|
+
system?: string
|
|
53
|
+
endpoint?: string
|
|
54
|
+
profileId?: string
|
|
55
|
+
outcome?: LogOutcome
|
|
56
|
+
error?: { code: string; message: string }
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface RouterDeps {
|
|
60
|
+
catalog: Catalog
|
|
61
|
+
schemas?: SchemaRegistry
|
|
62
|
+
passthroughAsDefault: boolean
|
|
63
|
+
unmockedUsers: UnmockedUsers
|
|
64
|
+
timeoutMs: number
|
|
65
|
+
env: Record<string, string | undefined>
|
|
66
|
+
getProfile: (profileId: string) => Promise<MockProfile | null>
|
|
67
|
+
getGlobalMockScenario: (systemSlug: string, endpointName: string) => Promise<string | null>
|
|
68
|
+
getProfileKeyMapping: (namespace: string, key: string) => Promise<ProfileKeyMapping | null>
|
|
69
|
+
captureProfileKeyMapping: (input: ProfileKeyMappingCaptureInput) => Promise<void>
|
|
70
|
+
advanceScenarioProgress: (
|
|
71
|
+
profileId: string,
|
|
72
|
+
endpointName: string,
|
|
73
|
+
steps: string[],
|
|
74
|
+
) => Promise<number>
|
|
75
|
+
getCompiledResolver: (
|
|
76
|
+
systemSlug: string,
|
|
77
|
+
endpointName: string,
|
|
78
|
+
slug: string,
|
|
79
|
+
) => CompiledResolver | null
|
|
80
|
+
getDynamicHistory: (
|
|
81
|
+
ownerType: DynamicOwnerType,
|
|
82
|
+
ownerKey: string,
|
|
83
|
+
endpointName: string,
|
|
84
|
+
scenario: string,
|
|
85
|
+
) => Promise<string[]>
|
|
86
|
+
appendDynamicHistory: (
|
|
87
|
+
ownerType: DynamicOwnerType,
|
|
88
|
+
ownerKey: string,
|
|
89
|
+
endpointName: string,
|
|
90
|
+
scenario: string,
|
|
91
|
+
slug: string,
|
|
92
|
+
) => Promise<void>
|
|
93
|
+
dynamicResolverTimeoutMs?: number
|
|
94
|
+
passthrough: (req: PassthroughRequest) => Promise<ProxiedResponse>
|
|
95
|
+
loadFixture: (systemSlug: string, endpointName: string, scenario: string) => Fixture
|
|
96
|
+
now?: () => Date
|
|
97
|
+
trace?: RouteTrace
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function jsonResult(status: number, body: unknown): RouteResult {
|
|
101
|
+
return {
|
|
102
|
+
status,
|
|
103
|
+
headers: { 'content-type': 'application/json' },
|
|
104
|
+
bodyBytes: Buffer.from(JSON.stringify(body)),
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export async function routeRequest(
|
|
109
|
+
req: IncomingRequest,
|
|
110
|
+
deps: RouterDeps,
|
|
111
|
+
): Promise<RouteResult> {
|
|
112
|
+
const trace = deps.trace ?? {}
|
|
113
|
+
const match = findEndpoint(deps.catalog, req.method, req.path)
|
|
114
|
+
if (!match) {
|
|
115
|
+
traceError(trace, 'no_match', `no matching endpoint for ${req.method} ${req.path}`)
|
|
116
|
+
return jsonResult(404, { error: 'no matching endpoint', method: req.method, path: req.path })
|
|
117
|
+
}
|
|
118
|
+
const { system, endpoint, pathParams } = match
|
|
119
|
+
trace.system = system.slug
|
|
120
|
+
trace.endpoint = endpoint.name
|
|
121
|
+
const ctx: RequestContext = {
|
|
122
|
+
body: null,
|
|
123
|
+
pathParams,
|
|
124
|
+
query: new URLSearchParams(req.search),
|
|
125
|
+
headers: req.headers,
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (req.rawBody && req.rawBody.length > 0) {
|
|
129
|
+
try {
|
|
130
|
+
ctx.body = JSON.parse(req.rawBody.toString('utf8'))
|
|
131
|
+
} catch {
|
|
132
|
+
traceError(trace, 'invalid_json', 'invalid JSON request body')
|
|
133
|
+
return jsonResult(400, { error: 'invalid JSON request body', endpoint: endpoint.name })
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
let profileId: string | null = null
|
|
138
|
+
let scenario: string
|
|
139
|
+
if ((endpoint.mockType ?? 'profiled') === 'global') {
|
|
140
|
+
const globalPick = await deps.getGlobalMockScenario(system.slug, endpoint.name)
|
|
141
|
+
scenario = globalPick ?? implicitScenario(deps.passthroughAsDefault)
|
|
142
|
+
trace.scenario = scenario
|
|
143
|
+
trace.scenarioSource = globalPick === null ? 'implicit' : 'global'
|
|
144
|
+
} else {
|
|
145
|
+
const resolvedProfile = await resolveProfileId(endpoint, ctx, deps, trace)
|
|
146
|
+
if (!resolvedProfile.ok) return resolvedProfile.result
|
|
147
|
+
profileId = resolvedProfile.profileId
|
|
148
|
+
trace.profileId = profileId
|
|
149
|
+
|
|
150
|
+
const profile = await deps.getProfile(profileId)
|
|
151
|
+
|
|
152
|
+
if (!profile) {
|
|
153
|
+
switch (deps.unmockedUsers) {
|
|
154
|
+
case 'ERROR':
|
|
155
|
+
traceError(trace, 'profile_not_found', `profile "${profileId}" not found`)
|
|
156
|
+
return jsonResult(404, { error: `profile "${profileId}" not found`, endpoint: endpoint.name })
|
|
157
|
+
case 'DEFAULT_MOCK':
|
|
158
|
+
scenario = DEFAULT_SCENARIO
|
|
159
|
+
trace.scenarioSource = 'unmocked_policy'
|
|
160
|
+
break
|
|
161
|
+
case 'REAL':
|
|
162
|
+
scenario = REAL_SCENARIO
|
|
163
|
+
trace.scenarioSource = 'unmocked_policy'
|
|
164
|
+
break
|
|
165
|
+
}
|
|
166
|
+
} else {
|
|
167
|
+
// Profiles store only deviations from the configured implicit scenario
|
|
168
|
+
// (delta save); a missing entry means "follow the environment default".
|
|
169
|
+
scenario = await resolveScenarioSelection(
|
|
170
|
+
profile.endpointScenarios[endpoint.name],
|
|
171
|
+
endpoint,
|
|
172
|
+
profileId,
|
|
173
|
+
deps,
|
|
174
|
+
trace,
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
trace.scenario = scenario
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (endpoint.resolverScenarios.includes(scenario)) {
|
|
181
|
+
const resolved = await runResolver(system, endpoint, scenario, profileId, ctx, deps, trace)
|
|
182
|
+
if (!resolved.ok) return resolved.result
|
|
183
|
+
trace.resolver = { slug: scenario, returned: resolved.scenario }
|
|
184
|
+
scenario = resolved.scenario
|
|
185
|
+
trace.scenario = scenario
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (scenario === REAL_SCENARIO) {
|
|
189
|
+
const captureError = profileId
|
|
190
|
+
? await captureProfileKeys(system, endpoint, profileId, ctx, deps, trace)
|
|
191
|
+
: null
|
|
192
|
+
if (captureError) return captureError
|
|
193
|
+
return proxy(system, endpoint, req, deps, trace)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const compiled = deps.schemas?.get(schemaKey(system.slug, endpoint.name))
|
|
197
|
+
if (compiled) {
|
|
198
|
+
const issues = compiled.validateRequestBody(ctx.body)
|
|
199
|
+
if (issues.length > 0) {
|
|
200
|
+
setValidation(trace, 'request', 'failed')
|
|
201
|
+
traceError(trace, 'request_schema_invalid', 'request body does not match schema')
|
|
202
|
+
return jsonResult(400, {
|
|
203
|
+
error: 'request body does not match schema',
|
|
204
|
+
endpoint: endpoint.name,
|
|
205
|
+
details: issues,
|
|
206
|
+
})
|
|
207
|
+
}
|
|
208
|
+
setValidation(trace, 'request', 'ok')
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (profileId) {
|
|
212
|
+
const captureError = await captureProfileKeys(system, endpoint, profileId, ctx, deps, trace)
|
|
213
|
+
if (captureError) return captureError
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (!(scenario in endpoint.scenarios)) {
|
|
217
|
+
// Drift: a profile pinned a scenario the catalog no longer declares.
|
|
218
|
+
// "default" is always declared (startup-validated), so this can only
|
|
219
|
+
// happen for an explicit, non-default pin.
|
|
220
|
+
traceError(
|
|
221
|
+
trace,
|
|
222
|
+
'scenario_undeclared',
|
|
223
|
+
`scenario "${scenario}" is not declared for endpoint "${endpoint.name}"`,
|
|
224
|
+
)
|
|
225
|
+
return jsonResult(500, {
|
|
226
|
+
error: `scenario "${scenario}" is not declared for endpoint "${endpoint.name}"`,
|
|
227
|
+
endpoint: endpoint.name,
|
|
228
|
+
scenario,
|
|
229
|
+
})
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
try {
|
|
233
|
+
const fixture = deps.loadFixture(system.slug, endpoint.name, scenario)
|
|
234
|
+
const now = deps.now ? deps.now() : new Date()
|
|
235
|
+
const placeholders: Record<string, string> = {}
|
|
236
|
+
const body = resolveTemplate(fixture.body, ctx, now, placeholders)
|
|
237
|
+
if (compiled) {
|
|
238
|
+
const issues = compiled.validateResponseBody(fixture.status, body)
|
|
239
|
+
if (issues.length > 0) {
|
|
240
|
+
setValidation(trace, 'response', 'failed')
|
|
241
|
+
traceError(trace, 'response_schema_invalid', 'generated response does not match schema')
|
|
242
|
+
return jsonResult(500, {
|
|
243
|
+
error: 'generated response does not match schema',
|
|
244
|
+
endpoint: endpoint.name,
|
|
245
|
+
scenario,
|
|
246
|
+
details: issues,
|
|
247
|
+
})
|
|
248
|
+
}
|
|
249
|
+
setValidation(trace, 'response', 'ok')
|
|
250
|
+
}
|
|
251
|
+
const headers = {
|
|
252
|
+
'content-type': 'application/json',
|
|
253
|
+
...(resolveTemplate(fixture.headers ?? {}, ctx, now, placeholders) as Record<string, string>),
|
|
254
|
+
}
|
|
255
|
+
trace.placeholders = placeholders
|
|
256
|
+
trace.outcome = 'fixture'
|
|
257
|
+
return { status: fixture.status, headers, bodyBytes: Buffer.from(JSON.stringify(body)) }
|
|
258
|
+
} catch (err) {
|
|
259
|
+
if (err instanceof PlaceholderError || err instanceof FixtureError) {
|
|
260
|
+
traceError(trace, 'template_error', err.message)
|
|
261
|
+
return jsonResult(500, { error: err.message, endpoint: endpoint.name, scenario })
|
|
262
|
+
}
|
|
263
|
+
throw err
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function traceError(trace: RouteTrace, code: string, message: string): void {
|
|
268
|
+
trace.outcome = 'error'
|
|
269
|
+
trace.error = { code, message }
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function setValidation(
|
|
273
|
+
trace: RouteTrace,
|
|
274
|
+
side: 'request' | 'response',
|
|
275
|
+
result: 'ok' | 'failed' | 'drift_warning',
|
|
276
|
+
): void {
|
|
277
|
+
trace.validation = { ...trace.validation, [side]: result }
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// A sequence advances one step per served call and sticks on its last step;
|
|
281
|
+
// the progress counter lives in the store, keyed to the exact steps array.
|
|
282
|
+
async function resolveScenarioSelection(
|
|
283
|
+
selection: ScenarioSelection | undefined,
|
|
284
|
+
endpoint: EndpointDef,
|
|
285
|
+
profileId: string,
|
|
286
|
+
deps: RouterDeps,
|
|
287
|
+
trace: RouteTrace,
|
|
288
|
+
): Promise<string> {
|
|
289
|
+
if (!Array.isArray(selection)) {
|
|
290
|
+
trace.scenarioSource = selection === undefined ? 'implicit' : 'pin'
|
|
291
|
+
return selection ?? implicitScenario(deps.passthroughAsDefault)
|
|
292
|
+
}
|
|
293
|
+
if (selection.length === 0) {
|
|
294
|
+
trace.scenarioSource = 'implicit'
|
|
295
|
+
return implicitScenario(deps.passthroughAsDefault)
|
|
296
|
+
}
|
|
297
|
+
const served = await deps.advanceScenarioProgress(profileId, endpoint.name, selection)
|
|
298
|
+
const step = Math.min(served, selection.length)
|
|
299
|
+
trace.scenarioSource = 'sequence'
|
|
300
|
+
trace.sequence = { step, of: selection.length, served }
|
|
301
|
+
return selection[step - 1]
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
async function runResolver(
|
|
305
|
+
system: SystemDef,
|
|
306
|
+
endpoint: EndpointDef,
|
|
307
|
+
slug: string,
|
|
308
|
+
profileId: string | null,
|
|
309
|
+
ctx: RequestContext,
|
|
310
|
+
deps: RouterDeps,
|
|
311
|
+
trace: RouteTrace,
|
|
312
|
+
): Promise<{ ok: true; scenario: string } | { ok: false; result: RouteResult }> {
|
|
313
|
+
let compiled: CompiledResolver | null
|
|
314
|
+
try {
|
|
315
|
+
compiled = deps.getCompiledResolver(system.slug, endpoint.name, slug)
|
|
316
|
+
} catch (err) {
|
|
317
|
+
const message = err instanceof Error ? err.message : String(err)
|
|
318
|
+
traceError(trace, 'resolver_compile_error', message)
|
|
319
|
+
return {
|
|
320
|
+
ok: false,
|
|
321
|
+
result: jsonResult(500, {
|
|
322
|
+
error: 'scenario resolver failed to compile',
|
|
323
|
+
endpoint: endpoint.name,
|
|
324
|
+
scenario: slug,
|
|
325
|
+
message,
|
|
326
|
+
}),
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
if (!compiled) {
|
|
330
|
+
traceError(
|
|
331
|
+
trace,
|
|
332
|
+
'resolver_missing',
|
|
333
|
+
`scenario "${slug}" is resolver-backed but no compiled resolver was found for endpoint "${endpoint.name}"`,
|
|
334
|
+
)
|
|
335
|
+
return {
|
|
336
|
+
ok: false,
|
|
337
|
+
result: jsonResult(500, {
|
|
338
|
+
error: 'scenario resolver is missing',
|
|
339
|
+
endpoint: endpoint.name,
|
|
340
|
+
scenario: slug,
|
|
341
|
+
}),
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const ownerType: DynamicOwnerType = profileId ? 'profile' : 'global'
|
|
346
|
+
const ownerKey = profileId ?? system.slug
|
|
347
|
+
const history = await deps.getDynamicHistory(ownerType, ownerKey, endpoint.name, slug)
|
|
348
|
+
const input: ResolverInput = {
|
|
349
|
+
request: {
|
|
350
|
+
method: endpoint.method,
|
|
351
|
+
path: endpoint.path,
|
|
352
|
+
pathParams: ctx.pathParams,
|
|
353
|
+
query: queryToRecord(ctx.query),
|
|
354
|
+
headers: ctx.headers,
|
|
355
|
+
body: ctx.body,
|
|
356
|
+
},
|
|
357
|
+
history,
|
|
358
|
+
profileId,
|
|
359
|
+
}
|
|
360
|
+
// Isolate the resolver's input from the live request context: runResolver
|
|
361
|
+
// runs before request-schema validation, captureProfileKeys, and template
|
|
362
|
+
// resolution, all of which still read ctx. A resolver that mutates its input
|
|
363
|
+
// by reference must not be able to corrupt the response served afterward.
|
|
364
|
+
const isolatedInput = structuredClone(input)
|
|
365
|
+
|
|
366
|
+
let returned: unknown
|
|
367
|
+
try {
|
|
368
|
+
returned = compiled.invoke(isolatedInput, deps.dynamicResolverTimeoutMs ?? DEFAULT_DYNAMIC_TIMEOUT_MS)
|
|
369
|
+
} catch (err) {
|
|
370
|
+
if (err instanceof ResolverTimeoutError) {
|
|
371
|
+
traceError(trace, 'resolver_timeout', err.message)
|
|
372
|
+
} else {
|
|
373
|
+
traceError(trace, 'resolver_threw', err instanceof Error ? err.message : String(err))
|
|
374
|
+
}
|
|
375
|
+
return { ok: false, result: jsonResult(500, { error: 'scenario resolver failed', endpoint: endpoint.name, scenario: slug }) }
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// Return invariant: a fixture-backed declared slug, or "real". A
|
|
379
|
+
// resolver-backed slug (including this one) would chain resolvers — rejected.
|
|
380
|
+
if (
|
|
381
|
+
typeof returned !== 'string' ||
|
|
382
|
+
!(
|
|
383
|
+
returned === REAL_SCENARIO ||
|
|
384
|
+
(returned in endpoint.scenarios && !endpoint.resolverScenarios.includes(returned))
|
|
385
|
+
)
|
|
386
|
+
) {
|
|
387
|
+
traceError(
|
|
388
|
+
trace,
|
|
389
|
+
'resolver_bad_return',
|
|
390
|
+
`resolver "${slug}" returned an invalid scenario: ${JSON.stringify(returned)}`,
|
|
391
|
+
)
|
|
392
|
+
return {
|
|
393
|
+
ok: false,
|
|
394
|
+
result: jsonResult(500, {
|
|
395
|
+
error: 'scenario resolver returned an invalid scenario',
|
|
396
|
+
endpoint: endpoint.name,
|
|
397
|
+
scenario: slug,
|
|
398
|
+
returned,
|
|
399
|
+
}),
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
await deps.appendDynamicHistory(ownerType, ownerKey, endpoint.name, slug, returned)
|
|
404
|
+
return { ok: true, scenario: returned }
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
function queryToRecord(query: URLSearchParams): Record<string, string[]> {
|
|
408
|
+
const out: Record<string, string[]> = {}
|
|
409
|
+
for (const key of new Set(query.keys())) out[key] = query.getAll(key)
|
|
410
|
+
return out
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
async function resolveProfileId(
|
|
414
|
+
endpoint: EndpointDef,
|
|
415
|
+
ctx: RequestContext,
|
|
416
|
+
deps: RouterDeps,
|
|
417
|
+
trace: RouteTrace,
|
|
418
|
+
): Promise<{ ok: true; profileId: string } | { ok: false; result: RouteResult }> {
|
|
419
|
+
if (!endpoint.profileIdSelector) {
|
|
420
|
+
traceError(
|
|
421
|
+
trace,
|
|
422
|
+
'no_profile_selector',
|
|
423
|
+
`profiled endpoint "${endpoint.name}" has no profileIdSelector`,
|
|
424
|
+
)
|
|
425
|
+
return {
|
|
426
|
+
ok: false,
|
|
427
|
+
result: jsonResult(500, {
|
|
428
|
+
error: `profiled endpoint "${endpoint.name}" has no profileIdSelector`,
|
|
429
|
+
endpoint: endpoint.name,
|
|
430
|
+
}),
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
const selector = parseProfileIdSelector(endpoint.profileIdSelector)
|
|
434
|
+
const value = extractProfileIdValue(selector, ctx)
|
|
435
|
+
if (value === null) {
|
|
436
|
+
traceError(
|
|
437
|
+
trace,
|
|
438
|
+
'selector_unresolved',
|
|
439
|
+
`profile ID selector "${endpoint.profileIdSelector}" did not resolve`,
|
|
440
|
+
)
|
|
441
|
+
return {
|
|
442
|
+
ok: false,
|
|
443
|
+
result: jsonResult(400, {
|
|
444
|
+
error: `profile ID selector "${endpoint.profileIdSelector}" did not resolve`,
|
|
445
|
+
endpoint: endpoint.name,
|
|
446
|
+
}),
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
if (selector.source !== 'profileKey') {
|
|
450
|
+
trace.profileResolution = {
|
|
451
|
+
selector: endpoint.profileIdSelector,
|
|
452
|
+
value: String(value),
|
|
453
|
+
via: 'direct',
|
|
454
|
+
}
|
|
455
|
+
return { ok: true, profileId: String(value) }
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
const key = String(value)
|
|
459
|
+
const mapping = await deps.getProfileKeyMapping(selector.namespace, key)
|
|
460
|
+
if (!mapping) {
|
|
461
|
+
traceError(
|
|
462
|
+
trace,
|
|
463
|
+
'mapping_not_found',
|
|
464
|
+
`no profile key mapping for ${selector.namespace}/${key}`,
|
|
465
|
+
)
|
|
466
|
+
return {
|
|
467
|
+
ok: false,
|
|
468
|
+
result: jsonResult(404, {
|
|
469
|
+
error: 'profile_key_mapping_not_found',
|
|
470
|
+
namespace: selector.namespace,
|
|
471
|
+
key,
|
|
472
|
+
endpoint: endpoint.name,
|
|
473
|
+
}),
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
trace.profileResolution = {
|
|
477
|
+
selector: endpoint.profileIdSelector,
|
|
478
|
+
value: key,
|
|
479
|
+
via: { namespace: selector.namespace, key },
|
|
480
|
+
}
|
|
481
|
+
return { ok: true, profileId: mapping.profileId }
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
async function captureProfileKeys(
|
|
485
|
+
system: SystemDef,
|
|
486
|
+
endpoint: EndpointDef,
|
|
487
|
+
profileId: string,
|
|
488
|
+
ctx: RequestContext,
|
|
489
|
+
deps: RouterDeps,
|
|
490
|
+
trace: RouteTrace,
|
|
491
|
+
): Promise<RouteResult | null> {
|
|
492
|
+
for (const capture of endpoint.captureProfileKeys ?? []) {
|
|
493
|
+
const selector = parseSelector(capture.keySelector)
|
|
494
|
+
const value = extractValue(selector, ctx)
|
|
495
|
+
if (value === null) {
|
|
496
|
+
traceError(
|
|
497
|
+
trace,
|
|
498
|
+
'capture_unresolved',
|
|
499
|
+
`profile key selector "${capture.keySelector}" did not resolve`,
|
|
500
|
+
)
|
|
501
|
+
return jsonResult(400, {
|
|
502
|
+
error: `profile key selector "${capture.keySelector}" did not resolve`,
|
|
503
|
+
endpoint: endpoint.name,
|
|
504
|
+
namespace: capture.namespace,
|
|
505
|
+
})
|
|
506
|
+
}
|
|
507
|
+
try {
|
|
508
|
+
await deps.captureProfileKeyMapping({
|
|
509
|
+
namespace: capture.namespace,
|
|
510
|
+
key: String(value),
|
|
511
|
+
profileId,
|
|
512
|
+
capturedBy: { system: system.slug, endpoint: endpoint.name },
|
|
513
|
+
})
|
|
514
|
+
trace.captures = [...(trace.captures ?? []), { namespace: capture.namespace, key: String(value) }]
|
|
515
|
+
} catch (err) {
|
|
516
|
+
if (err instanceof ProfileKeyMappingConflictError) {
|
|
517
|
+
traceError(
|
|
518
|
+
trace,
|
|
519
|
+
'mapping_conflict',
|
|
520
|
+
`${err.namespace}/${err.key} already mapped to ${err.existingProfileId}`,
|
|
521
|
+
)
|
|
522
|
+
return jsonResult(409, {
|
|
523
|
+
error: 'profile_key_mapping_conflict',
|
|
524
|
+
namespace: err.namespace,
|
|
525
|
+
key: err.key,
|
|
526
|
+
existingProfileId: err.existingProfileId,
|
|
527
|
+
newProfileId: err.newProfileId,
|
|
528
|
+
})
|
|
529
|
+
}
|
|
530
|
+
throw err
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
return null
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
async function proxy(
|
|
537
|
+
system: SystemDef,
|
|
538
|
+
endpoint: EndpointDef,
|
|
539
|
+
req: IncomingRequest,
|
|
540
|
+
deps: RouterDeps,
|
|
541
|
+
trace: RouteTrace,
|
|
542
|
+
): Promise<RouteResult> {
|
|
543
|
+
const baseUrl = deps.env[system.baseUrlEnv]
|
|
544
|
+
if (!baseUrl) {
|
|
545
|
+
// Startup validation guarantees this is set when passthrough is the
|
|
546
|
+
// configured default; otherwise explicit passthrough selections can still
|
|
547
|
+
// reach this defensive, self-explaining route-time error.
|
|
548
|
+
traceError(trace, 'missing_base_url', `environment variable ${system.baseUrlEnv} is not set`)
|
|
549
|
+
return jsonResult(500, {
|
|
550
|
+
error: `environment variable ${system.baseUrlEnv} is not set`,
|
|
551
|
+
endpoint: endpoint.name,
|
|
552
|
+
})
|
|
553
|
+
}
|
|
554
|
+
const targetUrl = `${baseUrl}${req.path}${req.search}`
|
|
555
|
+
const startedAt = Date.now()
|
|
556
|
+
let proxied: ProxiedResponse
|
|
557
|
+
try {
|
|
558
|
+
proxied = await deps.passthrough({
|
|
559
|
+
baseUrl,
|
|
560
|
+
method: req.method,
|
|
561
|
+
path: req.path,
|
|
562
|
+
search: req.search,
|
|
563
|
+
headers: req.headers,
|
|
564
|
+
rawBody: req.rawBody,
|
|
565
|
+
timeoutMs: deps.timeoutMs,
|
|
566
|
+
})
|
|
567
|
+
} catch (err) {
|
|
568
|
+
const message = passthroughFailureMessage(err)
|
|
569
|
+
traceError(trace, 'passthrough_failed', `passthrough to ${targetUrl} failed: ${message}`)
|
|
570
|
+
return jsonResult(502, {
|
|
571
|
+
error: 'passthrough request failed',
|
|
572
|
+
endpoint: endpoint.name,
|
|
573
|
+
upstream: targetUrl,
|
|
574
|
+
message,
|
|
575
|
+
})
|
|
576
|
+
}
|
|
577
|
+
trace.outcome = 'passthrough'
|
|
578
|
+
trace.upstream = {
|
|
579
|
+
url: targetUrl,
|
|
580
|
+
status: proxied.status,
|
|
581
|
+
durationMs: Date.now() - startedAt,
|
|
582
|
+
}
|
|
583
|
+
warnOnSchemaDrift(system, endpoint, proxied, deps, trace)
|
|
584
|
+
return { status: proxied.status, headers: proxied.headers, bodyBytes: proxied.bodyBytes }
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
function passthroughFailureMessage(err: unknown): string {
|
|
588
|
+
const message = err instanceof Error ? err.message : String(err)
|
|
589
|
+
const code = err instanceof Error ? errorCode((err as Error & { cause?: unknown }).cause) : null
|
|
590
|
+
return code ? `${message} (${code})` : message
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
function errorCode(value: unknown): string | null {
|
|
594
|
+
if (!value || typeof value !== 'object') return null
|
|
595
|
+
const maybeCode = (value as { code?: unknown }).code
|
|
596
|
+
if (typeof maybeCode === 'string') return maybeCode
|
|
597
|
+
const maybeErrors = (value as { errors?: unknown }).errors
|
|
598
|
+
if (!Array.isArray(maybeErrors)) return null
|
|
599
|
+
for (const nested of maybeErrors) {
|
|
600
|
+
const nestedCode = errorCode(nested)
|
|
601
|
+
if (nestedCode) return nestedCode
|
|
602
|
+
}
|
|
603
|
+
return null
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// Warn-only drift probe: a real upstream response that violates _schema.json
|
|
607
|
+
// means the schema (and therefore the mocks validated against it) has drifted
|
|
608
|
+
// from reality. Never blocks or modifies the proxied response.
|
|
609
|
+
function warnOnSchemaDrift(
|
|
610
|
+
system: SystemDef,
|
|
611
|
+
endpoint: EndpointDef,
|
|
612
|
+
proxied: ProxiedResponse,
|
|
613
|
+
deps: RouterDeps,
|
|
614
|
+
trace: RouteTrace,
|
|
615
|
+
): void {
|
|
616
|
+
const compiled = deps.schemas?.get(schemaKey(system.slug, endpoint.name))
|
|
617
|
+
if (!compiled) return
|
|
618
|
+
const contentType = proxied.headers['content-type'] ?? ''
|
|
619
|
+
if (!contentType.includes('json')) return
|
|
620
|
+
let body: unknown
|
|
621
|
+
try {
|
|
622
|
+
body = JSON.parse(proxied.bodyBytes.toString('utf8'))
|
|
623
|
+
} catch {
|
|
624
|
+
return
|
|
625
|
+
}
|
|
626
|
+
const issues = compiled.validateResponseBody(proxied.status, body)
|
|
627
|
+
if (issues.length > 0) {
|
|
628
|
+
setValidation(trace, 'response', 'drift_warning')
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
function findEndpoint(
|
|
633
|
+
catalog: Catalog,
|
|
634
|
+
method: string,
|
|
635
|
+
path: string,
|
|
636
|
+
): { system: SystemDef; endpoint: EndpointDef; pathParams: Record<string, string> } | null {
|
|
637
|
+
for (const system of catalog.systems) {
|
|
638
|
+
for (const endpoint of system.endpoints) {
|
|
639
|
+
if (endpoint.method.toUpperCase() !== method.toUpperCase()) continue
|
|
640
|
+
const pathParams = matchPath(parsePathTemplate(endpoint.path), path)
|
|
641
|
+
if (pathParams) return { system, endpoint, pathParams }
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
return null
|
|
645
|
+
}
|