phecda-server 7.0.0 → 7.0.2
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/README.md +10 -10
- package/bin/cli.mjs +1 -1
- package/dist/{chunk-RLFCI3RG.js → chunk-4LLLQOMF.js} +0 -1
- package/dist/{chunk-WTJKTICN.mjs → chunk-AIAO6SV6.mjs} +2 -3
- package/dist/{chunk-5SUY5UVC.js → chunk-DPPDWBYO.js} +28 -29
- package/dist/{chunk-LBH4RXQQ.mjs → chunk-E7EAPAGM.mjs} +1 -2
- package/dist/{chunk-VDOICQ2U.mjs → chunk-MKRHYZCL.mjs} +2 -3
- package/dist/{chunk-MDPW6WGF.mjs → chunk-NQ55PA2X.mjs} +0 -1
- package/dist/{chunk-H7OCHDZT.js → chunk-XKK2SQ7W.js} +53 -54
- package/dist/{chunk-KRUOHWFR.js → chunk-ZWPOWMZP.js} +20 -21
- package/dist/helper.js +3 -4
- package/dist/helper.mjs +2 -3
- package/dist/http/elysia/index.js +40 -41
- package/dist/http/elysia/index.mjs +3 -4
- package/dist/http/express/index.js +37 -38
- package/dist/http/express/index.mjs +2 -3
- package/dist/http/fastify/index.js +38 -39
- package/dist/http/fastify/index.mjs +3 -4
- package/dist/http/h3/index.js +38 -39
- package/dist/http/h3/index.mjs +2 -3
- package/dist/http/hono/index.js +34 -35
- package/dist/http/hono/index.mjs +2 -3
- package/dist/http/hyper-express/index.js +35 -36
- package/dist/http/hyper-express/index.mjs +2 -3
- package/dist/http/koa/index.js +37 -38
- package/dist/http/koa/index.mjs +2 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +44 -47
- package/dist/index.mjs +6 -9
- package/dist/rpc/bullmq/index.js +11 -12
- package/dist/rpc/bullmq/index.mjs +2 -3
- package/dist/rpc/electron/index.js +8 -9
- package/dist/rpc/electron/index.mjs +2 -3
- package/dist/rpc/kafka/index.js +10 -11
- package/dist/rpc/kafka/index.mjs +2 -3
- package/dist/rpc/nats/index.js +11 -12
- package/dist/rpc/nats/index.mjs +2 -3
- package/dist/rpc/rabbitmq/index.js +12 -13
- package/dist/rpc/rabbitmq/index.mjs +2 -3
- package/dist/rpc/redis/index.js +10 -11
- package/dist/rpc/redis/index.mjs +2 -3
- package/dist/rpc/web-ext/index.js +1 -1
- package/dist/rpc/web-ext/index.mjs +0 -1
- package/dist/rpc/ws/index.js +7 -8
- package/dist/rpc/ws/index.mjs +2 -3
- package/dist/test.js +6 -7
- package/dist/test.mjs +2 -3
- package/package.json +2 -2
- package/dist/chunk-5SUY5UVC.js.map +0 -1
- package/dist/chunk-6JAHCTOT.mjs +0 -334
- package/dist/chunk-6JAHCTOT.mjs.map +0 -1
- package/dist/chunk-EDAWJVJ4.js +0 -246
- package/dist/chunk-EDAWJVJ4.js.map +0 -1
- package/dist/chunk-H7OCHDZT.js.map +0 -1
- package/dist/chunk-KRUOHWFR.js.map +0 -1
- package/dist/chunk-KUGU3UGO.js +0 -334
- package/dist/chunk-KUGU3UGO.js.map +0 -1
- package/dist/chunk-LBH4RXQQ.mjs.map +0 -1
- package/dist/chunk-MDPW6WGF.mjs.map +0 -1
- package/dist/chunk-RLFCI3RG.js.map +0 -1
- package/dist/chunk-TTHYUNOT.mjs +0 -246
- package/dist/chunk-TTHYUNOT.mjs.map +0 -1
- package/dist/chunk-VDOICQ2U.mjs.map +0 -1
- package/dist/chunk-WTJKTICN.mjs.map +0 -1
- package/dist/core-BOo3uGFX.d.ts +0 -49
- package/dist/core-CF45G79J.d.mts +0 -49
- package/dist/helper.js.map +0 -1
- package/dist/helper.mjs.map +0 -1
- package/dist/http/elysia/index.js.map +0 -1
- package/dist/http/elysia/index.mjs.map +0 -1
- package/dist/http/express/index.js.map +0 -1
- package/dist/http/express/index.mjs.map +0 -1
- package/dist/http/fastify/index.js.map +0 -1
- package/dist/http/fastify/index.mjs.map +0 -1
- package/dist/http/h3/index.js.map +0 -1
- package/dist/http/h3/index.mjs.map +0 -1
- package/dist/http/hono/index.js.map +0 -1
- package/dist/http/hono/index.mjs.map +0 -1
- package/dist/http/hyper-express/index.js.map +0 -1
- package/dist/http/hyper-express/index.mjs.map +0 -1
- package/dist/http/koa/index.js.map +0 -1
- package/dist/http/koa/index.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/rpc/bullmq/index.js.map +0 -1
- package/dist/rpc/bullmq/index.mjs.map +0 -1
- package/dist/rpc/electron/index.js.map +0 -1
- package/dist/rpc/electron/index.mjs.map +0 -1
- package/dist/rpc/kafka/index.js.map +0 -1
- package/dist/rpc/kafka/index.mjs.map +0 -1
- package/dist/rpc/nats/index.js.map +0 -1
- package/dist/rpc/nats/index.mjs.map +0 -1
- package/dist/rpc/rabbitmq/index.js.map +0 -1
- package/dist/rpc/rabbitmq/index.mjs.map +0 -1
- package/dist/rpc/redis/index.js.map +0 -1
- package/dist/rpc/redis/index.mjs.map +0 -1
- package/dist/rpc/web-ext/index.js.map +0 -1
- package/dist/rpc/web-ext/index.mjs.map +0 -1
- package/dist/rpc/ws/index.js.map +0 -1
- package/dist/rpc/ws/index.mjs.map +0 -1
- package/dist/test.js.map +0 -1
- package/dist/test.mjs.map +0 -1
package/dist/chunk-KUGU3UGO.js
DELETED
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunkRLFCI3RGjs = require('./chunk-RLFCI3RG.js');
|
|
8
|
-
|
|
9
|
-
// src/meta.ts
|
|
10
|
-
var Meta = class {
|
|
11
|
-
static {
|
|
12
|
-
_chunkRLFCI3RGjs.__name.call(void 0, this, "Meta");
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
constructor(data, paramsType) {
|
|
17
|
-
this.data = data;
|
|
18
|
-
this.paramsType = paramsType;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// src/core.ts
|
|
23
|
-
require('reflect-metadata');
|
|
24
|
-
var _events = require('events'); var _events2 = _interopRequireDefault(_events);
|
|
25
|
-
var _phecdacore = require('phecda-core');
|
|
26
|
-
var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
27
|
-
var debug = _debug2.default.call(void 0, "phecda-server(Factory)");
|
|
28
|
-
var emitter = new (0, _events2.default)();
|
|
29
|
-
function defaultServerInject() {
|
|
30
|
-
if (!_phecdacore.getInject.call(void 0, "watcher")) {
|
|
31
|
-
_phecdacore.setInject.call(void 0, "watcher", ({ eventName, instance, property, options }) => {
|
|
32
|
-
const fn = typeof instance[property] === "function" ? instance[property].bind(instance) : (v) => instance[property] = v;
|
|
33
|
-
if (_optionalChain([options, 'optionalAccess', _ => _.once])) emitter.once(eventName, fn);
|
|
34
|
-
else emitter.on(eventName, fn);
|
|
35
|
-
return () => {
|
|
36
|
-
emitter.off(eventName, fn);
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
_chunkRLFCI3RGjs.__name.call(void 0, defaultServerInject, "defaultServerInject");
|
|
42
|
-
var phecdaNamespace = /* @__PURE__ */ new Map();
|
|
43
|
-
var ServerPhecda = (_class = class {
|
|
44
|
-
static {
|
|
45
|
-
_chunkRLFCI3RGjs.__name.call(void 0, this, "ServerPhecda");
|
|
46
|
-
}
|
|
47
|
-
__init() {this.moduleMap = /* @__PURE__ */ new Map()}
|
|
48
|
-
__init2() {this.meta = []}
|
|
49
|
-
__init3() {this.modelMap = /* @__PURE__ */ new WeakMap()}
|
|
50
|
-
__init4() {this.modelSet = /* @__PURE__ */ new WeakSet()}
|
|
51
|
-
__init5() {this.dependenceGraph = /* @__PURE__ */ new Map()}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
constructor(options) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);
|
|
56
|
-
defaultServerInject();
|
|
57
|
-
const { namespace = "default", parseModule = /* @__PURE__ */ _chunkRLFCI3RGjs.__name.call(void 0, (module) => module, "parseModule"), parseMeta = /* @__PURE__ */ _chunkRLFCI3RGjs.__name.call(void 0, (meta) => meta, "parseMeta"), generators = [] } = options;
|
|
58
|
-
phecdaNamespace.set(namespace, this);
|
|
59
|
-
this.parseMeta = parseMeta;
|
|
60
|
-
this.parseModule = parseModule;
|
|
61
|
-
this.generators = generators;
|
|
62
|
-
}
|
|
63
|
-
async start(models) {
|
|
64
|
-
for (const model of models) await this.buildDepModule(model);
|
|
65
|
-
this.hmr();
|
|
66
|
-
this.generateCode().then(() => {
|
|
67
|
-
if (_chunkRLFCI3RGjs.IS_ONLY_GENERATE) {
|
|
68
|
-
_chunkRLFCI3RGjs.log.call(void 0, "Only generate code");
|
|
69
|
-
process.exit(_chunkRLFCI3RGjs.PS_EXIT_CODE.EXIT);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
__init6() {this.generateCode = /* @__PURE__ */ _chunkRLFCI3RGjs.__name.call(void 0, async () => {
|
|
74
|
-
return Promise.all(this.generators.map((generator) => {
|
|
75
|
-
debug(`generate "${generator.name}" code to ${generator.path}`);
|
|
76
|
-
return generator.output(this.meta);
|
|
77
|
-
}));
|
|
78
|
-
}, "generateCode")}
|
|
79
|
-
hmr() {
|
|
80
|
-
_chunkRLFCI3RGjs.HMR.call(void 0, async (oldModels, newModels) => {
|
|
81
|
-
debug("reload models ");
|
|
82
|
-
await this.replace(oldModels, newModels);
|
|
83
|
-
this.generateCode();
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
// async add(Model: Construct) {
|
|
87
|
-
// const tag = getTag(Model)
|
|
88
|
-
// const oldInstance = await this.del(tag)
|
|
89
|
-
// const { module: newModule } = await this.buildDepModule(Model)
|
|
90
|
-
// if (oldInstance && this.dependenceGraph.has(tag)) {
|
|
91
|
-
// debug(`replace module "${String(tag)}"`);
|
|
92
|
-
// [...this.dependenceGraph.get(tag)!].forEach((tag) => {
|
|
93
|
-
// const module = this.moduleMap.get(tag)
|
|
94
|
-
// for (const key in module) {
|
|
95
|
-
// if (module[key] === oldInstance)
|
|
96
|
-
// module[key] = newModule
|
|
97
|
-
// }
|
|
98
|
-
// })
|
|
99
|
-
// }
|
|
100
|
-
// }
|
|
101
|
-
// async del(modelOrTag: Construct | PropertyKey) {
|
|
102
|
-
// const tag = typeof modelOrTag === 'function' ? getTag(modelOrTag) : modelOrTag
|
|
103
|
-
// if (!this.moduleMap.has(tag))
|
|
104
|
-
// return
|
|
105
|
-
// const module = this.moduleMap.get(tag)
|
|
106
|
-
// debug(`unmount module "${String(tag)}"`)
|
|
107
|
-
// await invokeUnmount(module)
|
|
108
|
-
// debug(`del module "${String(tag)}"`)
|
|
109
|
-
// this.moduleMap.delete(tag)
|
|
110
|
-
// this.modelMap.delete(module)
|
|
111
|
-
// for (let i = this.meta.length - 1; i >= 0; i--) {
|
|
112
|
-
// if (this.meta[i].data.tag === tag)
|
|
113
|
-
// this.meta.splice(i, 1)
|
|
114
|
-
// }
|
|
115
|
-
// return module
|
|
116
|
-
// }
|
|
117
|
-
async destroy() {
|
|
118
|
-
debug("destroy all");
|
|
119
|
-
this.replace(Object.values(this.modelMap), []);
|
|
120
|
-
}
|
|
121
|
-
createProxyModule(tag) {
|
|
122
|
-
const that = this;
|
|
123
|
-
return new Proxy({}, {
|
|
124
|
-
get(_target, prop) {
|
|
125
|
-
const module = that.moduleMap.get(tag);
|
|
126
|
-
return Reflect.get(module, prop, module);
|
|
127
|
-
},
|
|
128
|
-
set(_target, prop, newValue) {
|
|
129
|
-
const module = that.moduleMap.get(tag);
|
|
130
|
-
return Reflect.set(module, prop, newValue, module);
|
|
131
|
-
},
|
|
132
|
-
has(_target, prop) {
|
|
133
|
-
return Reflect.has(that.moduleMap.get(tag), prop);
|
|
134
|
-
},
|
|
135
|
-
ownKeys() {
|
|
136
|
-
return Reflect.ownKeys(that.moduleMap.get(tag));
|
|
137
|
-
},
|
|
138
|
-
getPrototypeOf() {
|
|
139
|
-
return Reflect.getPrototypeOf(that.moduleMap.get(tag));
|
|
140
|
-
},
|
|
141
|
-
getOwnPropertyDescriptor(_target, prop) {
|
|
142
|
-
return Reflect.getOwnPropertyDescriptor(that.moduleMap.get(tag), prop);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
async buildDepModule(Model) {
|
|
147
|
-
const paramtypes = getParamTypes(Model);
|
|
148
|
-
let module;
|
|
149
|
-
const tag = _phecdacore.getTag.call(void 0, Model);
|
|
150
|
-
if (this.moduleMap.has(tag)) {
|
|
151
|
-
module = this.moduleMap.get(tag);
|
|
152
|
-
if (!module) {
|
|
153
|
-
_chunkRLFCI3RGjs.log.call(void 0, `Exist Circular-Dependency or Multiple modules with the same tag [${String(tag)}]`, "warn");
|
|
154
|
-
return {
|
|
155
|
-
module: this.createProxyModule(tag),
|
|
156
|
-
tag
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
if (this.modelMap.get(module) !== Model && !this.modelSet.has(Model)) {
|
|
160
|
-
this.modelSet.add(Model);
|
|
161
|
-
if (module instanceof Model) _chunkRLFCI3RGjs.log.call(void 0, `Module taged ${String(tag)} has been overridden`);
|
|
162
|
-
else _chunkRLFCI3RGjs.log.call(void 0, `Synonym module: Module taged "${String(tag)}" has been loaded before, so phecda-server won't load Module "${Model.name}"`, "warn");
|
|
163
|
-
}
|
|
164
|
-
return {
|
|
165
|
-
module,
|
|
166
|
-
tag
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
this.moduleMap.set(tag, void 0);
|
|
170
|
-
debug(`instantiate module "${String(tag)}"`);
|
|
171
|
-
if (paramtypes) {
|
|
172
|
-
const paramtypesInstances = [];
|
|
173
|
-
for (const i in paramtypes) {
|
|
174
|
-
const { module: sub, tag: subTag } = await this.buildDepModule(paramtypes[i]);
|
|
175
|
-
paramtypesInstances[i] = sub;
|
|
176
|
-
if (!this.dependenceGraph.has(subTag)) this.dependenceGraph.set(subTag, /* @__PURE__ */ new Set());
|
|
177
|
-
this.dependenceGraph.get(subTag).add(tag);
|
|
178
|
-
}
|
|
179
|
-
module = this.parseModule(new Model(...paramtypesInstances));
|
|
180
|
-
} else {
|
|
181
|
-
module = this.parseModule(new Model());
|
|
182
|
-
}
|
|
183
|
-
this.meta.push(...getMetaFromInstance(module, tag, Model.name).map(this.parseMeta).filter((item) => !!item));
|
|
184
|
-
debug(`init module "${String(tag)}"`);
|
|
185
|
-
if (!_chunkRLFCI3RGjs.IS_ONLY_GENERATE) await _phecdacore.invokeInit.call(void 0, module);
|
|
186
|
-
debug(`add module "${String(tag)}"`);
|
|
187
|
-
this.moduleMap.set(tag, module);
|
|
188
|
-
this.modelMap.set(module, Model);
|
|
189
|
-
return {
|
|
190
|
-
module,
|
|
191
|
-
tag
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
async replace(oldModels, newModels) {
|
|
195
|
-
const oldModules = (await Promise.all(oldModels.map(async (model) => {
|
|
196
|
-
const tag = _phecdacore.getTag.call(void 0, model);
|
|
197
|
-
if (!this.has(tag)) return;
|
|
198
|
-
const module = this.moduleMap.get(tag);
|
|
199
|
-
debug(`unmount module "${String(tag)}"`);
|
|
200
|
-
await _phecdacore.invokeUnmount.call(void 0, module);
|
|
201
|
-
debug(`del module "${String(tag)}"`);
|
|
202
|
-
this.moduleMap.delete(tag);
|
|
203
|
-
this.modelMap.delete(module);
|
|
204
|
-
for (let i = this.meta.length - 1; i >= 0; i--) {
|
|
205
|
-
if (this.meta[i].data.tag === tag) this.meta.splice(i, 1);
|
|
206
|
-
}
|
|
207
|
-
return module;
|
|
208
|
-
}))).filter((item) => item);
|
|
209
|
-
for (const model of newModels) {
|
|
210
|
-
debug(`mount module: ${model.name}`);
|
|
211
|
-
await this.buildDepModule(model);
|
|
212
|
-
}
|
|
213
|
-
debug("replace old modules");
|
|
214
|
-
for (const module of oldModules) {
|
|
215
|
-
const tag = _phecdacore.getTag.call(void 0, module);
|
|
216
|
-
if (this.dependenceGraph.has(tag)) {
|
|
217
|
-
[
|
|
218
|
-
...this.dependenceGraph.get(tag)
|
|
219
|
-
].forEach((depTag) => {
|
|
220
|
-
const depModule = this.moduleMap.get(depTag);
|
|
221
|
-
if (depModule) {
|
|
222
|
-
for (const key in depModule) {
|
|
223
|
-
if (depModule[key] === module) depModule[key] = this.moduleMap.get(tag);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
has(modelOrTag) {
|
|
231
|
-
return this.moduleMap.has(typeof modelOrTag === "function" ? _phecdacore.getTag.call(void 0, modelOrTag) : modelOrTag);
|
|
232
|
-
}
|
|
233
|
-
get(modelOrTag) {
|
|
234
|
-
const tag = typeof modelOrTag === "function" ? _phecdacore.getTag.call(void 0, modelOrTag) : modelOrTag;
|
|
235
|
-
if (!this.has(tag)) throw new Error(`module "${tag.toString()}" doesn't exist`);
|
|
236
|
-
return this.moduleMap.get(tag);
|
|
237
|
-
}
|
|
238
|
-
}, _class);
|
|
239
|
-
async function Factory(models, opts = {}) {
|
|
240
|
-
const phecda = new ServerPhecda(opts);
|
|
241
|
-
await phecda.start(models);
|
|
242
|
-
return phecda;
|
|
243
|
-
}
|
|
244
|
-
_chunkRLFCI3RGjs.__name.call(void 0, Factory, "Factory");
|
|
245
|
-
function useS(nsOrModel, namespace) {
|
|
246
|
-
if (!nsOrModel) {
|
|
247
|
-
namespace = "default";
|
|
248
|
-
} else {
|
|
249
|
-
if (typeof nsOrModel === "string") namespace = nsOrModel;
|
|
250
|
-
else if (!namespace) namespace = "default";
|
|
251
|
-
}
|
|
252
|
-
if (!phecdaNamespace.has(namespace)) throw new Error(`namespace "${namespace}" doesn't exist`);
|
|
253
|
-
const serverPhecda = phecdaNamespace.get(namespace);
|
|
254
|
-
if (nsOrModel && typeof nsOrModel !== "string") return serverPhecda.get(nsOrModel);
|
|
255
|
-
else return serverPhecda;
|
|
256
|
-
}
|
|
257
|
-
_chunkRLFCI3RGjs.__name.call(void 0, useS, "useS");
|
|
258
|
-
function getMetaFromInstance(instance, tag, name) {
|
|
259
|
-
const propertyKeys = _phecdacore.getMetaKey.call(void 0, instance).filter((item) => typeof item === "string");
|
|
260
|
-
const baseMeta = _phecdacore.getMergedMeta.call(void 0, instance, void 0);
|
|
261
|
-
const ctxs = baseMeta.ctxs;
|
|
262
|
-
return propertyKeys.filter((i) => typeof instance[i] === "function").map((i) => {
|
|
263
|
-
const meta = _phecdacore.getMergedMeta.call(void 0, instance, i);
|
|
264
|
-
const metaData = {
|
|
265
|
-
...meta,
|
|
266
|
-
name,
|
|
267
|
-
tag,
|
|
268
|
-
func: i
|
|
269
|
-
};
|
|
270
|
-
if (baseMeta.controller) {
|
|
271
|
-
if (typeof tag !== "string") _chunkRLFCI3RGjs.log.call(void 0, `can't use Tag with ${typeof tag} on controller "${instance.constructor.name}",instead with "${tag = String(tag)}"`, "error");
|
|
272
|
-
metaData.controller = baseMeta.controller;
|
|
273
|
-
metaData[baseMeta.controller] = {
|
|
274
|
-
...baseMeta[baseMeta.controller],
|
|
275
|
-
...meta[baseMeta.controller]
|
|
276
|
-
};
|
|
277
|
-
const params = _phecdacore.getMetaParams.call(void 0, instance, i).map((item) => _phecdacore.getMergedMeta.call(void 0, instance, i, item));
|
|
278
|
-
params.forEach((item, index) => {
|
|
279
|
-
if (!item.pipe) item.pipe = meta.pipe || baseMeta.pipe;
|
|
280
|
-
if (!item.define) item.define = {};
|
|
281
|
-
item.index = index;
|
|
282
|
-
});
|
|
283
|
-
metaData.ctxs = ctxs;
|
|
284
|
-
metaData.params = params;
|
|
285
|
-
metaData.filter = meta.filter || baseMeta.filter;
|
|
286
|
-
metaData.define = {
|
|
287
|
-
...baseMeta.define,
|
|
288
|
-
...meta.define
|
|
289
|
-
};
|
|
290
|
-
for (const item of [
|
|
291
|
-
"addons",
|
|
292
|
-
"guards"
|
|
293
|
-
]) {
|
|
294
|
-
const set = new Set(baseMeta[item]);
|
|
295
|
-
if (meta[item]) {
|
|
296
|
-
meta[item].forEach((part) => {
|
|
297
|
-
set.delete(part);
|
|
298
|
-
set.add(part);
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
metaData[item] = [
|
|
302
|
-
...set
|
|
303
|
-
];
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
return new Meta(deepFreeze(metaData), getParamTypes(instance, i) || []);
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
_chunkRLFCI3RGjs.__name.call(void 0, getMetaFromInstance, "getMetaFromInstance");
|
|
310
|
-
function deepFreeze(object) {
|
|
311
|
-
Object.freeze(object);
|
|
312
|
-
Object.getOwnPropertyNames(object).forEach((prop) => {
|
|
313
|
-
if (object[prop] !== null && (typeof object[prop] === "object" || typeof object[prop] === "function") && !Object.isFrozen(object[prop])) deepFreeze(object[prop]);
|
|
314
|
-
});
|
|
315
|
-
return object;
|
|
316
|
-
}
|
|
317
|
-
_chunkRLFCI3RGjs.__name.call(void 0, deepFreeze, "deepFreeze");
|
|
318
|
-
function getParamTypes(Model, key) {
|
|
319
|
-
const paramTypes = Reflect.getMetadata("design:paramtypes", Model, key);
|
|
320
|
-
if (typeof paramTypes === "function") return paramTypes();
|
|
321
|
-
else return paramTypes;
|
|
322
|
-
}
|
|
323
|
-
_chunkRLFCI3RGjs.__name.call(void 0, getParamTypes, "getParamTypes");
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
exports.Meta = Meta; exports.emitter = emitter; exports.defaultServerInject = defaultServerInject; exports.phecdaNamespace = phecdaNamespace; exports.ServerPhecda = ServerPhecda; exports.Factory = Factory; exports.useS = useS;
|
|
334
|
-
//# sourceMappingURL=chunk-KUGU3UGO.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["d:\\myproject\\phecda\\packages\\server\\dist\\chunk-KUGU3UGO.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACF,sDAA4B;AAC5B;AACA;AACA,IAAI,KAAK,EAAE,MAAM;AACjB,EAAE,OAAO;AACT,IAAI,qCAAM,IAAK,EAAE,MAAM,CAAC;AACxB,EAAE;AACF,EAAE;AACF,EAAE;AACF,EAAE,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE;AAChC,IAAI,IAAI,CAAC,KAAK,EAAE,IAAI;AACpB,IAAI,IAAI,CAAC,WAAW,EAAE,UAAU;AAChC,EAAE;AACF,CAAC;AACD;AACA;AACA,4BAAyB;AACzB,gFAAiC;AACjC,yCAA+H;AAC/H,4EAAyB;AACzB,IAAI,MAAM,EAAE,6BAAK,wBAAyB,CAAC;AAC3C,IAAI,QAAQ,EAAE,IAAI,qBAAY,CAAC,CAAC;AAChC,SAAS,mBAAmB,CAAC,EAAE;AAC/B,EAAE,GAAG,CAAC,CAAC,mCAAS,SAAU,CAAC,EAAE;AAC7B,IAAI,mCAAS,SAAU,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,GAAG;AACzE,MAAM,MAAM,GAAG,EAAE,OAAO,QAAQ,CAAC,QAAQ,EAAE,IA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EAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,UAAA;AACA,UAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,UAAA;AACA,QAAA;AACA,UAAA;AACA,UAAA;AACA,YAAA;AACA,cAAA;AACA,YAAA;AACA,UAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,UAAA;AACA,YAAA;AACA,YAAA;AACA,UAAA;AACA,QAAA;AACA,QAAA;AACA,UAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"D:\\myproject\\phecda\\packages\\server\\dist\\chunk-KUGU3UGO.js","sourcesContent":[null]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/helper.ts","../src/context.ts","../src/pipe.ts","../src/exception/base.ts","../src/exception/undefine.ts","../src/exception/validate.ts","../src/exception/forbidden.ts","../src/exception/bad-request.ts","../src/exception/not-found.ts","../src/exception/conflict.ts","../src/exception/bad-gateway.ts","../src/exception/invalid-input.ts","../src/exception/media-type.ts","../src/exception/payload-large.ts","../src/exception/timeout.ts","../src/exception/unauthorized.ts","../src/exception/unavailable-service.ts","../src/exception/framework.ts","../src/exception/timer.ts","../src/exception/worker.ts","../src/filter.ts","../src/http/helper.ts","../src/decorators/helper.ts"],"sourcesContent":["// help you build custom framework or decorator\r\n\r\nimport pc from 'picocolors'\r\nimport { log } from './utils'\r\nimport { Context } from './context'\r\nimport { HMR } from './hmr'\r\nimport { ControllerMeta, Meta } from './meta'\r\nimport { IS_PURE, IS_STRICT } from './common'\r\n\r\nexport * from './hmr'\r\nexport * from './http/helper'\r\nexport * from './decorators/helper'\r\n\r\nexport function createControllerMetaMap(meta: Meta[], filter: (meta: Meta) => boolean | void) {\r\n const metaMap = new Map<string, Record<string, ControllerMeta>>()\r\n\r\n function handleMeta() {\r\n metaMap.clear()\r\n for (const item of meta) {\r\n const { tag, func } = item.data\r\n if (!filter(item))\r\n continue\r\n\r\n if (metaMap.has(tag))\r\n metaMap.get(tag)![func] = item as ControllerMeta\r\n\r\n else\r\n metaMap.set(tag, { [func]: item as ControllerMeta })\r\n }\r\n }\r\n\r\n handleMeta()\r\n HMR(handleMeta)\r\n\r\n return metaMap\r\n}\r\n\r\n// detect whether addon/filter/pipe/guard/intercept is injected\r\nexport function detectAopDep(meta: Meta[], { guards, addons }: {\r\n guards?: string[]\r\n addons?: string[]\r\n\r\n} = {}, controller = 'http') {\r\n if (IS_PURE)\r\n return\r\n\r\n const addonSet = new Set<string>()\r\n const guardSet = new Set<string>()\r\n const pipeSet = new Set<string>()\r\n const filterSet = new Set<string>()\r\n const warningSet = new Set<string>()\r\n function handleMeta() {\r\n addonSet.clear()\r\n guardSet.clear()\r\n pipeSet.clear()\r\n filterSet.clear()\r\n warningSet.clear()\r\n\r\n addons?.forEach((item) => {\r\n addonSet.add(item)\r\n })\r\n guards?.forEach((item) => {\r\n guardSet.add(item)\r\n });\r\n\r\n (meta as ControllerMeta[]).forEach(({ data }) => {\r\n if (!data.controller)\r\n return\r\n\r\n if (typeof data.tag !== 'string')\r\n warningSet.add(`Tag of controller \"${data.name}\" should be a string`)\r\n\r\n // @todo func of meta on controller should be string\r\n\r\n if (data.controller !== controller) {\r\n if (data[controller])\r\n warningSet.add(`Should use ${controller} controller to decorate class \"${data.name}\"`)\r\n\r\n return\r\n }\r\n if (data.filter)\r\n filterSet.add(data.filter)\r\n\r\n data.guards.forEach(i => guardSet.add(i))\r\n data.addons.forEach(i => addonSet.add(i))\r\n data.params.forEach((i) => {\r\n if (i.pipe)\r\n pipeSet.add(i.pipe)\r\n })\r\n })\r\n const missAddons = [...addonSet].filter(i => !Context.addonRecord[i])\r\n const missGuards = [...guardSet].filter(i => !Context.guardRecord[i])\r\n const missPipes = [...pipeSet].filter(i => !Context.pipeRecord[i])\r\n const missFilters = [...filterSet].filter(i => !Context.filterRecord[i])\r\n\r\n function exit() {\r\n if (IS_STRICT) {\r\n log('Does not meet strict mode requirements', 'error')\r\n process.exit(1)\r\n }\r\n }\r\n\r\n if (missAddons.length) {\r\n log(`${pc.white(`Addon [${missAddons.join(',')}]`)} doesn't exist`, 'warn')\r\n exit()\r\n }\r\n if (missGuards.length) {\r\n log(`${pc.magenta(`Guard [${missGuards.join(',')}]`)} doesn't exist`, 'warn')\r\n exit()\r\n }\r\n if (missPipes.length) {\r\n log(`${pc.blue(`Pipe [${missPipes.join(',')}]`)} doesn't exist`, 'warn')\r\n exit()\r\n }\r\n if (missFilters.length) {\r\n log(`${pc.red(`Filter [${missFilters.join(',')}]`)} doesn't exist`, 'warn')\r\n exit()\r\n }\r\n\r\n warningSet.forEach(warn => log(warn, 'warn'))\r\n if (warningSet.size)\r\n exit()\r\n }\r\n\r\n handleMeta()\r\n HMR(handleMeta)\r\n return {\r\n addonSet,\r\n guardSet,\r\n pipeSet,\r\n filterSet,\r\n }\r\n}\r\n\r\nexport function joinUrl(base: string, ...paths: string[]) {\r\n const joinedPath = [base, ...paths].filter(p => p).map(path => path.replace(/(^\\/)/g, '')).join('/')\r\n return `/${joinedPath}`\r\n}\r\n","import Debug from 'debug'\r\nimport pc from 'picocolors'\r\nimport { defaultPipe } from './pipe'\r\nimport { defaultFilter } from './filter'\r\nimport type { BaseCtx, DefaultOptions } from './types'\r\nimport { IS_DEV } from './common'\r\nimport { type Exception } from './exception'\r\nimport { resolveDep } from './helper'\r\nimport { ControllerMeta } from './meta'\r\nimport { log } from './utils'\r\n\r\nconst debug = Debug('phecda-server(Context)')\r\n\r\nexport interface AOP {\r\n guards: GuardType[]\r\n pipe: PipeType[]\r\n filter: FilterType\r\n}\r\n\r\nexport interface PipeArg { arg: any; pipe?: string; key: string; type: string; index: number; reflect: any; define: Record<string, any> }\r\nexport type GuardType<Ctx extends BaseCtx = any> = (ctx: Ctx, next: () => Promise<any>) => any\r\nexport type PipeType<Ctx extends BaseCtx = any> = (arg: PipeArg, ctx: Ctx) => Promise<any>\r\nexport type FilterType<Ctx extends BaseCtx = any, E extends Exception = any> = (err: E | Error, ctx?: Ctx) => Error | any\r\n\r\nexport class Context<Ctx extends BaseCtx> {\r\n method: string\r\n params: string[]\r\n\r\n static filterRecord: Record<PropertyKey, FilterType> = {\r\n default: defaultFilter,\r\n }\r\n\r\n static pipeRecord: Record<PropertyKey, PipeType> = {\r\n default: defaultPipe,\r\n }\r\n\r\n static guardRecord: Record<PropertyKey, {\r\n value: GuardType\r\n priority: number\r\n }> = {}\r\n\r\n static addonRecord: Record<PropertyKey, {\r\n value: (router: any, framework: string) => any\r\n priority: number\r\n\r\n }> = {}\r\n\r\n ctx: Ctx\r\n\r\n // protected canGetCtx = true\r\n\r\n constructor(public data: Ctx) {\r\n if (IS_DEV)\r\n // @ts-expect-error work for debug\r\n data._context = this\r\n\r\n // const that = this\r\n\r\n this.ctx = new Proxy(data, {\r\n get(target, p) {\r\n // if (IS_DEV && !that.canGetCtx)// only detect in dev\r\n // throw new FrameworkException('ctx must be obtained within the same request cycle in controller')\r\n\r\n if (!(p in target))\r\n log(`attribute \"${p as string}\" does not exist on ctx, which might be due to a missing AOP role (such as a guard).`, 'warn', data.tag)\r\n\r\n return target[p as any]\r\n },\r\n set(target: any, p, newValue) {\r\n target[p] = newValue\r\n return true\r\n },\r\n })\r\n }\r\n\r\n static getAop(meta: ControllerMeta, opts: DefaultOptions) {\r\n const { globalGuards = [], globalFilter = 'default', globalPipe = 'default' } = opts\r\n const {\r\n data: {\r\n guards, filter,\r\n params, tag, func,\r\n },\r\n } = meta\r\n\r\n const resolved = {\r\n guards: [...globalGuards, ...guards],\r\n pipe: params.map(item => item.pipe || globalPipe),\r\n filter: filter || globalFilter,\r\n\r\n }\r\n\r\n if (process.env.DEBUG) {\r\n const { guards, pipe, filter } = resolved\r\n debug(`func \"${tag}-${func}\" aop: \\n${pc.magenta(`Guard ${guards.join('->')}[${guards.filter(g => g in this.guardRecord).join('->')}]`)}\\n${pc.blue(`Pipe ${pipe.join('-')}[${pipe.map(p => p in this.pipeRecord ? p : 'default').join('-')}]`)}\\n${pc.red(`Filter ${filter}[${filter || 'default'}]`)}`)\r\n }\r\n return {\r\n guards: this.getGuards(resolved.guards),\r\n pipe: this.getPipe(resolved.pipe),\r\n filter: this.getFilter(resolved.filter),\r\n }\r\n }\r\n\r\n public async run<ResponseData = any, ReturnErr = any>({\r\n guards, filter, pipe,\r\n }: {\r\n guards: GuardType[]\r\n filter: FilterType\r\n pipe: PipeType[]\r\n }, successCb: (data: any) => ResponseData, failCb: (err: any) => ReturnErr) {\r\n const { meta, moduleMap } = this.data\r\n const {\r\n paramsType,\r\n data: {\r\n ctxs,\r\n tag,\r\n params,\r\n func,\r\n },\r\n } = meta\r\n\r\n try {\r\n // let current = 0\r\n let res: any\r\n const nextHandler = (index: number) => {\r\n return async () => {\r\n if (index === guards.length) {\r\n const instance = moduleMap.get(tag)!\r\n if (ctxs) {\r\n ctxs.forEach(ctx => instance[ctx] = this.ctx,\r\n )\r\n }\r\n const args = await Promise.all(\r\n params.map((item, i) =>\r\n pipe[i]({ arg: resolveDep(this.data[item.type], item.key), reflect: paramsType[item.index], ...item }, this.ctx),\r\n ),\r\n )\r\n\r\n // if (IS_DEV) {\r\n // Promise.resolve().then(() => {\r\n // this.canGetCtx = false\r\n // })\r\n // }\r\n res = await instance[func](...args)\r\n // this.canGetCtx = true\r\n }\r\n else {\r\n let nextPromise: Promise<any> | undefined\r\n async function next() {\r\n return nextPromise = nextHandler(index + 1)().then((ret) => {\r\n if (ret !== undefined) {\r\n debug(`The ${index + 1}th guard on \"${tag}-${func}\" rewrite the response value.`)\r\n res = ret\r\n }\r\n\r\n return res\r\n })\r\n }\r\n\r\n const ret = await guards[index](this.ctx, next)\r\n\r\n if (ret !== undefined) {\r\n res = ret\r\n }\r\n else {\r\n if (!nextPromise)\r\n await next()\r\n\r\n else\r\n await nextPromise\r\n }\r\n }\r\n }\r\n }\r\n await nextHandler(0)()\r\n\r\n return successCb(res)\r\n }\r\n catch (e) {\r\n const err = await filter(e, this.ctx)\r\n return failCb(err)\r\n }\r\n }\r\n\r\n static getPipe(pipe: string[]) {\r\n return pipe.map((pipe) => {\r\n return Context.pipeRecord[pipe] || Context.pipeRecord.default\r\n })\r\n }\r\n\r\n static getFilter(filter = 'default') {\r\n return Context.filterRecord[filter] || Context.filterRecord.default\r\n }\r\n\r\n static getGuards(guards: string[]) {\r\n const ret: { value: GuardType; priority: number }[] = []\r\n for (const guard of new Set(guards)) {\r\n if (guard in Context.guardRecord)\r\n ret.push(Context.guardRecord[guard])\r\n }\r\n\r\n return ret.sort((a, b) => b.priority - a.priority).map(item => item.value)\r\n }\r\n\r\n static applyAddons(addons: string[], router: any, framework: string) {\r\n const ret: {\r\n value: (router: any, framework: string) => any\r\n priority: number\r\n }[] = []\r\n for (const a of new Set(addons)) {\r\n if (a in Context.addonRecord)\r\n ret.push(Context.addonRecord[a])\r\n }\r\n\r\n ret.sort((a, b) => b.priority - a.priority).forEach(item => item.value(router, framework))\r\n\r\n // await Context.addonRecord[a](router, framework)\r\n }\r\n}\r\n\r\nexport function addPipe<C extends BaseCtx>(key: PropertyKey, pipe: PipeType<C>) {\r\n if (Context.pipeRecord[key] && Context.pipeRecord[key] !== pipe)\r\n debug(`overwrite Pipe \"${String(key)}\"`, 'warn')\r\n Context.pipeRecord[key] = pipe\r\n}\r\n\r\nexport function addFilter<C extends BaseCtx>(key: PropertyKey, filter: FilterType<C>) {\r\n if (Context.filterRecord[key] && Context.filterRecord[key] !== filter)\r\n debug(`overwrite Filter \"${String(key)}\"`, 'warn')\r\n Context.filterRecord[key] = filter\r\n}\r\n\r\nexport function addGuard<C extends BaseCtx>(key: PropertyKey, guard: GuardType<C>, priority = 0) {\r\n if (Context.guardRecord[key] && Context.guardRecord[key].value !== guard)\r\n debug(`overwrite Guard \"${String(key)}\"`, 'warn')\r\n\r\n Context.guardRecord[key] = {\r\n value: guard,\r\n priority,\r\n }\r\n}\r\nexport function addAddon(key: PropertyKey, addon: (router: any, framework: string) => void, priority = 0) {\r\n if (Context.addonRecord[key] && Context.addonRecord[key].value !== addon)\r\n debug(`overwrite Addon \"${String(key)}\"`, 'warn')\r\n Context.addonRecord[key] = {\r\n value: addon,\r\n priority,\r\n }\r\n}\r\n","// import { isPhecda, } from 'phecda-core'\r\n// import { ValidateException } from './exception/validate'\r\n\r\nimport type { PipeType } from './context'\r\n\r\nexport const defaultPipe: PipeType = ({ arg }) => {\n // if (['query', 'params'].includes(type) && reflect !== String) {\r\n // if ([Object, Array].includes(reflect)) {\r\n // return JSON.parse(arg)\r\n // }\r\n // if ([Number, Boolean].includes(reflect)) {\r\n // return reflect(arg)\r\n // }\r\n // }\r\n return arg\r\n}\r\n","import { ERROR_SYMBOL } from '../common'\r\n\r\nexport class Exception extends Error {\r\n constructor(public message: string, public status = 0, public description = 'Exception') {\r\n super(message)\r\n }\r\n\r\n get data() {\r\n return { message: this.message, description: this.description, status: this.status, [ERROR_SYMBOL]: true }\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class UndefinedException extends Exception {\r\n constructor(message: string) {\r\n super(message, 500, 'Undefined error')\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class ValidateException extends Exception {\r\n constructor(message: string) {\r\n super(message, 400, 'Validate exception')\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class ForbiddenException extends Exception {\r\n constructor(message: string) {\r\n super(message, 403, 'Forbidden resource')\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class BadRequestException extends Exception {\r\n constructor(message: string) {\r\n super(message, 400, 'Bad Request')\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class NotFoundException extends Exception {\r\n constructor(message: string) {\r\n super(message, 404, 'Not Found')\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class ConflictException extends Exception {\r\n constructor(message: string) {\r\n super(message, 409, 'Conflict')\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class BadGatewayException extends Exception {\r\n constructor(message: string) {\r\n super(message, 502, 'Bad Gatrway')\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class InvalidInputException extends Exception {\r\n constructor(message: string) {\r\n super(message, 502, 'Invalid Input')\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class UnsupportedMediaTypeException extends Exception {\r\n constructor(message: string) {\r\n super(message, 415, 'Unsupported Media Type')\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class PayloadLargeException extends Exception {\r\n constructor(message: string) {\r\n super(message, 413, 'Payload Too Large')\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class TimeoutException extends Exception {\r\n constructor(message: string) {\r\n super(message, 408, 'Request Timeout',\r\n )\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class UnauthorizedException extends Exception {\r\n constructor(message: string) {\r\n super(message, 401, 'Unauthorized')\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class ServiceUnavailableException extends Exception {\r\n constructor(message: string) {\r\n super(message, 503, 'Service Unavailable')\r\n }\r\n}\r\n","import { Exception } from './base'\r\n\r\nexport class FrameworkException extends Exception {\r\n constructor(message: string) {\r\n super(`[phecda-server] ${message}`, 500, 'Framework Error')\r\n }\r\n}\r\n","import { Exception } from './base'\r\nexport class TimerException extends Exception {\r\n constructor(message: string) {\r\n super(message, 0, 'Timer Error')\r\n }\r\n}\r\n","import { Exception } from './base'\r\nexport class WorkerException extends Exception {\r\n constructor(message: string) {\r\n super(message, 0, 'Worker Error')\r\n }\r\n}\r\n","import { LOG_LEVEL } from './common'\r\nimport { Exception, UndefinedException } from './exception'\r\nimport { log } from './utils'\r\nimport type { FilterType } from './context'\r\n\r\nexport const defaultFilter: FilterType = (e) => {\r\n if (!(e instanceof Exception)) {\r\n log(e.message, 'error')\r\n if (LOG_LEVEL <= 0)\r\n console.error(e.stack)\r\n\r\n e = new UndefinedException(e.message || e)\r\n }\r\n else {\r\n log(`[${e.constructor.name}] ${e.message}`, 'error')\r\n if (LOG_LEVEL <= 0)\r\n console.error(e.stack)\r\n }\r\n\r\n return e.data\r\n}\r\n","export function resolveDep(ret: any, key: string) {\r\n if (key)\r\n return ret?.[key]\r\n return ret\r\n}\r\n\r\n// export function argToReq(params: ControllerMetaData['params'], args: any[], headers: Record<string, any>) {\r\n// const req = {\r\n// body: {},\r\n// query: {},\r\n// params: {},\r\n// headers,\r\n// } as any\r\n\r\n// params.forEach((param) => {\r\n// if (param.key)\r\n// req[param.type][param.key] = args[param.index]\r\n\r\n// else\r\n// req[param.type] = args[param.index]\r\n// })\r\n\r\n// return req\r\n// }\r\n","export function shallowClone(obj: any) {\r\n return { ...obj }\r\n}\r\nexport function mergeObject(...args: any[]) {\r\n return Object.assign({}, ...args)\r\n}\r\n"],"mappings":";;;;;;;;;;;;AAEA,OAAOA,SAAQ;;;ACFf,OAAOC,WAAW;AAClB,OAAOC,QAAQ;;;ACIR,IAAMC,cAAwB,wBAAC,EAAEC,IAAG,MAAE;AAS3C,SAAOA;AACT,GAVqC;;;ACH9B,IAAMC,YAAN,cAAwBC,MAAAA;EAF/B,OAE+BA;;;;;;EAC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WtB,OAAO2B,CAAAA,MAAK,CAACI,QAAQO,aAAaX,CAAAA,CAAE;AAEvE,aAASY,OAAAA;AACP,UAAIC,WAAW;AACbC,YAAI,0CAA0C,OAAA;AAC9CC,gBAAQH,KAAK,CAAA;MACf;IACF;AALSA;AAOT,QAAIT,WAAWa,QAAQ;AACrBF,UAAI,GAAGG,IAAGC,MAAM,UAAUf,WAAWgB,KAAK,GAAA,CAAA,GAAO,CAAA,kBAAmB,MAAA;AACpEP,WAAAA;IACF;AACA,QAAIN,WAAWU,QAAQ;AACrBF,UAAI,GAAGG,IAAGG,QAAQ,UAAUd,WAAWa,KAAK,GAAA,CAAA,GAAO,CAAA,kBAAmB,MAAA;AACtEP,WAAAA;IACF;AACA,QAAIJ,UAAUQ,QAAQ;AACpBF,UAAI,GAAGG,IAAGI,KAAK,SAASb,UAAUW,KAAK,GAAA,CAAA,GAAO,CAAA,kBAAmB,MAAA;AACjEP,WAAAA;IACF;AACA,QAAIF,YAAYM,QAAQ;AACtBF,UAAI,GAAGG,IAAGK,IAAI,WAAWZ,YAAYS,KAAK,GAAA,CAAA,GAAO,CAAA,kBAAmB,MAAA;AACpEP,WAAAA;IACF;AAEAhB,eAAWC,QAAQ0B,CAAAA,SAAQT,IAAIS,MAAM,MAAA,CAAA;AACrC,QAAI3B,WAAW4B,KACbZ,MAAAA;EACJ;AAvESpC;AAyETA,aAAAA;AACAS,MAAIT,UAAAA;AACJ,SAAO;IACLe;IACAE;IACAC;IACAC;EACF;AACF;AA9FgBT;AAgGT,SAASuC,QAAQC,SAAiBC,OAAe;AACtD,QAAMC,aAAa;IAACF;OAASC;IAAOtD,OAAOwD,CAAAA,MAAKA,CAAAA,EAAGC,IAAIC,CAAAA,SAAQA,KAAKC,QAAQ,UAAU,EAAA,CAAA,EAAKb,KAAK,GAAA;AAChG,SAAO,IAAIS,UAAAA;AACb;AAHgBH;","names":["pc","Debug","pc","defaultPipe","arg","Exception","Error","constructor","message","status","description","data","ERROR_SYMBOL","UndefinedException","Exception","constructor","message","ValidateException","Exception","constructor","message","ForbiddenException","Exception","constructor","message","BadRequestException","Exception","constructor","message","NotFoundException","Exception","constructor","message","ConflictException","Exception","constructor","message","BadGatewayException","Exception","constructor","message","InvalidInputException","Exception","constructor","message","UnsupportedMediaTypeException","Exception","constructor","message","PayloadLargeException","Exception","constructor","message","TimeoutException","Exception","constructor","message","UnauthorizedException","Exception","constructor","message","ServiceUnavailableException","Exception","constructor","message","FrameworkException","Exception","constructor","message","TimerException","Exception","constructor","message","WorkerException","Exception","constructor","message","defaultFilter","e","Exception","log","message","LOG_LEVEL","console","error","stack","UndefinedException","constructor","name","data","debug","Debug","Context","method","params","filterRecord","default","defaultFilter","pipeRecord","defaultPipe","guardRecord","addonRecord","ctx","constructor","data","IS_DEV","_context","Proxy","get","target","p","log","tag","set","newValue","getAop","meta","opts","globalGuards","globalFilter","globalPipe","guards","filter","func","resolved","pipe","map","item","process","env","DEBUG","pc","magenta","join","g","blue","red","getGuards","getPipe","getFilter","run","successCb","failCb","moduleMap","paramsType","ctxs","res","nextHandler","index","length","instance","forEach","args","Promise","all","i","arg","resolveDep","type","key","reflect","nextPromise","next","then","ret","undefined","e","err","guard","Set","push","sort","a","b","priority","value","applyAddons","addons","router","framework","addPipe","String","addFilter","addGuard","addAddon","addon","resolveDep","ret","key","shallowClone","obj","mergeObject","args","Object","assign","createControllerMetaMap","meta","filter","metaMap","Map","handleMeta","clear","item","tag","func","data","has","get","set","HMR","detectAopDep","guards","addons","controller","IS_PURE","addonSet","Set","guardSet","pipeSet","filterSet","warningSet","forEach","add","name","i","params","pipe","missAddons","Context","addonRecord","missGuards","guardRecord","missPipes","pipeRecord","missFilters","filterRecord","exit","IS_STRICT","log","process","length","pc","white","join","magenta","blue","red","warn","size","joinUrl","base","paths","joinedPath","p","map","path","replace"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common.ts","../src/utils.ts","../src/hmr.ts"],"sourcesContent":["export const ERROR_SYMBOL = '__PS_ERROR__'// only use in paralle request\r\n\r\nexport const IS_DEV = process.env.NODE_ENV === 'development'\r\nexport const IS_ONLY_GENERATE = !!process.env.PS_GENERATE// work for ci; only generate code\r\nexport const IS_STRICT = !!process.env.PS_STRICT// throw error if depends on an aop module which is not imported\r\nexport const IS_PURE = !!process.env.PS_PURE// pure mode, will skip detectAopDep\r\n\r\nexport const LOG_LEVEL = Number(process.env.PS_LOG_LEVEL || 0)// internal logger\r\n\r\nexport enum PS_EXIT_CODE {\r\n RELAUNCH = 4171,\r\n EXIT = 4172,\r\n}\r\n","import pc from 'picocolors'\r\nimport { LOG_LEVEL } from './common'\r\nimport { HttpCtx } from './http/types'\r\n\r\nexport type LogLevel = 'error' | 'info' | 'warn' | 'log' | 'debug'\r\n\r\nexport interface Logger {\r\n log(msg: unknown, level: LogLevel, ctx?: string): void\r\n}\r\n\r\nconst isObject = (fn: any): fn is object =>\r\n fn !== null && typeof fn === 'object'\r\n\r\nconst isPlainObject = (fn: any): fn is object => {\r\n if (!isObject(fn))\r\n return false\r\n\r\n const proto = Object.getPrototypeOf(fn)\r\n if (proto === null)\r\n return true\r\n\r\n const ctor\r\n = Object.prototype.hasOwnProperty.call(proto, 'constructor')\r\n && proto.constructor\r\n return (\r\n typeof ctor === 'function'\r\n && ctor instanceof ctor\r\n && Function.prototype.toString.call(ctor)\r\n === Function.prototype.toString.call(Object)\r\n )\r\n}\r\n\r\nclass InternalLogger {\r\n time: number\r\n color = { debug: 'bgMagenta', error: 'red', info: 'gray', warn: 'yellow', log: 'green' } as const\r\n dateFormatter = new Intl.DateTimeFormat(undefined, {\r\n year: 'numeric',\r\n hour: 'numeric',\r\n minute: 'numeric',\r\n second: 'numeric',\r\n day: '2-digit',\r\n month: '2-digit',\r\n })\r\n\r\n diffTimestamp() {\r\n const now = Date.now()\r\n\r\n if (!this.time)\r\n return ''\r\n const diff = now - this.time\r\n\r\n this.time = now\r\n\r\n return diff ? pc.yellow(` +${diff}`) : ''\r\n }\r\n\r\n colorize(message: string, logLevel: LogLevel) {\r\n return pc[this.color[logLevel]](message)\r\n }\r\n\r\n isAllowLog(level: LogLevel) {\r\n const logLevel = {\r\n debug: -1,\r\n info: 0,\r\n log: 1,\r\n warn: 2,\r\n error: 3,\r\n }[level]\r\n\r\n if (logLevel < LOG_LEVEL)\r\n return false\r\n\r\n return true\r\n }\r\n\r\n stringifyMessage(message: unknown, logLevel: LogLevel): string {\r\n if (typeof message === 'function') {\r\n const messageAsStr = Function.prototype.toString.call(message)\r\n const isClass = messageAsStr.startsWith('class ')\r\n if (isClass) {\r\n // If the message is a class, we will display the class name.\r\n return this.stringifyMessage(message.name, logLevel)\r\n }\r\n // If the message is a non-class function, call it and re-resolve its value.\r\n return this.stringifyMessage(message(), logLevel)\r\n }\r\n\r\n return (isPlainObject(message) || Array.isArray(message))\r\n ? `${this.colorize('Object:', logLevel)}\\n${JSON.stringify(\r\n message,\r\n (key, value) =>\r\n typeof value === 'bigint' ? value.toString() : value,\r\n 2,\r\n )}\\n`\r\n : this.colorize(message as string, logLevel)\r\n }\r\n\r\n log(msg: unknown, level: LogLevel, ctx?: string) {\r\n if (!this.isAllowLog(level))\r\n return\r\n msg = this.stringifyMessage(msg, level)\r\n const pidMsg = this.colorize(`[${process.env.PS_APP_NAME || 'phecda-server'}] ${process.pid}`, level)\r\n const ctxMsg = ctx ? this.colorize(pc.bold(`[${ctx}] `), level) : ''\r\n const timeDiff = this.diffTimestamp()\r\n const levelMsg = this.colorize(level.toUpperCase().padStart(7, ' '), level)\r\n process.stdout.write(`${pidMsg} ${this.dateFormatter.format(Date.now())} ${levelMsg} ${ctxMsg}${msg}${timeDiff}\\n`)\r\n }\r\n}\r\n\r\nlet _logger: Logger = new InternalLogger()\r\n\r\nexport function setLogger(logger: Logger) {\r\n _logger = logger\r\n}\r\nexport function getLogger() {\r\n return _logger\r\n}\r\n\r\nexport function log(msg: unknown, level: LogLevel = 'log', ctx?: any) {\r\n _logger.log(msg, level, ctx)\r\n}\r\n\r\nexport function runMiddleware(ctx: HttpCtx, middleware: (req: any, res: any, next?: any) => any) {\r\n return new Promise((resolve) => {\r\n middleware(ctx.getRequest(), ctx.getResponse(), resolve)\r\n })\r\n}\r\n\r\nexport { Mixin } from 'ts-mixer'\r\n","import { Construct } from 'phecda-core'\r\nimport { IS_DEV, PS_EXIT_CODE } from './common'\r\nimport { log } from './utils'\r\nexport function HMR(cb: (oldModels: Construct[], newModels: Construct[]) => any) {\r\n if (IS_DEV) {\r\n if (!globalThis.__PS_HMR__)\r\n globalThis.__PS_HMR__ = []\r\n globalThis.__PS_HMR__.push(cb)\r\n }\r\n}\r\n\r\nexport async function RELOAD(oldModels: Construct[], newModels: Construct[]) {\r\n log('reload module...')\r\n for (const cb of globalThis.__PS_HMR__) await cb(oldModels, newModels)\r\n\r\n log('reload done')\r\n}\r\n\r\nexport function RELAUNCH() {\r\n if (IS_DEV) {\r\n log('relaunch...')\r\n\r\n process.exit(PS_EXIT_CODE.RELAUNCH)\r\n }\r\n}\r\n"],"mappings":";;;;AAAO,IAAMA,eAAe;AAErB,IAAMC,SAASC,QAAQC,IAAIC,aAAa;AACxC,IAAMC,mBAAmB,CAAC,CAACH,QAAQC,IAAIG;AACvC,IAAMC,YAAY,CAAC,CAACL,QAAQC,IAAIK;AAChC,IAAMC,UAAU,CAAC,CAACP,QAAQC,IAAIO;AAE9B,IAAMC,YAAYC,OAAOV,QAAQC,IAAIU,gBAAgB,CAAA;AAErD,IAAKC,eAAAA,yBAAAA,eAAAA;;;SAAAA;;;;ACTZ,OAAOC,QAAQ;AAgIf,SAASC,aAAa;AAtHtB,IAAMC,WAAW,wBAACC,OAChBA,OAAO,QAAQ,OAAOA,OAAO,UADd;AAGjB,IAAMC,gBAAgB,wBAACD,OAAAA;AACrB,MAAI,CAACD,SAASC,EAAAA,EACZ,QAAO;AAET,QAAME,QAAQC,OAAOC,eAAeJ,EAAAA;AACpC,MAAIE,UAAU,KACZ,QAAO;AAET,QAAMG,OACFF,O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AAAA;AAClBF,eAAWpB,IAAIuB,WAAU,GAAIvB,IAAIwB,YAAW,GAAIF,OAAAA;EAClD,CAAA;AACF;AAJgBH;;;ACvHT,SAASM,IAAIC,IAA2D;AAC7E,MAAIC,QAAQ;AACV,QAAI,CAACC,WAAWC,WACdD,YAAWC,aAAa,CAAA;AAC1BD,eAAWC,WAAWC,KAAKJ,EAAAA;EAC7B;AACF;AANgBD;AAQhB,eAAsBM,OAAOC,WAAwBC,WAAsB;AACzEC,MAAI,kBAAA;AACJ,aAAWR,MAAME,WAAWC,WAAY,OAAMH,GAAGM,WAAWC,SAAAA;AAE5DC,MAAI,aAAA;AACN;AALsBH;AAOf,SAASI,WAAAA;AACd,MAAIR,QAAQ;AACVO,QAAI,aAAA;AAEJE,YAAQC,KAAKC,aAAaH,QAAQ;EACpC;AACF;AANgBA;","names":["ERROR_SYMBOL","IS_DEV","process","env","NODE_ENV","IS_ONLY_GENERATE","PS_GENERATE","IS_STRICT","PS_STRICT","IS_PURE","PS_PURE","LOG_LEVEL","Number","PS_LOG_LEVEL","PS_EXIT_CODE","pc","Mixin","isObject","fn","isPlainObject","proto","Object","getPrototypeOf","ctor","prototype","hasOwnProperty","call","constructor","Function","toString","InternalLogger","time","color","debug","error","info","warn","log","dateFormatter","Intl","DateTimeFormat","undefined","year","hour","minute","second","day","month","diffTimestamp","now","Date","diff","pc","yellow","colorize","message","logLevel","isAllowLog","level","LOG_LEVEL","stringifyMessage","messageAsStr","isClass","startsWith","name","Array","isArray","JSON","stringify","key","value","msg","ctx","pidMsg","process","env","PS_APP_NAME","pid","ctxMsg","bold","timeDiff","levelMsg","toUpperCase","padStart","stdout","write","format","_logger","setLogger","logger","getLogger","runMiddleware","middleware","Promise","resolve","getRequest","getResponse","HMR","cb","IS_DEV","globalThis","__PS_HMR__","push","RELOAD","oldModels","newModels","log","RELAUNCH","process","exit","PS_EXIT_CODE"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["d:\\myproject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,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI;AAChC,IAAI,IAAI,CAAC,KAAK,EAAE,GAAG;AACnB,IAAI,OAAO,KAAK,EAAE,oBAAE,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"D:\\myproject\\phecda\\packages\\server\\dist\\chunk-RLFCI3RG.js","sourcesContent":[null]}
|