phecda-server 8.2.0 → 8.3.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/dist/{chunk-MPKVT4SQ.js → chunk-R73A7HS3.js} +35 -34
- package/dist/{chunk-2P2UICBC.mjs → chunk-US2DTB3Z.mjs} +35 -34
- package/dist/{core-D1YYphEn.d.mts → core-mOKtuP0F.d.mts} +1 -1
- package/dist/{core-BTSHIAyB.d.ts → core-qL97H3d_.d.ts} +1 -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 +17 -17
- package/dist/http/elysia/index.mjs +1 -1
- package/dist/http/express/index.d.mts +3 -3
- package/dist/http/express/index.d.ts +3 -3
- package/dist/http/express/index.js +16 -16
- package/dist/http/express/index.mjs +1 -1
- package/dist/http/fastify/index.d.mts +3 -3
- package/dist/http/fastify/index.d.ts +3 -3
- package/dist/http/fastify/index.js +16 -16
- package/dist/http/fastify/index.mjs +1 -1
- package/dist/http/h3/index.d.mts +3 -3
- package/dist/http/h3/index.d.ts +3 -3
- package/dist/http/h3/index.js +17 -17
- package/dist/http/h3/index.mjs +1 -1
- package/dist/http/hono/index.d.mts +3 -3
- package/dist/http/hono/index.d.ts +3 -3
- package/dist/http/hono/index.js +14 -14
- package/dist/http/hono/index.mjs +1 -1
- 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 +15 -15
- package/dist/http/hyper-express/index.mjs +1 -1
- package/dist/http/koa/index.d.mts +3 -3
- package/dist/http/koa/index.d.ts +3 -3
- package/dist/http/koa/index.js +16 -16
- package/dist/http/koa/index.mjs +1 -1
- package/dist/index.d.mts +29 -28
- package/dist/index.d.ts +29 -28
- package/dist/index.js +20 -20
- package/dist/index.mjs +1 -1
- package/dist/{meta-DNF6Fl27.d.mts → meta-EGS-4cNY.d.mts} +1 -1
- package/dist/{meta-DNF6Fl27.d.ts → meta-EGS-4cNY.d.ts} +1 -1
- package/dist/rpc/bullmq/index.d.mts +3 -3
- package/dist/rpc/bullmq/index.d.ts +3 -3
- package/dist/rpc/bullmq/index.js +6 -6
- package/dist/rpc/bullmq/index.mjs +1 -1
- package/dist/rpc/electron/index.d.mts +3 -3
- package/dist/rpc/electron/index.d.ts +3 -3
- package/dist/rpc/electron/index.js +5 -5
- package/dist/rpc/electron/index.mjs +1 -1
- package/dist/rpc/kafka/index.d.mts +3 -3
- package/dist/rpc/kafka/index.d.ts +3 -3
- package/dist/rpc/kafka/index.js +6 -6
- package/dist/rpc/kafka/index.mjs +1 -1
- package/dist/rpc/nats/index.d.mts +3 -3
- package/dist/rpc/nats/index.d.ts +3 -3
- package/dist/rpc/nats/index.js +6 -6
- package/dist/rpc/nats/index.mjs +1 -1
- package/dist/rpc/rabbitmq/index.d.mts +3 -3
- package/dist/rpc/rabbitmq/index.d.ts +3 -3
- package/dist/rpc/rabbitmq/index.js +6 -6
- package/dist/rpc/rabbitmq/index.mjs +1 -1
- package/dist/rpc/redis/index.d.mts +3 -3
- package/dist/rpc/redis/index.d.ts +3 -3
- package/dist/rpc/redis/index.js +6 -6
- package/dist/rpc/redis/index.mjs +1 -1
- package/dist/rpc/ws/index.d.mts +3 -3
- package/dist/rpc/ws/index.d.ts +3 -3
- package/dist/rpc/ws/index.js +5 -5
- package/dist/rpc/ws/index.mjs +1 -1
- package/dist/test.d.mts +2 -2
- package/dist/test.d.ts +2 -2
- package/dist/{types-DtiHAXQB.d.mts → types-BkU6kQWV.d.mts} +1 -1
- package/dist/{types-BOZ8yE2L.d.mts → types-CoOCYe_X.d.mts} +1 -1
- package/dist/{types-Cosv4nol.d.ts → types-DGUpAXle.d.ts} +1 -1
- package/dist/{types-YJ55P7A_.d.ts → types-NkRE3d35.d.ts} +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -61,7 +61,7 @@ var _chunkC424F7TVjs = require('./chunk-C424F7TV.js');
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
var
|
|
64
|
+
var _chunkR73A7HS3js = require('./chunk-R73A7HS3.js');
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
|
|
@@ -139,9 +139,9 @@ var PFilter = class extends ServerBase {
|
|
|
139
139
|
constructor(tag) {
|
|
140
140
|
super();
|
|
141
141
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
142
|
-
|
|
142
|
+
_chunkR73A7HS3js.addFilter.call(void 0, this.key, this.use.bind(this));
|
|
143
143
|
this.onUnmount(() => {
|
|
144
|
-
delete
|
|
144
|
+
delete _chunkR73A7HS3js.Context.filterRecord[this.key];
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
};
|
|
@@ -157,9 +157,9 @@ var PGuard = (_class2 = class extends ServerBase {
|
|
|
157
157
|
constructor(tag) {
|
|
158
158
|
super();_class2.prototype.__init2.call(this);;
|
|
159
159
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
160
|
-
|
|
160
|
+
_chunkR73A7HS3js.addGuard.call(void 0, this.key, this.use.bind(this), this.priority);
|
|
161
161
|
this.onUnmount(() => {
|
|
162
|
-
delete
|
|
162
|
+
delete _chunkR73A7HS3js.Context.guardRecord[this.key];
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
}, _class2);
|
|
@@ -174,9 +174,9 @@ var PPipe = class extends ServerBase {
|
|
|
174
174
|
constructor(tag) {
|
|
175
175
|
super();
|
|
176
176
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
177
|
-
|
|
177
|
+
_chunkR73A7HS3js.addPipe.call(void 0, this.key, this.use.bind(this));
|
|
178
178
|
this.onUnmount(() => {
|
|
179
|
-
delete
|
|
179
|
+
delete _chunkR73A7HS3js.Context.pipeRecord[this.key];
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
};
|
|
@@ -192,9 +192,9 @@ var PAddon = (_class3 = class extends ServerBase {
|
|
|
192
192
|
constructor(tag) {
|
|
193
193
|
super();_class3.prototype.__init3.call(this);;
|
|
194
194
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
195
|
-
|
|
195
|
+
_chunkR73A7HS3js.addAddon.call(void 0, this.key, this.use.bind(this), this.priority);
|
|
196
196
|
this.onUnmount(() => {
|
|
197
|
-
delete
|
|
197
|
+
delete _chunkR73A7HS3js.Context.addonRecord[this.key];
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
}, _class3);
|
|
@@ -212,27 +212,27 @@ var PExtension = class extends ServerBase {
|
|
|
212
212
|
super();
|
|
213
213
|
const key = this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
214
214
|
if (this.pipe) {
|
|
215
|
-
|
|
215
|
+
_chunkR73A7HS3js.addPipe.call(void 0, key, this.pipe.bind(this));
|
|
216
216
|
this.onUnmount(() => {
|
|
217
|
-
delete
|
|
217
|
+
delete _chunkR73A7HS3js.Context.pipeRecord[key];
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
if (this.addon) {
|
|
221
|
-
|
|
221
|
+
_chunkR73A7HS3js.addAddon.call(void 0, key, this.addon.bind(this), this.addonPriority);
|
|
222
222
|
this.onUnmount(() => {
|
|
223
|
-
delete
|
|
223
|
+
delete _chunkR73A7HS3js.Context.addonRecord[key];
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
if (this.guard) {
|
|
227
|
-
|
|
227
|
+
_chunkR73A7HS3js.addGuard.call(void 0, key, this.guard.bind(this), this.guardPriority);
|
|
228
228
|
this.onUnmount(() => {
|
|
229
|
-
delete
|
|
229
|
+
delete _chunkR73A7HS3js.Context.guardRecord[key];
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
if (this.filter) {
|
|
233
|
-
|
|
233
|
+
_chunkR73A7HS3js.addFilter.call(void 0, key, this.filter.bind(this));
|
|
234
234
|
this.onUnmount(() => {
|
|
235
|
-
delete
|
|
235
|
+
delete _chunkR73A7HS3js.Context.filterRecord[key];
|
|
236
236
|
});
|
|
237
237
|
}
|
|
238
238
|
}
|
|
@@ -313,7 +313,7 @@ var HTTPGenerator = (_class6 = class extends Generator {constructor(...args4) {
|
|
|
313
313
|
addMethod(args) {
|
|
314
314
|
const { http, name, method, params, tag } = args;
|
|
315
315
|
if (!_optionalChain([http, 'optionalAccess', _2 => _2.method])) return;
|
|
316
|
-
const url =
|
|
316
|
+
const url = _chunkR73A7HS3js.joinUrl.call(void 0, http.prefix, http.route).replace(/\/\:([^\/]*)/g, (_, js) => `/{{${js}}}`);
|
|
317
317
|
if (!this.classMap[name]) this.classMap[name] = {};
|
|
318
318
|
this.classMap[name][method] = `
|
|
319
319
|
${method}(...args){
|
|
@@ -360,7 +360,7 @@ var OpenAPIGenerator = (_class7 = class extends Generator {constructor(...args5)
|
|
|
360
360
|
if (!_optionalChain([http, 'optionalAccess', _3 => _3.method])) return;
|
|
361
361
|
const config = _phecdacore.getMergedMeta.call(void 0, model, method).openapi;
|
|
362
362
|
if (!config) return;
|
|
363
|
-
const path =
|
|
363
|
+
const path = _chunkR73A7HS3js.joinUrl.call(void 0, http.prefix, http.route);
|
|
364
364
|
if (!this.paths[path]) this.paths[path] = {};
|
|
365
365
|
this.paths[path][http.method] = {
|
|
366
366
|
summary: config.summary,
|
|
@@ -540,4 +540,4 @@ var GraphGenerator = (_class9 = class extends Generator {constructor(...args6) {
|
|
|
540
540
|
|
|
541
541
|
|
|
542
542
|
|
|
543
|
-
exports.Addon = _chunkC424F7TVjs.Addon; exports.ApiDoc = _chunkC424F7TVjs.ApiDoc; exports.Arg = _chunkC424F7TVjs.Arg; exports.BadGatewayException =
|
|
543
|
+
exports.Addon = _chunkC424F7TVjs.Addon; exports.ApiDoc = _chunkC424F7TVjs.ApiDoc; exports.Arg = _chunkC424F7TVjs.Arg; exports.BadGatewayException = _chunkR73A7HS3js.BadGatewayException; exports.BadRequestException = _chunkR73A7HS3js.BadRequestException; exports.BaseParam = _chunkC424F7TVjs.BaseParam; exports.Body = _chunkC424F7TVjs.Body; exports.ConflictException = _chunkR73A7HS3js.ConflictException; exports.Context = _chunkR73A7HS3js.Context; exports.Controller = _chunkC424F7TVjs.Controller; exports.Ctx = _chunkC424F7TVjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkC424F7TVjs.Define; exports.Delete = _chunkC424F7TVjs.Delete; exports.DocGenerator = DocGenerator; exports.ERROR_SYMBOL = _chunkOUQM7GZHjs.ERROR_SYMBOL; exports.Exception = _chunkR73A7HS3js.Exception; exports.Factory = _chunkSRPCXPAQjs.Factory; exports.Filter = _chunkC424F7TVjs.Filter; exports.ForbiddenException = _chunkR73A7HS3js.ForbiddenException; exports.FrameworkException = _chunkR73A7HS3js.FrameworkException; exports.Generator = Generator; exports.Get = _chunkC424F7TVjs.Get; exports.GraphGenerator = GraphGenerator; exports.Guard = _chunkC424F7TVjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkC424F7TVjs.Head; exports.Header = _chunkC424F7TVjs.Header; exports.HttpBase = HttpBase; exports.IS_DEV = _chunkOUQM7GZHjs.IS_DEV; exports.IS_ONLY_GENERATE = _chunkOUQM7GZHjs.IS_ONLY_GENERATE; exports.IS_PURE = _chunkOUQM7GZHjs.IS_PURE; exports.IS_STRICT = _chunkOUQM7GZHjs.IS_STRICT; exports.InvalidInputException = _chunkR73A7HS3js.InvalidInputException; exports.LOG_LEVEL = _chunkOUQM7GZHjs.LOG_LEVEL; exports.ManyFiles = _chunkC424F7TVjs.ManyFiles; exports.Meta = _chunkSRPCXPAQjs.Meta; exports.Mixin = _chunkOUQM7GZHjs.Mixin; exports.NotFoundException = _chunkR73A7HS3js.NotFoundException; exports.OneFile = _chunkC424F7TVjs.OneFile; exports.OpenAPIGenerator = OpenAPIGenerator; exports.PAddon = PAddon; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PPipe = PPipe; exports.PS_EXIT_CODE = _chunkOUQM7GZHjs.PS_EXIT_CODE; exports.Param = _chunkC424F7TVjs.Param; exports.Patch = _chunkC424F7TVjs.Patch; exports.PayloadLargeException = _chunkR73A7HS3js.PayloadLargeException; exports.Pipe = _chunkC424F7TVjs.Pipe; exports.Post = _chunkC424F7TVjs.Post; exports.Put = _chunkC424F7TVjs.Put; exports.Query = _chunkC424F7TVjs.Query; exports.Queue = _chunkC424F7TVjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkC424F7TVjs.Route; exports.Rpc = _chunkC424F7TVjs.Rpc; exports.RpcBase = RpcBase; exports.Search = _chunkC424F7TVjs.Search; exports.ServerBase = ServerBase; exports.ServerPhecda = _chunkSRPCXPAQjs.ServerPhecda; exports.ServiceUnavailableException = _chunkR73A7HS3js.ServiceUnavailableException; exports.TimeoutException = _chunkR73A7HS3js.TimeoutException; exports.TimerException = _chunkR73A7HS3js.TimerException; exports.UnauthorizedException = _chunkR73A7HS3js.UnauthorizedException; exports.UndefinedException = _chunkR73A7HS3js.UndefinedException; exports.UnsupportedMediaTypeException = _chunkR73A7HS3js.UnsupportedMediaTypeException; exports.ValidateException = _chunkR73A7HS3js.ValidateException; exports.WorkerException = _chunkR73A7HS3js.WorkerException; exports.addAddon = _chunkR73A7HS3js.addAddon; exports.addFilter = _chunkR73A7HS3js.addFilter; exports.addGuard = _chunkR73A7HS3js.addGuard; exports.addPipe = _chunkR73A7HS3js.addPipe; exports.defaultFilter = _chunkR73A7HS3js.defaultFilter; exports.defaultPipe = _chunkR73A7HS3js.defaultPipe; exports.defaultServerInject = _chunkSRPCXPAQjs.defaultServerInject; exports.emitter = _chunkSRPCXPAQjs.emitter; exports.getLogger = _chunkOUQM7GZHjs.getLogger; exports.log = _chunkOUQM7GZHjs.log; exports.phecdaNamespace = _chunkSRPCXPAQjs.phecdaNamespace; exports.runMiddleware = _chunkOUQM7GZHjs.runMiddleware; exports.setLogger = _chunkOUQM7GZHjs.setLogger; exports.useS = _chunkSRPCXPAQjs.useS;
|
package/dist/index.mjs
CHANGED
|
@@ -91,4 +91,4 @@ interface ControllerMeta extends Meta {
|
|
|
91
91
|
data: ControllerMetaData;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
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
|
|
94
|
+
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 BaseError as b, type ControllerMetaData as c, type BaseRequestMethod 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 };
|
|
@@ -91,4 +91,4 @@ interface ControllerMeta extends Meta {
|
|
|
91
91
|
data: ControllerMetaData;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
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
|
|
94
|
+
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 BaseError as b, type ControllerMetaData as c, type BaseRequestMethod 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 } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-mOKtuP0F.mjs';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-CoOCYe_X.mjs';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.mjs';
|
|
6
6
|
|
|
7
7
|
interface BullmqCtx extends RpcCtx {
|
|
8
8
|
type: 'bullmq';
|
|
@@ -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 } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-qL97H3d_.js';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-NkRE3d35.js';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.js';
|
|
6
6
|
|
|
7
7
|
interface BullmqCtx extends RpcCtx {
|
|
8
8
|
type: 'bullmq';
|
package/dist/rpc/bullmq/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -17,14 +17,14 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
17
17
|
const workerMap = {};
|
|
18
18
|
const queueMap = {};
|
|
19
19
|
const existQueue = /* @__PURE__ */ new Set();
|
|
20
|
-
const metaMap =
|
|
20
|
+
const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
21
21
|
const { controller, rpc, method, tag } = meta2.data;
|
|
22
22
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
23
23
|
debug(`register method "${method}" in module "${tag}"`);
|
|
24
24
|
return true;
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
|
|
27
|
+
_chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
|
|
28
28
|
guards: globalGuards
|
|
29
29
|
}, "rpc");
|
|
30
30
|
async function subscribeQueues() {
|
|
@@ -38,7 +38,7 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
38
38
|
if (existQueue.has(queue)) continue;
|
|
39
39
|
existQueue.add(queue);
|
|
40
40
|
workerMap[queue] = new (0, _bullmq.Worker)(queue, handleRequest, workerOpts);
|
|
41
|
-
|
|
41
|
+
_chunkR73A7HS3js.Context.applyAddons(addons, workerMap[queue], "bullmq");
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -52,12 +52,12 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
52
52
|
const meta2 = metaMap.get(tag)[method];
|
|
53
53
|
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
54
54
|
if (!isEvent && !(clientQueue in queueMap)) queueMap[clientQueue] = new (0, _bullmq.Queue)(clientQueue, queueOpts);
|
|
55
|
-
const aop =
|
|
55
|
+
const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
|
|
56
56
|
globalFilter,
|
|
57
57
|
globalGuards,
|
|
58
58
|
globalPipe
|
|
59
59
|
});
|
|
60
|
-
const context = new (0,
|
|
60
|
+
const context = new (0, _chunkR73A7HS3js.Context)({
|
|
61
61
|
type: "bullmq",
|
|
62
62
|
category: "rpc",
|
|
63
63
|
moduleMap,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Electron from 'electron';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-mOKtuP0F.mjs';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-CoOCYe_X.mjs';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.mjs';
|
|
6
6
|
|
|
7
7
|
interface ElectronCtx extends RpcCtx {
|
|
8
8
|
type: 'electron';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Electron from 'electron';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-qL97H3d_.js';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-NkRE3d35.js';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.js';
|
|
6
6
|
|
|
7
7
|
interface ElectronCtx extends RpcCtx {
|
|
8
8
|
type: 'electron';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkOUQM7GZHjs = require('../../chunk-OUQM7GZH.js');
|
|
@@ -12,14 +12,14 @@ var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
|
12
12
|
var debug = _debug2.default.call(void 0, "phecda-server/electron");
|
|
13
13
|
function bind(IPC, { moduleMap, meta }, opts = {}) {
|
|
14
14
|
const { globalGuards, globalFilter, globalPipe, globalAddons = [] } = opts;
|
|
15
|
-
const metaMap =
|
|
15
|
+
const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
16
16
|
const { controller, rpc, method, tag } = meta2.data;
|
|
17
17
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
18
18
|
debug(`register method "${method}" in module "${tag}"`);
|
|
19
19
|
return true;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
_chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
|
|
23
23
|
guards: globalGuards,
|
|
24
24
|
addons: globalAddons
|
|
25
25
|
}, "rpc");
|
|
@@ -31,12 +31,12 @@ function bind(IPC, { moduleMap, meta }, opts = {}) {
|
|
|
31
31
|
if (_ps !== 1) return;
|
|
32
32
|
const meta2 = metaMap.get(tag)[method];
|
|
33
33
|
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
34
|
-
const aop =
|
|
34
|
+
const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
|
|
35
35
|
globalFilter,
|
|
36
36
|
globalGuards,
|
|
37
37
|
globalPipe
|
|
38
38
|
});
|
|
39
|
-
const context = new (0,
|
|
39
|
+
const context = new (0, _chunkR73A7HS3js.Context)({
|
|
40
40
|
type: "electron",
|
|
41
41
|
category: "rpc",
|
|
42
42
|
moduleMap,
|
|
@@ -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 } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-mOKtuP0F.mjs';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-CoOCYe_X.mjs';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.mjs';
|
|
6
6
|
|
|
7
7
|
interface KafkaCtx extends RpcCtx {
|
|
8
8
|
type: 'kafka';
|
|
@@ -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 } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-qL97H3d_.js';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-NkRE3d35.js';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.js';
|
|
6
6
|
|
|
7
7
|
interface KafkaCtx extends RpcCtx {
|
|
8
8
|
type: 'kafka';
|
package/dist/rpc/kafka/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkOUQM7GZHjs = require('../../chunk-OUQM7GZH.js');
|
|
@@ -13,18 +13,18 @@ var debug = _debug2.default.call(void 0, "phecda-server/kafka");
|
|
|
13
13
|
async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
|
|
14
14
|
const { globalGuards, globalFilter, globalPipe, globalAddons = [], defaultQueue } = opts;
|
|
15
15
|
const existQueue = /* @__PURE__ */ new Set();
|
|
16
|
-
const metaMap =
|
|
16
|
+
const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
17
17
|
const { controller, rpc, method, tag } = meta2.data;
|
|
18
18
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
19
19
|
debug(`register method "${method}" in module "${tag}"`);
|
|
20
20
|
return true;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
|
|
23
|
+
_chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
|
|
24
24
|
guards: globalGuards,
|
|
25
25
|
addons: globalAddons
|
|
26
26
|
}, "rpc");
|
|
27
|
-
|
|
27
|
+
_chunkR73A7HS3js.Context.applyAddons(globalAddons, {
|
|
28
28
|
consumer,
|
|
29
29
|
producer
|
|
30
30
|
}, "kafka");
|
|
@@ -58,12 +58,12 @@ async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
|
|
|
58
58
|
const meta2 = metaMap.get(tag)[method];
|
|
59
59
|
const { data: { rpc } } = meta2;
|
|
60
60
|
const isEvent = rpc.isEvent;
|
|
61
|
-
const aop =
|
|
61
|
+
const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
|
|
62
62
|
globalFilter,
|
|
63
63
|
globalGuards,
|
|
64
64
|
globalPipe
|
|
65
65
|
});
|
|
66
|
-
const context = new (0,
|
|
66
|
+
const context = new (0, _chunkR73A7HS3js.Context)({
|
|
67
67
|
type: "kafka",
|
|
68
68
|
category: "rpc",
|
|
69
69
|
moduleMap,
|
package/dist/rpc/kafka/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NatsConnection } from 'nats';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-mOKtuP0F.mjs';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-CoOCYe_X.mjs';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.mjs';
|
|
6
6
|
|
|
7
7
|
interface NatsCtx extends RpcCtx {
|
|
8
8
|
type: 'nats';
|
package/dist/rpc/nats/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NatsConnection } from 'nats';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-qL97H3d_.js';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-NkRE3d35.js';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.js';
|
|
6
6
|
|
|
7
7
|
interface NatsCtx extends RpcCtx {
|
|
8
8
|
type: 'nats';
|
package/dist/rpc/nats/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -17,18 +17,18 @@ async function bind(nc, { moduleMap, meta }, opts = {}) {
|
|
|
17
17
|
const sc = _nats.StringCodec.call(void 0, );
|
|
18
18
|
const subscriptionMap = {};
|
|
19
19
|
const existQueue = /* @__PURE__ */ new Set();
|
|
20
|
-
const metaMap =
|
|
20
|
+
const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
21
21
|
const { controller, rpc, method, tag } = meta2.data;
|
|
22
22
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _2 => _2.queue]) !== void 0) {
|
|
23
23
|
debug(`register method "${method}" in module "${tag}"`);
|
|
24
24
|
return true;
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
|
|
27
|
+
_chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
|
|
28
28
|
addons: globalAddons,
|
|
29
29
|
guards: globalGuards
|
|
30
30
|
}, "rpc");
|
|
31
|
-
|
|
31
|
+
_chunkR73A7HS3js.Context.applyAddons(globalAddons, nc, "nats");
|
|
32
32
|
async function subscribeQueues() {
|
|
33
33
|
existQueue.clear();
|
|
34
34
|
for (const [tag, record] of metaMap) {
|
|
@@ -56,12 +56,12 @@ async function bind(nc, { moduleMap, meta }, opts = {}) {
|
|
|
56
56
|
const meta2 = metaMap.get(tag)[method];
|
|
57
57
|
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
58
58
|
if (isEvent) msg.respond("{}");
|
|
59
|
-
const aop =
|
|
59
|
+
const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
|
|
60
60
|
globalFilter,
|
|
61
61
|
globalGuards,
|
|
62
62
|
globalPipe
|
|
63
63
|
});
|
|
64
|
-
const context = new (0,
|
|
64
|
+
const context = new (0, _chunkR73A7HS3js.Context)({
|
|
65
65
|
type: "nats",
|
|
66
66
|
category: "rpc",
|
|
67
67
|
moduleMap,
|
package/dist/rpc/nats/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import amqplib from 'amqplib';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-mOKtuP0F.mjs';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-CoOCYe_X.mjs';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.mjs';
|
|
6
6
|
|
|
7
7
|
interface RabbitmqCtx extends RpcCtx {
|
|
8
8
|
type: 'rabbitmq';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import amqplib from 'amqplib';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-qL97H3d_.js';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-NkRE3d35.js';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.js';
|
|
6
6
|
|
|
7
7
|
interface RabbitmqCtx extends RpcCtx {
|
|
8
8
|
type: 'rabbitmq';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -13,19 +13,19 @@ var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
|
13
13
|
var debug = _debug2.default.call(void 0, "phecda-server/rabbitmq");
|
|
14
14
|
async function bind(ch, { moduleMap, meta }, opts = {}) {
|
|
15
15
|
const { globalGuards, globalFilter, globalPipe, globalAddons = [], defaultQueue } = opts;
|
|
16
|
-
const metaMap =
|
|
16
|
+
const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
17
17
|
const { controller, rpc, method, tag } = meta2.data;
|
|
18
18
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
19
19
|
debug(`register method "${method}" in module "${tag}"`);
|
|
20
20
|
return true;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
|
|
23
|
+
_chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
|
|
24
24
|
guards: globalGuards,
|
|
25
25
|
addons: globalAddons
|
|
26
26
|
}, "rpc");
|
|
27
27
|
const existQueue = /* @__PURE__ */ new Set();
|
|
28
|
-
|
|
28
|
+
_chunkR73A7HS3js.Context.applyAddons(globalAddons, ch, "rabbitmq");
|
|
29
29
|
async function subscribeQueues() {
|
|
30
30
|
existQueue.clear();
|
|
31
31
|
for (const [tag, record] of metaMap) {
|
|
@@ -57,12 +57,12 @@ async function bind(ch, { moduleMap, meta }, opts = {}) {
|
|
|
57
57
|
debug(`invoke method "${method}" in module "${tag}"`);
|
|
58
58
|
const meta2 = metaMap.get(tag)[method];
|
|
59
59
|
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
60
|
-
const aop =
|
|
60
|
+
const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
|
|
61
61
|
globalFilter,
|
|
62
62
|
globalGuards,
|
|
63
63
|
globalPipe
|
|
64
64
|
});
|
|
65
|
-
const context = new (0,
|
|
65
|
+
const context = new (0, _chunkR73A7HS3js.Context)({
|
|
66
66
|
type: "rabbitmq",
|
|
67
67
|
category: "rpc",
|
|
68
68
|
moduleMap,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-mOKtuP0F.mjs';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-CoOCYe_X.mjs';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.mjs';
|
|
6
6
|
|
|
7
7
|
interface RedisCtx extends RpcCtx {
|
|
8
8
|
type: 'redis';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
3
|
-
import { R as RpcCtx, a as RpcServerOptions } from '../../types-
|
|
2
|
+
import { F as Factory } from '../../core-qL97H3d_.js';
|
|
3
|
+
import { R as RpcCtx, a as RpcServerOptions } from '../../types-NkRE3d35.js';
|
|
4
4
|
import 'phecda-core';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.js';
|
|
6
6
|
|
|
7
7
|
interface RedisCtx extends RpcCtx {
|
|
8
8
|
type: 'redis';
|
package/dist/rpc/redis/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -13,19 +13,19 @@ var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
|
13
13
|
var debug = _debug2.default.call(void 0, "phecda-server/redis");
|
|
14
14
|
function bind({ sub, pub }, { moduleMap, meta }, opts = {}) {
|
|
15
15
|
const { globalGuards, globalFilter, globalPipe, globalAddons = [], defaultQueue } = opts;
|
|
16
|
-
const metaMap =
|
|
16
|
+
const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
17
17
|
const { controller, rpc, method, tag } = meta2.data;
|
|
18
18
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
19
19
|
debug(`register method "${method}" in module "${tag}"`);
|
|
20
20
|
return true;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
|
|
23
|
+
_chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
|
|
24
24
|
guards: globalGuards,
|
|
25
25
|
addons: globalAddons
|
|
26
26
|
}, "rpc");
|
|
27
27
|
const existQueue = /* @__PURE__ */ new Set();
|
|
28
|
-
|
|
28
|
+
_chunkR73A7HS3js.Context.applyAddons(globalAddons, {
|
|
29
29
|
pub,
|
|
30
30
|
sub
|
|
31
31
|
}, "redis");
|
|
@@ -54,12 +54,12 @@ function bind({ sub, pub }, { moduleMap, meta }, opts = {}) {
|
|
|
54
54
|
if (_ps !== 1) return;
|
|
55
55
|
const meta2 = metaMap.get(tag)[method];
|
|
56
56
|
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
57
|
-
const aop =
|
|
57
|
+
const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
|
|
58
58
|
globalFilter,
|
|
59
59
|
globalGuards,
|
|
60
60
|
globalPipe
|
|
61
61
|
});
|
|
62
|
-
const context = new (0,
|
|
62
|
+
const context = new (0, _chunkR73A7HS3js.Context)({
|
|
63
63
|
type: "redis",
|
|
64
64
|
category: "rpc",
|
|
65
65
|
moduleMap,
|