@radaros/transport 0.1.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/dist/index.d.ts +82 -0
- package/dist/index.js +728 -0
- package/package.json +47 -0
- package/src/express/file-upload.ts +88 -0
- package/src/express/middleware.ts +15 -0
- package/src/express/router-factory.ts +208 -0
- package/src/express/swagger.ts +424 -0
- package/src/express/types.ts +32 -0
- package/src/index.ts +9 -0
- package/src/socketio/gateway.ts +75 -0
- package/src/socketio/handlers.ts +1 -0
- package/src/socketio/types.ts +9 -0
- package/tsconfig.json +11 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Agent, Team, Workflow } from '@radaros/core';
|
|
2
|
+
|
|
3
|
+
interface FileUploadOptions {
|
|
4
|
+
maxFileSize?: number;
|
|
5
|
+
maxFiles?: number;
|
|
6
|
+
allowedMimeTypes?: string[];
|
|
7
|
+
}
|
|
8
|
+
declare function createFileUploadMiddleware(opts?: FileUploadOptions): any;
|
|
9
|
+
declare function buildMultiModalInput(body: any, files?: any[]): string | any[];
|
|
10
|
+
|
|
11
|
+
interface SwaggerOptions {
|
|
12
|
+
/** Enable Swagger UI at /docs. Default: false */
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
/** API title shown in Swagger UI */
|
|
15
|
+
title?: string;
|
|
16
|
+
/** API description shown in Swagger UI */
|
|
17
|
+
description?: string;
|
|
18
|
+
/** API version string */
|
|
19
|
+
version?: string;
|
|
20
|
+
/** Route prefix used in path generation (e.g. "/api") */
|
|
21
|
+
routePrefix?: string;
|
|
22
|
+
/** Server URLs for the spec */
|
|
23
|
+
servers?: Array<{
|
|
24
|
+
url: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
}>;
|
|
27
|
+
/** Path to serve Swagger UI. Default: "/docs" */
|
|
28
|
+
docsPath?: string;
|
|
29
|
+
/** Path to serve the raw OpenAPI JSON spec. Default: "/docs/spec.json" */
|
|
30
|
+
specPath?: string;
|
|
31
|
+
}
|
|
32
|
+
interface RouterOptions {
|
|
33
|
+
agents?: Record<string, Agent>;
|
|
34
|
+
teams?: Record<string, Team>;
|
|
35
|
+
workflows?: Record<string, Workflow<any>>;
|
|
36
|
+
middleware?: any[];
|
|
37
|
+
/** Swagger / OpenAPI configuration */
|
|
38
|
+
swagger?: SwaggerOptions;
|
|
39
|
+
/** File upload configuration for multi-modal inputs */
|
|
40
|
+
fileUpload?: boolean | FileUploadOptions;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare function createAgentRouter(opts: RouterOptions): any;
|
|
44
|
+
|
|
45
|
+
declare function errorHandler(): (err: any, _req: any, res: any, _next: any) => void;
|
|
46
|
+
declare function requestLogger(): (req: any, _res: any, next: any) => void;
|
|
47
|
+
|
|
48
|
+
interface OpenAPISpec {
|
|
49
|
+
openapi: string;
|
|
50
|
+
info: {
|
|
51
|
+
title: string;
|
|
52
|
+
description: string;
|
|
53
|
+
version: string;
|
|
54
|
+
};
|
|
55
|
+
servers?: Array<{
|
|
56
|
+
url: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
}>;
|
|
59
|
+
paths: Record<string, Record<string, unknown>>;
|
|
60
|
+
components: {
|
|
61
|
+
schemas: Record<string, unknown>;
|
|
62
|
+
securitySchemes?: Record<string, unknown>;
|
|
63
|
+
};
|
|
64
|
+
security?: Array<Record<string, string[]>>;
|
|
65
|
+
tags: Array<{
|
|
66
|
+
name: string;
|
|
67
|
+
description: string;
|
|
68
|
+
}>;
|
|
69
|
+
}
|
|
70
|
+
declare function generateOpenAPISpec(routerOpts: RouterOptions, swaggerOpts?: SwaggerOptions): OpenAPISpec;
|
|
71
|
+
|
|
72
|
+
interface GatewayOptions {
|
|
73
|
+
agents?: Record<string, Agent>;
|
|
74
|
+
teams?: Record<string, Team>;
|
|
75
|
+
io: any;
|
|
76
|
+
namespace?: string;
|
|
77
|
+
authMiddleware?: (socket: any, next: (err?: Error) => void) => void;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
declare function createAgentGateway(opts: GatewayOptions): void;
|
|
81
|
+
|
|
82
|
+
export { type FileUploadOptions, type GatewayOptions, type RouterOptions, type SwaggerOptions, buildMultiModalInput, createAgentGateway, createAgentRouter, createFileUploadMiddleware, errorHandler, generateOpenAPISpec, requestLogger };
|