devflare 1.0.0-next.59 → 1.0.0-next.60

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.
Files changed (45) hide show
  1. package/dist/_chunks/{build-IR-IaQN1.js → build-Dp8k2SWa.js} +1 -1
  2. package/dist/_chunks/{build-artifacts-C7JfIRnw.js → build-artifacts-DLEYfdVL.js} +2 -2
  3. package/dist/_chunks/{cli-yOO5yCaf.js → cli-BlVetiEh.js} +5 -5
  4. package/dist/_chunks/{compiler-okj8qvCh.js → compiler-CgIFPfRA.js} +23 -1
  5. package/dist/_chunks/{config-C8Qux0NR.js → config-BwRb2_vD.js} +1 -1
  6. package/dist/_chunks/{deploy-BG2PHaWu.js → deploy-Blrdr3Gv.js} +2 -2
  7. package/dist/_chunks/{dev-BgQl56Bd.js → dev-DRP6LR2H.js} +42 -7
  8. package/dist/_chunks/{previews-fTFp1WkQ.js → previews-D-GPVCeq.js} +1 -1
  9. package/dist/_chunks/r2-presign-runtime-zTOLS0Ea.js +291 -0
  10. package/dist/_chunks/{runtime-DL-Nz3k8.js → runtime-RekfD_2X.js} +325 -1
  11. package/dist/_chunks/{vite-De7bGxC6.js → vite-CtvgOi1c.js} +2 -2
  12. package/dist/bridge/miniflare-gateway.d.ts +45 -0
  13. package/dist/bridge/miniflare-gateway.d.ts.map +1 -0
  14. package/dist/bridge/miniflare.d.ts +8 -1
  15. package/dist/bridge/miniflare.d.ts.map +1 -1
  16. package/dist/bridge/r2-presign-runtime.d.ts +9 -0
  17. package/dist/bridge/r2-presign-runtime.d.ts.map +1 -0
  18. package/dist/cli/index.js +1 -1
  19. package/dist/config/compiler.d.ts.map +1 -1
  20. package/dist/dev-server/gateway-script.d.ts +2 -1
  21. package/dist/dev-server/gateway-script.d.ts.map +1 -1
  22. package/dist/dev-server/miniflare-dev-config.d.ts +13 -0
  23. package/dist/dev-server/miniflare-dev-config.d.ts.map +1 -1
  24. package/dist/dev-server/miniflare-worker-config.d.ts +7 -0
  25. package/dist/dev-server/miniflare-worker-config.d.ts.map +1 -1
  26. package/dist/dev-server/server.d.ts.map +1 -1
  27. package/dist/dev-server/vite-process.d.ts +9 -0
  28. package/dist/dev-server/vite-process.d.ts.map +1 -1
  29. package/dist/index.js +2 -2
  30. package/dist/runtime/index.d.ts +1 -0
  31. package/dist/runtime/index.d.ts.map +1 -1
  32. package/dist/runtime/index.js +2 -2
  33. package/dist/runtime/r2-presign.d.ts +164 -0
  34. package/dist/runtime/r2-presign.d.ts.map +1 -0
  35. package/dist/test/index.js +41 -4
  36. package/dist/test/simple-context-gateway-script.d.ts.map +1 -1
  37. package/dist/test/simple-context-mfconfig.d.ts +8 -0
  38. package/dist/test/simple-context-mfconfig.d.ts.map +1 -1
  39. package/dist/test/simple-context-multi-worker.d.ts.map +1 -1
  40. package/dist/test/simple-context-runtime.d.ts.map +1 -1
  41. package/dist/test/simple-context-startup.d.ts.map +1 -1
  42. package/dist/test/simple-context.d.ts.map +1 -1
  43. package/dist/vite/index.js +1 -1
  44. package/package.json +3 -2
  45. package/dist/_chunks/local-workflow-entrypoints-ZIL7apIa.js +0 -90
@@ -1,4 +1,5 @@
1
1
  import { D as createFetchEvent, b as createContextProxy, n as getContextOrNull, v as runWithEventContext } from "./context-CX50Y2Kb.js";
2
+ import { AwsV4Signer } from "aws4fetch";
2
3
  //#region src/runtime/exports.ts
