phecda-server 7.0.0-alpha.8 → 7.0.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/README.md +10 -10
- package/assets/schema.json +12 -9
- package/bin/cli.mjs +96 -37
- package/dist/chunk-5SUY5UVC.js +258 -0
- package/dist/chunk-5SUY5UVC.js.map +1 -0
- package/dist/chunk-6JAHCTOT.mjs +334 -0
- package/dist/chunk-6JAHCTOT.mjs.map +1 -0
- package/dist/{chunk-BBNJVYVX.js → chunk-EDAWJVJ4.js} +42 -25
- package/dist/chunk-EDAWJVJ4.js.map +1 -0
- package/dist/{chunk-7EMAZGYO.js → chunk-H7OCHDZT.js} +65 -95
- package/dist/chunk-H7OCHDZT.js.map +1 -0
- package/dist/{chunk-QJIAXSLZ.js → chunk-KRUOHWFR.js} +79 -68
- package/dist/chunk-KRUOHWFR.js.map +1 -0
- package/dist/chunk-KUGU3UGO.js +334 -0
- package/dist/chunk-KUGU3UGO.js.map +1 -0
- package/dist/{chunk-SGMQZRP6.mjs → chunk-LBH4RXQQ.mjs} +12 -42
- package/dist/chunk-LBH4RXQQ.mjs.map +1 -0
- package/dist/{chunk-YKP4ODZA.mjs → chunk-MDPW6WGF.mjs} +32 -6
- package/dist/chunk-MDPW6WGF.mjs.map +1 -0
- package/dist/{chunk-VSGYTGHY.js → chunk-RLFCI3RG.js} +31 -5
- package/dist/chunk-RLFCI3RG.js.map +1 -0
- package/dist/{chunk-7NWDKK7D.mjs → chunk-TTHYUNOT.mjs} +18 -1
- package/dist/chunk-TTHYUNOT.mjs.map +1 -0
- package/dist/chunk-VDOICQ2U.mjs +258 -0
- package/dist/chunk-VDOICQ2U.mjs.map +1 -0
- package/dist/{chunk-B45BN7LY.mjs → chunk-WTJKTICN.mjs} +65 -54
- package/dist/chunk-WTJKTICN.mjs.map +1 -0
- package/dist/{core-BGEsBtTG.d.ts → core-BOo3uGFX.d.ts} +5 -4
- package/dist/{core-BcKywWLd.d.mts → core-CF45G79J.d.mts} +5 -4
- package/dist/core-DbqWh47p.d.mts +50 -0
- package/dist/core-Rq7BhPHE.d.ts +50 -0
- package/dist/helper.d.mts +7 -8
- package/dist/helper.d.ts +7 -8
- package/dist/helper.js +5 -3
- package/dist/helper.js.map +1 -0
- package/dist/helper.mjs +9 -7
- package/dist/helper.mjs.map +1 -0
- package/dist/http/elysia/index.d.mts +4 -4
- package/dist/http/elysia/index.d.ts +4 -4
- package/dist/http/elysia/index.js +43 -45
- package/dist/http/elysia/index.js.map +1 -0
- package/dist/http/elysia/index.mjs +6 -8
- package/dist/http/elysia/index.mjs.map +1 -0
- package/dist/http/express/index.d.mts +3 -3
- package/dist/http/express/index.d.ts +3 -3
- package/dist/http/express/index.js +40 -42
- package/dist/http/express/index.js.map +1 -0
- package/dist/http/express/index.mjs +6 -8
- package/dist/http/express/index.mjs.map +1 -0
- package/dist/http/fastify/index.d.mts +3 -3
- package/dist/http/fastify/index.d.ts +3 -3
- package/dist/http/fastify/index.js +41 -43
- package/dist/http/fastify/index.js.map +1 -0
- package/dist/http/fastify/index.mjs +6 -8
- package/dist/http/fastify/index.mjs.map +1 -0
- package/dist/http/h3/index.d.mts +3 -3
- package/dist/http/h3/index.d.ts +3 -3
- package/dist/http/h3/index.js +41 -43
- package/dist/http/h3/index.js.map +1 -0
- package/dist/http/h3/index.mjs +5 -7
- package/dist/http/h3/index.mjs.map +1 -0
- package/dist/http/hono/index.d.mts +3 -3
- package/dist/http/hono/index.d.ts +3 -3
- package/dist/http/hono/index.js +37 -39
- package/dist/http/hono/index.js.map +1 -0
- package/dist/http/hono/index.mjs +5 -7
- package/dist/http/hono/index.mjs.map +1 -0
- package/dist/http/hyper-express/index.d.mts +3 -3
- package/dist/http/hyper-express/index.d.ts +3 -3
- package/dist/http/hyper-express/index.js +38 -40
- package/dist/http/hyper-express/index.js.map +1 -0
- package/dist/http/hyper-express/index.mjs +5 -7
- package/dist/http/hyper-express/index.mjs.map +1 -0
- package/dist/http/koa/index.d.mts +3 -3
- package/dist/http/koa/index.d.ts +3 -3
- package/dist/http/koa/index.js +40 -42
- package/dist/http/koa/index.js.map +1 -0
- package/dist/http/koa/index.mjs +6 -8
- package/dist/http/koa/index.mjs.map +1 -0
- package/dist/index.d.mts +76 -12
- package/dist/index.d.ts +76 -12
- package/dist/index.js +103 -49
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +68 -14
- package/dist/index.mjs.map +1 -0
- package/dist/{meta-B_HW7cWh.d.ts → meta-BoS1E-Nz.d.mts} +6 -24
- package/dist/{meta-B_HW7cWh.d.mts → meta-BoS1E-Nz.d.ts} +6 -24
- package/dist/rpc/bullmq/index.d.mts +4 -6
- package/dist/rpc/bullmq/index.d.ts +4 -6
- package/dist/rpc/bullmq/index.js +13 -80
- package/dist/rpc/bullmq/index.js.map +1 -0
- package/dist/rpc/bullmq/index.mjs +6 -73
- package/dist/rpc/bullmq/index.mjs.map +1 -0
- package/dist/rpc/electron/index.d.mts +13 -0
- package/dist/rpc/electron/index.d.ts +13 -0
- package/dist/rpc/electron/index.js +73 -0
- package/dist/rpc/electron/index.js.map +1 -0
- package/dist/rpc/electron/index.mjs +73 -0
- package/dist/rpc/electron/index.mjs.map +1 -0
- package/dist/rpc/kafka/index.d.mts +4 -9
- package/dist/rpc/kafka/index.d.ts +4 -9
- package/dist/rpc/kafka/index.js +12 -90
- package/dist/rpc/kafka/index.js.map +1 -0
- package/dist/rpc/kafka/index.mjs +5 -83
- package/dist/rpc/kafka/index.mjs.map +1 -0
- package/dist/rpc/nats/index.d.mts +4 -6
- package/dist/rpc/nats/index.d.ts +4 -6
- package/dist/rpc/nats/index.js +13 -72
- package/dist/rpc/nats/index.js.map +1 -0
- package/dist/rpc/nats/index.mjs +5 -64
- package/dist/rpc/nats/index.mjs.map +1 -0
- package/dist/rpc/rabbitmq/index.d.mts +4 -6
- package/dist/rpc/rabbitmq/index.d.ts +4 -6
- package/dist/rpc/rabbitmq/index.js +14 -79
- package/dist/rpc/rabbitmq/index.js.map +1 -0
- package/dist/rpc/rabbitmq/index.mjs +6 -71
- package/dist/rpc/rabbitmq/index.mjs.map +1 -0
- package/dist/rpc/redis/index.d.mts +4 -9
- package/dist/rpc/redis/index.d.ts +4 -9
- package/dist/rpc/redis/index.js +12 -78
- package/dist/rpc/redis/index.js.map +1 -0
- package/dist/rpc/redis/index.mjs +6 -72
- package/dist/rpc/redis/index.mjs.map +1 -0
- package/dist/rpc/web-ext/index.d.mts +2 -0
- package/dist/rpc/web-ext/index.d.ts +2 -0
- package/dist/rpc/web-ext/index.js +1 -0
- package/dist/rpc/web-ext/index.js.map +1 -0
- package/dist/rpc/web-ext/index.mjs +1 -0
- package/dist/rpc/web-ext/index.mjs.map +1 -0
- package/dist/rpc/ws/index.d.mts +14 -0
- package/dist/rpc/ws/index.d.ts +14 -0
- package/dist/rpc/ws/index.js +74 -0
- package/dist/rpc/ws/index.js.map +1 -0
- package/dist/rpc/ws/index.mjs +74 -0
- package/dist/rpc/ws/index.mjs.map +1 -0
- package/dist/test.d.mts +8 -4
- package/dist/test.d.ts +8 -4
- package/dist/test.js +7 -6
- package/dist/test.js.map +1 -0
- package/dist/test.mjs +3 -2
- package/dist/test.mjs.map +1 -0
- package/dist/types-CInz3bD0.d.ts +14 -0
- package/dist/types-E-rqlg3-.d.mts +14 -0
- package/dist/{types-C2SQ9U9V.d.mts → types-SCJZFCYt.d.mts} +1 -1
- package/dist/{types-PFPIQWVF.d.ts → types-xruyYmyu.d.ts} +1 -1
- package/package.json +24 -8
- package/register/export.mjs +30 -0
- package/register/index.mjs +20 -12
- package/register/loader.mjs +94 -116
- package/register/utils.mjs +36 -6
- package/assets/ps.json +0 -24
- package/assets/tsconfig.json +0 -21
- package/dist/types-CYF0vha6.d.ts +0 -19
- package/dist/types-DEQb_e59.d.mts +0 -19
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HMR,
|
|
3
|
+
IS_ONLY_GENERATE,
|
|
4
|
+
PS_EXIT_CODE,
|
|
5
|
+
__name,
|
|
6
|
+
log
|
|
7
|
+
} from "./chunk-MDPW6WGF.mjs";
|
|
8
|
+
|
|
9
|
+
// src/meta.ts
|
|
10
|
+
var Meta = class {
|
|
11
|
+
static {
|
|
12
|
+
__name(this, "Meta");
|
|
13
|
+
}
|
|
14
|
+
data;
|
|
15
|
+
paramsType;
|
|
16
|
+
constructor(data, paramsType) {
|
|
17
|
+
this.data = data;
|
|
18
|
+
this.paramsType = paramsType;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// src/core.ts
|
|
23
|
+
import "reflect-metadata";
|
|
24
|
+
import EventEmitter from "node:events";
|
|
25
|
+
import { getInject, getMergedMeta, getMetaKey, getMetaParams, getTag, invokeInit, invokeUnmount, setInject } from "phecda-core";
|
|
26
|
+
import Debug from "debug";
|
|
27
|
+
var debug = Debug("phecda-server(Factory)");
|
|
28
|
+
var emitter = new EventEmitter();
|
|
29
|
+
function defaultServerInject() {
|
|
30
|
+
if (!getInject("watcher")) {
|
|
31
|
+
setInject("watcher", ({ eventName, instance, property, options }) => {
|
|
32
|
+
const fn = typeof instance[property] === "function" ? instance[property].bind(instance) : (v) => instance[property] = v;
|
|
33
|
+
if (options?.once) emitter.once(eventName, fn);
|
|
34
|
+
else emitter.on(eventName, fn);
|
|
35
|
+
return () => {
|
|
36
|
+
emitter.off(eventName, fn);
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
__name(defaultServerInject, "defaultServerInject");
|
|
42
|
+
var phecdaNamespace = /* @__PURE__ */ new Map();
|
|
43
|
+
var ServerPhecda = class {
|
|
44
|
+
static {
|
|
45
|
+
__name(this, "ServerPhecda");
|
|
46
|
+
}
|
|
47
|
+
moduleMap = /* @__PURE__ */ new Map();
|
|
48
|
+
meta = [];
|
|
49
|
+
modelMap = /* @__PURE__ */ new WeakMap();
|
|
50
|
+
modelSet = /* @__PURE__ */ new WeakSet();
|
|
51
|
+
dependenceGraph = /* @__PURE__ */ new Map();
|
|
52
|
+
parseModule;
|
|
53
|
+
parseMeta;
|
|
54
|
+
generators;
|
|
55
|
+
constructor(options) {
|
|
56
|
+
defaultServerInject();
|
|
57
|
+
const { namespace = "default", parseModule = /* @__PURE__ */ __name((module) => module, "parseModule"), parseMeta = /* @__PURE__ */ __name((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 (IS_ONLY_GENERATE) {
|
|
68
|
+
log("Only generate code");
|
|
69
|
+
process.exit(PS_EXIT_CODE.EXIT);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
generateCode = /* @__PURE__ */ __name(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
|
+
HMR(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 = getTag(Model);
|
|
150
|
+
if (this.moduleMap.has(tag)) {
|
|
151
|
+
module = this.moduleMap.get(tag);
|
|
152
|
+
if (!module) {
|
|
153
|
+
log(`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) log(`Module taged ${String(tag)} has been overridden`);
|
|
162
|
+
else log(`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 (!IS_ONLY_GENERATE) await invokeInit(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 = getTag(model);
|
|
197
|
+
if (!this.has(tag)) return;
|
|
198
|
+
const module = this.moduleMap.get(tag);
|
|
199
|
+
debug(`unmount module "${String(tag)}"`);
|
|
200
|
+
await invokeUnmount(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 = getTag(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" ? getTag(modelOrTag) : modelOrTag);
|
|
232
|
+
}
|
|
233
|
+
get(modelOrTag) {
|
|
234
|
+
const tag = typeof modelOrTag === "function" ? getTag(modelOrTag) : modelOrTag;
|
|
235
|
+
if (!this.has(tag)) throw new Error(`module "${tag.toString()}" doesn't exist`);
|
|
236
|
+
return this.moduleMap.get(tag);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
async function Factory(models, opts = {}) {
|
|
240
|
+
const phecda = new ServerPhecda(opts);
|
|
241
|
+
await phecda.start(models);
|
|
242
|
+
return phecda;
|
|
243
|
+
}
|
|
244
|
+
__name(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
|
+
__name(useS, "useS");
|
|
258
|
+
function getMetaFromInstance(instance, tag, name) {
|
|
259
|
+
const propertyKeys = getMetaKey(instance).filter((item) => typeof item === "string");
|
|
260
|
+
const baseMeta = getMergedMeta(instance, void 0);
|
|
261
|
+
const ctxs = baseMeta.ctxs;
|
|
262
|
+
return propertyKeys.filter((i) => typeof instance[i] === "function").map((i) => {
|
|
263
|
+
const meta = getMergedMeta(instance, i);
|
|
264
|
+
const metaData = {
|
|
265
|
+
...meta,
|
|
266
|
+
name,
|
|
267
|
+
tag,
|
|
268
|
+
func: i
|
|
269
|
+
};
|
|
270
|
+
if (baseMeta.controller) {
|
|
271
|
+
if (typeof tag !== "string") log(`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 = getMetaParams(instance, i).map((item) => getMergedMeta(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
|
+
__name(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
|
+
__name(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
|
+
__name(getParamTypes, "getParamTypes");
|
|
324
|
+
|
|
325
|
+
export {
|
|
326
|
+
Meta,
|
|
327
|
+
emitter,
|
|
328
|
+
defaultServerInject,
|
|
329
|
+
phecdaNamespace,
|
|
330
|
+
ServerPhecda,
|
|
331
|
+
Factory,
|
|
332
|
+
useS
|
|
333
|
+
};
|
|
334
|
+
//# sourceMappingURL=chunk-6JAHCTOT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/meta.ts","../src/core.ts"],"sourcesContent":["import type { BaseRequestType } from './types'\r\n\r\nexport interface ServiceMetaData {\r\n func: string\r\n name: string\r\n tag: string\r\n define?: any\r\n [key: string]: any\r\n}\r\n\r\nexport interface ControllerMetaData extends ServiceMetaData {\r\n controller: string\r\n http?: {\r\n type: BaseRequestType\r\n prefix: string\r\n route: string\r\n headers?: Record<string, string>\r\n\r\n }\r\n rpc?: {\r\n queue?: string\r\n isEvent?: boolean\r\n }\r\n ctxs?: string[]\r\n params: { type: string; index: number; key: string; pipe?: string; define: Record<string, any> }[]\r\n guards: string[]\r\n pipe?: string\r\n filter?: string\r\n addons: string[]\r\n\r\n}\r\n\r\nexport type MetaData = ControllerMetaData | ServiceMetaData\r\n\r\nexport class Meta {\r\n constructor(public data: MetaData, public paramsType: any[]) {\r\n\r\n }\r\n}\r\n\r\nexport interface ControllerMeta extends Meta {\r\n data: ControllerMetaData\r\n}\r\n","import 'reflect-metadata'\r\nimport EventEmitter from 'node:events'\r\nimport type { Construct, Phecda, WatcherParam } from 'phecda-core'\r\nimport { getInject, getMergedMeta, getMetaKey, getMetaParams, getTag, invokeInit, invokeUnmount, setInject } from 'phecda-core'\r\nimport Debug from 'debug'\r\nimport type { Emitter } from './types'\r\nimport type { MetaData } from './meta'\r\nimport { Meta } from './meta'\r\nimport { log } from './utils'\r\nimport { IS_ONLY_GENERATE, PS_EXIT_CODE } from './common'\r\nimport type { Generator } from './generator'\r\nimport { HMR } from './hmr'\r\n\r\nconst debug = Debug('phecda-server(Factory)')\r\n// TODO: support both emitter types and origin emitter type in future\r\nexport const emitter: Emitter = new EventEmitter() as any\r\nexport interface Options {\r\n parseModule?: (module: any) => any\r\n parseMeta?: (meta: Meta) => Meta | null | undefined\r\n generators?: Generator[]\r\n namespace?: string\r\n\r\n}\r\n\r\nexport function defaultServerInject() {\r\n if (!getInject('watcher')) {\r\n setInject('watcher', ({ eventName, instance, property, options }: WatcherParam) => {\r\n const fn = typeof instance[property] === 'function' ? instance[property].bind(instance) : (v: any) => instance[property] = v\r\n\r\n if (options?.once)\r\n (emitter as any).once(eventName, fn)\r\n\r\n else\r\n (emitter as any).on(eventName, fn)\r\n\r\n return () => {\r\n (emitter as any).off(eventName, fn)\r\n }\r\n })\r\n }\r\n}\r\n\r\nexport const phecdaNamespace = new Map<string, ServerPhecda>()\r\n\r\nexport class ServerPhecda {\r\n moduleMap = new Map<PropertyKey, InstanceType<Construct>>()\r\n meta: Meta[] = []\r\n modelMap = new WeakMap<InstanceType<Construct>, Construct>()\r\n modelSet = new WeakSet<Construct>()\r\n dependenceGraph = new Map<PropertyKey, Set<PropertyKey>>()\r\n parseModule: (module: any) => any\r\n parseMeta: (meta: Meta) => Meta | null | undefined\r\n generators: Generator[]\r\n constructor(options: Options) {\r\n defaultServerInject()\r\n const { namespace = 'default', parseModule = (module: any) => module, parseMeta = (meta: any) => meta, generators = [] } = options\r\n phecdaNamespace.set(namespace, this)\r\n this.parseMeta = parseMeta\r\n this.parseModule = parseModule\r\n this.generators = generators\r\n }\r\n\r\n async start(models: Construct[]) {\r\n for (const model of models)\r\n await this.buildDepModule(model)\r\n\r\n this.hmr()\r\n this.generateCode().then(() => {\r\n if (IS_ONLY_GENERATE) {\r\n log('Only generate code')\r\n process.exit(PS_EXIT_CODE.EXIT)// only output code/work for ci\r\n }\r\n })\r\n }\r\n\r\n generateCode = async () => {\r\n return Promise.all(this.generators.map((generator) => {\r\n debug(`generate \"${generator.name}\" code to ${generator.path}`)\r\n\r\n return generator.output(this.meta)\r\n }))\r\n }\r\n\r\n hmr() {\r\n HMR(async (oldModels, newModels) => {\r\n debug('reload models ')\r\n\r\n await this.replace(oldModels, newModels)\r\n\r\n this.generateCode()\r\n })\r\n }\r\n // async add(Model: Construct) {\r\n // const tag = getTag(Model)\r\n\r\n // const oldInstance = await this.del(tag)\r\n // const { module: newModule } = await this.buildDepModule(Model)\r\n\r\n // if (oldInstance && this.dependenceGraph.has(tag)) {\r\n // debug(`replace module \"${String(tag)}\"`);\r\n\r\n // [...this.dependenceGraph.get(tag)!].forEach((tag) => {\r\n // const module = this.moduleMap.get(tag)\r\n // for (const key in module) {\r\n // if (module[key] === oldInstance)\r\n // module[key] = newModule\r\n // }\r\n // })\r\n // }\r\n // }\r\n\r\n // async del(modelOrTag: Construct | PropertyKey) {\r\n // const tag = typeof modelOrTag === 'function' ? getTag(modelOrTag) : modelOrTag\r\n\r\n // if (!this.moduleMap.has(tag))\r\n // return\r\n\r\n // const module = this.moduleMap.get(tag)\r\n\r\n // debug(`unmount module \"${String(tag)}\"`)\r\n // await invokeUnmount(module)\r\n // debug(`del module \"${String(tag)}\"`)\r\n\r\n // this.moduleMap.delete(tag)\r\n // this.modelMap.delete(module)\r\n // for (let i = this.meta.length - 1; i >= 0; i--) {\r\n // if (this.meta[i].data.tag === tag)\r\n // this.meta.splice(i, 1)\r\n // }\r\n // return module\r\n // }\r\n\r\n async destroy() {\r\n debug('destroy all')\r\n\r\n this.replace(Object.values(this.modelMap), [])\r\n }\r\n\r\n createProxyModule(tag: PropertyKey) {\r\n // eslint-disable-next-line @typescript-eslint/no-this-alias\r\n const that = this\r\n return new Proxy({}, {\r\n get(_target, prop) {\r\n const module = that.moduleMap.get(tag)\r\n return Reflect.get(module, prop, module)\r\n },\r\n set(_target, prop, newValue) {\r\n const module = that.moduleMap.get(tag)\r\n\r\n return Reflect.set(module, prop, newValue, module)\r\n },\r\n has(_target, prop) {\r\n return Reflect.has(that.moduleMap.get(tag), prop)\r\n },\r\n ownKeys() {\r\n return Reflect.ownKeys(that.moduleMap.get(tag))\r\n },\r\n getPrototypeOf() {\r\n return Reflect.getPrototypeOf(that.moduleMap.get(tag))\r\n },\r\n getOwnPropertyDescriptor(_target, prop) {\r\n return Reflect.getOwnPropertyDescriptor(that.moduleMap.get(tag), prop)\r\n },\r\n })\r\n }\r\n\r\n protected async buildDepModule(Model: Construct) {\r\n const paramtypes = getParamTypes(Model) as Construct[]\r\n let module: InstanceType<Construct>\r\n const tag = getTag(Model)\r\n\r\n if (this.moduleMap.has(tag)) {\r\n module = this.moduleMap.get(tag)\r\n if (!module) {\r\n log(`Exist Circular-Dependency or Multiple modules with the same tag [${String(tag)}]`, 'warn')\r\n return { module: this.createProxyModule(tag), tag }\r\n }\r\n if (this.modelMap.get(module) !== Model && !this.modelSet.has(Model)) {\r\n this.modelSet.add(Model)// a module will only warn once\r\n\r\n if (module instanceof Model)\r\n log(`Module taged ${String(tag)} has been overridden`)// legal override\r\n else\r\n log(`Synonym module: Module taged \"${String(tag)}\" has been loaded before, so phecda-server won't load Module \"${Model.name}\"`, 'warn')\r\n }\r\n return { module, tag }\r\n }\r\n this.moduleMap.set(tag, undefined)\r\n debug(`instantiate module \"${String(tag)}\"`)\r\n\r\n if (paramtypes) {\r\n const paramtypesInstances = [] as any[]\r\n for (const i in paramtypes) {\r\n const { module: sub, tag: subTag } = await this.buildDepModule(paramtypes[i])\r\n paramtypesInstances[i] = sub\r\n if (!this.dependenceGraph.has(subTag))\r\n this.dependenceGraph.set(subTag, new Set())\r\n this.dependenceGraph.get(subTag)!.add(tag)\r\n }\r\n\r\n module = this.parseModule(new Model(...paramtypesInstances))\r\n }\r\n else {\r\n module = this.parseModule(new Model())\r\n }\r\n this.meta.push(...getMetaFromInstance(module, tag, Model.name).map(this.parseMeta).filter(item => !!item))\r\n\r\n debug(`init module \"${String(tag)}\"`)\r\n\r\n if (!IS_ONLY_GENERATE)// ??\r\n\r\n await invokeInit(module)\r\n\r\n debug(`add module \"${String(tag)}\"`)\r\n\r\n this.moduleMap.set(tag, module)\r\n this.modelMap.set(module, Model)\r\n return { module, tag }\r\n }\r\n\r\n async replace(oldModels: Construct[], newModels: Construct[]) {\r\n const oldModules = (await Promise.all(oldModels.map(async (model) => {\r\n const tag = getTag(model)\r\n if (!this.has(tag))\r\n return\r\n const module = this.moduleMap.get(tag)\r\n\r\n debug(`unmount module \"${String(tag)}\"`)\r\n await invokeUnmount(module)\r\n debug(`del module \"${String(tag)}\"`)\r\n\r\n this.moduleMap.delete(tag)\r\n this.modelMap.delete(module)\r\n for (let i = this.meta.length - 1; i >= 0; i--) {\r\n if (this.meta[i].data.tag === tag)\r\n this.meta.splice(i, 1)\r\n }\r\n return module\r\n }))).filter(item => item)\r\n\r\n for (const model of newModels) {\r\n debug(`mount module: ${model.name}`)\r\n await this.buildDepModule(model)\r\n }\r\n\r\n debug('replace old modules')\r\n\r\n for (const module of oldModules) {\r\n const tag = getTag(module)\r\n if (this.dependenceGraph.has(tag)) {\r\n [...this.dependenceGraph.get(tag)!].forEach((depTag) => {\r\n const depModule = this.moduleMap.get(depTag)\r\n\r\n if (depModule) {\r\n for (const key in depModule) {\r\n if (depModule[key] === module)\r\n depModule[key] = this.moduleMap.get(tag)\r\n }\r\n }\r\n })\r\n }\r\n }\r\n }\r\n\r\n has(modelOrTag: Construct | PropertyKey) {\r\n return this.moduleMap.has(typeof modelOrTag === 'function' ? getTag(modelOrTag) : modelOrTag)\r\n }\r\n\r\n get<Model extends Construct>(modelOrTag: Model | PropertyKey): InstanceType<Model> {\r\n const tag = typeof modelOrTag === 'function' ? getTag(modelOrTag) : modelOrTag\r\n if (!this.has(tag))\r\n throw new Error(`module \"${tag.toString()}\" doesn't exist`)\r\n return this.moduleMap.get(tag)\r\n }\r\n}\r\n\r\nexport async function Factory(models: Construct[], opts: Options = {}) {\r\n const phecda = new ServerPhecda(opts)\r\n await phecda.start(models)\r\n return phecda\r\n}\r\n\r\nexport function useS<Model extends Construct>(model: Model, namespace?: string): InstanceType<Model>\r\nexport function useS(namespace?: string): ServerPhecda\r\nexport function useS(nsOrModel?: Construct | string, namespace?: string) {\r\n if (!nsOrModel) {\r\n namespace = 'default'\r\n }\r\n else {\r\n if (typeof nsOrModel === 'string')\r\n namespace = nsOrModel\r\n else if (!namespace)\r\n namespace = 'default'\r\n }\r\n if (!phecdaNamespace.has(namespace))\r\n throw new Error(`namespace \"${namespace}\" doesn't exist`)\r\n const serverPhecda = phecdaNamespace.get(namespace)!\r\n if (nsOrModel && typeof nsOrModel !== 'string')\r\n return serverPhecda.get(nsOrModel)\r\n else\r\n\r\n return serverPhecda\r\n}\r\n\r\nfunction getMetaFromInstance(instance: Phecda, tag: PropertyKey, name: string) {\r\n const propertyKeys = getMetaKey(instance).filter(item => typeof item === 'string') as string[]\r\n const baseMeta = getMergedMeta(instance, undefined) as MetaData\r\n\r\n const ctxs = baseMeta.ctxs\r\n return propertyKeys.filter(i => typeof (instance as any)[i] === 'function').map((i) => {\r\n const meta = getMergedMeta(instance, i)\r\n const metaData = {\r\n ...meta,\r\n name,\r\n tag,\r\n func:\r\n i,\r\n } as MetaData\r\n if (baseMeta.controller) {\r\n if (typeof tag !== 'string')\r\n log(`can't use Tag with ${typeof tag} on controller \"${(instance as any).constructor.name}\",instead with \"${tag = String(tag)}\"`, 'error')\r\n metaData.controller = baseMeta.controller\r\n metaData[baseMeta.controller] = {\r\n ...baseMeta[baseMeta.controller],\r\n ...meta[baseMeta.controller],\r\n }\r\n\r\n const params = getMetaParams(instance, i).map(item => getMergedMeta(instance, i, item))\r\n params.forEach((item, index) => {\r\n if (!item.pipe)\r\n item.pipe = meta.pipe || baseMeta.pipe\r\n if (!item.define)\r\n item.define = {}\r\n item.index = index\r\n })\r\n\r\n metaData.ctxs = ctxs\r\n metaData.params = params\r\n metaData.filter = meta.filter || baseMeta.filter\r\n metaData.define = { ...baseMeta.define, ...meta.define }\r\n\r\n for (const item of ['addons', 'guards']) {\r\n const set = new Set<string>(baseMeta[item])\r\n if (meta[item]) {\r\n meta[item].forEach((part: string) => {\r\n set.delete(part)\r\n set.add(part)\r\n })\r\n }\r\n\r\n metaData[item] = [...set]\r\n }\r\n\r\n // metaData.addons = [...new Set([...baseMeta.addons, ...meta.addons])]\r\n // metaData.guards = [...new Set([...baseMeta.guards, ...meta.guards])]\r\n // metaData.interceptors = [...new Set([...baseMeta.interceptors, ...meta.interceptors])]\r\n }\r\n return new Meta(deepFreeze(metaData as MetaData), getParamTypes(instance, i as string) || [])\r\n })\r\n}\r\n\r\nfunction deepFreeze<T extends Record<string, any>>(object: T): T {\r\n // 先冻结对象本身\r\n Object.freeze(object)\r\n\r\n // 获取对象的所有属性名\r\n Object.getOwnPropertyNames(object).forEach((prop) => {\r\n // 如果属性是对象,并且没有被冻结,则递归冻结\r\n if (object[prop] !== null\r\n && (typeof object[prop] === 'object' || typeof object[prop] === 'function')\r\n && !Object.isFrozen(object[prop]))\r\n deepFreeze(object[prop])\r\n })\r\n\r\n return object\r\n}\r\nfunction getParamTypes(Model: any, key?: string | symbol) {\r\n const paramTypes = Reflect.getMetadata('design:paramtypes', Model, key!)\r\n if (typeof paramTypes === 'function')// work with loader to handle Circular-Dependency\r\n return paramTypes()\r\n\r\n else return paramTypes\r\n}\r\n"],"mappings":";;;;;;;;;AAkCO,IAAMA,OAAN,MAAMA;EAAb,OAA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O3D,IAAAA,MAAU,YAAY,OAAO2D,OAAO3D,IAAAA,MAAU,eAC7D,CAACR,OAAOsE,SAASH,OAAO3D,IAAAA,CAAK,EAChC0D,YAAWC,OAAO3D,IAAAA,CAAK;EAC3B,CAAA;AAEA,SAAO2D;AACT;AAdSD;AAeT,SAASjD,cAAcF,OAAY0B,KAAqB;AACtD,QAAM8B,aAAa9D,QAAQ+D,YAAY,qBAAqBzD,OAAO0B,GAAAA;AACnE,MAAI,OAAO8B,eAAe,WACxB,QAAOA,WAAAA;MAEJ,QAAOA;AACd;AANStD;","names":["Meta","constructor","data","paramsType","EventEmitter","getInject","getMergedMeta","getMetaKey","getMetaParams","getTag","invokeInit","invokeUnmount","setInject","Debug","debug","Debug","emitter","EventEmitter","defaultServerInject","getInject","setInject","eventName","instance","property","options","fn","bind","v","once","on","off","phecdaNamespace","Map","ServerPhecda","moduleMap","meta","modelMap","WeakMap","modelSet","WeakSet","dependenceGraph","parseModule","parseMeta","generators","constructor","namespace","module","set","start","models","model","buildDepModule","hmr","generateCode","then","IS_ONLY_GENERATE","log","process","exit","PS_EXIT_CODE","EXIT","Promise","all","map","generator","name","path","output","HMR","oldModels","newModels","replace","destroy","Object","values","createProxyModule","tag","that","Proxy","get","_target","prop","Reflect","newValue","has","ownKeys","getPrototypeOf","getOwnPropertyDescriptor","Model","paramtypes","getParamTypes","getTag","String","add","undefined","paramtypesInstances","i","sub","subTag","Set","push","getMetaFromInstance","filter","item","invokeInit","oldModules","invokeUnmount","delete","length","data","splice","forEach","depTag","depModule","key","modelOrTag","Error","toString","Factory","opts","phecda","useS","nsOrModel","serverPhecda","propertyKeys","getMetaKey","baseMeta","getMergedMeta","ctxs","metaData","func","controller","params","getMetaParams","index","pipe","define","part","Meta","deepFreeze","object","freeze","getOwnPropertyNames","isFrozen","paramTypes","getMetadata"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkRLFCI3RGjs = require('./chunk-RLFCI3RG.js');
|
|
4
4
|
|
|
5
5
|
// src/decorators/param.ts
|
|
6
6
|
var _phecdacore = require('phecda-core');
|
|
@@ -10,42 +10,56 @@ function BaseParam(data) {
|
|
|
10
10
|
_phecdacore.setMeta.call(void 0, target, property, index, data);
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
_chunkRLFCI3RGjs.__name.call(void 0, BaseParam, "BaseParam");
|
|
14
14
|
function Body(key = "") {
|
|
15
15
|
return BaseParam({
|
|
16
16
|
type: "body",
|
|
17
17
|
key
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Body, "Body");
|
|
21
21
|
function Head(key) {
|
|
22
22
|
return BaseParam({
|
|
23
23
|
type: "headers",
|
|
24
24
|
key: key.toLowerCase()
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Head, "Head");
|
|
28
28
|
function Query(key = "") {
|
|
29
29
|
return BaseParam({
|
|
30
30
|
type: "query",
|
|
31
31
|
key
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Query, "Query");
|
|
35
35
|
function Param(key) {
|
|
36
36
|
return BaseParam({
|
|
37
37
|
type: "params",
|
|
38
38
|
key
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Param, "Param");
|
|
42
42
|
function Arg(target, k, index) {
|
|
43
43
|
BaseParam({
|
|
44
44
|
type: "args",
|
|
45
45
|
key: `${index}`
|
|
46
46
|
})(target, k, index);
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Arg, "Arg");
|
|
49
|
+
function OneFile(key = "") {
|
|
50
|
+
return BaseParam({
|
|
51
|
+
type: "file",
|
|
52
|
+
key
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
_chunkRLFCI3RGjs.__name.call(void 0, OneFile, "OneFile");
|
|
56
|
+
function ManyFiles(key = "") {
|
|
57
|
+
return BaseParam({
|
|
58
|
+
type: "files",
|
|
59
|
+
key
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
_chunkRLFCI3RGjs.__name.call(void 0, ManyFiles, "ManyFiles");
|
|
49
63
|
|
|
50
64
|
// src/decorators/aop.ts
|
|
51
65
|
|
|
@@ -56,7 +70,7 @@ function Guard(...guards) {
|
|
|
56
70
|
});
|
|
57
71
|
};
|
|
58
72
|
}
|
|
59
|
-
|
|
73
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Guard, "Guard");
|
|
60
74
|
function Addon(...addons) {
|
|
61
75
|
return (target, property) => {
|
|
62
76
|
_phecdacore.setMeta.call(void 0, target, property, void 0, {
|
|
@@ -64,7 +78,7 @@ function Addon(...addons) {
|
|
|
64
78
|
});
|
|
65
79
|
};
|
|
66
80
|
}
|
|
67
|
-
|
|
81
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Addon, "Addon");
|
|
68
82
|
function Filter(filter) {
|
|
69
83
|
return (target, property) => {
|
|
70
84
|
_phecdacore.setMeta.call(void 0, target, property, void 0, {
|
|
@@ -72,7 +86,7 @@ function Filter(filter) {
|
|
|
72
86
|
});
|
|
73
87
|
};
|
|
74
88
|
}
|
|
75
|
-
|
|
89
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Filter, "Filter");
|
|
76
90
|
function Pipe(pipe) {
|
|
77
91
|
return (target, property, index) => {
|
|
78
92
|
if (typeof index === "number") {
|
|
@@ -86,7 +100,7 @@ function Pipe(pipe) {
|
|
|
86
100
|
});
|
|
87
101
|
};
|
|
88
102
|
}
|
|
89
|
-
|
|
103
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Pipe, "Pipe");
|
|
90
104
|
|
|
91
105
|
// src/decorators/http.ts
|
|
92
106
|
|
|
@@ -100,7 +114,7 @@ function Route(route, type) {
|
|
|
100
114
|
});
|
|
101
115
|
};
|
|
102
116
|
}
|
|
103
|
-
|
|
117
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Route, "Route");
|
|
104
118
|
function Header(headers) {
|
|
105
119
|
return (target, property) => {
|
|
106
120
|
_phecdacore.setMeta.call(void 0, target, property, void 0, {
|
|
@@ -110,31 +124,31 @@ function Header(headers) {
|
|
|
110
124
|
});
|
|
111
125
|
};
|
|
112
126
|
}
|
|
113
|
-
|
|
127
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Header, "Header");
|
|
114
128
|
function Get(route = "") {
|
|
115
129
|
return Route(route, "get");
|
|
116
130
|
}
|
|
117
|
-
|
|
131
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Get, "Get");
|
|
118
132
|
function Post(route = "") {
|
|
119
133
|
return Route(route, "post");
|
|
120
134
|
}
|
|
121
|
-
|
|
135
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Post, "Post");
|
|
122
136
|
function Put(route = "") {
|
|
123
137
|
return Route(route, "put");
|
|
124
138
|
}
|
|
125
|
-
|
|
139
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Put, "Put");
|
|
126
140
|
function Search(route = "") {
|
|
127
141
|
return Route(route, "search");
|
|
128
142
|
}
|
|
129
|
-
|
|
143
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Search, "Search");
|
|
130
144
|
function Patch(route = "") {
|
|
131
145
|
return Route(route, "patch");
|
|
132
146
|
}
|
|
133
|
-
|
|
147
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Patch, "Patch");
|
|
134
148
|
function Delete(route = "") {
|
|
135
149
|
return Route(route, "delete");
|
|
136
150
|
}
|
|
137
|
-
|
|
151
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Delete, "Delete");
|
|
138
152
|
function Controller(prefix = "") {
|
|
139
153
|
return (target) => {
|
|
140
154
|
_phecdacore.setMeta.call(void 0, target, void 0, void 0, {
|
|
@@ -145,7 +159,7 @@ function Controller(prefix = "") {
|
|
|
145
159
|
});
|
|
146
160
|
};
|
|
147
161
|
}
|
|
148
|
-
|
|
162
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Controller, "Controller");
|
|
149
163
|
|
|
150
164
|
// src/decorators/rpc.ts
|
|
151
165
|
|
|
@@ -159,7 +173,7 @@ function Queue(queue = "", isEvent) {
|
|
|
159
173
|
});
|
|
160
174
|
};
|
|
161
175
|
}
|
|
162
|
-
|
|
176
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Queue, "Queue");
|
|
163
177
|
function Rpc() {
|
|
164
178
|
return (target) => {
|
|
165
179
|
_phecdacore.setMeta.call(void 0, target, void 0, void 0, {
|
|
@@ -167,11 +181,11 @@ function Rpc() {
|
|
|
167
181
|
});
|
|
168
182
|
};
|
|
169
183
|
}
|
|
170
|
-
|
|
184
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Rpc, "Rpc");
|
|
171
185
|
|
|
172
186
|
// src/decorators/ctx.ts
|
|
173
187
|
|
|
174
|
-
var Ctx = /* @__PURE__ */
|
|
188
|
+
var Ctx = /* @__PURE__ */ _chunkRLFCI3RGjs.__name.call(void 0, (target, property) => {
|
|
175
189
|
_phecdacore.setMeta.call(void 0, target, _phecdacore.SHARE_KEY, void 0, {
|
|
176
190
|
ctxs: [
|
|
177
191
|
property
|
|
@@ -200,7 +214,9 @@ function Define(key, value) {
|
|
|
200
214
|
}
|
|
201
215
|
};
|
|
202
216
|
}
|
|
203
|
-
|
|
217
|
+
_chunkRLFCI3RGjs.__name.call(void 0, Define, "Define");
|
|
218
|
+
|
|
219
|
+
|
|
204
220
|
|
|
205
221
|
|
|
206
222
|
|
|
@@ -226,4 +242,5 @@ _chunkVSGYTGHYjs.__name.call(void 0, Define, "Define");
|
|
|
226
242
|
|
|
227
243
|
|
|
228
244
|
|
|
229
|
-
exports.BaseParam = BaseParam; exports.Body = Body; exports.Head = Head; exports.Query = Query; exports.Param = Param; exports.Arg = Arg; exports.Guard = Guard; exports.Addon = Addon; exports.Filter = Filter; exports.Pipe = Pipe; exports.Route = Route; exports.Header = Header; exports.Get = Get; exports.Post = Post; exports.Put = Put; exports.Search = Search; exports.Patch = Patch; exports.Delete = Delete; exports.Controller = Controller; exports.Queue = Queue; exports.Rpc = Rpc; exports.Ctx = Ctx; exports.Define = Define;
|
|
245
|
+
exports.BaseParam = BaseParam; exports.Body = Body; exports.Head = Head; exports.Query = Query; exports.Param = Param; exports.Arg = Arg; exports.OneFile = OneFile; exports.ManyFiles = ManyFiles; exports.Guard = Guard; exports.Addon = Addon; exports.Filter = Filter; exports.Pipe = Pipe; exports.Route = Route; exports.Header = Header; exports.Get = Get; exports.Post = Post; exports.Put = Put; exports.Search = Search; exports.Patch = Patch; exports.Delete = Delete; exports.Controller = Controller; exports.Queue = Queue; exports.Rpc = Rpc; exports.Ctx = Ctx; exports.Define = Define;
|
|
246
|
+
//# sourceMappingURL=chunk-EDAWJVJ4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["d:\\myproject\\phecda\\packages\\server\\dist\\chunk-EDAWJVJ4.js"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACA;AACA,yCAAqC;AACrC,SAAS,SAAS,CAAC,IAAI,EAAE;AACzB,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG;AACtC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM;AACzB,IAAI,iCAAO,MAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC;AAC1C,EAAE,CAAC;AACH;AACA,qCAAM,SAAU,EAAE,WAAW,CAAC;AAC9B,SAAS,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE;AACxB,EAAE,OAAO,SAAS,CAAC;AACnB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI;AACJ,EAAE,CAAC,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ACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA;AACA;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,MAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,UAAA;AACA,YAAA;AACA,cAAA;AACA,YAAA;AACA,YAAA;AACA,UAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,UAAA;AACA,QAAA;AACA,MAAA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"D:\\myproject\\phecda\\packages\\server\\dist\\chunk-EDAWJVJ4.js","sourcesContent":[null]}
|