phecda-server 7.1.4 → 8.0.0
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/{chunk-MKRHYZCL.mjs → chunk-FI5756JX.mjs} +2 -2
- package/dist/{chunk-YRS4ECPT.js → chunk-OLNN4U3O.js} +12 -8
- package/dist/{chunk-5MAGRSEM.mjs → chunk-PFPOEZHH.mjs} +12 -8
- package/dist/{chunk-DPPDWBYO.js → chunk-UYZSUBX4.js} +2 -2
- package/dist/{chunk-P3CS65OP.mjs → chunk-VAHCYYCB.mjs} +32 -17
- package/dist/{chunk-OV3UJLGP.js → chunk-YJ3QHGTC.js} +32 -17
- package/dist/{core-B5yKYkMJ.d.mts → core-BTSHIAyB.d.ts} +2 -1
- package/dist/{core-BRuvL6hY.d.ts → core-D1YYphEn.d.mts} +2 -1
- package/dist/helper.d.mts +1 -1
- package/dist/helper.d.ts +1 -1
- package/dist/helper.js +2 -2
- package/dist/helper.mjs +1 -1
- package/dist/http/elysia/index.d.mts +3 -3
- package/dist/http/elysia/index.d.ts +3 -3
- package/dist/http/elysia/index.js +30 -30
- package/dist/http/elysia/index.mjs +15 -15
- package/dist/http/express/index.d.mts +3 -3
- package/dist/http/express/index.d.ts +3 -3
- package/dist/http/express/index.js +27 -27
- package/dist/http/express/index.mjs +14 -14
- package/dist/http/fastify/index.d.mts +3 -3
- package/dist/http/fastify/index.d.ts +3 -3
- package/dist/http/fastify/index.js +29 -29
- package/dist/http/fastify/index.mjs +15 -15
- package/dist/http/h3/index.d.mts +3 -3
- package/dist/http/h3/index.d.ts +3 -3
- package/dist/http/h3/index.js +28 -28
- package/dist/http/h3/index.mjs +14 -14
- package/dist/http/hono/index.d.mts +3 -3
- package/dist/http/hono/index.d.ts +3 -3
- package/dist/http/hono/index.js +26 -26
- package/dist/http/hono/index.mjs +14 -14
- package/dist/http/hyper-express/index.d.mts +3 -3
- package/dist/http/hyper-express/index.d.ts +3 -3
- package/dist/http/hyper-express/index.js +26 -26
- package/dist/http/hyper-express/index.mjs +14 -14
- package/dist/http/koa/index.d.mts +3 -3
- package/dist/http/koa/index.d.ts +3 -3
- package/dist/http/koa/index.js +27 -27
- package/dist/http/koa/index.mjs +14 -14
- package/dist/index.d.mts +20 -13
- package/dist/index.d.ts +20 -13
- package/dist/index.js +112 -71
- package/dist/index.mjs +69 -28
- package/dist/{meta-C_eDyXnK.d.ts → meta-DNF6Fl27.d.mts} +11 -9
- package/dist/{meta-C_eDyXnK.d.mts → meta-DNF6Fl27.d.ts} +11 -9
- package/dist/rpc/bullmq/index.d.mts +3 -3
- package/dist/rpc/bullmq/index.d.ts +3 -3
- package/dist/rpc/bullmq/index.js +16 -16
- package/dist/rpc/bullmq/index.mjs +11 -11
- package/dist/rpc/electron/index.d.mts +3 -3
- package/dist/rpc/electron/index.d.ts +3 -3
- package/dist/rpc/electron/index.js +11 -11
- package/dist/rpc/electron/index.mjs +7 -7
- package/dist/rpc/kafka/index.d.mts +3 -3
- package/dist/rpc/kafka/index.d.ts +3 -3
- package/dist/rpc/kafka/index.js +14 -14
- package/dist/rpc/kafka/index.mjs +9 -9
- package/dist/rpc/nats/index.d.mts +3 -3
- package/dist/rpc/nats/index.d.ts +3 -3
- package/dist/rpc/nats/index.js +14 -14
- package/dist/rpc/nats/index.mjs +9 -9
- package/dist/rpc/rabbitmq/index.d.mts +3 -3
- package/dist/rpc/rabbitmq/index.d.ts +3 -3
- package/dist/rpc/rabbitmq/index.js +14 -14
- package/dist/rpc/rabbitmq/index.mjs +9 -9
- package/dist/rpc/redis/index.d.mts +3 -3
- package/dist/rpc/redis/index.d.ts +3 -3
- package/dist/rpc/redis/index.js +14 -14
- package/dist/rpc/redis/index.mjs +9 -9
- package/dist/rpc/ws/index.d.mts +3 -3
- package/dist/rpc/ws/index.d.ts +3 -3
- package/dist/rpc/ws/index.js +10 -10
- package/dist/rpc/ws/index.mjs +6 -6
- package/dist/test.d.mts +2 -2
- package/dist/test.d.ts +2 -2
- package/dist/test.js +5 -5
- package/dist/test.mjs +4 -4
- package/dist/{types-7-m2wEkP.d.mts → types-BOZ8yE2L.d.mts} +1 -1
- package/dist/{types-BuvMT1ta.d.ts → types-Cosv4nol.d.ts} +1 -1
- package/dist/{types-BKHBmSQN.d.mts → types-DtiHAXQB.d.mts} +1 -1
- package/dist/{types-B6aU8oT-.d.ts → types-YJ55P7A_.d.ts} +1 -1
- package/package.json +3 -4
- package/register/export.mjs +5 -1
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
createControllerMetaMap,
|
|
5
5
|
detectAopDep,
|
|
6
6
|
joinUrl
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-VAHCYYCB.mjs";
|
|
8
8
|
import {
|
|
9
9
|
__name
|
|
10
10
|
} from "../../chunk-NQ55PA2X.mjs";
|
|
@@ -17,9 +17,9 @@ function bind(router, data, opts = {}) {
|
|
|
17
17
|
const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, dynamic = false } = opts;
|
|
18
18
|
const { moduleMap, meta } = data;
|
|
19
19
|
const metaMap = createControllerMetaMap(meta, (meta2) => {
|
|
20
|
-
const { controller, http,
|
|
21
|
-
if (controller === "http" && http?.
|
|
22
|
-
debug(`register method "${
|
|
20
|
+
const { controller, http, method, tag } = meta2.data;
|
|
21
|
+
if (controller === "http" && http?.method) {
|
|
22
|
+
debug(`register method "${method}" in module "${tag}"`);
|
|
23
23
|
return true;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -47,11 +47,11 @@ function bind(router, data, opts = {}) {
|
|
|
47
47
|
return Promise.all(body.map((item, i) => {
|
|
48
48
|
return new Promise(async (resolve) => {
|
|
49
49
|
if (!item) return resolve(null);
|
|
50
|
-
const { tag,
|
|
51
|
-
debug(`(parallel)invoke method "${
|
|
50
|
+
const { tag, method } = item;
|
|
51
|
+
debug(`(parallel)invoke method "${method}" in module "${tag}"`);
|
|
52
52
|
if (!metaMap.has(tag)) return resolve(await Context.filterRecord.default(new BadRequestException(`module "${tag}" doesn't exist`)));
|
|
53
|
-
const meta2 = metaMap.get(tag)[
|
|
54
|
-
if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${
|
|
53
|
+
const meta2 = metaMap.get(tag)[method];
|
|
54
|
+
if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${method}" in "${tag}" doesn't exist`)));
|
|
55
55
|
const aop = Context.getAop(meta2, {
|
|
56
56
|
globalFilter,
|
|
57
57
|
globalGuards,
|
|
@@ -91,10 +91,10 @@ function bind(router, data, opts = {}) {
|
|
|
91
91
|
router.use(subRouter);
|
|
92
92
|
}
|
|
93
93
|
for (const [tag, record] of metaMap) {
|
|
94
|
-
for (const
|
|
95
|
-
const meta2 = metaMap.get(tag)[
|
|
94
|
+
for (const method in record) {
|
|
95
|
+
const meta2 = metaMap.get(tag)[method];
|
|
96
96
|
const { data: { params, addons, http } } = meta2;
|
|
97
|
-
if (!http?.
|
|
97
|
+
if (!http?.method) continue;
|
|
98
98
|
const needBody = params.some((item) => item.type === "body");
|
|
99
99
|
let aop;
|
|
100
100
|
if (!dynamic) {
|
|
@@ -106,8 +106,8 @@ function bind(router, data, opts = {}) {
|
|
|
106
106
|
}
|
|
107
107
|
const subRouter = new Router();
|
|
108
108
|
Context.applyAddons(addons, subRouter, "hyper-express");
|
|
109
|
-
subRouter[http.
|
|
110
|
-
debug(`invoke method "${
|
|
109
|
+
subRouter[http.method](joinUrl(http.prefix, http.route), async (req, res, next) => {
|
|
110
|
+
debug(`invoke method "${method}" in module "${tag}"`);
|
|
111
111
|
const contextData = {
|
|
112
112
|
type: "hyper-express",
|
|
113
113
|
category: "http",
|
|
@@ -116,7 +116,7 @@ function bind(router, data, opts = {}) {
|
|
|
116
116
|
response: res,
|
|
117
117
|
moduleMap,
|
|
118
118
|
tag,
|
|
119
|
-
|
|
119
|
+
method,
|
|
120
120
|
query: req.query_parameters,
|
|
121
121
|
body: needBody ? await req.json({}) : void 0,
|
|
122
122
|
app: router,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Router, { RouterParamContext } from '@koa/router';
|
|
2
2
|
import { DefaultContext, DefaultState } from 'koa';
|
|
3
|
-
import { H as HttpCtx, a as HttpOptions } from '../../types-
|
|
4
|
-
import { F as Factory } from '../../core-
|
|
3
|
+
import { H as HttpCtx, a as HttpOptions } from '../../types-DtiHAXQB.mjs';
|
|
4
|
+
import { F as Factory } from '../../core-D1YYphEn.mjs';
|
|
5
5
|
import 'node:http';
|
|
6
|
-
import '../../meta-
|
|
6
|
+
import '../../meta-DNF6Fl27.mjs';
|
|
7
7
|
import 'phecda-core';
|
|
8
8
|
|
|
9
9
|
interface KoaCtx extends HttpCtx {
|
package/dist/http/koa/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Router, { RouterParamContext } from '@koa/router';
|
|
2
2
|
import { DefaultContext, DefaultState } from 'koa';
|
|
3
|
-
import { H as HttpCtx, a as HttpOptions } from '../../types-
|
|
4
|
-
import { F as Factory } from '../../core-
|
|
3
|
+
import { H as HttpCtx, a as HttpOptions } from '../../types-Cosv4nol.js';
|
|
4
|
+
import { F as Factory } from '../../core-BTSHIAyB.js';
|
|
5
5
|
import 'node:http';
|
|
6
|
-
import '../../meta-
|
|
6
|
+
import '../../meta-DNF6Fl27.js';
|
|
7
7
|
import 'phecda-core';
|
|
8
8
|
|
|
9
9
|
interface KoaCtx extends HttpCtx {
|
package/dist/http/koa/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkYJ3QHGTCjs = require('../../chunk-YJ3QHGTC.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -18,14 +18,14 @@ function bind(router, data, opts = {}) {
|
|
|
18
18
|
const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, dynamic = false } = opts;
|
|
19
19
|
const { moduleMap, meta } = data;
|
|
20
20
|
const originStack = router.stack.slice(0, router.stack.length);
|
|
21
|
-
const metaMap =
|
|
22
|
-
const { controller, http,
|
|
23
|
-
if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.
|
|
24
|
-
debug(`register method "${
|
|
21
|
+
const metaMap = _chunkYJ3QHGTCjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
22
|
+
const { controller, http, method, tag } = meta2.data;
|
|
23
|
+
if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.method])) {
|
|
24
|
+
debug(`register method "${method}" in module "${tag}"`);
|
|
25
25
|
return true;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
|
|
28
|
+
_chunkYJ3QHGTCjs.detectAopDep.call(void 0, meta, {
|
|
29
29
|
addons: [
|
|
30
30
|
...globalAddons,
|
|
31
31
|
...parallelAddons
|
|
@@ -34,29 +34,29 @@ function bind(router, data, opts = {}) {
|
|
|
34
34
|
});
|
|
35
35
|
registerRoute();
|
|
36
36
|
function registerRoute() {
|
|
37
|
-
|
|
37
|
+
_chunkYJ3QHGTCjs.Context.applyAddons(globalAddons, router, "koa");
|
|
38
38
|
if (parallelRoute) {
|
|
39
39
|
const subRouter = new (0, _router2.default)();
|
|
40
|
-
|
|
40
|
+
_chunkYJ3QHGTCjs.Context.applyAddons(parallelAddons, subRouter, "koa");
|
|
41
41
|
subRouter.post(parallelRoute, async (ctx, next) => {
|
|
42
42
|
const { body } = ctx.request;
|
|
43
43
|
async function errorHandler(e) {
|
|
44
|
-
const error = await
|
|
44
|
+
const error = await _chunkYJ3QHGTCjs.Context.filterRecord.default(e);
|
|
45
45
|
ctx.status = error.status;
|
|
46
46
|
ctx.body = error;
|
|
47
47
|
}
|
|
48
48
|
_chunk4LLLQOMFjs.__name.call(void 0, errorHandler, "errorHandler");
|
|
49
|
-
if (!Array.isArray(body)) return errorHandler(new (0,
|
|
49
|
+
if (!Array.isArray(body)) return errorHandler(new (0, _chunkYJ3QHGTCjs.BadRequestException)("data format should be an array"));
|
|
50
50
|
try {
|
|
51
51
|
return Promise.all(body.map((item, i) => {
|
|
52
52
|
return new Promise(async (resolve) => {
|
|
53
53
|
if (!item) return resolve(null);
|
|
54
|
-
const { tag,
|
|
55
|
-
debug(`(parallel)invoke method "${
|
|
56
|
-
if (!metaMap.has(tag)) return resolve(await
|
|
57
|
-
const meta2 = metaMap.get(tag)[
|
|
58
|
-
if (!meta2) return resolve(await
|
|
59
|
-
const aop =
|
|
54
|
+
const { tag, method } = item;
|
|
55
|
+
debug(`(parallel)invoke method "${method}" in module "${tag}"`);
|
|
56
|
+
if (!metaMap.has(tag)) return resolve(await _chunkYJ3QHGTCjs.Context.filterRecord.default(new (0, _chunkYJ3QHGTCjs.BadRequestException)(`module "${tag}" doesn't exist`)));
|
|
57
|
+
const meta2 = metaMap.get(tag)[method];
|
|
58
|
+
if (!meta2) return resolve(await _chunkYJ3QHGTCjs.Context.filterRecord.default(new (0, _chunkYJ3QHGTCjs.BadRequestException)(`"${method}" in "${tag}" doesn't exist`)));
|
|
59
|
+
const aop = _chunkYJ3QHGTCjs.Context.getAop(meta2, {
|
|
60
60
|
globalGuards,
|
|
61
61
|
globalFilter,
|
|
62
62
|
globalPipe
|
|
@@ -83,7 +83,7 @@ function bind(router, data, opts = {}) {
|
|
|
83
83
|
getRequest: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => ctx.req, "getRequest"),
|
|
84
84
|
getResponse: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => ctx.res, "getResponse")
|
|
85
85
|
};
|
|
86
|
-
const context = new (0,
|
|
86
|
+
const context = new (0, _chunkYJ3QHGTCjs.Context)(contextData);
|
|
87
87
|
context.run(aop, resolve, resolve);
|
|
88
88
|
});
|
|
89
89
|
})).then((ret) => {
|
|
@@ -96,22 +96,22 @@ function bind(router, data, opts = {}) {
|
|
|
96
96
|
router.use(subRouter.routes()).use(subRouter.allowedMethods());
|
|
97
97
|
}
|
|
98
98
|
for (const [tag, record] of metaMap) {
|
|
99
|
-
for (const
|
|
100
|
-
const meta2 = metaMap.get(tag)[
|
|
99
|
+
for (const method in record) {
|
|
100
|
+
const meta2 = metaMap.get(tag)[method];
|
|
101
101
|
const { data: { addons, http } } = meta2;
|
|
102
|
-
if (!_optionalChain([http, 'optionalAccess', _2 => _2.
|
|
102
|
+
if (!_optionalChain([http, 'optionalAccess', _2 => _2.method])) continue;
|
|
103
103
|
let aop;
|
|
104
104
|
if (!dynamic) {
|
|
105
|
-
aop =
|
|
105
|
+
aop = _chunkYJ3QHGTCjs.Context.getAop(meta2, {
|
|
106
106
|
globalFilter,
|
|
107
107
|
globalGuards,
|
|
108
108
|
globalPipe
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
const subRouter = new (0, _router2.default)();
|
|
112
|
-
|
|
113
|
-
router[http.
|
|
114
|
-
debug(`invoke method "${
|
|
112
|
+
_chunkYJ3QHGTCjs.Context.applyAddons(addons, subRouter, "koa");
|
|
113
|
+
router[http.method](_chunkYJ3QHGTCjs.joinUrl.call(void 0, http.prefix, http.route), async (ctx, next) => {
|
|
114
|
+
debug(`invoke method "${method}" in module "${tag}"`);
|
|
115
115
|
const contextData = {
|
|
116
116
|
type: "koa",
|
|
117
117
|
app: router,
|
|
@@ -119,7 +119,7 @@ function bind(router, data, opts = {}) {
|
|
|
119
119
|
meta: meta2,
|
|
120
120
|
moduleMap,
|
|
121
121
|
tag,
|
|
122
|
-
|
|
122
|
+
method,
|
|
123
123
|
query: ctx.query,
|
|
124
124
|
params: ctx.params,
|
|
125
125
|
category: "http",
|
|
@@ -137,10 +137,10 @@ function bind(router, data, opts = {}) {
|
|
|
137
137
|
getRequest: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => ctx.req, "getRequest"),
|
|
138
138
|
getResponse: /* @__PURE__ */ _chunk4LLLQOMFjs.__name.call(void 0, () => ctx.res, "getResponse")
|
|
139
139
|
};
|
|
140
|
-
const context = new (0,
|
|
140
|
+
const context = new (0, _chunkYJ3QHGTCjs.Context)(contextData);
|
|
141
141
|
if (http.headers) ctx.set(http.headers);
|
|
142
142
|
if (dynamic) {
|
|
143
|
-
aop =
|
|
143
|
+
aop = _chunkYJ3QHGTCjs.Context.getAop(meta2, {
|
|
144
144
|
globalFilter,
|
|
145
145
|
globalGuards,
|
|
146
146
|
globalPipe
|
package/dist/http/koa/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
createControllerMetaMap,
|
|
5
5
|
detectAopDep,
|
|
6
6
|
joinUrl
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-VAHCYYCB.mjs";
|
|
8
8
|
import {
|
|
9
9
|
HMR,
|
|
10
10
|
__name
|
|
@@ -19,9 +19,9 @@ function bind(router, data, opts = {}) {
|
|
|
19
19
|
const { moduleMap, meta } = data;
|
|
20
20
|
const originStack = router.stack.slice(0, router.stack.length);
|
|
21
21
|
const metaMap = createControllerMetaMap(meta, (meta2) => {
|
|
22
|
-
const { controller, http,
|
|
23
|
-
if (controller === "http" && http?.
|
|
24
|
-
debug(`register method "${
|
|
22
|
+
const { controller, http, method, tag } = meta2.data;
|
|
23
|
+
if (controller === "http" && http?.method) {
|
|
24
|
+
debug(`register method "${method}" in module "${tag}"`);
|
|
25
25
|
return true;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
@@ -51,11 +51,11 @@ function bind(router, data, opts = {}) {
|
|
|
51
51
|
return Promise.all(body.map((item, i) => {
|
|
52
52
|
return new Promise(async (resolve) => {
|
|
53
53
|
if (!item) return resolve(null);
|
|
54
|
-
const { tag,
|
|
55
|
-
debug(`(parallel)invoke method "${
|
|
54
|
+
const { tag, method } = item;
|
|
55
|
+
debug(`(parallel)invoke method "${method}" in module "${tag}"`);
|
|
56
56
|
if (!metaMap.has(tag)) return resolve(await Context.filterRecord.default(new BadRequestException(`module "${tag}" doesn't exist`)));
|
|
57
|
-
const meta2 = metaMap.get(tag)[
|
|
58
|
-
if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${
|
|
57
|
+
const meta2 = metaMap.get(tag)[method];
|
|
58
|
+
if (!meta2) return resolve(await Context.filterRecord.default(new BadRequestException(`"${method}" in "${tag}" doesn't exist`)));
|
|
59
59
|
const aop = Context.getAop(meta2, {
|
|
60
60
|
globalGuards,
|
|
61
61
|
globalFilter,
|
|
@@ -96,10 +96,10 @@ function bind(router, data, opts = {}) {
|
|
|
96
96
|
router.use(subRouter.routes()).use(subRouter.allowedMethods());
|
|
97
97
|
}
|
|
98
98
|
for (const [tag, record] of metaMap) {
|
|
99
|
-
for (const
|
|
100
|
-
const meta2 = metaMap.get(tag)[
|
|
99
|
+
for (const method in record) {
|
|
100
|
+
const meta2 = metaMap.get(tag)[method];
|
|
101
101
|
const { data: { addons, http } } = meta2;
|
|
102
|
-
if (!http?.
|
|
102
|
+
if (!http?.method) continue;
|
|
103
103
|
let aop;
|
|
104
104
|
if (!dynamic) {
|
|
105
105
|
aop = Context.getAop(meta2, {
|
|
@@ -110,8 +110,8 @@ function bind(router, data, opts = {}) {
|
|
|
110
110
|
}
|
|
111
111
|
const subRouter = new Router();
|
|
112
112
|
Context.applyAddons(addons, subRouter, "koa");
|
|
113
|
-
router[http.
|
|
114
|
-
debug(`invoke method "${
|
|
113
|
+
router[http.method](joinUrl(http.prefix, http.route), async (ctx, next) => {
|
|
114
|
+
debug(`invoke method "${method}" in module "${tag}"`);
|
|
115
115
|
const contextData = {
|
|
116
116
|
type: "koa",
|
|
117
117
|
app: router,
|
|
@@ -119,7 +119,7 @@ function bind(router, data, opts = {}) {
|
|
|
119
119
|
meta: meta2,
|
|
120
120
|
moduleMap,
|
|
121
121
|
tag,
|
|
122
|
-
|
|
122
|
+
method,
|
|
123
123
|
query: ctx.query,
|
|
124
124
|
params: ctx.params,
|
|
125
125
|
category: "http",
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { B as BaseCtx, a as ControllerMeta, D as DefaultOptions, b as ControllerMetaData, M as Meta, E as Emitter, c as BaseError } from './meta-
|
|
2
|
-
export { d as
|
|
3
|
-
import { G as Generator } from './core-
|
|
4
|
-
export { F as Factory, O as Options, S as ServerPhecda, d as defaultServerInject, e as emitter, p as phecdaNamespace, u as useS } from './core-
|
|
5
|
-
import { Base } from 'phecda-core';
|
|
1
|
+
import { B as BaseCtx, a as ControllerMeta, D as DefaultOptions, b as ControllerMetaData, M as Meta, E as Emitter, c as BaseError } from './meta-DNF6Fl27.mjs';
|
|
2
|
+
export { d as BaseRequestMethod, C as CustomResponse, g as ERROR_SYMBOL, e as ExtractResponse, I as IS_DEV, h as IS_ONLY_GENERATE, j as IS_PURE, i as IS_STRICT, L as LOG_LEVEL, f as MetaData, P as PS_EXIT_CODE, S as ServiceMetaData } from './meta-DNF6Fl27.mjs';
|
|
3
|
+
import { G as Generator } from './core-D1YYphEn.mjs';
|
|
4
|
+
export { F as Factory, O as Options, S as ServerPhecda, d as defaultServerInject, e as emitter, p as phecdaNamespace, u as useS } from './core-D1YYphEn.mjs';
|
|
5
|
+
import { Construct, Base } from 'phecda-core';
|
|
6
6
|
export * from 'phecda-core';
|
|
7
|
-
import { H as HttpCtx } from './types-
|
|
8
|
-
export { C as CookieSerializeOptions, a as HttpOptions } from './types-
|
|
9
|
-
import { R as RpcCtx } from './types-
|
|
10
|
-
export { a as RpcServerOptions } from './types-
|
|
7
|
+
import { H as HttpCtx } from './types-DtiHAXQB.mjs';
|
|
8
|
+
export { C as CookieSerializeOptions, a as HttpOptions } from './types-DtiHAXQB.mjs';
|
|
9
|
+
import { R as RpcCtx } from './types-BOZ8yE2L.mjs';
|
|
10
|
+
export { a as RpcServerOptions } from './types-BOZ8yE2L.mjs';
|
|
11
11
|
export { Mixin } from 'ts-mixer';
|
|
12
12
|
import 'node:http';
|
|
13
13
|
|
|
@@ -101,7 +101,7 @@ interface PipeArg {
|
|
|
101
101
|
index: number;
|
|
102
102
|
reflect: any;
|
|
103
103
|
define: Record<string, any>;
|
|
104
|
-
|
|
104
|
+
meta: any;
|
|
105
105
|
}
|
|
106
106
|
type GuardType<Ctx extends BaseCtx = any> = (ctx: Ctx, next: () => Promise<any>) => any;
|
|
107
107
|
type PipeType<Ctx extends BaseCtx = any> = (arg: PipeArg, ctx: Ctx) => Promise<any>;
|
|
@@ -163,10 +163,11 @@ declare class HTTPGenerator extends Generator {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
declare class OpenAPIGenerator extends Generator {
|
|
166
|
+
ext: string;
|
|
166
167
|
name: string;
|
|
167
168
|
paths: Record<string, any>;
|
|
168
169
|
getContent(): string;
|
|
169
|
-
addMethod(args: ControllerMetaData): void;
|
|
170
|
+
addMethod(args: ControllerMetaData, model: Construct): void;
|
|
170
171
|
generateCode(meta: Meta[]): string;
|
|
171
172
|
}
|
|
172
173
|
|
|
@@ -187,6 +188,12 @@ declare class DocGenerator extends Generator {
|
|
|
187
188
|
generateCode(meta: Meta[]): string;
|
|
188
189
|
}
|
|
189
190
|
|
|
191
|
+
declare class GraphGenerator extends Generator {
|
|
192
|
+
ext: string;
|
|
193
|
+
name: string;
|
|
194
|
+
generateCode(meta: Meta[]): string;
|
|
195
|
+
}
|
|
196
|
+
|
|
190
197
|
declare function BaseParam(data: Record<string, any>): ParameterDecorator;
|
|
191
198
|
declare function Body(key?: string): ParameterDecorator;
|
|
192
199
|
declare function Head(key: string): ParameterDecorator;
|
|
@@ -201,7 +208,7 @@ declare function Addon(...addons: string[]): (target: any, property?: PropertyKe
|
|
|
201
208
|
declare function Filter(filter: string): (target: any, property?: PropertyKey) => void;
|
|
202
209
|
declare function Pipe(pipe?: string): (target: any, property?: any, index?: any) => void;
|
|
203
210
|
|
|
204
|
-
declare function Route(route: string,
|
|
211
|
+
declare function Route(route: string, method: string): MethodDecorator;
|
|
205
212
|
declare function Header(headers: Record<string, string>): MethodDecorator;
|
|
206
213
|
declare function Get(route?: string): MethodDecorator;
|
|
207
214
|
declare function Post(route?: string): MethodDecorator;
|
|
@@ -347,4 +354,4 @@ declare class PExtension extends ServerBase {
|
|
|
347
354
|
constructor(tag?: string);
|
|
348
355
|
}
|
|
349
356
|
|
|
350
|
-
export { type AOP, Addon, ApiDoc, Arg, BadGatewayException, BadRequestException, BaseCtx, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, DocGenerator, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpCtx, InvalidInputException, type LogLevel, type Logger, ManyFiles, Meta, NotFoundException, OneFile, type OpenAPIConfig, OpenAPIGenerator, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcCtx, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultPipe, getLogger, log, runMiddleware, setLogger };
|
|
357
|
+
export { type AOP, Addon, ApiDoc, Arg, BadGatewayException, BadRequestException, BaseCtx, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, DocGenerator, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, GraphGenerator, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpCtx, InvalidInputException, type LogLevel, type Logger, ManyFiles, Meta, NotFoundException, OneFile, type OpenAPIConfig, OpenAPIGenerator, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcCtx, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultPipe, getLogger, log, runMiddleware, setLogger };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { B as BaseCtx, a as ControllerMeta, D as DefaultOptions, b as ControllerMetaData, M as Meta, E as Emitter, c as BaseError } from './meta-
|
|
2
|
-
export { d as
|
|
3
|
-
import { G as Generator } from './core-
|
|
4
|
-
export { F as Factory, O as Options, S as ServerPhecda, d as defaultServerInject, e as emitter, p as phecdaNamespace, u as useS } from './core-
|
|
5
|
-
import { Base } from 'phecda-core';
|
|
1
|
+
import { B as BaseCtx, a as ControllerMeta, D as DefaultOptions, b as ControllerMetaData, M as Meta, E as Emitter, c as BaseError } from './meta-DNF6Fl27.js';
|
|
2
|
+
export { d as BaseRequestMethod, C as CustomResponse, g as ERROR_SYMBOL, e as ExtractResponse, I as IS_DEV, h as IS_ONLY_GENERATE, j as IS_PURE, i as IS_STRICT, L as LOG_LEVEL, f as MetaData, P as PS_EXIT_CODE, S as ServiceMetaData } from './meta-DNF6Fl27.js';
|
|
3
|
+
import { G as Generator } from './core-BTSHIAyB.js';
|
|
4
|
+
export { F as Factory, O as Options, S as ServerPhecda, d as defaultServerInject, e as emitter, p as phecdaNamespace, u as useS } from './core-BTSHIAyB.js';
|
|
5
|
+
import { Construct, Base } from 'phecda-core';
|
|
6
6
|
export * from 'phecda-core';
|
|
7
|
-
import { H as HttpCtx } from './types-
|
|
8
|
-
export { C as CookieSerializeOptions, a as HttpOptions } from './types-
|
|
9
|
-
import { R as RpcCtx } from './types-
|
|
10
|
-
export { a as RpcServerOptions } from './types-
|
|
7
|
+
import { H as HttpCtx } from './types-Cosv4nol.js';
|
|
8
|
+
export { C as CookieSerializeOptions, a as HttpOptions } from './types-Cosv4nol.js';
|
|
9
|
+
import { R as RpcCtx } from './types-YJ55P7A_.js';
|
|
10
|
+
export { a as RpcServerOptions } from './types-YJ55P7A_.js';
|
|
11
11
|
export { Mixin } from 'ts-mixer';
|
|
12
12
|
import 'node:http';
|
|
13
13
|
|
|
@@ -101,7 +101,7 @@ interface PipeArg {
|
|
|
101
101
|
index: number;
|
|
102
102
|
reflect: any;
|
|
103
103
|
define: Record<string, any>;
|
|
104
|
-
|
|
104
|
+
meta: any;
|
|
105
105
|
}
|
|
106
106
|
type GuardType<Ctx extends BaseCtx = any> = (ctx: Ctx, next: () => Promise<any>) => any;
|
|
107
107
|
type PipeType<Ctx extends BaseCtx = any> = (arg: PipeArg, ctx: Ctx) => Promise<any>;
|
|
@@ -163,10 +163,11 @@ declare class HTTPGenerator extends Generator {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
declare class OpenAPIGenerator extends Generator {
|
|
166
|
+
ext: string;
|
|
166
167
|
name: string;
|
|
167
168
|
paths: Record<string, any>;
|
|
168
169
|
getContent(): string;
|
|
169
|
-
addMethod(args: ControllerMetaData): void;
|
|
170
|
+
addMethod(args: ControllerMetaData, model: Construct): void;
|
|
170
171
|
generateCode(meta: Meta[]): string;
|
|
171
172
|
}
|
|
172
173
|
|
|
@@ -187,6 +188,12 @@ declare class DocGenerator extends Generator {
|
|
|
187
188
|
generateCode(meta: Meta[]): string;
|
|
188
189
|
}
|
|
189
190
|
|
|
191
|
+
declare class GraphGenerator extends Generator {
|
|
192
|
+
ext: string;
|
|
193
|
+
name: string;
|
|
194
|
+
generateCode(meta: Meta[]): string;
|
|
195
|
+
}
|
|
196
|
+
|
|
190
197
|
declare function BaseParam(data: Record<string, any>): ParameterDecorator;
|
|
191
198
|
declare function Body(key?: string): ParameterDecorator;
|
|
192
199
|
declare function Head(key: string): ParameterDecorator;
|
|
@@ -201,7 +208,7 @@ declare function Addon(...addons: string[]): (target: any, property?: PropertyKe
|
|
|
201
208
|
declare function Filter(filter: string): (target: any, property?: PropertyKey) => void;
|
|
202
209
|
declare function Pipe(pipe?: string): (target: any, property?: any, index?: any) => void;
|
|
203
210
|
|
|
204
|
-
declare function Route(route: string,
|
|
211
|
+
declare function Route(route: string, method: string): MethodDecorator;
|
|
205
212
|
declare function Header(headers: Record<string, string>): MethodDecorator;
|
|
206
213
|
declare function Get(route?: string): MethodDecorator;
|
|
207
214
|
declare function Post(route?: string): MethodDecorator;
|
|
@@ -347,4 +354,4 @@ declare class PExtension extends ServerBase {
|
|
|
347
354
|
constructor(tag?: string);
|
|
348
355
|
}
|
|
349
356
|
|
|
350
|
-
export { type AOP, Addon, ApiDoc, Arg, BadGatewayException, BadRequestException, BaseCtx, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, DocGenerator, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpCtx, InvalidInputException, type LogLevel, type Logger, ManyFiles, Meta, NotFoundException, OneFile, type OpenAPIConfig, OpenAPIGenerator, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcCtx, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultPipe, getLogger, log, runMiddleware, setLogger };
|
|
357
|
+
export { type AOP, Addon, ApiDoc, Arg, BadGatewayException, BadRequestException, BaseCtx, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, DocGenerator, Emitter, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, GraphGenerator, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpCtx, InvalidInputException, type LogLevel, type Logger, ManyFiles, Meta, NotFoundException, OneFile, type OpenAPIConfig, OpenAPIGenerator, PAddon, PExtension, PFilter, PGuard, PPipe, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcCtx, Search, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addAddon, addFilter, addGuard, addPipe, defaultPipe, getLogger, log, runMiddleware, setLogger };
|