@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,1147 @@
|
|
|
1
|
+
import path from 'node:path'
|
|
2
|
+
import { describe, expect, it, vi } from 'vitest'
|
|
3
|
+
import { buildSchemaRegistry } from '../../src/lib/catalog/schema'
|
|
4
|
+
import type { Catalog } from '../../src/lib/catalog/types'
|
|
5
|
+
import { loadFixture } from '../../src/lib/mock-engine/fixtures'
|
|
6
|
+
import { ResolverRuntimeError } from '../../src/lib/mock-engine/resolver'
|
|
7
|
+
import {
|
|
8
|
+
ProfileKeyMappingConflictError,
|
|
9
|
+
type MockProfile,
|
|
10
|
+
type ProfileKeyMapping,
|
|
11
|
+
type ProfileKeyMappingCaptureInput,
|
|
12
|
+
} from '../../src/lib/profiles/store'
|
|
13
|
+
import type { PassthroughRequest, ProxiedResponse } from '../../src/lib/router/passthrough'
|
|
14
|
+
import {
|
|
15
|
+
IncomingRequest,
|
|
16
|
+
routeRequest,
|
|
17
|
+
RouterDeps,
|
|
18
|
+
type RouteTrace,
|
|
19
|
+
} from '../../src/lib/router/route-request'
|
|
20
|
+
|
|
21
|
+
const FIXTURES = path.join(__dirname, '../testdata/fixtures')
|
|
22
|
+
const NOW = new Date('2026-07-02T00:00:00.000Z')
|
|
23
|
+
|
|
24
|
+
const CATALOG: Catalog = {
|
|
25
|
+
systems: [
|
|
26
|
+
{
|
|
27
|
+
name: 'Test System',
|
|
28
|
+
slug: 'test-system',
|
|
29
|
+
baseUrlEnv: 'TEST_SYSTEM_URL',
|
|
30
|
+
endpoints: [
|
|
31
|
+
{
|
|
32
|
+
name: 'hello_world',
|
|
33
|
+
displayName: 'Hello World',
|
|
34
|
+
method: 'POST',
|
|
35
|
+
path: '/hello/world',
|
|
36
|
+
profileIdSelector: '$.customerId',
|
|
37
|
+
scenarios: { default: { label: 'Success' }, failure: { label: 'Failure' } },
|
|
38
|
+
resolverScenarios: [],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'capture_assessment',
|
|
42
|
+
displayName: 'Capture Assessment',
|
|
43
|
+
method: 'POST',
|
|
44
|
+
path: '/capture-assessment',
|
|
45
|
+
profileIdSelector: '$.customerId',
|
|
46
|
+
captureProfileKeys: [{ namespace: 'event-id', keySelector: '$.eventID' }],
|
|
47
|
+
scenarios: { default: { label: 'Success' } },
|
|
48
|
+
resolverScenarios: [],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'mapped_callback',
|
|
52
|
+
displayName: 'Mapped Callback',
|
|
53
|
+
method: 'POST',
|
|
54
|
+
path: '/callbacks/transaction',
|
|
55
|
+
profileIdSelector: 'profileKey:event-id:$.eventID',
|
|
56
|
+
scenarios: { default: { label: 'Success' } },
|
|
57
|
+
resolverScenarios: [],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'customer_status',
|
|
61
|
+
displayName: 'Customer Status',
|
|
62
|
+
method: 'GET',
|
|
63
|
+
path: '/customers/{customerId}/status',
|
|
64
|
+
profileIdSelector: 'path:customerId',
|
|
65
|
+
scenarios: { default: { label: 'Success' } },
|
|
66
|
+
resolverScenarios: [],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'lookup',
|
|
70
|
+
displayName: 'Lookup',
|
|
71
|
+
method: 'GET',
|
|
72
|
+
path: '/lookup',
|
|
73
|
+
profileIdSelector: 'query:cid',
|
|
74
|
+
scenarios: { default: { label: 'Success' } },
|
|
75
|
+
resolverScenarios: [],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'bearer_opaque',
|
|
79
|
+
displayName: 'Bearer Opaque',
|
|
80
|
+
method: 'GET',
|
|
81
|
+
path: '/bearer/opaque',
|
|
82
|
+
profileIdSelector: 'bearer',
|
|
83
|
+
scenarios: { default: { label: 'Success' } },
|
|
84
|
+
resolverScenarios: [],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'bearer_claim',
|
|
88
|
+
displayName: 'Bearer Claim',
|
|
89
|
+
method: 'GET',
|
|
90
|
+
path: '/bearer/claim',
|
|
91
|
+
profileIdSelector: 'bearer:sub',
|
|
92
|
+
scenarios: { default: { label: 'Success' } },
|
|
93
|
+
resolverScenarios: [],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'oauth_token',
|
|
97
|
+
displayName: 'OAuth Token',
|
|
98
|
+
method: 'POST',
|
|
99
|
+
path: '/oauth/token',
|
|
100
|
+
mockType: 'global',
|
|
101
|
+
scenarios: { default: { label: 'Success' }, expired: { label: 'Expired token' } },
|
|
102
|
+
resolverScenarios: [],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'template_fail',
|
|
106
|
+
displayName: 'Template Fail',
|
|
107
|
+
method: 'POST',
|
|
108
|
+
path: '/tpl',
|
|
109
|
+
profileIdSelector: '$.customerId',
|
|
110
|
+
scenarios: { default: { label: 'Success' } },
|
|
111
|
+
resolverScenarios: [],
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'dynamic_ep',
|
|
115
|
+
displayName: 'Dynamic Ep',
|
|
116
|
+
method: 'POST',
|
|
117
|
+
path: '/dynamic-ep',
|
|
118
|
+
profileIdSelector: '$.customerId',
|
|
119
|
+
scenarios: { default: { label: 'Success' }, failure: { label: 'Failure' }, dynamic: { label: 'dynamic' } },
|
|
120
|
+
resolverScenarios: ['dynamic'],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'resolver_default',
|
|
124
|
+
displayName: 'Resolver Default',
|
|
125
|
+
method: 'POST',
|
|
126
|
+
path: '/resolver-default',
|
|
127
|
+
profileIdSelector: '$.customerId',
|
|
128
|
+
scenarios: { default: { label: 'default' }, flaky: { label: 'flaky' }, hold: { label: 'Hold' }, success: { label: 'Success' } },
|
|
129
|
+
resolverScenarios: ['default', 'flaky'],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'schema_checked',
|
|
133
|
+
displayName: 'Schema Checked',
|
|
134
|
+
method: 'POST',
|
|
135
|
+
path: '/schema-checked',
|
|
136
|
+
profileIdSelector: '$.customerId',
|
|
137
|
+
scenarios: { default: { label: 'Success' }, bad_response: { label: 'Bad response' } },
|
|
138
|
+
resolverScenarios: [],
|
|
139
|
+
schema: {
|
|
140
|
+
requestBody: {
|
|
141
|
+
required: true,
|
|
142
|
+
content: {
|
|
143
|
+
'application/json': {
|
|
144
|
+
schema: {
|
|
145
|
+
type: 'object',
|
|
146
|
+
required: ['customerId'],
|
|
147
|
+
properties: {
|
|
148
|
+
customerId: { type: 'string' },
|
|
149
|
+
amount: { type: 'number' },
|
|
150
|
+
},
|
|
151
|
+
additionalProperties: false,
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
responses: {
|
|
157
|
+
'200': {
|
|
158
|
+
content: {
|
|
159
|
+
'application/json': {
|
|
160
|
+
schema: {
|
|
161
|
+
type: 'object',
|
|
162
|
+
required: ['customerId', 'ok'],
|
|
163
|
+
properties: {
|
|
164
|
+
customerId: { type: 'string' },
|
|
165
|
+
ok: { type: 'boolean' },
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function profile(overrides: Partial<MockProfile> = {}): MockProfile {
|
|
180
|
+
return {
|
|
181
|
+
profileId: 'c1',
|
|
182
|
+
endpointScenarios: {},
|
|
183
|
+
createdAt: NOW,
|
|
184
|
+
modifiedAt: NOW,
|
|
185
|
+
...overrides,
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function deps(overrides: Partial<RouterDeps> = {}): RouterDeps & {
|
|
190
|
+
passthroughCalls: PassthroughRequest[]
|
|
191
|
+
} {
|
|
192
|
+
const passthroughCalls: PassthroughRequest[] = []
|
|
193
|
+
const proxied: ProxiedResponse = {
|
|
194
|
+
status: 299,
|
|
195
|
+
headers: { 'x-proxied': '1' },
|
|
196
|
+
bodyBytes: Buffer.from('proxied'),
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
catalog: CATALOG,
|
|
200
|
+
passthroughAsDefault: false,
|
|
201
|
+
unmockedUsers: 'ERROR',
|
|
202
|
+
timeoutMs: 1000,
|
|
203
|
+
env: { TEST_SYSTEM_URL: 'http://real.example' },
|
|
204
|
+
getProfile: async () => null,
|
|
205
|
+
getGlobalMockScenario: async () => null,
|
|
206
|
+
getProfileKeyMapping: async () => null,
|
|
207
|
+
captureProfileKeyMapping: async () => {},
|
|
208
|
+
advanceScenarioProgress: async () => 1,
|
|
209
|
+
getCompiledResolver: () => null,
|
|
210
|
+
getDynamicHistory: async () => [],
|
|
211
|
+
appendDynamicHistory: async () => {},
|
|
212
|
+
passthrough: async (req) => {
|
|
213
|
+
passthroughCalls.push(req)
|
|
214
|
+
return proxied
|
|
215
|
+
},
|
|
216
|
+
loadFixture: (systemSlug, endpointName, scenario) =>
|
|
217
|
+
loadFixture(FIXTURES, systemSlug, endpointName, scenario),
|
|
218
|
+
now: () => NOW,
|
|
219
|
+
schemas: buildSchemaRegistry(CATALOG).schemas,
|
|
220
|
+
passthroughCalls,
|
|
221
|
+
...overrides,
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function post(pathname: string, body: unknown): IncomingRequest {
|
|
226
|
+
return {
|
|
227
|
+
method: 'POST',
|
|
228
|
+
path: pathname,
|
|
229
|
+
search: '',
|
|
230
|
+
headers: { 'content-type': 'application/json' },
|
|
231
|
+
rawBody: Buffer.from(JSON.stringify(body)),
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function get(pathname: string, search = ''): IncomingRequest {
|
|
236
|
+
return { method: 'GET', path: pathname, search, headers: {}, rawBody: null }
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function bearerGet(pathname: string, token: string): IncomingRequest {
|
|
240
|
+
return { ...get(pathname), headers: { authorization: `Bearer ${token}` } }
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function jwt(payload: Record<string, unknown>): string {
|
|
244
|
+
return [
|
|
245
|
+
Buffer.from(JSON.stringify({ alg: 'none', typ: 'JWT' })).toString('base64url'),
|
|
246
|
+
Buffer.from(JSON.stringify(payload)).toString('base64url'),
|
|
247
|
+
'signature',
|
|
248
|
+
].join('.')
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function json(result: { bodyBytes: Buffer }): Record<string, unknown> {
|
|
252
|
+
return JSON.parse(result.bodyBytes.toString('utf8'))
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const withProfile = (p: MockProfile) => async (id: string) =>
|
|
256
|
+
id === p.profileId ? p : null
|
|
257
|
+
|
|
258
|
+
function mapping(
|
|
259
|
+
overrides: Partial<ProfileKeyMapping> = {},
|
|
260
|
+
): ProfileKeyMapping {
|
|
261
|
+
return {
|
|
262
|
+
namespace: 'event-id',
|
|
263
|
+
key: 'evt-1',
|
|
264
|
+
profileId: 'c1',
|
|
265
|
+
capturedBy: { system: 'test-system', endpoint: 'hello_world' },
|
|
266
|
+
createdAt: NOW,
|
|
267
|
+
modifiedAt: NOW,
|
|
268
|
+
...overrides,
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
describe('mock path', () => {
|
|
273
|
+
it('serves the templated fixture for the selected scenario', async () => {
|
|
274
|
+
const d = deps({
|
|
275
|
+
getProfile: withProfile(profile({ profileId: 'c1', endpointScenarios: { hello_world: 'default' } })),
|
|
276
|
+
})
|
|
277
|
+
const res = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
278
|
+
expect(res.status).toBe(200)
|
|
279
|
+
expect(json(res)).toEqual({ customerId: 'c1', date: '20260702', ok: true })
|
|
280
|
+
expect(d.passthroughCalls).toHaveLength(0)
|
|
281
|
+
})
|
|
282
|
+
|
|
283
|
+
it('serves non-2xx failure fixtures as-is', async () => {
|
|
284
|
+
const d = deps({
|
|
285
|
+
getProfile: withProfile(profile({ endpointScenarios: { hello_world: 'failure' } })),
|
|
286
|
+
})
|
|
287
|
+
const res = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
288
|
+
expect(res.status).toBe(500)
|
|
289
|
+
expect(json(res)).toEqual({ ok: false })
|
|
290
|
+
})
|
|
291
|
+
|
|
292
|
+
it('extracts the profile ID from a path param and echoes it', async () => {
|
|
293
|
+
const d = deps({
|
|
294
|
+
getProfile: withProfile(profile({ profileId: 'cus-7', endpointScenarios: {} })),
|
|
295
|
+
})
|
|
296
|
+
const res = await routeRequest(get('/customers/cus-7/status'), d)
|
|
297
|
+
expect(res.status).toBe(200)
|
|
298
|
+
expect(json(res)).toEqual({ customerId: 'cus-7' })
|
|
299
|
+
})
|
|
300
|
+
|
|
301
|
+
it('extracts the profile ID from a query param and echoes it', async () => {
|
|
302
|
+
const d = deps({
|
|
303
|
+
getProfile: withProfile(profile({ profileId: 'q1', endpointScenarios: {} })),
|
|
304
|
+
})
|
|
305
|
+
const res = await routeRequest(get('/lookup', '?cid=q1'), d)
|
|
306
|
+
expect(res.status).toBe(200)
|
|
307
|
+
expect(json(res)).toEqual({ cid: 'q1' })
|
|
308
|
+
})
|
|
309
|
+
|
|
310
|
+
it('gap-fill: a profile with no pick for the endpoint gets "default"', async () => {
|
|
311
|
+
const d = deps({ getProfile: withProfile(profile({ endpointScenarios: {} })) })
|
|
312
|
+
const res = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
313
|
+
expect(res.status).toBe(200)
|
|
314
|
+
expect(json(res)).toEqual({ customerId: 'c1', date: '20260702', ok: true })
|
|
315
|
+
expect(d.passthroughCalls).toHaveLength(0)
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
it('gap-fill: PASSTHROUGH_AS_DEFAULT=true treats a profile with no pick as "real"', async () => {
|
|
319
|
+
const d = deps({
|
|
320
|
+
passthroughAsDefault: true,
|
|
321
|
+
getProfile: withProfile(profile({ endpointScenarios: {} })),
|
|
322
|
+
})
|
|
323
|
+
const res = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
324
|
+
expect(res.status).toBe(299)
|
|
325
|
+
expect(d.passthroughCalls).toHaveLength(1)
|
|
326
|
+
})
|
|
327
|
+
})
|
|
328
|
+
|
|
329
|
+
describe('scenario sequences', () => {
|
|
330
|
+
function fakeAdvance() {
|
|
331
|
+
const counts = new Map<string, number>()
|
|
332
|
+
const calls: Array<{ profileId: string; endpointName: string; steps: string[] }> = []
|
|
333
|
+
const fn = async (profileId: string, endpointName: string, steps: string[]) => {
|
|
334
|
+
calls.push({ profileId, endpointName, steps })
|
|
335
|
+
const key = `${profileId}/${endpointName}`
|
|
336
|
+
const n = (counts.get(key) ?? 0) + 1
|
|
337
|
+
counts.set(key, n)
|
|
338
|
+
return n
|
|
339
|
+
}
|
|
340
|
+
return { fn, calls }
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
it('serves sequence steps call-by-call and sticks on the last step', async () => {
|
|
344
|
+
const advance = fakeAdvance()
|
|
345
|
+
const d = deps({
|
|
346
|
+
getProfile: withProfile(
|
|
347
|
+
profile({ endpointScenarios: { hello_world: ['failure', 'default'] } }),
|
|
348
|
+
),
|
|
349
|
+
advanceScenarioProgress: advance.fn,
|
|
350
|
+
})
|
|
351
|
+
|
|
352
|
+
const first = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
353
|
+
const second = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
354
|
+
const third = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
355
|
+
|
|
356
|
+
expect(first.status).toBe(500)
|
|
357
|
+
expect(json(first)).toEqual({ ok: false })
|
|
358
|
+
expect(second.status).toBe(200)
|
|
359
|
+
expect(json(second)).toEqual({ customerId: 'c1', date: '20260702', ok: true })
|
|
360
|
+
expect(third.status).toBe(200)
|
|
361
|
+
})
|
|
362
|
+
|
|
363
|
+
it('advances progress with the profile id, endpoint name, and saved steps', async () => {
|
|
364
|
+
const advance = fakeAdvance()
|
|
365
|
+
const d = deps({
|
|
366
|
+
getProfile: withProfile(
|
|
367
|
+
profile({ endpointScenarios: { hello_world: ['failure', 'default'] } }),
|
|
368
|
+
),
|
|
369
|
+
advanceScenarioProgress: advance.fn,
|
|
370
|
+
})
|
|
371
|
+
|
|
372
|
+
await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
373
|
+
|
|
374
|
+
expect(advance.calls).toEqual([
|
|
375
|
+
{ profileId: 'c1', endpointName: 'hello_world', steps: ['failure', 'default'] },
|
|
376
|
+
])
|
|
377
|
+
})
|
|
378
|
+
|
|
379
|
+
it('does not advance progress for single-scenario selections', async () => {
|
|
380
|
+
const advance = fakeAdvance()
|
|
381
|
+
const d = deps({
|
|
382
|
+
getProfile: withProfile(profile({ endpointScenarios: { hello_world: 'default' } })),
|
|
383
|
+
advanceScenarioProgress: advance.fn,
|
|
384
|
+
})
|
|
385
|
+
|
|
386
|
+
await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
387
|
+
|
|
388
|
+
expect(advance.calls).toHaveLength(0)
|
|
389
|
+
})
|
|
390
|
+
|
|
391
|
+
it('treats an empty sequence like no selection (implicit scenario)', async () => {
|
|
392
|
+
const advance = fakeAdvance()
|
|
393
|
+
const d = deps({
|
|
394
|
+
getProfile: withProfile(profile({ endpointScenarios: { hello_world: [] } })),
|
|
395
|
+
advanceScenarioProgress: advance.fn,
|
|
396
|
+
})
|
|
397
|
+
|
|
398
|
+
const res = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
399
|
+
|
|
400
|
+
expect(res.status).toBe(200)
|
|
401
|
+
expect(json(res)).toEqual({ customerId: 'c1', date: '20260702', ok: true })
|
|
402
|
+
expect(advance.calls).toHaveLength(0)
|
|
403
|
+
})
|
|
404
|
+
|
|
405
|
+
it('proxies to the real upstream when the current step is "real"', async () => {
|
|
406
|
+
const advance = fakeAdvance()
|
|
407
|
+
const d = deps({
|
|
408
|
+
getProfile: withProfile(
|
|
409
|
+
profile({ endpointScenarios: { hello_world: ['real', 'default'] } }),
|
|
410
|
+
),
|
|
411
|
+
advanceScenarioProgress: advance.fn,
|
|
412
|
+
})
|
|
413
|
+
|
|
414
|
+
const first = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
415
|
+
const second = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
416
|
+
|
|
417
|
+
expect(first.status).toBe(299)
|
|
418
|
+
expect(d.passthroughCalls).toHaveLength(1)
|
|
419
|
+
expect(second.status).toBe(200)
|
|
420
|
+
})
|
|
421
|
+
})
|
|
422
|
+
|
|
423
|
+
describe('log trace', () => {
|
|
424
|
+
it('records the full decision trace for a pinned fixture response', async () => {
|
|
425
|
+
const trace: RouteTrace = {}
|
|
426
|
+
const d = deps({
|
|
427
|
+
getProfile: withProfile(profile({ endpointScenarios: { hello_world: 'default' } })),
|
|
428
|
+
trace,
|
|
429
|
+
})
|
|
430
|
+
|
|
431
|
+
await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
432
|
+
|
|
433
|
+
expect(trace.system).toBe('test-system')
|
|
434
|
+
expect(trace.endpoint).toBe('hello_world')
|
|
435
|
+
expect(trace.profileId).toBe('c1')
|
|
436
|
+
expect(trace.profileResolution).toEqual({ selector: '$.customerId', value: 'c1', via: 'direct' })
|
|
437
|
+
expect(trace.scenario).toBe('default')
|
|
438
|
+
expect(trace.scenarioSource).toBe('pin')
|
|
439
|
+
expect(trace.outcome).toBe('fixture')
|
|
440
|
+
expect(trace.placeholders).toEqual({
|
|
441
|
+
'{{$.customerId}}': 'c1',
|
|
442
|
+
'{{now:YYYYMMDD}}': '20260702',
|
|
443
|
+
})
|
|
444
|
+
})
|
|
445
|
+
|
|
446
|
+
it('records the implicit source when the profile has no pick', async () => {
|
|
447
|
+
const trace: RouteTrace = {}
|
|
448
|
+
const d = deps({ getProfile: withProfile(profile({ endpointScenarios: {} })), trace })
|
|
449
|
+
await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
450
|
+
expect(trace.scenarioSource).toBe('implicit')
|
|
451
|
+
expect(trace.scenario).toBe('default')
|
|
452
|
+
})
|
|
453
|
+
|
|
454
|
+
it('records the sequence position when a sequence serves the call', async () => {
|
|
455
|
+
const trace: RouteTrace = {}
|
|
456
|
+
const d = deps({
|
|
457
|
+
getProfile: withProfile(
|
|
458
|
+
profile({ endpointScenarios: { hello_world: ['failure', 'default'] } }),
|
|
459
|
+
),
|
|
460
|
+
advanceScenarioProgress: async () => 3,
|
|
461
|
+
trace,
|
|
462
|
+
})
|
|
463
|
+
|
|
464
|
+
await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
465
|
+
|
|
466
|
+
expect(trace.scenarioSource).toBe('sequence')
|
|
467
|
+
expect(trace.sequence).toEqual({ step: 2, of: 2, served: 3 })
|
|
468
|
+
expect(trace.scenario).toBe('default')
|
|
469
|
+
})
|
|
470
|
+
|
|
471
|
+
it('records profile-key resolution and captured keys', async () => {
|
|
472
|
+
const resolveTrace: RouteTrace = {}
|
|
473
|
+
const d = deps({
|
|
474
|
+
getProfile: withProfile(profile({ profileId: 'c1', endpointScenarios: {} })),
|
|
475
|
+
getProfileKeyMapping: async () => mapping(),
|
|
476
|
+
trace: resolveTrace,
|
|
477
|
+
})
|
|
478
|
+
await routeRequest(post('/callbacks/transaction', { eventID: 'evt-1' }), d)
|
|
479
|
+
expect(resolveTrace.profileResolution).toEqual({
|
|
480
|
+
selector: 'profileKey:event-id:$.eventID',
|
|
481
|
+
value: 'evt-1',
|
|
482
|
+
via: { namespace: 'event-id', key: 'evt-1' },
|
|
483
|
+
})
|
|
484
|
+
|
|
485
|
+
const captureTrace: RouteTrace = {}
|
|
486
|
+
const d2 = deps({
|
|
487
|
+
getProfile: withProfile(profile({ profileId: 'c1', endpointScenarios: {} })),
|
|
488
|
+
trace: captureTrace,
|
|
489
|
+
})
|
|
490
|
+
await routeRequest(post('/capture-assessment', { customerId: 'c1', eventID: 'evt-9' }), d2)
|
|
491
|
+
expect(captureTrace.captures).toEqual([{ namespace: 'event-id', key: 'evt-9' }])
|
|
492
|
+
})
|
|
493
|
+
|
|
494
|
+
it('records error outcomes with a code', async () => {
|
|
495
|
+
const noMatch: RouteTrace = {}
|
|
496
|
+
await routeRequest(post('/nope', {}), deps({ trace: noMatch }))
|
|
497
|
+
expect(noMatch.outcome).toBe('error')
|
|
498
|
+
expect(noMatch.error?.code).toBe('no_match')
|
|
499
|
+
|
|
500
|
+
const noMapping: RouteTrace = {}
|
|
501
|
+
await routeRequest(
|
|
502
|
+
post('/callbacks/transaction', { eventID: 'evt-404' }),
|
|
503
|
+
deps({ trace: noMapping }),
|
|
504
|
+
)
|
|
505
|
+
expect(noMapping.outcome).toBe('error')
|
|
506
|
+
expect(noMapping.error?.code).toBe('mapping_not_found')
|
|
507
|
+
})
|
|
508
|
+
|
|
509
|
+
it('records upstream details for passthrough responses', async () => {
|
|
510
|
+
const trace: RouteTrace = {}
|
|
511
|
+
const d = deps({
|
|
512
|
+
getProfile: withProfile(profile({ endpointScenarios: { hello_world: 'real' } })),
|
|
513
|
+
trace,
|
|
514
|
+
})
|
|
515
|
+
|
|
516
|
+
await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
517
|
+
|
|
518
|
+
expect(trace.outcome).toBe('passthrough')
|
|
519
|
+
expect(trace.upstream?.url).toBe('http://real.example/hello/world')
|
|
520
|
+
expect(trace.upstream?.status).toBe(299)
|
|
521
|
+
expect(typeof trace.upstream?.durationMs).toBe('number')
|
|
522
|
+
})
|
|
523
|
+
|
|
524
|
+
it('records the unmocked-users policy branch', async () => {
|
|
525
|
+
const trace: RouteTrace = {}
|
|
526
|
+
const d = deps({ unmockedUsers: 'DEFAULT_MOCK', getProfile: async () => null, trace })
|
|
527
|
+
await routeRequest(post('/hello/world', { customerId: 'ghost' }), d)
|
|
528
|
+
expect(trace.scenarioSource).toBe('unmocked_policy')
|
|
529
|
+
expect(trace.scenario).toBe('default')
|
|
530
|
+
})
|
|
531
|
+
})
|
|
532
|
+
|
|
533
|
+
describe('bearer profile selectors', () => {
|
|
534
|
+
const fixture = () => ({ status: 200, headers: {}, body: { ok: true } })
|
|
535
|
+
|
|
536
|
+
it('uses an opaque bearer token as the profile ID', async () => {
|
|
537
|
+
const trace: RouteTrace = {}
|
|
538
|
+
const d = deps({
|
|
539
|
+
getProfile: withProfile(profile({ profileId: 'customer-123' })),
|
|
540
|
+
loadFixture: fixture,
|
|
541
|
+
trace,
|
|
542
|
+
})
|
|
543
|
+
|
|
544
|
+
const res = await routeRequest(bearerGet('/bearer/opaque', 'customer-123'), d)
|
|
545
|
+
|
|
546
|
+
expect(res.status).toBe(200)
|
|
547
|
+
expect(json(res)).toEqual({ ok: true })
|
|
548
|
+
expect(trace.profileId).toBe('customer-123')
|
|
549
|
+
expect(trace.profileResolution).toEqual({
|
|
550
|
+
selector: 'bearer',
|
|
551
|
+
value: 'customer-123',
|
|
552
|
+
via: 'direct',
|
|
553
|
+
})
|
|
554
|
+
})
|
|
555
|
+
|
|
556
|
+
it('uses a scalar top-level JWT claim as the profile ID', async () => {
|
|
557
|
+
const trace: RouteTrace = {}
|
|
558
|
+
const d = deps({
|
|
559
|
+
getProfile: withProfile(profile({ profileId: 'customer-456' })),
|
|
560
|
+
loadFixture: fixture,
|
|
561
|
+
trace,
|
|
562
|
+
})
|
|
563
|
+
|
|
564
|
+
const res = await routeRequest(
|
|
565
|
+
bearerGet('/bearer/claim', jwt({ sub: 'customer-456' })),
|
|
566
|
+
d,
|
|
567
|
+
)
|
|
568
|
+
|
|
569
|
+
expect(res.status).toBe(200)
|
|
570
|
+
expect(trace.profileId).toBe('customer-456')
|
|
571
|
+
expect(trace.profileResolution).toEqual({
|
|
572
|
+
selector: 'bearer:sub',
|
|
573
|
+
value: 'customer-456',
|
|
574
|
+
via: 'direct',
|
|
575
|
+
})
|
|
576
|
+
})
|
|
577
|
+
|
|
578
|
+
it('returns 400 when the bearer header or selected JWT claim does not resolve', async () => {
|
|
579
|
+
const missingHeader = await routeRequest(get('/bearer/opaque'), deps())
|
|
580
|
+
const missingClaim = await routeRequest(
|
|
581
|
+
bearerGet('/bearer/claim', jwt({ aud: 'mock' })),
|
|
582
|
+
deps(),
|
|
583
|
+
)
|
|
584
|
+
|
|
585
|
+
expect(missingHeader.status).toBe(400)
|
|
586
|
+
expect(json(missingHeader).error).toMatch(/bearer/)
|
|
587
|
+
expect(missingClaim.status).toBe(400)
|
|
588
|
+
expect(json(missingClaim).error).toMatch(/bearer:sub/)
|
|
589
|
+
})
|
|
590
|
+
})
|
|
591
|
+
|
|
592
|
+
describe('profile key mappings', () => {
|
|
593
|
+
it('captures configured keys for direct-profile requests before serving the fixture', async () => {
|
|
594
|
+
const captures: ProfileKeyMappingCaptureInput[] = []
|
|
595
|
+
const d = deps({
|
|
596
|
+
getProfile: withProfile(profile({ profileId: 'c1', endpointScenarios: {} })),
|
|
597
|
+
captureProfileKeyMapping: async (input: ProfileKeyMappingCaptureInput) => {
|
|
598
|
+
captures.push(input)
|
|
599
|
+
},
|
|
600
|
+
} as Partial<RouterDeps>)
|
|
601
|
+
|
|
602
|
+
const res = await routeRequest(post('/capture-assessment', { customerId: 'c1', eventID: 'evt-1' }), d)
|
|
603
|
+
|
|
604
|
+
expect(res.status).toBe(200)
|
|
605
|
+
expect(captures).toEqual([
|
|
606
|
+
{
|
|
607
|
+
namespace: 'event-id',
|
|
608
|
+
key: 'evt-1',
|
|
609
|
+
profileId: 'c1',
|
|
610
|
+
capturedBy: { system: 'test-system', endpoint: 'capture_assessment' },
|
|
611
|
+
},
|
|
612
|
+
])
|
|
613
|
+
})
|
|
614
|
+
|
|
615
|
+
it('returns 409 and does not proxy when capture conflicts on a real request', async () => {
|
|
616
|
+
const d = deps({
|
|
617
|
+
getProfile: withProfile(profile({ endpointScenarios: { capture_assessment: 'real' } })),
|
|
618
|
+
captureProfileKeyMapping: async () => {
|
|
619
|
+
throw new ProfileKeyMappingConflictError('event-id', 'evt-1', 'other-account', 'c1')
|
|
620
|
+
},
|
|
621
|
+
} as Partial<RouterDeps>)
|
|
622
|
+
|
|
623
|
+
const res = await routeRequest(post('/capture-assessment', { customerId: 'c1', eventID: 'evt-1' }), d)
|
|
624
|
+
|
|
625
|
+
expect(res.status).toBe(409)
|
|
626
|
+
expect(json(res)).toEqual({
|
|
627
|
+
error: 'profile_key_mapping_conflict',
|
|
628
|
+
namespace: 'event-id',
|
|
629
|
+
key: 'evt-1',
|
|
630
|
+
existingProfileId: 'other-account',
|
|
631
|
+
newProfileId: 'c1',
|
|
632
|
+
})
|
|
633
|
+
expect(d.passthroughCalls).toHaveLength(0)
|
|
634
|
+
})
|
|
635
|
+
|
|
636
|
+
it('resolves profile ids through profileKey mappings', async () => {
|
|
637
|
+
const seenProfileIds: string[] = []
|
|
638
|
+
const d = deps({
|
|
639
|
+
getProfileKeyMapping: async (namespace: string, key: string) =>
|
|
640
|
+
namespace === 'event-id' && key === 'evt-1' ? mapping() : null,
|
|
641
|
+
getProfile: async (id: string) => {
|
|
642
|
+
seenProfileIds.push(id)
|
|
643
|
+
return id === 'c1' ? profile({ profileId: 'c1', endpointScenarios: {} }) : null
|
|
644
|
+
},
|
|
645
|
+
} as Partial<RouterDeps>)
|
|
646
|
+
|
|
647
|
+
const res = await routeRequest(post('/callbacks/transaction', { eventID: 'evt-1' }), d)
|
|
648
|
+
|
|
649
|
+
expect(res.status).toBe(200)
|
|
650
|
+
expect(json(res)).toEqual({ ok: true })
|
|
651
|
+
expect(seenProfileIds).toEqual(['c1'])
|
|
652
|
+
})
|
|
653
|
+
|
|
654
|
+
it('returns 400 when the mapped selector key is missing from the request', async () => {
|
|
655
|
+
const res = await routeRequest(post('/callbacks/transaction', {}), deps())
|
|
656
|
+
|
|
657
|
+
expect(res.status).toBe(400)
|
|
658
|
+
expect(json(res).error).toMatch(/profileKey:event-id:\$\.eventID/)
|
|
659
|
+
})
|
|
660
|
+
|
|
661
|
+
it('returns 404 when the mapped key has not been captured', async () => {
|
|
662
|
+
const d = deps({
|
|
663
|
+
getProfileKeyMapping: async () => null,
|
|
664
|
+
} as Partial<RouterDeps>)
|
|
665
|
+
|
|
666
|
+
const res = await routeRequest(post('/callbacks/transaction', { eventID: 'evt-404' }), d)
|
|
667
|
+
|
|
668
|
+
expect(res.status).toBe(404)
|
|
669
|
+
expect(json(res)).toEqual({
|
|
670
|
+
error: 'profile_key_mapping_not_found',
|
|
671
|
+
namespace: 'event-id',
|
|
672
|
+
key: 'evt-404',
|
|
673
|
+
endpoint: 'mapped_callback',
|
|
674
|
+
})
|
|
675
|
+
})
|
|
676
|
+
})
|
|
677
|
+
|
|
678
|
+
describe('real path (explicit profile pin)', () => {
|
|
679
|
+
it('proxies when the profile selects real', async () => {
|
|
680
|
+
const d = deps({
|
|
681
|
+
getProfile: withProfile(profile({ endpointScenarios: { hello_world: 'real' } })),
|
|
682
|
+
})
|
|
683
|
+
const res = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
684
|
+
expect(res.status).toBe(299)
|
|
685
|
+
expect(d.passthroughCalls).toHaveLength(1)
|
|
686
|
+
expect(d.passthroughCalls[0].baseUrl).toBe('http://real.example')
|
|
687
|
+
expect(d.passthroughCalls[0].path).toBe('/hello/world')
|
|
688
|
+
})
|
|
689
|
+
|
|
690
|
+
it('500s when the baseUrlEnv is not set', async () => {
|
|
691
|
+
const d = deps({
|
|
692
|
+
env: {},
|
|
693
|
+
getProfile: withProfile(profile({ endpointScenarios: { hello_world: 'real' } })),
|
|
694
|
+
})
|
|
695
|
+
const res = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
696
|
+
expect(res.status).toBe(500)
|
|
697
|
+
expect(json(res).error).toMatch(/TEST_SYSTEM_URL/)
|
|
698
|
+
})
|
|
699
|
+
})
|
|
700
|
+
|
|
701
|
+
describe('global mock path', () => {
|
|
702
|
+
it('serves default for a global endpoint with no saved selection when passthrough is not default', async () => {
|
|
703
|
+
const seenProfileIds: string[] = []
|
|
704
|
+
const d = deps({
|
|
705
|
+
getProfile: async (id: string) => {
|
|
706
|
+
seenProfileIds.push(id)
|
|
707
|
+
return null
|
|
708
|
+
},
|
|
709
|
+
getGlobalMockScenario: async () => null,
|
|
710
|
+
})
|
|
711
|
+
const res = await routeRequest(post('/oauth/token', { client_id: 'test' }), d)
|
|
712
|
+
expect(res.status).toBe(200)
|
|
713
|
+
expect(json(res)).toEqual({ access_token: 'mock-token', token_type: 'Bearer' })
|
|
714
|
+
expect(seenProfileIds).toEqual([])
|
|
715
|
+
expect(d.passthroughCalls).toHaveLength(0)
|
|
716
|
+
})
|
|
717
|
+
|
|
718
|
+
it('serves a saved global fixture scenario', async () => {
|
|
719
|
+
const d = deps({ getGlobalMockScenario: async () => 'expired' })
|
|
720
|
+
const res = await routeRequest(post('/oauth/token', { client_id: 'test' }), d)
|
|
721
|
+
expect(res.status).toBe(401)
|
|
722
|
+
expect(json(res)).toEqual({ error: 'expired_token' })
|
|
723
|
+
})
|
|
724
|
+
|
|
725
|
+
it('proxies a global endpoint with no saved selection when passthrough is default', async () => {
|
|
726
|
+
const d = deps({ passthroughAsDefault: true, getGlobalMockScenario: async () => null })
|
|
727
|
+
const res = await routeRequest(post('/oauth/token', { client_id: 'test' }), d)
|
|
728
|
+
expect(res.status).toBe(299)
|
|
729
|
+
expect(d.passthroughCalls).toHaveLength(1)
|
|
730
|
+
})
|
|
731
|
+
|
|
732
|
+
it('500s when a global endpoint resolves to real but its baseUrlEnv is missing', async () => {
|
|
733
|
+
const d = deps({
|
|
734
|
+
env: {},
|
|
735
|
+
getGlobalMockScenario: async () => 'real',
|
|
736
|
+
})
|
|
737
|
+
const res = await routeRequest(post('/oauth/token', { client_id: 'test' }), d)
|
|
738
|
+
expect(res.status).toBe(500)
|
|
739
|
+
expect(json(res).error).toMatch(/TEST_SYSTEM_URL/)
|
|
740
|
+
})
|
|
741
|
+
})
|
|
742
|
+
|
|
743
|
+
describe('malformed requests — always loud, in every configuration', () => {
|
|
744
|
+
it.each(['ERROR', 'DEFAULT_MOCK', 'REAL'] as const)(
|
|
745
|
+
'404s on unknown endpoint (UNMOCKED_USERS=%s)',
|
|
746
|
+
async (unmockedUsers) => {
|
|
747
|
+
const res = await routeRequest(post('/nope', {}), deps({ unmockedUsers }))
|
|
748
|
+
expect(res.status).toBe(404)
|
|
749
|
+
expect(json(res).error).toMatch(/no matching endpoint/)
|
|
750
|
+
},
|
|
751
|
+
)
|
|
752
|
+
|
|
753
|
+
it.each(['ERROR', 'DEFAULT_MOCK', 'REAL'] as const)(
|
|
754
|
+
'400s on invalid JSON body (UNMOCKED_USERS=%s)',
|
|
755
|
+
async (unmockedUsers) => {
|
|
756
|
+
const d = deps({ unmockedUsers })
|
|
757
|
+
const res = await routeRequest(
|
|
758
|
+
{ ...post('/hello/world', {}), rawBody: Buffer.from('{not json') },
|
|
759
|
+
d,
|
|
760
|
+
)
|
|
761
|
+
expect(res.status).toBe(400)
|
|
762
|
+
expect(d.passthroughCalls).toHaveLength(0)
|
|
763
|
+
},
|
|
764
|
+
)
|
|
765
|
+
|
|
766
|
+
it('400s when the selector does not resolve', async () => {
|
|
767
|
+
const res = await routeRequest(post('/hello/world', { other: 'x' }), deps())
|
|
768
|
+
expect(res.status).toBe(400)
|
|
769
|
+
expect(json(res).error).toMatch(/\$\.customerId/)
|
|
770
|
+
})
|
|
771
|
+
})
|
|
772
|
+
|
|
773
|
+
describe('UNMOCKED_USERS policy (selector resolved, profile not found)', () => {
|
|
774
|
+
it('ERROR: 404s when the profile is not found', async () => {
|
|
775
|
+
const res = await routeRequest(post('/hello/world', { customerId: 'ghost' }), deps({ unmockedUsers: 'ERROR' }))
|
|
776
|
+
expect(res.status).toBe(404)
|
|
777
|
+
expect(json(res).error).toMatch(/ghost/)
|
|
778
|
+
})
|
|
779
|
+
|
|
780
|
+
it('DEFAULT_MOCK: serves the default fixture for an unmocked user', async () => {
|
|
781
|
+
const d = deps({ unmockedUsers: 'DEFAULT_MOCK' })
|
|
782
|
+
const res = await routeRequest(post('/hello/world', { customerId: 'ghost' }), d)
|
|
783
|
+
expect(res.status).toBe(200)
|
|
784
|
+
expect(json(res)).toEqual({ customerId: 'ghost', date: '20260702', ok: true })
|
|
785
|
+
expect(d.passthroughCalls).toHaveLength(0)
|
|
786
|
+
})
|
|
787
|
+
|
|
788
|
+
it('REAL: proxies an unmocked user to the real upstream', async () => {
|
|
789
|
+
const d = deps({ unmockedUsers: 'REAL' })
|
|
790
|
+
const res = await routeRequest(post('/hello/world', { customerId: 'ghost' }), d)
|
|
791
|
+
expect(res.status).toBe(299)
|
|
792
|
+
expect(d.passthroughCalls).toHaveLength(1)
|
|
793
|
+
})
|
|
794
|
+
|
|
795
|
+
it('records unmocked-user fallback in the trace for handler-level warning logs', async () => {
|
|
796
|
+
const errorTrace: RouteTrace = {}
|
|
797
|
+
await routeRequest(
|
|
798
|
+
post('/hello/world', { customerId: 'ghost' }),
|
|
799
|
+
deps({ unmockedUsers: 'ERROR', trace: errorTrace }),
|
|
800
|
+
)
|
|
801
|
+
expect(errorTrace.error?.code).toBe('profile_not_found')
|
|
802
|
+
expect(errorTrace.scenarioSource).toBeUndefined()
|
|
803
|
+
|
|
804
|
+
const defaultMockTrace: RouteTrace = {}
|
|
805
|
+
await routeRequest(
|
|
806
|
+
post('/hello/world', { customerId: 'ghost' }),
|
|
807
|
+
deps({ unmockedUsers: 'DEFAULT_MOCK', trace: defaultMockTrace }),
|
|
808
|
+
)
|
|
809
|
+
expect(defaultMockTrace.scenarioSource).toBe('unmocked_policy')
|
|
810
|
+
expect(defaultMockTrace.scenario).toBe('default')
|
|
811
|
+
|
|
812
|
+
const realTrace: RouteTrace = {}
|
|
813
|
+
await routeRequest(
|
|
814
|
+
post('/hello/world', { customerId: 'ghost' }),
|
|
815
|
+
deps({ unmockedUsers: 'REAL', trace: realTrace }),
|
|
816
|
+
)
|
|
817
|
+
expect(realTrace.scenarioSource).toBe('unmocked_policy')
|
|
818
|
+
expect(realTrace.scenario).toBe('real')
|
|
819
|
+
})
|
|
820
|
+
})
|
|
821
|
+
|
|
822
|
+
describe('drift and templating failures — 500 regardless of config', () => {
|
|
823
|
+
it.each(['ERROR', 'DEFAULT_MOCK', 'REAL'] as const)(
|
|
824
|
+
'unknown scenario pinned in profile (UNMOCKED_USERS=%s)',
|
|
825
|
+
async (unmockedUsers) => {
|
|
826
|
+
const d = deps({
|
|
827
|
+
unmockedUsers,
|
|
828
|
+
getProfile: withProfile(profile({ endpointScenarios: { hello_world: 'ghost-scenario' } })),
|
|
829
|
+
})
|
|
830
|
+
const res = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
831
|
+
expect(res.status).toBe(500)
|
|
832
|
+
expect(json(res).error).toMatch(/ghost-scenario/)
|
|
833
|
+
expect(d.passthroughCalls).toHaveLength(0)
|
|
834
|
+
},
|
|
835
|
+
)
|
|
836
|
+
|
|
837
|
+
it('unresolvable placeholder', async () => {
|
|
838
|
+
const d = deps({
|
|
839
|
+
getProfile: withProfile(profile({ endpointScenarios: { template_fail: 'default' } })),
|
|
840
|
+
})
|
|
841
|
+
const res = await routeRequest(post('/tpl', { customerId: 'c1' }), d)
|
|
842
|
+
expect(res.status).toBe(500)
|
|
843
|
+
expect(json(res).error).toMatch(/fieldThatWillNeverExist/)
|
|
844
|
+
})
|
|
845
|
+
})
|
|
846
|
+
|
|
847
|
+
describe('schema validation (mocked path)', () => {
|
|
848
|
+
const p = () => withProfile(profile({ profileId: 'c1', endpointScenarios: {} }))
|
|
849
|
+
|
|
850
|
+
it('serves normally when the request and response satisfy the schema', async () => {
|
|
851
|
+
const d = deps({ getProfile: p() })
|
|
852
|
+
const res = await routeRequest(post('/schema-checked', { customerId: 'c1', amount: 3 }), d)
|
|
853
|
+
expect(res.status).toBe(200)
|
|
854
|
+
expect(json(res)).toEqual({ customerId: 'c1', ok: true })
|
|
855
|
+
})
|
|
856
|
+
|
|
857
|
+
it('400s when the request body violates the schema, with details', async () => {
|
|
858
|
+
const d = deps({ getProfile: p() })
|
|
859
|
+
const res = await routeRequest(post('/schema-checked', { customerId: 'c1', amount: 'lots' }), d)
|
|
860
|
+
expect(res.status).toBe(400)
|
|
861
|
+
const body = json(res)
|
|
862
|
+
expect(body.error).toMatch(/request body does not match schema/)
|
|
863
|
+
expect(JSON.stringify(body.details)).toMatch(/\/amount/)
|
|
864
|
+
expect(d.passthroughCalls).toHaveLength(0)
|
|
865
|
+
})
|
|
866
|
+
|
|
867
|
+
it('400s when a required request body is missing', async () => {
|
|
868
|
+
const d = deps({ getProfile: p() })
|
|
869
|
+
const res = await routeRequest(
|
|
870
|
+
{ method: 'POST', path: '/schema-checked', search: '?customerId=c1', headers: {}, rawBody: null },
|
|
871
|
+
d,
|
|
872
|
+
)
|
|
873
|
+
// selector $.customerId cannot resolve without a body, so guard the setup:
|
|
874
|
+
// use an endpoint-level check instead — the selector error comes first.
|
|
875
|
+
expect([400]).toContain(res.status)
|
|
876
|
+
})
|
|
877
|
+
|
|
878
|
+
it('skips request validation when the scenario is real', async () => {
|
|
879
|
+
const d = deps({
|
|
880
|
+
getProfile: withProfile(
|
|
881
|
+
profile({ profileId: 'c1', endpointScenarios: { schema_checked: 'real' } }),
|
|
882
|
+
),
|
|
883
|
+
})
|
|
884
|
+
// amount has the wrong type — the real path must not care
|
|
885
|
+
const res = await routeRequest(post('/schema-checked', { customerId: 'c1', amount: 'lots' }), d)
|
|
886
|
+
expect(res.status).toBe(299)
|
|
887
|
+
expect(d.passthroughCalls).toHaveLength(1)
|
|
888
|
+
})
|
|
889
|
+
|
|
890
|
+
it('500s when the resolved response violates the schema, with details', async () => {
|
|
891
|
+
const d = deps({
|
|
892
|
+
getProfile: withProfile(
|
|
893
|
+
profile({ profileId: 'c1', endpointScenarios: { schema_checked: 'bad_response' } }),
|
|
894
|
+
),
|
|
895
|
+
})
|
|
896
|
+
const res = await routeRequest(post('/schema-checked', { customerId: 'c1' }), d)
|
|
897
|
+
expect(res.status).toBe(500)
|
|
898
|
+
const body = json(res)
|
|
899
|
+
expect(body.error).toMatch(/generated response does not match schema/)
|
|
900
|
+
expect(body.scenario).toBe('bad_response')
|
|
901
|
+
expect(JSON.stringify(body.details)).toMatch(/\/ok/)
|
|
902
|
+
})
|
|
903
|
+
|
|
904
|
+
it('endpoints without a schema are untouched (no deps.schemas entry consulted)', async () => {
|
|
905
|
+
const d = deps({
|
|
906
|
+
getProfile: withProfile(profile({ endpointScenarios: { hello_world: 'default' } })),
|
|
907
|
+
})
|
|
908
|
+
const res = await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
909
|
+
expect(res.status).toBe(200)
|
|
910
|
+
})
|
|
911
|
+
})
|
|
912
|
+
|
|
913
|
+
describe('schema drift probe (proxy path, warn-only)', () => {
|
|
914
|
+
const realPin = () =>
|
|
915
|
+
withProfile(profile({ profileId: 'c1', endpointScenarios: { schema_checked: 'real' } }))
|
|
916
|
+
|
|
917
|
+
function proxiedDeps(proxied: ProxiedResponse, trace?: RouteTrace) {
|
|
918
|
+
return deps({
|
|
919
|
+
getProfile: realPin(),
|
|
920
|
+
passthrough: async () => proxied,
|
|
921
|
+
trace,
|
|
922
|
+
})
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
const req = () => post('/schema-checked', { customerId: 'c1' })
|
|
926
|
+
|
|
927
|
+
it('records drift when the real JSON response violates the schema, and forwards it unchanged', async () => {
|
|
928
|
+
const trace: RouteTrace = {}
|
|
929
|
+
const proxied: ProxiedResponse = {
|
|
930
|
+
status: 200,
|
|
931
|
+
headers: { 'content-type': 'application/json' },
|
|
932
|
+
bodyBytes: Buffer.from(JSON.stringify({ customerId: 'c1', ok: 'yes' })),
|
|
933
|
+
}
|
|
934
|
+
const res = await routeRequest(req(), proxiedDeps(proxied, trace))
|
|
935
|
+
expect(res.status).toBe(200)
|
|
936
|
+
expect(res.bodyBytes.toString()).toBe(JSON.stringify({ customerId: 'c1', ok: 'yes' }))
|
|
937
|
+
expect(trace.validation?.response).toBe('drift_warning')
|
|
938
|
+
})
|
|
939
|
+
|
|
940
|
+
it('records drift when the real response status has no declared schema', async () => {
|
|
941
|
+
const trace: RouteTrace = {}
|
|
942
|
+
const proxied: ProxiedResponse = {
|
|
943
|
+
status: 503,
|
|
944
|
+
headers: { 'content-type': 'application/json' },
|
|
945
|
+
bodyBytes: Buffer.from(JSON.stringify({ oops: true })),
|
|
946
|
+
}
|
|
947
|
+
await routeRequest(req(), proxiedDeps(proxied, trace))
|
|
948
|
+
expect(trace.validation?.response).toBe('drift_warning')
|
|
949
|
+
})
|
|
950
|
+
|
|
951
|
+
it('stays silent for a conforming real response', async () => {
|
|
952
|
+
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
|
|
953
|
+
const proxied: ProxiedResponse = {
|
|
954
|
+
status: 200,
|
|
955
|
+
headers: { 'content-type': 'application/json' },
|
|
956
|
+
bodyBytes: Buffer.from(JSON.stringify({ customerId: 'c1', ok: true })),
|
|
957
|
+
}
|
|
958
|
+
await routeRequest(req(), proxiedDeps(proxied))
|
|
959
|
+
expect(warn).not.toHaveBeenCalled()
|
|
960
|
+
warn.mockRestore()
|
|
961
|
+
})
|
|
962
|
+
|
|
963
|
+
it('skips non-JSON and unparseable responses silently', async () => {
|
|
964
|
+
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
|
|
965
|
+
await routeRequest(
|
|
966
|
+
req(),
|
|
967
|
+
proxiedDeps({
|
|
968
|
+
status: 200,
|
|
969
|
+
headers: { 'content-type': 'text/html' },
|
|
970
|
+
bodyBytes: Buffer.from('<html></html>'),
|
|
971
|
+
}),
|
|
972
|
+
)
|
|
973
|
+
await routeRequest(
|
|
974
|
+
req(),
|
|
975
|
+
proxiedDeps({
|
|
976
|
+
status: 200,
|
|
977
|
+
headers: { 'content-type': 'application/json' },
|
|
978
|
+
bodyBytes: Buffer.from('{broken'),
|
|
979
|
+
}),
|
|
980
|
+
)
|
|
981
|
+
expect(warn).not.toHaveBeenCalled()
|
|
982
|
+
warn.mockRestore()
|
|
983
|
+
})
|
|
984
|
+
|
|
985
|
+
it('never validates proxied responses for endpoints without a schema', async () => {
|
|
986
|
+
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
|
|
987
|
+
const d = deps({
|
|
988
|
+
getProfile: withProfile(profile({ endpointScenarios: { hello_world: 'real' } })),
|
|
989
|
+
passthrough: async () => ({
|
|
990
|
+
status: 200,
|
|
991
|
+
headers: { 'content-type': 'application/json' },
|
|
992
|
+
bodyBytes: Buffer.from(JSON.stringify({ totally: 'unrelated' })),
|
|
993
|
+
}),
|
|
994
|
+
})
|
|
995
|
+
await routeRequest(post('/hello/world', { customerId: 'c1' }), d)
|
|
996
|
+
expect(warn).not.toHaveBeenCalled()
|
|
997
|
+
warn.mockRestore()
|
|
998
|
+
})
|
|
999
|
+
})
|
|
1000
|
+
|
|
1001
|
+
describe('resolver-backed scenarios', () => {
|
|
1002
|
+
it('runs a resolver-backed default for a profile with no pick, recording trace.resolver', async () => {
|
|
1003
|
+
const d = deps({
|
|
1004
|
+
getProfile: withProfile(profile({ profileId: 'c1', endpointScenarios: {} })),
|
|
1005
|
+
getCompiledResolver: () => ({ invoke: () => 'hold' }),
|
|
1006
|
+
})
|
|
1007
|
+
const trace: RouteTrace = {}
|
|
1008
|
+
const res = await routeRequest(post('/resolver-default', { customerId: 'c1' }), { ...d, trace })
|
|
1009
|
+
expect(res.status).toBe(200) // hold.json fixture
|
|
1010
|
+
expect(trace.scenarioSource).toBe('implicit') // NOT overwritten
|
|
1011
|
+
expect(trace.resolver).toEqual({ slug: 'default', returned: 'hold' })
|
|
1012
|
+
expect(trace.scenario).toBe('hold')
|
|
1013
|
+
})
|
|
1014
|
+
|
|
1015
|
+
it('rejects a resolver returning a resolver-backed slug with resolver_bad_return', async () => {
|
|
1016
|
+
const d = deps({
|
|
1017
|
+
getProfile: withProfile(profile({ profileId: 'c1', endpointScenarios: {} })),
|
|
1018
|
+
getCompiledResolver: () => ({ invoke: () => 'flaky' }),
|
|
1019
|
+
})
|
|
1020
|
+
const trace: RouteTrace = {}
|
|
1021
|
+
const res = await routeRequest(post('/resolver-default', { customerId: 'c1' }), { ...d, trace })
|
|
1022
|
+
expect(res.status).toBe(500)
|
|
1023
|
+
expect(trace.error?.code).toBe('resolver_bad_return')
|
|
1024
|
+
})
|
|
1025
|
+
|
|
1026
|
+
it('runs default.ts for an unmocked caller under DEFAULT_MOCK', async () => {
|
|
1027
|
+
const d = deps({
|
|
1028
|
+
unmockedUsers: 'DEFAULT_MOCK',
|
|
1029
|
+
getProfile: async () => null,
|
|
1030
|
+
getCompiledResolver: () => ({ invoke: () => 'hold' }),
|
|
1031
|
+
})
|
|
1032
|
+
const trace: RouteTrace = {}
|
|
1033
|
+
const res = await routeRequest(post('/resolver-default', { customerId: 'ghost' }), { ...d, trace })
|
|
1034
|
+
expect(res.status).toBe(200)
|
|
1035
|
+
expect(trace.scenarioSource).toBe('unmocked_policy')
|
|
1036
|
+
expect(trace.resolver?.slug).toBe('default')
|
|
1037
|
+
})
|
|
1038
|
+
})
|
|
1039
|
+
|
|
1040
|
+
describe('resolver-backed scenario (dynamic slug)', () => {
|
|
1041
|
+
it('runs the resolver, serves the returned fixture, and records history', async () => {
|
|
1042
|
+
const appended: string[] = []
|
|
1043
|
+
const d = deps({
|
|
1044
|
+
getProfile: async () => profile({ endpointScenarios: { dynamic_ep: 'dynamic' } }),
|
|
1045
|
+
getCompiledResolver: () => ({ invoke: (i) => (i.history.length === 0 ? 'failure' : 'default') }),
|
|
1046
|
+
getDynamicHistory: async () => [],
|
|
1047
|
+
appendDynamicHistory: async (_t, _k, _e, _s, slug) => {
|
|
1048
|
+
appended.push(slug)
|
|
1049
|
+
},
|
|
1050
|
+
})
|
|
1051
|
+
const trace: RouteTrace = {}
|
|
1052
|
+
const res = await routeRequest(post('/dynamic-ep', { customerId: 'c1' }), { ...d, trace })
|
|
1053
|
+
expect(res.status).toBe(422) // failure.json status
|
|
1054
|
+
expect(trace.scenarioSource).toBe('pin') // underlying selection mechanism, not overwritten
|
|
1055
|
+
expect(trace.resolver).toEqual({ slug: 'dynamic', returned: 'failure' })
|
|
1056
|
+
expect(trace.scenario).toBe('failure')
|
|
1057
|
+
expect(appended).toEqual(['failure'])
|
|
1058
|
+
})
|
|
1059
|
+
|
|
1060
|
+
it('returning "real" triggers passthrough', async () => {
|
|
1061
|
+
const d = deps({
|
|
1062
|
+
getProfile: async () => profile({ endpointScenarios: { dynamic_ep: 'dynamic' } }),
|
|
1063
|
+
getCompiledResolver: () => ({ invoke: () => 'real' }),
|
|
1064
|
+
})
|
|
1065
|
+
const trace: RouteTrace = {}
|
|
1066
|
+
const res = await routeRequest(post('/dynamic-ep', { customerId: 'c1' }), { ...d, trace })
|
|
1067
|
+
expect(res.status).toBe(299)
|
|
1068
|
+
expect(d.passthroughCalls).toHaveLength(1)
|
|
1069
|
+
expect(trace.outcome).toBe('passthrough')
|
|
1070
|
+
expect(trace.resolver).toEqual({ slug: 'dynamic', returned: 'real' })
|
|
1071
|
+
})
|
|
1072
|
+
|
|
1073
|
+
it('500s when the resolved slug is resolver-backed but there is no resolver (drift)', async () => {
|
|
1074
|
+
const d = deps({
|
|
1075
|
+
getProfile: async () => profile({ endpointScenarios: { dynamic_ep: 'dynamic' } }),
|
|
1076
|
+
getCompiledResolver: () => null,
|
|
1077
|
+
})
|
|
1078
|
+
const trace: RouteTrace = {}
|
|
1079
|
+
const res = await routeRequest(post('/dynamic-ep', { customerId: 'c1' }), { ...d, trace })
|
|
1080
|
+
expect(res.status).toBe(500)
|
|
1081
|
+
expect(trace.error?.code).toBe('resolver_missing')
|
|
1082
|
+
})
|
|
1083
|
+
|
|
1084
|
+
it('500s on a bad return value and records nothing', async () => {
|
|
1085
|
+
const appended: string[] = []
|
|
1086
|
+
const d = deps({
|
|
1087
|
+
getProfile: async () => profile({ endpointScenarios: { dynamic_ep: 'dynamic' } }),
|
|
1088
|
+
getCompiledResolver: () => ({ invoke: () => 'nonexistent' }),
|
|
1089
|
+
appendDynamicHistory: async (_t, _k, _e, _s, slug) => {
|
|
1090
|
+
appended.push(slug)
|
|
1091
|
+
},
|
|
1092
|
+
})
|
|
1093
|
+
const trace: RouteTrace = {}
|
|
1094
|
+
const res = await routeRequest(post('/dynamic-ep', { customerId: 'c1' }), { ...d, trace })
|
|
1095
|
+
expect(res.status).toBe(500)
|
|
1096
|
+
expect(trace.error?.code).toBe('resolver_bad_return')
|
|
1097
|
+
expect(appended).toEqual([])
|
|
1098
|
+
})
|
|
1099
|
+
|
|
1100
|
+
it('500s when the resolver throws', async () => {
|
|
1101
|
+
const d = deps({
|
|
1102
|
+
getProfile: async () => profile({ endpointScenarios: { dynamic_ep: 'dynamic' } }),
|
|
1103
|
+
getCompiledResolver: () => ({
|
|
1104
|
+
invoke: () => {
|
|
1105
|
+
throw new ResolverRuntimeError('boom')
|
|
1106
|
+
},
|
|
1107
|
+
}),
|
|
1108
|
+
})
|
|
1109
|
+
const trace: RouteTrace = {}
|
|
1110
|
+
const res = await routeRequest(post('/dynamic-ep', { customerId: 'c1' }), { ...d, trace })
|
|
1111
|
+
expect(res.status).toBe(500)
|
|
1112
|
+
expect(trace.error?.code).toBe('resolver_threw')
|
|
1113
|
+
})
|
|
1114
|
+
|
|
1115
|
+
it('500s with resolver_compile_error when getCompiledResolver throws (dev-mode compile failure)', async () => {
|
|
1116
|
+
const d = deps({
|
|
1117
|
+
getProfile: async () => profile({ endpointScenarios: { dynamic_ep: 'dynamic' } }),
|
|
1118
|
+
getCompiledResolver: () => {
|
|
1119
|
+
throw new Error('dynamic.ts:3 unexpected token')
|
|
1120
|
+
},
|
|
1121
|
+
})
|
|
1122
|
+
const trace: RouteTrace = {}
|
|
1123
|
+
const res = await routeRequest(post('/dynamic-ep', { customerId: 'c1' }), { ...d, trace })
|
|
1124
|
+
expect(res.status).toBe(500)
|
|
1125
|
+
expect(trace.error?.code).toBe('resolver_compile_error')
|
|
1126
|
+
})
|
|
1127
|
+
|
|
1128
|
+
it('does not let a resolver mutate its input affect the served response', async () => {
|
|
1129
|
+
const d = deps({
|
|
1130
|
+
getProfile: async () => profile({ endpointScenarios: { dynamic_ep: 'dynamic' } }),
|
|
1131
|
+
getCompiledResolver: () => ({
|
|
1132
|
+
invoke: (i) => {
|
|
1133
|
+
// Attempt to corrupt the shared request context by reference.
|
|
1134
|
+
;(i.request.body as Record<string, unknown>).customerId = 'tampered'
|
|
1135
|
+
i.request.headers['x-tampered'] = 'yes'
|
|
1136
|
+
return 'default'
|
|
1137
|
+
},
|
|
1138
|
+
}),
|
|
1139
|
+
})
|
|
1140
|
+
const trace: RouteTrace = {}
|
|
1141
|
+
const req = post('/dynamic-ep', { customerId: 'c1' })
|
|
1142
|
+
const res = await routeRequest(req, { ...d, trace })
|
|
1143
|
+
expect(res.status).toBe(200)
|
|
1144
|
+
const body = JSON.parse(res.bodyBytes.toString('utf8'))
|
|
1145
|
+
expect(body.customerId).toBe('c1')
|
|
1146
|
+
})
|
|
1147
|
+
})
|