phecda-server 6.0.2 → 6.1.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-WXFZZZRY.mjs → chunk-2CFYUXPM.mjs} +1 -1
- package/dist/{chunk-HDQAT2IM.mjs → chunk-3H3T54IC.mjs} +116 -87
- package/dist/{chunk-7SYPUIBY.js → chunk-DVTBLV6I.js} +60 -60
- package/dist/{chunk-UXD62LGG.mjs → chunk-G7TD2VB7.mjs} +10 -2
- package/dist/{chunk-F3W3NN7F.mjs → chunk-J7B24YSE.mjs} +1 -1
- package/dist/{chunk-XCND2QW3.js → chunk-JDV2XJYE.js} +25 -25
- package/dist/chunk-NL6QBQAR.js +266 -0
- package/dist/{chunk-GHFSIZUO.js → chunk-TVT62GIX.js} +11 -3
- package/dist/core-BlN0Spy9.d.ts +47 -0
- package/dist/core-P1CsH6jz.d.mts +47 -0
- package/dist/helper.js +3 -3
- package/dist/helper.mjs +2 -2
- package/dist/index.d.mts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +49 -43
- package/dist/index.mjs +15 -9
- package/dist/rpc/bullmq/index.d.mts +1 -1
- package/dist/rpc/bullmq/index.d.ts +1 -1
- package/dist/rpc/bullmq/index.js +12 -12
- package/dist/rpc/bullmq/index.mjs +2 -2
- package/dist/rpc/kafka/index.d.mts +1 -1
- package/dist/rpc/kafka/index.d.ts +1 -1
- package/dist/rpc/kafka/index.js +12 -12
- package/dist/rpc/kafka/index.mjs +2 -2
- package/dist/rpc/nats/index.d.mts +1 -1
- package/dist/rpc/nats/index.d.ts +1 -1
- package/dist/rpc/nats/index.js +11 -11
- package/dist/rpc/nats/index.mjs +2 -2
- package/dist/rpc/rabbitmq/index.d.mts +1 -1
- package/dist/rpc/rabbitmq/index.d.ts +1 -1
- package/dist/rpc/rabbitmq/index.js +13 -13
- package/dist/rpc/rabbitmq/index.mjs +2 -2
- package/dist/rpc/redis/index.d.mts +1 -1
- package/dist/rpc/redis/index.d.ts +1 -1
- package/dist/rpc/redis/index.js +11 -11
- package/dist/rpc/redis/index.mjs +2 -2
- package/dist/server/elysia/index.d.mts +1 -1
- package/dist/server/elysia/index.d.ts +1 -1
- package/dist/server/elysia/index.js +36 -36
- package/dist/server/elysia/index.mjs +3 -3
- package/dist/server/express/index.d.mts +1 -1
- package/dist/server/express/index.d.ts +1 -1
- package/dist/server/express/index.js +34 -34
- package/dist/server/express/index.mjs +2 -2
- package/dist/server/fastify/index.d.mts +1 -1
- package/dist/server/fastify/index.d.ts +1 -1
- package/dist/server/fastify/index.js +35 -35
- package/dist/server/fastify/index.mjs +3 -3
- package/dist/server/h3/index.d.mts +1 -1
- package/dist/server/h3/index.d.ts +1 -1
- package/dist/server/h3/index.js +34 -34
- package/dist/server/h3/index.mjs +2 -2
- package/dist/server/hono/index.d.mts +1 -1
- package/dist/server/hono/index.d.ts +1 -1
- package/dist/server/hono/index.js +33 -33
- package/dist/server/hono/index.mjs +2 -2
- package/dist/server/hyper-express/index.d.mts +1 -1
- package/dist/server/hyper-express/index.d.ts +1 -1
- package/dist/server/hyper-express/index.js +33 -33
- package/dist/server/hyper-express/index.mjs +2 -2
- package/dist/server/koa/index.d.mts +1 -1
- package/dist/server/koa/index.d.ts +1 -1
- package/dist/server/koa/index.js +34 -34
- package/dist/server/koa/index.mjs +2 -2
- package/dist/test.d.mts +1 -1
- package/dist/test.d.ts +1 -1
- package/dist/test.js +6 -6
- package/dist/test.mjs +2 -2
- package/package.json +2 -2
- package/dist/chunk-LYEZ6RGX.js +0 -237
- package/dist/core-2SNw8m2B.d.mts +0 -30
- package/dist/core-BmJJLUqj.d.ts +0 -30
package/dist/index.js
CHANGED
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkJDV2XJYEjs = require('./chunk-JDV2XJYE.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var _chunkLYEZ6RGXjs = require('./chunk-LYEZ6RGX.js');
|
|
34
33
|
|
|
35
34
|
|
|
35
|
+
var _chunkNL6QBQARjs = require('./chunk-NL6QBQAR.js');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
@@ -56,9 +56,9 @@ var _chunkLYEZ6RGXjs = require('./chunk-LYEZ6RGX.js');
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
var _chunk7SYPUIBYjs = require('./chunk-7SYPUIBY.js');
|
|
60
59
|
|
|
61
60
|
|
|
61
|
+
var _chunkDVTBLV6Ijs = require('./chunk-DVTBLV6I.js');
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
|
|
@@ -68,13 +68,16 @@ var _chunk7SYPUIBYjs = require('./chunk-7SYPUIBY.js');
|
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
var _chunkTVT62GIXjs = require('./chunk-TVT62GIX.js');
|
|
72
75
|
|
|
73
76
|
// src/types.ts
|
|
74
77
|
var ResponseSymbol = Symbol("response");
|
|
75
78
|
var CustomResponse = class {
|
|
76
79
|
static {
|
|
77
|
-
|
|
80
|
+
_chunkTVT62GIXjs.__name.call(void 0, this, "CustomResponse");
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
};
|
|
@@ -87,35 +90,35 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
87
90
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
88
91
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
89
92
|
}
|
|
90
|
-
|
|
93
|
+
_chunkTVT62GIXjs.__name.call(void 0, _ts_decorate, "_ts_decorate");
|
|
91
94
|
function _ts_metadata(k, v) {
|
|
92
95
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
93
96
|
}
|
|
94
|
-
|
|
97
|
+
_chunkTVT62GIXjs.__name.call(void 0, _ts_metadata, "_ts_metadata");
|
|
95
98
|
var ServerBase = (_class = class extends _phecdacore.Base {constructor(...args2) { super(...args2); _class.prototype.__init.call(this); }
|
|
96
99
|
static {
|
|
97
|
-
|
|
100
|
+
_chunkTVT62GIXjs.__name.call(void 0, this, "ServerBase");
|
|
98
101
|
}
|
|
99
|
-
__init() {this.emitter = exports.emitter =
|
|
102
|
+
__init() {this.emitter = exports.emitter = _chunkNL6QBQARjs.emitter}
|
|
100
103
|
}, _class);
|
|
101
104
|
var HttpBase = class extends ServerBase {
|
|
102
105
|
static {
|
|
103
|
-
|
|
106
|
+
_chunkTVT62GIXjs.__name.call(void 0, this, "HttpBase");
|
|
104
107
|
}
|
|
105
108
|
|
|
106
109
|
};
|
|
107
110
|
_ts_decorate([
|
|
108
|
-
|
|
111
|
+
_chunkJDV2XJYEjs.Ctx,
|
|
109
112
|
_ts_metadata("design:type", typeof HttpContext === "undefined" ? Object : HttpContext)
|
|
110
113
|
], HttpBase.prototype, "context", void 0);
|
|
111
114
|
var RpcBase = class extends ServerBase {
|
|
112
115
|
static {
|
|
113
|
-
|
|
116
|
+
_chunkTVT62GIXjs.__name.call(void 0, this, "RpcBase");
|
|
114
117
|
}
|
|
115
118
|
|
|
116
119
|
};
|
|
117
120
|
_ts_decorate([
|
|
118
|
-
|
|
121
|
+
_chunkJDV2XJYEjs.Ctx,
|
|
119
122
|
_ts_metadata("design:type", typeof RpcContext === "undefined" ? Object : RpcContext)
|
|
120
123
|
], RpcBase.prototype, "context", void 0);
|
|
121
124
|
|
|
@@ -123,15 +126,15 @@ _ts_decorate([
|
|
|
123
126
|
|
|
124
127
|
var PFilter = class extends ServerBase {
|
|
125
128
|
static {
|
|
126
|
-
|
|
129
|
+
_chunkTVT62GIXjs.__name.call(void 0, this, "PFilter");
|
|
127
130
|
}
|
|
128
131
|
|
|
129
132
|
constructor(tag) {
|
|
130
133
|
super();
|
|
131
134
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
132
|
-
|
|
135
|
+
_chunkDVTBLV6Ijs.addFilter.call(void 0, this.key, this.use.bind(this));
|
|
133
136
|
this.onUnmount(() => {
|
|
134
|
-
delete
|
|
137
|
+
delete _chunkDVTBLV6Ijs.Context.filterRecord[this.key];
|
|
135
138
|
});
|
|
136
139
|
}
|
|
137
140
|
};
|
|
@@ -140,15 +143,15 @@ var PFilter = class extends ServerBase {
|
|
|
140
143
|
|
|
141
144
|
var PGuard = class extends ServerBase {
|
|
142
145
|
static {
|
|
143
|
-
|
|
146
|
+
_chunkTVT62GIXjs.__name.call(void 0, this, "PGuard");
|
|
144
147
|
}
|
|
145
148
|
|
|
146
149
|
constructor(tag) {
|
|
147
150
|
super();
|
|
148
151
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
149
|
-
|
|
152
|
+
_chunkDVTBLV6Ijs.addGuard.call(void 0, this.key, this.use.bind(this));
|
|
150
153
|
this.onUnmount(() => {
|
|
151
|
-
delete
|
|
154
|
+
delete _chunkDVTBLV6Ijs.Context.guardRecord[this.key];
|
|
152
155
|
});
|
|
153
156
|
}
|
|
154
157
|
};
|
|
@@ -157,16 +160,16 @@ var PGuard = class extends ServerBase {
|
|
|
157
160
|
|
|
158
161
|
var PInterceptor = class extends ServerBase {
|
|
159
162
|
static {
|
|
160
|
-
|
|
163
|
+
_chunkTVT62GIXjs.__name.call(void 0, this, "PInterceptor");
|
|
161
164
|
}
|
|
162
165
|
|
|
163
166
|
constructor(tag) {
|
|
164
167
|
super();
|
|
165
168
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
166
169
|
this.onUnmount(() => {
|
|
167
|
-
delete
|
|
170
|
+
delete _chunkDVTBLV6Ijs.Context.interceptorRecord[this.key];
|
|
168
171
|
});
|
|
169
|
-
|
|
172
|
+
_chunkDVTBLV6Ijs.addInterceptor.call(void 0, this.key, this.use.bind(this));
|
|
170
173
|
}
|
|
171
174
|
};
|
|
172
175
|
|
|
@@ -174,15 +177,15 @@ var PInterceptor = class extends ServerBase {
|
|
|
174
177
|
|
|
175
178
|
var PPipe = class extends ServerBase {
|
|
176
179
|
static {
|
|
177
|
-
|
|
180
|
+
_chunkTVT62GIXjs.__name.call(void 0, this, "PPipe");
|
|
178
181
|
}
|
|
179
182
|
|
|
180
183
|
constructor(tag) {
|
|
181
184
|
super();
|
|
182
185
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
183
|
-
|
|
186
|
+
_chunkDVTBLV6Ijs.addPipe.call(void 0, this.key, this.use.bind(this));
|
|
184
187
|
this.onUnmount(() => {
|
|
185
|
-
delete
|
|
188
|
+
delete _chunkDVTBLV6Ijs.Context.pipeRecord[this.key];
|
|
186
189
|
});
|
|
187
190
|
}
|
|
188
191
|
};
|
|
@@ -191,15 +194,15 @@ var PPipe = class extends ServerBase {
|
|
|
191
194
|
|
|
192
195
|
var PPlugin = class extends ServerBase {
|
|
193
196
|
static {
|
|
194
|
-
|
|
197
|
+
_chunkTVT62GIXjs.__name.call(void 0, this, "PPlugin");
|
|
195
198
|
}
|
|
196
199
|
|
|
197
200
|
constructor(tag) {
|
|
198
201
|
super();
|
|
199
202
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
200
|
-
|
|
203
|
+
_chunkDVTBLV6Ijs.addPlugin.call(void 0, this.key, this.use.bind(this));
|
|
201
204
|
this.onUnmount(() => {
|
|
202
|
-
delete
|
|
205
|
+
delete _chunkDVTBLV6Ijs.Context.pluginRecord[this.key];
|
|
203
206
|
});
|
|
204
207
|
}
|
|
205
208
|
};
|
|
@@ -208,40 +211,40 @@ var PPlugin = class extends ServerBase {
|
|
|
208
211
|
|
|
209
212
|
var PExtension = class extends ServerBase {
|
|
210
213
|
static {
|
|
211
|
-
|
|
214
|
+
_chunkTVT62GIXjs.__name.call(void 0, this, "PExtension");
|
|
212
215
|
}
|
|
213
216
|
|
|
214
217
|
constructor(tag) {
|
|
215
218
|
super();
|
|
216
219
|
const key = this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
217
220
|
if (this.pipe) {
|
|
218
|
-
|
|
221
|
+
_chunkDVTBLV6Ijs.addPipe.call(void 0, key, this.pipe.bind(this));
|
|
219
222
|
this.onUnmount(() => {
|
|
220
|
-
delete
|
|
223
|
+
delete _chunkDVTBLV6Ijs.Context.pipeRecord[key];
|
|
221
224
|
});
|
|
222
225
|
}
|
|
223
226
|
if (this.plugin) {
|
|
224
|
-
|
|
227
|
+
_chunkDVTBLV6Ijs.addPlugin.call(void 0, key, this.plugin.bind(this));
|
|
225
228
|
this.onUnmount(() => {
|
|
226
|
-
delete
|
|
229
|
+
delete _chunkDVTBLV6Ijs.Context.pluginRecord[key];
|
|
227
230
|
});
|
|
228
231
|
}
|
|
229
232
|
if (this.intercept) {
|
|
230
|
-
|
|
233
|
+
_chunkDVTBLV6Ijs.addInterceptor.call(void 0, key, this.intercept.bind(this));
|
|
231
234
|
this.onUnmount(() => {
|
|
232
|
-
delete
|
|
235
|
+
delete _chunkDVTBLV6Ijs.Context.interceptorRecord[key];
|
|
233
236
|
});
|
|
234
237
|
}
|
|
235
238
|
if (this.guard) {
|
|
236
|
-
|
|
239
|
+
_chunkDVTBLV6Ijs.addGuard.call(void 0, key, this.guard.bind(this));
|
|
237
240
|
this.onUnmount(() => {
|
|
238
|
-
delete
|
|
241
|
+
delete _chunkDVTBLV6Ijs.Context.guardRecord[key];
|
|
239
242
|
});
|
|
240
243
|
}
|
|
241
244
|
if (this.filter) {
|
|
242
|
-
|
|
245
|
+
_chunkDVTBLV6Ijs.addFilter.call(void 0, key, this.filter.bind(this));
|
|
243
246
|
this.onUnmount(() => {
|
|
244
|
-
delete
|
|
247
|
+
delete _chunkDVTBLV6Ijs.Context.filterRecord[key];
|
|
245
248
|
});
|
|
246
249
|
}
|
|
247
250
|
}
|
|
@@ -251,7 +254,7 @@ var PExtension = class extends ServerBase {
|
|
|
251
254
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
252
255
|
var Generator = class {
|
|
253
256
|
static {
|
|
254
|
-
|
|
257
|
+
_chunkTVT62GIXjs.__name.call(void 0, this, "Generator");
|
|
255
258
|
}
|
|
256
259
|
|
|
257
260
|
constructor(path) {
|
|
@@ -268,7 +271,7 @@ var Generator = class {
|
|
|
268
271
|
// src/generator/rpc.ts
|
|
269
272
|
var RPCGenerator = (_class2 = class extends Generator {constructor(...args3) { super(...args3); _class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this); }
|
|
270
273
|
static {
|
|
271
|
-
|
|
274
|
+
_chunkTVT62GIXjs.__name.call(void 0, this, "RPCGenerator");
|
|
272
275
|
}
|
|
273
276
|
__init2() {this.name = "RPC"}
|
|
274
277
|
__init3() {this.classMap = {}}
|
|
@@ -304,7 +307,7 @@ var RPCGenerator = (_class2 = class extends Generator {constructor(...args3) { s
|
|
|
304
307
|
// src/generator/http.ts
|
|
305
308
|
var HTTPGenerator = (_class3 = class extends Generator {constructor(...args4) { super(...args4); _class3.prototype.__init4.call(this);_class3.prototype.__init5.call(this); }
|
|
306
309
|
static {
|
|
307
|
-
|
|
310
|
+
_chunkTVT62GIXjs.__name.call(void 0, this, "HTTPGenerator");
|
|
308
311
|
}
|
|
309
312
|
__init4() {this.name = "HTTP"}
|
|
310
313
|
__init5() {this.classMap = {}}
|
|
@@ -420,4 +423,7 @@ return ret
|
|
|
420
423
|
|
|
421
424
|
|
|
422
425
|
|
|
423
|
-
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
exports.Arg = _chunkJDV2XJYEjs.Arg; exports.BadGatewayException = _chunkDVTBLV6Ijs.BadGatewayException; exports.BadRequestException = _chunkDVTBLV6Ijs.BadRequestException; exports.BaseParam = _chunkJDV2XJYEjs.BaseParam; exports.Body = _chunkJDV2XJYEjs.Body; exports.ConflictException = _chunkDVTBLV6Ijs.ConflictException; exports.Context = _chunkDVTBLV6Ijs.Context; exports.Controller = _chunkJDV2XJYEjs.Controller; exports.Ctx = _chunkJDV2XJYEjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkJDV2XJYEjs.Define; exports.Delete = _chunkJDV2XJYEjs.Delete; exports.ERROR_SYMBOL = _chunkTVT62GIXjs.ERROR_SYMBOL; exports.Exception = _chunkDVTBLV6Ijs.Exception; exports.Factory = _chunkNL6QBQARjs.Factory; exports.Filter = _chunkJDV2XJYEjs.Filter; exports.ForbiddenException = _chunkDVTBLV6Ijs.ForbiddenException; exports.FrameworkException = _chunkDVTBLV6Ijs.FrameworkException; exports.Generator = Generator; exports.Get = _chunkJDV2XJYEjs.Get; exports.Guard = _chunkJDV2XJYEjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkJDV2XJYEjs.Head; exports.Header = _chunkJDV2XJYEjs.Header; exports.HttpBase = HttpBase; exports.IS_HMR = _chunkTVT62GIXjs.IS_HMR; exports.IS_ONLY_GENERATE = _chunkTVT62GIXjs.IS_ONLY_GENERATE; exports.IS_STRICT = _chunkTVT62GIXjs.IS_STRICT; exports.Interceptor = _chunkJDV2XJYEjs.Interceptor; exports.InvalidInputException = _chunkDVTBLV6Ijs.InvalidInputException; exports.LOG_LEVEL = _chunkTVT62GIXjs.LOG_LEVEL; exports.Meta = _chunkNL6QBQARjs.Meta; exports.Mixin = _chunkTVT62GIXjs.Mixin; exports.NotFoundException = _chunkDVTBLV6Ijs.NotFoundException; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PInterceptor = PInterceptor; exports.PPipe = PPipe; exports.PPlugin = PPlugin; exports.PS_EXIT_CODE = _chunkTVT62GIXjs.PS_EXIT_CODE; exports.Param = _chunkJDV2XJYEjs.Param; exports.Patch = _chunkJDV2XJYEjs.Patch; exports.PayloadLargeException = _chunkDVTBLV6Ijs.PayloadLargeException; exports.Pipe = _chunkJDV2XJYEjs.Pipe; exports.Plugin = _chunkJDV2XJYEjs.Plugin; exports.Post = _chunkJDV2XJYEjs.Post; exports.Put = _chunkJDV2XJYEjs.Put; exports.Query = _chunkJDV2XJYEjs.Query; exports.Queue = _chunkJDV2XJYEjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkJDV2XJYEjs.Route; exports.Rpc = _chunkJDV2XJYEjs.Rpc; exports.RpcBase = RpcBase; exports.Search = _chunkJDV2XJYEjs.Search; exports.ServerBase = ServerBase; exports.ServerPhecda = _chunkNL6QBQARjs.ServerPhecda; exports.ServiceUnavailableException = _chunkDVTBLV6Ijs.ServiceUnavailableException; exports.TimeoutException = _chunkDVTBLV6Ijs.TimeoutException; exports.TimerException = _chunkDVTBLV6Ijs.TimerException; exports.UnauthorizedException = _chunkDVTBLV6Ijs.UnauthorizedException; exports.UndefinedException = _chunkDVTBLV6Ijs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkDVTBLV6Ijs.UnsupportedMediaTypeException; exports.ValidateException = _chunkDVTBLV6Ijs.ValidateException; exports.WorkerException = _chunkDVTBLV6Ijs.WorkerException; exports.addFilter = _chunkDVTBLV6Ijs.addFilter; exports.addGuard = _chunkDVTBLV6Ijs.addGuard; exports.addInterceptor = _chunkDVTBLV6Ijs.addInterceptor; exports.addPipe = _chunkDVTBLV6Ijs.addPipe; exports.addPlugin = _chunkDVTBLV6Ijs.addPlugin; exports.defaultPipe = _chunkDVTBLV6Ijs.defaultPipe; exports.defaultServerInject = _chunkNL6QBQARjs.defaultServerInject; exports.emitter = _chunkNL6QBQARjs.emitter; exports.getLogger = _chunkTVT62GIXjs.getLogger; exports.log = _chunkTVT62GIXjs.log; exports.phecdaNamespace = _chunkNL6QBQARjs.phecdaNamespace; exports.setLogger = _chunkTVT62GIXjs.setLogger; exports.useS = _chunkNL6QBQARjs.useS;
|
package/dist/index.mjs
CHANGED
|
@@ -23,14 +23,16 @@ import {
|
|
|
23
23
|
Route,
|
|
24
24
|
Rpc,
|
|
25
25
|
Search
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-J7B24YSE.mjs";
|
|
27
27
|
import {
|
|
28
28
|
Factory,
|
|
29
29
|
Meta,
|
|
30
|
-
|
|
30
|
+
ServerPhecda,
|
|
31
|
+
defaultServerInject,
|
|
31
32
|
emitter,
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
phecdaNamespace,
|
|
34
|
+
useS
|
|
35
|
+
} from "./chunk-3H3T54IC.mjs";
|
|
34
36
|
import {
|
|
35
37
|
BadGatewayException,
|
|
36
38
|
BadRequestException,
|
|
@@ -56,7 +58,7 @@ import {
|
|
|
56
58
|
addPipe,
|
|
57
59
|
addPlugin,
|
|
58
60
|
defaultPipe
|
|
59
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-2CFYUXPM.mjs";
|
|
60
62
|
import {
|
|
61
63
|
ERROR_SYMBOL,
|
|
62
64
|
IS_HMR,
|
|
@@ -66,9 +68,10 @@ import {
|
|
|
66
68
|
Mixin,
|
|
67
69
|
PS_EXIT_CODE,
|
|
68
70
|
__name,
|
|
71
|
+
getLogger,
|
|
69
72
|
log,
|
|
70
73
|
setLogger
|
|
71
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-G7TD2VB7.mjs";
|
|
72
75
|
|
|
73
76
|
// src/types.ts
|
|
74
77
|
var ResponseSymbol = Symbol("response");
|
|
@@ -401,6 +404,7 @@ export {
|
|
|
401
404
|
RpcBase,
|
|
402
405
|
Search,
|
|
403
406
|
ServerBase,
|
|
407
|
+
ServerPhecda,
|
|
404
408
|
ServiceUnavailableException,
|
|
405
409
|
TimeoutException,
|
|
406
410
|
TimerException,
|
|
@@ -414,10 +418,12 @@ export {
|
|
|
414
418
|
addInterceptor,
|
|
415
419
|
addPipe,
|
|
416
420
|
addPlugin,
|
|
417
|
-
createPhecda,
|
|
418
421
|
defaultPipe,
|
|
422
|
+
defaultServerInject,
|
|
419
423
|
emitter,
|
|
420
|
-
|
|
424
|
+
getLogger,
|
|
421
425
|
log,
|
|
422
|
-
|
|
426
|
+
phecdaNamespace,
|
|
427
|
+
setLogger,
|
|
428
|
+
useS
|
|
423
429
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
2
|
+
import { F as Factory } from '../../core-P1CsH6jz.mjs';
|
|
3
3
|
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-t9D1fU6G.mjs';
|
|
4
4
|
import { T as ToClientMap } from '../../meta-KtfiBIde.mjs';
|
|
5
5
|
import 'phecda-core';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
2
|
+
import { F as Factory } from '../../core-BlN0Spy9.js';
|
|
3
3
|
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-JVT0mgLD.js';
|
|
4
4
|
import { T as ToClientMap } from '../../meta-KtfiBIde.js';
|
|
5
5
|
import 'phecda-core';
|
package/dist/rpc/bullmq/index.js
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkDVTBLV6Ijs = require('../../chunk-DVTBLV6I.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkTVT62GIXjs = require('../../chunk-TVT62GIX.js');
|
|
11
11
|
|
|
12
12
|
// src/rpc/bullmq/bind.ts
|
|
13
13
|
var _bullmq = require('bullmq');
|
|
@@ -18,14 +18,14 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
18
18
|
const workerMap = {};
|
|
19
19
|
const queueMap = {};
|
|
20
20
|
const existQueue = /* @__PURE__ */ new Set();
|
|
21
|
-
const metaMap =
|
|
21
|
+
const metaMap = _chunkDVTBLV6Ijs.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
22
22
|
const { controller, rpc, func, tag } = meta2.data;
|
|
23
23
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
24
24
|
debug(`register method "${func}" in module "${tag}"`);
|
|
25
25
|
return true;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
|
|
28
|
+
_chunkDVTBLV6Ijs.detectAopDep.call(void 0, meta, {
|
|
29
29
|
guards: globalGuards,
|
|
30
30
|
interceptors: globalInterceptors
|
|
31
31
|
}, "rpc");
|
|
@@ -44,7 +44,7 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
_chunkTVT62GIXjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
|
|
48
48
|
async function handleRequest(job) {
|
|
49
49
|
const { data } = job;
|
|
50
50
|
const { tag, func, args, id, queue: clientQueue, _ps } = data;
|
|
@@ -53,7 +53,7 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
53
53
|
const meta2 = metaMap.get(tag)[func];
|
|
54
54
|
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
55
55
|
if (!isEvent && !(clientQueue in queueMap)) queueMap[clientQueue] = new (0, _bullmq.Queue)(clientQueue, queueOpts);
|
|
56
|
-
const context = new (0,
|
|
56
|
+
const context = new (0, _chunkDVTBLV6Ijs.Context)({
|
|
57
57
|
type: "bullmq",
|
|
58
58
|
moduleMap,
|
|
59
59
|
meta: meta2,
|
|
@@ -85,9 +85,9 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
_chunkTVT62GIXjs.__name.call(void 0, handleRequest, "handleRequest");
|
|
89
89
|
subscribeQueues();
|
|
90
|
-
|
|
90
|
+
_chunkDVTBLV6Ijs.HMR.call(void 0, async () => {
|
|
91
91
|
for (const i in workerMap) await workerMap[i].close(true);
|
|
92
92
|
for (const i in queueMap) await queueMap[i].close();
|
|
93
93
|
await subscribeQueues();
|
|
@@ -97,7 +97,7 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
97
97
|
queueMap
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
_chunkTVT62GIXjs.__name.call(void 0, create, "create");
|
|
101
101
|
|
|
102
102
|
// src/rpc/bullmq/client.ts
|
|
103
103
|
var _events = require('events');
|
|
@@ -108,7 +108,7 @@ async function createClient(controllers, opts = {}) {
|
|
|
108
108
|
const { max, workerOpts, queueOpts, timeout, key } = opts;
|
|
109
109
|
const ret = {};
|
|
110
110
|
const emitter = new (0, _events.EventEmitter)();
|
|
111
|
-
const clientQueue =
|
|
111
|
+
const clientQueue = _chunkDVTBLV6Ijs.genClientQueue.call(void 0, key);
|
|
112
112
|
const queueMap = {};
|
|
113
113
|
new (0, _bullmq.Worker)(clientQueue, async (job) => {
|
|
114
114
|
const { data, id, error } = job.data;
|
|
@@ -153,7 +153,7 @@ async function createClient(controllers, opts = {}) {
|
|
|
153
153
|
if (error) reject(data);
|
|
154
154
|
else resolve(data);
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
_chunkTVT62GIXjs.__name.call(void 0, listener, "listener");
|
|
157
157
|
eventCount++;
|
|
158
158
|
emitter.once(id, listener);
|
|
159
159
|
});
|
|
@@ -163,7 +163,7 @@ async function createClient(controllers, opts = {}) {
|
|
|
163
163
|
}
|
|
164
164
|
return ret;
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
_chunkTVT62GIXjs.__name.call(void 0, createClient, "createClient");
|
|
167
167
|
|
|
168
168
|
|
|
169
169
|
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
createControllerMetaMap,
|
|
5
5
|
detectAopDep,
|
|
6
6
|
genClientQueue
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-2CFYUXPM.mjs";
|
|
8
8
|
import {
|
|
9
9
|
__name
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-G7TD2VB7.mjs";
|
|
11
11
|
|
|
12
12
|
// src/rpc/bullmq/bind.ts
|
|
13
13
|
import { Queue, Worker } from "bullmq";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Consumer, Producer } from 'kafkajs';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
2
|
+
import { F as Factory } from '../../core-P1CsH6jz.mjs';
|
|
3
3
|
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-t9D1fU6G.mjs';
|
|
4
4
|
import { T as ToClientMap } from '../../meta-KtfiBIde.mjs';
|
|
5
5
|
import 'phecda-core';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Consumer, Producer } from 'kafkajs';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
2
|
+
import { F as Factory } from '../../core-BlN0Spy9.js';
|
|
3
3
|
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-JVT0mgLD.js';
|
|
4
4
|
import { T as ToClientMap } from '../../meta-KtfiBIde.js';
|
|
5
5
|
import 'phecda-core';
|
package/dist/rpc/kafka/index.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkDVTBLV6Ijs = require('../../chunk-DVTBLV6I.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkTVT62GIXjs = require('../../chunk-TVT62GIX.js');
|
|
10
10
|
|
|
11
11
|
// src/rpc/kafka/bind.ts
|
|
12
12
|
var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
@@ -14,14 +14,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/kafka");
|
|
|
14
14
|
async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
|
|
15
15
|
const { globalGuards, globalInterceptors, globalFilter, globalPipe } = opts;
|
|
16
16
|
const existQueue = /* @__PURE__ */ new Set();
|
|
17
|
-
const metaMap =
|
|
17
|
+
const metaMap = _chunkDVTBLV6Ijs.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
18
18
|
const { controller, rpc, func, tag } = meta2.data;
|
|
19
19
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
20
20
|
debug(`register method "${func}" in module "${tag}"`);
|
|
21
21
|
return true;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
_chunkDVTBLV6Ijs.detectAopDep.call(void 0, meta, {
|
|
25
25
|
guards: globalGuards,
|
|
26
26
|
interceptors: globalInterceptors
|
|
27
27
|
}, "rpc");
|
|
@@ -43,10 +43,10 @@ async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
_chunkTVT62GIXjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
|
|
47
47
|
await subscribeQueues();
|
|
48
48
|
await consumer.run({
|
|
49
|
-
eachMessage: /* @__PURE__ */
|
|
49
|
+
eachMessage: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, async ({ message, partition, topic, heartbeat, pause }) => {
|
|
50
50
|
if (!existQueue.has(topic)) return;
|
|
51
51
|
const data = JSON.parse(message.value.toString());
|
|
52
52
|
const { tag, func, id, queue: clientQueue, _ps, args } = data;
|
|
@@ -55,7 +55,7 @@ async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
|
|
|
55
55
|
const meta2 = metaMap.get(tag)[func];
|
|
56
56
|
const { data: { rpc } } = meta2;
|
|
57
57
|
const isEvent = rpc.isEvent;
|
|
58
|
-
const context = new (0,
|
|
58
|
+
const context = new (0, _chunkDVTBLV6Ijs.Context)({
|
|
59
59
|
type: "kafka",
|
|
60
60
|
moduleMap,
|
|
61
61
|
meta: meta2,
|
|
@@ -108,7 +108,7 @@ async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
|
|
|
108
108
|
}, "eachMessage")
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
|
|
111
|
+
_chunkTVT62GIXjs.__name.call(void 0, bind, "bind");
|
|
112
112
|
|
|
113
113
|
// src/rpc/kafka/client.ts
|
|
114
114
|
var _events = require('events');
|
|
@@ -117,7 +117,7 @@ async function createClient({ producer, consumer }, controllers, opts) {
|
|
|
117
117
|
let eventCount = 1;
|
|
118
118
|
const ret = {};
|
|
119
119
|
const emitter = new (0, _events.EventEmitter)();
|
|
120
|
-
const clientQueue =
|
|
120
|
+
const clientQueue = _chunkDVTBLV6Ijs.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
|
|
121
121
|
await consumer.subscribe({
|
|
122
122
|
topic: clientQueue,
|
|
123
123
|
fromBeginning: true
|
|
@@ -167,7 +167,7 @@ async function createClient({ producer, consumer }, controllers, opts) {
|
|
|
167
167
|
if (error) reject(data);
|
|
168
168
|
else resolve(data);
|
|
169
169
|
}
|
|
170
|
-
|
|
170
|
+
_chunkTVT62GIXjs.__name.call(void 0, listener, "listener");
|
|
171
171
|
eventCount++;
|
|
172
172
|
emitter.once(id, listener);
|
|
173
173
|
});
|
|
@@ -176,7 +176,7 @@ async function createClient({ producer, consumer }, controllers, opts) {
|
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
await consumer.run({
|
|
179
|
-
eachMessage: /* @__PURE__ */
|
|
179
|
+
eachMessage: /* @__PURE__ */ _chunkTVT62GIXjs.__name.call(void 0, async ({ message, topic }) => {
|
|
180
180
|
if (clientQueue === topic && message.value) {
|
|
181
181
|
const { data, id, error } = JSON.parse(message.value.toString());
|
|
182
182
|
emitter.emit(id, data, error);
|
|
@@ -185,7 +185,7 @@ async function createClient({ producer, consumer }, controllers, opts) {
|
|
|
185
185
|
});
|
|
186
186
|
return ret;
|
|
187
187
|
}
|
|
188
|
-
|
|
188
|
+
_chunkTVT62GIXjs.__name.call(void 0, createClient, "createClient");
|
|
189
189
|
|
|
190
190
|
|
|
191
191
|
|
package/dist/rpc/kafka/index.mjs
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
createControllerMetaMap,
|
|
4
4
|
detectAopDep,
|
|
5
5
|
genClientQueue
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-2CFYUXPM.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__name
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-G7TD2VB7.mjs";
|
|
10
10
|
|
|
11
11
|
// src/rpc/kafka/bind.ts
|
|
12
12
|
import Debug from "debug";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NatsConnection } from 'nats';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
2
|
+
import { F as Factory } from '../../core-P1CsH6jz.mjs';
|
|
3
3
|
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-t9D1fU6G.mjs';
|
|
4
4
|
import { T as ToClientMap } from '../../meta-KtfiBIde.mjs';
|
|
5
5
|
import 'phecda-core';
|
package/dist/rpc/nats/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NatsConnection } from 'nats';
|
|
2
|
-
import { F as Factory } from '../../core-
|
|
2
|
+
import { F as Factory } from '../../core-BlN0Spy9.js';
|
|
3
3
|
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-JVT0mgLD.js';
|
|
4
4
|
import { T as ToClientMap } from '../../meta-KtfiBIde.js';
|
|
5
5
|
import 'phecda-core';
|