phecda-server 5.2.0 → 5.2.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.
- package/assets/ps.json +21 -22
- package/dist/helper.d.ts +7 -5
- package/dist/index.d.ts +3 -0
- package/dist/rpc/bullmq/index.d.ts +1 -1
- package/dist/rpc/kafka/index.d.ts +1 -1
- package/dist/rpc/nats/index.d.ts +1 -1
- package/dist/rpc/rabbitmq/index.d.ts +1 -1
- package/dist/rpc/redis/index.d.ts +1 -1
- package/dist/server/elysia/index.d.ts +1 -1
- package/dist/server/express/index.d.ts +1 -1
- package/dist/server/fastify/index.d.ts +1 -1
- package/dist/server/h3/index.d.ts +1 -1
- package/dist/server/hono/index.d.ts +1 -1
- package/dist/server/hyper-express/index.d.ts +1 -1
- package/dist/server/koa/index.d.ts +1 -1
- package/dist/test.d.ts +1 -1
- package/dist/{helper-49c7213c.d.ts → types-68f2ec2a.d.ts} +2 -4
- package/dist/{helper-5d755442.d.ts → types-f3b79218.d.ts} +1 -2
- package/package.json +1 -1
package/assets/ps.json
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
"$schema": "https://unpkg.com/phecda-server/assets/schema.json",
|
|
3
|
+
"resolve": [
|
|
4
|
+
{
|
|
5
|
+
"source": "controller",
|
|
6
|
+
"importer": "http",
|
|
7
|
+
"path": ".ps/http.js"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"source": "rpc",
|
|
11
|
+
"importer": "client",
|
|
12
|
+
"path": ".ps/rpc.js"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
15
|
"unimport": {
|
|
16
16
|
"dirs": ["."],
|
|
17
|
-
"dirsScanOptions":{
|
|
18
|
-
"filePatterns":["*.{service,controller,module,rpc,edge,guard,interceptor,extension,pipe,filter,plugin}.ts"]
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
"dirsScanOptions": {
|
|
18
|
+
"filePatterns": ["*.{service,controller,module,rpc,edge,guard,interceptor,extension,pipe,filter,plugin}.ts"]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"virtualFile": {},
|
|
22
|
+
"moduleFile": []
|
|
23
|
+
|
|
24
|
+
}
|
package/dist/helper.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { h as Meta, i as ControllerMeta } from './types-81be0ba3.js';
|
|
2
|
-
export { a as HttpContext, H as HttpOptions, b as argToReq, r as resolveDep } from './helper-49c7213c.js';
|
|
3
|
-
export { a as RpcClientOptions, b as RpcContext, R as RpcServerOptions, g as genClientQueue } from './helper-5d755442.js';
|
|
1
|
+
import { C as ControllerMetaData, h as Meta, i as ControllerMeta } from './types-81be0ba3.js';
|
|
4
2
|
import 'phecda-core';
|
|
5
|
-
import 'node:http';
|
|
6
3
|
|
|
7
4
|
declare function HMR(cb: (...args: any) => any): void;
|
|
8
5
|
|
|
6
|
+
declare function resolveDep(ret: any, key: string): any;
|
|
7
|
+
declare function argToReq(params: ControllerMetaData['params'], args: any[], headers: Record<string, any>): any;
|
|
8
|
+
|
|
9
|
+
declare function genClientQueue(key?: string): string;
|
|
10
|
+
|
|
9
11
|
declare function shallowClone(obj: any): any;
|
|
10
12
|
declare function mergeObject(...args: any[]): any;
|
|
11
13
|
|
|
@@ -22,4 +24,4 @@ declare function detectAopDep(meta: Meta[], { guards, interceptors, plugins }?:
|
|
|
22
24
|
filterSet: Set<string>;
|
|
23
25
|
};
|
|
24
26
|
|
|
25
|
-
export { HMR, createControllerMetaMap, detectAopDep, mergeObject, shallowClone };
|
|
27
|
+
export { HMR, argToReq, createControllerMetaMap, detectAopDep, genClientQueue, mergeObject, resolveDep, shallowClone };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ import { G as Generator } from './core-7f6d2be6.js';
|
|
|
4
4
|
export { F as Factory, e as emitter } from './core-7f6d2be6.js';
|
|
5
5
|
import { Construct, AbConstruct } from 'phecda-core';
|
|
6
6
|
export * from 'phecda-core';
|
|
7
|
+
export { a as HttpContext, H as HttpOptions } from './types-68f2ec2a.js';
|
|
8
|
+
export { a as RpcClientOptions, b as RpcContext, R as RpcServerOptions } from './types-f3b79218.js';
|
|
9
|
+
import 'node:http';
|
|
7
10
|
|
|
8
11
|
declare class Exception extends Error {
|
|
9
12
|
message: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
|
|
2
2
|
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
3
|
-
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../
|
|
3
|
+
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-f3b79218.js';
|
|
4
4
|
import { T as ToClientMap } from '../../types-81be0ba3.js';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Consumer, Producer } from 'kafkajs';
|
|
2
2
|
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
3
|
-
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../
|
|
3
|
+
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-f3b79218.js';
|
|
4
4
|
import { T as ToClientMap } from '../../types-81be0ba3.js';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
package/dist/rpc/nats/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NatsConnection } from 'nats';
|
|
2
2
|
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
3
|
-
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../
|
|
3
|
+
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-f3b79218.js';
|
|
4
4
|
import { T as ToClientMap } from '../../types-81be0ba3.js';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import amqplib from 'amqplib';
|
|
2
2
|
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
3
|
-
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../
|
|
3
|
+
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-f3b79218.js';
|
|
4
4
|
import { T as ToClientMap } from '../../types-81be0ba3.js';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
2
|
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
3
|
-
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../
|
|
3
|
+
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../types-f3b79218.js';
|
|
4
4
|
import { T as ToClientMap } from '../../types-81be0ba3.js';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Elysia as Elysia$1, Context, LocalHook, InputSchema, RouteSchema, SingletonBase } from 'elysia';
|
|
2
2
|
import { BaseMacro } from 'elysia/dist/types';
|
|
3
|
-
import { a as HttpContext, H as HttpOptions } from '../../
|
|
3
|
+
import { a as HttpContext, H as HttpOptions } from '../../types-68f2ec2a.js';
|
|
4
4
|
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
5
5
|
import 'node:http';
|
|
6
6
|
import '../../types-81be0ba3.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Request, Response, Router, RequestHandler } from 'express';
|
|
2
|
-
import { a as HttpContext, H as HttpOptions } from '../../
|
|
2
|
+
import { a as HttpContext, H as HttpOptions } from '../../types-68f2ec2a.js';
|
|
3
3
|
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import '../../types-81be0ba3.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FastifyRequest, FastifyReply, FastifyInstance, FastifyPluginCallback, FastifyRegisterOptions, FastifyPluginOptions, RouteShorthandOptions } from 'fastify';
|
|
2
|
-
import { a as HttpContext, H as HttpOptions } from '../../
|
|
2
|
+
import { a as HttpContext, H as HttpOptions } from '../../types-68f2ec2a.js';
|
|
3
3
|
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import '../../types-81be0ba3.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { H3Event, Router, _RequestMiddleware } from 'h3';
|
|
2
2
|
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
3
|
-
import { a as HttpContext, H as HttpOptions } from '../../
|
|
3
|
+
import { a as HttpContext, H as HttpOptions } from '../../types-68f2ec2a.js';
|
|
4
4
|
import 'phecda-core';
|
|
5
5
|
import '../../types-81be0ba3.js';
|
|
6
6
|
import 'node:http';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, Hono, MiddlewareHandler } from 'hono';
|
|
2
|
-
import { a as HttpContext, H as HttpOptions } from '../../
|
|
2
|
+
import { a as HttpContext, H as HttpOptions } from '../../types-68f2ec2a.js';
|
|
3
3
|
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import '../../types-81be0ba3.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Request, Response, Router, MiddlewareHandler } from 'hyper-express';
|
|
2
|
-
import { a as HttpContext, H as HttpOptions } from '../../
|
|
2
|
+
import { a as HttpContext, H as HttpOptions } from '../../types-68f2ec2a.js';
|
|
3
3
|
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import '../../types-81be0ba3.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Router, { RouterParamContext } from '@koa/router';
|
|
2
2
|
import { DefaultContext, DefaultState } from 'koa';
|
|
3
|
-
import { a as HttpContext, H as HttpOptions } from '../../
|
|
3
|
+
import { a as HttpContext, H as HttpOptions } from '../../types-68f2ec2a.js';
|
|
4
4
|
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
5
5
|
import 'node:http';
|
|
6
6
|
import '../../types-81be0ba3.js';
|
package/dist/test.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare function TestFactory<T extends Construct[]>(...Modules: T): Promise<{
|
|
|
11
11
|
type SuperTestRequest<T> = {
|
|
12
12
|
[K in keyof T]: T[K] extends (...args: infer R) => any ? (...args: R) => Test : never;
|
|
13
13
|
};
|
|
14
|
-
declare function TestHttp(app: Server | any, { moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, isAgent?: boolean): Promise<supertest.SuperTestWithHost<Test> & Pick<supertest.Request, "type" | "
|
|
14
|
+
declare function TestHttp(app: Server | any, { moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, isAgent?: boolean): Promise<supertest.SuperTestWithHost<Test> & Pick<supertest.Request, "type" | "key" | "query" | "use" | "on" | "set" | "accept" | "auth" | "withCredentials" | "retry" | "ok" | "redirects" | "timeout" | "buffer" | "serialize" | "parse" | "ca" | "pfx" | "cert"> & {
|
|
15
15
|
module: <T extends Construct>(Module: T) => SuperTestRequest<PickFunc<InstanceType<T>>>;
|
|
16
16
|
}>;
|
|
17
17
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IncomingHttpHeaders } from 'node:http';
|
|
2
|
-
import { D as DefaultOptions, B as BaseContext
|
|
2
|
+
import { D as DefaultOptions, B as BaseContext } from './types-81be0ba3.js';
|
|
3
3
|
|
|
4
|
-
declare function resolveDep(ret: any, key: string): any;
|
|
5
4
|
interface HttpOptions extends DefaultOptions {
|
|
6
5
|
parallelRoute?: string | false;
|
|
7
6
|
parallelPlugins?: string[];
|
|
@@ -15,6 +14,5 @@ interface HttpContext extends BaseContext {
|
|
|
15
14
|
body: Record<string, any>;
|
|
16
15
|
headers: IncomingHttpHeaders;
|
|
17
16
|
}
|
|
18
|
-
declare function argToReq(params: ControllerMetaData['params'], args: any[], headers: Record<string, any>): any;
|
|
19
17
|
|
|
20
|
-
export { HttpOptions as H, HttpContext as a
|
|
18
|
+
export { HttpOptions as H, HttpContext as a };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { D as DefaultOptions, B as BaseContext } from './types-81be0ba3.js';
|
|
2
2
|
|
|
3
|
-
declare function genClientQueue(key?: string): string;
|
|
4
3
|
interface RpcServerOptions extends DefaultOptions {
|
|
5
4
|
}
|
|
6
5
|
interface RpcClientOptions {
|
|
@@ -15,4 +14,4 @@ interface RpcContext extends BaseContext {
|
|
|
15
14
|
isEvent?: boolean;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
export { RpcServerOptions as R, RpcClientOptions as a, RpcContext as b
|
|
17
|
+
export { RpcServerOptions as R, RpcClientOptions as a, RpcContext as b };
|