@dnax/core 0.16.0 → 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 CHANGED
@@ -583,4 +583,4 @@ function HonoInstance(): typeof app {
583
583
  return app;
584
584
  }
585
585
 
586
- export { HonoInstance };
586
+ export { HonoInstance, app };
@@ -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() {
@@ -18,9 +19,10 @@ async function initScript() {
18
19
  await import(fullPathFile)
19
20
  .then((inject) => {
20
21
  let scriptInject = inject.default;
21
- if (scriptInject?.ok) {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.16.0",
3
+ "version": "0.16.2",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {
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: { rest: InstanceType<typeof useRest>; io: socketIoType }) => any;
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;