miniflare 0.0.0-dff8d44f4 → 0.0.0-e3136f935

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.
@@ -58,6 +58,81 @@ export declare class __MiniflareFunctionWrapper {
58
58
 
59
59
  export declare type AnyHeaders = http.IncomingHttpHeaders | string[];
60
60
 
61
+ export declare const ASSETS_PLUGIN: Plugin<typeof AssetsOptionsSchema>;
62
+
63
+ export declare const AssetsOptionsSchema: z.ZodObject<{
64
+ assets: z.ZodOptional<z.ZodObject<{
65
+ workerName: z.ZodOptional<z.ZodString>;
66
+ path: z.ZodEffects<z.ZodString, string, string>;
67
+ bindingName: z.ZodOptional<z.ZodString>;
68
+ routingConfig: z.ZodObject<{
69
+ has_user_worker: z.ZodOptional<z.ZodBoolean>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ has_user_worker?: boolean;
72
+ }, {
73
+ has_user_worker?: boolean;
74
+ }>;
75
+ assetConfig: z.ZodObject<{
76
+ html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>;
77
+ not_found_handling: z.ZodOptional<z.ZodEnum<["single-page-application", "404-page", "none"]>>;
78
+ }, "strip", z.ZodTypeAny, {
79
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
80
+ not_found_handling?: "none" | "single-page-application" | "404-page";
81
+ }, {
82
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
83
+ not_found_handling?: "none" | "single-page-application" | "404-page";
84
+ }>;
85
+ }, "strip", z.ZodTypeAny, {
86
+ path: string;
87
+ routingConfig: {
88
+ has_user_worker?: boolean;
89
+ };
90
+ assetConfig: {
91
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
92
+ not_found_handling?: "none" | "single-page-application" | "404-page";
93
+ };
94
+ workerName?: string | undefined;
95
+ bindingName?: string | undefined;
96
+ }, {
97
+ path: string;
98
+ routingConfig: {
99
+ has_user_worker?: boolean;
100
+ };
101
+ assetConfig: {
102
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
103
+ not_found_handling?: "none" | "single-page-application" | "404-page";
104
+ };
105
+ workerName?: string | undefined;
106
+ bindingName?: string | undefined;
107
+ }>>;
108
+ }, "strip", z.ZodTypeAny, {
109
+ assets?: {
110
+ path: string;
111
+ routingConfig: {
112
+ has_user_worker?: boolean;
113
+ };
114
+ assetConfig: {
115
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
116
+ not_found_handling?: "none" | "single-page-application" | "404-page";
117
+ };
118
+ workerName?: string | undefined;
119
+ bindingName?: string | undefined;
120
+ } | undefined;
121
+ }, {
122
+ assets?: {
123
+ path: string;
124
+ routingConfig: {
125
+ has_user_worker?: boolean;
126
+ };
127
+ assetConfig: {
128
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
129
+ not_found_handling?: "none" | "single-page-application" | "404-page";
130
+ };
131
+ workerName?: string | undefined;
132
+ bindingName?: string | undefined;
133
+ } | undefined;
134
+ }>;
135
+
61
136
  export declare type Awaitable<T> = T | Promise<T>;
62
137
 
63
138
  export declare function base64Decode(encoded: string): string;
@@ -66,6 +141,8 @@ export declare function base64Encode(value: string): string;
66
141
 
67
142
  export { BodyInit }
68
143
 
144
+ export declare const buildAssetsManifest: (dir: string) => Promise<Uint8Array>;
145
+
69
146
  export declare const CACHE_PLUGIN: Plugin<typeof CacheOptionsSchema, typeof CacheSharedOptionsSchema>;
70
147
 
71
148
  export declare const CACHE_PLUGIN_NAME = "cache";
@@ -1270,6 +1347,7 @@ export declare const DURABLE_OBJECTS_PLUGIN_NAME = "do";
1270
1347
  export declare const DURABLE_OBJECTS_STORAGE_SERVICE_NAME = "do:storage";
1271
1348
 
1272
1349
  export declare type DurableObjectClassNames = Map<string, Map<string, {
1350
+ enableSql?: boolean;
1273
1351
  unsafeUniqueKey?: UnsafeUniqueKey;
1274
1352
  unsafePreventEviction?: boolean;
1275
1353
  }>>;
@@ -1278,16 +1356,19 @@ export declare const DurableObjectsOptionsSchema: z.ZodObject<{
1278
1356
  durableObjects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{
1279
1357
  className: z.ZodString;
1280
1358
  scriptName: z.ZodOptional<z.ZodString>;
1359
+ useSQLite: z.ZodOptional<z.ZodBoolean>;
1281
1360
  unsafeUniqueKey: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<typeof kUnsafeEphemeralUniqueKey>]>>;
1282
1361
  unsafePreventEviction: z.ZodOptional<z.ZodBoolean>;
1283
1362
  }, "strip", z.ZodTypeAny, {
1284
1363
  className: string;
1285
1364
  scriptName?: string | undefined;
1365
+ useSQLite?: boolean | undefined;
1286
1366
  unsafeUniqueKey?: string | typeof kUnsafeEphemeralUniqueKey | undefined;
1287
1367
  unsafePreventEviction?: boolean | undefined;
1288
1368
  }, {
1289
1369
  className: string;
1290
1370
  scriptName?: string | undefined;
1371
+ useSQLite?: boolean | undefined;
1291
1372
  unsafeUniqueKey?: string | typeof kUnsafeEphemeralUniqueKey | undefined;
1292
1373
  unsafePreventEviction?: boolean | undefined;
1293
1374
  }>]>>>;
