@dnax/core 0.16.1 → 0.16.2
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 -1
- package/lib/scripts/index.ts +2 -0
- package/package.json +1 -1
- package/types/index.ts +6 -1
package/app/hono.ts
CHANGED
package/lib/scripts/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Glob } from "bun";
|
|
|
3
3
|
import { Cfg } from "../../config";
|
|
4
4
|
import path from "path";
|
|
5
5
|
import type { cronConfig } from "../../types";
|
|
6
|
+
import { app } from "../../app/hono";
|
|
6
7
|
import cleanDeep from "clean-deep";
|
|
7
8
|
import { useRest } from "../../driver/mongo";
|
|
8
9
|
async function initScript() {
|
|
@@ -21,6 +22,7 @@ async function initScript() {
|
|
|
21
22
|
if (scriptInject?.ok && scriptInject?.enabled) {
|
|
22
23
|
setTimeout(() => {
|
|
23
24
|
scriptInject.exec({
|
|
25
|
+
router: app,
|
|
24
26
|
io: Cfg.io,
|
|
25
27
|
rest: new useRest({
|
|
26
28
|
tenant_id: t.id,
|
package/package.json
CHANGED
package/types/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Cron } from "croner";
|
|
|
3
3
|
import { updateParams } from "./../driver/mongo/@types";
|
|
4
4
|
import * as v from "valibot";
|
|
5
5
|
import type { Db, MongoClient } from "mongodb";
|
|
6
|
+
|
|
6
7
|
import { useRest } from "../driver/mongo/rest";
|
|
7
8
|
import { sessionStorage } from "../lib/asyncLocalStorage";
|
|
8
9
|
import type { Context, Hono } from "hono";
|
|
@@ -480,7 +481,11 @@ export type routeCtx = {
|
|
|
480
481
|
|
|
481
482
|
type scriptCtx = {
|
|
482
483
|
enabled: boolean;
|
|
483
|
-
exec: (ctx: {
|
|
484
|
+
exec: (ctx: {
|
|
485
|
+
rest: InstanceType<typeof useRest>;
|
|
486
|
+
io: socketIoType;
|
|
487
|
+
router: Hono;
|
|
488
|
+
}) => any;
|
|
484
489
|
};
|
|
485
490
|
|
|
486
491
|
export type Endpoint = endpointCtx;
|