weifuwu 0.4.0 → 0.5.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/README.md +382 -239
- package/dist/ai.d.ts +7 -0
- package/dist/graphql.d.ts +12 -0
- package/dist/index.d.ts +9 -3
- package/dist/index.js +1950 -1721
- package/dist/postgres/client.d.ts +2 -0
- package/dist/postgres/index.d.ts +2 -0
- package/dist/postgres/migrate.d.ts +3 -0
- package/dist/postgres/table.d.ts +4 -0
- package/dist/postgres/types.d.ts +51 -0
- package/dist/router.d.ts +0 -22
- package/dist/workflow/index.d.ts +2 -0
- package/dist/workflow/route.d.ts +11 -0
- package/package.json +3 -2
package/dist/ai.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { streamText } from 'ai';
|
|
2
|
+
import type { Context } from './types.ts';
|
|
3
|
+
import { Router } from './router.ts';
|
|
4
|
+
type StreamTextParams = Parameters<typeof streamText>[0];
|
|
5
|
+
export type AIHandler = (req: Request, ctx: Context) => StreamTextParams | Promise<StreamTextParams>;
|
|
6
|
+
export declare function ai(handler: AIHandler): Router;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type GraphQLSchema } from 'graphql';
|
|
2
|
+
import type { Context } from './types.ts';
|
|
3
|
+
import { Router } from './router.ts';
|
|
4
|
+
export interface GraphQLOptions {
|
|
5
|
+
schema: string | GraphQLSchema;
|
|
6
|
+
rootValue?: any;
|
|
7
|
+
resolvers?: any;
|
|
8
|
+
context?: (req: Request, ctx: Context) => Record<string, any> | Promise<Record<string, any>>;
|
|
9
|
+
graphiql?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export type GraphQLHandler = (req: Request, ctx: Context) => GraphQLOptions | Promise<GraphQLOptions>;
|
|
12
|
+
export declare function graphql(handler: GraphQLHandler): Router;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export type { Context, Handler, Middleware, ErrorHandler } from './types.ts';
|
|
|
2
2
|
export { serve } from './serve.ts';
|
|
3
3
|
export type { ServeOptions, Server } from './serve.ts';
|
|
4
4
|
export { Router } from './router.ts';
|
|
5
|
-
export type { WebSocketHandler
|
|
5
|
+
export type { WebSocketHandler } from './router.ts';
|
|
6
6
|
export { tsx, TsxContext, useTsx } from './tsx.ts';
|
|
7
7
|
export type { TsxOptions } from './tsx.ts';
|
|
8
8
|
export { auth, cors, logger } from './middleware.ts';
|
|
@@ -19,5 +19,11 @@ export { rateLimit } from './rate-limit.ts';
|
|
|
19
19
|
export type { RateLimitOptions } from './rate-limit.ts';
|
|
20
20
|
export { compress } from './compress.ts';
|
|
21
21
|
export type { CompressOptions } from './compress.ts';
|
|
22
|
-
export {
|
|
23
|
-
export type {
|
|
22
|
+
export { graphql } from './graphql.ts';
|
|
23
|
+
export type { GraphQLOptions, GraphQLHandler } from './graphql.ts';
|
|
24
|
+
export { ai } from './ai.ts';
|
|
25
|
+
export type { AIHandler } from './ai.ts';
|
|
26
|
+
export { tool, createWorkflowEngine, createSSEManager, generateWorkflow, workflow } from './workflow/index.ts';
|
|
27
|
+
export type { Tool, Workflow, WorkflowEngine, WorkflowState, SSEEvent, WorkflowOptions, WorkflowHandler } from './workflow/index.ts';
|
|
28
|
+
export { postgres } from './postgres/index.ts';
|
|
29
|
+
export type { PostgresOptions, PostgresClient, TableProxy, ListOptions, TableBuilder } from './postgres/types.ts';
|