phecda-server 8.4.1 → 8.5.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-RS6H6TEX.js → chunk-5ZZAOOKE.js} +26 -26
- package/dist/{chunk-R73A7HS3.js → chunk-76UDKZOJ.js} +53 -53
- package/dist/{chunk-OUQM7GZH.js → chunk-LLF55NZP.js} +14 -4
- package/dist/{chunk-3OKDXHO7.mjs → chunk-MUUKKO67.mjs} +1 -1
- package/dist/{chunk-SRPCXPAQ.js → chunk-SKGOTR4T.js} +20 -20
- package/dist/{chunk-JRNXLEAU.mjs → chunk-URKOYTBU.mjs} +14 -4
- package/dist/{chunk-US2DTB3Z.mjs → chunk-WST6E6MQ.mjs} +1 -1
- package/dist/{chunk-YDJAOLT2.mjs → chunk-ZHNYWZRL.mjs} +1 -1
- package/dist/helper.d.mts +2 -1
- package/dist/helper.d.ts +2 -1
- package/dist/helper.js +5 -3
- package/dist/helper.mjs +4 -2
- package/dist/http/elysia/index.js +45 -41
- package/dist/http/elysia/index.mjs +10 -6
- package/dist/http/express/index.js +38 -38
- package/dist/http/express/index.mjs +3 -3
- package/dist/http/fastify/index.js +39 -39
- package/dist/http/fastify/index.mjs +4 -4
- package/dist/http/h3/index.js +39 -39
- package/dist/http/h3/index.mjs +3 -3
- package/dist/http/hono/index.js +35 -35
- package/dist/http/hono/index.mjs +3 -3
- package/dist/http/hyper-express/index.js +36 -36
- package/dist/http/hyper-express/index.mjs +3 -3
- package/dist/http/koa/index.js +38 -38
- package/dist/http/koa/index.mjs +3 -3
- package/dist/index.js +44 -44
- package/dist/index.mjs +4 -4
- package/dist/rpc/bullmq/index.js +11 -11
- package/dist/rpc/bullmq/index.mjs +2 -2
- package/dist/rpc/electron/index.js +8 -8
- package/dist/rpc/electron/index.mjs +2 -2
- package/dist/rpc/kafka/index.js +10 -10
- package/dist/rpc/kafka/index.mjs +2 -2
- package/dist/rpc/nats/index.js +11 -11
- package/dist/rpc/nats/index.mjs +2 -2
- package/dist/rpc/rabbitmq/index.js +12 -12
- package/dist/rpc/rabbitmq/index.mjs +2 -2
- package/dist/rpc/redis/index.js +10 -10
- package/dist/rpc/redis/index.mjs +2 -2
- package/dist/rpc/ws/index.js +7 -7
- package/dist/rpc/ws/index.mjs +2 -2
- package/dist/test.js +6 -6
- package/dist/test.mjs +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkSKGOTR4Tjs = require('./chunk-SKGOTR4T.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -33,7 +33,7 @@ var _chunkSRPCXPAQjs = require('./chunk-SRPCXPAQ.js');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _chunk5ZZAOOKEjs = require('./chunk-5ZZAOOKE.js');
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
@@ -60,7 +60,7 @@ var _chunkRS6H6TEXjs = require('./chunk-RS6H6TEX.js');
|
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
var
|
|
63
|
+
var _chunk76UDKZOJjs = require('./chunk-76UDKZOJ.js');
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
@@ -75,12 +75,12 @@ var _chunkR73A7HS3js = require('./chunk-R73A7HS3.js');
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
|
|
78
|
-
var
|
|
78
|
+
var _chunkLLF55NZPjs = require('./chunk-LLF55NZP.js');
|
|
79
79
|
|
|
80
80
|
// src/types.ts
|
|
81
81
|
var CustomResponse = class {
|
|
82
82
|
static {
|
|
83
|
-
|
|
83
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "CustomResponse");
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
};
|
|
@@ -93,38 +93,38 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
93
93
|
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;
|
|
94
94
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
_chunkLLF55NZPjs.__name.call(void 0, _ts_decorate, "_ts_decorate");
|
|
97
97
|
function _ts_metadata(k, v) {
|
|
98
98
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
_chunkLLF55NZPjs.__name.call(void 0, _ts_metadata, "_ts_metadata");
|
|
101
101
|
var ServerBase = (_class = class extends _phecdacore.Base {constructor(...args2) { super(...args2); _class.prototype.__init.call(this); }
|
|
102
102
|
static {
|
|
103
|
-
|
|
103
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "ServerBase");
|
|
104
104
|
}
|
|
105
|
-
__init() {this.emitter = exports.emitter =
|
|
105
|
+
__init() {this.emitter = exports.emitter = _chunkSKGOTR4Tjs.emitter}
|
|
106
106
|
log(msg, level = "log") {
|
|
107
|
-
|
|
107
|
+
_chunkLLF55NZPjs.log.call(void 0, msg, level, this.tag);
|
|
108
108
|
}
|
|
109
109
|
}, _class);
|
|
110
110
|
var HttpBase = class extends ServerBase {
|
|
111
111
|
static {
|
|
112
|
-
|
|
112
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "HttpBase");
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
};
|
|
116
116
|
_ts_decorate([
|
|
117
|
-
|
|
117
|
+
_chunk5ZZAOOKEjs.Ctx,
|
|
118
118
|
_ts_metadata("design:type", typeof Ctx === "undefined" ? Object : Ctx)
|
|
119
119
|
], HttpBase.prototype, "context", void 0);
|
|
120
120
|
var RpcBase = class extends ServerBase {
|
|
121
121
|
static {
|
|
122
|
-
|
|
122
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "RpcBase");
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
};
|
|
126
126
|
_ts_decorate([
|
|
127
|
-
|
|
127
|
+
_chunk5ZZAOOKEjs.Ctx,
|
|
128
128
|
_ts_metadata("design:type", typeof Ctx === "undefined" ? Object : Ctx)
|
|
129
129
|
], RpcBase.prototype, "context", void 0);
|
|
130
130
|
|
|
@@ -132,15 +132,15 @@ _ts_decorate([
|
|
|
132
132
|
|
|
133
133
|
var PFilter = class extends ServerBase {
|
|
134
134
|
static {
|
|
135
|
-
|
|
135
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "PFilter");
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
constructor(tag) {
|
|
139
139
|
super();
|
|
140
140
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
141
|
-
|
|
141
|
+
_chunk76UDKZOJjs.addFilter.call(void 0, this.key, this.use.bind(this));
|
|
142
142
|
this.onUnmount(() => {
|
|
143
|
-
delete
|
|
143
|
+
delete _chunk76UDKZOJjs.Context.filterRecord[this.key];
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
};
|
|
@@ -149,16 +149,16 @@ var PFilter = class extends ServerBase {
|
|
|
149
149
|
|
|
150
150
|
var PGuard = (_class2 = class extends ServerBase {
|
|
151
151
|
static {
|
|
152
|
-
|
|
152
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "PGuard");
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
__init2() {this.priority = 0}
|
|
156
156
|
constructor(tag) {
|
|
157
157
|
super();_class2.prototype.__init2.call(this);;
|
|
158
158
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
159
|
-
|
|
159
|
+
_chunk76UDKZOJjs.addGuard.call(void 0, this.key, this.use.bind(this), this.priority);
|
|
160
160
|
this.onUnmount(() => {
|
|
161
|
-
delete
|
|
161
|
+
delete _chunk76UDKZOJjs.Context.guardRecord[this.key];
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
}, _class2);
|
|
@@ -167,15 +167,15 @@ var PGuard = (_class2 = class extends ServerBase {
|
|
|
167
167
|
|
|
168
168
|
var PPipe = class extends ServerBase {
|
|
169
169
|
static {
|
|
170
|
-
|
|
170
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "PPipe");
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
constructor(tag) {
|
|
174
174
|
super();
|
|
175
175
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
176
|
-
|
|
176
|
+
_chunk76UDKZOJjs.addPipe.call(void 0, this.key, this.use.bind(this));
|
|
177
177
|
this.onUnmount(() => {
|
|
178
|
-
delete
|
|
178
|
+
delete _chunk76UDKZOJjs.Context.pipeRecord[this.key];
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
};
|
|
@@ -184,16 +184,16 @@ var PPipe = class extends ServerBase {
|
|
|
184
184
|
|
|
185
185
|
var PAddon = (_class3 = class extends ServerBase {
|
|
186
186
|
static {
|
|
187
|
-
|
|
187
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "PAddon");
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
__init3() {this.priority = 0}
|
|
191
191
|
constructor(tag) {
|
|
192
192
|
super();_class3.prototype.__init3.call(this);;
|
|
193
193
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
194
|
-
|
|
194
|
+
_chunk76UDKZOJjs.addAddon.call(void 0, this.key, this.use.bind(this), this.priority);
|
|
195
195
|
this.onUnmount(() => {
|
|
196
|
-
delete
|
|
196
|
+
delete _chunk76UDKZOJjs.Context.addonRecord[this.key];
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
199
|
}, _class3);
|
|
@@ -202,7 +202,7 @@ var PAddon = (_class3 = class extends ServerBase {
|
|
|
202
202
|
|
|
203
203
|
var PExtension = class extends ServerBase {
|
|
204
204
|
static {
|
|
205
|
-
|
|
205
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "PExtension");
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
|
|
@@ -211,27 +211,27 @@ var PExtension = class extends ServerBase {
|
|
|
211
211
|
super();
|
|
212
212
|
const key = this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
213
213
|
if (this.pipe) {
|
|
214
|
-
|
|
214
|
+
_chunk76UDKZOJjs.addPipe.call(void 0, key, this.pipe.bind(this));
|
|
215
215
|
this.onUnmount(() => {
|
|
216
|
-
delete
|
|
216
|
+
delete _chunk76UDKZOJjs.Context.pipeRecord[key];
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
if (this.addon) {
|
|
220
|
-
|
|
220
|
+
_chunk76UDKZOJjs.addAddon.call(void 0, key, this.addon.bind(this), this.addonPriority);
|
|
221
221
|
this.onUnmount(() => {
|
|
222
|
-
delete
|
|
222
|
+
delete _chunk76UDKZOJjs.Context.addonRecord[key];
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
if (this.guard) {
|
|
226
|
-
|
|
226
|
+
_chunk76UDKZOJjs.addGuard.call(void 0, key, this.guard.bind(this), this.guardPriority);
|
|
227
227
|
this.onUnmount(() => {
|
|
228
|
-
delete
|
|
228
|
+
delete _chunk76UDKZOJjs.Context.guardRecord[key];
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
if (this.filter) {
|
|
232
|
-
|
|
232
|
+
_chunk76UDKZOJjs.addFilter.call(void 0, key, this.filter.bind(this));
|
|
233
233
|
this.onUnmount(() => {
|
|
234
|
-
delete
|
|
234
|
+
delete _chunk76UDKZOJjs.Context.filterRecord[key];
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
}
|
|
@@ -241,7 +241,7 @@ var PExtension = class extends ServerBase {
|
|
|
241
241
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
242
242
|
var Generator = (_class4 = class {
|
|
243
243
|
static {
|
|
244
|
-
|
|
244
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "Generator");
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
constructor(path) {;_class4.prototype.__init4.call(this);
|
|
@@ -259,7 +259,7 @@ var Generator = (_class4 = class {
|
|
|
259
259
|
// src/generator/rpc.ts
|
|
260
260
|
var RPCGenerator = (_class5 = class extends Generator {constructor(...args3) { super(...args3); _class5.prototype.__init5.call(this);_class5.prototype.__init6.call(this); }
|
|
261
261
|
static {
|
|
262
|
-
|
|
262
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "RPCGenerator");
|
|
263
263
|
}
|
|
264
264
|
__init5() {this.name = "RPC"}
|
|
265
265
|
__init6() {this.classMap = {}}
|
|
@@ -295,7 +295,7 @@ var RPCGenerator = (_class5 = class extends Generator {constructor(...args3) { s
|
|
|
295
295
|
// src/generator/http.ts
|
|
296
296
|
var HTTPGenerator = (_class6 = class extends Generator {constructor(...args4) { super(...args4); _class6.prototype.__init7.call(this);_class6.prototype.__init8.call(this); }
|
|
297
297
|
static {
|
|
298
|
-
|
|
298
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "HTTPGenerator");
|
|
299
299
|
}
|
|
300
300
|
__init7() {this.name = "HTTP"}
|
|
301
301
|
__init8() {this.classMap = {}}
|
|
@@ -312,7 +312,7 @@ var HTTPGenerator = (_class6 = class extends Generator {constructor(...args4) {
|
|
|
312
312
|
addMethod(args) {
|
|
313
313
|
const { http, name, method, params, tag } = args;
|
|
314
314
|
if (!_optionalChain([http, 'optionalAccess', _2 => _2.method])) return;
|
|
315
|
-
const url =
|
|
315
|
+
const url = _chunk76UDKZOJjs.joinUrl.call(void 0, http.prefix, http.route).replace(/\/\:([^\/]*)/g, (_, js) => `/{{${js}}}`);
|
|
316
316
|
if (!this.classMap[name]) this.classMap[name] = {};
|
|
317
317
|
this.classMap[name][method] = `
|
|
318
318
|
${method}(...args){
|
|
@@ -338,7 +338,7 @@ return ret
|
|
|
338
338
|
|
|
339
339
|
var OpenAPIGenerator = (_class7 = class extends Generator {constructor(...args5) { super(...args5); _class7.prototype.__init9.call(this);_class7.prototype.__init10.call(this);_class7.prototype.__init11.call(this); }
|
|
340
340
|
static {
|
|
341
|
-
|
|
341
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "OpenAPIGenerator");
|
|
342
342
|
}
|
|
343
343
|
__init9() {this.ext = ".json"}
|
|
344
344
|
__init10() {this.name = "OpenAPI"}
|
|
@@ -359,7 +359,7 @@ var OpenAPIGenerator = (_class7 = class extends Generator {constructor(...args5)
|
|
|
359
359
|
if (!_optionalChain([http, 'optionalAccess', _3 => _3.method])) return;
|
|
360
360
|
const config = _phecdacore.getMergedMeta.call(void 0, model, method).openapi;
|
|
361
361
|
if (!config) return;
|
|
362
|
-
const path =
|
|
362
|
+
const path = _chunk76UDKZOJjs.joinUrl.call(void 0, http.prefix, http.route);
|
|
363
363
|
if (!this.paths[path]) this.paths[path] = {};
|
|
364
364
|
this.paths[path][http.method] = {
|
|
365
365
|
summary: config.summary,
|
|
@@ -384,7 +384,7 @@ var OpenAPIGenerator = (_class7 = class extends Generator {constructor(...args5)
|
|
|
384
384
|
// src/generator/doc.ts
|
|
385
385
|
var DocGenerator = (_class8 = class extends Generator {
|
|
386
386
|
static {
|
|
387
|
-
|
|
387
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "DocGenerator");
|
|
388
388
|
}
|
|
389
389
|
__init12() {this.name = "DOC"}
|
|
390
390
|
__init13() {this.classMap = {}}
|
|
@@ -420,7 +420,7 @@ var DocGenerator = (_class8 = class extends Generator {
|
|
|
420
420
|
|
|
421
421
|
var GraphGenerator = (_class9 = class extends Generator {constructor(...args6) { super(...args6); _class9.prototype.__init14.call(this);_class9.prototype.__init15.call(this); }
|
|
422
422
|
static {
|
|
423
|
-
|
|
423
|
+
_chunkLLF55NZPjs.__name.call(void 0, this, "GraphGenerator");
|
|
424
424
|
}
|
|
425
425
|
__init14() {this.ext = ".mmd"}
|
|
426
426
|
__init15() {this.name = "Graph"}
|
|
@@ -538,4 +538,4 @@ var GraphGenerator = (_class9 = class extends Generator {constructor(...args6) {
|
|
|
538
538
|
|
|
539
539
|
|
|
540
540
|
|
|
541
|
-
exports.Addon =
|
|
541
|
+
exports.Addon = _chunk5ZZAOOKEjs.Addon; exports.ApiDoc = _chunk5ZZAOOKEjs.ApiDoc; exports.Arg = _chunk5ZZAOOKEjs.Arg; exports.BadGatewayException = _chunk76UDKZOJjs.BadGatewayException; exports.BadRequestException = _chunk76UDKZOJjs.BadRequestException; exports.BaseParam = _chunk5ZZAOOKEjs.BaseParam; exports.Body = _chunk5ZZAOOKEjs.Body; exports.ConflictException = _chunk76UDKZOJjs.ConflictException; exports.Context = _chunk76UDKZOJjs.Context; exports.Controller = _chunk5ZZAOOKEjs.Controller; exports.Ctx = _chunk5ZZAOOKEjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunk5ZZAOOKEjs.Define; exports.Delete = _chunk5ZZAOOKEjs.Delete; exports.DocGenerator = DocGenerator; exports.ERROR_SYMBOL = _chunkLLF55NZPjs.ERROR_SYMBOL; exports.Exception = _chunk76UDKZOJjs.Exception; exports.Factory = _chunkSKGOTR4Tjs.Factory; exports.Filter = _chunk5ZZAOOKEjs.Filter; exports.ForbiddenException = _chunk76UDKZOJjs.ForbiddenException; exports.FrameworkException = _chunk76UDKZOJjs.FrameworkException; exports.Generator = Generator; exports.Get = _chunk5ZZAOOKEjs.Get; exports.GraphGenerator = GraphGenerator; exports.Guard = _chunk5ZZAOOKEjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunk5ZZAOOKEjs.Head; exports.Header = _chunk5ZZAOOKEjs.Header; exports.HttpBase = HttpBase; exports.IS_DEV = _chunkLLF55NZPjs.IS_DEV; exports.IS_ONLY_GENERATE = _chunkLLF55NZPjs.IS_ONLY_GENERATE; exports.IS_PURE = _chunkLLF55NZPjs.IS_PURE; exports.IS_STRICT = _chunkLLF55NZPjs.IS_STRICT; exports.InvalidInputException = _chunk76UDKZOJjs.InvalidInputException; exports.LOG_LEVEL = _chunkLLF55NZPjs.LOG_LEVEL; exports.Meta = _chunkSKGOTR4Tjs.Meta; exports.Mixin = _chunkLLF55NZPjs.Mixin; exports.NotFoundException = _chunk76UDKZOJjs.NotFoundException; exports.OpenAPIGenerator = OpenAPIGenerator; exports.PAddon = PAddon; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PPipe = PPipe; exports.PS_EXIT_CODE = _chunkLLF55NZPjs.PS_EXIT_CODE; exports.Param = _chunk5ZZAOOKEjs.Param; exports.Patch = _chunk5ZZAOOKEjs.Patch; exports.PayloadLargeException = _chunk76UDKZOJjs.PayloadLargeException; exports.Pipe = _chunk5ZZAOOKEjs.Pipe; exports.Post = _chunk5ZZAOOKEjs.Post; exports.Put = _chunk5ZZAOOKEjs.Put; exports.Query = _chunk5ZZAOOKEjs.Query; exports.Queue = _chunk5ZZAOOKEjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunk5ZZAOOKEjs.Route; exports.Rpc = _chunk5ZZAOOKEjs.Rpc; exports.RpcBase = RpcBase; exports.Search = _chunk5ZZAOOKEjs.Search; exports.ServerBase = ServerBase; exports.ServerPhecda = _chunkSKGOTR4Tjs.ServerPhecda; exports.ServiceUnavailableException = _chunk76UDKZOJjs.ServiceUnavailableException; exports.TimeoutException = _chunk76UDKZOJjs.TimeoutException; exports.TimerException = _chunk76UDKZOJjs.TimerException; exports.UnauthorizedException = _chunk76UDKZOJjs.UnauthorizedException; exports.UndefinedException = _chunk76UDKZOJjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunk76UDKZOJjs.UnsupportedMediaTypeException; exports.UploadFile = _chunk5ZZAOOKEjs.UploadFile; exports.ValidateException = _chunk76UDKZOJjs.ValidateException; exports.WorkerException = _chunk76UDKZOJjs.WorkerException; exports.addAddon = _chunk76UDKZOJjs.addAddon; exports.addFilter = _chunk76UDKZOJjs.addFilter; exports.addGuard = _chunk76UDKZOJjs.addGuard; exports.addPipe = _chunk76UDKZOJjs.addPipe; exports.defaultFilter = _chunk76UDKZOJjs.defaultFilter; exports.defaultPipe = _chunk76UDKZOJjs.defaultPipe; exports.defaultServerInject = _chunkSKGOTR4Tjs.defaultServerInject; exports.emitter = _chunkSKGOTR4Tjs.emitter; exports.getLogger = _chunkLLF55NZPjs.getLogger; exports.log = _chunkLLF55NZPjs.log; exports.phecdaNamespace = _chunkSKGOTR4Tjs.phecdaNamespace; exports.runMiddleware = _chunkLLF55NZPjs.runMiddleware; exports.setLogger = _chunkLLF55NZPjs.setLogger; exports.useS = _chunkSKGOTR4Tjs.useS;
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
emitter,
|
|
7
7
|
phecdaNamespace,
|
|
8
8
|
useS
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZHNYWZRL.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Addon,
|
|
12
12
|
ApiDoc,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
Rpc,
|
|
34
34
|
Search,
|
|
35
35
|
UploadFile
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-MUUKKO67.mjs";
|
|
37
37
|
import {
|
|
38
38
|
BadGatewayException,
|
|
39
39
|
BadRequestException,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
defaultFilter,
|
|
61
61
|
defaultPipe,
|
|
62
62
|
joinUrl
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-WST6E6MQ.mjs";
|
|
64
64
|
import {
|
|
65
65
|
ERROR_SYMBOL,
|
|
66
66
|
IS_DEV,
|
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
log,
|
|
76
76
|
runMiddleware,
|
|
77
77
|
setLogger
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-URKOYTBU.mjs";
|
|
79
79
|
|
|
80
80
|
// src/types.ts
|
|
81
81
|
var CustomResponse = class {
|
package/dist/rpc/bullmq/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk76UDKZOJjs = require('../../chunk-76UDKZOJ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkLLF55NZPjs = require('../../chunk-LLF55NZP.js');
|
|
10
10
|
|
|
11
11
|
// src/rpc/bullmq/create.ts
|
|
12
12
|
var _bullmq = require('bullmq');
|
|
@@ -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 = _chunk76UDKZOJjs.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
|
+
_chunk76UDKZOJjs.detectAopDep.call(void 0, meta, {
|
|
28
28
|
guards: globalGuards
|
|
29
29
|
}, "rpc");
|
|
30
30
|
async function subscribeQueues() {
|
|
@@ -38,12 +38,12 @@ 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
|
+
_chunk76UDKZOJjs.Context.applyAddons(addons, workerMap[queue], "bullmq");
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
_chunkLLF55NZPjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
|
|
47
47
|
async function handleRequest(job) {
|
|
48
48
|
const { data } = job;
|
|
49
49
|
const { tag, method, args, id, queue: clientQueue, _ps } = data;
|
|
@@ -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 = _chunk76UDKZOJjs.Context.getAop(meta2, {
|
|
56
56
|
globalFilter,
|
|
57
57
|
globalGuards,
|
|
58
58
|
globalPipe
|
|
59
59
|
});
|
|
60
|
-
const context = new (0,
|
|
60
|
+
const context = new (0, _chunk76UDKZOJjs.Context)({
|
|
61
61
|
type: "bullmq",
|
|
62
62
|
category: "rpc",
|
|
63
63
|
moduleMap,
|
|
@@ -85,9 +85,9 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
_chunkLLF55NZPjs.__name.call(void 0, handleRequest, "handleRequest");
|
|
89
89
|
subscribeQueues();
|
|
90
|
-
|
|
90
|
+
_chunkLLF55NZPjs.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
|
+
_chunkLLF55NZPjs.__name.call(void 0, create, "create");
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
exports.create = create;
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
Context,
|
|
3
3
|
createControllerMetaMap,
|
|
4
4
|
detectAopDep
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-WST6E6MQ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
HMR,
|
|
8
8
|
__name
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-URKOYTBU.mjs";
|
|
10
10
|
|
|
11
11
|
// src/rpc/bullmq/create.ts
|
|
12
12
|
import { Queue, Worker } from "bullmq";
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk76UDKZOJjs = require('../../chunk-76UDKZOJ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkLLF55NZPjs = require('../../chunk-LLF55NZP.js');
|
|
9
9
|
|
|
10
10
|
// src/rpc/electron/bind.ts
|
|
11
11
|
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 = _chunk76UDKZOJjs.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
|
+
_chunk76UDKZOJjs.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 = _chunk76UDKZOJjs.Context.getAop(meta2, {
|
|
35
35
|
globalFilter,
|
|
36
36
|
globalGuards,
|
|
37
37
|
globalPipe
|
|
38
38
|
});
|
|
39
|
-
const context = new (0,
|
|
39
|
+
const context = new (0, _chunk76UDKZOJjs.Context)({
|
|
40
40
|
type: "electron",
|
|
41
41
|
category: "rpc",
|
|
42
42
|
moduleMap,
|
|
@@ -64,9 +64,9 @@ function bind(IPC, { moduleMap, meta }, opts = {}) {
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
_chunkLLF55NZPjs.__name.call(void 0, callback, "callback");
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
_chunkLLF55NZPjs.__name.call(void 0, bind, "bind");
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
exports.bind = bind;
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
Context,
|
|
3
3
|
createControllerMetaMap,
|
|
4
4
|
detectAopDep
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-WST6E6MQ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-URKOYTBU.mjs";
|
|
9
9
|
|
|
10
10
|
// src/rpc/electron/bind.ts
|
|
11
11
|
import Debug from "debug";
|
package/dist/rpc/kafka/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk76UDKZOJjs = require('../../chunk-76UDKZOJ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkLLF55NZPjs = require('../../chunk-LLF55NZP.js');
|
|
9
9
|
|
|
10
10
|
// src/rpc/kafka/bind.ts
|
|
11
11
|
var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
@@ -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 = _chunk76UDKZOJjs.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
|
+
_chunk76UDKZOJjs.detectAopDep.call(void 0, meta, {
|
|
24
24
|
guards: globalGuards,
|
|
25
25
|
addons: globalAddons
|
|
26
26
|
}, "rpc");
|
|
27
|
-
|
|
27
|
+
_chunk76UDKZOJjs.Context.applyAddons(globalAddons, {
|
|
28
28
|
consumer,
|
|
29
29
|
producer
|
|
30
30
|
}, "kafka");
|
|
@@ -46,10 +46,10 @@ async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
_chunkLLF55NZPjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
|
|
50
50
|
await subscribeQueues();
|
|
51
51
|
await consumer.run({
|
|
52
|
-
eachMessage: /* @__PURE__ */
|
|
52
|
+
eachMessage: /* @__PURE__ */ _chunkLLF55NZPjs.__name.call(void 0, async ({ message, partition, topic, heartbeat, pause }) => {
|
|
53
53
|
if (!existQueue.has(topic)) return;
|
|
54
54
|
const data = JSON.parse(message.value.toString());
|
|
55
55
|
const { tag, method, id, queue: clientQueue, _ps, args } = data;
|
|
@@ -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 = _chunk76UDKZOJjs.Context.getAop(meta2, {
|
|
62
62
|
globalFilter,
|
|
63
63
|
globalGuards,
|
|
64
64
|
globalPipe
|
|
65
65
|
});
|
|
66
|
-
const context = new (0,
|
|
66
|
+
const context = new (0, _chunk76UDKZOJjs.Context)({
|
|
67
67
|
type: "kafka",
|
|
68
68
|
category: "rpc",
|
|
69
69
|
moduleMap,
|
|
@@ -112,7 +112,7 @@ async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
|
|
|
112
112
|
}, "eachMessage")
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
_chunkLLF55NZPjs.__name.call(void 0, bind, "bind");
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
exports.bind = bind;
|
package/dist/rpc/kafka/index.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
Context,
|
|
3
3
|
createControllerMetaMap,
|
|
4
4
|
detectAopDep
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-WST6E6MQ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-URKOYTBU.mjs";
|
|
9
9
|
|
|
10
10
|
// src/rpc/kafka/bind.ts
|
|
11
11
|
import Debug from "debug";
|
package/dist/rpc/nats/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk76UDKZOJjs = require('../../chunk-76UDKZOJ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkLLF55NZPjs = require('../../chunk-LLF55NZP.js');
|
|
10
10
|
|
|
11
11
|
// src/rpc/nats/bind.ts
|
|
12
12
|
var _nats = require('nats');
|
|
@@ -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 = _chunk76UDKZOJjs.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
|
+
_chunk76UDKZOJjs.detectAopDep.call(void 0, meta, {
|
|
28
28
|
addons: globalAddons,
|
|
29
29
|
guards: globalGuards
|
|
30
30
|
}, "rpc");
|
|
31
|
-
|
|
31
|
+
_chunk76UDKZOJjs.Context.applyAddons(globalAddons, nc, "nats");
|
|
32
32
|
async function subscribeQueues() {
|
|
33
33
|
existQueue.clear();
|
|
34
34
|
for (const [tag, record] of metaMap) {
|
|
@@ -47,7 +47,7 @@ async function bind(nc, { moduleMap, meta }, opts = {}) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
_chunkLLF55NZPjs.__name.call(void 0, subscribeQueues, "subscribeQueues");
|
|
51
51
|
async function handleRequest(_, msg) {
|
|
52
52
|
const data = JSON.parse(sc.decode(msg.data));
|
|
53
53
|
const { tag, method, id, _ps, args } = data;
|
|
@@ -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 = _chunk76UDKZOJjs.Context.getAop(meta2, {
|
|
60
60
|
globalFilter,
|
|
61
61
|
globalGuards,
|
|
62
62
|
globalPipe
|
|
63
63
|
});
|
|
64
|
-
const context = new (0,
|
|
64
|
+
const context = new (0, _chunk76UDKZOJjs.Context)({
|
|
65
65
|
type: "nats",
|
|
66
66
|
category: "rpc",
|
|
67
67
|
moduleMap,
|
|
@@ -88,14 +88,14 @@ async function bind(nc, { moduleMap, meta }, opts = {}) {
|
|
|
88
88
|
})));
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
_chunkLLF55NZPjs.__name.call(void 0, handleRequest, "handleRequest");
|
|
92
92
|
subscribeQueues();
|
|
93
|
-
|
|
93
|
+
_chunkLLF55NZPjs.HMR.call(void 0, async () => {
|
|
94
94
|
for (const i in subscriptionMap) subscriptionMap[i].unsubscribe();
|
|
95
95
|
await subscribeQueues();
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
|
|
98
|
+
_chunkLLF55NZPjs.__name.call(void 0, bind, "bind");
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
exports.bind = bind;
|