@substrat-run/adapter-cloudflare 0.122.1 → 0.125.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/control-plane-do.d.ts +8 -0
- package/dist/control-plane-do.d.ts.map +1 -1
- package/dist/control-plane-do.js +24 -7
- package/dist/control-plane-do.js.map +1 -1
- package/dist/host.d.ts +176 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +462 -28
- package/dist/host.js.map +1 -1
- package/dist/live-reads.d.ts +7 -9
- package/dist/live-reads.d.ts.map +1 -1
- package/dist/live-reads.js +7 -7
- package/dist/live-reads.js.map +1 -1
- package/dist/rewind-refusal.d.ts +11 -0
- package/dist/rewind-refusal.d.ts.map +1 -0
- package/dist/rewind-refusal.js +13 -0
- package/dist/rewind-refusal.js.map +1 -0
- package/dist/scope-do.d.ts.map +1 -1
- package/dist/scope-do.js +393 -70
- package/dist/scope-do.js.map +1 -1
- package/package.json +6 -6
package/dist/live-reads.d.ts
CHANGED
|
@@ -39,8 +39,12 @@ export declare const LIVE_SCOPE_HEADER = "x-substrat-live-scope";
|
|
|
39
39
|
* is how somebody reports "live updates are broken" two months later and nobody can
|
|
40
40
|
* establish whether they ever worked on that hostname. One header makes the fallback a
|
|
41
41
|
* fact the client can log, display, and report.
|
|
42
|
+
*
|
|
43
|
+
* Defined in the kernel (#1859), because the pure host's `501` names it too and a
|
|
44
|
+
* vertical's dev server should not import this adapter to spell it. Re-exported here so
|
|
45
|
+
* `host.ts` and `scope-do.ts` keep reading every wire name from this one file.
|
|
42
46
|
*/
|
|
43
|
-
export
|
|
47
|
+
export { LIVE_MODE_HEADER, type LiveRefusal } from '@substrat-run/kernel';
|
|
44
48
|
/**
|
|
45
49
|
* Cloudflare's own per-request marker for orange-to-orange routing.
|
|
46
50
|
*
|
|
@@ -58,12 +62,6 @@ export declare const LIVE_MODE_HEADER = "x-substrat-live";
|
|
|
58
62
|
* cheaper than a matrix and correct on the request after the tenant changes their DNS.
|
|
59
63
|
*/
|
|
60
64
|
export declare const O2O_HEADER = "cf-connecting-o2o";
|
|
61
|
-
/** Why a subscription was refused — the value of `LIVE_MODE_HEADER` on a refusal. */
|
|
62
|
-
export type LiveRefusal =
|
|
63
|
-
/** This connection cannot carry a WebSocket; the client should keep polling. */
|
|
64
|
-
'poll'
|
|
65
|
-
/** The request was not an upgrade at all — a programming error at the caller. */
|
|
66
|
-
| 'not-an-upgrade';
|
|
67
65
|
/**
|
|
68
66
|
* What a subscribed socket remembers about itself across a hibernation.
|
|
69
67
|
*
|
|
@@ -103,8 +101,8 @@ export declare function readSubscription(attachment: unknown): LiveSubscription
|
|
|
103
101
|
* reaching it means something unusual happened rather than something normal being cut off.
|
|
104
102
|
*/
|
|
105
103
|
export declare const LIVE_FANOUT_LIMIT = 200;
|
|
106
|
-
/** Is this request asking to be upgraded to a WebSocket? */
|
|
107
|
-
export
|
|
104
|
+
/** Is this request asking to be upgraded to a WebSocket? Defined in the kernel (#1859). */
|
|
105
|
+
export { isUpgradeRequest } from '@substrat-run/kernel';
|
|
108
106
|
/**
|
|
109
107
|
* Is this request arriving over an orange-to-orange hop?
|
|
110
108
|
*
|
package/dist/live-reads.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-reads.d.ts","sourceRoot":"","sources":["../src/live-reads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAE9E;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAErD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AACjE,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAC3D,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AAEzD
|
|
1
|
+
{"version":3,"file":"live-reads.d.ts","sourceRoot":"","sources":["../src/live-reads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAE9E;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAErD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AACjE,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAC3D,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE1E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,UAAU,sBAAsB,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,yFAAyF;IACzF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,OAAO,GAAG,gBAAgB,GAAG,IAAI,CAa7E;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,2FAA2F;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE1D"}
|
package/dist/live-reads.js
CHANGED
|
@@ -27,8 +27,12 @@ export const LIVE_SCOPE_HEADER = 'x-substrat-live-scope';
|
|
|
27
27
|
* is how somebody reports "live updates are broken" two months later and nobody can
|
|
28
28
|
* establish whether they ever worked on that hostname. One header makes the fallback a
|
|
29
29
|
* fact the client can log, display, and report.
|
|
30
|
+
*
|
|
31
|
+
* Defined in the kernel (#1859), because the pure host's `501` names it too and a
|
|
32
|
+
* vertical's dev server should not import this adapter to spell it. Re-exported here so
|
|
33
|
+
* `host.ts` and `scope-do.ts` keep reading every wire name from this one file.
|
|
30
34
|
*/
|
|
31
|
-
export
|
|
35
|
+
export { LIVE_MODE_HEADER } from '@substrat-run/kernel';
|
|
32
36
|
/**
|
|
33
37
|
* Cloudflare's own per-request marker for orange-to-orange routing.
|
|
34
38
|
*
|
|
@@ -87,12 +91,8 @@ export function readSubscription(attachment) {
|
|
|
87
91
|
* reaching it means something unusual happened rather than something normal being cut off.
|
|
88
92
|
*/
|
|
89
93
|
export const LIVE_FANOUT_LIMIT = 200;
|
|
90
|
-
/** Is this request asking to be upgraded to a WebSocket? */
|
|
91
|
-
export
|
|
92
|
-
// Case-insensitive: the header is `Upgrade: websocket` by the RFC, but the token is
|
|
93
|
-
// compared case-insensitively there too, and browsers are not the only clients.
|
|
94
|
-
return (request.headers.get('Upgrade') ?? '').toLowerCase() === 'websocket';
|
|
95
|
-
}
|
|
94
|
+
/** Is this request asking to be upgraded to a WebSocket? Defined in the kernel (#1859). */
|
|
95
|
+
export { isUpgradeRequest } from '@substrat-run/kernel';
|
|
96
96
|
/**
|
|
97
97
|
* Is this request arriving over an orange-to-orange hop?
|
|
98
98
|
*
|
package/dist/live-reads.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-reads.js","sourceRoot":"","sources":["../src/live-reads.ts"],"names":[],"mappings":"AAaA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AACjE,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAC3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAEzD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AAK;KACf,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAErC,2FAA2F;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #1819: the prefix every DEFINITE refusal of a PITR rewind carries. The scope DO refuses before
|
|
3
|
+
* it arms the bookmark, so a refusal means nothing was rewound. Any other throw from a rewind is
|
|
4
|
+
* ambiguous: the DO may already have armed the bookmark and restarted. The host tells the two
|
|
5
|
+
* apart by this prefix, because an error crossing an RPC boundary keeps its message and little
|
|
6
|
+
* else.
|
|
7
|
+
*/
|
|
8
|
+
export declare const REWIND_REFUSED = "rewind refused: ";
|
|
9
|
+
/** Is this a rewind the scope DO definitely refused, before arming anything? */
|
|
10
|
+
export declare function isRewindRefusal(err: unknown): boolean;
|
|
11
|
+
//# sourceMappingURL=rewind-refusal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewind-refusal.d.ts","sourceRoot":"","sources":["../src/rewind-refusal.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAErD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #1819: the prefix every DEFINITE refusal of a PITR rewind carries. The scope DO refuses before
|
|
3
|
+
* it arms the bookmark, so a refusal means nothing was rewound. Any other throw from a rewind is
|
|
4
|
+
* ambiguous: the DO may already have armed the bookmark and restarted. The host tells the two
|
|
5
|
+
* apart by this prefix, because an error crossing an RPC boundary keeps its message and little
|
|
6
|
+
* else.
|
|
7
|
+
*/
|
|
8
|
+
export const REWIND_REFUSED = 'rewind refused: ';
|
|
9
|
+
/** Is this a rewind the scope DO definitely refused, before arming anything? */
|
|
10
|
+
export function isRewindRefusal(err) {
|
|
11
|
+
return err instanceof Error && err.message.startsWith(REWIND_REFUSED);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=rewind-refusal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewind-refusal.js","sourceRoot":"","sources":["../src/rewind-refusal.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEjD,gFAAgF;AAChF,MAAM,UAAU,eAAe,CAAC,GAAY;IAC1C,OAAO,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACxE,CAAC"}
|
package/dist/scope-do.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-do.d.ts","sourceRoot":"","sources":["../src/scope-do.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scope-do.d.ts","sourceRoot":"","sources":["../src/scope-do.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAYL,KAAK,WAAW,EAqCjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAmCL,KAAK,SAAS,EAmBd,KAAK,kBAAkB,EAEvB,KAAK,gBAAgB,EAoEtB,MAAM,sBAAsB,CAAC;AAiF9B;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAwaD;;;GAGG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAgDxG;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,CAOxD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAwDxD;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,kBAAkB,EAAE,EAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,GACxD,KAAK,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,UAAU,KAAK,aAAa,CA86JjE"}
|