miniflare 0.0.0-e8975a93a → 0.0.0-eaf71b86c
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/README.md +11 -0
- package/dist/src/index.d.ts +202 -66
- package/dist/src/index.js +489 -304
- package/dist/src/index.js.map +3 -3
- package/dist/src/workers/assets/assets-kv.worker.js +5 -1
- package/dist/src/workers/assets/assets-kv.worker.js.map +1 -1
- package/dist/src/workers/assets/assets.worker.js +9251 -92
- package/dist/src/workers/assets/assets.worker.js.map +3 -3
- package/dist/src/workers/assets/router.worker.js +8684 -6
- package/dist/src/workers/assets/router.worker.js.map +3 -3
- package/dist/src/workers/core/entry.worker.js +5 -2
- package/dist/src/workers/core/entry.worker.js.map +1 -1
- package/dist/src/workers/queues/broker.worker.js +11 -5
- package/dist/src/workers/queues/broker.worker.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -574,6 +574,17 @@ parameter in module format Workers.
|
|
|
574
574
|
have at most one consumer. If a `string[]` of queue names is specified,
|
|
575
575
|
default consumer options will be used.
|
|
576
576
|
|
|
577
|
+
#### Assets
|
|
578
|
+
|
|
579
|
+
- `directory?: string`
|
|
580
|
+
Path to serve Workers static asset files from.
|
|
581
|
+
|
|
582
|
+
- `binding?: string`
|
|
583
|
+
Binding name to inject as a `Fetcher` binding to allow access to static assets from within the Worker.
|
|
584
|
+
|
|
585
|
+
- `assetOptions?: { html_handling?: HTMLHandlingOptions, not_found_handling?: NotFoundHandlingOptions}`
|
|
586
|
+
Configuration for file-based asset routing - see [docs](https://developers.cloudflare.com/workers/static-assets/routing/#routing-configuration) for options
|
|
587
|
+
|
|
577
588
|
#### Analytics Engine, Sending Email, Vectorize and Workers for Platforms
|
|
578
589
|
|
|
579
590
|
_Not yet supported_
|
package/dist/src/index.d.ts
CHANGED
|
@@ -58,52 +58,85 @@ export declare class __MiniflareFunctionWrapper {
|
|
|
58
58
|
|
|
59
59
|
export declare type AnyHeaders = http.IncomingHttpHeaders | string[];
|
|
60
60
|
|
|
61
|
+
export declare type AssetReverseMap = {
|
|
62
|
+
[pathHash: string]: {
|
|
63
|
+
filePath: string;
|
|
64
|
+
contentType: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
61
68
|
export declare const ASSETS_PLUGIN: Plugin<typeof AssetsOptionsSchema>;
|
|
62
69
|
|
|
63
70
|
export declare const AssetsOptionsSchema: z.ZodObject<{
|
|
64
71
|
assets: z.ZodOptional<z.ZodObject<{
|
|
65
72
|
workerName: z.ZodOptional<z.ZodString>;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
routingConfig: z.ZodObject<{
|
|
69
|
-
|
|
73
|
+
directory: z.ZodEffects<z.ZodString, string, string>;
|
|
74
|
+
binding: z.ZodOptional<z.ZodString>;
|
|
75
|
+
routingConfig: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
has_user_worker: z.ZodOptional<z.ZodBoolean>;
|
|
70
77
|
}, "strip", z.ZodTypeAny, {
|
|
71
|
-
|
|
78
|
+
has_user_worker?: boolean;
|
|
72
79
|
}, {
|
|
73
|
-
|
|
74
|
-
}
|
|
80
|
+
has_user_worker?: boolean;
|
|
81
|
+
}>>;
|
|
82
|
+
assetConfig: z.ZodOptional<z.ZodObject<{
|
|
83
|
+
html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>;
|
|
84
|
+
not_found_handling: z.ZodOptional<z.ZodEnum<["single-page-application", "404-page", "none"]>>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
87
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
88
|
+
}, {
|
|
89
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
90
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
91
|
+
}>>;
|
|
75
92
|
}, "strip", z.ZodTypeAny, {
|
|
76
|
-
|
|
77
|
-
routingConfig: {
|
|
78
|
-
hasUserWorker: boolean;
|
|
79
|
-
};
|
|
93
|
+
directory: string;
|
|
80
94
|
workerName?: string | undefined;
|
|
81
|
-
|
|
95
|
+
binding?: string | undefined;
|
|
96
|
+
routingConfig?: {
|
|
97
|
+
has_user_worker?: boolean;
|
|
98
|
+
} | undefined;
|
|
99
|
+
assetConfig?: {
|
|
100
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
101
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
102
|
+
} | undefined;
|
|
82
103
|
}, {
|
|
83
|
-
|
|
84
|
-
routingConfig: {
|
|
85
|
-
hasUserWorker: boolean;
|
|
86
|
-
};
|
|
104
|
+
directory: string;
|
|
87
105
|
workerName?: string | undefined;
|
|
88
|
-
|
|
106
|
+
binding?: string | undefined;
|
|
107
|
+
routingConfig?: {
|
|
108
|
+
has_user_worker?: boolean;
|
|
109
|
+
} | undefined;
|
|
110
|
+
assetConfig?: {
|
|
111
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
112
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
113
|
+
} | undefined;
|
|
89
114
|
}>>;
|
|
90
115
|
}, "strip", z.ZodTypeAny, {
|
|
91
116
|
assets?: {
|
|
92
|
-
|
|
93
|
-
routingConfig: {
|
|
94
|
-
hasUserWorker: boolean;
|
|
95
|
-
};
|
|
117
|
+
directory: string;
|
|
96
118
|
workerName?: string | undefined;
|
|
97
|
-
|
|
119
|
+
binding?: string | undefined;
|
|
120
|
+
routingConfig?: {
|
|
121
|
+
has_user_worker?: boolean;
|
|
122
|
+
} | undefined;
|
|
123
|
+
assetConfig?: {
|
|
124
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
125
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
126
|
+
} | undefined;
|
|
98
127
|
} | undefined;
|
|
99
128
|
}, {
|
|
100
129
|
assets?: {
|
|
101
|
-
|
|
102
|
-
routingConfig: {
|
|
103
|
-
hasUserWorker: boolean;
|
|
104
|
-
};
|
|
130
|
+
directory: string;
|
|
105
131
|
workerName?: string | undefined;
|
|
106
|
-
|
|
132
|
+
binding?: string | undefined;
|
|
133
|
+
routingConfig?: {
|
|
134
|
+
has_user_worker?: boolean;
|
|
135
|
+
} | undefined;
|
|
136
|
+
assetConfig?: {
|
|
137
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
138
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
139
|
+
} | undefined;
|
|
107
140
|
} | undefined;
|
|
108
141
|
}>;
|
|
109
142
|
|
|
@@ -115,7 +148,19 @@ export declare function base64Encode(value: string): string;
|
|
|
115
148
|
|
|
116
149
|
export { BodyInit }
|
|
117
150
|
|
|
118
|
-
|
|
151
|
+
/**
|
|
152
|
+
* The Asset Manifest and Asset Reverse Map are used to map a request path to an asset.
|
|
153
|
+
* 1. Hash path of request
|
|
154
|
+
* 2. Use this path hash to find the manifest entry
|
|
155
|
+
* 3. Get content hash from manifest entry
|
|
156
|
+
* 4a. In prod, use content hash to get asset from KV
|
|
157
|
+
* 4b. In dev, we fake out the KV store and use the file system instead.
|
|
158
|
+
* Use content hash to get file path from asset reverse map.
|
|
159
|
+
*/
|
|
160
|
+
export declare const buildAssetManifest: (dir: string) => Promise<{
|
|
161
|
+
encodedAssetManifest: Uint8Array;
|
|
162
|
+
assetsReverseMap: AssetReverseMap;
|
|
163
|
+
}>;
|
|
119
164
|
|
|
120
165
|
export declare const CACHE_PLUGIN: Plugin<typeof CacheOptionsSchema, typeof CacheSharedOptionsSchema>;
|
|
121
166
|
|
|
@@ -640,6 +685,10 @@ export declare const CoreOptionsSchema: z.ZodEffects<z.ZodIntersection<z.ZodUnio
|
|
|
640
685
|
}>, "many">>;
|
|
641
686
|
unsafeEvalBinding: z.ZodOptional<z.ZodString>;
|
|
642
687
|
unsafeUseModuleFallbackService: z.ZodOptional<z.ZodBoolean>;
|
|
688
|
+
/** Used to set the vitest pool worker SELF binding to point to the router worker if there are assets.
|
|
689
|
+
(If there are assets but we're not using vitest, the miniflare entry worker can point directly to RW.)
|
|
690
|
+
*/
|
|
691
|
+
hasAssetsAndIsVitest: z.ZodOptional<z.ZodBoolean>;
|
|
643
692
|
}, "strip", z.ZodTypeAny, {
|
|
644
693
|
name?: string | undefined;
|
|
645
694
|
rootPath?: undefined;
|
|
@@ -719,6 +768,7 @@ export declare const CoreOptionsSchema: z.ZodEffects<z.ZodIntersection<z.ZodUnio
|
|
|
719
768
|
}[] | undefined;
|
|
720
769
|
unsafeEvalBinding?: string | undefined;
|
|
721
770
|
unsafeUseModuleFallbackService?: boolean | undefined;
|
|
771
|
+
hasAssetsAndIsVitest?: boolean | undefined;
|
|
722
772
|
}, {
|
|
723
773
|
name?: string | undefined;
|
|
724
774
|
rootPath?: string | undefined;
|
|
@@ -798,6 +848,7 @@ export declare const CoreOptionsSchema: z.ZodEffects<z.ZodIntersection<z.ZodUnio
|
|
|
798
848
|
}[] | undefined;
|
|
799
849
|
unsafeEvalBinding?: string | undefined;
|
|
800
850
|
unsafeUseModuleFallbackService?: boolean | undefined;
|
|
851
|
+
hasAssetsAndIsVitest?: boolean | undefined;
|
|
801
852
|
}>>, ({
|
|
802
853
|
modules: {
|
|
803
854
|
type: "ESModule" | "CommonJS" | "NodeJsCompatModule" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement";
|
|
@@ -884,6 +935,7 @@ export declare const CoreOptionsSchema: z.ZodEffects<z.ZodIntersection<z.ZodUnio
|
|
|
884
935
|
}[] | undefined;
|
|
885
936
|
unsafeEvalBinding?: string | undefined;
|
|
886
937
|
unsafeUseModuleFallbackService?: boolean | undefined;
|
|
938
|
+
hasAssetsAndIsVitest?: boolean | undefined;
|
|
887
939
|
}) | ({
|
|
888
940
|
script: string;
|
|
889
941
|
scriptPath?: string | undefined;
|
|
@@ -973,6 +1025,7 @@ export declare const CoreOptionsSchema: z.ZodEffects<z.ZodIntersection<z.ZodUnio
|
|
|
973
1025
|
}[] | undefined;
|
|
974
1026
|
unsafeEvalBinding?: string | undefined;
|
|
975
1027
|
unsafeUseModuleFallbackService?: boolean | undefined;
|
|
1028
|
+
hasAssetsAndIsVitest?: boolean | undefined;
|
|
976
1029
|
}) | ({
|
|
977
1030
|
scriptPath: string;
|
|
978
1031
|
modules?: boolean | undefined;
|
|
@@ -1061,6 +1114,7 @@ export declare const CoreOptionsSchema: z.ZodEffects<z.ZodIntersection<z.ZodUnio
|
|
|
1061
1114
|
}[] | undefined;
|
|
1062
1115
|
unsafeEvalBinding?: string | undefined;
|
|
1063
1116
|
unsafeUseModuleFallbackService?: boolean | undefined;
|
|
1117
|
+
hasAssetsAndIsVitest?: boolean | undefined;
|
|
1064
1118
|
}), ({
|
|
1065
1119
|
modules: {
|
|
1066
1120
|
type: "ESModule" | "CommonJS" | "NodeJsCompatModule" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement";
|
|
@@ -1166,6 +1220,7 @@ export declare const CoreOptionsSchema: z.ZodEffects<z.ZodIntersection<z.ZodUnio
|
|
|
1166
1220
|
}[] | undefined;
|
|
1167
1221
|
unsafeEvalBinding?: string | undefined;
|
|
1168
1222
|
unsafeUseModuleFallbackService?: boolean | undefined;
|
|
1223
|
+
hasAssetsAndIsVitest?: boolean | undefined;
|
|
1169
1224
|
}>;
|
|
1170
1225
|
|
|
1171
1226
|
export declare const CoreSharedOptionsSchema: z.ZodObject<{
|
|
@@ -1321,6 +1376,7 @@ export declare const DURABLE_OBJECTS_PLUGIN_NAME = "do";
|
|
|
1321
1376
|
export declare const DURABLE_OBJECTS_STORAGE_SERVICE_NAME = "do:storage";
|
|
1322
1377
|
|
|
1323
1378
|
export declare type DurableObjectClassNames = Map<string, Map<string, {
|
|
1379
|
+
enableSql?: boolean;
|
|
1324
1380
|
unsafeUniqueKey?: UnsafeUniqueKey;
|
|
1325
1381
|
unsafePreventEviction?: boolean;
|
|
1326
1382
|
}>>;
|
|
@@ -1329,16 +1385,19 @@ export declare const DurableObjectsOptionsSchema: z.ZodObject<{
|
|
|
1329
1385
|
durableObjects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1330
1386
|
className: z.ZodString;
|
|
1331
1387
|
scriptName: z.ZodOptional<z.ZodString>;
|
|
1388
|
+
useSQLite: z.ZodOptional<z.ZodBoolean>;
|
|
1332
1389
|
unsafeUniqueKey: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<typeof kUnsafeEphemeralUniqueKey>]>>;
|
|
1333
1390
|
unsafePreventEviction: z.ZodOptional<z.ZodBoolean>;
|
|
1334
1391
|
}, "strip", z.ZodTypeAny, {
|
|
1335
1392
|
className: string;
|
|
1336
1393
|
scriptName?: string | undefined;
|
|
1394
|
+
useSQLite?: boolean | undefined;
|
|
1337
1395
|
unsafeUniqueKey?: string | typeof kUnsafeEphemeralUniqueKey | undefined;
|
|
1338
1396
|
unsafePreventEviction?: boolean | undefined;
|
|
1339
1397
|
}, {
|
|
1340
1398
|
className: string;
|
|
1341
1399
|
scriptName?: string | undefined;
|
|
1400
|
+
useSQLite?: boolean | undefined;
|
|
1342
1401
|
unsafeUniqueKey?: string | typeof kUnsafeEphemeralUniqueKey | undefined;
|
|
1343
1402
|
unsafePreventEviction?: boolean | undefined;
|
|
1344
1403
|
}>]>>>;
|
|
@@ -1346,6 +1405,7 @@ export declare const DurableObjectsOptionsSchema: z.ZodObject<{
|
|
|
1346
1405
|
durableObjects?: Record<string, string | {
|
|
1347
1406
|
className: string;
|
|
1348
1407
|
scriptName?: string | undefined;
|
|
1408
|
+
useSQLite?: boolean | undefined;
|
|
1349
1409
|
unsafeUniqueKey?: string | typeof kUnsafeEphemeralUniqueKey | undefined;
|
|
1350
1410
|
unsafePreventEviction?: boolean | undefined;
|
|
1351
1411
|
}> | undefined;
|
|
@@ -1353,6 +1413,7 @@ export declare const DurableObjectsOptionsSchema: z.ZodObject<{
|
|
|
1353
1413
|
durableObjects?: Record<string, string | {
|
|
1354
1414
|
className: string;
|
|
1355
1415
|
scriptName?: string | undefined;
|
|
1416
|
+
useSQLite?: boolean | undefined;
|
|
1356
1417
|
unsafeUniqueKey?: string | typeof kUnsafeEphemeralUniqueKey | undefined;
|
|
1357
1418
|
unsafePreventEviction?: boolean | undefined;
|
|
1358
1419
|
}> | undefined;
|
|
@@ -1443,6 +1504,30 @@ export declare function getGlobalServices({ sharedOptions, allWorkerRoutes, fall
|
|
|
1443
1504
|
|
|
1444
1505
|
export declare function getMiniflareObjectBindings(unsafeStickyBlobs: boolean): Worker_Binding[];
|
|
1445
1506
|
|
|
1507
|
+
/**
|
|
1508
|
+
* Computes the Node.js compatibility mode we are running.
|
|
1509
|
+
*
|
|
1510
|
+
* NOTES:
|
|
1511
|
+
* - The v2 mode is configured via `nodejs_compat_v2` compat flag or via `nodejs_compat` plus a compatibility date of Sept 23rd. 2024 or later.
|
|
1512
|
+
* - See `EnvironmentInheritable` for `nodeCompat` and `noBundle`.
|
|
1513
|
+
*
|
|
1514
|
+
* @param compatibilityDateStr The compatibility date
|
|
1515
|
+
* @param compatibilityFlags The compatibility flags
|
|
1516
|
+
* @param opts.nodeCompat Whether the legacy node_compat arg is being used
|
|
1517
|
+
* @returns the mode and flags to indicate specific configuration for validating.
|
|
1518
|
+
*/
|
|
1519
|
+
export declare function getNodeCompat(compatibilityDate: string | undefined, // Default to some arbitrary old date
|
|
1520
|
+
compatibilityFlags: string[], opts?: {
|
|
1521
|
+
nodeCompat?: boolean;
|
|
1522
|
+
}): {
|
|
1523
|
+
mode: NodeJSCompatMode;
|
|
1524
|
+
hasNodejsAlsFlag: boolean;
|
|
1525
|
+
hasNodejsCompatFlag: boolean;
|
|
1526
|
+
hasNodejsCompatV2Flag: boolean;
|
|
1527
|
+
hasNoNodejsCompatV2Flag: boolean;
|
|
1528
|
+
hasExperimentalNodejsCompatV2Flag: boolean;
|
|
1529
|
+
};
|
|
1530
|
+
|
|
1446
1531
|
export declare function getPersistPath(pluginName: string, tmpPath: string, persist: Persistence): string;
|
|
1447
1532
|
|
|
1448
1533
|
export declare function getRootPath(opts: unknown): string;
|
|
@@ -1547,8 +1632,6 @@ export declare const kInspectorSocket: unique symbol;
|
|
|
1547
1632
|
|
|
1548
1633
|
declare const kPair: unique symbol;
|
|
1549
1634
|
|
|
1550
|
-
export declare const kProxyNodeBinding: unique symbol;
|
|
1551
|
-
|
|
1552
1635
|
declare const kSend: unique symbol;
|
|
1553
1636
|
|
|
1554
1637
|
export declare const kUnsafeEphemeralUniqueKey: unique symbol;
|
|
@@ -1643,6 +1726,11 @@ export declare interface LogOptions {
|
|
|
1643
1726
|
suffix?: string;
|
|
1644
1727
|
}
|
|
1645
1728
|
|
|
1729
|
+
export declare type ManifestEntry = {
|
|
1730
|
+
pathHash: Uint8Array;
|
|
1731
|
+
contentHash: Uint8Array;
|
|
1732
|
+
};
|
|
1733
|
+
|
|
1646
1734
|
export declare interface MatcherRegExps {
|
|
1647
1735
|
include: RegExp[];
|
|
1648
1736
|
exclude: RegExp[];
|
|
@@ -1696,7 +1784,7 @@ export declare class Miniflare {
|
|
|
1696
1784
|
export declare class MiniflareCoreError extends MiniflareError<MiniflareCoreErrorCode> {
|
|
1697
1785
|
}
|
|
1698
1786
|
|
|
1699
|
-
export declare type MiniflareCoreErrorCode = "ERR_RUNTIME_FAILURE" | "ERR_DISPOSED" | "ERR_MODULE_PARSE" | "ERR_MODULE_STRING_SCRIPT" | "ERR_MODULE_DYNAMIC_SPEC" | "ERR_MODULE_RULE" | "ERR_PERSIST_UNSUPPORTED" | "ERR_PERSIST_REMOTE_UNAUTHENTICATED" | "ERR_PERSIST_REMOTE_UNSUPPORTED" | "ERR_FUTURE_COMPATIBILITY_DATE" | "ERR_NO_WORKERS" | "ERR_VALIDATION" | "ERR_DUPLICATE_NAME" | "ERR_DIFFERENT_UNIQUE_KEYS" | "ERR_DIFFERENT_PREVENT_EVICTION" | "ERR_MULTIPLE_OUTBOUNDS" | "ERR_INVALID_WRAPPED" | "ERR_CYCLIC";
|
|
1787
|
+
export declare type MiniflareCoreErrorCode = "ERR_RUNTIME_FAILURE" | "ERR_DISPOSED" | "ERR_MODULE_PARSE" | "ERR_MODULE_STRING_SCRIPT" | "ERR_MODULE_DYNAMIC_SPEC" | "ERR_MODULE_RULE" | "ERR_PERSIST_UNSUPPORTED" | "ERR_PERSIST_REMOTE_UNAUTHENTICATED" | "ERR_PERSIST_REMOTE_UNSUPPORTED" | "ERR_FUTURE_COMPATIBILITY_DATE" | "ERR_NO_WORKERS" | "ERR_VALIDATION" | "ERR_DUPLICATE_NAME" | "ERR_DIFFERENT_STORAGE_BACKEND" | "ERR_DIFFERENT_UNIQUE_KEYS" | "ERR_DIFFERENT_PREVENT_EVICTION" | "ERR_MULTIPLE_OUTBOUNDS" | "ERR_INVALID_WRAPPED" | "ERR_CYCLIC";
|
|
1700
1788
|
|
|
1701
1789
|
export declare class MiniflareError<Code extends string | number = string | number> extends Error {
|
|
1702
1790
|
readonly code: Code;
|
|
@@ -1767,6 +1855,17 @@ export declare interface Network {
|
|
|
1767
1855
|
|
|
1768
1856
|
export declare const NODE_PLATFORM_IMPL: PlatformImpl<ReadableStream_2>;
|
|
1769
1857
|
|
|
1858
|
+
/**
|
|
1859
|
+
* We can provide Node.js compatibility in a number of different modes:
|
|
1860
|
+
* - "legacy" - this mode adds compile-time polyfills that are not well maintained and cannot work with workerd runtime builtins.
|
|
1861
|
+
* - "als": this mode tells the workerd runtime to enable only the Async Local Storage builtin library (accessible via `node:async_hooks`).
|
|
1862
|
+
* - "v1" - this mode tells the workerd runtime to enable some Node.js builtin libraries (accessible only via `node:...` imports) but no globals.
|
|
1863
|
+
* - "v2" - this mode tells the workerd runtime to enable more Node.js builtin libraries (accessible both with and without the `node:` prefix)
|
|
1864
|
+
* and also some Node.js globals such as `Buffer`; it also turns on additional compile-time polyfills for those that are not provided by the runtime.
|
|
1865
|
+
* - null - no Node.js compatibility.
|
|
1866
|
+
*/
|
|
1867
|
+
export declare type NodeJSCompatMode = "legacy" | "als" | "v1" | "v2" | null;
|
|
1868
|
+
|
|
1770
1869
|
export declare class NoOpLog extends Log {
|
|
1771
1870
|
constructor();
|
|
1772
1871
|
protected log(): void;
|
|
@@ -1776,6 +1875,7 @@ export declare class NoOpLog extends Log {
|
|
|
1776
1875
|
export declare function normaliseDurableObject(designator: NonNullable<z.infer<typeof DurableObjectsOptionsSchema>["durableObjects"]>[string]): {
|
|
1777
1876
|
className: string;
|
|
1778
1877
|
serviceName?: string;
|
|
1878
|
+
enableSql?: boolean;
|
|
1779
1879
|
unsafeUniqueKey?: UnsafeUniqueKey;
|
|
1780
1880
|
unsafePreventEviction?: boolean;
|
|
1781
1881
|
};
|
|
@@ -2333,6 +2433,7 @@ export declare const PLUGINS: {
|
|
|
2333
2433
|
}>, "many">>;
|
|
2334
2434
|
unsafeEvalBinding: z.ZodOptional<z.ZodString>;
|
|
2335
2435
|
unsafeUseModuleFallbackService: z.ZodOptional<z.ZodBoolean>;
|
|
2436
|
+
hasAssetsAndIsVitest: z.ZodOptional<z.ZodBoolean>;
|
|
2336
2437
|
}, "strip", z.ZodTypeAny, {
|
|
2337
2438
|
name?: string | undefined;
|
|
2338
2439
|
rootPath?: undefined;
|
|
@@ -2412,6 +2513,7 @@ export declare const PLUGINS: {
|
|
|
2412
2513
|
}[] | undefined;
|
|
2413
2514
|
unsafeEvalBinding?: string | undefined;
|
|
2414
2515
|
unsafeUseModuleFallbackService?: boolean | undefined;
|
|
2516
|
+
hasAssetsAndIsVitest?: boolean | undefined;
|
|
2415
2517
|
}, {
|
|
2416
2518
|
name?: string | undefined;
|
|
2417
2519
|
rootPath?: string | undefined;
|
|
@@ -2491,6 +2593,7 @@ export declare const PLUGINS: {
|
|
|
2491
2593
|
}[] | undefined;
|
|
2492
2594
|
unsafeEvalBinding?: string | undefined;
|
|
2493
2595
|
unsafeUseModuleFallbackService?: boolean | undefined;
|
|
2596
|
+
hasAssetsAndIsVitest?: boolean | undefined;
|
|
2494
2597
|
}>>, ({
|
|
2495
2598
|
modules: {
|
|
2496
2599
|
type: "ESModule" | "CommonJS" | "NodeJsCompatModule" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement";
|
|
@@ -2577,6 +2680,7 @@ export declare const PLUGINS: {
|
|
|
2577
2680
|
}[] | undefined;
|
|
2578
2681
|
unsafeEvalBinding?: string | undefined;
|
|
2579
2682
|
unsafeUseModuleFallbackService?: boolean | undefined;
|
|
2683
|
+
hasAssetsAndIsVitest?: boolean | undefined;
|
|
2580
2684
|
}) | ({
|
|
2581
2685
|
script: string;
|
|
2582
2686
|
scriptPath?: string | undefined;
|
|
@@ -2666,6 +2770,7 @@ export declare const PLUGINS: {
|
|
|
2666
2770
|
}[] | undefined;
|
|
2667
2771
|
unsafeEvalBinding?: string | undefined;
|
|
2668
2772
|
unsafeUseModuleFallbackService?: boolean | undefined;
|
|
2773
|
+
hasAssetsAndIsVitest?: boolean | undefined;
|
|
2669
2774
|
}) | ({
|
|
2670
2775
|
scriptPath: string;
|
|
2671
2776
|
modules?: boolean | undefined;
|
|
@@ -2754,6 +2859,7 @@ export declare const PLUGINS: {
|
|
|
2754
2859
|
}[] | undefined;
|
|
2755
2860
|
unsafeEvalBinding?: string | undefined;
|
|
2756
2861
|
unsafeUseModuleFallbackService?: boolean | undefined;
|
|
2862
|
+
hasAssetsAndIsVitest?: boolean | undefined;
|
|
2757
2863
|
}), ({
|
|
2758
2864
|
modules: {
|
|
2759
2865
|
type: "ESModule" | "CommonJS" | "NodeJsCompatModule" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement";
|
|
@@ -2859,6 +2965,7 @@ export declare const PLUGINS: {
|
|
|
2859
2965
|
}[] | undefined;
|
|
2860
2966
|
unsafeEvalBinding?: string | undefined;
|
|
2861
2967
|
unsafeUseModuleFallbackService?: boolean | undefined;
|
|
2968
|
+
hasAssetsAndIsVitest?: boolean | undefined;
|
|
2862
2969
|
}>, z.ZodObject<{
|
|
2863
2970
|
rootPath: z.ZodOptional<z.ZodEffects<z.ZodString, undefined, string>>;
|
|
2864
2971
|
host: z.ZodOptional<z.ZodString>;
|
|
@@ -2950,16 +3057,19 @@ export declare const PLUGINS: {
|
|
|
2950
3057
|
durableObjects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
2951
3058
|
className: z.ZodString;
|
|
2952
3059
|
scriptName: z.ZodOptional<z.ZodString>;
|
|
3060
|
+
useSQLite: z.ZodOptional<z.ZodBoolean>;
|
|
2953
3061
|
unsafeUniqueKey: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<kUnsafeEphemeralUniqueKey>]>>;
|
|
2954
3062
|
unsafePreventEviction: z.ZodOptional<z.ZodBoolean>;
|
|
2955
3063
|
}, "strip", z.ZodTypeAny, {
|
|
2956
3064
|
className: string;
|
|
2957
3065
|
scriptName?: string | undefined;
|
|
3066
|
+
useSQLite?: boolean | undefined;
|
|
2958
3067
|
unsafeUniqueKey?: string | kUnsafeEphemeralUniqueKey | undefined;
|
|
2959
3068
|
unsafePreventEviction?: boolean | undefined;
|
|
2960
3069
|
}, {
|
|
2961
3070
|
className: string;
|
|
2962
3071
|
scriptName?: string | undefined;
|
|
3072
|
+
useSQLite?: boolean | undefined;
|
|
2963
3073
|
unsafeUniqueKey?: string | kUnsafeEphemeralUniqueKey | undefined;
|
|
2964
3074
|
unsafePreventEviction?: boolean | undefined;
|
|
2965
3075
|
}>]>>>;
|
|
@@ -2967,6 +3077,7 @@ export declare const PLUGINS: {
|
|
|
2967
3077
|
durableObjects?: Record<string, string | {
|
|
2968
3078
|
className: string;
|
|
2969
3079
|
scriptName?: string | undefined;
|
|
3080
|
+
useSQLite?: boolean | undefined;
|
|
2970
3081
|
unsafeUniqueKey?: string | kUnsafeEphemeralUniqueKey | undefined;
|
|
2971
3082
|
unsafePreventEviction?: boolean | undefined;
|
|
2972
3083
|
}> | undefined;
|
|
@@ -2974,6 +3085,7 @@ export declare const PLUGINS: {
|
|
|
2974
3085
|
durableObjects?: Record<string, string | {
|
|
2975
3086
|
className: string;
|
|
2976
3087
|
scriptName?: string | undefined;
|
|
3088
|
+
useSQLite?: boolean | undefined;
|
|
2977
3089
|
unsafeUniqueKey?: string | kUnsafeEphemeralUniqueKey | undefined;
|
|
2978
3090
|
unsafePreventEviction?: boolean | undefined;
|
|
2979
3091
|
}> | undefined;
|
|
@@ -3122,47 +3234,73 @@ export declare const PLUGINS: {
|
|
|
3122
3234
|
assets: Plugin<z.ZodObject<{
|
|
3123
3235
|
assets: z.ZodOptional<z.ZodObject<{
|
|
3124
3236
|
workerName: z.ZodOptional<z.ZodString>;
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
routingConfig: z.ZodObject<{
|
|
3128
|
-
|
|
3237
|
+
directory: z.ZodEffects<z.ZodString, string, string>;
|
|
3238
|
+
binding: z.ZodOptional<z.ZodString>;
|
|
3239
|
+
routingConfig: z.ZodOptional<z.ZodObject<{
|
|
3240
|
+
has_user_worker: z.ZodOptional<z.ZodBoolean>;
|
|
3129
3241
|
}, "strip", z.ZodTypeAny, {
|
|
3130
|
-
|
|
3242
|
+
has_user_worker?: boolean;
|
|
3131
3243
|
}, {
|
|
3132
|
-
|
|
3133
|
-
}
|
|
3244
|
+
has_user_worker?: boolean;
|
|
3245
|
+
}>>;
|
|
3246
|
+
assetConfig: z.ZodOptional<z.ZodObject<{
|
|
3247
|
+
html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>;
|
|
3248
|
+
not_found_handling: z.ZodOptional<z.ZodEnum<["single-page-application", "404-page", "none"]>>;
|
|
3134
3249
|
}, "strip", z.ZodTypeAny, {
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3250
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
3251
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
3252
|
+
}, {
|
|
3253
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
3254
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
3255
|
+
}>>;
|
|
3256
|
+
}, "strip", z.ZodTypeAny, {
|
|
3257
|
+
directory: string;
|
|
3139
3258
|
workerName?: string | undefined;
|
|
3140
|
-
|
|
3259
|
+
binding?: string | undefined;
|
|
3260
|
+
routingConfig?: {
|
|
3261
|
+
has_user_worker?: boolean;
|
|
3262
|
+
} | undefined;
|
|
3263
|
+
assetConfig?: {
|
|
3264
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
3265
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
3266
|
+
} | undefined;
|
|
3141
3267
|
}, {
|
|
3142
|
-
|
|
3143
|
-
routingConfig: {
|
|
3144
|
-
hasUserWorker: boolean;
|
|
3145
|
-
};
|
|
3268
|
+
directory: string;
|
|
3146
3269
|
workerName?: string | undefined;
|
|
3147
|
-
|
|
3270
|
+
binding?: string | undefined;
|
|
3271
|
+
routingConfig?: {
|
|
3272
|
+
has_user_worker?: boolean;
|
|
3273
|
+
} | undefined;
|
|
3274
|
+
assetConfig?: {
|
|
3275
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
3276
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
3277
|
+
} | undefined;
|
|
3148
3278
|
}>>;
|
|
3149
3279
|
}, "strip", z.ZodTypeAny, {
|
|
3150
3280
|
assets?: {
|
|
3151
|
-
|
|
3152
|
-
routingConfig: {
|
|
3153
|
-
hasUserWorker: boolean;
|
|
3154
|
-
};
|
|
3281
|
+
directory: string;
|
|
3155
3282
|
workerName?: string | undefined;
|
|
3156
|
-
|
|
3283
|
+
binding?: string | undefined;
|
|
3284
|
+
routingConfig?: {
|
|
3285
|
+
has_user_worker?: boolean;
|
|
3286
|
+
} | undefined;
|
|
3287
|
+
assetConfig?: {
|
|
3288
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
3289
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
3290
|
+
} | undefined;
|
|
3157
3291
|
} | undefined;
|
|
3158
3292
|
}, {
|
|
3159
3293
|
assets?: {
|
|
3160
|
-
|
|
3161
|
-
routingConfig: {
|
|
3162
|
-
hasUserWorker: boolean;
|
|
3163
|
-
};
|
|
3294
|
+
directory: string;
|
|
3164
3295
|
workerName?: string | undefined;
|
|
3165
|
-
|
|
3296
|
+
binding?: string | undefined;
|
|
3297
|
+
routingConfig?: {
|
|
3298
|
+
has_user_worker?: boolean;
|
|
3299
|
+
} | undefined;
|
|
3300
|
+
assetConfig?: {
|
|
3301
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
3302
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
3303
|
+
} | undefined;
|
|
3166
3304
|
} | undefined;
|
|
3167
3305
|
}>>;
|
|
3168
3306
|
};
|
|
@@ -3207,6 +3345,11 @@ export declare class ProxyClient {
|
|
|
3207
3345
|
dispose(): Promise<void>;
|
|
3208
3346
|
}
|
|
3209
3347
|
|
|
3348
|
+
export declare class ProxyNodeBinding {
|
|
3349
|
+
proxyOverrideHandler?: ProxyHandler<any> | undefined;
|
|
3350
|
+
constructor(proxyOverrideHandler?: ProxyHandler<any> | undefined);
|
|
3351
|
+
}
|
|
3352
|
+
|
|
3210
3353
|
export declare const ProxyOps: {
|
|
3211
3354
|
readonly GET: "GET";
|
|
3212
3355
|
readonly GET_OWN_DESCRIPTOR: "GET_OWN_DESCRIPTOR";
|
|
@@ -3637,14 +3780,6 @@ export declare class RouterError extends MiniflareError<RouterErrorCode> {
|
|
|
3637
3780
|
|
|
3638
3781
|
export declare type RouterErrorCode = "ERR_QUERY_STRING" | "ERR_INFIX_WILDCARD";
|
|
3639
3782
|
|
|
3640
|
-
export declare const RoutingConfigSchema: z.ZodObject<{
|
|
3641
|
-
hasUserWorker: z.ZodBoolean;
|
|
3642
|
-
}, "strip", z.ZodTypeAny, {
|
|
3643
|
-
hasUserWorker: boolean;
|
|
3644
|
-
}, {
|
|
3645
|
-
hasUserWorker: boolean;
|
|
3646
|
-
}>;
|
|
3647
|
-
|
|
3648
3783
|
export declare class Runtime {
|
|
3649
3784
|
#private;
|
|
3650
3785
|
updateConfig(configBuffer: Buffer, options: Abortable & RuntimeOptions): Promise<SocketPorts | undefined>;
|
|
@@ -4127,6 +4262,7 @@ export declare interface Worker_Binding_WrappedBinding {
|
|
|
4127
4262
|
export declare type Worker_DurableObjectNamespace = {
|
|
4128
4263
|
className?: string;
|
|
4129
4264
|
preventEviction?: boolean;
|
|
4265
|
+
enableSql?: boolean;
|
|
4130
4266
|
} & ({
|
|
4131
4267
|
uniqueKey?: string;
|
|
4132
4268
|
} | {
|