@@ -1295,6 +1376,7 @@ export declare const DurableObjectsOptionsSchema: z.ZodObject<{
1295
1376
  durableObjects?: Record<string, string | {
1296
1377
  className: string;
1297
1378
  scriptName?: string | undefined;
1379
+ useSQLite?: boolean | undefined;
1298
1380
  unsafeUniqueKey?: string | typeof kUnsafeEphemeralUniqueKey | undefined;
1299
1381
  unsafePreventEviction?: boolean | undefined;
1300
1382
  }> | undefined;
@@ -1302,6 +1384,7 @@ export declare const DurableObjectsOptionsSchema: z.ZodObject<{
1302
1384
  durableObjects?: Record<string, string | {
1303
1385
  className: string;
1304
1386
  scriptName?: string | undefined;
1387
+ useSQLite?: boolean | undefined;
1305
1388
  unsafeUniqueKey?: string | typeof kUnsafeEphemeralUniqueKey | undefined;
1306
1389
  unsafePreventEviction?: boolean | undefined;
1307
1390
  }> | undefined;
@@ -1496,8 +1579,6 @@ export declare const kInspectorSocket: unique symbol;
1496
1579
 
1497
1580
  declare const kPair: unique symbol;
1498
1581
 
1499
- export declare const kProxyNodeBinding: unique symbol;
1500
-
1501
1582
  declare const kSend: unique symbol;
1502
1583
 
1503
1584
  export declare const kUnsafeEphemeralUniqueKey: unique symbol;
@@ -1524,25 +1605,16 @@ export declare const kVoid: unique symbol;
1524
1605
 
1525
1606
  export declare const KVOptionsSchema: z.ZodObject<{
1526
1607
  kvNamespaces: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString, "many">]>>;
1527
- assetsPath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1528
- assetsKVBindingName: z.ZodOptional<z.ZodString>;
1529
- assetsManifestBindingName: z.ZodOptional<z.ZodString>;
1530
1608
  sitePath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1531
1609
  siteInclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1532
1610
  siteExclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1533
1611
  }, "strip", z.ZodTypeAny, {
1534
1612
  kvNamespaces?: string[] | Record<string, string> | undefined;
1535
- assetsPath?: string | undefined;
1536
- assetsKVBindingName?: string | undefined;
1537
- assetsManifestBindingName?: string | undefined;
1538
1613
  sitePath?: string | undefined;
1539
1614
  siteInclude?: string[] | undefined;
1540
1615
  siteExclude?: string[] | undefined;
1541
1616
  }, {
1542
1617
  kvNamespaces?: string[] | Record<string, string> | undefined;
1543
- assetsPath?: string | undefined;
1544
- assetsKVBindingName?: string | undefined;
1545
- assetsManifestBindingName?: string | undefined;
1546
1618
  sitePath?: string | undefined;
1547
1619
  siteInclude?: string[] | undefined;
1548
1620
  siteExclude?: string[] | undefined;
@@ -1654,7 +1726,7 @@ export declare class Miniflare {
1654
1726
  export declare class MiniflareCoreError extends MiniflareError<MiniflareCoreErrorCode> {
1655
1727
  }
1656
1728
 
1657
- 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";
1729
+ 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";
1658
1730
 
1659
1731
  export declare class MiniflareError<Code extends string | number = string | number> extends Error {
1660
1732
  readonly code: Code;
@@ -1734,6 +1806,7 @@ export declare class NoOpLog extends Log {
1734
1806
  export declare function normaliseDurableObject(designator: NonNullable<z.infer<typeof DurableObjectsOptionsSchema>["durableObjects"]>[string]): {
1735
1807
  className: string;
1736
1808
  serviceName?: string;
1809
+ enableSql?: boolean;
1737
1810
  unsafeUniqueKey?: UnsafeUniqueKey;
1738
1811
  unsafePreventEviction?: boolean;
1739
1812
  };
@@ -2908,16 +2981,19 @@ export declare const PLUGINS: {
2908
2981
  durableObjects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{
2909
2982
  className: z.ZodString;
2910
2983
  scriptName: z.ZodOptional<z.ZodString>;
2984
+ useSQLite: z.ZodOptional<z.ZodBoolean>;
2911
2985
  unsafeUniqueKey: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<kUnsafeEphemeralUniqueKey>]>>;
2912
2986
  unsafePreventEviction: z.ZodOptional<z.ZodBoolean>;
2913
2987
  }, "strip", z.ZodTypeAny, {
2914
2988
  className: string;
2915
2989
  scriptName?: string | undefined;
2990
+ useSQLite?: boolean | undefined;
2916
2991
  unsafeUniqueKey?: string | kUnsafeEphemeralUniqueKey | undefined;
2917
2992
  unsafePreventEviction?: boolean | undefined;
2918
2993
  }, {
2919
2994
  className: string;
2920
2995
  scriptName?: string | undefined;
2996
+ useSQLite?: boolean | undefined;
2921
2997
  unsafeUniqueKey?: string | kUnsafeEphemeralUniqueKey | undefined;
2922
2998
  unsafePreventEviction?: boolean | undefined;
2923
2999
  }>]>>>;
@@ -2925,6 +3001,7 @@ export declare const PLUGINS: {
2925
3001
  durableObjects?: Record<string, string | {
2926
3002
  className: string;
2927
3003
  scriptName?: string | undefined;
3004
+ useSQLite?: boolean | undefined;
2928
3005
  unsafeUniqueKey?: string | kUnsafeEphemeralUniqueKey | undefined;
2929
3006
  unsafePreventEviction?: boolean | undefined;
2930
3007
  }> | undefined;
@@ -2932,6 +3009,7 @@ export declare const PLUGINS: {
2932
3009
  durableObjects?: Record<string, string | {
2933
3010
  className: string;
2934
3011
  scriptName?: string | undefined;
3012
+ useSQLite?: boolean | undefined;
2935
3013
  unsafeUniqueKey?: string | kUnsafeEphemeralUniqueKey | undefined;
2936
3014
  unsafePreventEviction?: boolean | undefined;
2937
3015
  }> | undefined;
@@ -2944,25 +3022,16 @@ export declare const PLUGINS: {
2944
3022
  }>>;
2945
3023
  kv: Plugin<z.ZodObject<{
2946
3024
  kvNamespaces: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString, "many">]>>;
2947
- assetsPath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
2948
- assetsKVBindingName: z.ZodOptional<z.ZodString>;
2949
- assetsManifestBindingName: z.ZodOptional<z.ZodString>;
2950
3025
  sitePath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
2951
3026
  siteInclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2952
3027
  siteExclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2953
3028
  }, "strip", z.ZodTypeAny, {
2954
3029
  kvNamespaces?: string[] | Record<string, string> | undefined;
2955
- assetsPath?: string | undefined;
2956
- assetsKVBindingName?: string | undefined;
2957
- assetsManifestBindingName?: string | undefined;
2958
3030
  sitePath?: string | undefined;
2959
3031
  siteInclude?: string[] | undefined;
2960
3032
  siteExclude?: string[] | undefined;
2961
3033
  }, {
2962
3034
  kvNamespaces?: string[] | Record<string, string> | undefined;
2963
- assetsPath?: string | undefined;
2964
- assetsKVBindingName?: string | undefined;
2965
- assetsManifestBindingName?: string | undefined;
2966
3035
  sitePath?: string | undefined;
2967
3036
  siteInclude?: string[] | undefined;
2968
3037
  siteExclude?: string[] | undefined;
@@ -3086,6 +3155,78 @@ export declare const PLUGINS: {
3086
3155
  };
3087
3156
  }> | undefined;
3088
3157
  }>>;
3158
+ assets: Plugin<z.ZodObject<{
3159
+ assets: z.ZodOptional<z.ZodObject<{
3160
+ workerName: z.ZodOptional<z.ZodString>;
3161
+ path: z.ZodEffects<z.ZodString, string, string>;
3162
+ bindingName: z.ZodOptional<z.ZodString>;
3163
+ routingConfig: z.ZodObject<{
3164
+ has_user_worker: z.ZodOptional<z.ZodBoolean>;
3165
+ }, "strip", z.ZodTypeAny, {
3166
+ has_user_worker?: boolean;
3167
+ }, {
3168
+ has_user_worker?: boolean;
3169
+ }>;
3170
+ assetConfig: z.ZodObject<{
3171
+ html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>;
3172
+ not_found_handling: z.ZodOptional<z.ZodEnum<["single-page-application", "404-page", "none"]>>;
3173
+ }, "strip", z.ZodTypeAny, {
3174
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
3175
+ not_found_handling?: "none" | "single-page-application" | "404-page";
3176
+ }, {
3177
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
3178
+ not_found_handling?: "none" | "single-page-application" | "404-page";
3179
+ }>;
3180
+ }, "strip", z.ZodTypeAny, {
3181
+ path: string;
3182
+ routingConfig: {
3183
+ has_user_worker?: boolean;
3184
+ };
3185
+ assetConfig: {
3186
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
3187
+ not_found_handling?: "none" | "single-page-application" | "404-page";
3188
+ };
3189
+ workerName?: string | undefined;
3190
+ bindingName?: string | undefined;
3191
+ }, {
3192
+ path: string;
3193
+ routingConfig: {
3194
+ has_user_worker?: boolean;
3195
+ };
3196
+ assetConfig: {
3197
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
3198
+ not_found_handling?: "none" | "single-page-application" | "404-page";
3199
+ };
3200
+ workerName?: string | undefined;
3201
+ bindingName?: string | undefined;
3202
+ }>>;
3203
+ }, "strip", z.ZodTypeAny, {
3204
+ assets?: {
3205
+ path: string;
3206
+ routingConfig: {
3207
+ has_user_worker?: boolean;
3208
+ };
3209
+ assetConfig: {
3210
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
3211
+ not_found_handling?: "none" | "single-page-application" | "404-page";
3212
+ };
3213
+ workerName?: string | undefined;
3214
+ bindingName?: string | undefined;
3215
+ } | undefined;
3216
+ }, {
3217
+ assets?: {
3218
+ path: string;
3219
+ routingConfig: {
3220
+ has_user_worker?: boolean;
3221
+ };
3222
+ assetConfig: {
3223
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
3224
+ not_found_handling?: "none" | "single-page-application" | "404-page";
3225
+ };
3226
+ workerName?: string | undefined;
3227
+ bindingName?: string | undefined;
3228
+ } | undefined;
3229
+ }>>;
3089
3230
  };
3090
3231
 
3091
3232
  export declare type Plugins = typeof PLUGINS;
@@ -3128,6 +3269,11 @@ export declare class ProxyClient {
3128
3269
  dispose(): Promise<void>;
3129
3270
  }
3130
3271
 
3272
+ export declare class ProxyNodeBinding {
3273
+ proxyOverrideHandler?: ProxyHandler<any> | undefined;
3274
+ constructor(proxyOverrideHandler?: ProxyHandler<any> | undefined);
3275
+ }
3276
+
3131
3277
  export declare const ProxyOps: {
3132
3278
  readonly GET: "GET";
3133
3279
  readonly GET_OWN_DESCRIPTOR: "GET_OWN_DESCRIPTOR";
@@ -4040,6 +4186,7 @@ export declare interface Worker_Binding_WrappedBinding {
4040
4186
  export declare type Worker_DurableObjectNamespace = {
4041
4187
  className?: string;
4042
4188
  preventEviction?: boolean;
4189
+ enableSql?: boolean;
4043
4190
  } & ({
4044
4191
  uniqueKey?: string;
4045
4192
  } | {
@@ -4076,7 +4223,7 @@ export declare type Worker_Module = {
4076
4223
  pythonRequirement?: string;
4077
4224
  });
4078
4225
 
4079
- export declare type WorkerOptions = z.input<typeof CORE_PLUGIN.options> & z.input<typeof CACHE_PLUGIN.options> & z.input<typeof D1_PLUGIN.options> & z.input<typeof DURABLE_OBJECTS_PLUGIN.options> & z.input<typeof KV_PLUGIN.options> & z.input<typeof QUEUES_PLUGIN.options> & z.input<typeof R2_PLUGIN.options> & z.input<typeof HYPERDRIVE_PLUGIN.options> & z.input<typeof RATELIMIT_PLUGIN.options>;
4226
+ export declare type WorkerOptions = z.input<typeof CORE_PLUGIN.options> & z.input<typeof CACHE_PLUGIN.options> & z.input<typeof D1_PLUGIN.options> & z.input<typeof DURABLE_OBJECTS_PLUGIN.options> & z.input<typeof KV_PLUGIN.options> & z.input<typeof QUEUES_PLUGIN.options> & z.input<typeof R2_PLUGIN.options> & z.input<typeof HYPERDRIVE_PLUGIN.options> & z.input<typeof RATELIMIT_PLUGIN.options> & z.input<typeof ASSETS_PLUGIN.options>;
4080
4227
 
4081
4228
  export declare interface WorkerRoute {
4082
4229
  target: string;