{
  "version": 3,
  "sources": ["../../../../src/workers/shared/constants.ts", "../../../../src/workers/shared/object-entry.worker.ts"],
  "sourcesContent": ["export const SharedHeaders = {\n\tLOG_LEVEL: \"MF-Log-Level\",\n} as const;\n\nexport const SharedBindings = {\n\tTEXT_NAMESPACE: \"MINIFLARE_NAMESPACE\",\n\tDURABLE_OBJECT_NAMESPACE_OBJECT: \"MINIFLARE_OBJECT\",\n\tMAYBE_SERVICE_BLOBS: \"MINIFLARE_BLOBS\",\n\tMAYBE_SERVICE_LOOPBACK: \"MINIFLARE_LOOPBACK\",\n\tMAYBE_JSON_ENABLE_CONTROL_ENDPOINTS: \"MINIFLARE_ENABLE_CONTROL_ENDPOINTS\",\n\tMAYBE_JSON_ENABLE_STICKY_BLOBS: \"MINIFLARE_STICKY_BLOBS\",\n} as const;\n\nexport enum LogLevel {\n\tNONE,\n\tERROR,\n\tWARN,\n\tINFO,\n\tDEBUG,\n\tVERBOSE,\n}\n", "import { SharedBindings } from \"./constants\";\nimport type { MiniflareDurableObjectCf } from \"./object.worker\";\n\ninterface Props {\n\t[SharedBindings.TEXT_NAMESPACE]?: string;\n}\ninterface Env {\n\t// Present only in the legacy per-resource model, where the namespace is baked\n\t// into the worker as a static binding.\n\t[SharedBindings.TEXT_NAMESPACE]?: string;\n\t[SharedBindings.DURABLE_OBJECT_NAMESPACE_OBJECT]: DurableObjectNamespace;\n}\n\nexport default <ExportedHandler<Env, unknown, unknown, Props>>{\n\tasync fetch(request, env, ctx) {\n\t\t// Prefer the namespace passed at runtime via `ctx.props` (props-based\n\t\t// model: one entry service serves many namespaces). Fall back to the\n\t\t// static binding for callers that still bake the namespace in.\n\t\tconst name =\n\t\t\tctx.props[SharedBindings.TEXT_NAMESPACE] ??\n\t\t\tenv[SharedBindings.TEXT_NAMESPACE];\n\t\tif (name === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t\"object-entry worker: no namespace provided via props or binding\"\n\t\t\t);\n\t\t}\n\t\tconst objectNamespace = env[SharedBindings.DURABLE_OBJECT_NAMESPACE_OBJECT];\n\t\tconst id = objectNamespace.idFromName(name);\n\t\tconst stub = objectNamespace.get(id);\n\t\tconst cf: MiniflareDurableObjectCf = { miniflare: { name } };\n\t\treturn await stub.fetch(request, { cf: cf as Record<string, unknown> });\n\t},\n};\n"],
  "mappings": ";AAIO,IAAM,iBAAiB;AAAA,EAC7B,gBAAgB;AAAA,EAChB,iCAAiC;AAAA,EACjC,qBAAqB;AAAA,EACrB,wBAAwB;AAAA,EACxB,qCAAqC;AAAA,EACrC,gCAAgC;AACjC;;;ACEA,IAAO,8BAAuD;AAAA,EAC7D,MAAM,MAAM,SAAS,KAAK,KAAK;AAI9B,QAAM,OACL,IAAI,MAAM,eAAe,cAAc,KACvC,IAAI,eAAe,cAAc;AAClC,QAAI,SAAS;AACZ,YAAM,IAAI;AAAA,QACT;AAAA,MACD;AAED,QAAM,kBAAkB,IAAI,eAAe,+BAA+B,GACpE,KAAK,gBAAgB,WAAW,IAAI,GACpC,OAAO,gBAAgB,IAAI,EAAE,GAC7B,KAA+B,EAAE,WAAW,EAAE,KAAK,EAAE;AAC3D,WAAO,MAAM,KAAK,MAAM,SAAS,EAAE,GAAkC,CAAC;AAAA,EACvE;AACD;",
  "names": []
}
