mirror of
https://github.com/hanzoai/team-go.git
synced 2026-10-30 20:22:42 +00:00
The Go transactor and account service for Hanzo Team. History starts here. The previous 107 commits carried the fork's origin in their messages and their tree, and none of it described this code: the Go under pkg/transactor is Hanzo's own work implementing a wire protocol, not a port of anyone's implementation. pkg/transactor/model.json remains, and remains attributed. It is a compiled platform model this transactor loads through go:embed, governed by EPL-2.0 and named in NOTICE. Removing it is a replacement project -- a new compiler and a move off the protocol -- not a deletion.
74 lines
1.9 KiB
TypeScript
74 lines
1.9 KiB
TypeScript
// Ambient type declarations for the hanzo/base JSVM runtime.
|
|
//
|
|
// The real generated types live in hanzo/base/plugins/jsvm/internal/types
|
|
// and ship with @hanzo/base. This stub is intentionally minimal — it
|
|
// shadows just enough for `bun run typecheck` to be happy on the
|
|
// .fn.ts files in this directory. Replace with a re-export once the
|
|
// generated types land as a published package.
|
|
|
|
declare function routerAdd(
|
|
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE",
|
|
path: string,
|
|
handler: (e: RequestEvent) => any
|
|
): void;
|
|
|
|
declare const $app: {
|
|
newMailClient(): { send(m: any): void };
|
|
findRecordById(collection: string, id: string): any;
|
|
findFirstRecordByFilter(collection: string, filter: string, params?: Record<string, any>): any;
|
|
save(record: any): void;
|
|
delete(record: any): void;
|
|
logger(): { info: (m: string, ...kv: any[]) => void; error: (m: string, ...kv: any[]) => void };
|
|
};
|
|
|
|
declare const $os: {
|
|
getenv(key: string): string;
|
|
};
|
|
|
|
declare const $http: {
|
|
send(opts: {
|
|
url: string;
|
|
method?: string;
|
|
body?: string;
|
|
headers?: Record<string, string>;
|
|
timeout?: number;
|
|
}): { statusCode: number; headers: Record<string, string[]>; body: string };
|
|
};
|
|
|
|
interface RequestEvent {
|
|
auth: null | {
|
|
id: string;
|
|
email(): string;
|
|
get(field: string): any;
|
|
};
|
|
request: Request;
|
|
response: Response;
|
|
requestInfo(): { body: any; query: Record<string, string> };
|
|
json(status: number, body: any): any;
|
|
}
|
|
|
|
declare class MailerMessage {
|
|
constructor(opts: {
|
|
from: { address: string; name?: string };
|
|
to: Array<{ address: string; name?: string }>;
|
|
subject: string;
|
|
html?: string;
|
|
text?: string;
|
|
});
|
|
}
|
|
|
|
declare function migrate(
|
|
up: (app: any) => void,
|
|
down?: (app: any) => void
|
|
): void;
|
|
|
|
declare class Collection {
|
|
id: string;
|
|
constructor(spec: {
|
|
type: "base" | "auth" | "view";
|
|
name: string;
|
|
fields?: any[];
|
|
indexes?: string[];
|
|
});
|
|
}
|