API reference
app-method-runtime
Import
Section titled “Import”import * as api from "@fungi.computer/puffball/app-method-runtime";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | AppMethodCallContext | Trusted attribution delivered separately from App method arguments. |
| constant | appApiReservedMethodNames | Reserved JavaScript, RPC and lifecycle names are never App method names. |
| constant | appMethodCallerSchema | Sole grammar for the Hub-minted Computer pin and actor attribution. |
| function | parseAppMethodCallContext() | Decode the trusted Hub attribution through the sole runtime-neutral grammar. |
| function | isAppApiMethodName() | Shared domain grammar for generated RPC method names. |
AppMethodCallContexttype alias
Section titled “AppMethodCallContext”type AppMethodCallContext = z.output<typeof appMethodCallerSchema>;Trusted attribution delivered separately from App method arguments.
appApiReservedMethodNamesconstant
Section titled “appApiReservedMethodNames”const appApiReservedMethodNames: Readonly<{ intrinsic: readonly [ "constructor", "toString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", ]; rpc: readonly ["then", "dup", "connect", "id", "name"]; instance: readonly ["ctx", "env"]; lifecycle: readonly [ "fetch", "alarm", "queue", "scheduled", "tail", "trace", "email", "test", "tailStream", "webSocketMessage", "webSocketClose", "webSocketError", ];}>;Reserved JavaScript, RPC and lifecycle names are never App method names.
appMethodCallerSchemaconstant
Section titled “appMethodCallerSchema”const appMethodCallerSchema: ZodMiniObject< { computerId: ZodMiniNullable<ZodMiniString<string>>; actor: ZodMiniDiscriminatedUnion< [ ZodMiniObject< { kind: ZodMiniLiteral<"member">; memberId: ZodMiniString<string>; }, $strip >, ZodMiniObject< { kind: ZodMiniLiteral<"agent">; agentId: ZodMiniString<string>; }, $strip >, ZodMiniObject< { kind: ZodMiniLiteral<"team-key">; keyId: ZodMiniString<string>; }, $strip >, ], "kind" >; }, $strip>;Sole grammar for the Hub-minted Computer pin and actor attribution.
parseAppMethodCallContext()function
Section titled “parseAppMethodCallContext()”function parseAppMethodCallContext(value, rejectUnknownKeys?): object;Decode the trusted Hub attribution through the sole runtime-neutral grammar.
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
value |
unknown |
undefined |
rejectUnknownKeys |
boolean |
false |
Returns
Section titled “Returns”object
| Name | Type |
|---|---|
computerId |
string | null |
actor |
| { kind: "member"; memberId: string; } | { kind: "agent"; agentId: string; } | { kind: "team-key"; keyId: string; } |
isAppApiMethodName()function
Section titled “isAppApiMethodName()”function isAppApiMethodName(name): boolean;Shared domain grammar for generated RPC method names.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
Returns
Section titled “Returns”boolean