miniflare 0.0.0-ee305dd67 → 0.0.0-ee3ef6414
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 +28 -0
- package/dist/src/index.js +15 -10
- package/dist/src/index.js.map +1 -1
- package/dist/src/workers/assets/assets.worker.js +9 -6
- package/dist/src/workers/assets/assets.worker.js.map +1 -1
- package/dist/src/workers/assets/router.worker.js +13 -4
- package/dist/src/workers/assets/router.worker.js.map +1 -1
- package/dist/src/workers/queues/broker.worker.js +1 -1
- package/dist/src/workers/workflows/binding.worker.js +70 -28
- package/dist/src/workers/workflows/binding.worker.js.map +1 -1
- package/package.json +5 -5
package/dist/src/index.d.ts
CHANGED
|
@@ -74,20 +74,26 @@ export declare const AssetsOptionsSchema: z.ZodObject<{
|
|
|
74
74
|
binding: z.ZodOptional<z.ZodString>;
|
|
75
75
|
routingConfig: z.ZodOptional<z.ZodObject<{
|
|
76
76
|
has_user_worker: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
invoke_user_worker_ahead_of_assets: z.ZodOptional<z.ZodBoolean>;
|
|
77
78
|
}, "strip", z.ZodTypeAny, {
|
|
78
79
|
has_user_worker?: boolean;
|
|
80
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
79
81
|
}, {
|
|
80
82
|
has_user_worker?: boolean;
|
|
83
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
81
84
|
}>>;
|
|
82
85
|
assetConfig: z.ZodOptional<z.ZodObject<{
|
|
83
86
|
html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>;
|
|
84
87
|
not_found_handling: z.ZodOptional<z.ZodEnum<["single-page-application", "404-page", "none"]>>;
|
|
88
|
+
serve_directly: z.ZodOptional<z.ZodBoolean>;
|
|
85
89
|
}, "strip", z.ZodTypeAny, {
|
|
86
90
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
87
91
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
92
|
+
serve_directly?: boolean;
|
|
88
93
|
}, {
|
|
89
94
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
90
95
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
96
|
+
serve_directly?: boolean;
|
|
91
97
|
}>>;
|
|
92
98
|
}, "strip", z.ZodTypeAny, {
|
|
93
99
|
directory: string;
|
|
@@ -95,10 +101,12 @@ export declare const AssetsOptionsSchema: z.ZodObject<{
|
|
|
95
101
|
binding?: string | undefined;
|
|
96
102
|
routingConfig?: {
|
|
97
103
|
has_user_worker?: boolean;
|
|
104
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
98
105
|
} | undefined;
|
|
99
106
|
assetConfig?: {
|
|
100
107
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
101
108
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
109
|
+
serve_directly?: boolean;
|
|
102
110
|
} | undefined;
|
|
103
111
|
}, {
|
|
104
112
|
directory: string;
|
|
@@ -106,10 +114,12 @@ export declare const AssetsOptionsSchema: z.ZodObject<{
|
|
|
106
114
|
binding?: string | undefined;
|
|
107
115
|
routingConfig?: {
|
|
108
116
|
has_user_worker?: boolean;
|
|
117
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
109
118
|
} | undefined;
|
|
110
119
|
assetConfig?: {
|
|
111
120
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
112
121
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
122
|
+
serve_directly?: boolean;
|
|
113
123
|
} | undefined;
|
|
114
124
|
}>>;
|
|
115
125
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -119,10 +129,12 @@ export declare const AssetsOptionsSchema: z.ZodObject<{
|
|
|
119
129
|
binding?: string | undefined;
|
|
120
130
|
routingConfig?: {
|
|
121
131
|
has_user_worker?: boolean;
|
|
132
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
122
133
|
} | undefined;
|
|
123
134
|
assetConfig?: {
|
|
124
135
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
125
136
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
137
|
+
serve_directly?: boolean;
|
|
126
138
|
} | undefined;
|
|
127
139
|
} | undefined;
|
|
128
140
|
}, {
|
|
@@ -132,10 +144,12 @@ export declare const AssetsOptionsSchema: z.ZodObject<{
|
|
|
132
144
|
binding?: string | undefined;
|
|
133
145
|
routingConfig?: {
|
|
134
146
|
has_user_worker?: boolean;
|
|
147
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
135
148
|
} | undefined;
|
|
136
149
|
assetConfig?: {
|
|
137
150
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
138
151
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
152
|
+
serve_directly?: boolean;
|
|
139
153
|
} | undefined;
|
|
140
154
|
} | undefined;
|
|
141
155
|
}>;
|
|
@@ -3259,20 +3273,26 @@ export declare const PLUGINS: {
|
|
|
3259
3273
|
binding: z.ZodOptional<z.ZodString>;
|
|
3260
3274
|
routingConfig: z.ZodOptional<z.ZodObject<{
|
|
3261
3275
|
has_user_worker: z.ZodOptional<z.ZodBoolean>;
|
|
3276
|
+
invoke_user_worker_ahead_of_assets: z.ZodOptional<z.ZodBoolean>;
|
|
3262
3277
|
}, "strip", z.ZodTypeAny, {
|
|
3263
3278
|
has_user_worker?: boolean;
|
|
3279
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
3264
3280
|
}, {
|
|
3265
3281
|
has_user_worker?: boolean;
|
|
3282
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
3266
3283
|
}>>;
|
|
3267
3284
|
assetConfig: z.ZodOptional<z.ZodObject<{
|
|
3268
3285
|
html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>;
|
|
3269
3286
|
not_found_handling: z.ZodOptional<z.ZodEnum<["single-page-application", "404-page", "none"]>>;
|
|
3287
|
+
serve_directly: z.ZodOptional<z.ZodBoolean>;
|
|
3270
3288
|
}, "strip", z.ZodTypeAny, {
|
|
3271
3289
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
3272
3290
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
3291
|
+
serve_directly?: boolean;
|
|
3273
3292
|
}, {
|
|
3274
3293
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
3275
3294
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
3295
|
+
serve_directly?: boolean;
|
|
3276
3296
|
}>>;
|
|
3277
3297
|
}, "strip", z.ZodTypeAny, {
|
|
3278
3298
|
directory: string;
|
|
@@ -3280,10 +3300,12 @@ export declare const PLUGINS: {
|
|
|
3280
3300
|
binding?: string | undefined;
|
|
3281
3301
|
routingConfig?: {
|
|
3282
3302
|
has_user_worker?: boolean;
|
|
3303
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
3283
3304
|
} | undefined;
|
|
3284
3305
|
assetConfig?: {
|
|
3285
3306
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
3286
3307
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
3308
|
+
serve_directly?: boolean;
|
|
3287
3309
|
} | undefined;
|
|
3288
3310
|
}, {
|
|
3289
3311
|
directory: string;
|
|
@@ -3291,10 +3313,12 @@ export declare const PLUGINS: {
|
|
|
3291
3313
|
binding?: string | undefined;
|
|
3292
3314
|
routingConfig?: {
|
|
3293
3315
|
has_user_worker?: boolean;
|
|
3316
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
3294
3317
|
} | undefined;
|
|
3295
3318
|
assetConfig?: {
|
|
3296
3319
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
3297
3320
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
3321
|
+
serve_directly?: boolean;
|
|
3298
3322
|
} | undefined;
|
|
3299
3323
|
}>>;
|
|
3300
3324
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -3304,10 +3328,12 @@ export declare const PLUGINS: {
|
|
|
3304
3328
|
binding?: string | undefined;
|
|
3305
3329
|
routingConfig?: {
|
|
3306
3330
|
has_user_worker?: boolean;
|
|
3331
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
3307
3332
|
} | undefined;
|
|
3308
3333
|
assetConfig?: {
|
|
3309
3334
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
3310
3335
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
3336
|
+
serve_directly?: boolean;
|
|
3311
3337
|
} | undefined;
|
|
3312
3338
|
} | undefined;
|
|
3313
3339
|
}, {
|
|
@@ -3317,10 +3343,12 @@ export declare const PLUGINS: {
|
|
|
3317
3343
|
binding?: string | undefined;
|
|
3318
3344
|
routingConfig?: {
|
|
3319
3345
|
has_user_worker?: boolean;
|
|
3346
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
3320
3347
|
} | undefined;
|
|
3321
3348
|
assetConfig?: {
|
|
3322
3349
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
3323
3350
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
3351
|
+
serve_directly?: boolean;
|
|
3324
3352
|
} | undefined;
|
|
3325
3353
|
} | undefined;
|
|
3326
3354
|
}>>;
|
package/dist/src/index.js
CHANGED
|
@@ -3788,7 +3788,7 @@ var QueueConsumerOptionsSchema = /* @__PURE__ */ import_zod2.z.object({
|
|
|
3788
3788
|
// https://developers.cloudflare.com/queues/platform/configuration/#consumer
|
|
3789
3789
|
// https://developers.cloudflare.com/queues/platform/limits/
|
|
3790
3790
|
maxBatchSize: import_zod2.z.number().min(0).max(100).optional(),
|
|
3791
|
-
maxBatchTimeout: import_zod2.z.number().min(0).max(
|
|
3791
|
+
maxBatchTimeout: import_zod2.z.number().min(0).max(60).optional(),
|
|
3792
3792
|
// seconds
|
|
3793
3793
|
maxRetires: import_zod2.z.number().min(0).max(100).optional(),
|
|
3794
3794
|
// deprecated
|
|
@@ -4616,7 +4616,8 @@ var MAX_ASSET_SIZE = 25 * 1024 * 1024;
|
|
|
4616
4616
|
// ../workers-shared/utils/types.ts
|
|
4617
4617
|
var import_zod4 = require("zod");
|
|
4618
4618
|
var RoutingConfigSchema = import_zod4.z.object({
|
|
4619
|
-
has_user_worker: import_zod4.z.boolean().optional()
|
|
4619
|
+
has_user_worker: import_zod4.z.boolean().optional(),
|
|
4620
|
+
invoke_user_worker_ahead_of_assets: import_zod4.z.boolean().optional()
|
|
4620
4621
|
});
|
|
4621
4622
|
var AssetConfigSchema = import_zod4.z.object({
|
|
4622
4623
|
html_handling: import_zod4.z.enum([
|
|
@@ -4625,7 +4626,8 @@ var AssetConfigSchema = import_zod4.z.object({
|
|
|
4625
4626
|
"drop-trailing-slash",
|
|
4626
4627
|
"none"
|
|
4627
4628
|
]).optional(),
|
|
4628
|
-
not_found_handling: import_zod4.z.enum(["single-page-application", "404-page", "none"]).optional()
|
|
4629
|
+
not_found_handling: import_zod4.z.enum(["single-page-application", "404-page", "none"]).optional(),
|
|
4630
|
+
serve_directly: import_zod4.z.boolean().optional()
|
|
4629
4631
|
});
|
|
4630
4632
|
|
|
4631
4633
|
// ../workers-shared/utils/helpers.ts
|
|
@@ -8666,13 +8668,15 @@ var WORKFLOWS_PLUGIN = {
|
|
|
8666
8668
|
sharedOptions.workflowsPersist
|
|
8667
8669
|
);
|
|
8668
8670
|
await import_promises12.default.mkdir(persistPath, { recursive: true });
|
|
8669
|
-
const
|
|
8670
|
-
|
|
8671
|
+
const storageServices = Object.entries(
|
|
8672
|
+
options.workflows ?? {}
|
|
8673
|
+
).map(([_, workflow]) => ({
|
|
8674
|
+
name: `${WORKFLOWS_STORAGE_SERVICE_NAME}-${workflow.name}`,
|
|
8671
8675
|
disk: { path: persistPath, writable: true }
|
|
8672
|
-
};
|
|
8676
|
+
}));
|
|
8673
8677
|
const services = Object.entries(options.workflows ?? {}).map(
|
|
8674
8678
|
([_bindingName, workflow]) => {
|
|
8675
|
-
const uniqueKey = `miniflare-workflows`;
|
|
8679
|
+
const uniqueKey = `miniflare-workflows-${workflow.name}`;
|
|
8676
8680
|
const workflowsBinding = {
|
|
8677
8681
|
name: `${WORKFLOWS_PLUGIN_NAME}:${workflow.name}`,
|
|
8678
8682
|
worker: {
|
|
@@ -8691,8 +8695,9 @@ var WORKFLOWS_PLUGIN = {
|
|
|
8691
8695
|
preventEviction: true
|
|
8692
8696
|
}
|
|
8693
8697
|
],
|
|
8694
|
-
|
|
8695
|
-
|
|
8698
|
+
durableObjectStorage: {
|
|
8699
|
+
localDisk: `${WORKFLOWS_STORAGE_SERVICE_NAME}-${workflow.name}`
|
|
8700
|
+
},
|
|
8696
8701
|
bindings: [
|
|
8697
8702
|
{
|
|
8698
8703
|
name: "ENGINE",
|
|
@@ -8714,7 +8719,7 @@ var WORKFLOWS_PLUGIN = {
|
|
|
8714
8719
|
if (services.length === 0) {
|
|
8715
8720
|
return [];
|
|
8716
8721
|
}
|
|
8717
|
-
return [
|
|
8722
|
+
return [...storageServices, ...services];
|
|
8718
8723
|
},
|
|
8719
8724
|
getPersistPath({ workflowsPersist }, tmpPath) {
|
|
8720
8725
|
return getPersistPath(WORKFLOWS_PLUGIN_NAME, tmpPath, workflowsPersist);
|