3
4
  /**
4
5
  * Creates a readonly proxy that throws on mutation attempts. Thin wrapper
@@ -547,4 +548,327 @@ function createRouteResolve(routes, initialEvent) {
547
548
  };
548
549
  }
549
550
  //#endregion
550
- export { ctx as _, assertExplicitQueueHandlerStyle as a, locals as b, defineFetchHandler as c, invokeFetchHandler as d, invokeFetchModule as f, sequence as g, resolveFetchHandler as h, assertExplicit2ArgStyle as i, defineQueueHandler as l, markWorkerStyle as m, invokeRouteModules as n, assertExplicitScheduledHandlerStyle as o, markResolveStyle as p, matchFetchRoute as r, createResolveFetch as s, createRouteResolve as t, defineScheduledHandler as u, env as v, vars as x, event as y };
551
+ //#region src/runtime/r2-presign.ts
552
+ /** URL path prefix of the local presign endpoint served by devflare gateways. */
553
+ const R2_PRESIGN_LOCAL_PATH_PREFIX = "/_devflare/r2/presigned/";
554
+ /** Version tag prepended to the local canonical string (breaks old URLs on format changes). */
555
+ const LOCAL_CANONICAL_VERSION = "devflare:r2-presign:v1";
556
+ /** Env/var names devflare injects in local dev + tests to enable local presigning. */
557
+ const R2_PRESIGN_SECRET_VAR = "DEVFLARE_R2_PRESIGN_SECRET";
558
+ const R2_PRESIGN_ORIGIN_VAR = "DEVFLARE_R2_PRESIGN_ORIGIN";
559
+ /** Var (injected at deploy compile time) mapping R2 binding names to bucket metadata. */
560
+ const R2_BUCKETS_VAR = "DEVFLARE_R2_BUCKETS";
561
+ /** Default env/secret names for R2 S3 API credentials in production. */
562
+ const R2_ACCOUNT_ID_VAR = "R2_ACCOUNT_ID";
563
+ const R2_ACCESS_KEY_ID_VAR = "R2_ACCESS_KEY_ID";
564
+ const R2_SECRET_ACCESS_KEY_VAR = "R2_SECRET_ACCESS_KEY";
565
+ /** Maximum expiry accepted by S3-style presigned URLs (7 days, in seconds). */
566
+ const MAX_EXPIRES_IN_SECONDS = 10080 * 60;
567
+ /** Default presigned URL lifetime (15 minutes, in seconds). */
568
+ const DEFAULT_EXPIRES_IN_SECONDS = 900;
569
+ /**
570
+ * Read a string value by name from the platform `env`, falling back to
571
+ * `process.env`. Handles dev-mode env proxies gracefully: any non-string
572
+ * (e.g. a bridge binding proxy) is treated as absent.
573
+ */
574
+ function readEnvString(env, name) {
575
+ let own;
576
+ try {
577
+ own = env?.[name];
578
+ } catch {
579
+ own = void 0;
580
+ }
581
+ if (typeof own === "string" && own.length > 0) return own;
582
+ const fromProcess = (globalThis.process?.env)?.[name];
583
+ return typeof fromProcess === "string" && fromProcess.length > 0 ? fromProcess : void 0;
584
+ }
585
+ /**
586
+ * Resolve the local presign context (origin + secret) injected by devflare in
587
+ * dev/test. Returns `null` outside devflare-managed local environments.
588
+ */
589
+ function resolveLocalContext(env) {
590
+ const secret = readEnvString(env, R2_PRESIGN_SECRET_VAR);
591
+ const origin = readEnvString(env, R2_PRESIGN_ORIGIN_VAR);
592
+ if (!secret || !origin) return null;
593
+ return {
594
+ origin: origin.replace(/\/$/, ""),
595
+ secret
596
+ };
597
+ }
598
+ /**
599
+ * Parse the injected `DEVFLARE_R2_BUCKETS` mapping from `env`. Accepts either
600
+ * a JSON string var or an already-parsed object (wrangler JSON vars).
601
+ */
602
+ function readBucketsVar(env) {
603
+ let raw;
604
+ try {
605
+ raw = env?.[R2_BUCKETS_VAR];
606
+ } catch {
607
+ return null;
608
+ }
609
+ if (raw === void 0 || raw === null) raw = (globalThis.process?.env)?.[R2_BUCKETS_VAR];
610
+ if (typeof raw === "string") try {
611
+ raw = JSON.parse(raw);
612
+ } catch {
613
+ return null;
614
+ }
615
+ if (!raw || typeof raw !== "object") return null;
616
+ const entries = {};
617
+ for (const [binding, value] of Object.entries(raw)) {
618
+ if (!value || typeof value !== "object") continue;
619
+ const bucketName = value.bucketName;
620
+ if (typeof bucketName !== "string" || bucketName.length === 0) continue;
621
+ const jurisdiction = value.jurisdiction;
622
+ entries[binding] = {
623
+ bucketName,
624
+ ...typeof jurisdiction === "string" && jurisdiction.length > 0 && { jurisdiction }
625
+ };
626
+ }
627
+ return entries;
628
+ }
629
+ /**
630
+ * Validate the binding/key/options tuple shared by PUT and GET presigning.
631
+ * Returns the effective expiry in seconds.
632
+ *
633
+ * @throws {RangeError} on out-of-range `expiresIn`, `contentLength` or `maxSizeBytes`.
634
+ * @throws {TypeError} on an empty binding or key.
635
+ */
636
+ function validateCommonInputs(binding, key, options) {
637
+ if (typeof binding !== "string" || binding.length === 0) throw new TypeError("[devflare] presignR2*: `binding` must be a non-empty R2 binding name.");
638
+ if (typeof key !== "string" || key.length === 0) throw new TypeError("[devflare] presignR2*: `key` must be a non-empty object key.");
639
+ if (key.startsWith("/")) throw new TypeError("[devflare] presignR2*: `key` must not start with \"/\".");
640
+ const controlChars = /[\u0000-\u001f\u007f]/;
641
+ if (controlChars.test(key) || controlChars.test(binding)) throw new TypeError("[devflare] presignR2*: `binding`/`key` must not contain control characters.");
642
+ const expiresIn = options.expiresIn ?? DEFAULT_EXPIRES_IN_SECONDS;
643
+ if (!Number.isInteger(expiresIn) || expiresIn < 1 || expiresIn > MAX_EXPIRES_IN_SECONDS) throw new RangeError(`[devflare] presignR2*: \`expiresIn\` must be an integer between 1 and ${MAX_EXPIRES_IN_SECONDS} seconds (got ${expiresIn}).`);
644
+ if (options.contentLength !== void 0) {
645
+ if (!Number.isInteger(options.contentLength) || options.contentLength < 0) throw new RangeError("[devflare] presignR2Put: `contentLength` must be a non-negative integer byte count.");
646
+ }
647
+ if (options.maxSizeBytes !== void 0) {
648
+ if (!Number.isInteger(options.maxSizeBytes) || options.maxSizeBytes < 1) throw new RangeError("[devflare] presignR2Put: `maxSizeBytes` must be a positive integer byte count.");
649
+ }
650
+ if (options.contentLength !== void 0 && options.maxSizeBytes !== void 0 && options.contentLength > options.maxSizeBytes) throw new RangeError(`[devflare] presignR2Put: \`contentLength\` (${options.contentLength}) exceeds \`maxSizeBytes\` (${options.maxSizeBytes}).`);
651
+ return expiresIn;
652
+ }
653
+ /**
654
+ * Percent-encode an object key for use in a URL path, RFC 3986-strict
655
+ * (S3 canonical-URI compatible), preserving `/` as the segment separator.
656
+ */
657
+ function encodeKeyPath(key) {
658
+ return key.split("/").map((segment) => encodeURIComponent(segment).replace(/[!'()*]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`)).join("/");
659
+ }
660
+ /** Compute a lowercase hex HMAC-SHA256 of `message` with `secret` via WebCrypto. */
661
+ async function hmacSha256Hex(secret, message) {
662
+ const encoder = new TextEncoder();
663
+ const cryptoKey = await crypto.subtle.importKey("raw", encoder.encode(secret), {
664
+ name: "HMAC",
665
+ hash: "SHA-256"
666
+ }, false, ["sign"]);
667
+ const signature = await crypto.subtle.sign("HMAC", cryptoKey, encoder.encode(message));
668
+ return [...new Uint8Array(signature)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
669
+ }
670
+ /**
671
+ * Build the canonical string covered by the local signature. MUST match
672
+ * `buildCanonicalString` in `src/bridge/r2-presign-runtime.ts` byte-for-byte.
673
+ */
674
+ function buildLocalCanonicalString(input) {
675
+ return [
676
+ LOCAL_CANONICAL_VERSION,
677
+ input.method,
678
+ input.binding,
679
+ input.key,
680
+ String(input.expires),
681
+ input.contentType ?? "",
682
+ input.contentLength !== void 0 ? String(input.contentLength) : "",
683
+ input.maxSizeBytes !== void 0 ? String(input.maxSizeBytes) : ""
684
+ ].join("\n");
685
+ }
686
+ /** Mint a signed URL against the devflare gateway's local presign endpoint. */
687
+ async function presignLocal(input) {
688
+ const expires = Math.floor(Date.now() / 1e3) + input.expiresIn;
689
+ const signature = await hmacSha256Hex(input.secret, buildLocalCanonicalString({
690
+ method: input.method,
691
+ binding: input.binding,
692
+ key: input.key,
693
+ expires,
694
+ contentType: input.contentType,
695
+ contentLength: input.contentLength,
696
+ maxSizeBytes: input.maxSizeBytes
697
+ }));
698
+ const url = new URL(`${input.origin}${R2_PRESIGN_LOCAL_PATH_PREFIX}${encodeURIComponent(input.binding)}/${encodeKeyPath(input.key)}`);
699
+ url.searchParams.set("X-Devflare-Method", input.method);
700
+ url.searchParams.set("X-Devflare-Expires", String(expires));
701
+ if (input.contentType !== void 0) url.searchParams.set("X-Devflare-Content-Type", input.contentType);
702
+ if (input.contentLength !== void 0) url.searchParams.set("X-Devflare-Content-Length", String(input.contentLength));
703
+ if (input.maxSizeBytes !== void 0) url.searchParams.set("X-Devflare-Max-Size", String(input.maxSizeBytes));
704
+ url.searchParams.set("X-Devflare-Signature", signature);
705
+ return {
706
+ url: url.toString(),
707
+ method: input.method,
708
+ headers: input.contentType !== void 0 ? { "content-type": input.contentType } : {},
709
+ expiresAt: /* @__PURE__ */ new Date(expires * 1e3),
710
+ key: input.key,
711
+ mode: "local"
712
+ };
713
+ }
714
+ /**
715
+ * Resolve production credentials from options or env.
716
+ *
717
+ * @throws {Error} naming exactly which credential values are missing.
718
+ */
719
+ function resolveCredentials(env, options) {
720
+ if (options.credentials) return options.credentials;
721
+ const accountId = readEnvString(env, R2_ACCOUNT_ID_VAR);
722
+ const accessKeyId = readEnvString(env, R2_ACCESS_KEY_ID_VAR);
723
+ const secretAccessKey = readEnvString(env, R2_SECRET_ACCESS_KEY_VAR);
724
+ if (accountId && accessKeyId && secretAccessKey) return {
725
+ accountId,
726
+ accessKeyId,
727
+ secretAccessKey
728
+ };
729
+ const missing = [
730
+ !accountId && "R2_ACCOUNT_ID",
731
+ !accessKeyId && "R2_ACCESS_KEY_ID",
732
+ !secretAccessKey && "R2_SECRET_ACCESS_KEY"
733
+ ].filter(Boolean);
734
+ throw new Error(`[devflare] presignR2*: missing R2 S3 credentials (${missing.join(", ")}). Provide them as Worker secrets (\`wrangler secret put <NAME>\`) or pass \`options.credentials\`. Create R2 S3 credentials under Cloudflare Dashboard → R2 → Manage R2 API Tokens. In devflare local dev no credentials are needed — this error usually means the code runs in production without the secrets set.`);
735
+ }
736
+ /**
737
+ * Resolve the production bucket for a binding from options or the injected
738
+ * `DEVFLARE_R2_BUCKETS` mapping.
739
+ *
740
+ * @throws {Error} when the bucket cannot be resolved.
741
+ */
742
+ function resolveBucket(env, binding, options) {
743
+ if (options.bucketName) return {
744
+ bucketName: options.bucketName,
745
+ ...options.jurisdiction && { jurisdiction: options.jurisdiction }
746
+ };
747
+ const entry = readBucketsVar(env)?.[binding];
748
+ if (entry) return {
749
+ bucketName: entry.bucketName,
750
+ ...(options.jurisdiction ?? entry.jurisdiction) && { jurisdiction: options.jurisdiction ?? entry.jurisdiction }
751
+ };
752
+ throw new Error(`[devflare] presignR2*: cannot resolve the bucket name for binding '${binding}'. Deploy through devflare (which injects the ${R2_BUCKETS_VAR} var from \`bindings.r2\`) or pass \`options.bucketName\` explicitly.`);
753
+ }
754
+ /** Mint a real S3 SigV4 presigned URL against the R2 S3 endpoint. */
755
+ async function presignRemote(input) {
756
+ const jurisdictionHost = input.bucket.jurisdiction ? `.${input.bucket.jurisdiction}` : "";
757
+ const endpoint = new URL(`https://${input.credentials.accountId}${jurisdictionHost}.r2.cloudflarestorage.com/${input.bucket.bucketName}/${encodeKeyPath(input.key)}`);
758
+ endpoint.searchParams.set("X-Amz-Expires", String(input.expiresIn));
759
+ const signedHeaders = {};
760
+ if (input.contentType !== void 0) signedHeaders["content-type"] = input.contentType;
761
+ if (input.contentLength !== void 0) signedHeaders["content-length"] = String(input.contentLength);
762
+ return {
763
+ url: (await new AwsV4Signer({
764
+ url: endpoint.toString(),
765
+ method: input.method,
766
+ accessKeyId: input.credentials.accessKeyId,
767
+ secretAccessKey: input.credentials.secretAccessKey,
768
+ region: "auto",
769
+ service: "s3",
770
+ signQuery: true,
771
+ allHeaders: true,
772
+ headers: signedHeaders
773
+ }).sign()).url.toString(),
774
+ method: input.method,
775
+ headers: input.contentType !== void 0 ? { "content-type": input.contentType } : {},
776
+ expiresAt: new Date(Date.now() + input.expiresIn * 1e3),
777
+ key: input.key,
778
+ mode: "remote"
779
+ };
780
+ }
781
+ /**
782
+ * Presign a direct-to-R2 `PUT` URL for a browser (or any HTTP client) upload.
783
+ *
784
+ * Resolves to a real R2 S3 presigned URL in production and to a signed
785
+ * devflare-gateway URL in local dev and the test harness — same call, same
786
+ * guarantees (signature, expiry, method, content type, size), so upload and
787
+ * quota logic can be exercised identically in every environment.
788
+ *
789
+ * @param env - The platform env (`platform.env` in SvelteKit, `env` in a
790
+ * Worker handler). Used to detect the local dev context and to read
791
+ * production credentials/bucket mapping.
792
+ * @param binding - The R2 binding name from `bindings.r2` (e.g. `'BUCKET'`).
793
+ * @param key - Object key to upload to. Percent-encoding is handled internally.
794
+ * @param options - Expiry, enforcement (content type / length / max size) and
795
+ * production credential overrides.
796
+ * @returns The presigned request: `url` to PUT to, `headers` the client must
797
+ * send, and `expiresAt`.
798
+ * @throws {Error} in production when credentials or the bucket mapping are missing.
799
+ * @throws {TypeError | RangeError} on invalid inputs.
800
+ *
801
+ * @example
802
+ * ```ts
803
+ * // Server (SvelteKit endpoint) — reserve quota first, then presign:
804
+ * const { url, headers } = await presignR2Put(platform.env, 'BUCKET', `media/${id}.png`, {
805
+ * expiresIn: 600,
806
+ * contentType: file.type,
807
+ * contentLength: file.size
808
+ * })
809
+ *
810
+ * // Browser — upload directly to storage:
811
+ * await fetch(url, { method: 'PUT', body: file, headers })
812
+ *
813
+ * // Server — finalize: confirm the object before committing quota:
814
+ * const head = await platform.env.BUCKET.head(`media/${id}.png`)
815
+ * ```
816
+ */
817
+ async function presignR2Put(env, binding, key, options = {}) {
818
+ const expiresIn = validateCommonInputs(binding, key, options);
819
+ const local = resolveLocalContext(env);
820
+ if (local) return presignLocal({
821
+ ...local,
822
+ method: "PUT",
823
+ binding,
824
+ key,
825
+ expiresIn,
826
+ contentType: options.contentType,
827
+ contentLength: options.contentLength,
828
+ maxSizeBytes: options.maxSizeBytes
829
+ });
830
+ return presignRemote({
831
+ credentials: resolveCredentials(env, options),
832
+ bucket: resolveBucket(env, binding, options),
833
+ method: "PUT",
834
+ key,
835
+ expiresIn,
836
+ contentType: options.contentType,
837
+ contentLength: options.contentLength
838
+ });
839
+ }
840
+ /**
841
+ * Presign a direct-from-R2 `GET` URL (also valid for `HEAD`) so a browser can
842
+ * download an object without routing the bytes through the Worker.
843
+ *
844
+ * Same dev/prod symmetry as {@link presignR2Put}. Note that browser reads
845
+ * from real R2 additionally require CORS rules on the bucket itself.
846
+ *
847
+ * @param env - The platform env (see {@link presignR2Put}).
848
+ * @param binding - The R2 binding name from `bindings.r2`.
849
+ * @param key - Object key to read.
850
+ * @param options - Expiry and production credential overrides.
851
+ * @returns The presigned request; `headers` is always empty for GET.
852
+ * @throws {Error} in production when credentials or the bucket mapping are missing.
853
+ * @throws {TypeError | RangeError} on invalid inputs.
854
+ */
855
+ async function presignR2Get(env, binding, key, options = {}) {
856
+ const expiresIn = validateCommonInputs(binding, key, options);
857
+ const local = resolveLocalContext(env);
858
+ if (local) return presignLocal({
859
+ ...local,
860
+ method: "GET",
861
+ binding,
862
+ key,
863
+ expiresIn
864
+ });
865
+ return presignRemote({
866
+ credentials: resolveCredentials(env, options),
867
+ bucket: resolveBucket(env, binding, options),
868
+ method: "GET",
869
+ key,
870
+ expiresIn
871
+ });
872
+ }
873
+ //#endregion
874
+ export { vars as C, locals as S, resolveFetchHandler as _, matchFetchRoute as a, env as b, assertExplicitScheduledHandlerStyle as c, defineQueueHandler as d, defineScheduledHandler as f, markWorkerStyle as g, markResolveStyle as h, invokeRouteModules as i, createResolveFetch as l, invokeFetchModule as m, presignR2Put as n, assertExplicit2ArgStyle as o, invokeFetchHandler as p, createRouteResolve as r, assertExplicitQueueHandlerStyle as s, presignR2Get as t, defineFetchHandler as u, sequence as v, event as x, ctx as y };
@@ -1,8 +1,8 @@
1
1
  import { d as resolveConfigEnvVars } from "./preview-C3Cdr8an.js";
2
2
  import { i as resolveConfigPath, o as loadResolvedConfig, r as loadConfig, s as resolveResources, u as resolveConfigForEnvironment } from "./loader-E_UGyTrJ.js";
3
3
  import { o as normalizeDOBinding } from "./schema-normalization-Zgm4W6O6.js";
4
- import { c as writeWranglerConfig, i as isolateViteBuildOutputPaths, n as compileConfig, o as rebaseWranglerConfigPaths, r as compileToProgrammaticConfig, t as compileBuildConfig } from "./compiler-okj8qvCh.js";
5
- import { h as resolveFetchHandler, i as assertExplicit2ArgStyle } from "./runtime-DL-Nz3k8.js";
4
+ import { c as writeWranglerConfig, i as isolateViteBuildOutputPaths, n as compileConfig, o as rebaseWranglerConfigPaths, r as compileToProgrammaticConfig, t as compileBuildConfig } from "./compiler-CgIFPfRA.js";
5
+ import { _ as resolveFetchHandler, o as assertExplicit2ArgStyle } from "./runtime-RekfD_2X.js";
6
6
  import { s as resolveServiceBindings, t as discoverRoutes } from "./routes-BMU7ga_l.js";
7
7
  import { n as findDurableObjectClasses } from "./durable-object-DMtH0XYX.js";
8
8
  import { r as SUPPORTED_WORKER_EXTENSIONS } from "./worker-entrypoint-CQW77lG8.js";
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Local presign context for a running Miniflare instance: the HTTP origin the
3
+ * gateway listens on plus the per-boot HMAC secret it validates presigned R2
4
+ * URLs with. Feed these to `presignR2Put`/`presignR2Get` (as
5
+ * `DEVFLARE_R2_PRESIGN_ORIGIN`/`DEVFLARE_R2_PRESIGN_SECRET` env values) to
6
+ * mint URLs this instance accepts.
7
+ */
8
+ export interface R2PresignContext {
9
+ /** Gateway HTTP origin, e.g. `http://127.0.0.1:8787`. */
10
+ origin: string;
11
+ /** Per-boot HMAC signing secret shared with the gateway worker. */
12
+ secret: string;
13
+ }
14
+ /** Binding-map shapes accepted by Miniflare options (array or name → id record). */
15
+ type NamedBindings = string[] | Record<string, string> | undefined;
16
+ /** Whether a Miniflare binding map actually declares at least one binding. */
17
+ export declare function hasNamedBindings(bindings: NamedBindings): boolean;
18
+ /**
19
+ * Generates a lightweight HTTP-only gateway worker script for
20
+ * `startMiniflare()` usage (tests, scripts, programmatic access).
21
+ *
22
+ * The RPC dispatch logic is shared with `dev-server/gateway-script.ts` via
23
+ * `GATEWAY_RUNTIME_JS`, and the local presigned-R2 endpoint via
24
+ * `R2_PRESIGN_RUNTIME_JS`. This gateway exposes the dispatcher over a plain
25
+ * HTTP endpoint (`POST /_devflare/rpc`). The full WebSocket bridge with
26
+ * streaming and WebSocket proxying lives in `./server.ts` / the dev-server
27
+ * gateway.
28
+ */
29
+ export declare function generateGatewayScript(): string;
30
+ /**
31
+ * Ensure a per-boot R2 presign secret is present in the worker bindings when
32
+ * R2 buckets are configured, so the embedded gateway endpoint can validate
33
+ * presigned URLs. Respects a caller-provided secret; returns a `null` context
34
+ * (and the options untouched) when the instance has no R2 buckets.
35
+ */
36
+ export declare function resolveR2PresignSetup<TOptions extends {
37
+ r2Buckets?: NamedBindings;
38
+ port?: number;
39
+ bindings?: Record<string, unknown>;
40
+ }>(options: TOptions): {
41
+ options: TOptions;
42
+ r2Presign: R2PresignContext | null;
43
+ };
44
+ export {};
45
+ //# sourceMappingURL=miniflare-gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"miniflare-gateway.d.ts","sourceRoot":"","sources":["../../src/bridge/miniflare-gateway.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAChC,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAA;CACd;AAED,oFAAoF;AACpF,KAAK,aAAa,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAA;AAElE,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAUjE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CA2C9C;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACpC,QAAQ,SAAS;IAChB,SAAS,CAAC,EAAE,aAAa,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC,EACA,OAAO,EAAE,QAAQ,GAAG;IAAE,OAAO,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAA;CAAE,CAuB9E"}
@@ -1,9 +1,16 @@
1
1
  import type { Miniflare as MiniflareType } from 'miniflare';
2
2
  import { type DevflareConfig } from '../config/index.js';
3
3
  import { type LocalSecretWrappedBindingConfig } from '../secrets/local-secrets.js';
4
+ import { type R2PresignContext } from './miniflare-gateway.js';
5
+ export type { R2PresignContext } from './miniflare-gateway.js';
4
6
  export interface MiniflareInstance {
5
7
  /** Ready promise - resolves when Miniflare is ready */
6
8
  ready: Promise<void>;
9
+ /**
10
+ * Local R2 presign context. Present when the instance was started with R2
11
+ * buckets; `null` otherwise.
12
+ */
13
+ r2Presign: R2PresignContext | null;
7
14
  /** Dispose the Miniflare instance */
8
15
  dispose(): Promise<void>;
9
16
  /** Get bindings directly from Miniflare */
@@ -133,7 +140,7 @@ export interface MiniflareOptions {
133
140
  /** Compatibility flags */
134
141
  compatibilityFlags?: string[];
135
142
  }
136
- export declare function createMiniflareInstanceHandle(mf: MiniflareType, primaryWorkerName?: string, nodeBindingOverrides?: Record<string, unknown>): MiniflareInstance;
143
+ export declare function createMiniflareInstanceHandle(mf: MiniflareType, primaryWorkerName?: string, nodeBindingOverrides?: Record<string, unknown>, r2Presign?: R2PresignContext | null): MiniflareInstance;
137
144
  /**
138
145
  * Start a Miniflare instance with the given configuration
139
146
  */
@@ -1 +1 @@
1
- {"version":3,"file":"miniflare.d.ts","sourceRoot":"","sources":["../../src/bridge/miniflare.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,EACN,KAAK,cAAc,EAcnB,MAAM,WAAW,CAAA;AAOlB,OAAO,EACN,KAAK,+BAA+B,EAGpC,MAAM,0BAA0B,CAAA;AAQjC,MAAM,WAAW,iBAAiB;IACjC,uDAAuD;IACvD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IACpB,qCAAqC;IACrC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACxB,2CAA2C;IAC3C,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAC/C,kDAAkD;IAClD,cAAc,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAA;IAC/C,+CAA+C;IAC/C,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;IACzC,iDAAiD;IACjD,aAAa,EAAE,aAAa,CAAC,eAAe,CAAC,CAAA;IAC7C,qDAAqD;IACrD,yBAAyB,EAAE,aAAa,CAAC,2BAA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AAE,CAAA;CAC7B;AAicD,wBAAgB,6BAA6B,CAC5C,EAAE,EAAE,aAAa,EACjB,iBAAiB,CAAC,EAAE,MAAM,EAC1B,oBAAoB,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EAClD,SAAS,GAAE,gBAAgB,GAAG,IAAW,GACvC,iBAAiB,CAuCnB;AAMD;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAa/F;AAMD;;GAEG;AACH,wBAAsB,wBAAwB,CAC7C,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,OAAO,CAAC,gBAAgB,CAAM,GACrC,OAAO,CAAC,iBAAiB,CAAC,CAmO5B;AAQD;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAKzF;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAKnD"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Inline JS defining `__devflareR2PresignHandle(request, env, url)`, which
3
+ * returns a `Response` when the request targets the local presign endpoint
4
+ * and `null` otherwise. Enforces signature, expiry, method, content type and
5
+ * size against the per-boot secret in `env.DEVFLARE_R2_PRESIGN_SECRET`, then
6
+ * executes the object operation on the local R2 binding.
7
+ */
8
+ export declare const R2_PRESIGN_RUNTIME_JS = "\nconst __devflareR2PresignPrefix = '/_devflare/r2/presigned/'\n\nconst __devflareR2PresignCors = {\n\t'Access-Control-Allow-Origin': '*',\n\t'Access-Control-Allow-Methods': 'GET, HEAD, PUT, OPTIONS',\n\t'Access-Control-Allow-Headers': 'Content-Type',\n\t'Access-Control-Expose-Headers': 'ETag, Content-Type, Content-Length'\n}\n\nfunction __devflareR2PresignError(status, code, message) {\n\treturn new Response(JSON.stringify({ error: { code, message } }), {\n\t\tstatus,\n\t\theaders: { 'Content-Type': 'application/json', ...__devflareR2PresignCors }\n\t})\n}\n\nasync function __devflareR2PresignHmacHex(secret, message) {\n\tconst encoder = new TextEncoder()\n\tconst key = await crypto.subtle.importKey(\n\t\t'raw',\n\t\tencoder.encode(secret),\n\t\t{ name: 'HMAC', hash: 'SHA-256' },\n\t\tfalse,\n\t\t['sign']\n\t)\n\tconst signature = await crypto.subtle.sign('HMAC', key, encoder.encode(message))\n\treturn [...new Uint8Array(signature)].map((b) => b.toString(16).padStart(2, '0')).join('')\n}\n\n// Constant-time hex comparison (uses workerd's timingSafeEqual when present).\nfunction __devflareR2PresignEqual(expectedHex, actualHex) {\n\tif (typeof actualHex !== 'string' || actualHex.length !== expectedHex.length) return false\n\tconst encoder = new TextEncoder()\n\tconst expected = encoder.encode(expectedHex)\n\tconst actual = encoder.encode(actualHex)\n\tconst subtle = crypto.subtle\n\tif (subtle && typeof subtle.timingSafeEqual === 'function') {\n\t\treturn subtle.timingSafeEqual(expected, actual)\n\t}\n\tlet diff = 0\n\tfor (let i = 0; i < expected.length; i++) diff |= expected[i] ^ actual[i]\n\treturn diff === 0\n}\n\n// MUST match buildLocalCanonicalString in src/runtime/r2-presign.ts.\nfunction __devflareR2PresignCanonical(method, binding, key, expires, contentType, contentLength, maxSize) {\n\treturn [\n\t\t'devflare:r2-presign:v1',\n\t\tmethod,\n\t\tbinding,\n\t\tkey,\n\t\texpires,\n\t\tcontentType || '',\n\t\tcontentLength || '',\n\t\tmaxSize || ''\n\t].join('\\n')\n}\n\n/**\n * Handle a request to the local presigned R2 endpoint; returns null when the\n * path does not match so gateways can fall through to their other routes.\n */\nasync function __devflareR2PresignHandle(request, env, url) {\n\tif (!url.pathname.startsWith(__devflareR2PresignPrefix)) return null\n\n\tif (request.method === 'OPTIONS') {\n\t\treturn new Response(null, {\n\t\t\tstatus: 204,\n\t\t\theaders: { ...__devflareR2PresignCors, 'Access-Control-Max-Age': '86400' }\n\t\t})\n\t}\n\n\tconst rest = url.pathname.slice(__devflareR2PresignPrefix.length)\n\tconst slashIndex = rest.indexOf('/')\n\tif (slashIndex <= 0 || slashIndex === rest.length - 1) {\n\t\treturn __devflareR2PresignError(400, 'bad_request', 'Expected /_devflare/r2/presigned/<binding>/<key>.')\n\t}\n\tconst binding = decodeURIComponent(rest.slice(0, slashIndex))\n\tconst key = rest\n\t\t.slice(slashIndex + 1)\n\t\t.split('/')\n\t\t.map((segment) => decodeURIComponent(segment))\n\t\t.join('/')\n\n\tconst secret = env.DEVFLARE_R2_PRESIGN_SECRET\n\tif (typeof secret !== 'string' || secret.length === 0) {\n\t\treturn __devflareR2PresignError(\n\t\t\t500,\n\t\t\t'presign_unconfigured',\n\t\t\t'DEVFLARE_R2_PRESIGN_SECRET is not configured on the devflare gateway. '\n\t\t\t\t+ 'This endpoint is only served for configs with R2 bindings.'\n\t\t)\n\t}\n\n\tconst params = url.searchParams\n\tconst signedMethod = params.get('X-Devflare-Method')\n\tconst expires = params.get('X-Devflare-Expires')\n\tconst providedSignature = params.get('X-Devflare-Signature')\n\tconst signedContentType = params.get('X-Devflare-Content-Type')\n\tconst signedContentLength = params.get('X-Devflare-Content-Length')\n\tconst signedMaxSize = params.get('X-Devflare-Max-Size')\n\n\tif (!signedMethod || !expires || !providedSignature) {\n\t\treturn __devflareR2PresignError(403, 'missing_parameters', 'Missing presign query parameters.')\n\t}\n\n\tconst expectedSignature = await __devflareR2PresignHmacHex(\n\t\tsecret,\n\t\t__devflareR2PresignCanonical(\n\t\t\tsignedMethod, binding, key, expires, signedContentType, signedContentLength, signedMaxSize\n\t\t)\n\t)\n\tif (!__devflareR2PresignEqual(expectedSignature, providedSignature)) {\n\t\treturn __devflareR2PresignError(403, 'invalid_signature', 'Presigned URL signature mismatch.')\n\t}\n\n\tif (Math.floor(Date.now() / 1000) > Number(expires)) {\n\t\treturn __devflareR2PresignError(403, 'expired', 'Presigned URL has expired.')\n\t}\n\n\tconst methodAllowed = signedMethod === 'GET'\n\t\t? request.method === 'GET' || request.method === 'HEAD'\n\t\t: request.method === signedMethod\n\tif (!methodAllowed) {\n\t\treturn __devflareR2PresignError(\n\t\t\t403,\n\t\t\t'method_mismatch',\n\t\t\t'URL was presigned for ' + signedMethod + ', got ' + request.method + '.'\n\t\t)\n\t}\n\n\tconst bucket = env[binding]\n\tif (!bucket || typeof bucket.put !== 'function' || typeof bucket.head !== 'function') {\n\t\treturn __devflareR2PresignError(404, 'unknown_binding', 'R2 binding not found: ' + binding)\n\t}\n\n\tif (request.method === 'PUT') {\n\t\tconst sentContentType = request.headers.get('Content-Type')\n\t\tif (signedContentType !== null && sentContentType !== signedContentType) {\n\t\t\treturn __devflareR2PresignError(\n\t\t\t\t403,\n\t\t\t\t'content_type_mismatch',\n\t\t\t\t'URL was presigned for Content-Type \"' + signedContentType + '\", got \"' + sentContentType + '\".'\n\t\t\t)\n\t\t}\n\n\t\tconst body = await request.arrayBuffer()\n\t\tif (signedContentLength !== null && body.byteLength !== Number(signedContentLength)) {\n\t\t\treturn __devflareR2PresignError(\n\t\t\t\t403,\n\t\t\t\t'content_length_mismatch',\n\t\t\t\t'URL was presigned for exactly ' + signedContentLength + ' bytes, got ' + body.byteLength + '.'\n\t\t\t)\n\t\t}\n\t\tif (signedMaxSize !== null && body.byteLength > Number(signedMaxSize)) {\n\t\t\treturn __devflareR2PresignError(\n\t\t\t\t413,\n\t\t\t\t'too_large',\n\t\t\t\t'Body of ' + body.byteLength + ' bytes exceeds the presigned maximum of ' + signedMaxSize + '.'\n\t\t\t)\n\t\t}\n\n\t\tconst putContentType = sentContentType || signedContentType || undefined\n\t\tconst result = await bucket.put(key, body, {\n\t\t\t...(putContentType && { httpMetadata: { contentType: putContentType } })\n\t\t})\n\t\treturn new Response(null, {\n\t\t\tstatus: 200,\n\t\t\theaders: { ...__devflareR2PresignCors, ...(result?.httpEtag && { ETag: result.httpEtag }) }\n\t\t})\n\t}\n\n\t// GET / HEAD\n\tconst objectHeaders = (object) => ({\n\t\t...__devflareR2PresignCors,\n\t\t'Content-Type': object.httpMetadata?.contentType || 'application/octet-stream',\n\t\t'Content-Length': String(object.size),\n\t\t...(object.httpEtag && { ETag: object.httpEtag })\n\t})\n\n\tif (request.method === 'HEAD') {\n\t\tconst object = await bucket.head(key)\n\t\tif (!object) return __devflareR2PresignError(404, 'not_found', 'Object not found: ' + key)\n\t\treturn new Response(null, { status: 200, headers: objectHeaders(object) })\n\t}\n\n\tconst object = await bucket.get(key)\n\tif (!object) return __devflareR2PresignError(404, 'not_found', 'Object not found: ' + key)\n\treturn new Response(object.body, { status: 200, headers: objectHeaders(object) })\n}\n";
9
+ //# sourceMappingURL=r2-presign-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"r2-presign-runtime.d.ts","sourceRoot":"","sources":["../../src/bridge/r2-presign-runtime.ts"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,yiOA+LjC,CAAA"}
package/dist/cli/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as runCli, t as parseArgs } from "../_chunks/cli-yOO5yCaf.js";
1
+ import { n as runCli, t as parseArgs } from "../_chunks/cli-BlVetiEh.js";
2
2
  export { parseArgs, runCli };
@@ -1 +1 @@
1
- {"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/config/compiler.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAwB,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAG5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EACN,2BAA2B,EAC3B,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,mBAAmB,EACnB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EACX,oBAAoB,EACpB,cAAc,EACd,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,MAAM,kB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AE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAO,GACzC,cAAc,CAKhB;AA2KD;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAC1C,MAAM,EAAE,cAAc,EACtB,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,GAAE;IAAE,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAIzB"}
@@ -5,7 +5,8 @@ import type { WsRouteConfig } from '../config/index.js';
5
5
  * All in-sandbox RPC behavior (method dispatch, error envelope, serialization,
6
6
  * WebSocket bridge, HTTP transfer) lives in `GATEWAY_RUNTIME_JS` and is shared
7
7
  * with `src/bridge/miniflare.ts`. The canonical TypeScript equivalent lives in
8
- * `src/bridge/server.ts`.
8
+ * `src/bridge/server.ts`. The local presigned-R2 endpoint handler is shared
9
+ * via `R2_PRESIGN_RUNTIME_JS` (`src/bridge/r2-presign-runtime.ts`).
9
10
  *
10
11
  * This file only owns the pieces that are genuinely dev-server-specific:
11
12
  * - WebSocket route matching & DO WebSocket forwarding (`WS_ROUTES`)
@@ -1 +1 @@
1
- {"version":3,"file":"gateway-script.d.ts","sourceRoot":"","sources":["../../src/dev-server/gateway-script.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAE9C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,GAAE,aAAa,EAAO,EAC9B,KAAK,UAAQ,EACb,qBAAqB,GAAE,MAAM,GAAG,IAAW,GACzC,MAAM,CAgQR"}
1
+ {"version":3,"file":"gateway-script.d.ts","sourceRoot":"","sources":["../../src/dev-server/gateway-script.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,GAAE,aAAa,EAAO,EAC9B,KAAK,UAAQ,EACb,qBAAqB,GAAE,MAAM,GAAG,IAAW,GACzC,MAAM,CAuQR"}
@@ -21,8 +21,21 @@ export interface BuildMiniflareDevConfigInput {
21
21
  browserShimPort: number;
22
22
  doResult: DOBundleResult | null;
23
23
  serviceBindingResolution?: ServiceBindingResolution | null;
24
+ /**
25
+ * Per-boot HMAC secret for the local R2 presign endpoint. Injected (with
26
+ * the gateway origin) as `DEVFLARE_R2_PRESIGN_*` vars into every worker
27
+ * when the config declares R2 bindings; ignored otherwise.
28
+ */
29
+ r2PresignSecret?: string | null;
24
30
  logger?: ConsolaInstance;
25
31
  }
32
+ /**
33
+ * Resolve the browser-facing origin of the local dev runtime, used inside
34
+ * locally-presigned R2 URLs. Honors `server.publicUrl` (reverse proxy /
35
+ * tunnel setups); otherwise derives `http(s)://<host>:<port>` from the
36
+ * Miniflare listen address, normalizing wildcard hosts to `localhost`.
37
+ */
38
+ export declare function resolveR2PresignOrigin(serverConfig: DevflareConfig['server'], miniflareHost: string, miniflarePort: number): string;
26
39
  /**
27
40
  * Build the complete Miniflare configuration for the dev server.
28
41
  *
@@ -1 +1 @@
1
- {"version":3,"file":"miniflare-dev-config.d.ts","sourceRoot":"","sources":["../../src/dev-server/miniflare-dev-config.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAI/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAgClE,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,wBAAwB,CAAA;AAGvF,KAAK,wBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAA;AAEl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AAM,WAAW,4BAA4B;IAC5C,MAAM,EAAE,cAAc,CAAA;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;IACd,sBAAsB,EAAE,kBAAkB,CAAA;IAC1C,gBAAgB,EAAE,oBAAoB,GAAG,IAAI,CAAA;IAC7C,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1C,wBAAwB,EAAE,MAAM,CAAA;IAChC,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAA;IAC/B,wBAAwB,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAA;IAC1D;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,MAAM,CAAC,EAAE,eAAe,CAAA;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACrC,YAAY,EAAE,cAAc,CAAC,QAAQ,CAAC,EACtC,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,GACnB,MAAM,CAOR;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,GAAG,GAAG,CAwQhF"}
@@ -83,6 +83,13 @@ export interface MakeMiniflareWorkerContext {
83
83
  queueName: string;
84
84
  deliveryDelay?: number;
85
85
  }> | undefined;
86
+ /**
87
+ * Devflare-internal plain-string vars merged into every worker's
88
+ * `bindings` on top of `config.vars` (e.g. the local R2 presign
89
+ * secret/origin). Collisions win over user vars — these names are
90
+ * `DEVFLARE_`-prefixed and reserved.
91
+ */
92
+ injectedVars?: Record<string, string>;
86
93
  }
87
94
  /**
88
95
  * Build a single worker config object for Miniflare's `workers` array.
@@ -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CAAA;IACjE,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,SAAS,CAAA;CACzF;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,0BAA0B,EACnC,OAAO,EAAE,0BAA0B,GACjC,GAAG,CAqHL"}
1
+ {"version":3,"file":"miniflare-worker-config.d.ts","sourceRoot":"","sources":["../../src/dev-server/miniflare-worker-config.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAM/C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAA;AAC/E,OAAO,KAAK,EACX,4BAA4B,EAC5B,6BAA6B,EAC7B,0BAA0B,EAC1B,oBAAoB,EACpB,6BAA6B,EAC7B,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,iCAAiC,EACjC,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,MAAM,sBAAsB,CAAA;AAE7B,KAAK,QAAQ,GAAG,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAA;AACvD,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAC9D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAChE,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAC1E,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAA;AACtE,KAAK,sBAAsB,GAAG,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAC5E,KAAK,wBAAwB,GAAG,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,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrB,yCAAyC;IACzC,YAAY,IAAI,aAAa,GAAG,IAAI,CAAA;CACpC;AAMD,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAwYpE"}
@@ -6,6 +6,15 @@ export interface StartViteProcessOptions {
6
6
  vitePort: number;
7
7
  miniflarePort: number;
8
8
  generatedViteConfigPath: string | null;
9
+ /**
10
+ * Local R2 presign context, exposed to the app process as
11
+ * `DEVFLARE_R2_PRESIGN_SECRET`/`DEVFLARE_R2_PRESIGN_ORIGIN` so
12
+ * `presignR2Put`/`presignR2Get` mint gateway-local URLs in dev.
13
+ */
14
+ r2Presign?: {
15
+ secret: string;
16
+ origin: string;
17
+ } | null;
9
18
  logger?: ConsolaInstance;
10
19
  }
11
20
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"vite-process.d.ts","sourceRoot":"","sources":["../../src/dev-server/vite-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,oBAAoB,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG9C,MAAM,WAAW,uBAAuB;IACvC,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC,MAAM,CAAC,EAAE,eAAe,CAAA;CACxB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,YAAY,CAAC,CAqC9F"}
1
+ {"version":3,"file":"vite-process.d.ts","sourceRoot":"","sources":["../../src/dev-server/vite-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,oBAAoB,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG9C,MAAM,WAAW,uBAAuB;IACvC,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC;;;;OAIG;IACH,SAAS,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IACrD,MAAM,CAAC,EAAE,eAAe,CAAA;CACxB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,YAAY,CAAC,CA4C9F"}
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { n as defineConfig, t as ref } from "./_chunks/ref-CYJNAAe_.js";
2
2
  import { i as preview } from "./_chunks/preview-C3Cdr8an.js";
3
3
  import { a as ConfigResourceResolutionError, d as configSchema, n as ConfigValidationError, o as loadResolvedConfig, r as loadConfig, t as ConfigNotFoundError } from "./_chunks/loader-E_UGyTrJ.js";
4
- import { n as compileConfig, s as stringifyConfig } from "./_chunks/compiler-okj8qvCh.js";
4
+ import { n as compileConfig, s as stringifyConfig } from "./_chunks/compiler-CgIFPfRA.js";
5
5
  import { t as workerName } from "./_chunks/workerName-CFJsLZA-.js";
6
6
  import { n as getDurableObjectOptions, t as durableObject } from "./_chunks/decorators-QmV57ixr.js";
7
- import { n as runCli, t as parseArgs } from "./_chunks/cli-yOO5yCaf.js";
7
+ import { n as runCli, t as parseArgs } from "./_chunks/cli-BlVetiEh.js";
8
8
  import { i as vars, r as env } from "./_chunks/env-S0_nMVz1.js";
9
9
  export { ConfigNotFoundError, ConfigResourceResolutionError, ConfigValidationError, compileConfig, configSchema, defineConfig as default, defineConfig, durableObject, env, getDurableObjectOptions, loadConfig, loadResolvedConfig, parseArgs, preview, ref, runCli, stringifyConfig, vars, workerName };
@@ -8,4 +8,5 @@ export { matchFetchRoute, invokeRouteModules, createRouteResolve } from './route
8
8
  export type { RouteSegment, RouteModuleDefinition, RouteMatchResult } from './router/types.js';
9
9
  export { durableObject, getDurableObjectOptions, type DurableObjectOptions } from '../decorators/index.js';
10
10
  export { setLocalSendEmailBindings, clearLocalSendEmailBindings, type LocalSendEmailBindingConfig } from '../utils/send-email.js';
11
+ export { presignR2Put, presignR2Get, type R2PresignCredentials, type R2PresignBaseOptions, type R2PresignPutOptions, type R2PresignGetOptions, type PresignedR2Request } from './r2-presign.js';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACN,GAAG,EACH,IAAI,EACJ,GAAG,EACH,KAAK,EACL,MAAM,EACN,MAAM,WAAW,CAAA;AAElB,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7C,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,6BAA6B,EAC7B,6BAA6B,EAC7B,wCAAwC,EACxC,sCAAsC,EACtC,sCAAsC,EACtC,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,0BAA0B,EAC1B,0BAA0B,EAC1B,qCAAqC,EACrC,mCAAmC,EACnC,mCAAmC,EACnC,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,MAAM,WAAW,CAAA;AAElB,YAAY,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,WAAW,EACX,QAAQ,EACR,MAAM,WAAW,CAAA;AAGlB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAGrE,OAAO,EACN,QAAQ,EACR,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,+BAA+B,EAC/B,mCAAmC,EACnC,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,cAAc,CAAA;AAErB,OAAO,EACN,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,MAAM,UAAU,CAAA;AAEjB,YAAY,EACX,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,EAChB,MAAM,gBAAgB,CAAA;AAGvB,OAAO,EACN,aAAa,EACb,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,MAAM,eAAe,CAAA;AAKtB,OAAO,EACN,yBAAyB,EACzB,2BAA2B,EAC3B,KAAK,2BAA2B,EAChC,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACN,GAAG,EACH,IAAI,EACJ,GAAG,EACH,KAAK,EACL,MAAM,EACN,MAAM,WAAW,CAAA;AAElB,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7C,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,6BAA6B,EAC7B,6BAA6B,EAC7B,wCAAwC,EACxC,sCAAsC,EACtC,sCAAsC,EACtC,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,YAAY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