miniflare 0.0.0-dff8d44f4 → 0.0.0-e8975a93a
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/src/index.d.ts +106 -19
- package/dist/src/index.js +1089 -1006
- package/dist/src/index.js.map +3 -3
- package/dist/src/workers/{kv/assets.worker.js → assets/assets-kv.worker.js} +5 -5
- package/dist/src/workers/{kv/assets.worker.js.map → assets/assets-kv.worker.js.map} +2 -2
- package/dist/src/workers/assets/assets.worker.js +116 -0
- package/dist/src/workers/assets/assets.worker.js.map +6 -0
- package/dist/src/workers/assets/router.worker.js +12 -0
- package/dist/src/workers/assets/router.worker.js.map +6 -0
- package/package.json +3 -2
package/dist/src/index.d.ts
CHANGED
|
@@ -58,6 +58,55 @@ 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
|
+
hasUserWorker: z.ZodBoolean;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
hasUserWorker: boolean;
|
|
72
|
+
}, {
|
|
73
|
+
hasUserWorker: boolean;
|
|
74
|
+
}>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
path: string;
|
|
77
|
+
routingConfig: {
|
|
78
|
+
hasUserWorker: boolean;
|
|
79
|
+
};
|
|
80
|
+
workerName?: string | undefined;
|
|
81
|
+
bindingName?: string | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
path: string;
|
|
84
|
+
routingConfig: {
|
|
85
|
+
hasUserWorker: boolean;
|
|
86
|
+
};
|
|
87
|
+
workerName?: string | undefined;
|
|
88
|
+
bindingName?: string | undefined;
|
|
89
|
+
}>>;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
assets?: {
|
|
92
|
+
path: string;
|
|
93
|
+
routingConfig: {
|
|
94
|
+
hasUserWorker: boolean;
|
|
95
|
+
};
|
|
96
|
+
workerName?: string | undefined;
|
|
97
|
+
bindingName?: string | undefined;
|
|
98
|
+
} | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
assets?: {
|
|
101
|
+
path: string;
|
|
102
|
+
routingConfig: {
|
|
103
|
+
hasUserWorker: boolean;
|
|
104
|
+
};
|
|
105
|
+
workerName?: string | undefined;
|
|
106
|
+
bindingName?: string | undefined;
|
|
107
|
+
} | undefined;
|
|
108
|
+
}>;
|
|
109
|
+
|
|
61
110
|
export declare type Awaitable<T> = T | Promise<T>;
|
|
62
111
|
|
|
63
112
|
export declare function base64Decode(encoded: string): string;
|
|
@@ -66,6 +115,8 @@ export declare function base64Encode(value: string): string;
|
|
|
66
115
|
|
|
67
116
|
export { BodyInit }
|
|
68
117
|
|
|
118
|
+
export declare const buildAssetsManifest: (dir: string) => Promise<Uint8Array>;
|
|
119
|
+
|
|
69
120
|
export declare const CACHE_PLUGIN: Plugin<typeof CacheOptionsSchema, typeof CacheSharedOptionsSchema>;
|
|
70
121
|
|
|
71
122
|
export declare const CACHE_PLUGIN_NAME = "cache";
|
|
@@ -1524,25 +1575,16 @@ export declare const kVoid: unique symbol;
|
|
|
1524
1575
|
|
|
1525
1576
|
export declare const KVOptionsSchema: z.ZodObject<{
|
|
1526
1577
|
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
1578
|
sitePath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
1531
1579
|
siteInclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1532
1580
|
siteExclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1533
1581
|
}, "strip", z.ZodTypeAny, {
|
|
1534
1582
|
kvNamespaces?: string[] | Record<string, string> | undefined;
|
|
1535
|
-
assetsPath?: string | undefined;
|
|
1536
|
-
assetsKVBindingName?: string | undefined;
|
|
1537
|
-
assetsManifestBindingName?: string | undefined;
|
|
1538
1583
|
sitePath?: string | undefined;
|
|
1539
1584
|
siteInclude?: string[] | undefined;
|
|
1540
1585
|
siteExclude?: string[] | undefined;
|
|
1541
1586
|
}, {
|
|
1542
1587
|
kvNamespaces?: string[] | Record<string, string> | undefined;
|
|
1543
|
-
assetsPath?: string | undefined;
|
|
1544
|
-
assetsKVBindingName?: string | undefined;
|
|
1545
|
-
assetsManifestBindingName?: string | undefined;
|
|
1546
1588
|
sitePath?: string | undefined;
|
|
1547
1589
|
siteInclude?: string[] | undefined;
|
|
1548
1590
|
siteExclude?: string[] | undefined;
|
|
@@ -2944,25 +2986,16 @@ export declare const PLUGINS: {
|
|
|
2944
2986
|
}>>;
|
|
2945
2987
|
kv: Plugin<z.ZodObject<{
|
|
2946
2988
|
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
2989
|
sitePath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
2951
2990
|
siteInclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2952
2991
|
siteExclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2953
2992
|
}, "strip", z.ZodTypeAny, {
|
|
2954
2993
|
kvNamespaces?: string[] | Record<string, string> | undefined;
|
|
2955
|
-
assetsPath?: string | undefined;
|
|
2956
|
-
assetsKVBindingName?: string | undefined;
|
|
2957
|
-
assetsManifestBindingName?: string | undefined;
|
|
2958
2994
|
sitePath?: string | undefined;
|
|
2959
2995
|
siteInclude?: string[] | undefined;
|
|
2960
2996
|
siteExclude?: string[] | undefined;
|
|
2961
2997
|
}, {
|
|
2962
2998
|
kvNamespaces?: string[] | Record<string, string> | undefined;
|
|
2963
|
-
assetsPath?: string | undefined;
|
|
2964
|
-
assetsKVBindingName?: string | undefined;
|
|
2965
|
-
assetsManifestBindingName?: string | undefined;
|
|
2966
2999
|
sitePath?: string | undefined;
|
|
2967
3000
|
siteInclude?: string[] | undefined;
|
|
2968
3001
|
siteExclude?: string[] | undefined;
|
|
@@ -3086,6 +3119,52 @@ export declare const PLUGINS: {
|
|
|
3086
3119
|
};
|
|
3087
3120
|
}> | undefined;
|
|
3088
3121
|
}>>;
|
|
3122
|
+
assets: Plugin<z.ZodObject<{
|
|
3123
|
+
assets: z.ZodOptional<z.ZodObject<{
|
|
3124
|
+
workerName: z.ZodOptional<z.ZodString>;
|
|
3125
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
3126
|
+
bindingName: z.ZodOptional<z.ZodString>;
|
|
3127
|
+
routingConfig: z.ZodObject<{
|
|
3128
|
+
hasUserWorker: z.ZodBoolean;
|
|
3129
|
+
}, "strip", z.ZodTypeAny, {
|
|
3130
|
+
hasUserWorker: boolean;
|
|
3131
|
+
}, {
|
|
3132
|
+
hasUserWorker: boolean;
|
|
3133
|
+
}>;
|
|
3134
|
+
}, "strip", z.ZodTypeAny, {
|
|
3135
|
+
path: string;
|
|
3136
|
+
routingConfig: {
|
|
3137
|
+
hasUserWorker: boolean;
|
|
3138
|
+
};
|
|
3139
|
+
workerName?: string | undefined;
|
|
3140
|
+
bindingName?: string | undefined;
|
|
3141
|
+
}, {
|
|
3142
|
+
path: string;
|
|
3143
|
+
routingConfig: {
|
|
3144
|
+
hasUserWorker: boolean;
|
|
3145
|
+
};
|
|
3146
|
+
workerName?: string | undefined;
|
|
3147
|
+
bindingName?: string | undefined;
|
|
3148
|
+
}>>;
|
|
3149
|
+
}, "strip", z.ZodTypeAny, {
|
|
3150
|
+
assets?: {
|
|
3151
|
+
path: string;
|
|
3152
|
+
routingConfig: {
|
|
3153
|
+
hasUserWorker: boolean;
|
|
3154
|
+
};
|
|
3155
|
+
workerName?: string | undefined;
|
|
3156
|
+
bindingName?: string | undefined;
|
|
3157
|
+
} | undefined;
|
|
3158
|
+
}, {
|
|
3159
|
+
assets?: {
|
|
3160
|
+
path: string;
|
|
3161
|
+
routingConfig: {
|
|
3162
|
+
hasUserWorker: boolean;
|
|
3163
|
+
};
|
|
3164
|
+
workerName?: string | undefined;
|
|
3165
|
+
bindingName?: string | undefined;
|
|
3166
|
+
} | undefined;
|
|
3167
|
+
}>>;
|
|
3089
3168
|
};
|
|
3090
3169
|
|
|
3091
3170
|
export declare type Plugins = typeof PLUGINS;
|
|
@@ -3558,6 +3637,14 @@ export declare class RouterError extends MiniflareError<RouterErrorCode> {
|
|
|
3558
3637
|
|
|
3559
3638
|
export declare type RouterErrorCode = "ERR_QUERY_STRING" | "ERR_INFIX_WILDCARD";
|
|
3560
3639
|
|
|
3640
|
+
export declare const RoutingConfigSchema: z.ZodObject<{
|
|
3641
|
+
hasUserWorker: z.ZodBoolean;
|
|
3642
|
+
}, "strip", z.ZodTypeAny, {
|
|
3643
|
+
hasUserWorker: boolean;
|
|
3644
|
+
}, {
|
|
3645
|
+
hasUserWorker: boolean;
|
|
3646
|
+
}>;
|
|
3647
|
+
|
|
3561
3648
|
export declare class Runtime {
|
|
3562
3649
|
#private;
|
|
3563
3650
|
updateConfig(configBuffer: Buffer, options: Abortable & RuntimeOptions): Promise<SocketPorts | undefined>;
|
|
@@ -4076,7 +4163,7 @@ export declare type Worker_Module = {
|
|
|
4076
4163
|
pythonRequirement?: string;
|
|
4077
4164
|
});
|
|
4078
4165
|
|
|
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>;
|
|
4166
|
+
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
4167
|
|
|
4081
4168
|
export declare interface WorkerRoute {
|
|
4082
4169
|
target: string;
|