phecda-server 5.0.0-alpha.11 → 5.0.0-alpha.13
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-JJG37LHY.mjs → chunk-BADPI5WG.mjs} +25 -21
- package/dist/{chunk-KGMDCF26.mjs → chunk-DJO45NRZ.mjs} +6 -2
- package/dist/{chunk-C36XJ7D3.js → chunk-GWLM5DEJ.js} +7 -3
- package/dist/{chunk-MZBE4NIO.mjs → chunk-HQ5RLYMA.mjs} +1 -1
- package/dist/{chunk-ANH53I6B.js → chunk-INPMEA67.js} +33 -37
- package/dist/{chunk-P5LJBZPN.js → chunk-MFCPWVO5.js} +65 -61
- package/dist/{chunk-2AI7ID6X.js → chunk-SSZS3GSQ.js} +2 -2
- package/dist/{chunk-KKTRNKCF.mjs → chunk-Y7AOZMC2.mjs} +15 -19
- package/dist/{core-39d78b79.d.ts → core-11dd822c.d.ts} +8 -5
- package/dist/index.d.ts +26 -25
- package/dist/index.js +77 -62
- package/dist/index.mjs +32 -17
- package/dist/rpc/kafka/index.d.ts +1 -1
- package/dist/rpc/kafka/index.js +9 -9
- package/dist/rpc/kafka/index.mjs +3 -3
- package/dist/rpc/rabbitmq/index.d.ts +1 -1
- package/dist/rpc/rabbitmq/index.js +9 -9
- package/dist/rpc/rabbitmq/index.mjs +3 -3
- package/dist/rpc/redis/index.d.ts +1 -1
- package/dist/rpc/redis/index.js +9 -9
- package/dist/rpc/redis/index.mjs +3 -3
- package/dist/server/express/index.d.ts +1 -1
- package/dist/server/express/index.js +24 -24
- package/dist/server/express/index.mjs +4 -4
- package/dist/server/fastify/index.d.ts +1 -1
- package/dist/server/fastify/index.js +22 -22
- package/dist/server/fastify/index.mjs +4 -4
- package/dist/server/h3/index.d.ts +1 -1
- package/dist/server/h3/index.js +21 -21
- package/dist/server/h3/index.mjs +4 -4
- package/dist/server/koa/index.d.ts +1 -1
- package/dist/server/koa/index.js +24 -24
- package/dist/server/koa/index.mjs +4 -4
- package/dist/test.d.ts +5 -4
- package/dist/test.js +45 -43
- package/dist/test.mjs +42 -40
- package/package.json +2 -2
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
__name,
|
|
6
6
|
__publicField,
|
|
7
7
|
log
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DJO45NRZ.mjs";
|
|
9
9
|
|
|
10
10
|
// src/exception/base.ts
|
|
11
11
|
var Exception = class extends Error {
|
|
@@ -169,16 +169,12 @@ import pc from "picocolors";
|
|
|
169
169
|
// src/filter.ts
|
|
170
170
|
var defaultFilter = /* @__PURE__ */ __name((e) => {
|
|
171
171
|
if (!(e instanceof Exception)) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
console.error(e.stack);
|
|
175
|
-
}
|
|
172
|
+
log(e.message, "error");
|
|
173
|
+
console.error(e.stack);
|
|
176
174
|
e = new UndefinedException(e.message || e);
|
|
177
175
|
} else {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
console.error(e.stack);
|
|
181
|
-
}
|
|
176
|
+
log(`[${e.constructor.name}] ${e.message}`, "error");
|
|
177
|
+
console.error(e.stack);
|
|
182
178
|
}
|
|
183
179
|
return e.data;
|
|
184
180
|
}, "defaultFilter");
|
|
@@ -272,12 +268,12 @@ var _Context = class {
|
|
|
272
268
|
static usePlugin(plugins) {
|
|
273
269
|
const ret = [];
|
|
274
270
|
for (const m of plugins) {
|
|
275
|
-
if (!(m in _Context.
|
|
271
|
+
if (!(m in _Context.addonRecord)) {
|
|
276
272
|
if (IS_STRICT)
|
|
277
273
|
throw new FrameworkException(`can't find middleware named '${m}'`);
|
|
278
274
|
continue;
|
|
279
275
|
}
|
|
280
|
-
ret.push(_Context.
|
|
276
|
+
ret.push(_Context.addonRecord[m]);
|
|
281
277
|
}
|
|
282
278
|
return ret;
|
|
283
279
|
}
|
|
@@ -292,30 +288,38 @@ __publicField(Context, "pipeRecord", {
|
|
|
292
288
|
});
|
|
293
289
|
__publicField(Context, "guardRecord", {});
|
|
294
290
|
__publicField(Context, "interceptorRecord", {});
|
|
295
|
-
__publicField(Context, "
|
|
296
|
-
function
|
|
297
|
-
Context.
|
|
291
|
+
__publicField(Context, "addonRecord", {});
|
|
292
|
+
function addAddon(key, handler) {
|
|
293
|
+
if (Context.addonRecord[key] && Context.addonRecord[key] !== handler)
|
|
294
|
+
log(`overwrite Addon "${String(key)}"`, "warn");
|
|
295
|
+
Context.addonRecord[key] = handler;
|
|
298
296
|
}
|
|
299
|
-
__name(
|
|
300
|
-
function addPipe(key,
|
|
301
|
-
Context.pipeRecord[key]
|
|
297
|
+
__name(addAddon, "addAddon");
|
|
298
|
+
function addPipe(key, handler) {
|
|
299
|
+
if (Context.pipeRecord[key] && Context.pipeRecord[key] !== handler)
|
|
300
|
+
log(`overwrite Pipe "${String(key)}"`, "warn");
|
|
301
|
+
Context.pipeRecord[key] = handler;
|
|
302
302
|
}
|
|
303
303
|
__name(addPipe, "addPipe");
|
|
304
304
|
function addFilter(key, handler) {
|
|
305
|
+
if (Context.filterRecord[key] && Context.filterRecord[key] !== handler)
|
|
306
|
+
log(`overwrite Filter "${String(key)}"`, "warn");
|
|
305
307
|
Context.filterRecord[key] = handler;
|
|
306
308
|
}
|
|
307
309
|
__name(addFilter, "addFilter");
|
|
308
310
|
function addGuard(key, handler) {
|
|
311
|
+
if (Context.guardRecord[key] && Context.guardRecord[key] !== handler)
|
|
312
|
+
log(`overwrite Guard "${String(key)}"`, "warn");
|
|
309
313
|
Context.guardRecord[key] = handler;
|
|
310
314
|
}
|
|
311
315
|
__name(addGuard, "addGuard");
|
|
312
316
|
function addInterceptor(key, handler) {
|
|
317
|
+
if (Context.interceptorRecord[key] && Context.interceptorRecord[key] !== handler)
|
|
318
|
+
log(`overwrite Interceptor "${String(key)}"`, "warn");
|
|
313
319
|
Context.interceptorRecord[key] = handler;
|
|
314
320
|
}
|
|
315
321
|
__name(addInterceptor, "addInterceptor");
|
|
316
322
|
function isAopDepInject(meta, { guards, interceptors, plugins } = {}) {
|
|
317
|
-
if (!IS_DEV)
|
|
318
|
-
return;
|
|
319
323
|
const pluginSet = new Set(plugins);
|
|
320
324
|
const guardSet = new Set(guards);
|
|
321
325
|
const interceptorSet = new Set(interceptors);
|
|
@@ -334,7 +338,7 @@ function isAopDepInject(meta, { guards, interceptors, plugins } = {}) {
|
|
|
334
338
|
});
|
|
335
339
|
const missPlugins = [
|
|
336
340
|
...pluginSet
|
|
337
|
-
].filter((i) => !Context.
|
|
341
|
+
].filter((i) => !Context.addonRecord[i]);
|
|
338
342
|
const missGuards = [
|
|
339
343
|
...guardSet
|
|
340
344
|
].filter((i) => !Context.guardRecord[i]);
|
|
@@ -379,7 +383,7 @@ export {
|
|
|
379
383
|
FrameworkException,
|
|
380
384
|
guardRecord,
|
|
381
385
|
Context,
|
|
382
|
-
|
|
386
|
+
addAddon,
|
|
383
387
|
addPipe,
|
|
384
388
|
addFilter,
|
|
385
389
|
addGuard,
|
|
@@ -14,15 +14,18 @@ var META_SYMBOL = "__PS_META__";
|
|
|
14
14
|
var APP_SYMBOL = "__PS__";
|
|
15
15
|
var IS_DEV = process.env.NODE_ENV === "development";
|
|
16
16
|
var IS_STRICT = !!process.env.PS_STRICT;
|
|
17
|
+
var IS_LOG_BAN = !!process.env.PS_LOG_BAN;
|
|
17
18
|
var ERROR_SYMBOL = "__PS_ERROR__";
|
|
18
|
-
var PS_FILE_RE = /\.(controller|service|module|extension|guard|interceptor|
|
|
19
|
-
var PS_IMPORT_RE = /\.(controller|extension|guard|interceptor|
|
|
19
|
+
var PS_FILE_RE = /\.(controller|service|module|extension|ext|guard|interceptor|addon|filter|pipe|edge)\.ts$/i;
|
|
20
|
+
var PS_IMPORT_RE = /\.(controller|extension|ext|guard|interceptor|addon|filter|pipe|edge)\.ts$/i;
|
|
20
21
|
|
|
21
22
|
// src/utils.ts
|
|
22
23
|
import pc from "picocolors";
|
|
23
24
|
import { DataMap } from "phecda-core";
|
|
24
25
|
var time;
|
|
25
26
|
function log(msg, level = "info") {
|
|
27
|
+
if (IS_LOG_BAN)
|
|
28
|
+
return;
|
|
26
29
|
const color = {
|
|
27
30
|
error: "red",
|
|
28
31
|
info: "green",
|
|
@@ -70,6 +73,7 @@ export {
|
|
|
70
73
|
APP_SYMBOL,
|
|
71
74
|
IS_DEV,
|
|
72
75
|
IS_STRICT,
|
|
76
|
+
IS_LOG_BAN,
|
|
73
77
|
ERROR_SYMBOL,
|
|
74
78
|
PS_FILE_RE,
|
|
75
79
|
PS_IMPORT_RE,
|
|
@@ -14,15 +14,18 @@ var META_SYMBOL = "__PS_META__";
|
|
|
14
14
|
var APP_SYMBOL = "__PS__";
|
|
15
15
|
var IS_DEV = process.env.NODE_ENV === "development";
|
|
16
16
|
var IS_STRICT = !!process.env.PS_STRICT;
|
|
17
|
+
var IS_LOG_BAN = !!process.env.PS_LOG_BAN;
|
|
17
18
|
var ERROR_SYMBOL = "__PS_ERROR__";
|
|
18
|
-
var PS_FILE_RE = /\.(controller|service|module|extension|guard|interceptor|
|
|
19
|
-
var PS_IMPORT_RE = /\.(controller|extension|guard|interceptor|
|
|
19
|
+
var PS_FILE_RE = /\.(controller|service|module|extension|ext|guard|interceptor|addon|filter|pipe|edge)\.ts$/i;
|
|
20
|
+
var PS_IMPORT_RE = /\.(controller|extension|ext|guard|interceptor|addon|filter|pipe|edge)\.ts$/i;
|
|
20
21
|
|
|
21
22
|
// src/utils.ts
|
|
22
23
|
var _picocolors = require('picocolors'); var _picocolors2 = _interopRequireDefault(_picocolors);
|
|
23
24
|
var _phecdacore = require('phecda-core');
|
|
24
25
|
var time;
|
|
25
26
|
function log(msg, level = "info") {
|
|
27
|
+
if (IS_LOG_BAN)
|
|
28
|
+
return;
|
|
26
29
|
const color = {
|
|
27
30
|
error: "red",
|
|
28
31
|
info: "green",
|
|
@@ -77,4 +80,5 @@ __name(Mix, "Mix");
|
|
|
77
80
|
|
|
78
81
|
|
|
79
82
|
|
|
80
|
-
|
|
83
|
+
|
|
84
|
+
exports.__name = __name; exports.__publicField = __publicField; exports.MERGE_SYMBOL = MERGE_SYMBOL; exports.UNMOUNT_SYMBOL = UNMOUNT_SYMBOL; exports.MODULE_SYMBOL = MODULE_SYMBOL; exports.META_SYMBOL = META_SYMBOL; exports.APP_SYMBOL = APP_SYMBOL; exports.IS_DEV = IS_DEV; exports.IS_STRICT = IS_STRICT; exports.IS_LOG_BAN = IS_LOG_BAN; exports.ERROR_SYMBOL = ERROR_SYMBOL; exports.PS_FILE_RE = PS_FILE_RE; exports.PS_IMPORT_RE = PS_IMPORT_RE; exports.log = log; exports.getConfig = getConfig; exports.setConfig = setConfig; exports.Mix = Mix;
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
var _chunkC36XJ7D3js = require('./chunk-C36XJ7D3.js');
|
|
5
|
+
var _chunkGWLM5DEJjs = require('./chunk-GWLM5DEJ.js');
|
|
7
6
|
|
|
8
7
|
// src/meta.ts
|
|
9
8
|
var Meta = class {
|
|
@@ -16,10 +15,10 @@ var Meta = class {
|
|
|
16
15
|
this.paramsType = paramsType;
|
|
17
16
|
}
|
|
18
17
|
};
|
|
19
|
-
|
|
18
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Meta, "Meta");
|
|
20
19
|
|
|
21
20
|
// src/compiler/rpc.ts
|
|
22
|
-
var Compiler = /* @__PURE__ */
|
|
21
|
+
var Compiler = /* @__PURE__ */ _chunkGWLM5DEJjs.__name.call(void 0, (_class =class Compiler2 {
|
|
23
22
|
__init() {this.classMap = {}}
|
|
24
23
|
constructor() {;_class.prototype.__init.call(this);
|
|
25
24
|
}
|
|
@@ -55,10 +54,10 @@ function generateRPCCode(meta) {
|
|
|
55
54
|
compiler.addMethod(i);
|
|
56
55
|
return compiler.getContent();
|
|
57
56
|
}
|
|
58
|
-
|
|
57
|
+
_chunkGWLM5DEJjs.__name.call(void 0, generateRPCCode, "generateRPCCode");
|
|
59
58
|
|
|
60
59
|
// src/compiler/http.ts
|
|
61
|
-
var Compiler3 = /* @__PURE__ */
|
|
60
|
+
var Compiler3 = /* @__PURE__ */ _chunkGWLM5DEJjs.__name.call(void 0, (_class2 =class Compiler4 {
|
|
62
61
|
__init2() {this.classMap = {}}
|
|
63
62
|
constructor() {;_class2.prototype.__init2.call(this);
|
|
64
63
|
}
|
|
@@ -97,7 +96,7 @@ function generateHTTPCode(meta) {
|
|
|
97
96
|
compiler.addMethod(i);
|
|
98
97
|
return compiler.getContent();
|
|
99
98
|
}
|
|
100
|
-
|
|
99
|
+
_chunkGWLM5DEJjs.__name.call(void 0, generateHTTPCode, "generateHTTPCode");
|
|
101
100
|
|
|
102
101
|
// src/core.ts
|
|
103
102
|
require('reflect-metadata');
|
|
@@ -108,7 +107,7 @@ var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
|
108
107
|
function Injectable() {
|
|
109
108
|
return (target) => _phecdacore.Empty.call(void 0, target);
|
|
110
109
|
}
|
|
111
|
-
|
|
110
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Injectable, "Injectable");
|
|
112
111
|
var debug = _debug2.default.call(void 0, "phecda-server");
|
|
113
112
|
var emitter = new (0, _events2.default)();
|
|
114
113
|
async function Factory(Modules, opts = {}) {
|
|
@@ -121,27 +120,22 @@ async function Factory(Modules, opts = {}) {
|
|
|
121
120
|
if (!_phecdacore.getProperty.call(void 0, "watcher")) {
|
|
122
121
|
_phecdacore.injectProperty.call(void 0, "watcher", ({ eventName, instance, key, options }) => {
|
|
123
122
|
const fn = typeof instance[key] === "function" ? instance[key].bind(instance) : (v) => instance[key] = v;
|
|
124
|
-
if (!instance[_chunkC36XJ7D3js.UNMOUNT_SYMBOL])
|
|
125
|
-
instance[_chunkC36XJ7D3js.UNMOUNT_SYMBOL] = [];
|
|
126
|
-
instance[_chunkC36XJ7D3js.UNMOUNT_SYMBOL].push(() => {
|
|
127
|
-
emitter.off(eventName, fn);
|
|
128
|
-
});
|
|
129
123
|
if (_optionalChain([options, 'optionalAccess', _2 => _2.once]))
|
|
130
124
|
emitter.once(eventName, fn);
|
|
131
125
|
else
|
|
132
126
|
emitter.on(eventName, fn);
|
|
127
|
+
return () => {
|
|
128
|
+
emitter.off(eventName, fn);
|
|
129
|
+
};
|
|
133
130
|
});
|
|
134
131
|
}
|
|
135
132
|
async function del(tag) {
|
|
136
133
|
if (!moduleMap.has(tag))
|
|
137
134
|
return;
|
|
138
135
|
const instance = moduleMap.get(tag);
|
|
139
|
-
debug(`unmount module "${tag}"`);
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
await cb();
|
|
143
|
-
}
|
|
144
|
-
debug(`del module "${tag}"`);
|
|
136
|
+
debug(`unmount module "${String(tag)}"`);
|
|
137
|
+
_phecdacore.unmountParallel.call(void 0, instance);
|
|
138
|
+
debug(`del module "${String(tag)}"`);
|
|
145
139
|
moduleMap.delete(tag);
|
|
146
140
|
constructorMap.delete(tag);
|
|
147
141
|
for (let i = meta.length - 1; i >= 0; i--) {
|
|
@@ -150,15 +144,15 @@ async function Factory(Modules, opts = {}) {
|
|
|
150
144
|
}
|
|
151
145
|
return instance;
|
|
152
146
|
}
|
|
153
|
-
|
|
147
|
+
_chunkGWLM5DEJjs.__name.call(void 0, del, "del");
|
|
154
148
|
async function destroy() {
|
|
155
149
|
debug("destroy all");
|
|
156
150
|
for (const [tag] of moduleMap)
|
|
157
151
|
await del(tag);
|
|
158
152
|
}
|
|
159
|
-
|
|
153
|
+
_chunkGWLM5DEJjs.__name.call(void 0, destroy, "destroy");
|
|
160
154
|
async function add(Module) {
|
|
161
|
-
const tag = _optionalChain([Module, 'access',
|
|
155
|
+
const tag = _optionalChain([Module, 'access', _3 => _3.prototype, 'optionalAccess', _4 => _4.__TAG__]) || Module.name;
|
|
162
156
|
const oldInstance = await del(tag);
|
|
163
157
|
const { instance: newModule } = await buildNestModule(Module);
|
|
164
158
|
if (oldInstance && moduleGraph.has(tag)) {
|
|
@@ -174,7 +168,7 @@ async function Factory(Modules, opts = {}) {
|
|
|
174
168
|
});
|
|
175
169
|
}
|
|
176
170
|
}
|
|
177
|
-
|
|
171
|
+
_chunkGWLM5DEJjs.__name.call(void 0, add, "add");
|
|
178
172
|
async function buildNestModule(Module) {
|
|
179
173
|
const paramtypes = getParamTypes(Module);
|
|
180
174
|
let instance;
|
|
@@ -182,10 +176,10 @@ async function Factory(Modules, opts = {}) {
|
|
|
182
176
|
if (moduleMap.has(tag)) {
|
|
183
177
|
instance = moduleMap.get(tag);
|
|
184
178
|
if (!instance)
|
|
185
|
-
throw new Error(`exist Circular-Dependency or Multiple modules with the same name/tag [tag] ${tag}--[module] ${Module}`);
|
|
179
|
+
throw new Error(`exist Circular-Dependency or Multiple modules with the same name/tag [tag] ${String(tag)}--[module] ${Module}`);
|
|
186
180
|
if (constructorMap.get(tag) !== Module && !constructorSet.has(Module)) {
|
|
187
181
|
constructorSet.add(Module);
|
|
188
|
-
|
|
182
|
+
_chunkGWLM5DEJjs.log.call(void 0, `Synonym module: Module taged "${String(tag)}" has been loaded before, so phecda-server won't load Module "${Module.name}"`, "warn");
|
|
189
183
|
}
|
|
190
184
|
return {
|
|
191
185
|
instance,
|
|
@@ -193,7 +187,7 @@ async function Factory(Modules, opts = {}) {
|
|
|
193
187
|
};
|
|
194
188
|
}
|
|
195
189
|
moduleMap.set(tag, void 0);
|
|
196
|
-
debug(`instantiate module "${tag}"`);
|
|
190
|
+
debug(`instantiate module "${String(tag)}"`);
|
|
197
191
|
if (paramtypes) {
|
|
198
192
|
const paramtypesInstances = [];
|
|
199
193
|
for (const i in paramtypes) {
|
|
@@ -208,9 +202,9 @@ async function Factory(Modules, opts = {}) {
|
|
|
208
202
|
instance = new Module();
|
|
209
203
|
}
|
|
210
204
|
meta.push(...getMetaFromInstance(instance, tag, Module.name));
|
|
211
|
-
debug(`init module "${tag}"`);
|
|
205
|
+
debug(`init module "${String(tag)}"`);
|
|
212
206
|
await _phecdacore.registerSerial.call(void 0, instance);
|
|
213
|
-
debug(`add module "${tag}"`);
|
|
207
|
+
debug(`add module "${String(tag)}"`);
|
|
214
208
|
moduleMap.set(tag, instance);
|
|
215
209
|
constructorMap.set(tag, Module);
|
|
216
210
|
return {
|
|
@@ -218,7 +212,7 @@ async function Factory(Modules, opts = {}) {
|
|
|
218
212
|
tag
|
|
219
213
|
};
|
|
220
214
|
}
|
|
221
|
-
|
|
215
|
+
_chunkGWLM5DEJjs.__name.call(void 0, buildNestModule, "buildNestModule");
|
|
222
216
|
for (const Module of Modules)
|
|
223
217
|
await buildNestModule(Module);
|
|
224
218
|
function writeCode() {
|
|
@@ -231,12 +225,12 @@ async function Factory(Modules, opts = {}) {
|
|
|
231
225
|
_fs2.default.promises.writeFile(rpc, generateRPCCode(meta.map((item) => item.data)));
|
|
232
226
|
}
|
|
233
227
|
}
|
|
234
|
-
|
|
228
|
+
_chunkGWLM5DEJjs.__name.call(void 0, writeCode, "writeCode");
|
|
235
229
|
writeCode();
|
|
236
|
-
if (
|
|
230
|
+
if (_chunkGWLM5DEJjs.IS_DEV) {
|
|
237
231
|
if (!globalThis.__PS_HMR__)
|
|
238
232
|
globalThis.__PS_HMR__ = [];
|
|
239
|
-
_optionalChain([globalThis, 'access',
|
|
233
|
+
_optionalChain([globalThis, 'access', _5 => _5.__PS_HMR__, 'optionalAccess', _6 => _6.push, 'call', _7 => _7(async (files) => {
|
|
240
234
|
debug("reload files ");
|
|
241
235
|
for (const file of files) {
|
|
242
236
|
const module = await Promise.resolve().then(() => require(file));
|
|
@@ -257,7 +251,7 @@ async function Factory(Modules, opts = {}) {
|
|
|
257
251
|
destroy
|
|
258
252
|
};
|
|
259
253
|
}
|
|
260
|
-
|
|
254
|
+
_chunkGWLM5DEJjs.__name.call(void 0, Factory, "Factory");
|
|
261
255
|
function getMetaFromInstance(instance, tag, name) {
|
|
262
256
|
const vars = _phecdacore.getExposeKey.call(void 0, instance).filter((item) => item !== _phecdacore.SHARE_KEY);
|
|
263
257
|
const baseState = _phecdacore.getState.call(void 0, instance, _phecdacore.SHARE_KEY) || {};
|
|
@@ -268,7 +262,7 @@ function getMetaFromInstance(instance, tag, name) {
|
|
|
268
262
|
initState(state);
|
|
269
263
|
if (state.http) {
|
|
270
264
|
meta.http = {
|
|
271
|
-
route: (_optionalChain([baseState, 'access',
|
|
265
|
+
route: (_optionalChain([baseState, 'access', _8 => _8.http, 'optionalAccess', _9 => _9.route]) || "") + state.http.route,
|
|
272
266
|
type: state.http.type
|
|
273
267
|
};
|
|
274
268
|
}
|
|
@@ -280,6 +274,8 @@ function getMetaFromInstance(instance, tag, name) {
|
|
|
280
274
|
...state.rpc
|
|
281
275
|
};
|
|
282
276
|
}
|
|
277
|
+
if (typeof tag !== "string" && (meta.rpc || meta.http))
|
|
278
|
+
_chunkGWLM5DEJjs.log.call(void 0, `can't use Tag with ${typeof tag} on http/rpc controller "${instance.constructor.name}",instead with "${tag = String(tag)}"`, "error");
|
|
283
279
|
meta.name = name;
|
|
284
280
|
meta.tag = tag;
|
|
285
281
|
meta.method = i;
|
|
@@ -320,11 +316,11 @@ function getMetaFromInstance(instance, tag, name) {
|
|
|
320
316
|
return new Meta(meta, _phecdacore.getHandler.call(void 0, instance, i), getParamTypes(instance, i) || []);
|
|
321
317
|
});
|
|
322
318
|
}
|
|
323
|
-
|
|
319
|
+
_chunkGWLM5DEJjs.__name.call(void 0, getMetaFromInstance, "getMetaFromInstance");
|
|
324
320
|
function getParamTypes(Module, key) {
|
|
325
321
|
return Reflect.getMetadata("design:paramtypes", Module, key);
|
|
326
322
|
}
|
|
327
|
-
|
|
323
|
+
_chunkGWLM5DEJjs.__name.call(void 0, getParamTypes, "getParamTypes");
|
|
328
324
|
function initState(state) {
|
|
329
325
|
if (!state.define)
|
|
330
326
|
state.define = {};
|
|
@@ -337,7 +333,7 @@ function initState(state) {
|
|
|
337
333
|
if (!state.interceptors)
|
|
338
334
|
state.interceptors = [];
|
|
339
335
|
}
|
|
340
|
-
|
|
336
|
+
_chunkGWLM5DEJjs.__name.call(void 0, initState, "initState");
|
|
341
337
|
|
|
342
338
|
|
|
343
339
|
|