phecda-server 5.3.2 → 5.3.3
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.
|
@@ -179,11 +179,14 @@ function getMetaFromInstance(instance, tag, name) {
|
|
|
179
179
|
...state[baseState.controller]
|
|
180
180
|
};
|
|
181
181
|
const params = [];
|
|
182
|
-
for (const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (
|
|
182
|
+
for (const item of state.params || []) {
|
|
183
|
+
const newItem = {
|
|
184
|
+
...item
|
|
185
|
+
};
|
|
186
|
+
if (!newItem.pipe) newItem.pipe = state.pipe || baseState.pipe;
|
|
187
|
+
if (!newItem.define) newItem.define = {};
|
|
188
|
+
params.unshift(newItem);
|
|
189
|
+
if (item.index === 0) break;
|
|
187
190
|
}
|
|
188
191
|
meta.ctxs = ctxs;
|
|
189
192
|
meta.params = params;
|
|
@@ -211,10 +214,18 @@ function getMetaFromInstance(instance, tag, name) {
|
|
|
211
214
|
])
|
|
212
215
|
];
|
|
213
216
|
}
|
|
214
|
-
return new Meta(meta, getParamTypes(instance, i) || []);
|
|
217
|
+
return new Meta(deepFreeze(meta), getParamTypes(instance, i) || []);
|
|
215
218
|
});
|
|
216
219
|
}
|
|
217
220
|
_chunkGHFSIZUOjs.__name.call(void 0, getMetaFromInstance, "getMetaFromInstance");
|
|
221
|
+
function deepFreeze(object) {
|
|
222
|
+
Object.freeze(object);
|
|
223
|
+
Object.getOwnPropertyNames(object).forEach((prop) => {
|
|
224
|
+
if (object[prop] !== null && (typeof object[prop] === "object" || typeof object[prop] === "function") && !Object.isFrozen(object[prop])) deepFreeze(object[prop]);
|
|
225
|
+
});
|
|
226
|
+
return object;
|
|
227
|
+
}
|
|
228
|
+
_chunkGHFSIZUOjs.__name.call(void 0, deepFreeze, "deepFreeze");
|
|
218
229
|
function getParamTypes(Model, key) {
|
|
219
230
|
return Reflect.getMetadata("design:paramtypes", Model, key);
|
|
220
231
|
}
|
|
@@ -179,11 +179,14 @@ function getMetaFromInstance(instance, tag, name) {
|
|
|
179
179
|
...state[baseState.controller]
|
|
180
180
|
};
|
|
181
181
|
const params = [];
|
|
182
|
-
for (const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (
|
|
182
|
+
for (const item of state.params || []) {
|
|
183
|
+
const newItem = {
|
|
184
|
+
...item
|
|
185
|
+
};
|
|
186
|
+
if (!newItem.pipe) newItem.pipe = state.pipe || baseState.pipe;
|
|
187
|
+
if (!newItem.define) newItem.define = {};
|
|
188
|
+
params.unshift(newItem);
|
|
189
|
+
if (item.index === 0) break;
|
|
187
190
|
}
|
|
188
191
|
meta.ctxs = ctxs;
|
|
189
192
|
meta.params = params;
|
|
@@ -211,10 +214,18 @@ function getMetaFromInstance(instance, tag, name) {
|
|
|
211
214
|
])
|
|
212
215
|
];
|
|
213
216
|
}
|
|
214
|
-
return new Meta(meta, getParamTypes(instance, i) || []);
|
|
217
|
+
return new Meta(deepFreeze(meta), getParamTypes(instance, i) || []);
|
|
215
218
|
});
|
|
216
219
|
}
|
|
217
220
|
__name(getMetaFromInstance, "getMetaFromInstance");
|
|
221
|
+
function deepFreeze(object) {
|
|
222
|
+
Object.freeze(object);
|
|
223
|
+
Object.getOwnPropertyNames(object).forEach((prop) => {
|
|
224
|
+
if (object[prop] !== null && (typeof object[prop] === "object" || typeof object[prop] === "function") && !Object.isFrozen(object[prop])) deepFreeze(object[prop]);
|
|
225
|
+
});
|
|
226
|
+
return object;
|
|
227
|
+
}
|
|
228
|
+
__name(deepFreeze, "deepFreeze");
|
|
218
229
|
function getParamTypes(Model, key) {
|
|
219
230
|
return Reflect.getMetadata("design:paramtypes", Model, key);
|
|
220
231
|
}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk3D7AROG2js = require('./chunk-3D7AROG2.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -95,7 +95,7 @@ var ServerBase = (_class = class extends _phecdacore.Base {constructor(...args2)
|
|
|
95
95
|
static {
|
|
96
96
|
_chunkGHFSIZUOjs.__name.call(void 0, this, "ServerBase");
|
|
97
97
|
}
|
|
98
|
-
__init() {this.emitter = exports.emitter =
|
|
98
|
+
__init() {this.emitter = exports.emitter = _chunk3D7AROG2js.emitter}
|
|
99
99
|
}, _class);
|
|
100
100
|
var HttpBase = class extends ServerBase {
|
|
101
101
|
static {
|
|
@@ -418,4 +418,4 @@ return ret
|
|
|
418
418
|
|
|
419
419
|
|
|
420
420
|
|
|
421
|
-
exports.Arg = _chunk2HVTWYS2js.Arg; exports.BadGatewayException = _chunkRZ7IXJYQjs.BadGatewayException; exports.BadRequestException = _chunkRZ7IXJYQjs.BadRequestException; exports.BaseParam = _chunk2HVTWYS2js.BaseParam; exports.Body = _chunk2HVTWYS2js.Body; exports.ConflictException = _chunkRZ7IXJYQjs.ConflictException; exports.Context = _chunkRZ7IXJYQjs.Context; exports.Controller = _chunk2HVTWYS2js.Controller; exports.Ctx = _chunk2HVTWYS2js.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunk2HVTWYS2js.Define; exports.Delete = _chunk2HVTWYS2js.Delete; exports.ERROR_SYMBOL = _chunkGHFSIZUOjs.ERROR_SYMBOL; exports.Event = _chunk2HVTWYS2js.Event; exports.Exception = _chunkRZ7IXJYQjs.Exception; exports.Factory =
|
|
421
|
+
exports.Arg = _chunk2HVTWYS2js.Arg; exports.BadGatewayException = _chunkRZ7IXJYQjs.BadGatewayException; exports.BadRequestException = _chunkRZ7IXJYQjs.BadRequestException; exports.BaseParam = _chunk2HVTWYS2js.BaseParam; exports.Body = _chunk2HVTWYS2js.Body; exports.ConflictException = _chunkRZ7IXJYQjs.ConflictException; exports.Context = _chunkRZ7IXJYQjs.Context; exports.Controller = _chunk2HVTWYS2js.Controller; exports.Ctx = _chunk2HVTWYS2js.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunk2HVTWYS2js.Define; exports.Delete = _chunk2HVTWYS2js.Delete; exports.ERROR_SYMBOL = _chunkGHFSIZUOjs.ERROR_SYMBOL; exports.Event = _chunk2HVTWYS2js.Event; exports.Exception = _chunkRZ7IXJYQjs.Exception; exports.Factory = _chunk3D7AROG2js.Factory; exports.Filter = _chunk2HVTWYS2js.Filter; exports.ForbiddenException = _chunkRZ7IXJYQjs.ForbiddenException; exports.FrameworkException = _chunkRZ7IXJYQjs.FrameworkException; exports.Generator = Generator; exports.Get = _chunk2HVTWYS2js.Get; exports.Guard = _chunk2HVTWYS2js.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunk2HVTWYS2js.Head; exports.Header = _chunk2HVTWYS2js.Header; exports.HttpBase = HttpBase; exports.IS_HMR = _chunkGHFSIZUOjs.IS_HMR; exports.IS_ONLY_GENERATE = _chunkGHFSIZUOjs.IS_ONLY_GENERATE; exports.IS_STRICT = _chunkGHFSIZUOjs.IS_STRICT; exports.Interceptor = _chunk2HVTWYS2js.Interceptor; exports.InvalidInputException = _chunkRZ7IXJYQjs.InvalidInputException; exports.LOG_LEVEL = _chunkGHFSIZUOjs.LOG_LEVEL; exports.Meta = _chunk3D7AROG2js.Meta; exports.Mixin = _chunkGHFSIZUOjs.Mixin; exports.NotFoundException = _chunkRZ7IXJYQjs.NotFoundException; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PInterceptor = PInterceptor; exports.PPipe = PPipe; exports.PPlugin = PPlugin; exports.PS_EXIT_CODE = _chunkGHFSIZUOjs.PS_EXIT_CODE; exports.Param = _chunk2HVTWYS2js.Param; exports.Patch = _chunk2HVTWYS2js.Patch; exports.PayloadLargeException = _chunkRZ7IXJYQjs.PayloadLargeException; exports.Pipe = _chunk2HVTWYS2js.Pipe; exports.Plugin = _chunk2HVTWYS2js.Plugin; exports.Post = _chunk2HVTWYS2js.Post; exports.Put = _chunk2HVTWYS2js.Put; exports.Query = _chunk2HVTWYS2js.Query; exports.Queue = _chunk2HVTWYS2js.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunk2HVTWYS2js.Route; exports.Rpc = _chunk2HVTWYS2js.Rpc; exports.RpcBase = RpcBase; exports.ServerBase = ServerBase; exports.ServiceUnavailableException = _chunkRZ7IXJYQjs.ServiceUnavailableException; exports.TimeoutException = _chunkRZ7IXJYQjs.TimeoutException; exports.TimerException = _chunkRZ7IXJYQjs.TimerException; exports.UnauthorizedException = _chunkRZ7IXJYQjs.UnauthorizedException; exports.UndefinedException = _chunkRZ7IXJYQjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkRZ7IXJYQjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkRZ7IXJYQjs.ValidateException; exports.WorkerException = _chunkRZ7IXJYQjs.WorkerException; exports.addFilter = _chunkRZ7IXJYQjs.addFilter; exports.addGuard = _chunkRZ7IXJYQjs.addGuard; exports.addInterceptor = _chunkRZ7IXJYQjs.addInterceptor; exports.addPipe = _chunkRZ7IXJYQjs.addPipe; exports.addPlugin = _chunkRZ7IXJYQjs.addPlugin; exports.createPhecda = _chunk3D7AROG2js.createPhecda; exports.defaultPipe = _chunkRZ7IXJYQjs.defaultPipe; exports.emitter = _chunk3D7AROG2js.emitter; exports.log = _chunkGHFSIZUOjs.log; exports.setLogger = _chunkGHFSIZUOjs.setLogger;
|
package/dist/index.mjs
CHANGED
package/dist/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3D7AROG2js = require('./chunk-3D7AROG2.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkGHFSIZUOjs = require('./chunk-GHFSIZUO.js');
|
|
@@ -8,7 +8,7 @@ var _chunkGHFSIZUOjs = require('./chunk-GHFSIZUO.js');
|
|
|
8
8
|
// src/test.ts
|
|
9
9
|
var _phecdacore = require('phecda-core');
|
|
10
10
|
async function TestFactory(...Modules) {
|
|
11
|
-
const { moduleMap, modelMap } = await
|
|
11
|
+
const { moduleMap, modelMap } = await _chunk3D7AROG2js.Factory.call(void 0, Modules);
|
|
12
12
|
return {
|
|
13
13
|
get(Model) {
|
|
14
14
|
const tag = _phecdacore.getTag.call(void 0, Model);
|
package/dist/test.mjs
CHANGED