phecda-server 5.0.0-alpha.14 → 5.0.0-alpha.16
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.
|
@@ -102,7 +102,7 @@ __name(generateHTTPCode, "generateHTTPCode");
|
|
|
102
102
|
import "reflect-metadata";
|
|
103
103
|
import fs from "fs";
|
|
104
104
|
import EventEmitter from "node:events";
|
|
105
|
-
import { Empty, SHARE_KEY, getExposeKey, getHandler, getProperty, getState, getTag, injectProperty,
|
|
105
|
+
import { Empty, SHARE_KEY, getExposeKey, getHandler, getProperty, getState, getTag, injectProperty, invokeHandler, isPhecda } from "phecda-core";
|
|
106
106
|
import Debug from "debug";
|
|
107
107
|
function Injectable() {
|
|
108
108
|
return (target) => Empty(target);
|
|
@@ -134,7 +134,7 @@ async function Factory(Modules, opts = {}) {
|
|
|
134
134
|
return;
|
|
135
135
|
const instance = moduleMap.get(tag);
|
|
136
136
|
debug(`unmount module "${String(tag)}"`);
|
|
137
|
-
|
|
137
|
+
invokeHandler("unmount", instance);
|
|
138
138
|
debug(`del module "${String(tag)}"`);
|
|
139
139
|
moduleMap.delete(tag);
|
|
140
140
|
constructorMap.delete(tag);
|
|
@@ -203,7 +203,7 @@ async function Factory(Modules, opts = {}) {
|
|
|
203
203
|
}
|
|
204
204
|
meta.push(...getMetaFromInstance(instance, tag, Module.name));
|
|
205
205
|
debug(`init module "${String(tag)}"`);
|
|
206
|
-
await
|
|
206
|
+
await invokeHandler("init", instance);
|
|
207
207
|
debug(`add module "${String(tag)}"`);
|
|
208
208
|
moduleMap.set(tag, instance);
|
|
209
209
|
constructorMap.set(tag, Module);
|
|
@@ -134,7 +134,7 @@ async function Factory(Modules, opts = {}) {
|
|
|
134
134
|
return;
|
|
135
135
|
const instance = moduleMap.get(tag);
|
|
136
136
|
debug(`unmount module "${String(tag)}"`);
|
|
137
|
-
_phecdacore.
|
|
137
|
+
_phecdacore.invokeHandler.call(void 0, "unmount", instance);
|
|
138
138
|
debug(`del module "${String(tag)}"`);
|
|
139
139
|
moduleMap.delete(tag);
|
|
140
140
|
constructorMap.delete(tag);
|
|
@@ -203,7 +203,7 @@ async function Factory(Modules, opts = {}) {
|
|
|
203
203
|
}
|
|
204
204
|
meta.push(...getMetaFromInstance(instance, tag, Module.name));
|
|
205
205
|
debug(`init module "${String(tag)}"`);
|
|
206
|
-
await _phecdacore.
|
|
206
|
+
await _phecdacore.invokeHandler.call(void 0, "init", instance);
|
|
207
207
|
debug(`add module "${String(tag)}"`);
|
|
208
208
|
moduleMap.set(tag, instance);
|
|
209
209
|
constructorMap.set(tag, Module);
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkRQOJIVQMjs = require('./chunk-RQOJIVQM.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -511,4 +511,4 @@ _chunkT4C6CCWMjs.__name.call(void 0, PExtension, "PExtension");
|
|
|
511
511
|
|
|
512
512
|
|
|
513
513
|
|
|
514
|
-
exports.APP_SYMBOL = _chunkT4C6CCWMjs.APP_SYMBOL; exports.Arg = Arg; exports.BadGatewayException = _chunkVUOACQPJjs.BadGatewayException; exports.BadRequestException = _chunkVUOACQPJjs.BadRequestException; exports.BaseParam = BaseParam; exports.Body = Body; exports.ConflictException = _chunkVUOACQPJjs.ConflictException; exports.Context = _chunkVUOACQPJjs.Context; exports.Controller = Controller; exports.Define = Define; exports.Delete = Delete; exports.Dev = Dev; exports.ERROR_SYMBOL = _chunkT4C6CCWMjs.ERROR_SYMBOL; exports.Event = Event; exports.Exception = _chunkVUOACQPJjs.Exception; exports.Factory =
|
|
514
|
+
exports.APP_SYMBOL = _chunkT4C6CCWMjs.APP_SYMBOL; exports.Arg = Arg; exports.BadGatewayException = _chunkVUOACQPJjs.BadGatewayException; exports.BadRequestException = _chunkVUOACQPJjs.BadRequestException; exports.BaseParam = BaseParam; exports.Body = Body; exports.ConflictException = _chunkVUOACQPJjs.ConflictException; exports.Context = _chunkVUOACQPJjs.Context; exports.Controller = Controller; exports.Define = Define; exports.Delete = Delete; exports.Dev = Dev; exports.ERROR_SYMBOL = _chunkT4C6CCWMjs.ERROR_SYMBOL; exports.Event = Event; exports.Exception = _chunkVUOACQPJjs.Exception; exports.Factory = _chunkRQOJIVQMjs.Factory; exports.Filter = Filter; exports.ForbiddenException = _chunkVUOACQPJjs.ForbiddenException; exports.FrameworkException = _chunkVUOACQPJjs.FrameworkException; exports.Get = Get; exports.Guard = Guard; exports.Head = Head; exports.Header = Header; exports.IS_DEV = _chunkT4C6CCWMjs.IS_DEV; exports.IS_LOG_BAN = _chunkT4C6CCWMjs.IS_LOG_BAN; exports.IS_STRICT = _chunkT4C6CCWMjs.IS_STRICT; exports.Injectable = _chunkRQOJIVQMjs.Injectable; exports.Interceptor = Interceptor; exports.InvalidInputException = _chunkVUOACQPJjs.InvalidInputException; exports.MERGE_SYMBOL = _chunkT4C6CCWMjs.MERGE_SYMBOL; exports.META_SYMBOL = _chunkT4C6CCWMjs.META_SYMBOL; exports.MODULE_SYMBOL = _chunkT4C6CCWMjs.MODULE_SYMBOL; exports.Meta = _chunkRQOJIVQMjs.Meta; exports.Mix = _chunkT4C6CCWMjs.Mix; exports.NotFoundException = _chunkVUOACQPJjs.NotFoundException; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PInterceptor = PInterceptor; exports.PPipe = PPipe; exports.PPlugin = PPlugin; exports.PS_FILE_RE = _chunkT4C6CCWMjs.PS_FILE_RE; exports.PS_IMPORT_RE = _chunkT4C6CCWMjs.PS_IMPORT_RE; exports.Param = Param; exports.Patch = Patch; exports.PayloadLargeException = _chunkVUOACQPJjs.PayloadLargeException; exports.Pipe = Pipe; exports.Plugin = Plugin; exports.Post = Post; exports.Put = Put; exports.Query = Query; exports.Route = Route; exports.Rpc = Rpc; exports.ServiceUnavailableException = _chunkVUOACQPJjs.ServiceUnavailableException; exports.TimeoutException = _chunkVUOACQPJjs.TimeoutException; exports.UNMOUNT_SYMBOL = _chunkT4C6CCWMjs.UNMOUNT_SYMBOL; exports.UnauthorizedException = _chunkVUOACQPJjs.UnauthorizedException; exports.UndefinedException = _chunkVUOACQPJjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkVUOACQPJjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkVUOACQPJjs.ValidateException; exports.addFilter = _chunkVUOACQPJjs.addFilter; exports.addGuard = _chunkVUOACQPJjs.addGuard; exports.addInterceptor = _chunkVUOACQPJjs.addInterceptor; exports.addPipe = _chunkVUOACQPJjs.addPipe; exports.addPlugin = _chunkVUOACQPJjs.addPlugin; exports.argToReq = _chunkCRAV4WSBjs.argToReq; exports.defaultPipe = _chunkVUOACQPJjs.defaultPipe; exports.emitter = _chunkRQOJIVQMjs.emitter; exports.generateHTTPCode = _chunkRQOJIVQMjs.generateHTTPCode; exports.generateRPCCode = _chunkRQOJIVQMjs.generateRPCCode; exports.getConfig = _chunkT4C6CCWMjs.getConfig; exports.guardRecord = _chunkVUOACQPJjs.guardRecord; exports.isAopDepInject = _chunkVUOACQPJjs.isAopDepInject; exports.log = _chunkT4C6CCWMjs.log; exports.resolveDep = _chunkCRAV4WSBjs.resolveDep; exports.setConfig = _chunkT4C6CCWMjs.setConfig;
|
package/dist/index.mjs
CHANGED
package/dist/test.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkRQOJIVQMjs = require('./chunk-RQOJIVQM.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkT4C6CCWMjs = require('./chunk-T4C6CCWM.js');
|
|
7
7
|
|
|
8
8
|
// src/test.ts
|
|
9
9
|
async function TestFactory(...Modules) {
|
|
10
|
-
const { moduleMap, constructorMap } = await
|
|
10
|
+
const { moduleMap, constructorMap } = await _chunkRQOJIVQMjs.Factory.call(void 0, Modules);
|
|
11
11
|
return {
|
|
12
12
|
get(Module) {
|
|
13
13
|
const tag = _optionalChain([Module, 'access', _ => _.prototype, 'optionalAccess', _2 => _2.__TAG__]) || Module.name;
|
package/dist/test.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phecda-server",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.16",
|
|
4
4
|
"description": "provide express middlewares, `nestjs` format",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"debug": "^4.3.4",
|
|
122
122
|
"picocolors": "^1.0.0",
|
|
123
123
|
"reflect-metadata": "^0.1.13",
|
|
124
|
-
"phecda-core": "3.0.0-alpha.
|
|
124
|
+
"phecda-core": "3.0.0-alpha.10"
|
|
125
125
|
},
|
|
126
126
|
"scripts": {
|
|
127
127
|
"dev": "tsup --watch",
|