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