phecda-server 7.0.0-alpha.9 → 7.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/README.md +10 -10
- package/assets/schema.json +12 -9
- package/bin/cli.mjs +96 -37
- package/dist/chunk-5SUY5UVC.js +258 -0
- package/dist/chunk-5SUY5UVC.js.map +1 -0
- package/dist/{chunk-7ZGYJ5OW.mjs → chunk-6JAHCTOT.mjs} +7 -2
- package/dist/chunk-6JAHCTOT.mjs.map +1 -0
- package/dist/{chunk-V5EYXVJT.js → chunk-EDAWJVJ4.js} +42 -25
- package/dist/chunk-EDAWJVJ4.js.map +1 -0
- package/dist/{chunk-FX3LDQII.js → chunk-H7OCHDZT.js} +61 -70
- package/dist/chunk-H7OCHDZT.js.map +1 -0
- package/dist/chunk-KRUOHWFR.js +306 -0
- package/dist/chunk-KRUOHWFR.js.map +1 -0
- package/dist/{chunk-KJUD2BKE.js → chunk-KUGU3UGO.js} +23 -18
- package/dist/chunk-KUGU3UGO.js.map +1 -0
- package/dist/{chunk-CVPZWDXU.mjs → chunk-LBH4RXQQ.mjs} +11 -20
- package/dist/chunk-LBH4RXQQ.mjs.map +1 -0
- package/dist/{chunk-FXTJ3BJ6.mjs → chunk-MDPW6WGF.mjs} +10 -4
- package/dist/chunk-MDPW6WGF.mjs.map +1 -0
- package/dist/{chunk-5RBTN33A.js → chunk-RLFCI3RG.js} +11 -5
- package/dist/chunk-RLFCI3RG.js.map +1 -0
- package/dist/{chunk-ODVWOXVB.mjs → chunk-TTHYUNOT.mjs} +18 -1
- package/dist/chunk-TTHYUNOT.mjs.map +1 -0
- package/dist/chunk-VDOICQ2U.mjs +258 -0
- package/dist/chunk-VDOICQ2U.mjs.map +1 -0
- package/dist/chunk-WTJKTICN.mjs +306 -0
- package/dist/chunk-WTJKTICN.mjs.map +1 -0
- package/dist/{core-D_cz0tKa.d.ts → core-BOo3uGFX.d.ts} +2 -2
- package/dist/{core-BDkhrEyf.d.mts → core-CF45G79J.d.mts} +2 -2
- package/dist/core-DbqWh47p.d.mts +50 -0
- package/dist/core-Rq7BhPHE.d.ts +50 -0
- package/dist/helper.d.mts +3 -5
- package/dist/helper.d.ts +3 -5
- package/dist/helper.js +4 -5
- package/dist/helper.js.map +1 -0
- package/dist/helper.mjs +3 -4
- package/dist/helper.mjs.map +1 -0
- package/dist/http/elysia/index.d.mts +4 -4
- package/dist/http/elysia/index.d.ts +4 -4
- package/dist/http/elysia/index.js +42 -40
- package/dist/http/elysia/index.js.map +1 -0
- package/dist/http/elysia/index.mjs +5 -3
- package/dist/http/elysia/index.mjs.map +1 -0
- package/dist/http/express/index.d.mts +3 -3
- package/dist/http/express/index.d.ts +3 -3
- package/dist/http/express/index.js +39 -37
- package/dist/http/express/index.js.map +1 -0
- package/dist/http/express/index.mjs +4 -2
- package/dist/http/express/index.mjs.map +1 -0
- package/dist/http/fastify/index.d.mts +3 -3
- package/dist/http/fastify/index.d.ts +3 -3
- package/dist/http/fastify/index.js +40 -38
- package/dist/http/fastify/index.js.map +1 -0
- package/dist/http/fastify/index.mjs +5 -3
- package/dist/http/fastify/index.mjs.map +1 -0
- package/dist/http/h3/index.d.mts +3 -3
- package/dist/http/h3/index.d.ts +3 -3
- package/dist/http/h3/index.js +40 -38
- package/dist/http/h3/index.js.map +1 -0
- package/dist/http/h3/index.mjs +4 -2
- package/dist/http/h3/index.mjs.map +1 -0
- package/dist/http/hono/index.d.mts +3 -3
- package/dist/http/hono/index.d.ts +3 -3
- package/dist/http/hono/index.js +36 -34
- package/dist/http/hono/index.js.map +1 -0
- package/dist/http/hono/index.mjs +4 -2
- package/dist/http/hono/index.mjs.map +1 -0
- 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 +37 -35
- package/dist/http/hyper-express/index.js.map +1 -0
- package/dist/http/hyper-express/index.mjs +4 -2
- package/dist/http/hyper-express/index.mjs.map +1 -0
- package/dist/http/koa/index.d.mts +3 -3
- package/dist/http/koa/index.d.ts +3 -3
- package/dist/http/koa/index.js +39 -37
- package/dist/http/koa/index.js.map +1 -0
- package/dist/http/koa/index.mjs +4 -2
- package/dist/http/koa/index.mjs.map +1 -0
- package/dist/index.d.mts +76 -12
- package/dist/index.d.ts +76 -12
- package/dist/index.js +105 -49
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +68 -12
- package/dist/index.mjs.map +1 -0
- package/dist/{meta-BX5jhe4Z.d.mts → meta-BoS1E-Nz.d.mts} +6 -23
- package/dist/{meta-BX5jhe4Z.d.ts → meta-BoS1E-Nz.d.ts} +6 -23
- package/dist/rpc/bullmq/index.d.mts +4 -6
- package/dist/rpc/bullmq/index.d.ts +4 -6
- package/dist/rpc/bullmq/index.js +13 -80
- package/dist/rpc/bullmq/index.js.map +1 -0
- package/dist/rpc/bullmq/index.mjs +5 -72
- package/dist/rpc/bullmq/index.mjs.map +1 -0
- package/dist/rpc/electron/index.d.mts +13 -0
- package/dist/rpc/electron/index.d.ts +13 -0
- package/dist/rpc/electron/index.js +73 -0
- package/dist/rpc/electron/index.js.map +1 -0
- package/dist/rpc/electron/index.mjs +73 -0
- package/dist/rpc/electron/index.mjs.map +1 -0
- package/dist/rpc/kafka/index.d.mts +4 -9
- package/dist/rpc/kafka/index.d.ts +4 -9
- package/dist/rpc/kafka/index.js +12 -90
- package/dist/rpc/kafka/index.js.map +1 -0
- package/dist/rpc/kafka/index.mjs +5 -83
- package/dist/rpc/kafka/index.mjs.map +1 -0
- package/dist/rpc/nats/index.d.mts +4 -6
- package/dist/rpc/nats/index.d.ts +4 -6
- package/dist/rpc/nats/index.js +13 -72
- package/dist/rpc/nats/index.js.map +1 -0
- package/dist/rpc/nats/index.mjs +4 -63
- package/dist/rpc/nats/index.mjs.map +1 -0
- package/dist/rpc/rabbitmq/index.d.mts +4 -6
- package/dist/rpc/rabbitmq/index.d.ts +4 -6
- package/dist/rpc/rabbitmq/index.js +14 -79
- package/dist/rpc/rabbitmq/index.js.map +1 -0
- package/dist/rpc/rabbitmq/index.mjs +5 -70
- package/dist/rpc/rabbitmq/index.mjs.map +1 -0
- package/dist/rpc/redis/index.d.mts +4 -9
- package/dist/rpc/redis/index.d.ts +4 -9
- package/dist/rpc/redis/index.js +12 -78
- package/dist/rpc/redis/index.js.map +1 -0
- package/dist/rpc/redis/index.mjs +5 -71
- package/dist/rpc/redis/index.mjs.map +1 -0
- package/dist/rpc/web-ext/index.d.mts +2 -0
- package/dist/rpc/web-ext/index.d.ts +2 -0
- package/dist/rpc/web-ext/index.js +1 -0
- package/dist/rpc/web-ext/index.js.map +1 -0
- package/dist/rpc/web-ext/index.mjs +1 -0
- package/dist/rpc/web-ext/index.mjs.map +1 -0
- package/dist/rpc/ws/index.d.mts +14 -0
- package/dist/rpc/ws/index.d.ts +14 -0
- package/dist/rpc/ws/index.js +74 -0
- package/dist/rpc/ws/index.js.map +1 -0
- package/dist/rpc/ws/index.mjs +74 -0
- package/dist/rpc/ws/index.mjs.map +1 -0
- package/dist/test.d.mts +7 -3
- package/dist/test.d.ts +7 -3
- package/dist/test.js +7 -6
- package/dist/test.js.map +1 -0
- package/dist/test.mjs +3 -2
- package/dist/test.mjs.map +1 -0
- package/dist/types-CInz3bD0.d.ts +14 -0
- package/dist/types-E-rqlg3-.d.mts +14 -0
- package/dist/{types-DKVhyZk_.d.mts → types-SCJZFCYt.d.mts} +1 -1
- package/dist/{types-CMeuFoyd.d.ts → types-xruyYmyu.d.ts} +1 -1
- package/package.json +24 -8
- package/register/export.mjs +30 -0
- package/register/index.mjs +2 -3
- package/register/loader.mjs +83 -90
- package/register/utils.mjs +36 -6
- package/assets/ps.json +0 -24
- package/assets/tsconfig.json +0 -21
- package/dist/types-B-rUM9Fm.d.mts +0 -19
- package/dist/types-MxxtkZXw.d.ts +0 -19
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { Events
|
|
1
|
+
import { Events } from 'phecda-core';
|
|
2
2
|
|
|
3
3
|
declare const ERROR_SYMBOL = "__PS_ERROR__";
|
|
4
4
|
declare const IS_DEV: boolean;
|
|
5
5
|
declare const IS_ONLY_GENERATE: boolean;
|
|
6
6
|
declare const IS_STRICT: boolean;
|
|
7
|
+
declare const IS_PURE: boolean;
|
|
7
8
|
declare const LOG_LEVEL: number;
|
|
8
9
|
declare enum PS_EXIT_CODE {
|
|
9
|
-
RELAUNCH =
|
|
10
|
-
|
|
10
|
+
RELAUNCH = 4171,
|
|
11
|
+
EXIT = 4172
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
interface Emitter {
|
|
@@ -17,20 +18,6 @@ interface Emitter {
|
|
|
17
18
|
removeAllListeners<N extends keyof Events>(eventName: N): void;
|
|
18
19
|
emit<N extends keyof Events>(eventName: N, param: Events[N]): void;
|
|
19
20
|
}
|
|
20
|
-
type AnyFunction = (...args: any) => any;
|
|
21
|
-
type ParseInstance<Instance extends Record<string, AnyFunction>> = {
|
|
22
|
-
[Key in keyof Instance]: ToClientFn<Instance[Key]>;
|
|
23
|
-
};
|
|
24
|
-
type PickFuncKeys<Type> = {
|
|
25
|
-
[Key in keyof Type]: Type[Key] extends (...args: any) => any ? (ReturnType<Type[Key]> extends CustomResponse<any> ? never : Key) : never;
|
|
26
|
-
}[keyof Type];
|
|
27
|
-
type ToClientMap<ControllerMap extends Record<string, Construct>> = {
|
|
28
|
-
[Key in keyof ControllerMap]: ToClientInstance<InstanceType<ControllerMap[Key]>>;
|
|
29
|
-
};
|
|
30
|
-
type ToClientInstance<Instance extends Record<string, any>> = ParseInstance<PickFunc<Instance>>;
|
|
31
|
-
type ToClientFn<Func extends AnyFunction> = (...p: Parameters<Func>) => Promise<BaseReturn<ReturnType<Func>>>;
|
|
32
|
-
type PickFunc<Instance> = Pick<Instance, PickFuncKeys<Instance>>;
|
|
33
|
-
type OmitFunction<Instance> = Omit<Instance, PickFuncKeys<Instance>>;
|
|
34
21
|
interface BaseCtx {
|
|
35
22
|
meta: ControllerMeta;
|
|
36
23
|
moduleMap: Record<string, any>;
|
|
@@ -52,13 +39,9 @@ interface BaseError {
|
|
|
52
39
|
message: string;
|
|
53
40
|
description: string;
|
|
54
41
|
}
|
|
55
|
-
type BaseReturn<T> = Awaited<T> extends {
|
|
56
|
-
toJSON(): infer R;
|
|
57
|
-
} ? R : Awaited<T>;
|
|
58
42
|
type BaseRequestType = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'options';
|
|
59
|
-
declare const ResponseSymbol: unique symbol;
|
|
60
43
|
declare class CustomResponse<Value> {
|
|
61
|
-
|
|
44
|
+
_ps_response: Value;
|
|
62
45
|
}
|
|
63
46
|
type ExtractResponse<Class extends CustomResponse<any>> = Class extends CustomResponse<infer Value> ? Value : never;
|
|
64
47
|
|
|
@@ -104,4 +87,4 @@ interface ControllerMeta extends Meta {
|
|
|
104
87
|
data: ControllerMetaData;
|
|
105
88
|
}
|
|
106
89
|
|
|
107
|
-
export { type BaseCtx as B,
|
|
90
|
+
export { type BaseCtx as B, CustomResponse as C, type DefaultOptions as D, type Emitter as E, IS_DEV as I, LOG_LEVEL as L, Meta as M, PS_EXIT_CODE as P, type ServiceMetaData as S, type ControllerMeta as a, type ControllerMetaData as b, type BaseError as c, type BaseRequestType as d, type ExtractResponse as e, type MetaData as f, ERROR_SYMBOL as g, IS_ONLY_GENERATE as h, IS_STRICT as i, IS_PURE as j };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { Events
|
|
1
|
+
import { Events } from 'phecda-core';
|
|
2
2
|
|
|
3
3
|
declare const ERROR_SYMBOL = "__PS_ERROR__";
|
|
4
4
|
declare const IS_DEV: boolean;
|
|
5
5
|
declare const IS_ONLY_GENERATE: boolean;
|
|
6
6
|
declare const IS_STRICT: boolean;
|
|
7
|
+
declare const IS_PURE: boolean;
|
|
7
8
|
declare const LOG_LEVEL: number;
|
|
8
9
|
declare enum PS_EXIT_CODE {
|
|
9
|
-
RELAUNCH =
|
|
10
|
-
|
|
10
|
+
RELAUNCH = 4171,
|
|
11
|
+
EXIT = 4172
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
interface Emitter {
|
|
@@ -17,20 +18,6 @@ interface Emitter {
|
|
|
17
18
|
removeAllListeners<N extends keyof Events>(eventName: N): void;
|
|
18
19
|
emit<N extends keyof Events>(eventName: N, param: Events[N]): void;
|
|
19
20
|
}
|
|
20
|
-
type AnyFunction = (...args: any) => any;
|
|
21
|
-
type ParseInstance<Instance extends Record<string, AnyFunction>> = {
|
|
22
|
-
[Key in keyof Instance]: ToClientFn<Instance[Key]>;
|
|
23
|
-
};
|
|
24
|
-
type PickFuncKeys<Type> = {
|
|
25
|
-
[Key in keyof Type]: Type[Key] extends (...args: any) => any ? (ReturnType<Type[Key]> extends CustomResponse<any> ? never : Key) : never;
|
|
26
|
-
}[keyof Type];
|
|
27
|
-
type ToClientMap<ControllerMap extends Record<string, Construct>> = {
|
|
28
|
-
[Key in keyof ControllerMap]: ToClientInstance<InstanceType<ControllerMap[Key]>>;
|
|
29
|
-
};
|
|
30
|
-
type ToClientInstance<Instance extends Record<string, any>> = ParseInstance<PickFunc<Instance>>;
|
|
31
|
-
type ToClientFn<Func extends AnyFunction> = (...p: Parameters<Func>) => Promise<BaseReturn<ReturnType<Func>>>;
|
|
32
|
-
type PickFunc<Instance> = Pick<Instance, PickFuncKeys<Instance>>;
|
|
33
|
-
type OmitFunction<Instance> = Omit<Instance, PickFuncKeys<Instance>>;
|
|
34
21
|
interface BaseCtx {
|
|
35
22
|
meta: ControllerMeta;
|
|
36
23
|
moduleMap: Record<string, any>;
|
|
@@ -52,13 +39,9 @@ interface BaseError {
|
|
|
52
39
|
message: string;
|
|
53
40
|
description: string;
|
|
54
41
|
}
|
|
55
|
-
type BaseReturn<T> = Awaited<T> extends {
|
|
56
|
-
toJSON(): infer R;
|
|
57
|
-
} ? R : Awaited<T>;
|
|
58
42
|
type BaseRequestType = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'options';
|
|
59
|
-
declare const ResponseSymbol: unique symbol;
|
|
60
43
|
declare class CustomResponse<Value> {
|
|
61
|
-
|
|
44
|
+
_ps_response: Value;
|
|
62
45
|
}
|
|
63
46
|
type ExtractResponse<Class extends CustomResponse<any>> = Class extends CustomResponse<infer Value> ? Value : never;
|
|
64
47
|
|
|
@@ -104,4 +87,4 @@ interface ControllerMeta extends Meta {
|
|
|
104
87
|
data: ControllerMetaData;
|
|
105
88
|
}
|
|
106
89
|
|
|
107
|
-
export { type BaseCtx as B,
|
|
90
|
+
export { type BaseCtx as B, CustomResponse as C, type DefaultOptions as D, type Emitter as E, IS_DEV as I, LOG_LEVEL as L, Meta as M, PS_EXIT_CODE as P, type ServiceMetaData as S, type ControllerMeta as a, type ControllerMetaData as b, type BaseError as c, type BaseRequestType as d, type ExtractResponse as e, type MetaData as f, ERROR_SYMBOL as g, IS_ONLY_GENERATE as h, IS_STRICT as i, IS_PURE as j };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions
|
|
4
|
-
import { T as ToClientMap } from '../../meta-BX5jhe4Z.mjs';
|
|
2
|
+
import { F as Factory } from '../../core-DbqWh47p.mjs';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-E-rqlg3-.mjs';
|
|
5
4
|
import 'phecda-core';
|
|
5
|
+
import '../../meta-BoS1E-Nz.mjs';
|
|
6
6
|
|
|
7
7
|
interface BullmqCtx extends RpcCtx {
|
|
8
8
|
type: 'bullmq';
|
|
@@ -16,6 +16,4 @@ declare function create({ moduleMap, meta }: Awaited<ReturnType<typeof Factory>>
|
|
|
16
16
|
queueMap: Record<string, Queue<any, any, string, any, any, string>>;
|
|
17
17
|
}>;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export { type BullmqCtx, type BullmqOptions, create, createClient };
|
|
19
|
+
export { type BullmqCtx, type BullmqOptions, create };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions
|
|
4
|
-
import { T as ToClientMap } from '../../meta-BX5jhe4Z.js';
|
|
2
|
+
import { F as Factory } from '../../core-Rq7BhPHE.js';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-CInz3bD0.js';
|
|
5
4
|
import 'phecda-core';
|
|
5
|
+
import '../../meta-BoS1E-Nz.js';
|
|
6
6
|
|
|
7
7
|
interface BullmqCtx extends RpcCtx {
|
|
8
8
|
type: 'bullmq';
|
|
@@ -16,6 +16,4 @@ declare function create({ moduleMap, meta }: Awaited<ReturnType<typeof Factory>>
|
|
|
16
16
|
queueMap: Record<string, Queue<any, any, string, any, any, string>>;
|
|
17
17
|
}>;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export { type BullmqCtx, type BullmqOptions, create, createClient };
|
|
19
|
+
export { type BullmqCtx, type BullmqOptions, create };
|
package/dist/rpc/bullmq/index.js
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
var _chunkH7OCHDZTjs = require('../../chunk-H7OCHDZT.js');
|
|
5
6
|
|
|
6
|
-
var _chunkFX3LDQIIjs = require('../../chunk-FX3LDQII.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
var _chunk5RBTN33Ajs = require('../../chunk-5RBTN33A.js');
|
|
9
|
+
var _chunkRLFCI3RGjs = require('../../chunk-RLFCI3RG.js');
|
|
11
10
|
|
|
12
11
|
// src/rpc/bullmq/create.ts
|
|
13
12
|
var _bullmq = require('bullmq');
|
|
@@ -18,14 +17,14 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
18
17
|
const workerMap = {};
|
|
19
18
|
const queueMap = {};
|
|
20
19
|
const existQueue = /* @__PURE__ */ new Set();
|
|
21
|
-
const metaMap =
|
|
20
|
+
const metaMap = _chunkH7OCHDZTjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
22
21
|
const { controller, rpc, func, tag } = meta2.data;
|
|
23
22
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
24
23
|
debug(`register method "${func}" in module "${tag}"`);
|
|
25
24
|
return true;
|
|
26
25
|
}
|
|
27
26
|
});
|
|
28
|
-
|
|
27
|
+
_chunkH7OCHDZTjs.detectAopDep.call(void 0, meta, {
|
|
29
28
|
guards: globalGuards
|
|
30
29
|
}, "rpc");
|
|
31
30
|
async function subscribeQueues() {
|
|
@@ -39,12 +38,12 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
39
38
|
if (existQueue.has(queue)) continue;
|
|
40
39
|
existQueue.add(queue);
|
|
41
40
|
workerMap[queue] = new (0, _bullmq.Worker)(queue, handleRequest, workerOpts);
|
|
42
|
-
|
|
41
|
+
_chunkH7OCHDZTjs.Context.applyAddons(addons, workerMap[queue], "bullmq");
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
|
-
|
|
46
|
+
_chunkRLFCI3RGjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
|
|
48
47
|
async function handleRequest(job) {
|
|
49
48
|
const { data } = job;
|
|
50
49
|
const { tag, func, args, id, queue: clientQueue, _ps } = data;
|
|
@@ -53,12 +52,12 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
53
52
|
const meta2 = metaMap.get(tag)[func];
|
|
54
53
|
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
55
54
|
if (!isEvent && !(clientQueue in queueMap)) queueMap[clientQueue] = new (0, _bullmq.Queue)(clientQueue, queueOpts);
|
|
56
|
-
const aop =
|
|
55
|
+
const aop = _chunkH7OCHDZTjs.Context.getAop(meta2, {
|
|
57
56
|
globalFilter,
|
|
58
57
|
globalGuards,
|
|
59
58
|
globalPipe
|
|
60
59
|
});
|
|
61
|
-
const context = new (0,
|
|
60
|
+
const context = new (0, _chunkH7OCHDZTjs.Context)({
|
|
62
61
|
type: "bullmq",
|
|
63
62
|
category: "rpc",
|
|
64
63
|
moduleMap,
|
|
@@ -86,9 +85,9 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
86
85
|
}
|
|
87
86
|
});
|
|
88
87
|
}
|
|
89
|
-
|
|
88
|
+
_chunkRLFCI3RGjs.__name.call(void 0, handleRequest, "handleRequest");
|
|
90
89
|
subscribeQueues();
|
|
91
|
-
|
|
90
|
+
_chunkRLFCI3RGjs.HMR.call(void 0, async () => {
|
|
92
91
|
for (const i in workerMap) await workerMap[i].close(true);
|
|
93
92
|
for (const i in queueMap) await queueMap[i].close();
|
|
94
93
|
await subscribeQueues();
|
|
@@ -98,74 +97,8 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
98
97
|
queueMap
|
|
99
98
|
};
|
|
100
99
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// src/rpc/bullmq/client.ts
|
|
104
|
-
var _events = require('events');
|
|
105
|
-
|
|
106
|
-
async function createClient(controllers, opts = {}) {
|
|
107
|
-
let eventId = 1;
|
|
108
|
-
let eventCount = 0;
|
|
109
|
-
const { max, workerOpts, queueOpts, timeout, key } = opts;
|
|
110
|
-
const ret = {};
|
|
111
|
-
const emitter = new (0, _events.EventEmitter)();
|
|
112
|
-
const clientQueue = _chunkFX3LDQIIjs.genClientQueue.call(void 0, key);
|
|
113
|
-
const queueMap = {};
|
|
114
|
-
new (0, _bullmq.Worker)(clientQueue, async (job) => {
|
|
115
|
-
const { data, id, error } = job.data;
|
|
116
|
-
emitter.emit(id, data, error);
|
|
117
|
-
}, workerOpts);
|
|
118
|
-
for (const i in controllers) {
|
|
119
|
-
ret[i] = new Proxy(new controllers[i](), {
|
|
120
|
-
get(target, p) {
|
|
121
|
-
if (typeof target[p] !== "function") throw new Error(`"${p}" in "${i}" is not an exposed rpc `);
|
|
122
|
-
let { tag, queue, isEvent } = target[p]();
|
|
123
|
-
return async (...args) => {
|
|
124
|
-
if (!queue) queue = tag;
|
|
125
|
-
if (!(queue in queueMap)) queueMap[queue] = new (0, _bullmq.Queue)(queue, queueOpts);
|
|
126
|
-
const id = `${eventId++}`;
|
|
127
|
-
queueMap[queue].add(`${tag}-${p}`, {
|
|
128
|
-
_ps: 1,
|
|
129
|
-
id,
|
|
130
|
-
args,
|
|
131
|
-
tag,
|
|
132
|
-
queue: clientQueue,
|
|
133
|
-
func: p
|
|
134
|
-
});
|
|
135
|
-
if (isEvent) return null;
|
|
136
|
-
return new Promise((resolve, reject) => {
|
|
137
|
-
if (max && eventCount >= max) reject({
|
|
138
|
-
type: "exceeded"
|
|
139
|
-
});
|
|
140
|
-
let isEnd = false;
|
|
141
|
-
const timer = setTimeout(() => {
|
|
142
|
-
if (!isEnd) {
|
|
143
|
-
eventCount--;
|
|
144
|
-
emitter.off(id, listener);
|
|
145
|
-
reject({
|
|
146
|
-
type: "timeout"
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}, timeout || 5e3);
|
|
150
|
-
function listener(data, error) {
|
|
151
|
-
eventCount--;
|
|
152
|
-
isEnd = true;
|
|
153
|
-
clearTimeout(timer);
|
|
154
|
-
if (error) reject(data);
|
|
155
|
-
else resolve(data);
|
|
156
|
-
}
|
|
157
|
-
_chunk5RBTN33Ajs.__name.call(void 0, listener, "listener");
|
|
158
|
-
eventCount++;
|
|
159
|
-
emitter.once(id, listener);
|
|
160
|
-
});
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
return ret;
|
|
166
|
-
}
|
|
167
|
-
_chunk5RBTN33Ajs.__name.call(void 0, createClient, "createClient");
|
|
168
|
-
|
|
100
|
+
_chunkRLFCI3RGjs.__name.call(void 0, create, "create");
|
|
169
101
|
|
|
170
102
|
|
|
171
|
-
exports.create = create;
|
|
103
|
+
exports.create = create;
|
|
104
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["d:\\myproject\\phecda\\packages\\server\\dist\\rpc\\bullmq\\index.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,0DAAgC;AAChC;AACE;AACA;AACF,0DAAgC;AAChC;AACA;AACA,gCAAsC;AACtC,4EAAyB;AACzB,IAAI,MAAM,EAAE,6BAAK,sBAAuB,CAAC;AACzC,MAAM,SAAS,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE;AACtD,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,IAAI;AAC9F,EAAE,MAAM,UAAU,EAAE,CAAC,CAAC;AACtB,EAAE,MAAM,SAAS,EAAE,CAAC,CAAC;AACrB,EAAE,MAAM,WAAW,kBAAkB,IAAI,GAAG,CAAC,CAAC;AAC9C,EAAE,MAAM,QAAQ,EAAE,sDAAuB,IAAK,EAAE,CAAC,KAAK,EAAE,GAAG;AAC3D,IAAI,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,IAAI;AACrD,IAAI,GAAG,CAAC,WAAW,IAAI,MAAM,mBAAG,GAAG,2BAAE,QAAM,IAAI,KAAK,CAAC,EAAE;AACvD,MAAM,KAAK,CAAC,CAAC,iBAAiB,EAAE,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3D,MAAM,OAAO,IAAI;AACjB,IAAI;AACJ,EAAE,CAAC,CAAC;AACJ,EAAE,2CAAY,IAAK,EAAE;AACrB,IAAI,MAAM,EAAE;AACZ,EAAE,CAAC,EAAE,KAAK,CAAC;AACX,EAAE,MAAM,SAAS,eAAe,CAAC,EAAE;AACn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ACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA","file":"D:\\myproject\\phecda\\packages\\server\\dist\\rpc\\bullmq\\index.js","sourcesContent":[null]}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Context,
|
|
3
3
|
createControllerMetaMap,
|
|
4
|
-
detectAopDep
|
|
5
|
-
|
|
6
|
-
} from "../../chunk-CVPZWDXU.mjs";
|
|
4
|
+
detectAopDep
|
|
5
|
+
} from "../../chunk-LBH4RXQQ.mjs";
|
|
7
6
|
import {
|
|
8
7
|
HMR,
|
|
9
8
|
__name
|
|
10
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-MDPW6WGF.mjs";
|
|
11
10
|
|
|
12
11
|
// src/rpc/bullmq/create.ts
|
|
13
12
|
import { Queue, Worker } from "bullmq";
|
|
@@ -99,73 +98,7 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
99
98
|
};
|
|
100
99
|
}
|
|
101
100
|
__name(create, "create");
|
|
102
|
-
|
|
103
|
-
// src/rpc/bullmq/client.ts
|
|
104
|
-
import { EventEmitter } from "events";
|
|
105
|
-
import { Queue as Queue2, Worker as Worker2 } from "bullmq";
|
|
106
|
-
async function createClient(controllers, opts = {}) {
|
|
107
|
-
let eventId = 1;
|
|
108
|
-
let eventCount = 0;
|
|
109
|
-
const { max, workerOpts, queueOpts, timeout, key } = opts;
|
|
110
|
-
const ret = {};
|
|
111
|
-
const emitter = new EventEmitter();
|
|
112
|
-
const clientQueue = genClientQueue(key);
|
|
113
|
-
const queueMap = {};
|
|
114
|
-
new Worker2(clientQueue, async (job) => {
|
|
115
|
-
const { data, id, error } = job.data;
|
|
116
|
-
emitter.emit(id, data, error);
|
|
117
|
-
}, workerOpts);
|
|
118
|
-
for (const i in controllers) {
|
|
119
|
-
ret[i] = new Proxy(new controllers[i](), {
|
|
120
|
-
get(target, p) {
|
|
121
|
-
if (typeof target[p] !== "function") throw new Error(`"${p}" in "${i}" is not an exposed rpc `);
|
|
122
|
-
let { tag, queue, isEvent } = target[p]();
|
|
123
|
-
return async (...args) => {
|
|
124
|
-
if (!queue) queue = tag;
|
|
125
|
-
if (!(queue in queueMap)) queueMap[queue] = new Queue2(queue, queueOpts);
|
|
126
|
-
const id = `${eventId++}`;
|
|
127
|
-
queueMap[queue].add(`${tag}-${p}`, {
|
|
128
|
-
_ps: 1,
|
|
129
|
-
id,
|
|
130
|
-
args,
|
|
131
|
-
tag,
|
|
132
|
-
queue: clientQueue,
|
|
133
|
-
func: p
|
|
134
|
-
});
|
|
135
|
-
if (isEvent) return null;
|
|
136
|
-
return new Promise((resolve, reject) => {
|
|
137
|
-
if (max && eventCount >= max) reject({
|
|
138
|
-
type: "exceeded"
|
|
139
|
-
});
|
|
140
|
-
let isEnd = false;
|
|
141
|
-
const timer = setTimeout(() => {
|
|
142
|
-
if (!isEnd) {
|
|
143
|
-
eventCount--;
|
|
144
|
-
emitter.off(id, listener);
|
|
145
|
-
reject({
|
|
146
|
-
type: "timeout"
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}, timeout || 5e3);
|
|
150
|
-
function listener(data, error) {
|
|
151
|
-
eventCount--;
|
|
152
|
-
isEnd = true;
|
|
153
|
-
clearTimeout(timer);
|
|
154
|
-
if (error) reject(data);
|
|
155
|
-
else resolve(data);
|
|
156
|
-
}
|
|
157
|
-
__name(listener, "listener");
|
|
158
|
-
eventCount++;
|
|
159
|
-
emitter.once(id, listener);
|
|
160
|
-
});
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
return ret;
|
|
166
|
-
}
|
|
167
|
-
__name(createClient, "createClient");
|
|
168
101
|
export {
|
|
169
|
-
create
|
|
170
|
-
createClient
|
|
102
|
+
create
|
|
171
103
|
};
|
|
104
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/rpc/bullmq/create.ts"],"sourcesContent":["import type { Job, QueueOptions, WorkerOptions } from 'bullmq'\r\nimport { Queue, Worker } from 'bullmq'\r\nimport Debug from 'debug'\r\nimport type { Factory } from '../../core'\r\nimport { Context } from '../../context'\r\nimport type { RpcCtx, RpcServerOptions } from '../types'\r\nimport { HMR } from '../../hmr'\r\n\r\nimport { createControllerMetaMap, detectAopDep } from '../../helper'\r\n\r\nconst debug = Debug('phecda-server/bullmq')\r\n\r\nexport interface BullmqCtx extends RpcCtx {\r\n type: 'bullmq'\r\n}\r\n\r\nexport type BullmqOptions = Omit<RpcServerOptions, 'globalAddons'> & {\r\n workerOpts?: WorkerOptions\r\n queueOpts?: QueueOptions\r\n}\r\n\r\nexport async function create({ moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, opts: BullmqOptions = {}) {\r\n const { globalGuards, globalFilter, globalPipe, workerOpts, queueOpts, defaultQueue } = opts\r\n\r\n const workerMap: Record<string, Worker> = {}\r\n const queueMap: Record<string, Queue> = {}\r\n const existQueue = new Set<string>()\r\n const metaMap = createControllerMetaMap(meta, (meta) => {\r\n const { controller, rpc, func, tag } = meta.data\r\n if (controller === 'rpc' && rpc?.queue !== undefined) {\r\n debug(`register method \"${func}\" in module \"${tag}\"`)\r\n return true\r\n }\r\n })\r\n\r\n detectAopDep(meta, {\r\n guards: globalGuards,\r\n }, 'rpc')\r\n\r\n async function subscribeQueues() {\r\n existQueue.clear()\r\n for (const [tag, record] of metaMap) {\r\n for (const func in record) {\r\n const meta = metaMap.get(tag)![func]\r\n\r\n const {\r\n data: {\r\n rpc,\r\n addons,\r\n },\r\n } = meta\r\n\r\n if (rpc) {\r\n const queue = rpc.queue || defaultQueue || tag\r\n if (existQueue.has(queue))\r\n continue\r\n existQueue.add(queue)\r\n workerMap[queue] = new Worker(queue, handleRequest, workerOpts)\r\n\r\n Context.applyAddons(addons, workerMap[queue], 'bullmq')\r\n }\r\n }\r\n }\r\n }\r\n\r\n async function handleRequest(job: Job) {\r\n const { data } = job\r\n const { tag, func, args, id, queue: clientQueue, _ps } = data\r\n if (_ps !== 1)\r\n return\r\n debug(`invoke method \"${func}\" in module \"${tag}\"`)\r\n const meta = metaMap.get(tag)![func]\r\n\r\n const {\r\n data: {\r\n rpc: { isEvent } = {},\r\n },\r\n } = meta\r\n\r\n if (!isEvent && !(clientQueue in queueMap))\r\n queueMap[clientQueue] = new Queue(clientQueue, queueOpts)\r\n\r\n const aop = Context.getAop(meta, {\r\n globalFilter,\r\n globalGuards,\r\n globalPipe,\r\n })\r\n const context = new Context<BullmqCtx>({\r\n type: 'bullmq',\r\n category: 'rpc',\r\n moduleMap,\r\n meta,\r\n tag,\r\n func,\r\n data,\r\n args,\r\n id,\r\n queue: job.queueName,\r\n isEvent,\r\n })\r\n\r\n await context.run(aop, (returnData) => {\r\n if (!isEvent)\r\n\r\n queueMap[clientQueue].add(`${tag}-${func}`, { data: returnData, id })\r\n }, (err) => {\r\n if (!isEvent) {\r\n queueMap[clientQueue].add(`${tag}-${func}`, {\r\n data: err,\r\n error: true,\r\n id,\r\n })\r\n }\r\n })\r\n }\r\n\r\n subscribeQueues()\r\n\r\n HMR(async () => {\r\n for (const i in workerMap)\r\n await workerMap[i].close(true)\r\n for (const i in queueMap)\r\n await queueMap[i].close()\r\n\r\n await subscribeQueues()\r\n })\r\n\r\n return { workerMap, queueMap }\r\n}\r\n"],"mappings":";;;;;;;;;;;AACA,SAASA,OAAOC,cAAc;AAC9B,OAAOC,WAAW;AAQlB,IAAMC,QAAQC,MAAM,sBAAA;AAWpB,eAAsBC,OAAO,EAAEC,WAAWC,KAAI,GAAyCC,OAAsB,CAAC,GAAC;AAC7G,QAAM,EAAEC,cAAcC,cAAcC,YAAYC,YAAYC,WAAWC,aAAY,IAAKN;AAExF,QAAMO,YAAoC,CAAC;AAC3C,QAAMC,WAAkC,CAAC;AACzC,QAAMC,aAAa,oBAAIC,IAAAA;AACvB,QAAMC,UAAUC,wBAAwBb,MAAM,CAACA,UAAAA;AAC7C,UAAM,EAAEc,YAA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UAAMmC,MAAMT,QAAQU,OAAO1C,OAAM;MAC/BG;MACAD;MACAE;IACF,CAAA;AACA,UAAMuC,UAAU,IAAIX,QAAmB;MACrCY,MAAM;MACNC,UAAU;MACV9C;MACAC,MAAAA;MACAiB;MACAD;MACAE;MACAiB;MACAC;MACAjB,OAAOe,IAAIY;MACXP;IACF,CAAA;AAEA,UAAMI,QAAQI,IAAIN,KAAK,CAACO,eAAAA;AACtB,UAAI,CAACT,QAEH9B,UAAS4B,WAAAA,EAAaR,IAAI,GAAGZ,GAAAA,IAAOD,IAAAA,IAAQ;QAAEE,MAAM8B;QAAYZ;MAAG,CAAA;IACvE,GAAG,CAACa,QAAAA;AACF,UAAI,CAACV,SAAS;AACZ9B,iBAAS4B,WAAAA,EAAaR,IAAI,GAAGZ,GAAAA,IAAOD,IAAAA,IAAQ;UAC1CE,MAAM+B;UACNC,OAAO;UACPd;QACF,CAAA;MACF;IACF,CAAA;EACF;AAjDeL;AAmDfR,kBAAAA;AAEA4B,MAAI,YAAA;AACF,eAAWC,KAAK5C,UACd,OAAMA,UAAU4C,CAAAA,EAAGC,MAAM,IAAA;AAC3B,eAAWD,KAAK3C,SACd,OAAMA,SAAS2C,CAAAA,EAAGC,MAAK;AAEzB,UAAM9B,gBAAAA;EACR,CAAA;AAEA,SAAO;IAAEf;IAAWC;EAAS;AAC/B;AA3GsBX;","names":["Queue","Worker","Debug","debug","Debug","create","moduleMap","meta","opts","globalGuards","globalFilter","globalPipe","workerOpts","queueOpts","defaultQueue","workerMap","queueMap","existQueue","Set","metaMap","createControllerMetaMap","controller","rpc","func","tag","data","queue","undefined","detectAopDep","guards","subscribeQueues","clear","record","get","addons","has","add","Worker","handleRequest","Context","applyAddons","job","args","id","clientQueue","_ps","isEvent","Queue","aop","getAop","context","type","category","queueName","run","returnData","err","error","HMR","i","close"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Electron from 'electron';
|
|
2
|
+
import { F as Factory } from '../../core-DbqWh47p.mjs';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-E-rqlg3-.mjs';
|
|
4
|
+
import 'phecda-core';
|
|
5
|
+
import '../../meta-BoS1E-Nz.mjs';
|
|
6
|
+
|
|
7
|
+
interface ElectronCtx extends RpcCtx {
|
|
8
|
+
type: 'electron';
|
|
9
|
+
event: Electron.IpcMainEvent | Electron.IpcMainInvokeEvent;
|
|
10
|
+
}
|
|
11
|
+
declare function bind(IPC: Electron.IpcMain, { moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, opts?: RpcServerOptions): void;
|
|
12
|
+
|
|
13
|
+
export { type ElectronCtx, bind };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Electron from 'electron';
|
|
2
|
+
import { F as Factory } from '../../core-Rq7BhPHE.js';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-CInz3bD0.js';
|
|
4
|
+
import 'phecda-core';
|
|
5
|
+
import '../../meta-BoS1E-Nz.js';
|
|
6
|
+
|
|
7
|
+
interface ElectronCtx extends RpcCtx {
|
|
8
|
+
type: 'electron';
|
|
9
|
+
event: Electron.IpcMainEvent | Electron.IpcMainInvokeEvent;
|
|
10
|
+
}
|
|
11
|
+
declare function bind(IPC: Electron.IpcMain, { moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, opts?: RpcServerOptions): void;
|
|
12
|
+
|
|
13
|
+
export { type ElectronCtx, bind };
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkH7OCHDZTjs = require('../../chunk-H7OCHDZT.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkRLFCI3RGjs = require('../../chunk-RLFCI3RG.js');
|
|
9
|
+
|
|
10
|
+
// src/rpc/electron/bind.ts
|
|
11
|
+
var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
12
|
+
var debug = _debug2.default.call(void 0, "phecda-server/electron");
|
|
13
|
+
function bind(IPC, { moduleMap, meta }, opts = {}) {
|
|
14
|
+
const { globalGuards, globalFilter, globalPipe, globalAddons = [] } = opts;
|
|
15
|
+
const metaMap = _chunkH7OCHDZTjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
16
|
+
const { controller, rpc, func, tag } = meta2.data;
|
|
17
|
+
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
18
|
+
debug(`register method "${func}" in module "${tag}"`);
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
_chunkH7OCHDZTjs.detectAopDep.call(void 0, meta, {
|
|
23
|
+
guards: globalGuards,
|
|
24
|
+
addons: globalAddons
|
|
25
|
+
}, "rpc");
|
|
26
|
+
IPC.handle("phecda-server:invoke", callback);
|
|
27
|
+
IPC.on("phecda-server:send", callback);
|
|
28
|
+
async function callback(event, data) {
|
|
29
|
+
const { func, id, tag, _ps, args } = data || {};
|
|
30
|
+
debug(`invoke method "${func}" in module "${tag}"`);
|
|
31
|
+
if (_ps !== 1) return;
|
|
32
|
+
const meta2 = metaMap.get(tag)[func];
|
|
33
|
+
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
34
|
+
const aop = _chunkH7OCHDZTjs.Context.getAop(meta2, {
|
|
35
|
+
globalFilter,
|
|
36
|
+
globalGuards,
|
|
37
|
+
globalPipe
|
|
38
|
+
});
|
|
39
|
+
const context = new (0, _chunkH7OCHDZTjs.Context)({
|
|
40
|
+
type: "electron",
|
|
41
|
+
category: "rpc",
|
|
42
|
+
moduleMap,
|
|
43
|
+
meta: meta2,
|
|
44
|
+
tag,
|
|
45
|
+
func,
|
|
46
|
+
args,
|
|
47
|
+
id,
|
|
48
|
+
isEvent,
|
|
49
|
+
queue: tag,
|
|
50
|
+
event
|
|
51
|
+
});
|
|
52
|
+
return await context.run(aop, (returnData) => {
|
|
53
|
+
if (!isEvent) return {
|
|
54
|
+
data: returnData,
|
|
55
|
+
id
|
|
56
|
+
};
|
|
57
|
+
}, (err) => {
|
|
58
|
+
if (!isEvent) {
|
|
59
|
+
return {
|
|
60
|
+
data: err,
|
|
61
|
+
error: true,
|
|
62
|
+
id
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
_chunkRLFCI3RGjs.__name.call(void 0, callback, "callback");
|
|
68
|
+
}
|
|
69
|
+
_chunkRLFCI3RGjs.__name.call(void 0, bind, "bind");
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
exports.bind = bind;
|
|
73
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["d:\\myproject\\phecda\\packages\\server\\dist\\rpc\\electron\\index.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACA;AACA,4EAAyB;AACzB,IAAI,MAAM,EAAE,6BAAK,wBAAyB,CAAC;AAC3C,SAAS,IAAI,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE;AACnD,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI;AAC5E,EAAE,MAAM,QAAQ,EAAE,sDAAuB,IAAK,EAAE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AY;AAClB,MAAM,YAAY;AAClB,MAAM;AACN,IAAI,CAAC,CAAC;AACN,IAAI,MAAM,QAAQ,EAAE,IAAI,6BAAO,CAAC;AAChC,MAAM,IAAI,EAAE,UAAU;AACtB,MAAM,QAAQ,EAAE,KAAK;AACrB,MAAM,SAAS;AACf,MAAM,IAAI,EAAE,KAAK;AACjB,MAAM,GAAG;AACT,MAAM,IAAI;AACV,MAAM,IAAI;AACV,MAAM,EAAE;AACR,MAAM,OAAO;AACb,MAAM,KAAK,EAAE,GAAG;AAChB,MAAM;AACN,IAAI,CAAC,CAAC;AACN,IAAI,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,GAAG;AAClD,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO;AAC3B,QAAQ,IAAI,EAAE,UAAU;AACxB,QAAQ;AACR,MAAM,CAAC;AACP,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG;AAChB,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE;AACpB,QAAQ,OAAO;AACf,UAAU,IAAI,EAAE,GAAG;AACnB,UAAU,KAAK,EAAE,IAAI;AACrB,UAAU;AACV,QAAQ,CAAC;AACT,MAAM;AACN,IAAI,CAAC,CAAC;AACN,EAAE;AACF,EAAE,qCAAM,QAAS,EAAE,UAAU,CAAC;AAC9B;AACA,qCAAM,IAAK,EAAE,MAAM,CAAC;AACpB;AACE;AACF,oBAAC","file":"D:\\myproject\\phecda\\packages\\server\\dist\\rpc\\electron\\index.js","sourcesContent":[null]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Context,
|
|
3
|
+
createControllerMetaMap,
|
|
4
|
+
detectAopDep
|
|
5
|
+
} from "../../chunk-LBH4RXQQ.mjs";
|
|
6
|
+
import {
|
|
7
|
+
__name
|
|
8
|
+
} from "../../chunk-MDPW6WGF.mjs";
|
|
9
|
+
|
|
10
|
+
// src/rpc/electron/bind.ts
|
|
11
|
+
import Debug from "debug";
|
|
12
|
+
var debug = Debug("phecda-server/electron");
|
|
13
|
+
function bind(IPC, { moduleMap, meta }, opts = {}) {
|
|
14
|
+
const { globalGuards, globalFilter, globalPipe, globalAddons = [] } = opts;
|
|
15
|
+
const metaMap = createControllerMetaMap(meta, (meta2) => {
|
|
16
|
+
const { controller, rpc, func, tag } = meta2.data;
|
|
17
|
+
if (controller === "rpc" && rpc?.queue !== void 0) {
|
|
18
|
+
debug(`register method "${func}" in module "${tag}"`);
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
detectAopDep(meta, {
|
|
23
|
+
guards: globalGuards,
|
|
24
|
+
addons: globalAddons
|
|
25
|
+
}, "rpc");
|
|
26
|
+
IPC.handle("phecda-server:invoke", callback);
|
|
27
|
+
IPC.on("phecda-server:send", callback);
|
|
28
|
+
async function callback(event, data) {
|
|
29
|
+
const { func, id, tag, _ps, args } = data || {};
|
|
30
|
+
debug(`invoke method "${func}" in module "${tag}"`);
|
|
31
|
+
if (_ps !== 1) return;
|
|
32
|
+
const meta2 = metaMap.get(tag)[func];
|
|
33
|
+
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
34
|
+
const aop = Context.getAop(meta2, {
|
|
35
|
+
globalFilter,
|
|
36
|
+
globalGuards,
|
|
37
|
+
globalPipe
|
|
38
|
+
});
|
|
39
|
+
const context = new Context({
|
|
40
|
+
type: "electron",
|
|
41
|
+
category: "rpc",
|
|
42
|
+
moduleMap,
|
|
43
|
+
meta: meta2,
|
|
44
|
+
tag,
|
|
45
|
+
func,
|
|
46
|
+
args,
|
|
47
|
+
id,
|
|
48
|
+
isEvent,
|
|
49
|
+
queue: tag,
|
|
50
|
+
event
|
|
51
|
+
});
|
|
52
|
+
return await context.run(aop, (returnData) => {
|
|
53
|
+
if (!isEvent) return {
|
|
54
|
+
data: returnData,
|
|
55
|
+
id
|
|
56
|
+
};
|
|
57
|
+
}, (err) => {
|
|
58
|
+
if (!isEvent) {
|
|
59
|
+
return {
|
|
60
|
+
data: err,
|
|
61
|
+
error: true,
|
|
62
|
+
id
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
__name(callback, "callback");
|
|
68
|
+
}
|
|
69
|
+
__name(bind, "bind");
|
|
70
|
+
export {
|
|
71
|
+
bind
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/rpc/electron/bind.ts"],"sourcesContent":["import Debug from 'debug'\r\nimport type Electron from 'electron'\r\nimport type { Factory } from '../../core'\r\nimport { Context } from '../../context'\r\nimport type { RpcCtx, RpcServerOptions } from '../types'\r\nimport { createControllerMetaMap, detectAopDep } from '../../helper'\r\nconst debug = Debug('phecda-server/electron')\r\n\r\nexport interface ElectronCtx extends RpcCtx {\r\n type: 'electron'\r\n event: Electron.IpcMainEvent | Electron.IpcMainInvokeEvent\r\n}\r\n\r\nexport function bind(IPC: Electron.IpcMain, { moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, opts: RpcServerOptions = {}) {\r\n const { globalGuards, globalFilter, globalPipe, globalAddons = [] } = opts\r\n const metaMap = createControllerMetaMap(meta, (meta) => {\r\n const { controller, rpc, func, tag } = meta.data\r\n if (controller === 'rpc' && rpc?.queue !== undefined) {\r\n debug(`register method \"${func}\" in module \"${tag}\"`)\r\n return true\r\n }\r\n })\r\n\r\n detectAopDep(meta, {\r\n guards: globalGuards,\r\n addons: globalAddons,\r\n }, 'rpc')\r\n\r\n IPC.handle('phecda-server:invoke', callback)\r\n\r\n IPC.on('phecda-server:send', callback)\r\n\r\n async function callback(event: Electron.IpcMainEvent | Electron.IpcMainInvokeEvent, data: any) {\r\n const { func, id, tag, _ps, args } = data || {}\r\n debug(`invoke method \"${func}\" in module \"${tag}\"`)\r\n\r\n if (_ps !== 1)\r\n return\r\n const meta = metaMap.get(tag)![func]\r\n\r\n const {\r\n data: { rpc: { isEvent } = {} },\r\n } = meta\r\n\r\n const aop = Context.getAop(meta, {\r\n globalFilter,\r\n globalGuards,\r\n globalPipe,\r\n })\r\n const context = new Context(<ElectronCtx>{\r\n type: 'electron',\r\n category: 'rpc',\r\n moduleMap,\r\n meta,\r\n tag,\r\n func,\r\n args,\r\n id,\r\n isEvent,\r\n queue: tag,\r\n event,\r\n })\r\n return await context.run(aop, (returnData) => {\r\n if (!isEvent)\r\n return { data: returnData, id }\r\n }, (err) => {\r\n if (!isEvent) {\r\n return {\r\n data: err,\r\n error: true,\r\n id,\r\n }\r\n }\r\n })\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,WAAW;AAMlB,IAAMC,QAAQC,MAAM,wBAAA;AAOb,SAASC,KAAKC,KAAuB,EAAEC,WAAWC,KAAI,GAAyCC,OAAyB,CAAC,GAAC;AAC/H,QAAM,EAAEC,cAAcC,cAAcC,YAAYC,eAAe,CAAA,EAAE,IAAKJ;AACtE,QAAMK,UAAUC,wBAAwBP,MAAM,CAACA,UAAAA;AAC7C,UAAM,EAAEQ,YAAYC,KAAKC,MAAMC,IAAG,IAAKX,MAAKY;AAC5C,QAAIJ,eAAe,SAASC,KAAKI,UAAUC,QAAW;AACpDnB,YAAM,oBAAoBe,IAAAA,gBAAoBC,GAAAA,GAAM;AACpD,aAAO;IACT;EACF,CAAA;AAEAI,eAAaf,MAAM;IACjBgB,QAAQd;IACRe,QAAQZ;EACV,GAAG,KAAA;AAEHP,MAAIoB,OAAO,wBAAwBC,QAAAA;AAEnCrB,MAAIsB,GAAG,sBAAsBD,QAAAA;AAE7B,iBAAeA,SAASE,OAA4DT,MAAS;AAC3F,UAAM,EAAEF,MAAMY,IAAIX,KAAKY,KAAKC,KAAI,IAAKZ,QAAQ,CAAC;AAC9CjB,UAAM,kBAAkBe,IAAAA,gBAAoBC,GAAAA,GAAM;AAElD,QAAIY,QAAQ,EACV;AACF,UAAMvB,QAAOM,QAAQmB,IAAId,GAAAA,EAAMD,IAAAA;AAE/B,UAAM,EACJE,MAAM,EAAEH,KAAK,EAAEiB,QAAO,IAAK,CAAC,EAAC,EAAE,IAC7B1B;AAEJ,UAAM2B,MAAMC,QAAQC,OAAO7B,OAAM;MAC/BG;MACAD;MACAE;IACF,CAAA;AACA,UAAM0B,UAAU,IAAIF,QAAqB;MACvCG,MAAM;MACNC,UAAU;MACVjC;MACAC,MAAAA;MACAW;MACAD;MACAc;MACAF;MACAI;MACAb,OAAOF;MACPU;IACF,CAAA;AACA,WAAO,MAAMS,QAAQG,IAAIN,KAAK,CAACO,eAAAA;AAC7B,UAAI,CAACR,QACH,QAAO;QAAEd,MAAMsB;QAAYZ;MAAG;IAClC,GAAG,CAACa,QAAAA;AACF,UAAI,CAACT,SAAS;AACZ,eAAO;UACLd,MAAMuB;UACNC,OAAO;UACPd;QACF;MACF;IACF,CAAA;EACF;AA1CeH;AA2CjB;AA9DgBtB;","names":["Debug","debug","Debug","bind","IPC","moduleMap","meta","opts","globalGuards","globalFilter","globalPipe","globalAddons","metaMap","createControllerMetaMap","controller","rpc","func","tag","data","queue","undefined","detectAopDep","guards","addons","handle","callback","on","event","id","_ps","args","get","isEvent","aop","Context","getAop","context","type","category","run","returnData","err","error"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Consumer, Producer } from 'kafkajs';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions
|
|
4
|
-
import { T as ToClientMap } from '../../meta-BX5jhe4Z.mjs';
|
|
2
|
+
import { F as Factory } from '../../core-DbqWh47p.mjs';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-E-rqlg3-.mjs';
|
|
5
4
|
import 'phecda-core';
|
|
5
|
+
import '../../meta-BoS1E-Nz.mjs';
|
|
6
6
|
|
|
7
7
|
interface KafkaCtx extends RpcCtx {
|
|
8
8
|
type: 'kafka';
|
|
@@ -16,9 +16,4 @@ declare function bind({ consumer, producer }: {
|
|
|
16
16
|
producer: Producer;
|
|
17
17
|
}, { moduleMap, meta }: Awaited<ReturnType<typeof Factory>>, opts?: RpcServerOptions): Promise<void>;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
producer: Producer;
|
|
21
|
-
consumer: Consumer;
|
|
22
|
-
}, controllers: S, opts?: RpcClientOptions): Promise<ToClientMap<S>>;
|
|
23
|
-
|
|
24
|
-
export { type KafkaCtx, bind, createClient };
|
|
19
|
+
export { type KafkaCtx, bind };
|