service-bridge 1.8.5-dev.49 → 2.0.0-alpha
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/LICENSE +21 -0
- package/README.md +386 -1053
- package/dist/http/express/index.d.ts +31 -0
- package/dist/http/express/index.js +2765 -0
- package/dist/http/express/index.js.map +1 -0
- package/dist/http/fastify/index.d.ts +38 -0
- package/dist/http/fastify/index.js +2726 -0
- package/dist/http/fastify/index.js.map +1 -0
- package/dist/http/hono/index.d.ts +39 -0
- package/dist/http/hono/index.js +2706 -0
- package/dist/http/hono/index.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +14907 -2722
- package/dist/index.js.map +1 -0
- package/dist/service-bridge-CPmirNES.d.ts +2261 -0
- package/package.json +107 -123
- package/dist/express.d.ts +0 -51
- package/dist/express.js +0 -129
- package/dist/fastify.d.ts +0 -43
- package/dist/fastify.js +0 -122
- package/dist/trace.d.ts +0 -19
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Express } from 'express';
|
|
2
|
+
import { p as ServiceBridge } from '../../service-bridge-CPmirNES.js';
|
|
3
|
+
import '@grpc/grpc-js';
|
|
4
|
+
import '@bufbuild/protobuf/wire';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Endpoint, на котором фактически слушает Express-сервер. `port` обязателен:
|
|
8
|
+
* Express может биндиться на 0 и в момент сбора роутов фактический порт не
|
|
9
|
+
* известен — пользователь его передаёт явно. `host` опционален, fallback —
|
|
10
|
+
* `resolveHttpAdvertiseHost()`.
|
|
11
|
+
*
|
|
12
|
+
* @public — см. ./README.md
|
|
13
|
+
*/
|
|
14
|
+
interface ExpressEndpoint {
|
|
15
|
+
host?: string;
|
|
16
|
+
port: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Подключает Express-приложение к `ServiceBridge`: обходит router stack
|
|
20
|
+
* (включая sub-routers), собирает роуты в `sb.routes`, и публикует
|
|
21
|
+
* HTTP-endpoint (`host:port`). Симметрично `attachHono`. Идемпотентен по
|
|
22
|
+
* сбору роутов (дедуп в `RouteCollector`).
|
|
23
|
+
*
|
|
24
|
+
* Безопасен и до `sb.start()` — endpoint осядет в Registry и попадёт в
|
|
25
|
+
* первый RegisterRequest.
|
|
26
|
+
*
|
|
27
|
+
* @public — см. ./README.md
|
|
28
|
+
*/
|
|
29
|
+
declare function attachExpress(app: Express, sb: ServiceBridge, endpoint: ExpressEndpoint): void;
|
|
30
|
+
|
|
31
|
+
export { type ExpressEndpoint, attachExpress };
|