phecda-server 8.2.0 → 8.3.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-MPKVT4SQ.js → chunk-R73A7HS3.js} +35 -34
- package/dist/{chunk-2P2UICBC.mjs → chunk-US2DTB3Z.mjs} +35 -34
- package/dist/helper.js +2 -2
- package/dist/helper.mjs +1 -1
- package/dist/http/elysia/index.js +17 -17
- package/dist/http/elysia/index.mjs +1 -1
- package/dist/http/express/index.js +16 -16
- package/dist/http/express/index.mjs +1 -1
- package/dist/http/fastify/index.js +16 -16
- package/dist/http/fastify/index.mjs +1 -1
- package/dist/http/h3/index.js +17 -17
- package/dist/http/h3/index.mjs +1 -1
- package/dist/http/hono/index.js +14 -14
- package/dist/http/hono/index.mjs +1 -1
- package/dist/http/hyper-express/index.js +15 -15
- package/dist/http/hyper-express/index.mjs +1 -1
- package/dist/http/koa/index.js +16 -16
- package/dist/http/koa/index.mjs +1 -1
- package/dist/index.d.mts +18 -17
- package/dist/index.d.ts +18 -17
- package/dist/index.js +20 -20
- package/dist/index.mjs +1 -1
- package/dist/rpc/bullmq/index.js +6 -6
- package/dist/rpc/bullmq/index.mjs +1 -1
- package/dist/rpc/electron/index.js +5 -5
- package/dist/rpc/electron/index.mjs +1 -1
- package/dist/rpc/kafka/index.js +6 -6
- package/dist/rpc/kafka/index.mjs +1 -1
- package/dist/rpc/nats/index.js +6 -6
- package/dist/rpc/nats/index.mjs +1 -1
- package/dist/rpc/rabbitmq/index.js +6 -6
- package/dist/rpc/rabbitmq/index.mjs +1 -1
- package/dist/rpc/redis/index.js +6 -6
- package/dist/rpc/redis/index.mjs +1 -1
- package/dist/rpc/ws/index.js +5 -5
- package/dist/rpc/ws/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -13,9 +13,10 @@ import 'node:http';
|
|
|
13
13
|
|
|
14
14
|
declare class Exception extends Error {
|
|
15
15
|
message: string;
|
|
16
|
+
metadata?: any | undefined;
|
|
16
17
|
status: number;
|
|
17
18
|
description: string;
|
|
18
|
-
constructor(message: string, status?: number, description?: string);
|
|
19
|
+
constructor(message: string, metadata?: any | undefined, status?: number, description?: string);
|
|
19
20
|
get data(): {
|
|
20
21
|
message: string;
|
|
21
22
|
description: string;
|
|
@@ -25,67 +26,67 @@ declare class Exception extends Error {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
declare class UndefinedException extends Exception {
|
|
28
|
-
constructor(message: string);
|
|
29
|
+
constructor(message: string, metadata?: any);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
declare class ValidateException extends Exception {
|
|
32
|
-
constructor(message: string);
|
|
33
|
+
constructor(message: string, metadata?: any);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
declare class ForbiddenException extends Exception {
|
|
36
|
-
constructor(message: string);
|
|
37
|
+
constructor(message: string, metadata?: any);
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
declare class BadRequestException extends Exception {
|
|
40
|
-
constructor(message: string);
|
|
41
|
+
constructor(message: string, metadata?: any);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
declare class NotFoundException extends Exception {
|
|
44
|
-
constructor(message: string);
|
|
45
|
+
constructor(message: string, metadata?: any);
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
declare class ConflictException extends Exception {
|
|
48
|
-
constructor(message: string);
|
|
49
|
+
constructor(message: string, metadata?: any);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
declare class BadGatewayException extends Exception {
|
|
52
|
-
constructor(message: string);
|
|
53
|
+
constructor(message: string, metadata?: any);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
declare class InvalidInputException extends Exception {
|
|
56
|
-
constructor(message: string);
|
|
57
|
+
constructor(message: string, metadata?: any);
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
declare class UnsupportedMediaTypeException extends Exception {
|
|
60
|
-
constructor(message: string);
|
|
61
|
+
constructor(message: string, metadata?: any);
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
declare class PayloadLargeException extends Exception {
|
|
64
|
-
constructor(message: string);
|
|
65
|
+
constructor(message: string, metadata?: any);
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
declare class TimeoutException extends Exception {
|
|
68
|
-
constructor(message: string);
|
|
69
|
+
constructor(message: string, metadata?: any);
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
declare class UnauthorizedException extends Exception {
|
|
72
|
-
constructor(message: string);
|
|
73
|
+
constructor(message: string, metadata?: any);
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
declare class ServiceUnavailableException extends Exception {
|
|
76
|
-
constructor(message: string);
|
|
77
|
+
constructor(message: string, metadata?: any);
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
declare class FrameworkException extends Exception {
|
|
80
|
-
constructor(message: string);
|
|
81
|
+
constructor(message: string, metadata?: any);
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
declare class TimerException extends Exception {
|
|
84
|
-
constructor(message: string);
|
|
85
|
+
constructor(message: string, metadata?: any);
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
declare class WorkerException extends Exception {
|
|
88
|
-
constructor(message: string);
|
|
89
|
+
constructor(message: string, metadata?: any);
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
interface AOP {
|
package/dist/index.d.ts
CHANGED
|
@@ -13,9 +13,10 @@ import 'node:http';
|
|
|
13
13
|
|
|
14
14
|
declare class Exception extends Error {
|
|
15
15
|
message: string;
|
|
16
|
+
metadata?: any | undefined;
|
|
16
17
|
status: number;
|
|
17
18
|
description: string;
|
|
18
|
-
constructor(message: string, status?: number, description?: string);
|
|
19
|
+
constructor(message: string, metadata?: any | undefined, status?: number, description?: string);
|
|
19
20
|
get data(): {
|
|
20
21
|
message: string;
|
|
21
22
|
description: string;
|
|
@@ -25,67 +26,67 @@ declare class Exception extends Error {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
declare class UndefinedException extends Exception {
|
|
28
|
-
constructor(message: string);
|
|
29
|
+
constructor(message: string, metadata?: any);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
declare class ValidateException extends Exception {
|
|
32
|
-
constructor(message: string);
|
|
33
|
+
constructor(message: string, metadata?: any);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
declare class ForbiddenException extends Exception {
|
|
36
|
-
constructor(message: string);
|
|
37
|
+
constructor(message: string, metadata?: any);
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
declare class BadRequestException extends Exception {
|
|
40
|
-
constructor(message: string);
|
|
41
|
+
constructor(message: string, metadata?: any);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
declare class NotFoundException extends Exception {
|
|
44
|
-
constructor(message: string);
|
|
45
|
+
constructor(message: string, metadata?: any);
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
declare class ConflictException extends Exception {
|
|
48
|
-
constructor(message: string);
|
|
49
|
+
constructor(message: string, metadata?: any);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
declare class BadGatewayException extends Exception {
|
|
52
|
-
constructor(message: string);
|
|
53
|
+
constructor(message: string, metadata?: any);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
declare class InvalidInputException extends Exception {
|
|
56
|
-
constructor(message: string);
|
|
57
|
+
constructor(message: string, metadata?: any);
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
declare class UnsupportedMediaTypeException extends Exception {
|
|
60
|
-
constructor(message: string);
|
|
61
|
+
constructor(message: string, metadata?: any);
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
declare class PayloadLargeException extends Exception {
|
|
64
|
-
constructor(message: string);
|
|
65
|
+
constructor(message: string, metadata?: any);
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
declare class TimeoutException extends Exception {
|
|
68
|
-
constructor(message: string);
|
|
69
|
+
constructor(message: string, metadata?: any);
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
declare class UnauthorizedException extends Exception {
|
|
72
|
-
constructor(message: string);
|
|
73
|
+
constructor(message: string, metadata?: any);
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
declare class ServiceUnavailableException extends Exception {
|
|
76
|
-
constructor(message: string);
|
|
77
|
+
constructor(message: string, metadata?: any);
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
declare class FrameworkException extends Exception {
|
|
80
|
-
constructor(message: string);
|
|
81
|
+
constructor(message: string, metadata?: any);
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
declare class TimerException extends Exception {
|
|
84
|
-
constructor(message: string);
|
|
85
|
+
constructor(message: string, metadata?: any);
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
declare class WorkerException extends Exception {
|
|
88
|
-
constructor(message: string);
|
|
89
|
+
constructor(message: string, metadata?: any);
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
interface AOP {
|
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
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,
|
|
@@ -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,
|
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
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
|
@@ -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,
|
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,
|