@kevisual/router 0.2.6 → 0.2.7

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/dist/app.js CHANGED
@@ -17915,6 +17915,9 @@ class QueryRouterServer extends QueryRouter {
17915
17915
  }
17916
17916
  return super.run(msg, ctx);
17917
17917
  }
17918
+ async runLocal(msg, ctx) {
17919
+ return this.run(msg, { ...ctx, appId: this.appId });
17920
+ }
17918
17921
  async runAction(api2, payload, ctx) {
17919
17922
  const { path, key, rid } = api2;
17920
17923
  return this.run({ path, key, rid, payload }, ctx);
@@ -18900,7 +18903,7 @@ class App extends QueryRouterServer {
18900
18903
  }
18901
18904
  }
18902
18905
 
18903
- // ../../node_modules/.pnpm/@kevisual+context@0.0.8/node_modules/@kevisual/context/dist/app.js
18906
+ // ../../node_modules/.pnpm/@kevisual+context@0.0.10/node_modules/@kevisual/context/dist/app.js
18904
18907
  var isBrowser22 = typeof window !== "undefined" && typeof window.document !== "undefined";
18905
18908
  function getDefaultExportFromCjs(x) {
18906
18909
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -20109,7 +20112,7 @@ app
20109
20112
  10. **中间件找不到会返回 404**,错误信息中会包含找不到的中间件列表。
20110
20113
  `;
20111
20114
  // package.json
20112
- var version2 = "0.2.5";
20115
+ var version2 = "0.2.6";
20113
20116
 
20114
20117
  // agent/routes/route-create.ts
20115
20118
  app.route({
@@ -449,6 +449,20 @@ declare class QueryRouterServer<C extends SimpleObject = SimpleObject> extends Q
449
449
  token?: string;
450
450
  data?: any;
451
451
  }, ctx?: Partial<RouteContext<C>>): Promise<any>;
452
+ /**
453
+ * 调用了handle
454
+ * @param param0
455
+ * @returns
456
+ */
457
+ runLocal(msg: {
458
+ rid?: string;
459
+ path?: string;
460
+ key?: string;
461
+ payload?: any;
462
+ args?: any;
463
+ token?: string;
464
+ data?: any;
465
+ }, ctx?: Partial<RouteContext<C>>): Promise<any>;
452
466
  runAction<T extends {
453
467
  rid?: string;
454
468
  path?: string;
@@ -449,6 +449,20 @@ declare class QueryRouterServer<C extends SimpleObject = SimpleObject> extends Q
449
449
  token?: string;
450
450
  data?: any;
451
451
  }, ctx?: Partial<RouteContext<C>>): Promise<any>;
452
+ /**
453
+ * 调用了handle
454
+ * @param param0
455
+ * @returns
456
+ */
457
+ runLocal(msg: {
458
+ rid?: string;
459
+ path?: string;
460
+ key?: string;
461
+ payload?: any;
462
+ args?: any;
463
+ token?: string;
464
+ data?: any;
465
+ }, ctx?: Partial<RouteContext<C>>): Promise<any>;
452
466
  runAction<T extends {
453
467
  rid?: string;
454
468
  path?: string;
package/dist/opencode.js CHANGED
@@ -685,7 +685,7 @@ var require_md5 = __commonJS((exports, module) => {
685
685
  });
686
686
  });
687
687
 
688
- // ../../node_modules/.pnpm/@kevisual+context@0.0.8/node_modules/@kevisual/context/dist/app.js
688
+ // ../../node_modules/.pnpm/@kevisual+context@0.0.10/node_modules/@kevisual/context/dist/app.js
689
689
  var isBrowser2 = typeof window !== "undefined" && typeof window.document !== "undefined";
690
690
  function getDefaultExportFromCjs(x) {
691
691
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -505,6 +505,20 @@ declare class QueryRouterServer<C extends SimpleObject$1 = SimpleObject$1> exten
505
505
  token?: string;
506
506
  data?: any;
507
507
  }, ctx?: Partial<RouteContext<C>>): Promise<any>;
508
+ /**
509
+ * 调用了handle
510
+ * @param param0
511
+ * @returns
512
+ */
513
+ runLocal(msg: {
514
+ rid?: string;
515
+ path?: string;
516
+ key?: string;
517
+ payload?: any;
518
+ args?: any;
519
+ token?: string;
520
+ data?: any;
521
+ }, ctx?: Partial<RouteContext<C>>): Promise<any>;
508
522
  runAction<T extends {
509
523
  rid?: string;
510
524
  path?: string;
@@ -33179,6 +33179,9 @@ class QueryRouterServer extends QueryRouter {
33179
33179
  }
33180
33180
  return super.run(msg, ctx);
33181
33181
  }
33182
+ async runLocal(msg, ctx) {
33183
+ return this.run(msg, { ...ctx, appId: this.appId });
33184
+ }
33182
33185
  async runAction(api2, payload, ctx) {
33183
33186
  const { path, key, rid } = api2;
33184
33187
  return this.run({ path, key, rid, payload }, ctx);
@@ -446,6 +446,20 @@ declare class QueryRouterServer<C extends SimpleObject$1 = SimpleObject$1> exten
446
446
  token?: string;
447
447
  data?: any;
448
448
  }, ctx?: Partial<RouteContext<C>>): Promise<any>;
449
+ /**
450
+ * 调用了handle
451
+ * @param param0
452
+ * @returns
453
+ */
454
+ runLocal(msg: {
455
+ rid?: string;
456
+ path?: string;
457
+ key?: string;
458
+ payload?: any;
459
+ args?: any;
460
+ token?: string;
461
+ data?: any;
462
+ }, ctx?: Partial<RouteContext<C>>): Promise<any>;
449
463
  runAction<T extends {
450
464
  rid?: string;
451
465
  path?: string;
package/dist/router.d.ts CHANGED
@@ -511,6 +511,20 @@ declare class QueryRouterServer<C extends SimpleObject$1 = SimpleObject$1> exten
511
511
  token?: string;
512
512
  data?: any;
513
513
  }, ctx?: Partial<RouteContext<C>>): Promise<any>;
514
+ /**
515
+ * 调用了handle
516
+ * @param param0
517
+ * @returns
518
+ */
519
+ runLocal(msg: {
520
+ rid?: string;
521
+ path?: string;
522
+ key?: string;
523
+ payload?: any;
524
+ args?: any;
525
+ token?: string;
526
+ data?: any;
527
+ }, ctx?: Partial<RouteContext<C>>): Promise<any>;
514
528
  runAction<T extends {
515
529
  rid?: string;
516
530
  path?: string;
package/dist/router.js CHANGED
@@ -17912,6 +17912,9 @@ class QueryRouterServer extends QueryRouter {
17912
17912
  }
17913
17913
  return super.run(msg, ctx);
17914
17914
  }
17915
+ async runLocal(msg, ctx) {
17916
+ return this.run(msg, { ...ctx, appId: this.appId });
17917
+ }
17915
17918
  async runAction(api2, payload, ctx) {
17916
17919
  const { path, key, rid } = api2;
17917
17920
  return this.run({ path, key, rid, payload }, ctx);
package/dist/ws.d.ts CHANGED
@@ -496,6 +496,20 @@ declare class QueryRouterServer<C extends SimpleObject = SimpleObject> extends Q
496
496
  token?: string;
497
497
  data?: any;
498
498
  }, ctx?: Partial<RouteContext<C>>): Promise<any>;
499
+ /**
500
+ * 调用了handle
501
+ * @param param0
502
+ * @returns
503
+ */
504
+ runLocal(msg: {
505
+ rid?: string;
506
+ path?: string;
507
+ key?: string;
508
+ payload?: any;
509
+ args?: any;
510
+ token?: string;
511
+ data?: any;
512
+ }, ctx?: Partial<RouteContext<C>>): Promise<any>;
499
513
  runAction<T extends {
500
514
  rid?: string;
501
515
  path?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@kevisual/router",
4
- "version": "0.2.6",
4
+ "version": "0.2.7",
5
5
  "description": "",
6
6
  "type": "module",
7
7
  "main": "./dist/router.js",
package/src/route.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CustomError, throwError, CustomErrorOptions } from './result/error.ts';
1
+ import { CustomError, throwError } from './result/error.ts';
2
2
  import { pick } from './utils/pick.ts';
3
3
  import { listenProcess, MockProcess } from './utils/listen-process.ts';
4
4
  import { z } from 'zod';
@@ -773,7 +773,14 @@ export class QueryRouterServer<C extends SimpleObject = SimpleObject> extends Qu
773
773
  }
774
774
  return super.run(msg, ctx as RouteContext<C>);
775
775
  }
776
-
776
+ /**
777
+ * 调用了handle
778
+ * @param param0
779
+ * @returns
780
+ */
781
+ async runLocal(msg: { rid?: string; path?: string; key?: string; payload?: any, args?: any, token?: string, data?: any }, ctx?: Partial<RouteContext<C>>) {
782
+ return this.run(msg, { ...ctx, appId: this.appId } as RouteContext<C>);
783
+ }
777
784
  async runAction<T extends { rid?: string; path?: string; key?: string; metadata?: { args?: any } } = {}>(
778
785
  api: T,
779
786
  payload: RunActionPayload<T>,