phecda-server 5.0.0-alpha.16 → 5.0.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-CPTMTSPU.mjs → chunk-EASQZ4RI.mjs} +4 -6
- package/dist/{chunk-CRAV4WSB.js → chunk-EVF2CXTP.js} +3 -3
- package/dist/{chunk-RQOJIVQM.js → chunk-JQOV7JUD.js} +21 -23
- package/dist/{chunk-6FRXLKGA.mjs → chunk-N7GEBDPZ.mjs} +1 -1
- package/dist/{chunk-MGHJFKVZ.mjs → chunk-P57NA4BR.mjs} +1 -1
- package/dist/{chunk-ONUMVNO7.mjs → chunk-UFSW7A6B.mjs} +3 -3
- package/dist/{chunk-VUOACQPJ.js → chunk-XAFRQQNM.js} +52 -52
- package/dist/{chunk-T4C6CCWM.js → chunk-XHKBG2VA.js} +3 -3
- package/dist/{core-b8dcc009.d.ts → core-eb2a0799.d.ts} +1 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.js +79 -79
- package/dist/index.mjs +30 -30
- package/dist/rpc/kafka/index.d.ts +1 -1
- package/dist/rpc/kafka/index.js +9 -9
- package/dist/rpc/kafka/index.mjs +2 -2
- package/dist/rpc/rabbitmq/index.d.ts +1 -1
- package/dist/rpc/rabbitmq/index.js +9 -9
- package/dist/rpc/rabbitmq/index.mjs +2 -2
- package/dist/rpc/redis/index.d.ts +1 -1
- package/dist/rpc/redis/index.js +9 -9
- package/dist/rpc/redis/index.mjs +2 -2
- package/dist/server/express/index.d.ts +2 -1
- package/dist/server/express/index.js +32 -32
- package/dist/server/express/index.mjs +10 -10
- package/dist/server/fastify/index.d.ts +1 -1
- package/dist/server/fastify/index.js +27 -29
- package/dist/server/fastify/index.mjs +5 -7
- package/dist/server/h3/index.d.ts +1 -1
- package/dist/server/h3/index.js +26 -28
- package/dist/server/h3/index.mjs +5 -7
- package/dist/server/koa/index.d.ts +2 -1
- package/dist/server/koa/index.js +32 -32
- package/dist/server/koa/index.mjs +10 -10
- package/dist/test.d.ts +1 -1
- package/dist/test.js +6 -6
- package/dist/test.mjs +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkJQOV7JUDjs = require('./chunk-JQOV7JUD.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkEVF2CXTPjs = require('./chunk-EVF2CXTP.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -35,7 +35,7 @@ var _chunkCRAV4WSBjs = require('./chunk-CRAV4WSB.js');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunkXAFRQQNMjs = require('./chunk-XAFRQQNM.js');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -53,7 +53,7 @@ var _chunkVUOACQPJjs = require('./chunk-VUOACQPJ.js');
|
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
var
|
|
56
|
+
var _chunkXHKBG2VAjs = require('./chunk-XHKBG2VA.js');
|
|
57
57
|
|
|
58
58
|
// src/decorators/index.ts
|
|
59
59
|
var _phecdacore = require('phecda-core'); _createStarExport(_phecdacore);
|
|
@@ -62,8 +62,8 @@ var _phecdacore = require('phecda-core'); _createStarExport(_phecdacore);
|
|
|
62
62
|
|
|
63
63
|
function BaseParam(type, key) {
|
|
64
64
|
return (target, k, index) => {
|
|
65
|
-
_phecdacore.
|
|
66
|
-
const state =
|
|
65
|
+
_phecdacore.setStateVar.call(void 0, target, k);
|
|
66
|
+
const state = _phecdacore.getOwnState.call(void 0, target, k);
|
|
67
67
|
if (!state.params)
|
|
68
68
|
state.params = [];
|
|
69
69
|
const existItem = state.params.find((item) => item.index === index);
|
|
@@ -81,11 +81,11 @@ function BaseParam(type, key) {
|
|
|
81
81
|
_phecdacore.setState.call(void 0, target, k, state);
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
_chunkXHKBG2VAjs.__name.call(void 0, BaseParam, "BaseParam");
|
|
85
85
|
function Pipe(key, opts) {
|
|
86
86
|
return (target, k, index) => {
|
|
87
|
-
_phecdacore.
|
|
88
|
-
const state =
|
|
87
|
+
_phecdacore.setStateVar.call(void 0, target, k);
|
|
88
|
+
const state = _phecdacore.getOwnState.call(void 0, target, k);
|
|
89
89
|
if (!state.params)
|
|
90
90
|
state.params = [];
|
|
91
91
|
const existItem = state.params.find((item) => item.index === index);
|
|
@@ -103,27 +103,27 @@ function Pipe(key, opts) {
|
|
|
103
103
|
_phecdacore.setState.call(void 0, target, k, state);
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Pipe, "Pipe");
|
|
107
107
|
function Body(key = "") {
|
|
108
108
|
return BaseParam("body", key);
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Body, "Body");
|
|
111
111
|
function Head(key) {
|
|
112
112
|
return BaseParam("headers", key.toLowerCase());
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Head, "Head");
|
|
115
115
|
function Query(key = "") {
|
|
116
116
|
return BaseParam("query", key);
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Query, "Query");
|
|
119
119
|
function Param(key) {
|
|
120
120
|
return BaseParam("params", key);
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Param, "Param");
|
|
123
123
|
function Arg() {
|
|
124
124
|
return BaseParam("params", "");
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Arg, "Arg");
|
|
127
127
|
|
|
128
128
|
// src/decorators/route.ts
|
|
129
129
|
|
|
@@ -132,8 +132,8 @@ function Route(route, type) {
|
|
|
132
132
|
if (!key)
|
|
133
133
|
key = _phecdacore.SHARE_KEY;
|
|
134
134
|
target = key === _phecdacore.SHARE_KEY ? target.prototype : target;
|
|
135
|
-
_phecdacore.
|
|
136
|
-
const state =
|
|
135
|
+
_phecdacore.setStateVar.call(void 0, target, key);
|
|
136
|
+
const state = _phecdacore.getOwnState.call(void 0, target, key);
|
|
137
137
|
state.http = {
|
|
138
138
|
route,
|
|
139
139
|
type
|
|
@@ -141,59 +141,59 @@ function Route(route, type) {
|
|
|
141
141
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Route, "Route");
|
|
145
145
|
function Get(route = "") {
|
|
146
146
|
return Route(route, "get");
|
|
147
147
|
}
|
|
148
|
-
|
|
148
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Get, "Get");
|
|
149
149
|
function Post(route = "") {
|
|
150
150
|
return Route(route, "post");
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Post, "Post");
|
|
153
153
|
function Put(route = "") {
|
|
154
154
|
return Route(route, "put");
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Put, "Put");
|
|
157
157
|
function Patch(route = "") {
|
|
158
158
|
return Route(route, "patch");
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Patch, "Patch");
|
|
161
161
|
function Delete(route = "") {
|
|
162
162
|
return Route(route, "delete");
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Delete, "Delete");
|
|
165
165
|
function Controller(route = "") {
|
|
166
166
|
return Route(route);
|
|
167
167
|
}
|
|
168
|
-
|
|
168
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Controller, "Controller");
|
|
169
169
|
function Rpc(...types) {
|
|
170
170
|
return (target, key) => {
|
|
171
171
|
if (!key)
|
|
172
172
|
key = _phecdacore.SHARE_KEY;
|
|
173
173
|
target = key === _phecdacore.SHARE_KEY ? target.prototype : target;
|
|
174
|
-
_phecdacore.
|
|
175
|
-
const state =
|
|
174
|
+
_phecdacore.setStateVar.call(void 0, target, key);
|
|
175
|
+
const state = _phecdacore.getOwnState.call(void 0, target, key);
|
|
176
176
|
if (!state.rpc)
|
|
177
177
|
state.rpc = {};
|
|
178
178
|
state.rpc.type = types;
|
|
179
179
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Rpc, "Rpc");
|
|
183
183
|
function Event(isEvent = true) {
|
|
184
184
|
return (target, key) => {
|
|
185
185
|
if (!key)
|
|
186
186
|
key = _phecdacore.SHARE_KEY;
|
|
187
187
|
target = key === _phecdacore.SHARE_KEY ? target.prototype : target;
|
|
188
|
-
_phecdacore.
|
|
189
|
-
const state =
|
|
188
|
+
_phecdacore.setStateVar.call(void 0, target, key);
|
|
189
|
+
const state = _phecdacore.getOwnState.call(void 0, target, key);
|
|
190
190
|
if (!state.rpc)
|
|
191
191
|
state.rpc = {};
|
|
192
192
|
state.rpc.isEvent = isEvent;
|
|
193
193
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Event, "Event");
|
|
197
197
|
|
|
198
198
|
// src/decorators/aop.ts
|
|
199
199
|
|
|
@@ -202,83 +202,83 @@ function Guard(...guards) {
|
|
|
202
202
|
if (!key)
|
|
203
203
|
key = _phecdacore.SHARE_KEY;
|
|
204
204
|
target = key === _phecdacore.SHARE_KEY ? target.prototype : target;
|
|
205
|
-
_phecdacore.
|
|
206
|
-
const state =
|
|
205
|
+
_phecdacore.setStateVar.call(void 0, target, key);
|
|
206
|
+
const state = _phecdacore.getOwnState.call(void 0, target, key);
|
|
207
207
|
if (!state.guards)
|
|
208
208
|
state.guards = [];
|
|
209
209
|
state.guards.push(...guards);
|
|
210
210
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
|
|
213
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Guard, "Guard");
|
|
214
214
|
function Plugin(...plugins) {
|
|
215
215
|
return (target, key) => {
|
|
216
216
|
if (!key)
|
|
217
217
|
key = _phecdacore.SHARE_KEY;
|
|
218
218
|
target = key === _phecdacore.SHARE_KEY ? target.prototype : target;
|
|
219
|
-
_phecdacore.
|
|
220
|
-
const state =
|
|
219
|
+
_phecdacore.setStateVar.call(void 0, target, key);
|
|
220
|
+
const state = _phecdacore.getOwnState.call(void 0, target, key);
|
|
221
221
|
if (!state.plugins)
|
|
222
222
|
state.plugins = [];
|
|
223
223
|
state.plugins.push(...plugins);
|
|
224
224
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
-
|
|
227
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Plugin, "Plugin");
|
|
228
228
|
function Interceptor(...interceptors) {
|
|
229
229
|
return (target, key) => {
|
|
230
230
|
if (!key)
|
|
231
231
|
key = _phecdacore.SHARE_KEY;
|
|
232
232
|
target = key === _phecdacore.SHARE_KEY ? target.prototype : target;
|
|
233
|
-
_phecdacore.
|
|
234
|
-
const state =
|
|
233
|
+
_phecdacore.setStateVar.call(void 0, target, key);
|
|
234
|
+
const state = _phecdacore.getOwnState.call(void 0, target, key);
|
|
235
235
|
if (!state.interceptors)
|
|
236
236
|
state.interceptors = [];
|
|
237
237
|
state.interceptors.push(...interceptors);
|
|
238
238
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
|
-
|
|
241
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Interceptor, "Interceptor");
|
|
242
242
|
function Filter(filter) {
|
|
243
243
|
return (target, key) => {
|
|
244
244
|
if (!key)
|
|
245
245
|
key = _phecdacore.SHARE_KEY;
|
|
246
246
|
target = key === _phecdacore.SHARE_KEY ? target.prototype : target;
|
|
247
|
-
_phecdacore.
|
|
248
|
-
const state =
|
|
247
|
+
_phecdacore.setStateVar.call(void 0, target, key);
|
|
248
|
+
const state = _phecdacore.getOwnState.call(void 0, target, key);
|
|
249
249
|
state.filter = filter;
|
|
250
250
|
_phecdacore.setState.call(void 0, target, key, state);
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
-
|
|
253
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Filter, "Filter");
|
|
254
254
|
|
|
255
255
|
// src/decorators/index.ts
|
|
256
256
|
function Header(name, value) {
|
|
257
257
|
return (target, k) => {
|
|
258
|
-
_phecdacore.
|
|
259
|
-
const state =
|
|
258
|
+
_phecdacore.setStateVar.call(void 0, target, k);
|
|
259
|
+
const state = _phecdacore.getOwnState.call(void 0, target, k);
|
|
260
260
|
if (!state.header)
|
|
261
261
|
state.header = {};
|
|
262
262
|
state.header[name] = value;
|
|
263
263
|
_phecdacore.setState.call(void 0, target, k, state);
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
|
-
|
|
266
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Header, "Header");
|
|
267
267
|
function Define(key, value) {
|
|
268
268
|
return (target, k) => {
|
|
269
269
|
if (!k) {
|
|
270
270
|
k = _phecdacore.SHARE_KEY;
|
|
271
271
|
target = target.prototype;
|
|
272
272
|
}
|
|
273
|
-
_phecdacore.
|
|
274
|
-
const state =
|
|
273
|
+
_phecdacore.setStateVar.call(void 0, target, k);
|
|
274
|
+
const state = _phecdacore.getOwnState.call(void 0, target, k);
|
|
275
275
|
if (!state.define)
|
|
276
276
|
state.define = {};
|
|
277
277
|
state.define[key] = value;
|
|
278
278
|
_phecdacore.setState.call(void 0, target, k, state);
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
|
-
|
|
281
|
+
_chunkXHKBG2VAjs.__name.call(void 0, Define, "Define");
|
|
282
282
|
|
|
283
283
|
// src/index.ts
|
|
284
284
|
|
|
@@ -299,14 +299,14 @@ var __metadata = function(k, v) {
|
|
|
299
299
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
300
300
|
return Reflect.metadata(k, v);
|
|
301
301
|
};
|
|
302
|
-
var Dev = /* @__PURE__ */
|
|
303
|
-
__init() {this[
|
|
302
|
+
var Dev = /* @__PURE__ */ _chunkXHKBG2VAjs.__name.call(void 0, (_class =class Dev2 {constructor() { _class.prototype.__init.call(this); }
|
|
303
|
+
__init() {this[_chunkXHKBG2VAjs.UNMOUNT_SYMBOL] = []}
|
|
304
304
|
|
|
305
305
|
onUnmount(cb) {
|
|
306
|
-
this[
|
|
306
|
+
this[_chunkXHKBG2VAjs.UNMOUNT_SYMBOL].push(cb);
|
|
307
307
|
}
|
|
308
308
|
async unmount() {
|
|
309
|
-
for (const cb of this[
|
|
309
|
+
for (const cb of this[_chunkXHKBG2VAjs.UNMOUNT_SYMBOL])
|
|
310
310
|
await cb();
|
|
311
311
|
}
|
|
312
312
|
}, _class), "Dev");
|
|
@@ -326,13 +326,13 @@ var PFilter = class extends Dev {
|
|
|
326
326
|
constructor(tag) {
|
|
327
327
|
super();
|
|
328
328
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
329
|
-
|
|
329
|
+
_chunkXAFRQQNMjs.addFilter.call(void 0, this.key, this.use.bind(this));
|
|
330
330
|
this.onUnmount(() => {
|
|
331
|
-
delete
|
|
331
|
+
delete _chunkXAFRQQNMjs.Context.filterRecord[this.key];
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
334
|
};
|
|
335
|
-
|
|
335
|
+
_chunkXHKBG2VAjs.__name.call(void 0, PFilter, "PFilter");
|
|
336
336
|
|
|
337
337
|
// src/modules/guard.ts
|
|
338
338
|
|
|
@@ -341,13 +341,13 @@ var PGuard = class extends Dev {
|
|
|
341
341
|
constructor(tag) {
|
|
342
342
|
super();
|
|
343
343
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
344
|
-
|
|
344
|
+
_chunkXAFRQQNMjs.addGuard.call(void 0, this.key, this.use.bind(this));
|
|
345
345
|
this.onUnmount(() => {
|
|
346
|
-
delete
|
|
346
|
+
delete _chunkXAFRQQNMjs.Context.guardRecord[this.key];
|
|
347
347
|
});
|
|
348
348
|
}
|
|
349
349
|
};
|
|
350
|
-
|
|
350
|
+
_chunkXHKBG2VAjs.__name.call(void 0, PGuard, "PGuard");
|
|
351
351
|
|
|
352
352
|
// src/modules/interceptor.ts
|
|
353
353
|
|
|
@@ -357,12 +357,12 @@ var PInterceptor = class extends Dev {
|
|
|
357
357
|
super();
|
|
358
358
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
359
359
|
this.onUnmount(() => {
|
|
360
|
-
delete
|
|
360
|
+
delete _chunkXAFRQQNMjs.Context.interceptorRecord[this.key];
|
|
361
361
|
});
|
|
362
|
-
|
|
362
|
+
_chunkXAFRQQNMjs.addInterceptor.call(void 0, this.key, this.use.bind(this));
|
|
363
363
|
}
|
|
364
364
|
};
|
|
365
|
-
|
|
365
|
+
_chunkXHKBG2VAjs.__name.call(void 0, PInterceptor, "PInterceptor");
|
|
366
366
|
|
|
367
367
|
// src/modules/pipe.ts
|
|
368
368
|
|
|
@@ -371,13 +371,13 @@ var PPipe = class extends Dev {
|
|
|
371
371
|
constructor(tag) {
|
|
372
372
|
super();
|
|
373
373
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
374
|
-
|
|
374
|
+
_chunkXAFRQQNMjs.addPipe.call(void 0, this.key, this.use.bind(this));
|
|
375
375
|
this.onUnmount(() => {
|
|
376
|
-
delete
|
|
376
|
+
delete _chunkXAFRQQNMjs.Context.pipeRecord[this.key];
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
|
-
|
|
380
|
+
_chunkXHKBG2VAjs.__name.call(void 0, PPipe, "PPipe");
|
|
381
381
|
|
|
382
382
|
// src/modules/plugin.ts
|
|
383
383
|
|
|
@@ -386,13 +386,13 @@ var PPlugin = class extends Dev {
|
|
|
386
386
|
constructor(tag) {
|
|
387
387
|
super();
|
|
388
388
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
389
|
-
|
|
389
|
+
_chunkXAFRQQNMjs.addPlugin.call(void 0, this.key, this.use.bind(this));
|
|
390
390
|
this.onUnmount(() => {
|
|
391
|
-
delete
|
|
391
|
+
delete _chunkXAFRQQNMjs.Context.pluginRecord[this.key];
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
394
|
};
|
|
395
|
-
|
|
395
|
+
_chunkXHKBG2VAjs.__name.call(void 0, PPlugin, "PPlugin");
|
|
396
396
|
|
|
397
397
|
// src/modules/extension.ts
|
|
398
398
|
|
|
@@ -402,38 +402,38 @@ var PExtension = class extends Dev {
|
|
|
402
402
|
super();
|
|
403
403
|
const key = this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
404
404
|
if (this.pipe) {
|
|
405
|
-
|
|
405
|
+
_chunkXAFRQQNMjs.addPipe.call(void 0, key, this.pipe.bind(this));
|
|
406
406
|
this.onUnmount(() => {
|
|
407
|
-
delete
|
|
407
|
+
delete _chunkXAFRQQNMjs.Context.pipeRecord[key];
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
410
|
if (this.plugin) {
|
|
411
|
-
|
|
411
|
+
_chunkXAFRQQNMjs.addPlugin.call(void 0, key, this.plugin.bind(this));
|
|
412
412
|
this.onUnmount(() => {
|
|
413
|
-
delete
|
|
413
|
+
delete _chunkXAFRQQNMjs.Context.pluginRecord[key];
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
416
|
if (this.intercept) {
|
|
417
|
-
|
|
417
|
+
_chunkXAFRQQNMjs.addInterceptor.call(void 0, key, this.intercept.bind(this));
|
|
418
418
|
this.onUnmount(() => {
|
|
419
|
-
delete
|
|
419
|
+
delete _chunkXAFRQQNMjs.Context.interceptorRecord[key];
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
422
|
if (this.guard) {
|
|
423
|
-
|
|
423
|
+
_chunkXAFRQQNMjs.addGuard.call(void 0, key, this.guard.bind(this));
|
|
424
424
|
this.onUnmount(() => {
|
|
425
|
-
delete
|
|
425
|
+
delete _chunkXAFRQQNMjs.Context.guardRecord[key];
|
|
426
426
|
});
|
|
427
427
|
}
|
|
428
428
|
if (this.filter) {
|
|
429
|
-
|
|
429
|
+
_chunkXAFRQQNMjs.addFilter.call(void 0, key, this.filter.bind(this));
|
|
430
430
|
this.onUnmount(() => {
|
|
431
|
-
delete
|
|
431
|
+
delete _chunkXAFRQQNMjs.Context.filterRecord[key];
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
};
|
|
436
|
-
|
|
436
|
+
_chunkXHKBG2VAjs.__name.call(void 0, PExtension, "PExtension");
|
|
437
437
|
|
|
438
438
|
|
|
439
439
|
|
|
@@ -511,4 +511,4 @@ _chunkT4C6CCWMjs.__name.call(void 0, PExtension, "PExtension");
|
|
|
511
511
|
|
|
512
512
|
|
|
513
513
|
|
|
514
|
-
exports.APP_SYMBOL =
|
|
514
|
+
exports.APP_SYMBOL = _chunkXHKBG2VAjs.APP_SYMBOL; exports.Arg = Arg; exports.BadGatewayException = _chunkXAFRQQNMjs.BadGatewayException; exports.BadRequestException = _chunkXAFRQQNMjs.BadRequestException; exports.BaseParam = BaseParam; exports.Body = Body; exports.ConflictException = _chunkXAFRQQNMjs.ConflictException; exports.Context = _chunkXAFRQQNMjs.Context; exports.Controller = Controller; exports.Define = Define; exports.Delete = Delete; exports.Dev = Dev; exports.ERROR_SYMBOL = _chunkXHKBG2VAjs.ERROR_SYMBOL; exports.Event = Event; exports.Exception = _chunkXAFRQQNMjs.Exception; exports.Factory = _chunkJQOV7JUDjs.Factory; exports.Filter = Filter; exports.ForbiddenException = _chunkXAFRQQNMjs.ForbiddenException; exports.FrameworkException = _chunkXAFRQQNMjs.FrameworkException; exports.Get = Get; exports.Guard = Guard; exports.Head = Head; exports.Header = Header; exports.IS_DEV = _chunkXHKBG2VAjs.IS_DEV; exports.IS_LOG_BAN = _chunkXHKBG2VAjs.IS_LOG_BAN; exports.IS_STRICT = _chunkXHKBG2VAjs.IS_STRICT; exports.Injectable = _chunkJQOV7JUDjs.Injectable; exports.Interceptor = Interceptor; exports.InvalidInputException = _chunkXAFRQQNMjs.InvalidInputException; exports.MERGE_SYMBOL = _chunkXHKBG2VAjs.MERGE_SYMBOL; exports.META_SYMBOL = _chunkXHKBG2VAjs.META_SYMBOL; exports.MODULE_SYMBOL = _chunkXHKBG2VAjs.MODULE_SYMBOL; exports.Meta = _chunkJQOV7JUDjs.Meta; exports.Mix = _chunkXHKBG2VAjs.Mix; exports.NotFoundException = _chunkXAFRQQNMjs.NotFoundException; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PInterceptor = PInterceptor; exports.PPipe = PPipe; exports.PPlugin = PPlugin; exports.PS_FILE_RE = _chunkXHKBG2VAjs.PS_FILE_RE; exports.PS_IMPORT_RE = _chunkXHKBG2VAjs.PS_IMPORT_RE; exports.Param = Param; exports.Patch = Patch; exports.PayloadLargeException = _chunkXAFRQQNMjs.PayloadLargeException; exports.Pipe = Pipe; exports.Plugin = Plugin; exports.Post = Post; exports.Put = Put; exports.Query = Query; exports.Route = Route; exports.Rpc = Rpc; exports.ServiceUnavailableException = _chunkXAFRQQNMjs.ServiceUnavailableException; exports.TimeoutException = _chunkXAFRQQNMjs.TimeoutException; exports.UNMOUNT_SYMBOL = _chunkXHKBG2VAjs.UNMOUNT_SYMBOL; exports.UnauthorizedException = _chunkXAFRQQNMjs.UnauthorizedException; exports.UndefinedException = _chunkXAFRQQNMjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkXAFRQQNMjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkXAFRQQNMjs.ValidateException; exports.addFilter = _chunkXAFRQQNMjs.addFilter; exports.addGuard = _chunkXAFRQQNMjs.addGuard; exports.addInterceptor = _chunkXAFRQQNMjs.addInterceptor; exports.addPipe = _chunkXAFRQQNMjs.addPipe; exports.addPlugin = _chunkXAFRQQNMjs.addPlugin; exports.argToReq = _chunkEVF2CXTPjs.argToReq; exports.defaultPipe = _chunkXAFRQQNMjs.defaultPipe; exports.emitter = _chunkJQOV7JUDjs.emitter; exports.generateHTTPCode = _chunkJQOV7JUDjs.generateHTTPCode; exports.generateRPCCode = _chunkJQOV7JUDjs.generateRPCCode; exports.getConfig = _chunkXHKBG2VAjs.getConfig; exports.guardRecord = _chunkXAFRQQNMjs.guardRecord; exports.isAopDepInject = _chunkXAFRQQNMjs.isAopDepInject; exports.log = _chunkXHKBG2VAjs.log; exports.resolveDep = _chunkEVF2CXTPjs.resolveDep; exports.setConfig = _chunkXHKBG2VAjs.setConfig;
|
package/dist/index.mjs
CHANGED
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
emitter,
|
|
6
6
|
generateHTTPCode,
|
|
7
7
|
generateRPCCode
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EASQZ4RI.mjs";
|
|
9
9
|
import {
|
|
10
10
|
argToReq,
|
|
11
11
|
resolveDep
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-N7GEBDPZ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
BadGatewayException,
|
|
15
15
|
BadRequestException,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
defaultPipe,
|
|
36
36
|
guardRecord,
|
|
37
37
|
isAopDepInject
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-P57NA4BR.mjs";
|
|
39
39
|
import {
|
|
40
40
|
APP_SYMBOL,
|
|
41
41
|
ERROR_SYMBOL,
|
|
@@ -53,17 +53,17 @@ import {
|
|
|
53
53
|
getConfig,
|
|
54
54
|
log,
|
|
55
55
|
setConfig
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-UFSW7A6B.mjs";
|
|
57
57
|
|
|
58
58
|
// src/decorators/index.ts
|
|
59
|
-
import { SHARE_KEY as SHARE_KEY3, setState as setState4,
|
|
59
|
+
import { SHARE_KEY as SHARE_KEY3, getOwnState as getOwnState4, setState as setState4, setStateVar as setStateVar4 } from "phecda-core";
|
|
60
60
|
|
|
61
61
|
// src/decorators/param.ts
|
|
62
|
-
import { setState,
|
|
62
|
+
import { getOwnState, setState, setStateVar } from "phecda-core";
|
|
63
63
|
function BaseParam(type, key) {
|
|
64
64
|
return (target, k, index) => {
|
|
65
|
-
|
|
66
|
-
const state = target
|
|
65
|
+
setStateVar(target, k);
|
|
66
|
+
const state = getOwnState(target, k);
|
|
67
67
|
if (!state.params)
|
|
68
68
|
state.params = [];
|
|
69
69
|
const existItem = state.params.find((item) => item.index === index);
|
|
@@ -84,8 +84,8 @@ function BaseParam(type, key) {
|
|
|
84
84
|
__name(BaseParam, "BaseParam");
|
|
85
85
|
function Pipe(key, opts) {
|
|
86
86
|
return (target, k, index) => {
|
|
87
|
-
|
|
88
|
-
const state = target
|
|
87
|
+
setStateVar(target, k);
|
|
88
|
+
const state = getOwnState(target, k);
|
|
89
89
|
if (!state.params)
|
|
90
90
|
state.params = [];
|
|
91
91
|
const existItem = state.params.find((item) => item.index === index);
|
|
@@ -126,14 +126,14 @@ function Arg() {
|
|
|
126
126
|
__name(Arg, "Arg");
|
|
127
127
|
|
|
128
128
|
// src/decorators/route.ts
|
|
129
|
-
import { SHARE_KEY, setState as setState2,
|
|
129
|
+
import { SHARE_KEY, getOwnState as getOwnState2, setState as setState2, setStateVar as setStateVar2 } from "phecda-core";
|
|
130
130
|
function Route(route, type) {
|
|
131
131
|
return (target, key) => {
|
|
132
132
|
if (!key)
|
|
133
133
|
key = SHARE_KEY;
|
|
134
134
|
target = key === SHARE_KEY ? target.prototype : target;
|
|
135
|
-
|
|
136
|
-
const state = target
|
|
135
|
+
setStateVar2(target, key);
|
|
136
|
+
const state = getOwnState2(target, key);
|
|
137
137
|
state.http = {
|
|
138
138
|
route,
|
|
139
139
|
type
|
|
@@ -171,8 +171,8 @@ function Rpc(...types) {
|
|
|
171
171
|
if (!key)
|
|
172
172
|
key = SHARE_KEY;
|
|
173
173
|
target = key === SHARE_KEY ? target.prototype : target;
|
|
174
|
-
|
|
175
|
-
const state = target
|
|
174
|
+
setStateVar2(target, key);
|
|
175
|
+
const state = getOwnState2(target, key);
|
|
176
176
|
if (!state.rpc)
|
|
177
177
|
state.rpc = {};
|
|
178
178
|
state.rpc.type = types;
|
|
@@ -185,8 +185,8 @@ function Event(isEvent = true) {
|
|
|
185
185
|
if (!key)
|
|
186
186
|
key = SHARE_KEY;
|
|
187
187
|
target = key === SHARE_KEY ? target.prototype : target;
|
|
188
|
-
|
|
189
|
-
const state = target
|
|
188
|
+
setStateVar2(target, key);
|
|
189
|
+
const state = getOwnState2(target, key);
|
|
190
190
|
if (!state.rpc)
|
|
191
191
|
state.rpc = {};
|
|
192
192
|
state.rpc.isEvent = isEvent;
|
|
@@ -196,14 +196,14 @@ function Event(isEvent = true) {
|
|
|
196
196
|
__name(Event, "Event");
|
|
197
197
|
|
|
198
198
|
// src/decorators/aop.ts
|
|
199
|
-
import { SHARE_KEY as SHARE_KEY2, setState as setState3,
|
|
199
|
+
import { SHARE_KEY as SHARE_KEY2, getOwnState as getOwnState3, setState as setState3, setStateVar as setStateVar3 } from "phecda-core";
|
|
200
200
|
function Guard(...guards) {
|
|
201
201
|
return (target, key) => {
|
|
202
202
|
if (!key)
|
|
203
203
|
key = SHARE_KEY2;
|
|
204
204
|
target = key === SHARE_KEY2 ? target.prototype : target;
|
|
205
|
-
|
|
206
|
-
const state = target
|
|
205
|
+
setStateVar3(target, key);
|
|
206
|
+
const state = getOwnState3(target, key);
|
|
207
207
|
if (!state.guards)
|
|
208
208
|
state.guards = [];
|
|
209
209
|
state.guards.push(...guards);
|
|
@@ -216,8 +216,8 @@ function Plugin(...plugins) {
|
|
|
216
216
|
if (!key)
|
|
217
217
|
key = SHARE_KEY2;
|
|
218
218
|
target = key === SHARE_KEY2 ? target.prototype : target;
|
|
219
|
-
|
|
220
|
-
const state = target
|
|
219
|
+
setStateVar3(target, key);
|
|
220
|
+
const state = getOwnState3(target, key);
|
|
221
221
|
if (!state.plugins)
|
|
222
222
|
state.plugins = [];
|
|
223
223
|
state.plugins.push(...plugins);
|
|
@@ -230,8 +230,8 @@ function Interceptor(...interceptors) {
|
|
|
230
230
|
if (!key)
|
|
231
231
|
key = SHARE_KEY2;
|
|
232
232
|
target = key === SHARE_KEY2 ? target.prototype : target;
|
|
233
|
-
|
|
234
|
-
const state = target
|
|
233
|
+
setStateVar3(target, key);
|
|
234
|
+
const state = getOwnState3(target, key);
|
|
235
235
|
if (!state.interceptors)
|
|
236
236
|
state.interceptors = [];
|
|
237
237
|
state.interceptors.push(...interceptors);
|
|
@@ -244,8 +244,8 @@ function Filter(filter) {
|
|
|
244
244
|
if (!key)
|
|
245
245
|
key = SHARE_KEY2;
|
|
246
246
|
target = key === SHARE_KEY2 ? target.prototype : target;
|
|
247
|
-
|
|
248
|
-
const state = target
|
|
247
|
+
setStateVar3(target, key);
|
|
248
|
+
const state = getOwnState3(target, key);
|
|
249
249
|
state.filter = filter;
|
|
250
250
|
setState3(target, key, state);
|
|
251
251
|
};
|
|
@@ -255,8 +255,8 @@ __name(Filter, "Filter");
|
|
|
255
255
|
// src/decorators/index.ts
|
|
256
256
|
function Header(name, value) {
|
|
257
257
|
return (target, k) => {
|
|
258
|
-
|
|
259
|
-
const state = target
|
|
258
|
+
setStateVar4(target, k);
|
|
259
|
+
const state = getOwnState4(target, k);
|
|
260
260
|
if (!state.header)
|
|
261
261
|
state.header = {};
|
|
262
262
|
state.header[name] = value;
|
|
@@ -270,8 +270,8 @@ function Define(key, value) {
|
|
|
270
270
|
k = SHARE_KEY3;
|
|
271
271
|
target = target.prototype;
|
|
272
272
|
}
|
|
273
|
-
|
|
274
|
-
const state = target
|
|
273
|
+
setStateVar4(target, k);
|
|
274
|
+
const state = getOwnState4(target, k);
|
|
275
275
|
if (!state.define)
|
|
276
276
|
state.define = {};
|
|
277
277
|
state.define[key] = value;
|