phecda-server 5.0.2 → 5.1.1

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.
Files changed (57) hide show
  1. package/README.md +4 -102
  2. package/bin/cli.mjs +17 -14
  3. package/dist/{chunk-RCTOVYZY.mjs → chunk-2HKQPZDT.mjs} +1 -1
  4. package/dist/{chunk-BXLBWRHS.js → chunk-3BV2GRS7.js} +38 -38
  5. package/dist/{chunk-AB4OX3WV.mjs → chunk-665MB62T.mjs} +127 -99
  6. package/dist/{chunk-YERBWZCS.js → chunk-FSBD5R22.js} +180 -152
  7. package/dist/{chunk-F5YWXY5W.js → chunk-HMPTPTFL.js} +17 -17
  8. package/dist/{chunk-W5EOVGQD.mjs → chunk-UU6RHGRF.mjs} +2 -2
  9. package/dist/{chunk-ITTD2GBR.mjs → chunk-VLV3AO3H.mjs} +7 -19
  10. package/dist/{chunk-YR5Q5F2K.js → chunk-ZP7HNASU.js} +7 -19
  11. package/dist/{core-fd134ffa.d.ts → core-39f27fe8.d.ts} +4 -3
  12. package/dist/{helper-73e8d2f0.d.ts → helper-6133f78f.d.ts} +1 -1
  13. package/dist/{helper-f29f082f.d.ts → helper-fcbf6aa8.d.ts} +4 -3
  14. package/dist/index.d.ts +27 -32
  15. package/dist/index.js +44 -40
  16. package/dist/index.mjs +14 -10
  17. package/dist/rpc/bullmq/index.d.ts +10 -6
  18. package/dist/rpc/bullmq/index.js +32 -53
  19. package/dist/rpc/bullmq/index.mjs +26 -47
  20. package/dist/rpc/kafka/index.d.ts +10 -4
  21. package/dist/rpc/kafka/index.js +20 -37
  22. package/dist/rpc/kafka/index.mjs +15 -32
  23. package/dist/rpc/nats/index.d.ts +2 -2
  24. package/dist/rpc/nats/index.js +20 -34
  25. package/dist/rpc/nats/index.mjs +13 -27
  26. package/dist/rpc/rabbitmq/index.d.ts +2 -2
  27. package/dist/rpc/rabbitmq/index.js +23 -37
  28. package/dist/rpc/rabbitmq/index.mjs +14 -28
  29. package/dist/rpc/redis/index.d.ts +10 -4
  30. package/dist/rpc/redis/index.js +23 -37
  31. package/dist/rpc/redis/index.mjs +16 -30
  32. package/dist/server/elysia/index.d.ts +4 -3
  33. package/dist/server/elysia/index.js +77 -94
  34. package/dist/server/elysia/index.mjs +74 -91
  35. package/dist/server/express/index.d.ts +5 -4
  36. package/dist/server/express/index.js +79 -93
  37. package/dist/server/express/index.mjs +77 -91
  38. package/dist/server/fastify/index.d.ts +8 -5
  39. package/dist/server/fastify/index.js +83 -102
  40. package/dist/server/fastify/index.mjs +79 -98
  41. package/dist/server/h3/index.d.ts +5 -4
  42. package/dist/server/h3/index.js +81 -97
  43. package/dist/server/h3/index.mjs +80 -96
  44. package/dist/server/hono/index.d.ts +5 -4
  45. package/dist/server/hono/index.js +73 -90
  46. package/dist/server/hono/index.mjs +72 -89
  47. package/dist/server/hyper-express/index.d.ts +6 -5
  48. package/dist/server/hyper-express/index.js +78 -96
  49. package/dist/server/hyper-express/index.mjs +77 -95
  50. package/dist/server/koa/index.d.ts +5 -4
  51. package/dist/server/koa/index.js +79 -92
  52. package/dist/server/koa/index.mjs +76 -89
  53. package/dist/test.d.ts +1 -1
  54. package/dist/test.js +6 -6
  55. package/dist/test.mjs +2 -2
  56. package/package.json +9 -8
  57. package/register/loader.mjs +19 -5
