@velajs/cloudflare 1.31.0 → 1.33.0
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/CHANGELOG.md +85 -0
- package/README.md +154 -10
- package/dist/bindings.js +17 -1
- package/dist/bindings.js.map +1 -1
- package/dist/{cloudflare-factory-eGiet0mg.d.ts → cloudflare-application-CXDy9C1R.d.ts} +9 -98
- package/dist/cloudflare-application.js +8 -0
- package/dist/cloudflare-application.js.map +1 -1
- package/dist/cloudflare-factory-CuFNUJJD.d.ts +241 -0
- package/dist/cloudflare-factory.js +153 -20
- package/dist/cloudflare-factory.js.map +1 -1
- package/dist/durable-object/boot.js +76 -0
- package/dist/durable-object/boot.js.map +1 -0
- package/dist/durable-object/host-dispatch.js +134 -0
- package/dist/durable-object/host-dispatch.js.map +1 -0
- package/dist/durable-object/host-methods.js +47 -0
- package/dist/durable-object/host-methods.js.map +1 -0
- package/dist/durable-object/tokens.js +17 -0
- package/dist/durable-object/tokens.js.map +1 -0
- package/dist/durable-object/vela-durable-object.js +121 -0
- package/dist/durable-object/vela-durable-object.js.map +1 -0
- package/dist/durable-objects.d.ts +131 -9
- package/dist/durable-objects.js +3 -1
- package/dist/email/email-dispatch.js +65 -0
- package/dist/email/email-dispatch.js.map +1 -0
- package/dist/email/on-email.js +57 -0
- package/dist/email/on-email.js.map +1 -0
- package/dist/email.d.ts +51 -0
- package/dist/email.js +3 -0
- package/dist/entrypoint/vela-entrypoint.js +160 -0
- package/dist/entrypoint/vela-entrypoint.js.map +1 -0
- package/dist/entrypoints.d.ts +93 -0
- package/dist/entrypoints.js +2 -0
- package/dist/host/host-invoker.js +276 -0
- package/dist/host/host-invoker.js.map +1 -0
- package/dist/host/host-members.js +73 -0
- package/dist/host/host-members.js.map +1 -0
- package/dist/host-members-DECj_4yz.d.ts +13 -0
- package/dist/index.d.ts +74 -13
- package/dist/index.js +4 -3
- package/dist/root-module.js +19 -0
- package/dist/root-module.js.map +1 -0
- package/dist/rpc/entrypoint-error.js +145 -0
- package/dist/rpc/entrypoint-error.js.map +1 -0
- package/dist/services/kv-cache.store.js +4 -4
- package/dist/services/kv-cache.store.js.map +1 -1
- package/dist/tail/on-tail.js +46 -0
- package/dist/tail/on-tail.js.map +1 -0
- package/dist/tail/tail-dispatch.js +67 -0
- package/dist/tail/tail-dispatch.js.map +1 -0
- package/dist/tail.d.ts +39 -0
- package/dist/tail.js +2 -0
- package/dist/testing.d.ts +55 -3
- package/dist/testing.js +78 -1
- package/dist/testing.js.map +1 -1
- package/dist/websocket/binding-gateways.js +1 -1
- package/dist/websocket/binding-gateways.js.map +1 -1
- package/dist/websocket/do-bootstrap.js +40 -37
- package/dist/websocket/do-bootstrap.js.map +1 -1
- package/dist/websocket/websocket.durable-object.js +37 -8
- package/dist/websocket/websocket.durable-object.js.map +1 -1
- package/dist/worker-events.js +49 -0
- package/dist/worker-events.js.map +1 -0
- package/dist/workflow/vela-workflow.js +104 -0
- package/dist/workflow/vela-workflow.js.map +1 -0
- package/dist/workflows.d.ts +82 -0
- package/dist/workflows.js +2 -0
- package/package.json +23 -7
- package/dist/root-module-C23bUwt_.d.ts +0 -11
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { registerWorkerEvent } from "../worker-events.js";
|
|
2
|
+
import { EMAIL_METADATA, dispatchEmail } from "./email-dispatch.js";
|
|
3
|
+
import { MetadataRegistry, registerEntrypointKind } from "@velajs/vela/module-kit";
|
|
4
|
+
//#region src/email/on-email.ts
|
|
5
|
+
registerEntrypointKind({
|
|
6
|
+
kind: "cf:email",
|
|
7
|
+
metaKey: EMAIL_METADATA,
|
|
8
|
+
level: "method"
|
|
9
|
+
});
|
|
10
|
+
registerWorkerEvent("email", async (application, message) => dispatchEmail(await application(), message));
|
|
11
|
+
function recipients(to) {
|
|
12
|
+
if (to === void 0) return void 0;
|
|
13
|
+
const list = typeof to === "string" ? [to] : to;
|
|
14
|
+
if (!Array.isArray(list) || list.length === 0) throw new TypeError("@OnEmail({ to }) takes an address or a non-empty list of addresses.");
|
|
15
|
+
return list.map((address) => {
|
|
16
|
+
if (typeof address !== "string" || address.trim() === "" || !address.includes("@")) throw new TypeError(`@OnEmail({ to }) takes email addresses, not ${String(address)}.`);
|
|
17
|
+
return address.trim().toLowerCase();
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Handle Email Workers messages (entrypoint kind `cf:email`). The method of an
|
|
22
|
+
* `@Injectable()` provider receives the native `ForwardableEmailMessage`,
|
|
23
|
+
* which it can read (`raw`, `headers`), `forward()`, `reply()` or
|
|
24
|
+
* `setReject()`:
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* @Injectable()
|
|
28
|
+
* export class SupportInbox {
|
|
29
|
+
* @OnEmail({ to: 'support@example.com' })
|
|
30
|
+
* async receive(message: ForwardableEmailMessage): Promise<void> {
|
|
31
|
+
* await message.forward('team@example.com');
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* Importing it gives the Worker (`app.worker`) its `email` handler. A message
|
|
37
|
+
* goes to the handlers whose `to` lists its envelope recipient, else to those
|
|
38
|
+
* without `to`; each runs in its own execution scope through its scoped
|
|
39
|
+
* guards, interceptors and filters. A message no handler accepts is rejected
|
|
40
|
+
* with a permanent SMTP error, never silently dropped. A failure is reported
|
|
41
|
+
* (`edge: 'email'`) and rethrown to the platform unless a scoped filter
|
|
42
|
+
* handles it.
|
|
43
|
+
*/
|
|
44
|
+
function OnEmail(options = {}) {
|
|
45
|
+
const to = recipients(options.to);
|
|
46
|
+
return (target, key) => {
|
|
47
|
+
if (typeof key !== "string") throw new TypeError("@OnEmail() decorates a string-named method.");
|
|
48
|
+
MetadataRegistry.appendCustomClassMeta(target.constructor, EMAIL_METADATA, to === void 0 ? { methodName: key } : {
|
|
49
|
+
methodName: key,
|
|
50
|
+
to
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { OnEmail };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=on-email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on-email.js","names":[],"sources":["../../src/email/on-email.ts"],"sourcesContent":["import { MetadataRegistry, registerEntrypointKind } from '@velajs/vela/module-kit';\nimport { registerWorkerEvent } from '../worker-events';\nimport { EMAIL_METADATA, dispatchEmail, type OnEmailMetadata } from './email-dispatch';\n\n// The entrypoint kind, declared next to its decorator; importing the decorator\n// also gives every Worker of the isolate its `email` handler.\nregisterEntrypointKind({ kind: 'cf:email', metaKey: EMAIL_METADATA, level: 'method' });\nregisterWorkerEvent('email', async (application, message) =>\n dispatchEmail(await application(), message),\n);\n\n/** Options of {@link OnEmail}. */\nexport interface OnEmailOptions {\n /**\n * The envelope recipients (`message.to`) this handler accepts, such as\n * `'support@example.com'`, compared without regard to case. Without it the\n * handler accepts the mail that no handler lists its recipient for.\n */\n readonly to?: string | readonly string[];\n}\n\n/** A method decorator whose method receives an Email Workers message. */\nexport type OnEmailDecorator = <Handler extends (message: ForwardableEmailMessage) => unknown>(\n target: object,\n key: string | symbol,\n descriptor: TypedPropertyDescriptor<Handler>,\n) => void;\n\nfunction recipients(to: OnEmailOptions['to']): string[] | undefined {\n if (to === undefined) return undefined;\n const list: readonly unknown[] = typeof to === 'string' ? [to] : to;\n if (!Array.isArray(list) || list.length === 0) {\n throw new TypeError('@OnEmail({ to }) takes an address or a non-empty list of addresses.');\n }\n return list.map((address) => {\n if (typeof address !== 'string' || address.trim() === '' || !address.includes('@')) {\n throw new TypeError(`@OnEmail({ to }) takes email addresses, not ${String(address)}.`);\n }\n return address.trim().toLowerCase();\n });\n}\n\n/**\n * Handle Email Workers messages (entrypoint kind `cf:email`). The method of an\n * `@Injectable()` provider receives the native `ForwardableEmailMessage`,\n * which it can read (`raw`, `headers`), `forward()`, `reply()` or\n * `setReject()`:\n *\n * ```ts\n * @Injectable()\n * export class SupportInbox {\n * @OnEmail({ to: 'support@example.com' })\n * async receive(message: ForwardableEmailMessage): Promise<void> {\n * await message.forward('team@example.com');\n * }\n * }\n * ```\n *\n * Importing it gives the Worker (`app.worker`) its `email` handler. A message\n * goes to the handlers whose `to` lists its envelope recipient, else to those\n * without `to`; each runs in its own execution scope through its scoped\n * guards, interceptors and filters. A message no handler accepts is rejected\n * with a permanent SMTP error, never silently dropped. A failure is reported\n * (`edge: 'email'`) and rethrown to the platform unless a scoped filter\n * handles it.\n */\nexport function OnEmail(options: OnEmailOptions = {}): OnEmailDecorator {\n const to = recipients(options.to);\n return (target, key) => {\n if (typeof key !== 'string') throw new TypeError('@OnEmail() decorates a string-named method.');\n MetadataRegistry.appendCustomClassMeta<OnEmailMetadata>(\n target.constructor,\n EMAIL_METADATA,\n to === undefined ? { methodName: key } : { methodName: key, to },\n );\n };\n}\n"],"mappings":";;;;AAMA,uBAAuB;CAAE,MAAM;CAAY,SAAS;CAAgB,OAAO;AAAS,CAAC;AACrF,oBAAoB,SAAS,OAAO,aAAa,YAC/C,cAAc,MAAM,YAAY,GAAG,OAAO,CAC5C;AAmBA,SAAS,WAAW,IAAgD;CAClE,IAAI,OAAO,KAAA,GAAW,OAAO,KAAA;CAC7B,MAAM,OAA2B,OAAO,OAAO,WAAW,CAAC,EAAE,IAAI;CACjE,IAAI,CAAC,MAAM,QAAQ,IAAI,KAAK,KAAK,WAAW,GAC1C,MAAM,IAAI,UAAU,qEAAqE;CAE3F,OAAO,KAAK,KAAK,YAAY;EAC3B,IAAI,OAAO,YAAY,YAAY,QAAQ,KAAK,MAAM,MAAM,CAAC,QAAQ,SAAS,GAAG,GAC/E,MAAM,IAAI,UAAU,+CAA+C,OAAO,OAAO,EAAE,EAAE;EAEvF,OAAO,QAAQ,KAAK,CAAC,CAAC,YAAY;CACpC,CAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,QAAQ,UAA0B,CAAC,GAAqB;CACtE,MAAM,KAAK,WAAW,QAAQ,EAAE;CAChC,QAAQ,QAAQ,QAAQ;EACtB,IAAI,OAAO,QAAQ,UAAU,MAAM,IAAI,UAAU,6CAA6C;EAC9F,iBAAiB,sBACf,OAAO,aACP,gBACA,OAAO,KAAA,IAAY,EAAE,YAAY,IAAI,IAAI;GAAE,YAAY;GAAK;EAAG,CACjE;CACF;AACF"}
|
package/dist/email.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import "./vela-env-DFvyoNT3.js";
|
|
2
|
+
import "./cloudflare-application-CXDy9C1R.js";
|
|
3
|
+
import { EntrypointExecutionContext } from "@velajs/vela/module-kit";
|
|
4
|
+
//#region src/email/on-email.d.ts
|
|
5
|
+
/** Options of {@link OnEmail}. */
|
|
6
|
+
interface OnEmailOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The envelope recipients (`message.to`) this handler accepts, such as
|
|
9
|
+
* `'support@example.com'`, compared without regard to case. Without it the
|
|
10
|
+
* handler accepts the mail that no handler lists its recipient for.
|
|
11
|
+
*/
|
|
12
|
+
readonly to?: string | readonly string[];
|
|
13
|
+
}
|
|
14
|
+
/** A method decorator whose method receives an Email Workers message. */
|
|
15
|
+
type OnEmailDecorator = <Handler extends (message: ForwardableEmailMessage) => unknown>(target: object, key: string | symbol, descriptor: TypedPropertyDescriptor<Handler>) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Handle Email Workers messages (entrypoint kind `cf:email`). The method of an
|
|
18
|
+
* `@Injectable()` provider receives the native `ForwardableEmailMessage`,
|
|
19
|
+
* which it can read (`raw`, `headers`), `forward()`, `reply()` or
|
|
20
|
+
* `setReject()`:
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* @Injectable()
|
|
24
|
+
* export class SupportInbox {
|
|
25
|
+
* @OnEmail({ to: 'support@example.com' })
|
|
26
|
+
* async receive(message: ForwardableEmailMessage): Promise<void> {
|
|
27
|
+
* await message.forward('team@example.com');
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* Importing it gives the Worker (`app.worker`) its `email` handler. A message
|
|
33
|
+
* goes to the handlers whose `to` lists its envelope recipient, else to those
|
|
34
|
+
* without `to`; each runs in its own execution scope through its scoped
|
|
35
|
+
* guards, interceptors and filters. A message no handler accepts is rejected
|
|
36
|
+
* with a permanent SMTP error, never silently dropped. A failure is reported
|
|
37
|
+
* (`edge: 'email'`) and rethrown to the platform unless a scoped filter
|
|
38
|
+
* handles it.
|
|
39
|
+
*/
|
|
40
|
+
export declare function OnEmail(options?: OnEmailOptions): OnEmailDecorator;
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/email/email-dispatch.d.ts
|
|
43
|
+
/** The ExecutionContext guards, interceptors and filters receive around an `@OnEmail()` handler. */
|
|
44
|
+
type EmailExecutionContext = EntrypointExecutionContext<'cf:email'>;
|
|
45
|
+
/**
|
|
46
|
+
* The reason a message no handler accepts is rejected with: a permanent SMTP
|
|
47
|
+
* error the sending server reports to its sender.
|
|
48
|
+
*/
|
|
49
|
+
export declare const UNCLAIMED_EMAIL_REASON = "No handler accepts mail for this address.";
|
|
50
|
+
//#endregion
|
|
51
|
+
export type { EmailExecutionContext, OnEmailDecorator, OnEmailOptions };
|
package/dist/email.js
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { CLOUDFLARE_ENTRYPOINT, cloudflareApplication, isCloudflareApp, registerEntrypoint } from "../cloudflare-factory.js";
|
|
2
|
+
import { internalEntrypointError } from "../rpc/entrypoint-error.js";
|
|
3
|
+
import { HostInvoker, callRpcMethod, hostModuleId } from "../host/host-invoker.js";
|
|
4
|
+
import { hostMembers } from "../host/host-members.js";
|
|
5
|
+
import { InjectionToken, Scope } from "@velajs/vela";
|
|
6
|
+
import { WorkerEntrypoint } from "cloudflare:workers";
|
|
7
|
+
//#region src/entrypoint/vela-entrypoint.ts
|
|
8
|
+
/**
|
|
9
|
+
* The `props` of the current service entrypoint call (`ctx.props` in a
|
|
10
|
+
* hand-written `WorkerEntrypoint`): what the caller's service binding
|
|
11
|
+
* configuration (`services: [{ binding, service, entrypoint, props }]`) or a
|
|
12
|
+
* `ctx.exports` loopback stub attached. Request-scoped: it resolves only
|
|
13
|
+
* inside an RPC call of a `VelaEntrypoint()` class, and a class injecting it
|
|
14
|
+
* is built for each call. Validate it before use; it is `{}` when the caller
|
|
15
|
+
* attached none.
|
|
16
|
+
*/
|
|
17
|
+
const ENTRYPOINT_PROPS = /* @__PURE__ */ new InjectionToken("@velajs/cloudflare:entrypoint-props", {
|
|
18
|
+
scope: Scope.REQUEST,
|
|
19
|
+
factory: () => {
|
|
20
|
+
throw new Error("ENTRYPOINT_PROPS can only be resolved inside a service entrypoint RPC call: VelaEntrypoint() seeds it into each call with the caller ctx.props.");
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Names an RPC method cannot take: the entrypoint's own `ctx` and `env`, the
|
|
25
|
+
* platform handlers of a `WorkerEntrypoint`, the stub members that shadow an
|
|
26
|
+
* RPC method of that name (`fetch()`, `connect()`, `dup()`), and `then`,
|
|
27
|
+
* which would make the stub and its results thenables.
|
|
28
|
+
*/
|
|
29
|
+
const SERVICE_ENTRYPOINT = {
|
|
30
|
+
label: "service entrypoint",
|
|
31
|
+
reserved: /* @__PURE__ */ new Set([
|
|
32
|
+
"ctx",
|
|
33
|
+
"env",
|
|
34
|
+
"dup",
|
|
35
|
+
"then",
|
|
36
|
+
...[
|
|
37
|
+
"fetch",
|
|
38
|
+
"connect",
|
|
39
|
+
"email",
|
|
40
|
+
"queue",
|
|
41
|
+
"scheduled",
|
|
42
|
+
"tail",
|
|
43
|
+
"tailStream",
|
|
44
|
+
"test",
|
|
45
|
+
"trace"
|
|
46
|
+
]
|
|
47
|
+
]),
|
|
48
|
+
handlers: []
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* @internal The RPC methods of `host` its service entrypoint class exposes:
|
|
52
|
+
* the methods `rpc` names. A hook, a reserved name, an accessor or an instance
|
|
53
|
+
* field throws, and so does a host whose prototype defines `then`. Read at
|
|
54
|
+
* class definition, without constructing the host.
|
|
55
|
+
*/
|
|
56
|
+
function entrypointHostMembers(host, rpc) {
|
|
57
|
+
return { methods: hostMembers(host, rpc, SERVICE_ENTRYPOINT).methods };
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A service entrypoint class (a `WorkerEntrypoint`) whose JS-RPC methods are
|
|
61
|
+
* the methods of `host`, an `@Injectable()` class, that `rpc` names. Each call
|
|
62
|
+
* runs in the Worker's application for its environment: the one the app's
|
|
63
|
+
* Worker handlers use, with the host added to the root module's providers.
|
|
64
|
+
* Export a named subclass and bind it from another Worker (or this one) with
|
|
65
|
+
* `services: [{ binding, service, entrypoint: 'Billing' }]`:
|
|
66
|
+
*
|
|
67
|
+
* ```ts
|
|
68
|
+
* @Injectable()
|
|
69
|
+
* export class BillingHost {
|
|
70
|
+
* constructor(
|
|
71
|
+
* private readonly invoices: InvoicesService,
|
|
72
|
+
* @Inject(ENTRYPOINT_PROPS) private readonly props: unknown,
|
|
73
|
+
* ) {}
|
|
74
|
+
* async charge(customerId: string, cents: number): Promise<{ invoiceId: string }> {
|
|
75
|
+
* return this.invoices.charge(customerId, cents);
|
|
76
|
+
* }
|
|
77
|
+
* }
|
|
78
|
+
* export class Billing extends VelaEntrypoint(app, BillingHost, { rpc: ['charge'] }) {}
|
|
79
|
+
* // Caller: await env.BILLING.charge('customer-1', 500)
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* - Exactly the host methods `rpc` names are RPC methods, typed so a
|
|
83
|
+
* `Service<typeof Billing>` binding exposes their signatures. Nothing else
|
|
84
|
+
* is reachable over RPC, even from plain JavaScript naming it on a stub. A
|
|
85
|
+
* listed name that is not a prototype method of the host, a hook, a
|
|
86
|
+
* `WorkerEntrypoint` handler (`fetch`, `connect`, `email`, `queue`,
|
|
87
|
+
* `scheduled`, `tail`, ...), `ctx`, `env`, `dup` or `then` throws here, and
|
|
88
|
+
* so does a host whose prototype defines `then()`.
|
|
89
|
+
* - Each call runs in its own execution scope, so request-scoped providers
|
|
90
|
+
* are built per call, through the host's scoped guards, pipes (the
|
|
91
|
+
* arguments), interceptors and filters (`getType()` is `'rpc'`). The
|
|
92
|
+
* caller's `ctx.props` is injectable as {@link ENTRYPOINT_PROPS}.
|
|
93
|
+
* - Failures are reported (`edge: 'rpc'`); a call rejects only with an
|
|
94
|
+
* `EntrypointError`, rendered like an HTTP response with server errors
|
|
95
|
+
* redacted.
|
|
96
|
+
*/
|
|
97
|
+
function VelaEntrypoint(app, host, options = {}) {
|
|
98
|
+
if (!isCloudflareApp(app)) throw new TypeError("VelaEntrypoint() takes the app from defineCloudflareApp(AppModule, options): each call runs in the Worker application that app builds.");
|
|
99
|
+
if (typeof host !== "function") throw new TypeError("VelaEntrypoint(app, Host, { rpc }) takes the @Injectable() host class.");
|
|
100
|
+
const members = entrypointHostMembers(host, options.rpc);
|
|
101
|
+
const methods = new Set(members.methods);
|
|
102
|
+
const rootClass = typeof app.rootModule === "function" ? app.rootModule : app.rootModule.module;
|
|
103
|
+
const invokers = /* @__PURE__ */ new WeakMap();
|
|
104
|
+
const invokerOf = (application) => {
|
|
105
|
+
const existing = invokers.get(application);
|
|
106
|
+
if (existing) return existing;
|
|
107
|
+
const container = application.getContainer();
|
|
108
|
+
const invoker = new HostInvoker({
|
|
109
|
+
container,
|
|
110
|
+
host,
|
|
111
|
+
moduleId: hostModuleId(container, host, rootClass),
|
|
112
|
+
edge: "rpc"
|
|
113
|
+
});
|
|
114
|
+
invokers.set(application, invoker);
|
|
115
|
+
return invoker;
|
|
116
|
+
};
|
|
117
|
+
/** The platform's `ctx` and `env` of each instance, readable by the methods defined below. */
|
|
118
|
+
const platform = /* @__PURE__ */ new WeakMap();
|
|
119
|
+
class VelaHostEntrypoint extends WorkerEntrypoint {
|
|
120
|
+
constructor(ctx, env) {
|
|
121
|
+
super(ctx, env);
|
|
122
|
+
platform.set(this, {
|
|
123
|
+
ctx,
|
|
124
|
+
env
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const prototype = VelaHostEntrypoint.prototype;
|
|
129
|
+
for (const method of members.methods) Object.defineProperty(prototype, method, {
|
|
130
|
+
writable: true,
|
|
131
|
+
configurable: true,
|
|
132
|
+
value: async function(...args) {
|
|
133
|
+
const call = platform.get(this);
|
|
134
|
+
let application;
|
|
135
|
+
try {
|
|
136
|
+
if (call === void 0) throw new TypeError("Entrypoint method called on a foreign receiver.");
|
|
137
|
+
application = await cloudflareApplication(app, call.env);
|
|
138
|
+
} catch (error) {
|
|
139
|
+
console.error(`[vela] Service entrypoint ${host.name} failed to start:`, error);
|
|
140
|
+
throw internalEntrypointError();
|
|
141
|
+
}
|
|
142
|
+
const props = call.ctx.props ?? {};
|
|
143
|
+
return callRpcMethod(invokerOf(application), methods, method, args, (scope) => scope.setRequestInstance(ENTRYPOINT_PROPS, props));
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
const descriptor = {
|
|
147
|
+
rootModule: app.rootModule,
|
|
148
|
+
host,
|
|
149
|
+
methods: members.methods,
|
|
150
|
+
entrypoint: VelaHostEntrypoint
|
|
151
|
+
};
|
|
152
|
+
registerEntrypoint(app, descriptor);
|
|
153
|
+
Object.defineProperty(VelaHostEntrypoint, "name", { value: `${host.name}Entrypoint` });
|
|
154
|
+
Object.defineProperty(VelaHostEntrypoint, CLOUDFLARE_ENTRYPOINT, { value: descriptor });
|
|
155
|
+
return VelaHostEntrypoint;
|
|
156
|
+
}
|
|
157
|
+
//#endregion
|
|
158
|
+
export { ENTRYPOINT_PROPS, VelaEntrypoint, entrypointHostMembers };
|
|
159
|
+
|
|
160
|
+
//# sourceMappingURL=vela-entrypoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vela-entrypoint.js","names":[],"sources":["../../src/entrypoint/vela-entrypoint.ts"],"sourcesContent":["import { WorkerEntrypoint } from 'cloudflare:workers';\nimport { InjectionToken, Scope } from '@velajs/vela';\nimport type { Type, VelaEnv } from '@velajs/vela';\nimport type { EntrypointExecutionContext } from '@velajs/vela/module-kit';\nimport type { CloudflareApplication } from '../cloudflare-application';\nimport {\n CLOUDFLARE_ENTRYPOINT,\n cloudflareApplication,\n isCloudflareApp,\n registerEntrypoint,\n type CloudflareApp,\n type CloudflareEntrypointDescriptor,\n} from '../cloudflare-factory';\nimport { HostInvoker, callRpcMethod, hostModuleId } from '../host/host-invoker';\nimport {\n hostMembers,\n type RpcMethodOf,\n type RpcMethods,\n type RpcSurface,\n} from '../host/host-members';\nimport { internalEntrypointError } from '../rpc/entrypoint-error';\n\n/**\n * The `props` of the current service entrypoint call (`ctx.props` in a\n * hand-written `WorkerEntrypoint`): what the caller's service binding\n * configuration (`services: [{ binding, service, entrypoint, props }]`) or a\n * `ctx.exports` loopback stub attached. Request-scoped: it resolves only\n * inside an RPC call of a `VelaEntrypoint()` class, and a class injecting it\n * is built for each call. Validate it before use; it is `{}` when the caller\n * attached none.\n */\nexport const ENTRYPOINT_PROPS = /* @__PURE__ */ new InjectionToken<unknown>(\n '@velajs/cloudflare:entrypoint-props',\n {\n scope: Scope.REQUEST,\n factory: () => {\n throw new Error(\n 'ENTRYPOINT_PROPS can only be resolved inside a service entrypoint RPC call: ' +\n 'VelaEntrypoint() seeds it into each call with the caller ctx.props.',\n );\n },\n },\n);\n\n/** WorkerEntrypoint handlers the platform calls, never RPC methods. */\nconst WORKER_ENTRYPOINT_HANDLERS = [\n 'fetch',\n 'connect',\n 'email',\n 'queue',\n 'scheduled',\n 'tail',\n 'tailStream',\n 'test',\n 'trace',\n] as const;\n\n/**\n * Names an RPC method cannot take: the entrypoint's own `ctx` and `env`, the\n * platform handlers of a `WorkerEntrypoint`, the stub members that shadow an\n * RPC method of that name (`fetch()`, `connect()`, `dup()`), and `then`,\n * which would make the stub and its results thenables.\n */\nconst SERVICE_ENTRYPOINT: RpcSurface<never> = {\n label: 'service entrypoint',\n reserved: new Set(['ctx', 'env', 'dup', 'then', ...WORKER_ENTRYPOINT_HANDLERS]),\n handlers: [],\n};\n\n/**\n * @internal The RPC methods of `host` its service entrypoint class exposes:\n * the methods `rpc` names. A hook, a reserved name, an accessor or an instance\n * field throws, and so does a host whose prototype defines `then`. Read at\n * class definition, without constructing the host.\n */\nexport function entrypointHostMembers(\n host: abstract new (...args: never[]) => unknown,\n rpc?: readonly string[],\n): { methods: string[] } {\n return { methods: hostMembers(host, rpc, SERVICE_ENTRYPOINT).methods };\n}\n\n/** Host members that are never RPC methods, besides hooks: the names {@link SERVICE_ENTRYPOINT} reserves. */\ntype NotRpcMethod = (typeof WORKER_ENTRYPOINT_HANDLERS)[number] | 'ctx' | 'env' | 'dup' | 'then';\n\n/**\n * The names a service entrypoint host's `rpc` list may take: its public\n * methods, less hooks, platform handlers and names the entrypoint or its\n * stubs own. TypeScript `private` and `protected` methods are not among them.\n */\nexport type EntrypointRpcMethod<Host> = RpcMethodOf<Host, NotRpcMethod>;\n\n/**\n * The RPC methods a `VelaEntrypoint(app, Host, { rpc })` class exposes: the\n * host methods `Method` names, asynchronous. A service binding to the class\n * (`Service<typeof Billing>`) calls them with these signatures.\n */\nexport type EntrypointRpc<Host, Method extends EntrypointRpcMethod<Host>> = RpcMethods<\n Host,\n Method\n>;\n\n/** Options of {@link VelaEntrypoint}. */\nexport interface VelaEntrypointOptions<Method extends string = string> {\n /**\n * The host methods callers may invoke over JS-RPC, such as\n * `['charge', 'refund']`: public methods declared in the host's class body\n * (or inherited). Nothing else is an RPC method, so TypeScript `private`\n * helpers, hooks and unlisted methods stay unreachable.\n */\n readonly rpc?: readonly Method[];\n}\n\n/**\n * The class `VelaEntrypoint(app, Host, { rpc })` returns: export a named\n * subclass of it, which service bindings name as their `entrypoint`. It also\n * carries its `CloudflareEntrypointDescriptor` under the static\n * `CLOUDFLARE_ENTRYPOINT` key, for tools.\n */\nexport type VelaEntrypointClass<Host, Method extends EntrypointRpcMethod<Host> = never> = new (\n ctx: ExecutionContext,\n env: VelaEnv,\n) => WorkerEntrypoint<VelaEnv> & EntrypointRpc<Host, Method>;\n\n/** The ExecutionContext guards, interceptors and filters receive around a service RPC call. */\nexport type EntrypointRpcExecutionContext = EntrypointExecutionContext<'rpc'>;\n\n/**\n * A service entrypoint class (a `WorkerEntrypoint`) whose JS-RPC methods are\n * the methods of `host`, an `@Injectable()` class, that `rpc` names. Each call\n * runs in the Worker's application for its environment: the one the app's\n * Worker handlers use, with the host added to the root module's providers.\n * Export a named subclass and bind it from another Worker (or this one) with\n * `services: [{ binding, service, entrypoint: 'Billing' }]`:\n *\n * ```ts\n * @Injectable()\n * export class BillingHost {\n * constructor(\n * private readonly invoices: InvoicesService,\n * @Inject(ENTRYPOINT_PROPS) private readonly props: unknown,\n * ) {}\n * async charge(customerId: string, cents: number): Promise<{ invoiceId: string }> {\n * return this.invoices.charge(customerId, cents);\n * }\n * }\n * export class Billing extends VelaEntrypoint(app, BillingHost, { rpc: ['charge'] }) {}\n * // Caller: await env.BILLING.charge('customer-1', 500)\n * ```\n *\n * - Exactly the host methods `rpc` names are RPC methods, typed so a\n * `Service<typeof Billing>` binding exposes their signatures. Nothing else\n * is reachable over RPC, even from plain JavaScript naming it on a stub. A\n * listed name that is not a prototype method of the host, a hook, a\n * `WorkerEntrypoint` handler (`fetch`, `connect`, `email`, `queue`,\n * `scheduled`, `tail`, ...), `ctx`, `env`, `dup` or `then` throws here, and\n * so does a host whose prototype defines `then()`.\n * - Each call runs in its own execution scope, so request-scoped providers\n * are built per call, through the host's scoped guards, pipes (the\n * arguments), interceptors and filters (`getType()` is `'rpc'`). The\n * caller's `ctx.props` is injectable as {@link ENTRYPOINT_PROPS}.\n * - Failures are reported (`edge: 'rpc'`); a call rejects only with an\n * `EntrypointError`, rendered like an HTTP response with server errors\n * redacted.\n */\nexport function VelaEntrypoint<\n Host extends object,\n const Method extends EntrypointRpcMethod<Host> = never,\n>(\n app: CloudflareApp,\n host: Type<Host>,\n options: VelaEntrypointOptions<Method> = {},\n): VelaEntrypointClass<Host, Method> {\n if (!isCloudflareApp(app)) {\n throw new TypeError(\n 'VelaEntrypoint() takes the app from defineCloudflareApp(AppModule, options): each call ' +\n 'runs in the Worker application that app builds.',\n );\n }\n if (typeof host !== 'function') {\n throw new TypeError('VelaEntrypoint(app, Host, { rpc }) takes the @Injectable() host class.');\n }\n const members = entrypointHostMembers(host, options.rpc);\n const methods: ReadonlySet<string> = new Set(members.methods);\n const rootClass = typeof app.rootModule === 'function' ? app.rootModule : app.rootModule.module;\n const invokers = new WeakMap<CloudflareApplication, HostInvoker>();\n const invokerOf = (application: CloudflareApplication): HostInvoker => {\n const existing = invokers.get(application);\n if (existing) return existing;\n const container = application.getContainer();\n const invoker = new HostInvoker({\n container,\n host,\n moduleId: hostModuleId(container, host, rootClass),\n edge: 'rpc',\n });\n invokers.set(application, invoker);\n return invoker;\n };\n /** The platform's `ctx` and `env` of each instance, readable by the methods defined below. */\n const platform = new WeakMap<object, { ctx: ExecutionContext; env: VelaEnv }>();\n\n class VelaHostEntrypoint extends WorkerEntrypoint<VelaEnv> {\n constructor(ctx: ExecutionContext, env: VelaEnv) {\n super(ctx, env);\n platform.set(this, { ctx, env });\n }\n }\n\n const prototype = VelaHostEntrypoint.prototype;\n for (const method of members.methods) {\n Object.defineProperty(prototype, method, {\n writable: true,\n configurable: true,\n value: async function (this: object, ...args: unknown[]): Promise<unknown> {\n const call = platform.get(this);\n let application: CloudflareApplication;\n try {\n if (call === undefined)\n throw new TypeError('Entrypoint method called on a foreign receiver.');\n application = await cloudflareApplication(app, call.env);\n } catch (error) {\n // A caller learns that the application failed to start, never why.\n console.error(`[vela] Service entrypoint ${host.name} failed to start:`, error);\n throw internalEntrypointError();\n }\n const props: unknown = call.ctx.props ?? {};\n return callRpcMethod(invokerOf(application), methods, method, args, (scope) =>\n scope.setRequestInstance(ENTRYPOINT_PROPS, props),\n );\n },\n });\n }\n\n const descriptor: CloudflareEntrypointDescriptor = {\n rootModule: app.rootModule,\n host,\n methods: members.methods,\n entrypoint: VelaHostEntrypoint,\n };\n registerEntrypoint(app, descriptor);\n Object.defineProperty(VelaHostEntrypoint, 'name', { value: `${host.name}Entrypoint` });\n Object.defineProperty(VelaHostEntrypoint, CLOUDFLARE_ENTRYPOINT, { value: descriptor });\n // The RPC methods are defined on the prototype above, at runtime, from the rpc list.\n return VelaHostEntrypoint as unknown as VelaEntrypointClass<Host, Method>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+BA,MAAa,mCAAmC,IAAI,eAClD,uCACA;CACE,OAAO,MAAM;CACb,eAAe;EACb,MAAM,IAAI,MACR,iJAEF;CACF;AACF,CACF;;;;;;;AAqBA,MAAM,qBAAwC;CAC5C,OAAO;CACP,0BAAU,IAAI,IAAI;EAAC;EAAO;EAAO;EAAO;EAAQ,GAAG;GAnBnD;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EAW4E;CAAC,CAAC;CAC9E,UAAU,CAAC;AACb;;;;;;;AAQA,SAAgB,sBACd,MACA,KACuB;CACvB,OAAO,EAAE,SAAS,YAAY,MAAM,KAAK,kBAAkB,CAAC,CAAC,QAAQ;AACvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,SAAgB,eAId,KACA,MACA,UAAyC,CAAC,GACP;CACnC,IAAI,CAAC,gBAAgB,GAAG,GACtB,MAAM,IAAI,UACR,wIAEF;CAEF,IAAI,OAAO,SAAS,YAClB,MAAM,IAAI,UAAU,wEAAwE;CAE9F,MAAM,UAAU,sBAAsB,MAAM,QAAQ,GAAG;CACvD,MAAM,UAA+B,IAAI,IAAI,QAAQ,OAAO;CAC5D,MAAM,YAAY,OAAO,IAAI,eAAe,aAAa,IAAI,aAAa,IAAI,WAAW;CACzF,MAAM,2BAAW,IAAI,QAA4C;CACjE,MAAM,aAAa,gBAAoD;EACrE,MAAM,WAAW,SAAS,IAAI,WAAW;EACzC,IAAI,UAAU,OAAO;EACrB,MAAM,YAAY,YAAY,aAAa;EAC3C,MAAM,UAAU,IAAI,YAAY;GAC9B;GACA;GACA,UAAU,aAAa,WAAW,MAAM,SAAS;GACjD,MAAM;EACR,CAAC;EACD,SAAS,IAAI,aAAa,OAAO;EACjC,OAAO;CACT;;CAEA,MAAM,2BAAW,IAAI,QAAyD;CAE9E,MAAM,2BAA2B,iBAA0B;EACzD,YAAY,KAAuB,KAAc;GAC/C,MAAM,KAAK,GAAG;GACd,SAAS,IAAI,MAAM;IAAE;IAAK;GAAI,CAAC;EACjC;CACF;CAEA,MAAM,YAAY,mBAAmB;CACrC,KAAK,MAAM,UAAU,QAAQ,SAC3B,OAAO,eAAe,WAAW,QAAQ;EACvC,UAAU;EACV,cAAc;EACd,OAAO,eAA8B,GAAG,MAAmC;GACzE,MAAM,OAAO,SAAS,IAAI,IAAI;GAC9B,IAAI;GACJ,IAAI;IACF,IAAI,SAAS,KAAA,GACX,MAAM,IAAI,UAAU,iDAAiD;IACvE,cAAc,MAAM,sBAAsB,KAAK,KAAK,GAAG;GACzD,SAAS,OAAO;IAEd,QAAQ,MAAM,6BAA6B,KAAK,KAAK,oBAAoB,KAAK;IAC9E,MAAM,wBAAwB;GAChC;GACA,MAAM,QAAiB,KAAK,IAAI,SAAS,CAAC;GAC1C,OAAO,cAAc,UAAU,WAAW,GAAG,SAAS,QAAQ,OAAO,UACnE,MAAM,mBAAmB,kBAAkB,KAAK,CAClD;EACF;CACF,CAAC;CAGH,MAAM,aAA6C;EACjD,YAAY,IAAI;EAChB;EACA,SAAS,QAAQ;EACjB,YAAY;CACd;CACA,mBAAmB,KAAK,UAAU;CAClC,OAAO,eAAe,oBAAoB,QAAQ,EAAE,OAAO,GAAG,KAAK,KAAK,YAAY,CAAC;CACrF,OAAO,eAAe,oBAAoB,uBAAuB,EAAE,OAAO,WAAW,CAAC;CAEtF,OAAO;AACT"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import "./vela-env-DFvyoNT3.js";
|
|
2
|
+
import { a as CloudflareApp } from "./cloudflare-factory-CuFNUJJD.js";
|
|
3
|
+
import { n as RpcMethods, t as RpcMethodOf } from "./host-members-DECj_4yz.js";
|
|
4
|
+
import { WorkerEntrypoint } from "cloudflare:workers";
|
|
5
|
+
import { InjectionToken, Type, VelaEnv } from "@velajs/vela";
|
|
6
|
+
import { EntrypointExecutionContext } from "@velajs/vela/module-kit";
|
|
7
|
+
//#region src/entrypoint/vela-entrypoint.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* The `props` of the current service entrypoint call (`ctx.props` in a
|
|
10
|
+
* hand-written `WorkerEntrypoint`): what the caller's service binding
|
|
11
|
+
* configuration (`services: [{ binding, service, entrypoint, props }]`) or a
|
|
12
|
+
* `ctx.exports` loopback stub attached. Request-scoped: it resolves only
|
|
13
|
+
* inside an RPC call of a `VelaEntrypoint()` class, and a class injecting it
|
|
14
|
+
* is built for each call. Validate it before use; it is `{}` when the caller
|
|
15
|
+
* attached none.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ENTRYPOINT_PROPS: InjectionToken<unknown>;
|
|
18
|
+
/** WorkerEntrypoint handlers the platform calls, never RPC methods. */
|
|
19
|
+
declare const WORKER_ENTRYPOINT_HANDLERS: readonly ['fetch', 'connect', 'email', 'queue', 'scheduled', 'tail', 'tailStream', 'test', 'trace'];
|
|
20
|
+
/** Host members that are never RPC methods, besides hooks: the names {@link SERVICE_ENTRYPOINT} reserves. */
|
|
21
|
+
type NotRpcMethod = (typeof WORKER_ENTRYPOINT_HANDLERS)[number] | 'ctx' | 'env' | 'dup' | 'then';
|
|
22
|
+
/**
|
|
23
|
+
* The names a service entrypoint host's `rpc` list may take: its public
|
|
24
|
+
* methods, less hooks, platform handlers and names the entrypoint or its
|
|
25
|
+
* stubs own. TypeScript `private` and `protected` methods are not among them.
|
|
26
|
+
*/
|
|
27
|
+
type EntrypointRpcMethod<Host> = RpcMethodOf<Host, NotRpcMethod>;
|
|
28
|
+
/**
|
|
29
|
+
* The RPC methods a `VelaEntrypoint(app, Host, { rpc })` class exposes: the
|
|
30
|
+
* host methods `Method` names, asynchronous. A service binding to the class
|
|
31
|
+
* (`Service<typeof Billing>`) calls them with these signatures.
|
|
32
|
+
*/
|
|
33
|
+
type EntrypointRpc<Host, Method extends EntrypointRpcMethod<Host>> = RpcMethods<Host, Method>;
|
|
34
|
+
/** Options of {@link VelaEntrypoint}. */
|
|
35
|
+
interface VelaEntrypointOptions<Method extends string = string> {
|
|
36
|
+
/**
|
|
37
|
+
* The host methods callers may invoke over JS-RPC, such as
|
|
38
|
+
* `['charge', 'refund']`: public methods declared in the host's class body
|
|
39
|
+
* (or inherited). Nothing else is an RPC method, so TypeScript `private`
|
|
40
|
+
* helpers, hooks and unlisted methods stay unreachable.
|
|
41
|
+
*/
|
|
42
|
+
readonly rpc?: readonly Method[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The class `VelaEntrypoint(app, Host, { rpc })` returns: export a named
|
|
46
|
+
* subclass of it, which service bindings name as their `entrypoint`. It also
|
|
47
|
+
* carries its `CloudflareEntrypointDescriptor` under the static
|
|
48
|
+
* `CLOUDFLARE_ENTRYPOINT` key, for tools.
|
|
49
|
+
*/
|
|
50
|
+
type VelaEntrypointClass<Host, Method extends EntrypointRpcMethod<Host> = never> = new (ctx: ExecutionContext, env: VelaEnv) => WorkerEntrypoint<VelaEnv> & EntrypointRpc<Host, Method>;
|
|
51
|
+
/** The ExecutionContext guards, interceptors and filters receive around a service RPC call. */
|
|
52
|
+
type EntrypointRpcExecutionContext = EntrypointExecutionContext<'rpc'>;
|
|
53
|
+
/**
|
|
54
|
+
* A service entrypoint class (a `WorkerEntrypoint`) whose JS-RPC methods are
|
|
55
|
+
* the methods of `host`, an `@Injectable()` class, that `rpc` names. Each call
|
|
56
|
+
* runs in the Worker's application for its environment: the one the app's
|
|
57
|
+
* Worker handlers use, with the host added to the root module's providers.
|
|
58
|
+
* Export a named subclass and bind it from another Worker (or this one) with
|
|
59
|
+
* `services: [{ binding, service, entrypoint: 'Billing' }]`:
|
|
60
|
+
*
|
|
61
|
+
* ```ts
|
|
62
|
+
* @Injectable()
|
|
63
|
+
* export class BillingHost {
|
|
64
|
+
* constructor(
|
|
65
|
+
* private readonly invoices: InvoicesService,
|
|
66
|
+
* @Inject(ENTRYPOINT_PROPS) private readonly props: unknown,
|
|
67
|
+
* ) {}
|
|
68
|
+
* async charge(customerId: string, cents: number): Promise<{ invoiceId: string }> {
|
|
69
|
+
* return this.invoices.charge(customerId, cents);
|
|
70
|
+
* }
|
|
71
|
+
* }
|
|
72
|
+
* export class Billing extends VelaEntrypoint(app, BillingHost, { rpc: ['charge'] }) {}
|
|
73
|
+
* // Caller: await env.BILLING.charge('customer-1', 500)
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* - Exactly the host methods `rpc` names are RPC methods, typed so a
|
|
77
|
+
* `Service<typeof Billing>` binding exposes their signatures. Nothing else
|
|
78
|
+
* is reachable over RPC, even from plain JavaScript naming it on a stub. A
|
|
79
|
+
* listed name that is not a prototype method of the host, a hook, a
|
|
80
|
+
* `WorkerEntrypoint` handler (`fetch`, `connect`, `email`, `queue`,
|
|
81
|
+
* `scheduled`, `tail`, ...), `ctx`, `env`, `dup` or `then` throws here, and
|
|
82
|
+
* so does a host whose prototype defines `then()`.
|
|
83
|
+
* - Each call runs in its own execution scope, so request-scoped providers
|
|
84
|
+
* are built per call, through the host's scoped guards, pipes (the
|
|
85
|
+
* arguments), interceptors and filters (`getType()` is `'rpc'`). The
|
|
86
|
+
* caller's `ctx.props` is injectable as {@link ENTRYPOINT_PROPS}.
|
|
87
|
+
* - Failures are reported (`edge: 'rpc'`); a call rejects only with an
|
|
88
|
+
* `EntrypointError`, rendered like an HTTP response with server errors
|
|
89
|
+
* redacted.
|
|
90
|
+
*/
|
|
91
|
+
export declare function VelaEntrypoint<Host extends object, const Method extends EntrypointRpcMethod<Host> = never>(app: CloudflareApp, host: Type<Host>, options?: VelaEntrypointOptions<Method>): VelaEntrypointClass<Host, Method>;
|
|
92
|
+
//#endregion
|
|
93
|
+
export type { EntrypointRpc, EntrypointRpcExecutionContext, EntrypointRpcMethod, VelaEntrypointClass, VelaEntrypointOptions };
|