@powerlines/plugin-cloudflare 0.2.28 → 0.2.30
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 +1 -1
- package/dist/components/cloudflare-builtin.cjs +846 -792
- package/dist/components/cloudflare-builtin.mjs +846 -792
- package/dist/components/cloudflare-builtin.mjs.map +1 -1
- package/dist/components/env-builtin.cjs +14 -10
- package/dist/components/env-builtin.mjs +14 -10
- package/dist/components/env-builtin.mjs.map +1 -1
- package/dist/components/worker-entry.cjs +142 -118
- package/dist/components/worker-entry.mjs +142 -118
- package/dist/components/worker-entry.mjs.map +1 -1
- package/dist/index.cjs +8 -5
- package/dist/index.mjs +8 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
4
|
let _alloy_js_core = require("@alloy-js/core");
|
|
4
5
|
let defu = require("defu");
|
|
5
6
|
defu = require_runtime.__toESM(defu);
|
|
6
7
|
let _powerlines_plugin_alloy_core_components = require("@powerlines/plugin-alloy/core/components");
|
|
7
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
8
8
|
let _powerlines_plugin_alloy_core_contexts = require("@powerlines/plugin-alloy/core/contexts");
|
|
9
9
|
let _powerlines_plugin_alloy_typescript_components_entry_file = require("@powerlines/plugin-alloy/typescript/components/entry-file");
|
|
10
10
|
let _stryke_hash = require("@stryke/hash");
|
|
@@ -24,155 +24,179 @@ function WorkerEntry(props) {
|
|
|
24
24
|
]);
|
|
25
25
|
const context = (0, _powerlines_plugin_alloy_core_contexts.usePowerlines)();
|
|
26
26
|
const entryPath = (0, _alloy_js_core.computed)(() => `./${(0, _stryke_path_replace.replaceExtension)((0, _stryke_path_find.relativePath)(context.entryPath, worker.entry.input?.file || worker.entry.file))}`);
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
imports
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
27
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_entry_file.EntryFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({ get path() {
|
|
28
|
+
return `worker-${(0, _stryke_hash.murmurhash)(worker.entry, { maxLength: 8 })}-entry.ts`;
|
|
29
|
+
} }, rest, {
|
|
30
|
+
get imports() {
|
|
31
|
+
return (0, defu.default)({
|
|
32
|
+
"@cloudflare/workers-types": [
|
|
33
|
+
{
|
|
34
|
+
name: "Request",
|
|
35
|
+
type: true
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "Response",
|
|
39
|
+
type: true
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "ExecutionContext",
|
|
43
|
+
type: true
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "IncomingRequestCfProperties",
|
|
47
|
+
type: true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "ScheduledController",
|
|
51
|
+
type: true
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "ForwardableEmailMessage",
|
|
55
|
+
type: true
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "MessageBatch",
|
|
59
|
+
type: true
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "TailStream",
|
|
63
|
+
type: true
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "TraceItem",
|
|
67
|
+
type: true
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "TailStream.TailEvent",
|
|
71
|
+
type: true
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "TailStream.Onset",
|
|
75
|
+
type: true
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "TailStream.TailEventHandlerType",
|
|
79
|
+
type: true
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
[entryPath.value]: "worker"
|
|
83
|
+
}, imports ?? {});
|
|
84
|
+
},
|
|
85
|
+
get builtinImports() {
|
|
86
|
+
return (0, defu.default)({ cloudflare: [
|
|
87
|
+
"withFetchContext",
|
|
88
|
+
"withTailContext",
|
|
89
|
+
"withTraceContext",
|
|
90
|
+
"withTailStreamContext",
|
|
91
|
+
"withScheduledContext",
|
|
92
|
+
"withTestContext",
|
|
93
|
+
"withEmailContext",
|
|
94
|
+
"withQueueContext"
|
|
95
|
+
] }, builtinImports ?? {});
|
|
96
|
+
},
|
|
97
|
+
get children() {
|
|
98
|
+
return [
|
|
99
|
+
_alloy_js_core.code`export default { `,
|
|
100
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
101
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
102
|
+
get when() {
|
|
103
|
+
return worker.fetch;
|
|
104
|
+
},
|
|
105
|
+
children: _alloy_js_core.code` async fetch(request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: CloudflareBindings, ctx: ExecutionContext): Promise<Response> {
|
|
99
106
|
return await withFetchContext({ request, env, ctx }, async (context) => {
|
|
100
107
|
return worker.fetch(context.request, context.env, context.ctx);
|
|
101
108
|
});
|
|
102
109
|
}, `
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
}),
|
|
111
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
112
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
113
|
+
get when() {
|
|
114
|
+
return worker.tail;
|
|
115
|
+
},
|
|
116
|
+
children: _alloy_js_core.code` async tail(events: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
|
|
108
117
|
return withTailContext({ events, env, ctx }, async (context) => {
|
|
109
118
|
return worker.tail(context.events, context.env, context.ctx);
|
|
110
119
|
});
|
|
111
120
|
}, `
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
121
|
+
}),
|
|
122
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
123
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
124
|
+
get when() {
|
|
125
|
+
return worker.trace;
|
|
126
|
+
},
|
|
127
|
+
children: _alloy_js_core.code` async trace(traces: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
|
|
117
128
|
return withTraceContext({ traces, env, ctx }, async (context) => {
|
|
118
129
|
return worker.trace(context.traces, context.env, context.ctx);
|
|
119
130
|
});
|
|
120
131
|
}, `
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
132
|
+
}),
|
|
133
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
134
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
135
|
+
get when() {
|
|
136
|
+
return worker.tailStream;
|
|
137
|
+
},
|
|
138
|
+
children: _alloy_js_core.code` async tailStream(event: TailStream.TailEvent<TailStream.Onset>, env: CloudflareBindings, ctx: ExecutionContext): Promise<ReadableStream> {
|
|
126
139
|
return await withTailStreamContext({ event, env, ctx }, async (context) => {
|
|
127
140
|
return await worker.tailStream(context.event, context.env, context.ctx);
|
|
128
141
|
});
|
|
129
142
|
}, `
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
143
|
+
}),
|
|
144
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
145
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
146
|
+
get when() {
|
|
147
|
+
return worker.scheduled;
|
|
148
|
+
},
|
|
149
|
+
children: _alloy_js_core.code` async scheduled(controller: ScheduledController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
|
|
135
150
|
return withScheduledContext({ controller, env, ctx }, async (context) => {
|
|
136
151
|
return worker.scheduled(context.controller, context.env, context.ctx);
|
|
137
152
|
});
|
|
138
153
|
}, `
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
154
|
+
}),
|
|
155
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
156
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
157
|
+
get when() {
|
|
158
|
+
return worker.test;
|
|
159
|
+
},
|
|
160
|
+
children: _alloy_js_core.code` async test(controller: TestController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
|
|
144
161
|
return withTestContext({ controller, env, ctx }, async (context) => {
|
|
145
162
|
return worker.test(context.controller, context.env, context.ctx);
|
|
146
163
|
});
|
|
147
164
|
}, `
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
165
|
+
}),
|
|
166
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
167
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
168
|
+
get when() {
|
|
169
|
+
return worker.email;
|
|
170
|
+
},
|
|
171
|
+
children: _alloy_js_core.code` async email(message: ForwardableEmailMessage, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
|
|
153
172
|
return withEmailContext({ message, env, ctx }, async (context) => {
|
|
154
173
|
return worker.email(context.message, context.env, context.ctx);
|
|
155
174
|
});
|
|
156
175
|
}, `
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
176
|
+
}),
|
|
177
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
178
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
179
|
+
get when() {
|
|
180
|
+
return worker.queue;
|
|
181
|
+
},
|
|
182
|
+
children: _alloy_js_core.code` async queue(batch: MessageBatch, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
|
|
162
183
|
return withQueueContext({ batch, env, ctx }, async (context) => {
|
|
163
184
|
return worker.queue(context.batch, context.env, context.ctx);
|
|
164
185
|
});
|
|
165
186
|
}, `
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
187
|
+
}),
|
|
188
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
189
|
+
_alloy_js_core.code` } satisfies ExportedHandler<CloudflareBindings>; `,
|
|
190
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
|
|
191
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
192
|
+
get when() {
|
|
193
|
+
return Boolean(children);
|
|
194
|
+
},
|
|
195
|
+
children
|
|
196
|
+
})
|
|
197
|
+
];
|
|
198
|
+
}
|
|
199
|
+
}));
|
|
176
200
|
}
|
|
177
201
|
|
|
178
202
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
1
2
|
import { Show, code, computed, splitProps } from "@alloy-js/core";
|
|
2
3
|
import defu from "defu";
|
|
3
4
|
import { Spacing } from "@powerlines/plugin-alloy/core/components";
|
|
4
|
-
import { jsx, jsxs } from "@alloy-js/core/jsx-runtime";
|
|
5
5
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts";
|
|
6
6
|
import { EntryFile } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
7
7
|
import { murmurhash } from "@stryke/hash";
|
|
@@ -21,155 +21,179 @@ function WorkerEntry(props) {
|
|
|
21
21
|
]);
|
|
22
22
|
const context = usePowerlines();
|
|
23
23
|
const entryPath = computed(() => `./${replaceExtension(relativePath(context.entryPath, worker.entry.input?.file || worker.entry.file))}`);
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
imports
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
24
|
+
return createComponent(EntryFile, mergeProps({ get path() {
|
|
25
|
+
return `worker-${murmurhash(worker.entry, { maxLength: 8 })}-entry.ts`;
|
|
26
|
+
} }, rest, {
|
|
27
|
+
get imports() {
|
|
28
|
+
return defu({
|
|
29
|
+
"@cloudflare/workers-types": [
|
|
30
|
+
{
|
|
31
|
+
name: "Request",
|
|
32
|
+
type: true
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "Response",
|
|
36
|
+
type: true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "ExecutionContext",
|
|
40
|
+
type: true
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "IncomingRequestCfProperties",
|
|
44
|
+
type: true
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "ScheduledController",
|
|
48
|
+
type: true
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "ForwardableEmailMessage",
|
|
52
|
+
type: true
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "MessageBatch",
|
|
56
|
+
type: true
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "TailStream",
|
|
60
|
+
type: true
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "TraceItem",
|
|
64
|
+
type: true
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "TailStream.TailEvent",
|
|
68
|
+
type: true
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "TailStream.Onset",
|
|
72
|
+
type: true
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "TailStream.TailEventHandlerType",
|
|
76
|
+
type: true
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
[entryPath.value]: "worker"
|
|
80
|
+
}, imports ?? {});
|
|
81
|
+
},
|
|
82
|
+
get builtinImports() {
|
|
83
|
+
return defu({ cloudflare: [
|
|
84
|
+
"withFetchContext",
|
|
85
|
+
"withTailContext",
|
|
86
|
+
"withTraceContext",
|
|
87
|
+
"withTailStreamContext",
|
|
88
|
+
"withScheduledContext",
|
|
89
|
+
"withTestContext",
|
|
90
|
+
"withEmailContext",
|
|
91
|
+
"withQueueContext"
|
|
92
|
+
] }, builtinImports ?? {});
|
|
93
|
+
},
|
|
94
|
+
get children() {
|
|
95
|
+
return [
|
|
96
|
+
code`export default { `,
|
|
97
|
+
createIntrinsic("hbr", {}),
|
|
98
|
+
createComponent(Show, {
|
|
99
|
+
get when() {
|
|
100
|
+
return worker.fetch;
|
|
101
|
+
},
|
|
102
|
+
children: code` async fetch(request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: CloudflareBindings, ctx: ExecutionContext): Promise<Response> {
|
|
96
103
|
return await withFetchContext({ request, env, ctx }, async (context) => {
|
|
97
104
|
return worker.fetch(context.request, context.env, context.ctx);
|
|
98
105
|
});
|
|
99
106
|
}, `
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
}),
|
|
108
|
+
createIntrinsic("hbr", {}),
|
|
109
|
+
createComponent(Show, {
|
|
110
|
+
get when() {
|
|
111
|
+
return worker.tail;
|
|
112
|
+
},
|
|
113
|
+
children: code` async tail(events: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
|
|
105
114
|
return withTailContext({ events, env, ctx }, async (context) => {
|
|
106
115
|
return worker.tail(context.events, context.env, context.ctx);
|
|
107
116
|
});
|
|
108
117
|
}, `
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
118
|
+
}),
|
|
119
|
+
createIntrinsic("hbr", {}),
|
|
120
|
+
createComponent(Show, {
|
|
121
|
+
get when() {
|
|
122
|
+
return worker.trace;
|
|
123
|
+
},
|
|
124
|
+
children: code` async trace(traces: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
|
|
114
125
|
return withTraceContext({ traces, env, ctx }, async (context) => {
|
|
115
126
|
return worker.trace(context.traces, context.env, context.ctx);
|
|
116
127
|
});
|
|
117
128
|
}, `
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
129
|
+
}),
|
|
130
|
+
createIntrinsic("hbr", {}),
|
|
131
|
+
createComponent(Show, {
|
|
132
|
+
get when() {
|
|
133
|
+
return worker.tailStream;
|
|
134
|
+
},
|
|
135
|
+
children: code` async tailStream(event: TailStream.TailEvent<TailStream.Onset>, env: CloudflareBindings, ctx: ExecutionContext): Promise<ReadableStream> {
|
|
123
136
|
return await withTailStreamContext({ event, env, ctx }, async (context) => {
|
|
124
137
|
return await worker.tailStream(context.event, context.env, context.ctx);
|
|
125
138
|
});
|
|
126
139
|
}, `
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
140
|
+
}),
|
|
141
|
+
createIntrinsic("hbr", {}),
|
|
142
|
+
createComponent(Show, {
|
|
143
|
+
get when() {
|
|
144
|
+
return worker.scheduled;
|
|
145
|
+
},
|
|
146
|
+
children: code` async scheduled(controller: ScheduledController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
|
|
132
147
|
return withScheduledContext({ controller, env, ctx }, async (context) => {
|
|
133
148
|
return worker.scheduled(context.controller, context.env, context.ctx);
|
|
134
149
|
});
|
|
135
150
|
}, `
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
151
|
+
}),
|
|
152
|
+
createIntrinsic("hbr", {}),
|
|
153
|
+
createComponent(Show, {
|
|
154
|
+
get when() {
|
|
155
|
+
return worker.test;
|
|
156
|
+
},
|
|
157
|
+
children: code` async test(controller: TestController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
|
|
141
158
|
return withTestContext({ controller, env, ctx }, async (context) => {
|
|
142
159
|
return worker.test(context.controller, context.env, context.ctx);
|
|
143
160
|
});
|
|
144
161
|
}, `
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
162
|
+
}),
|
|
163
|
+
createIntrinsic("hbr", {}),
|
|
164
|
+
createComponent(Show, {
|
|
165
|
+
get when() {
|
|
166
|
+
return worker.email;
|
|
167
|
+
},
|
|
168
|
+
children: code` async email(message: ForwardableEmailMessage, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
|
|
150
169
|
return withEmailContext({ message, env, ctx }, async (context) => {
|
|
151
170
|
return worker.email(context.message, context.env, context.ctx);
|
|
152
171
|
});
|
|
153
172
|
}, `
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
173
|
+
}),
|
|
174
|
+
createIntrinsic("hbr", {}),
|
|
175
|
+
createComponent(Show, {
|
|
176
|
+
get when() {
|
|
177
|
+
return worker.queue;
|
|
178
|
+
},
|
|
179
|
+
children: code` async queue(batch: MessageBatch, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
|
|
159
180
|
return withQueueContext({ batch, env, ctx }, async (context) => {
|
|
160
181
|
return worker.queue(context.batch, context.env, context.ctx);
|
|
161
182
|
});
|
|
162
183
|
}, `
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
184
|
+
}),
|
|
185
|
+
createIntrinsic("hbr", {}),
|
|
186
|
+
code` } satisfies ExportedHandler<CloudflareBindings>; `,
|
|
187
|
+
createComponent(Spacing, {}),
|
|
188
|
+
createComponent(Show, {
|
|
189
|
+
get when() {
|
|
190
|
+
return Boolean(children);
|
|
191
|
+
},
|
|
192
|
+
children
|
|
193
|
+
})
|
|
194
|
+
];
|
|
195
|
+
}
|
|
196
|
+
}));
|
|
173
197
|
}
|
|
174
198
|
|
|
175
199
|
//#endregion
|