@@ -1,131 +1,112 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkBXLBWRHSjs = require('../../chunk-BXLBWRHS.js');
3
+ var _chunk3BV2GRS7js = require('../../chunk-3BV2GRS7.js');
4
4
 
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _chunkYERBWZCSjs = require('../../chunk-YERBWZCS.js');
10
+ var _chunkFSBD5R22js = require('../../chunk-FSBD5R22.js');
11
11
 
12
12
 
13
- var _chunkYR5Q5F2Kjs = require('../../chunk-YR5Q5F2K.js');
13
+ var _chunkZP7HNASUjs = require('../../chunk-ZP7HNASU.js');
14
14
 
15
15
  // src/server/fastify/bind.ts
16
16
  var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
17
17
  var debug = _debug2.default.call(void 0, "phecda-server/fastify");
18
- function bind(data, opts = {}) {
19
- const { globalGuards, globalInterceptors, route, plugins, globalFilter, globalPipe } = {
20
- route: "/__PHECDA_SERVER__",
21
- plugins: [],
22
- ...opts
23
- };
18
+ function bind(fastify, data, opts = {}) {
19
+ const { globalGuards, globalInterceptors, parallelRoute = "/__PHECDA_SERVER__", globalPlugins = [], parallelPlugins = [], globalFilter, globalPipe, fastifyOpts } = opts;
24
20
  const { moduleMap, meta } = data;
25
- const metaMap = /* @__PURE__ */ new Map();
26
- function handleMeta() {
27
- metaMap.clear();
28
- for (const item of meta) {
29
- const { tag, func, controller, http } = item.data;
30
- if (controller !== "http" || !_optionalChain([http, 'optionalAccess', _2 => _2.type]))
31
- continue;
21
+ const metaMap = _chunkFSBD5R22js.createControllerMetaMap.call(void 0, meta, (meta2) => {
22
+ const { controller, http, func, tag } = meta2.data;
23
+ if (controller === "http" && _optionalChain([http, 'optionalAccess', _2 => _2.type])) {
32
24
  debug(`register method "${func}" in module "${tag}"`);
33
- if (metaMap.has(tag))
34
- metaMap.get(tag)[func] = item;
35
- else
36
- metaMap.set(tag, {
37
- [func]: item
38
- });
25
+ return true;
39
26
  }
40
- }
41
- _chunkYR5Q5F2Kjs.__name.call(void 0, handleMeta, "handleMeta");
42
- _chunkYERBWZCSjs.detectAopDep.call(void 0, meta, {
43
- plugins,
27
+ });
28
+ _chunkFSBD5R22js.detectAopDep.call(void 0, meta, {
29
+ plugins: [
30
+ ...globalPlugins,
31
+ ...parallelPlugins
32
+ ],
44
33
  guards: globalGuards,
45
34
  interceptors: globalInterceptors
46
35
  });
47
- handleMeta();
48
- _chunkYERBWZCSjs.HMR.call(void 0, async () => {
49
- _chunkYERBWZCSjs.detectAopDep.call(void 0, meta, {
50
- plugins,
51
- guards: globalGuards,
52
- interceptors: globalInterceptors
36
+ fastify.register((fastify2, _, done) => {
37
+ _chunkFSBD5R22js.Context.usePlugin(globalPlugins, "fastify").forEach((p) => {
38
+ p[Symbol.for("skip-override")] = true;
39
+ fastify2.register(p);
53
40
  });
54
- handleMeta();
55
- });
56
- return (fastify, _, done) => {
57
- fastify.register((fastify2, _opts, done2) => {
58
- plugins.forEach((p) => {
59
- const plugin = _chunkYERBWZCSjs.Context.usePlugin([
60
- p
61
- ])[0];
62
- if (plugin) {
63
- plugin[Symbol.for("skip-override")] = true;
64
- fastify2.register(plugin);
65
- }
41
+ fastify2.register((fastify3, _opts, done2) => {
42
+ _chunkFSBD5R22js.Context.usePlugin(parallelPlugins, "fastify").forEach((p) => {
43
+ p[Symbol.for("skip-override")] = true;
44
+ fastify3.register(p);
66
45
  });
67
- fastify2.post(route, async (req, res) => {
68
- const { body } = req;
69
- async function errorHandler(e) {
70
- const error = await _chunkYERBWZCSjs.Context.filterRecord.default(e);
71
- return res.status(error.status).send(error);
72
- }
73
- _chunkYR5Q5F2Kjs.__name.call(void 0, errorHandler, "errorHandler");
74
- if (!Array.isArray(body))
75
- return errorHandler(new (0, _chunkYERBWZCSjs.BadRequestException)("data format should be an array"));
76
- try {
77
- return Promise.all(body.map((item, i) => {
78
- return new Promise(async (resolve) => {
79
- const { tag, func } = item;
80
- debug(`(parallel)invoke method "${func}" in module "${tag}"`);
81
- if (!metaMap.has(tag))
82
- return resolve(await _chunkYERBWZCSjs.Context.filterRecord.default(new (0, _chunkYERBWZCSjs.BadRequestException)(`module "${tag}" doesn't exist`)));
83
- const meta2 = metaMap.get(tag)[func];
84
- if (!meta2)
85
- return resolve(await _chunkYERBWZCSjs.Context.filterRecord.default(new (0, _chunkYERBWZCSjs.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
86
- const { data: { params } } = meta2;
87
- const contextData = {
88
- type: "fastify",
89
- parallel: true,
90
- request: req,
91
- index: i,
92
- meta: meta2,
93
- response: res,
94
- moduleMap,
95
- tag,
96
- func,
97
- app: fastify2,
98
- ..._chunkYERBWZCSjs.argToReq.call(void 0, params, item.args, req.headers)
99
- };
100
- const context = new (0, _chunkYERBWZCSjs.Context)(contextData);
101
- context.run({
102
- globalGuards,
103
- globalInterceptors,
104
- globalFilter,
105
- globalPipe
106
- }, resolve, resolve);
46
+ if (parallelRoute) {
47
+ fastify3.post(parallelRoute, async (req, res) => {
48
+ const { body } = req;
49
+ async function errorHandler(e) {
50
+ const error = await _chunkFSBD5R22js.Context.filterRecord.default(e);
51
+ return res.status(error.status).send(error);
52
+ }
53
+ _chunkZP7HNASUjs.__name.call(void 0, errorHandler, "errorHandler");
54
+ if (!Array.isArray(body))
55
+ return errorHandler(new (0, _chunkFSBD5R22js.BadRequestException)("data format should be an array"));
56
+ try {
57
+ return Promise.all(body.map((item, i) => {
58
+ return new Promise(async (resolve) => {
59
+ const { tag, func } = item;
60
+ debug(`(parallel)invoke method "${func}" in module "${tag}"`);
61
+ if (!metaMap.has(tag))
62
+ return resolve(await _chunkFSBD5R22js.Context.filterRecord.default(new (0, _chunkFSBD5R22js.BadRequestException)(`module "${tag}" doesn't exist`)));
63
+ const meta2 = metaMap.get(tag)[func];
64
+ if (!meta2)
65
+ return resolve(await _chunkFSBD5R22js.Context.filterRecord.default(new (0, _chunkFSBD5R22js.BadRequestException)(`"${func}" in "${tag}" doesn't exist`)));
66
+ const { data: { params } } = meta2;
67
+ const contextData = {
68
+ type: "fastify",
69
+ parallel: true,
70
+ request: req,
71
+ index: i,
72
+ meta: meta2,
73
+ response: res,
74
+ moduleMap,
75
+ tag,
76
+ func,
77
+ app: fastify3,
78
+ ..._chunkFSBD5R22js.argToReq.call(void 0, params, item.args, req.headers)
79
+ };
80
+ const context = new (0, _chunkFSBD5R22js.Context)(contextData);
81
+ context.run({
82
+ globalGuards,
83
+ globalInterceptors,
84
+ globalFilter,
85
+ globalPipe
86
+ }, resolve, resolve);
87
+ });
88
+ })).then((ret) => {
89
+ res.send(ret);
107
90
  });
108
- })).then((ret) => {
109
- res.send(ret);
110
- });
111
- } catch (e) {
112
- return errorHandler(e);
113
- }
114
- });
91
+ } catch (e) {
92
+ return errorHandler(e);
93
+ }
94
+ });
95
+ }
115
96
  done2();
116
97
  });
117
98
  for (const [tag, record] of metaMap) {
118
99
  for (const func in record) {
119
100
  const meta2 = metaMap.get(tag)[func];
120
- const { data: { plugins: plugins2, define, http } } = meta2;
101
+ const { data: { plugins, define, http } } = meta2;
121
102
  if (!_optionalChain([http, 'optionalAccess', _3 => _3.type]))
122
103
  continue;
123
- fastify.register((fastify2, _opts, done2) => {
124
- _chunkYERBWZCSjs.Context.usePlugin(plugins2).forEach((p) => {
104
+ fastify2.register((fastify3, _opts, done2) => {
105
+ _chunkFSBD5R22js.Context.usePlugin(plugins, "fastify").forEach((p) => {
125
106
  p[Symbol.for("skip-override")] = true;
126
- fastify2.register(p);
107
+ fastify3.register(p);
127
108
  });
128
- fastify2[http.type](http.prefix + http.route, _optionalChain([define, 'optionalAccess', _4 => _4.fastify]) || {}, async (req, res) => {
109
+ fastify3[http.type](http.prefix + http.route, _optionalChain([define, 'optionalAccess', _4 => _4.fastify]) || {}, async (req, res) => {
129
110
  debug(`invoke method "${func}" in module "${tag}"`);
130
111
  const contextData = {
131
112
  type: "fastify",
@@ -139,9 +120,9 @@ function bind(data, opts = {}) {
139
120
  body: req.body,
140
121
  params: req.params,
141
122
  headers: req.headers,
142
- app: fastify2
123
+ app: fastify3
143
124
  };
144
- const context = new (0, _chunkYERBWZCSjs.Context)(contextData);
125
+ const context = new (0, _chunkFSBD5R22js.Context)(contextData);
145
126
  if (http.headers) {
146
127
  for (const name in http.headers)
147
128
  res.header(name, http.headers[name]);
@@ -166,13 +147,13 @@ function bind(data, opts = {}) {
166
147
  }
167
148
  }
168
149
  done();
169
- };
150
+ }, fastifyOpts);
170
151
  }
171
- _chunkYR5Q5F2Kjs.__name.call(void 0, bind, "bind");
152
+ _chunkZP7HNASUjs.__name.call(void 0, bind, "bind");
172
153
  function Fastify(opts) {
173
- return _chunkBXLBWRHSjs.Define.call(void 0, "fastify", opts);
154
+ return _chunk3BV2GRS7js.Define.call(void 0, "fastify", opts);
174
155
  }
175
- _chunkYR5Q5F2Kjs.__name.call(void 0, Fastify, "Fastify");
156
+ _chunkZP7HNASUjs.__name.call(void 0, Fastify, "Fastify");
176
157
 
177
158
 
178
159
 
@@ -1,131 +1,112 @@
1
1
  import {
2
2
  Define
3
- } from "../../chunk-W5EOVGQD.mjs";
3
+ } from "../../chunk-UU6RHGRF.mjs";
4
4
  import {
5
5
  BadRequestException,
6
6
  Context,
7
- HMR,
8
7
  argToReq,
8
+ createControllerMetaMap,
9
9
  detectAopDep
10
- } from "../../chunk-AB4OX3WV.mjs";
10
+ } from "../../chunk-665MB62T.mjs";
11
11
  import {
12
12
  __name
13
- } from "../../chunk-ITTD2GBR.mjs";
13
+ } from "../../chunk-VLV3AO3H.mjs";
14
14
 
15
15
  // src/server/fastify/bind.ts
16
16
  import Debug from "debug";
17
17
  var debug = Debug("phecda-server/fastify");
18
- function bind(data, opts = {}) {
19
- const { globalGuards, globalInterceptors, route, plugins, globalFilter, globalPipe } = {
20
- route: "/__PHECDA_SERVER__",
21
- plugins: [],
22
- ...opts
23
- };
18
+ function bind(fastify, data, opts = {}) {
19
+ const { globalGuards, globalInterceptors, parallelRoute = "/__PHECDA_SERVER__", globalPlugins = [], parallelPlugins = [], globalFilter, globalPipe, fastifyOpts } = opts;
24
20
  const { moduleMap, meta } = data;
25
- const metaMap = /* @__PURE__ */ new Map();
26
- function handleMeta() {
27
- metaMap.clear();
28
- for (const item of meta) {
29
- const { tag, func, controller, http } = item.data;
30
- if (controller !== "http" || !http?.type)
31
- continue;
21
+ const metaMap = createControllerMetaMap(meta, (meta2) => {
22
+ const { controller, http, func, tag } = meta2.data;
23
+ if (controller === "http" && http?.type) {
32
24
  debug(`register method "${func}" in module "${tag}"`);
33
- if (metaMap.has(tag))
34
- metaMap.get(tag)[func] = item;
35
- else
36
- metaMap.set(tag, {
37
- [func]: item
38
- });
25
+ return true;
39
26
  }
40
- }
41
- __name(handleMeta, "handleMeta");
27
+ });
42
28
  detectAopDep(meta, {
43
- plugins,
29
+ plugins: [
30
+ ...globalPlugins,
31
+ ...parallelPlugins
32
+ ],
44
33
  guards: globalGuards,
45
34
  interceptors: globalInterceptors
46
35
  });
47
- handleMeta();
48
- HMR(async () => {
49
- detectAopDep(meta, {
50
- plugins,
51
- guards: globalGuards,
52
- interceptors: globalInterceptors
36
+ fastify.register((fastify2, _, done) => {
37
+ Context.usePlugin(globalPlugins, "fastify").forEach((p) => {
38
+ p[Symbol.for("skip-override")] = true;
39
+ fastify2.register(p);
53
40
  });
54
- handleMeta();
55
- });
56
- return (fastify, _, done) => {
57
- fastify.register((fastify2, _opts, done2) => {
58
- plugins.forEach((p) => {
59
- const plugin = Context.usePlugin([
60
- p
61
- ])[0];
62
- if (plugin) {
63
- plugin[Symbol.for("skip-override")] = true;
64
- fastify2.register(plugin);
65
- }
41
+ fastify2.register((fastify3, _opts, done2) => {
42
+ Context.usePlugin(parallelPlugins, "fastify").forEach((p) => {
43
+ p[Symbol.for("skip-override")] = true;
44
+ fastify3.register(p);
66
45
  });
67
- fastify2.post(route, async (req, res) => {
68
- const { body } = req;
69
- async function errorHandler(e) {
70
- const error = await Context.filterRecord.default(e);
71
- return res.status(error.status).send(error);
72
- }
73
- __name(errorHandler, "errorHandler");
74
- if (!Array.isArray(body))
75
- return errorHandler(new BadRequestException("data format should be an array"));
76
- try {
77
- return Promise.all(body.map((item, i) => {
78
- return new Promise(async (resolve) => {
79
- const { tag, func } = item;
80
- debug(`(parallel)invoke method "${func}" in module "${tag}"`);
81
- if (!metaMap.has(tag))
82
- return resolve(await Context.filterRecord.default(new BadRequestException(`module "${tag}" doesn't exist`)));
83
- const meta2 = metaMap.get(tag)[func];
84
- if (!meta2)
85
- return resolve(await Context.filterRecord.default(new BadRequestException(`"${func}" in "${tag}" doesn't exist`)));
86
- const { data: { params } } = meta2;
87
- const contextData = {
88
- type: "fastify",
89
- parallel: true,
90
- request: req,
91
- index: i,
92
- meta: meta2,
93
- response: res,
94
- moduleMap,
95
- tag,
96
- func,
97
- app: fastify2,
98
- ...argToReq(params, item.args, req.headers)
99
- };
100
- const context = new Context(contextData);
101
- context.run({
102
- globalGuards,
103
- globalInterceptors,
104
- globalFilter,
105
- globalPipe
106
- }, resolve, resolve);
46
+ if (parallelRoute) {
47
+ fastify3.post(parallelRoute, async (req, res) => {
48
+ const { body } = req;
49
+ async function errorHandler(e) {
50
+ const error = await Context.filterRecord.default(e);
51
+ return res.status(error.status).send(error);
52
+ }
53
+ __name(errorHandler, "errorHandler");
54
+ if (!Array.isArray(body))
55
+ return errorHandler(new BadRequestException("data format should be an array"));
56
+ try {
57
+ return Promise.all(body.map((item, i) => {
58
+ return new Promise(async (resolve) => {
59
+ const { tag, func } = item;
60
+ debug(`(parallel)invoke method "${func}" in module "${tag}"`);
61
+ if (!metaMap.has(tag))
62
+ return resolve(await Context.filterRecord.default(new BadRequestException(`module "${tag}" doesn't exist`)));
63
+ const meta2 = metaMap.get(tag)[func];
64
+ if (!meta2)
65
+ return resolve(await Context.filterRecord.default(new BadRequestException(`"${func}" in "${tag}" doesn't exist`)));
66
+ const { data: { params } } = meta2;
67
+ const contextData = {
68
+ type: "fastify",
69
+ parallel: true,
70
+ request: req,
71
+ index: i,
72
+ meta: meta2,
73
+ response: res,
74
+ moduleMap,
75
+ tag,
76
+ func,
77
+ app: fastify3,
78
+ ...argToReq(params, item.args, req.headers)
79
+ };
80
+ const context = new Context(contextData);
81
+ context.run({
82
+ globalGuards,
83
+ globalInterceptors,
84
+ globalFilter,
85
+ globalPipe
86
+ }, resolve, resolve);
87
+ });
88
+ })).then((ret) => {
89
+ res.send(ret);
107
90
  });
108
- })).then((ret) => {
109
- res.send(ret);
110
- });
111
- } catch (e) {
112
- return errorHandler(e);
113
- }
114
- });
91
+ } catch (e) {
92
+ return errorHandler(e);
93
+ }
94
+ });
95
+ }
115
96
  done2();
116
97
  });
117
98
  for (const [tag, record] of metaMap) {
118
99
  for (const func in record) {
119
100
  const meta2 = metaMap.get(tag)[func];
120
- const { data: { plugins: plugins2, define, http } } = meta2;
101
+ const { data: { plugins, define, http } } = meta2;
121
102
  if (!http?.type)
122
103
  continue;
123
- fastify.register((fastify2, _opts, done2) => {
124
- Context.usePlugin(plugins2).forEach((p) => {
104
+ fastify2.register((fastify3, _opts, done2) => {
105
+ Context.usePlugin(plugins, "fastify").forEach((p) => {
125
106
  p[Symbol.for("skip-override")] = true;
126
- fastify2.register(p);
107
+ fastify3.register(p);
127
108
  });
128
- fastify2[http.type](http.prefix + http.route, define?.fastify || {}, async (req, res) => {
109
+ fastify3[http.type](http.prefix + http.route, define?.fastify || {}, async (req, res) => {
129
110
  debug(`invoke method "${func}" in module "${tag}"`);
130
111
  const contextData = {
131
112
  type: "fastify",
@@ -139,7 +120,7 @@ function bind(data, opts = {}) {
139
120
  body: req.body,
140
121
  params: req.params,
141
122
  headers: req.headers,
142
- app: fastify2
123
+ app: fastify3
143
124
  };
144
125
  const context = new Context(contextData);
145
126
  if (http.headers) {
@@ -166,7 +147,7 @@ function bind(data, opts = {}) {
166
147
  }
167
148
  }
168
149
  done();
169
- };
150
+ }, fastifyOpts);
170
151
  }
171
152
  __name(bind, "bind");
172
153
  function Fastify(opts) {
@@ -1,6 +1,6 @@
1
- import { H3Event, Router } from 'h3';
2
- import { F as Factory } from '../../core-fd134ffa.js';
3
- import { a as HttpContext, H as HttpOptions } from '../../helper-f29f082f.js';
1
+ import { H3Event, Router, _RequestMiddleware } from 'h3';
2
+ import { F as Factory } from '../../core-39f27fe8.js';
3
+ import { a as HttpContext, H as HttpOptions } from '../../helper-fcbf6aa8.js';
4
4
  import 'phecda-core';
5
5
  import 'node:http';
6
6
 
@@ -9,6 +9,7 @@ interface H3Ctx extends HttpContext {
9
9
  event: H3Event;
10
10
  app: Router;
11
11
  }
12
+ type Plugin = _RequestMiddleware;
12
13
  declare function bind(router: Router, data: Awaited<ReturnType<typeof Factory>>, opts?: HttpOptions): void;
13
14
 
14
- export { H3Ctx, bind };
15
+ export { H3Ctx, Plugin, bind };