phecda-server 5.1.1 → 5.2.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/assets/ps.json +25 -0
- package/assets/tsconfig.json +21 -0
- package/bin/cli.mjs +41 -80
- package/dist/{chunk-HMPTPTFL.js → chunk-5BVUCNMA.js} +2 -2
- package/dist/{chunk-FSBD5R22.js → chunk-BSE2DSDK.js} +64 -66
- package/dist/{chunk-2HKQPZDT.mjs → chunk-CKQW3FDK.mjs} +3 -3
- package/dist/{chunk-665MB62T.mjs → chunk-JE6BBDXW.mjs} +63 -65
- package/dist/{chunk-UU6RHGRF.mjs → chunk-V3WIKOP3.mjs} +10 -4
- package/dist/{chunk-3BV2GRS7.js → chunk-VMLHTEW3.js} +22 -16
- package/dist/core-7f6d2be6.d.ts +27 -0
- package/dist/{helper-fcbf6aa8.d.ts → helper-49c7213c.d.ts} +1 -1
- package/dist/{helper-6133f78f.d.ts → helper-5d755442.d.ts} +1 -1
- package/dist/helper.d.ts +25 -0
- package/dist/helper.js +21 -0
- package/dist/helper.mjs +21 -0
- package/dist/index.d.ts +5 -25
- package/dist/index.js +24 -42
- package/dist/index.mjs +5 -23
- package/dist/rpc/bullmq/index.d.ts +3 -2
- package/dist/rpc/bullmq/index.js +6 -6
- package/dist/rpc/bullmq/index.mjs +1 -1
- package/dist/rpc/kafka/index.d.ts +3 -2
- package/dist/rpc/kafka/index.js +5 -5
- package/dist/rpc/kafka/index.mjs +1 -1
- package/dist/rpc/nats/index.d.ts +3 -2
- package/dist/rpc/nats/index.js +5 -5
- package/dist/rpc/nats/index.mjs +1 -1
- package/dist/rpc/rabbitmq/index.d.ts +3 -2
- package/dist/rpc/rabbitmq/index.js +6 -6
- package/dist/rpc/rabbitmq/index.mjs +1 -1
- package/dist/rpc/redis/index.d.ts +3 -2
- package/dist/rpc/redis/index.js +6 -6
- package/dist/rpc/redis/index.mjs +1 -1
- package/dist/server/elysia/index.d.ts +3 -2
- package/dist/server/elysia/index.js +15 -15
- package/dist/server/elysia/index.mjs +2 -2
- package/dist/server/express/index.d.ts +3 -2
- package/dist/server/express/index.js +14 -14
- package/dist/server/express/index.mjs +1 -1
- package/dist/server/fastify/index.d.ts +3 -2
- package/dist/server/fastify/index.js +15 -15
- package/dist/server/fastify/index.mjs +2 -2
- package/dist/server/h3/index.d.ts +3 -2
- package/dist/server/h3/index.js +12 -12
- package/dist/server/h3/index.mjs +1 -1
- package/dist/server/hono/index.d.ts +3 -2
- package/dist/server/hono/index.js +13 -13
- package/dist/server/hono/index.mjs +1 -1
- package/dist/server/hyper-express/index.d.ts +3 -2
- package/dist/server/hyper-express/index.js +13 -13
- package/dist/server/hyper-express/index.mjs +1 -1
- package/dist/server/koa/index.d.ts +3 -2
- package/dist/server/koa/index.js +14 -14
- package/dist/server/koa/index.mjs +1 -1
- package/dist/test.d.ts +2 -1
- package/dist/test.js +2 -2
- package/dist/test.mjs +1 -1
- package/dist/{core-39f27fe8.d.ts → types-81be0ba3.d.ts} +2 -25
- package/package.json +61 -53
- package/register/loader.mjs +26 -13
- package/register/utils.mjs +6 -31
- /package/{bin → assets}/schema.json +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
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
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkBSE2DSDKjs = require('./chunk-BSE2DSDK.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkZP7HNASUjs = require('./chunk-ZP7HNASU.js');
|
|
@@ -16,7 +16,7 @@ function BaseParam(data) {
|
|
|
16
16
|
if (!state.params)
|
|
17
17
|
state.params = [
|
|
18
18
|
..._optionalChain([_phecdacore.getState.call(void 0, target, k), 'optionalAccess', _ => _.params]) || []
|
|
19
|
-
].map(
|
|
19
|
+
].map(_chunkBSE2DSDKjs.shallowClone);
|
|
20
20
|
const existItem = state.params.find((item) => item.index === index);
|
|
21
21
|
if (existItem)
|
|
22
22
|
Object.assign(existItem, data);
|
|
@@ -139,7 +139,7 @@ _chunkZP7HNASUjs.__name.call(void 0, Pipe, "Pipe");
|
|
|
139
139
|
function Route(route, type) {
|
|
140
140
|
return (target, k) => {
|
|
141
141
|
_phecdacore.setPropertyState.call(void 0, target, k, (state) => {
|
|
142
|
-
state.http =
|
|
142
|
+
state.http = _chunkBSE2DSDKjs.mergeObject.call(void 0, state.http || _optionalChain([_phecdacore.getState.call(void 0, target, k), 'optionalAccess', _5 => _5.http]), {
|
|
143
143
|
route,
|
|
144
144
|
type
|
|
145
145
|
});
|
|
@@ -151,9 +151,9 @@ function Header(headers) {
|
|
|
151
151
|
return (target, k) => {
|
|
152
152
|
_phecdacore.setPropertyState.call(void 0, target, k, (state) => {
|
|
153
153
|
if (!state.http)
|
|
154
|
-
state.http =
|
|
155
|
-
state.http =
|
|
156
|
-
headers:
|
|
154
|
+
state.http = _chunkBSE2DSDKjs.mergeObject.call(void 0, _optionalChain([_phecdacore.getState.call(void 0, target, k), 'optionalAccess', _6 => _6.http]));
|
|
155
|
+
state.http = _chunkBSE2DSDKjs.mergeObject.call(void 0, state.http, {
|
|
156
|
+
headers: _chunkBSE2DSDKjs.mergeObject.call(void 0, _optionalChain([state, 'access', _7 => _7.http, 'optionalAccess', _8 => _8.headers]), headers)
|
|
157
157
|
});
|
|
158
158
|
});
|
|
159
159
|
};
|
|
@@ -183,7 +183,7 @@ function Controller(prefix = "") {
|
|
|
183
183
|
return (target) => {
|
|
184
184
|
_phecdacore.setPropertyState.call(void 0, target, void 0, (state) => {
|
|
185
185
|
state.controller = "http";
|
|
186
|
-
state.http =
|
|
186
|
+
state.http = _chunkBSE2DSDKjs.mergeObject.call(void 0, state.http || _optionalChain([_phecdacore.getState.call(void 0, target), 'optionalAccess', _9 => _9.http]), {
|
|
187
187
|
prefix
|
|
188
188
|
});
|
|
189
189
|
});
|
|
@@ -196,7 +196,7 @@ _chunkZP7HNASUjs.__name.call(void 0, Controller, "Controller");
|
|
|
196
196
|
function Event(isEvent = true) {
|
|
197
197
|
return (target, k) => {
|
|
198
198
|
_phecdacore.setPropertyState.call(void 0, target, k, (state) => {
|
|
199
|
-
state.rpc =
|
|
199
|
+
state.rpc = _chunkBSE2DSDKjs.mergeObject.call(void 0, state.rpc || _optionalChain([_phecdacore.getState.call(void 0, target, k), 'optionalAccess', _10 => _10.rpc]), {
|
|
200
200
|
isEvent
|
|
201
201
|
});
|
|
202
202
|
});
|
|
@@ -206,7 +206,7 @@ _chunkZP7HNASUjs.__name.call(void 0, Event, "Event");
|
|
|
206
206
|
function Queue(queue = "") {
|
|
207
207
|
return (target, k) => {
|
|
208
208
|
_phecdacore.setPropertyState.call(void 0, target, k, (state) => {
|
|
209
|
-
state.rpc =
|
|
209
|
+
state.rpc = _chunkBSE2DSDKjs.mergeObject.call(void 0, state.rpc || _optionalChain([_phecdacore.getState.call(void 0, target, k), 'optionalAccess', _11 => _11.rpc]), {
|
|
210
210
|
queue
|
|
211
211
|
});
|
|
212
212
|
});
|
|
@@ -222,27 +222,33 @@ function Rpc() {
|
|
|
222
222
|
}
|
|
223
223
|
_chunkZP7HNASUjs.__name.call(void 0, Rpc, "Rpc");
|
|
224
224
|
|
|
225
|
-
// src/decorators/
|
|
225
|
+
// src/decorators/ctx.ts
|
|
226
226
|
|
|
227
227
|
function Injectable() {
|
|
228
228
|
return (target) => _phecdacore.Empty.call(void 0, target);
|
|
229
229
|
}
|
|
230
230
|
_chunkZP7HNASUjs.__name.call(void 0, Injectable, "Injectable");
|
|
231
231
|
var Ctx = /* @__PURE__ */ _chunkZP7HNASUjs.__name.call(void 0, (target, key) => {
|
|
232
|
-
_phecdacore.
|
|
232
|
+
_phecdacore.setPropertyState.call(void 0, target, _phecdacore.SHARE_KEY, (state) => {
|
|
233
|
+
if (!state.ctxs)
|
|
234
|
+
state.ctxs = /* @__PURE__ */ new Set([
|
|
235
|
+
..._optionalChain([_phecdacore.getState.call(void 0, target), 'optionalAccess', _12 => _12.ctxs]) || []
|
|
236
|
+
]);
|
|
237
|
+
state.ctxs.add(key);
|
|
238
|
+
});
|
|
233
239
|
}, "Ctx");
|
|
234
240
|
function Define(key, value) {
|
|
235
241
|
return (target, k, index) => {
|
|
236
242
|
if (typeof index === "number") {
|
|
237
243
|
_phecdacore.setPropertyState.call(void 0, target, k, (state) => {
|
|
238
|
-
const parentState = _optionalChain([_phecdacore.getState.call(void 0, target, k), 'optionalAccess',
|
|
244
|
+
const parentState = _optionalChain([_phecdacore.getState.call(void 0, target, k), 'optionalAccess', _13 => _13.params]) || [];
|
|
239
245
|
if (!state.params)
|
|
240
246
|
state.params = [
|
|
241
247
|
...parentState
|
|
242
|
-
].map(
|
|
248
|
+
].map(_chunkBSE2DSDKjs.shallowClone);
|
|
243
249
|
const existItem = state.params.find((item) => item.index === index);
|
|
244
250
|
if (existItem)
|
|
245
|
-
existItem.define =
|
|
251
|
+
existItem.define = _chunkBSE2DSDKjs.mergeObject.call(void 0, existItem.define, {
|
|
246
252
|
[key]: value
|
|
247
253
|
});
|
|
248
254
|
else
|
|
@@ -256,9 +262,9 @@ function Define(key, value) {
|
|
|
256
262
|
return;
|
|
257
263
|
}
|
|
258
264
|
_phecdacore.setPropertyState.call(void 0, target, k, (state) => {
|
|
259
|
-
const parentState = _optionalChain([_phecdacore.getState.call(void 0, target, k), 'optionalAccess',
|
|
265
|
+
const parentState = _optionalChain([_phecdacore.getState.call(void 0, target, k), 'optionalAccess', _14 => _14.define]);
|
|
260
266
|
if (!state.define)
|
|
261
|
-
state.define =
|
|
267
|
+
state.define = _chunkBSE2DSDKjs.mergeObject.call(void 0, parentState);
|
|
262
268
|
state.define[key] = value;
|
|
263
269
|
});
|
|
264
270
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Construct } from 'phecda-core';
|
|
2
|
+
import { M as MetaData, h as Meta, E as Emitter } from './types-81be0ba3.js';
|
|
3
|
+
|
|
4
|
+
declare abstract class Generator {
|
|
5
|
+
private _path;
|
|
6
|
+
constructor(path?: string);
|
|
7
|
+
abstract name: string;
|
|
8
|
+
get path(): string;
|
|
9
|
+
abstract generateCode(meta: MetaData[]): string;
|
|
10
|
+
output(meta: Meta[]): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare const emitter: Emitter;
|
|
14
|
+
declare function Factory(models: (new (...args: any) => any)[], opts?: {
|
|
15
|
+
parseModule?: (module: any) => any;
|
|
16
|
+
parseMeta?: (meta: Meta) => Meta | null | undefined;
|
|
17
|
+
generators?: Generator[];
|
|
18
|
+
}): Promise<{
|
|
19
|
+
moduleMap: Map<PropertyKey, any>;
|
|
20
|
+
constructorMap: Map<any, any>;
|
|
21
|
+
meta: Meta[];
|
|
22
|
+
add: (Model: Construct) => Promise<void>;
|
|
23
|
+
del: (tag: PropertyKey) => Promise<any>;
|
|
24
|
+
destroy: () => Promise<void>;
|
|
25
|
+
}>;
|
|
26
|
+
|
|
27
|
+
export { Factory as F, Generator as G, emitter as e };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IncomingHttpHeaders } from 'node:http';
|
|
2
|
-
import { D as DefaultOptions, B as BaseContext, C as ControllerMetaData } from './
|
|
2
|
+
import { D as DefaultOptions, B as BaseContext, C as ControllerMetaData } from './types-81be0ba3.js';
|
|
3
3
|
|
|
4
4
|
declare function resolveDep(ret: any, key: string): any;
|
|
5
5
|
interface HttpOptions extends DefaultOptions {
|
package/dist/helper.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { h as Meta, i as ControllerMeta } from './types-81be0ba3.js';
|
|
2
|
+
export { a as HttpContext, H as HttpOptions, b as argToReq, r as resolveDep } from './helper-49c7213c.js';
|
|
3
|
+
export { a as RpcClientOptions, b as RpcContext, R as RpcServerOptions, g as genClientQueue } from './helper-5d755442.js';
|
|
4
|
+
import 'phecda-core';
|
|
5
|
+
import 'node:http';
|
|
6
|
+
|
|
7
|
+
declare function HMR(cb: (...args: any) => any): void;
|
|
8
|
+
|
|
9
|
+
declare function shallowClone(obj: any): any;
|
|
10
|
+
declare function mergeObject(...args: any[]): any;
|
|
11
|
+
|
|
12
|
+
declare function createControllerMetaMap(meta: Meta[], filter: (meta: Meta) => boolean | void): Map<string, Record<string, ControllerMeta>>;
|
|
13
|
+
declare function detectAopDep(meta: Meta[], { guards, interceptors, plugins }?: {
|
|
14
|
+
guards?: string[];
|
|
15
|
+
interceptors?: string[];
|
|
16
|
+
plugins?: string[];
|
|
17
|
+
}, controller?: string): {
|
|
18
|
+
pluginSet: Set<string>;
|
|
19
|
+
guardSet: Set<string>;
|
|
20
|
+
interceptorSet: Set<string>;
|
|
21
|
+
pipeSet: Set<string>;
|
|
22
|
+
filterSet: Set<string>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { HMR, createControllerMetaMap, detectAopDep, mergeObject, shallowClone };
|
package/dist/helper.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkBSE2DSDKjs = require('./chunk-BSE2DSDK.js');
|
|
11
|
+
require('./chunk-ZP7HNASU.js');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.HMR = _chunkBSE2DSDKjs.HMR; exports.argToReq = _chunkBSE2DSDKjs.argToReq; exports.createControllerMetaMap = _chunkBSE2DSDKjs.createControllerMetaMap; exports.detectAopDep = _chunkBSE2DSDKjs.detectAopDep; exports.genClientQueue = _chunkBSE2DSDKjs.genClientQueue; exports.mergeObject = _chunkBSE2DSDKjs.mergeObject; exports.resolveDep = _chunkBSE2DSDKjs.resolveDep; exports.shallowClone = _chunkBSE2DSDKjs.shallowClone;
|
package/dist/helper.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HMR,
|
|
3
|
+
argToReq,
|
|
4
|
+
createControllerMetaMap,
|
|
5
|
+
detectAopDep,
|
|
6
|
+
genClientQueue,
|
|
7
|
+
mergeObject,
|
|
8
|
+
resolveDep,
|
|
9
|
+
shallowClone
|
|
10
|
+
} from "./chunk-JE6BBDXW.mjs";
|
|
11
|
+
import "./chunk-VLV3AO3H.mjs";
|
|
12
|
+
export {
|
|
13
|
+
HMR,
|
|
14
|
+
argToReq,
|
|
15
|
+
createControllerMetaMap,
|
|
16
|
+
detectAopDep,
|
|
17
|
+
genClientQueue,
|
|
18
|
+
mergeObject,
|
|
19
|
+
resolveDep,
|
|
20
|
+
shallowClone
|
|
21
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { B as BaseContext, D as DefaultOptions,
|
|
2
|
-
export {
|
|
1
|
+
import { B as BaseContext, D as DefaultOptions, C as ControllerMetaData, M as MetaData, U as UNMOUNT_SYMBOL, a as BaseError } from './types-81be0ba3.js';
|
|
2
|
+
export { e as BaseRequestType, d as BaseReturn, i as ControllerMeta, f as CustomResponse, j as ERROR_SYMBOL, E as Emitter, g as ExtractResponse, I as IS_HMR, k as IS_ONLY_GENERATE, l as IS_STRICT, L as LOG_LEVEL, h as Meta, O as OmitFunction, m as PS_EXIT_CODE, P as PickFunc, S as ServiceMetaData, c as ToClientFn, b as ToClientInstance, T as ToClientMap } from './types-81be0ba3.js';
|
|
3
|
+
import { G as Generator } from './core-7f6d2be6.js';
|
|
4
|
+
export { F as Factory, e as emitter } from './core-7f6d2be6.js';
|
|
3
5
|
import { Construct, AbConstruct } from 'phecda-core';
|
|
4
6
|
export * from 'phecda-core';
|
|
5
|
-
export { a as HttpContext, H as HttpOptions, b as argToReq, r as resolveDep } from './helper-fcbf6aa8.js';
|
|
6
|
-
export { a as RpcClientOptions, b as RpcContext, R as RpcServerOptions, g as genClientQueue } from './helper-6133f78f.js';
|
|
7
|
-
import 'node:http';
|
|
8
7
|
|
|
9
8
|
declare class Exception extends Error {
|
|
10
9
|
message: string;
|
|
@@ -241,23 +240,4 @@ declare function setLogger(logger: Record<LogLevel, (msg: string) => void>): voi
|
|
|
241
240
|
declare function log(msg: string, level?: LogLevel): void;
|
|
242
241
|
declare function Mix<C1 extends Construct | AbConstruct, C2 extends Construct>(InternalClass: C1, ExtendClass: C2): new (...args: ConstructorParameters<C2>) => InstanceType<C1> & InstanceType<C2>;
|
|
243
242
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
declare function shallowClone(obj: any): any;
|
|
247
|
-
declare function mergeObject(...args: any[]): any;
|
|
248
|
-
declare function mergeArray(...args: any[]): any[];
|
|
249
|
-
|
|
250
|
-
declare function createControllerMetaMap(meta: Meta[], filter: (meta: Meta) => boolean | void): Map<string, Record<string, ControllerMeta>>;
|
|
251
|
-
declare function detectAopDep(meta: Meta[], { guards, interceptors, plugins }?: {
|
|
252
|
-
guards?: string[];
|
|
253
|
-
interceptors?: string[];
|
|
254
|
-
plugins?: string[];
|
|
255
|
-
}, controller?: string): {
|
|
256
|
-
pluginSet: Set<string>;
|
|
257
|
-
guardSet: Set<string>;
|
|
258
|
-
interceptorSet: Set<string>;
|
|
259
|
-
pipeSet: Set<string>;
|
|
260
|
-
filterSet: Set<string>;
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMeta, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Dev, Event, Exception, Filter, FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, GuardType, HMR, HTTPGenerator, Head, Header, Injectable, Interceptor, InterceptorType, InvalidInputException, Meta, MetaData, Mix, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, PipeArg, PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, ServiceUnavailableException, TimeoutException, TimerException, UNMOUNT_SYMBOL, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, createControllerMetaMap, defaultPipe, detectAopDep, log, mergeArray, mergeObject, setLogger, shallowClone };
|
|
243
|
+
export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Dev, Event, Exception, Filter, FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, GuardType, HTTPGenerator, Head, Header, Injectable, Interceptor, InterceptorType, InvalidInputException, MetaData, Mix, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, PipeArg, PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, ServiceUnavailableException, TimeoutException, TimerException, UNMOUNT_SYMBOL, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, defaultPipe, log, setLogger };
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk5BVUCNMAjs = require('./chunk-5BVUCNMA.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -29,7 +29,7 @@ var _chunkHMPTPTFLjs = require('./chunk-HMPTPTFL.js');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkVMLHTEW3js = require('./chunk-VMLHTEW3.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
@@ -55,16 +55,7 @@ var _chunk3BV2GRS7js = require('./chunk-3BV2GRS7.js');
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var _chunkFSBD5R22js = require('./chunk-FSBD5R22.js');
|
|
58
|
+
var _chunkBSE2DSDKjs = require('./chunk-BSE2DSDK.js');
|
|
68
59
|
|
|
69
60
|
|
|
70
61
|
|
|
@@ -129,9 +120,9 @@ var PFilter = class extends Dev {
|
|
|
129
120
|
constructor(tag) {
|
|
130
121
|
super();
|
|
131
122
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
132
|
-
|
|
123
|
+
_chunkBSE2DSDKjs.addFilter.call(void 0, this.key, this.use.bind(this));
|
|
133
124
|
this.onUnmount(() => {
|
|
134
|
-
delete
|
|
125
|
+
delete _chunkBSE2DSDKjs.Context.filterRecord[this.key];
|
|
135
126
|
});
|
|
136
127
|
}
|
|
137
128
|
};
|
|
@@ -144,9 +135,9 @@ var PGuard = class extends Dev {
|
|
|
144
135
|
constructor(tag) {
|
|
145
136
|
super();
|
|
146
137
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
147
|
-
|
|
138
|
+
_chunkBSE2DSDKjs.addGuard.call(void 0, this.key, this.use.bind(this));
|
|
148
139
|
this.onUnmount(() => {
|
|
149
|
-
delete
|
|
140
|
+
delete _chunkBSE2DSDKjs.Context.guardRecord[this.key];
|
|
150
141
|
});
|
|
151
142
|
}
|
|
152
143
|
};
|
|
@@ -160,9 +151,9 @@ var PInterceptor = class extends Dev {
|
|
|
160
151
|
super();
|
|
161
152
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
162
153
|
this.onUnmount(() => {
|
|
163
|
-
delete
|
|
154
|
+
delete _chunkBSE2DSDKjs.Context.interceptorRecord[this.key];
|
|
164
155
|
});
|
|
165
|
-
|
|
156
|
+
_chunkBSE2DSDKjs.addInterceptor.call(void 0, this.key, this.use.bind(this));
|
|
166
157
|
}
|
|
167
158
|
};
|
|
168
159
|
_chunkZP7HNASUjs.__name.call(void 0, PInterceptor, "PInterceptor");
|
|
@@ -174,9 +165,9 @@ var PPipe = class extends Dev {
|
|
|
174
165
|
constructor(tag) {
|
|
175
166
|
super();
|
|
176
167
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
177
|
-
|
|
168
|
+
_chunkBSE2DSDKjs.addPipe.call(void 0, this.key, this.use.bind(this));
|
|
178
169
|
this.onUnmount(() => {
|
|
179
|
-
delete
|
|
170
|
+
delete _chunkBSE2DSDKjs.Context.pipeRecord[this.key];
|
|
180
171
|
});
|
|
181
172
|
}
|
|
182
173
|
};
|
|
@@ -189,9 +180,9 @@ var PPlugin = class extends Dev {
|
|
|
189
180
|
constructor(tag) {
|
|
190
181
|
super();
|
|
191
182
|
this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
192
|
-
|
|
183
|
+
_chunkBSE2DSDKjs.addPlugin.call(void 0, this.key, this.use.bind(this));
|
|
193
184
|
this.onUnmount(() => {
|
|
194
|
-
delete
|
|
185
|
+
delete _chunkBSE2DSDKjs.Context.pluginRecord[this.key];
|
|
195
186
|
});
|
|
196
187
|
}
|
|
197
188
|
};
|
|
@@ -205,33 +196,33 @@ var PExtension = class extends Dev {
|
|
|
205
196
|
super();
|
|
206
197
|
const key = this.key = tag || _phecdacore.getTag.call(void 0, this);
|
|
207
198
|
if (this.pipe) {
|
|
208
|
-
|
|
199
|
+
_chunkBSE2DSDKjs.addPipe.call(void 0, key, this.pipe.bind(this));
|
|
209
200
|
this.onUnmount(() => {
|
|
210
|
-
delete
|
|
201
|
+
delete _chunkBSE2DSDKjs.Context.pipeRecord[key];
|
|
211
202
|
});
|
|
212
203
|
}
|
|
213
204
|
if (this.plugin) {
|
|
214
|
-
|
|
205
|
+
_chunkBSE2DSDKjs.addPlugin.call(void 0, key, this.plugin.bind(this));
|
|
215
206
|
this.onUnmount(() => {
|
|
216
|
-
delete
|
|
207
|
+
delete _chunkBSE2DSDKjs.Context.pluginRecord[key];
|
|
217
208
|
});
|
|
218
209
|
}
|
|
219
210
|
if (this.intercept) {
|
|
220
|
-
|
|
211
|
+
_chunkBSE2DSDKjs.addInterceptor.call(void 0, key, this.intercept.bind(this));
|
|
221
212
|
this.onUnmount(() => {
|
|
222
|
-
delete
|
|
213
|
+
delete _chunkBSE2DSDKjs.Context.interceptorRecord[key];
|
|
223
214
|
});
|
|
224
215
|
}
|
|
225
216
|
if (this.guard) {
|
|
226
|
-
|
|
217
|
+
_chunkBSE2DSDKjs.addGuard.call(void 0, key, this.guard.bind(this));
|
|
227
218
|
this.onUnmount(() => {
|
|
228
|
-
delete
|
|
219
|
+
delete _chunkBSE2DSDKjs.Context.guardRecord[key];
|
|
229
220
|
});
|
|
230
221
|
}
|
|
231
222
|
if (this.filter) {
|
|
232
|
-
|
|
223
|
+
_chunkBSE2DSDKjs.addFilter.call(void 0, key, this.filter.bind(this));
|
|
233
224
|
this.onUnmount(() => {
|
|
234
|
-
delete
|
|
225
|
+
delete _chunkBSE2DSDKjs.Context.filterRecord[key];
|
|
235
226
|
});
|
|
236
227
|
}
|
|
237
228
|
}
|
|
@@ -410,13 +401,4 @@ _chunkZP7HNASUjs.__name.call(void 0, HTTPGenerator, "HTTPGenerator");
|
|
|
410
401
|
|
|
411
402
|
|
|
412
403
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
exports.Arg = _chunk3BV2GRS7js.Arg; exports.BadGatewayException = _chunkFSBD5R22js.BadGatewayException; exports.BadRequestException = _chunkFSBD5R22js.BadRequestException; exports.BaseParam = _chunk3BV2GRS7js.BaseParam; exports.Body = _chunk3BV2GRS7js.Body; exports.ConflictException = _chunkFSBD5R22js.ConflictException; exports.Context = _chunkFSBD5R22js.Context; exports.Controller = _chunk3BV2GRS7js.Controller; exports.Ctx = _chunk3BV2GRS7js.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunk3BV2GRS7js.Define; exports.Delete = _chunk3BV2GRS7js.Delete; exports.Dev = Dev; exports.ERROR_SYMBOL = _chunkZP7HNASUjs.ERROR_SYMBOL; exports.Event = _chunk3BV2GRS7js.Event; exports.Exception = _chunkFSBD5R22js.Exception; exports.Factory = _chunkHMPTPTFLjs.Factory; exports.Filter = _chunk3BV2GRS7js.Filter; exports.ForbiddenException = _chunkFSBD5R22js.ForbiddenException; exports.FrameworkException = _chunkFSBD5R22js.FrameworkException; exports.Generator = Generator; exports.Get = _chunk3BV2GRS7js.Get; exports.Guard = _chunk3BV2GRS7js.Guard; exports.HMR = _chunkFSBD5R22js.HMR; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunk3BV2GRS7js.Head; exports.Header = _chunk3BV2GRS7js.Header; exports.IS_HMR = _chunkZP7HNASUjs.IS_HMR; exports.IS_ONLY_GENERATE = _chunkZP7HNASUjs.IS_ONLY_GENERATE; exports.IS_STRICT = _chunkZP7HNASUjs.IS_STRICT; exports.Injectable = _chunk3BV2GRS7js.Injectable; exports.Interceptor = _chunk3BV2GRS7js.Interceptor; exports.InvalidInputException = _chunkFSBD5R22js.InvalidInputException; exports.LOG_LEVEL = _chunkZP7HNASUjs.LOG_LEVEL; exports.Meta = _chunkHMPTPTFLjs.Meta; exports.Mix = _chunkZP7HNASUjs.Mix; exports.NotFoundException = _chunkFSBD5R22js.NotFoundException; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PInterceptor = PInterceptor; exports.PPipe = PPipe; exports.PPlugin = PPlugin; exports.PS_EXIT_CODE = _chunkZP7HNASUjs.PS_EXIT_CODE; exports.Param = _chunk3BV2GRS7js.Param; exports.Patch = _chunk3BV2GRS7js.Patch; exports.PayloadLargeException = _chunkFSBD5R22js.PayloadLargeException; exports.Pipe = _chunk3BV2GRS7js.Pipe; exports.Plugin = _chunk3BV2GRS7js.Plugin; exports.Post = _chunk3BV2GRS7js.Post; exports.Put = _chunk3BV2GRS7js.Put; exports.Query = _chunk3BV2GRS7js.Query; exports.Queue = _chunk3BV2GRS7js.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunk3BV2GRS7js.Route; exports.Rpc = _chunk3BV2GRS7js.Rpc; exports.ServiceUnavailableException = _chunkFSBD5R22js.ServiceUnavailableException; exports.TimeoutException = _chunkFSBD5R22js.TimeoutException; exports.TimerException = _chunkFSBD5R22js.TimerException; exports.UNMOUNT_SYMBOL = _chunkZP7HNASUjs.UNMOUNT_SYMBOL; exports.UnauthorizedException = _chunkFSBD5R22js.UnauthorizedException; exports.UndefinedException = _chunkFSBD5R22js.UndefinedException; exports.UnsupportedMediaTypeException = _chunkFSBD5R22js.UnsupportedMediaTypeException; exports.ValidateException = _chunkFSBD5R22js.ValidateException; exports.WorkerException = _chunkFSBD5R22js.WorkerException; exports.addFilter = _chunkFSBD5R22js.addFilter; exports.addGuard = _chunkFSBD5R22js.addGuard; exports.addInterceptor = _chunkFSBD5R22js.addInterceptor; exports.addPipe = _chunkFSBD5R22js.addPipe; exports.addPlugin = _chunkFSBD5R22js.addPlugin; exports.argToReq = _chunkFSBD5R22js.argToReq; exports.createControllerMetaMap = _chunkFSBD5R22js.createControllerMetaMap; exports.defaultPipe = _chunkFSBD5R22js.defaultPipe; exports.detectAopDep = _chunkFSBD5R22js.detectAopDep; exports.emitter = _chunkHMPTPTFLjs.emitter; exports.genClientQueue = _chunkFSBD5R22js.genClientQueue; exports.log = _chunkZP7HNASUjs.log; exports.mergeArray = _chunkFSBD5R22js.mergeArray; exports.mergeObject = _chunkFSBD5R22js.mergeObject; exports.resolveDep = _chunkFSBD5R22js.resolveDep; exports.setLogger = _chunkZP7HNASUjs.setLogger; exports.shallowClone = _chunkFSBD5R22js.shallowClone;
|
|
404
|
+
exports.Arg = _chunkVMLHTEW3js.Arg; exports.BadGatewayException = _chunkBSE2DSDKjs.BadGatewayException; exports.BadRequestException = _chunkBSE2DSDKjs.BadRequestException; exports.BaseParam = _chunkVMLHTEW3js.BaseParam; exports.Body = _chunkVMLHTEW3js.Body; exports.ConflictException = _chunkBSE2DSDKjs.ConflictException; exports.Context = _chunkBSE2DSDKjs.Context; exports.Controller = _chunkVMLHTEW3js.Controller; exports.Ctx = _chunkVMLHTEW3js.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkVMLHTEW3js.Define; exports.Delete = _chunkVMLHTEW3js.Delete; exports.Dev = Dev; exports.ERROR_SYMBOL = _chunkZP7HNASUjs.ERROR_SYMBOL; exports.Event = _chunkVMLHTEW3js.Event; exports.Exception = _chunkBSE2DSDKjs.Exception; exports.Factory = _chunk5BVUCNMAjs.Factory; exports.Filter = _chunkVMLHTEW3js.Filter; exports.ForbiddenException = _chunkBSE2DSDKjs.ForbiddenException; exports.FrameworkException = _chunkBSE2DSDKjs.FrameworkException; exports.Generator = Generator; exports.Get = _chunkVMLHTEW3js.Get; exports.Guard = _chunkVMLHTEW3js.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkVMLHTEW3js.Head; exports.Header = _chunkVMLHTEW3js.Header; exports.IS_HMR = _chunkZP7HNASUjs.IS_HMR; exports.IS_ONLY_GENERATE = _chunkZP7HNASUjs.IS_ONLY_GENERATE; exports.IS_STRICT = _chunkZP7HNASUjs.IS_STRICT; exports.Injectable = _chunkVMLHTEW3js.Injectable; exports.Interceptor = _chunkVMLHTEW3js.Interceptor; exports.InvalidInputException = _chunkBSE2DSDKjs.InvalidInputException; exports.LOG_LEVEL = _chunkZP7HNASUjs.LOG_LEVEL; exports.Meta = _chunk5BVUCNMAjs.Meta; exports.Mix = _chunkZP7HNASUjs.Mix; exports.NotFoundException = _chunkBSE2DSDKjs.NotFoundException; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PInterceptor = PInterceptor; exports.PPipe = PPipe; exports.PPlugin = PPlugin; exports.PS_EXIT_CODE = _chunkZP7HNASUjs.PS_EXIT_CODE; exports.Param = _chunkVMLHTEW3js.Param; exports.Patch = _chunkVMLHTEW3js.Patch; exports.PayloadLargeException = _chunkBSE2DSDKjs.PayloadLargeException; exports.Pipe = _chunkVMLHTEW3js.Pipe; exports.Plugin = _chunkVMLHTEW3js.Plugin; exports.Post = _chunkVMLHTEW3js.Post; exports.Put = _chunkVMLHTEW3js.Put; exports.Query = _chunkVMLHTEW3js.Query; exports.Queue = _chunkVMLHTEW3js.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkVMLHTEW3js.Route; exports.Rpc = _chunkVMLHTEW3js.Rpc; exports.ServiceUnavailableException = _chunkBSE2DSDKjs.ServiceUnavailableException; exports.TimeoutException = _chunkBSE2DSDKjs.TimeoutException; exports.TimerException = _chunkBSE2DSDKjs.TimerException; exports.UNMOUNT_SYMBOL = _chunkZP7HNASUjs.UNMOUNT_SYMBOL; exports.UnauthorizedException = _chunkBSE2DSDKjs.UnauthorizedException; exports.UndefinedException = _chunkBSE2DSDKjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkBSE2DSDKjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkBSE2DSDKjs.ValidateException; exports.WorkerException = _chunkBSE2DSDKjs.WorkerException; exports.addFilter = _chunkBSE2DSDKjs.addFilter; exports.addGuard = _chunkBSE2DSDKjs.addGuard; exports.addInterceptor = _chunkBSE2DSDKjs.addInterceptor; exports.addPipe = _chunkBSE2DSDKjs.addPipe; exports.addPlugin = _chunkBSE2DSDKjs.addPlugin; exports.defaultPipe = _chunkBSE2DSDKjs.defaultPipe; exports.emitter = _chunk5BVUCNMAjs.emitter; exports.log = _chunkZP7HNASUjs.log; exports.setLogger = _chunkZP7HNASUjs.setLogger;
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Factory,
|
|
3
3
|
Meta,
|
|
4
4
|
emitter
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CKQW3FDK.mjs";
|
|
6
6
|
import {
|
|
7
7
|
Arg,
|
|
8
8
|
BaseParam,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
Queue,
|
|
30
30
|
Route,
|
|
31
31
|
Rpc
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-V3WIKOP3.mjs";
|
|
33
33
|
import {
|
|
34
34
|
BadGatewayException,
|
|
35
35
|
BadRequestException,
|
|
@@ -38,7 +38,6 @@ import {
|
|
|
38
38
|
Exception,
|
|
39
39
|
ForbiddenException,
|
|
40
40
|
FrameworkException,
|
|
41
|
-
HMR,
|
|
42
41
|
InvalidInputException,
|
|
43
42
|
NotFoundException,
|
|
44
43
|
PayloadLargeException,
|
|
@@ -55,16 +54,8 @@ import {
|
|
|
55
54
|
addInterceptor,
|
|
56
55
|
addPipe,
|
|
57
56
|
addPlugin,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
defaultPipe,
|
|
61
|
-
detectAopDep,
|
|
62
|
-
genClientQueue,
|
|
63
|
-
mergeArray,
|
|
64
|
-
mergeObject,
|
|
65
|
-
resolveDep,
|
|
66
|
-
shallowClone
|
|
67
|
-
} from "./chunk-665MB62T.mjs";
|
|
57
|
+
defaultPipe
|
|
58
|
+
} from "./chunk-JE6BBDXW.mjs";
|
|
68
59
|
import {
|
|
69
60
|
ERROR_SYMBOL,
|
|
70
61
|
IS_HMR,
|
|
@@ -360,7 +351,6 @@ export {
|
|
|
360
351
|
Generator,
|
|
361
352
|
Get,
|
|
362
353
|
Guard,
|
|
363
|
-
HMR,
|
|
364
354
|
HTTPGenerator,
|
|
365
355
|
Head,
|
|
366
356
|
Header,
|
|
@@ -407,16 +397,8 @@ export {
|
|
|
407
397
|
addInterceptor,
|
|
408
398
|
addPipe,
|
|
409
399
|
addPlugin,
|
|
410
|
-
argToReq,
|
|
411
|
-
createControllerMetaMap,
|
|
412
400
|
defaultPipe,
|
|
413
|
-
detectAopDep,
|
|
414
401
|
emitter,
|
|
415
|
-
genClientQueue,
|
|
416
402
|
log,
|
|
417
|
-
|
|
418
|
-
mergeObject,
|
|
419
|
-
resolveDep,
|
|
420
|
-
setLogger,
|
|
421
|
-
shallowClone
|
|
403
|
+
setLogger
|
|
422
404
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
|
|
2
|
-
import { F as Factory
|
|
3
|
-
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../helper-
|
|
2
|
+
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
3
|
+
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../helper-5d755442.js';
|
|
4
|
+
import { T as ToClientMap } from '../../types-81be0ba3.js';
|
|
4
5
|
import 'phecda-core';
|
|
5
6
|
|
|
6
7
|
interface BullmqCtx extends RpcContext {
|
package/dist/rpc/bullmq/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkBSE2DSDKjs = require('../../chunk-BSE2DSDK.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkZP7HNASUjs = require('../../chunk-ZP7HNASU.js');
|
|
@@ -18,14 +18,14 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
18
18
|
const workerMap = {};
|
|
19
19
|
const queueMap = {};
|
|
20
20
|
const existQueue = /* @__PURE__ */ new Set();
|
|
21
|
-
const metaMap =
|
|
21
|
+
const metaMap = _chunkBSE2DSDKjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
22
22
|
const { controller, rpc, func, tag } = meta2.data;
|
|
23
23
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
24
24
|
debug(`register method "${func}" in module "${tag}"`);
|
|
25
25
|
return true;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
|
|
28
|
+
_chunkBSE2DSDKjs.detectAopDep.call(void 0, meta, {
|
|
29
29
|
guards: globalGuards,
|
|
30
30
|
interceptors: globalInterceptors
|
|
31
31
|
}, "rpc");
|
|
@@ -56,7 +56,7 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
56
56
|
const { data: { rpc: { isEvent } = {} } } = meta2;
|
|
57
57
|
if (!isEvent && !(clientQueue in queueMap))
|
|
58
58
|
queueMap[clientQueue] = new (0, _bullmq.Queue)(clientQueue, queueOpts);
|
|
59
|
-
const context = new (0,
|
|
59
|
+
const context = new (0, _chunkBSE2DSDKjs.Context)({
|
|
60
60
|
type: "bullmq",
|
|
61
61
|
moduleMap,
|
|
62
62
|
meta: meta2,
|
|
@@ -91,7 +91,7 @@ async function create({ moduleMap, meta }, opts = {}) {
|
|
|
91
91
|
}
|
|
92
92
|
_chunkZP7HNASUjs.__name.call(void 0, handleRequest, "handleRequest");
|
|
93
93
|
subscribeQueues();
|
|
94
|
-
|
|
94
|
+
_chunkBSE2DSDKjs.HMR.call(void 0, async () => {
|
|
95
95
|
for (const i in workerMap)
|
|
96
96
|
await workerMap[i].close(true);
|
|
97
97
|
for (const i in queueMap)
|
|
@@ -114,7 +114,7 @@ async function createClient(controllers, opts = {}) {
|
|
|
114
114
|
const { max, workerOpts, queueOpts, timeout, key } = opts;
|
|
115
115
|
const ret = {};
|
|
116
116
|
const emitter = new (0, _events.EventEmitter)();
|
|
117
|
-
const clientQueue =
|
|
117
|
+
const clientQueue = _chunkBSE2DSDKjs.genClientQueue.call(void 0, key);
|
|
118
118
|
const queueMap = {};
|
|
119
119
|
new (0, _bullmq.Worker)(clientQueue, async (job) => {
|
|
120
120
|
const { data, id, error } = job.data;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Consumer, Producer } from 'kafkajs';
|
|
2
|
-
import { F as Factory
|
|
3
|
-
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../helper-
|
|
2
|
+
import { F as Factory } from '../../core-7f6d2be6.js';
|
|
3
|
+
import { b as RpcContext, R as RpcServerOptions, a as RpcClientOptions } from '../../helper-5d755442.js';
|
|
4
|
+
import { T as ToClientMap } from '../../types-81be0ba3.js';
|
|
4
5
|
import 'phecda-core';
|
|
5
6
|
|
|
6
7
|
interface KafkaCtx extends RpcContext {
|
package/dist/rpc/kafka/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkBSE2DSDKjs = require('../../chunk-BSE2DSDK.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkZP7HNASUjs = require('../../chunk-ZP7HNASU.js');
|
|
@@ -14,14 +14,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/kafka");
|
|
|
14
14
|
async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
|
|
15
15
|
const { globalGuards, globalInterceptors, globalFilter, globalPipe } = opts;
|
|
16
16
|
const existQueue = /* @__PURE__ */ new Set();
|
|
17
|
-
const metaMap =
|
|
17
|
+
const metaMap = _chunkBSE2DSDKjs.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
18
18
|
const { controller, rpc, func, tag } = meta2.data;
|
|
19
19
|
if (controller === "rpc" && _optionalChain([rpc, 'optionalAccess', _ => _.queue]) !== void 0) {
|
|
20
20
|
debug(`register method "${func}" in module "${tag}"`);
|
|
21
21
|
return true;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
_chunkBSE2DSDKjs.detectAopDep.call(void 0, meta, {
|
|
25
25
|
guards: globalGuards,
|
|
26
26
|
interceptors: globalInterceptors
|
|
27
27
|
}, "rpc");
|
|
@@ -58,7 +58,7 @@ async function bind({ consumer, producer }, { moduleMap, meta }, opts = {}) {
|
|
|
58
58
|
const meta2 = metaMap.get(tag)[func];
|
|
59
59
|
const { data: { rpc } } = meta2;
|
|
60
60
|
const isEvent = rpc.isEvent;
|
|
61
|
-
const context = new (0,
|
|
61
|
+
const context = new (0, _chunkBSE2DSDKjs.Context)({
|
|
62
62
|
type: "kafka",
|
|
63
63
|
moduleMap,
|
|
64
64
|
meta: meta2,
|
|
@@ -120,7 +120,7 @@ async function createClient({ producer, consumer }, controllers, opts) {
|
|
|
120
120
|
let eventCount = 1;
|
|
121
121
|
const ret = {};
|
|
122
122
|
const emitter = new (0, _events.EventEmitter)();
|
|
123
|
-
const clientQueue =
|
|
123
|
+
const clientQueue = _chunkBSE2DSDKjs.genClientQueue.call(void 0, _optionalChain([opts, 'optionalAccess', _2 => _2.key]));
|
|
124
124
|
await consumer.subscribe({
|
|
125
125
|
topic: clientQueue,
|
|
126
126
|
fromBeginning: true
|