@dnax/core 0.12.4 → 0.12.5
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/app/hono.ts +1 -0
- package/lib/routes.ts +2 -1
- package/package.json +1 -1
- package/types/index.ts +2 -0
package/app/hono.ts
CHANGED
package/lib/routes.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Hono } from "hono";
|
|
|
9
9
|
async function loadAutoRoutes() {
|
|
10
10
|
let endpoints = [] as any;
|
|
11
11
|
if (Cfg?.tenants) {
|
|
12
|
-
for await (let t of Cfg
|
|
12
|
+
for await (let t of Cfg?.tenants) {
|
|
13
13
|
let tenantPath = `${t.dir}/routes/**/*.{ts,js}`;
|
|
14
14
|
const glob = new Glob(tenantPath);
|
|
15
15
|
for await (let file of glob.scan({
|
|
@@ -31,6 +31,7 @@ async function loadAutoRoutes() {
|
|
|
31
31
|
router: new Hono(),
|
|
32
32
|
};
|
|
33
33
|
inject?.default?.handler({
|
|
34
|
+
tenant_id: t.id,
|
|
34
35
|
io: Cfg.io,
|
|
35
36
|
router: instance.router,
|
|
36
37
|
});
|
package/package.json
CHANGED
package/types/index.ts
CHANGED
|
@@ -444,6 +444,7 @@ export type routeOption = {
|
|
|
444
444
|
export type endpointCtx = {
|
|
445
445
|
enabled: boolean;
|
|
446
446
|
handler: (ctx: {
|
|
447
|
+
rest: InstanceType<typeof useRest>;
|
|
447
448
|
io: Io;
|
|
448
449
|
router: {
|
|
449
450
|
post: (path: string, clb: (c: Context) => void) => {};
|
|
@@ -455,6 +456,7 @@ export type endpointCtx = {
|
|
|
455
456
|
export type routeCtx = {
|
|
456
457
|
enabled: boolean;
|
|
457
458
|
handler: (ctx: {
|
|
459
|
+
rest: InstanceType<typeof useRest>;
|
|
458
460
|
io: Io;
|
|
459
461
|
router: {
|
|
460
462
|
post: (path: string, clb: (c: Context) => void) => {};
|