@teamscala/service-boot 0.23.543 → 0.23.544
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/package.json +18 -18
- package/src/mount-orpc-router.ts +2 -25
package/package.json
CHANGED
|
@@ -4,13 +4,30 @@
|
|
|
4
4
|
"status": "generated",
|
|
5
5
|
"edit": "edit src/ — dependencies and exports derive from imports; everything else preserved"
|
|
6
6
|
},
|
|
7
|
+
"files": [
|
|
8
|
+
"src"
|
|
9
|
+
],
|
|
10
|
+
"imports": {
|
|
11
|
+
"#service-boot/*": "./src/*",
|
|
12
|
+
"#service-boot/*.ts": "./src/*.ts"
|
|
13
|
+
},
|
|
14
|
+
"name": "@teamscala/service-boot",
|
|
15
|
+
"capability": "Lower-tier boot stages composed by service-runtime — page-server SSR, asset proxy, hono pipeline, agreement gate (no-shadow-runtime-exports: only service-runtime composes them).",
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"@teamscala/chat-completion": "*"
|
|
18
|
+
},
|
|
19
|
+
"peerDependenciesMeta": {
|
|
20
|
+
"@teamscala/chat-completion": {
|
|
21
|
+
"optional": true
|
|
22
|
+
}
|
|
23
|
+
},
|
|
7
24
|
"publishConfig": {
|
|
8
25
|
"registry": "https://registry.npmjs.org"
|
|
9
26
|
},
|
|
10
27
|
"repository": "https://github.com/teamgbg/service-boot",
|
|
11
28
|
"sideEffects": false,
|
|
12
29
|
"type": "module",
|
|
13
|
-
"version": "0.23.
|
|
30
|
+
"version": "0.23.544",
|
|
14
31
|
"dependencies": {
|
|
15
32
|
"@orpc/openapi": "*",
|
|
16
33
|
"@orpc/server": "*",
|
|
@@ -292,22 +309,5 @@
|
|
|
292
309
|
"./ui-service.ts": "./src/ui-service.ts",
|
|
293
310
|
"./ws-boot-self-test": "./src/ws-boot-self-test.ts",
|
|
294
311
|
"./ws-boot-self-test.ts": "./src/ws-boot-self-test.ts"
|
|
295
|
-
},
|
|
296
|
-
"files": [
|
|
297
|
-
"src"
|
|
298
|
-
],
|
|
299
|
-
"imports": {
|
|
300
|
-
"#service-boot/*": "./src/*",
|
|
301
|
-
"#service-boot/*.ts": "./src/*.ts"
|
|
302
|
-
},
|
|
303
|
-
"name": "@teamscala/service-boot",
|
|
304
|
-
"capability": "Lower-tier boot stages composed by service-runtime — page-server SSR, asset proxy, hono pipeline, agreement gate (no-shadow-runtime-exports: only service-runtime composes them).",
|
|
305
|
-
"peerDependencies": {
|
|
306
|
-
"@teamscala/chat-completion": "*"
|
|
307
|
-
},
|
|
308
|
-
"peerDependenciesMeta": {
|
|
309
|
-
"@teamscala/chat-completion": {
|
|
310
|
-
"optional": true
|
|
311
|
-
}
|
|
312
312
|
}
|
|
313
313
|
}
|
package/src/mount-orpc-router.ts
CHANGED
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { getAppLogger } from "@teamscala/logger/app-loggers";
|
|
8
|
-
import type { Db8Client } from "@teamscala/db/db8-registry";
|
|
9
|
-
import { resolveDbUrlOrNull } from "@teamscala/db/db-url";
|
|
10
8
|
import type { Hono } from "hono";
|
|
11
9
|
import { bodyLimit } from "hono/body-limit";
|
|
12
10
|
import { openApiContractAuthorised } from "./orpc-openapi-gate.ts";
|
|
@@ -98,27 +96,6 @@ export async function mountOrpcRouter(
|
|
|
98
96
|
"@teamscala/orpc/configure"
|
|
99
97
|
);
|
|
100
98
|
|
|
101
|
-
let db8: Db8Client | undefined;
|
|
102
|
-
try {
|
|
103
|
-
const databaseUrl = resolveDbUrlOrNull("tenant");
|
|
104
|
-
if (databaseUrl) {
|
|
105
|
-
const { createDbClientV8 } = await import(
|
|
106
|
-
"@teamscala/db/create-db-client-v8"
|
|
107
|
-
);
|
|
108
|
-
db8 = (await createDbClientV8({
|
|
109
|
-
connectionString: databaseUrl,
|
|
110
|
-
serviceName: serviceSlug,
|
|
111
|
-
})) as never;
|
|
112
|
-
const { registerDb8 } = await import("@teamscala/db/db8-registry");
|
|
113
|
-
registerDb8(db8 as never);
|
|
114
|
-
}
|
|
115
|
-
} catch (err) {
|
|
116
|
-
log.info(
|
|
117
|
-
`[scala-install:${serviceSlug}] db8 (Prisma 8 chained client) unavailable: ${err instanceof Error ? err.message : err} — serving v7 procedures only`,
|
|
118
|
-
);
|
|
119
|
-
db8 = undefined;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
99
|
const { configure: configureToolExecutor } = await import(
|
|
123
100
|
"@teamscala/tool-executor/configure"
|
|
124
101
|
);
|
|
@@ -203,7 +180,7 @@ export async function mountOrpcRouter(
|
|
|
203
180
|
const prisma = getConfiguredPrisma();
|
|
204
181
|
const result = await handler.handle(c.req.raw, {
|
|
205
182
|
prefix: "/api/rpc",
|
|
206
|
-
context: { prisma,
|
|
183
|
+
context: { prisma, headers: c.req.raw.headers, resolveUser },
|
|
207
184
|
});
|
|
208
185
|
if (!result?.matched) return c.notFound();
|
|
209
186
|
if (result.response.status >= 500) {
|
|
@@ -224,7 +201,7 @@ export async function mountOrpcRouter(
|
|
|
224
201
|
async (c) => {
|
|
225
202
|
const result = await openApiHandler.handle(c.req.raw, {
|
|
226
203
|
prefix: "/api/openapi",
|
|
227
|
-
context: { prisma: getConfiguredPrisma(),
|
|
204
|
+
context: { prisma: getConfiguredPrisma(), headers: c.req.raw.headers, resolveUser },
|
|
228
205
|
});
|
|
229
206
|
return result.matched ? result.response : c.notFound();
|
|
230
207
|
},
|