phecda-server 5.2.6 → 5.3.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/dist/index.d.mts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +27 -2
- package/dist/index.mjs +26 -1
- package/dist/rpc/bullmq/index.d.mts +1 -1
- package/dist/rpc/bullmq/index.d.ts +1 -1
- package/dist/rpc/kafka/index.d.mts +1 -1
- package/dist/rpc/kafka/index.d.ts +1 -1
- package/dist/rpc/nats/index.d.mts +1 -1
- package/dist/rpc/nats/index.d.ts +1 -1
- package/dist/rpc/rabbitmq/index.d.mts +1 -1
- package/dist/rpc/rabbitmq/index.d.ts +1 -1
- package/dist/rpc/redis/index.d.mts +1 -1
- package/dist/rpc/redis/index.d.ts +1 -1
- package/dist/server/elysia/index.d.mts +1 -1
- package/dist/server/elysia/index.d.ts +1 -1
- package/dist/server/elysia/index.js +20 -2
- package/dist/server/elysia/index.mjs +20 -2
- package/dist/server/express/index.d.mts +1 -1
- package/dist/server/express/index.d.ts +1 -1
- package/dist/server/express/index.js +19 -5
- package/dist/server/express/index.mjs +19 -5
- package/dist/server/fastify/index.d.mts +1 -1
- package/dist/server/fastify/index.d.ts +1 -1
- package/dist/server/fastify/index.js +23 -5
- package/dist/server/fastify/index.mjs +23 -5
- package/dist/server/h3/index.d.mts +1 -1
- package/dist/server/h3/index.d.ts +1 -1
- package/dist/server/h3/index.js +14 -2
- package/dist/server/h3/index.mjs +15 -3
- package/dist/server/hono/index.d.mts +1 -1
- package/dist/server/hono/index.d.ts +1 -1
- package/dist/server/hono/index.js +19 -2
- package/dist/server/hono/index.mjs +19 -2
- package/dist/server/hyper-express/index.d.mts +1 -1
- package/dist/server/hyper-express/index.d.ts +1 -1
- package/dist/server/hyper-express/index.js +15 -3
- package/dist/server/hyper-express/index.mjs +14 -2
- package/dist/server/koa/index.d.mts +1 -1
- package/dist/server/koa/index.d.ts +1 -1
- package/dist/server/koa/index.js +19 -5
- package/dist/server/koa/index.mjs +19 -5
- package/dist/{types-vF4Hvnvo.d.mts → types-AgVwUXPC.d.mts} +1 -1
- package/dist/{types-CJSkC9tO.d.ts → types-B-ZFZajI.d.ts} +1 -1
- package/dist/types-BCJhmpQh.d.ts +45 -0
- package/dist/types-Dgxirc9f.d.mts +45 -0
- package/package.json +2 -2
- package/dist/types-Dp5ixUqW.d.mts +0 -27
- package/dist/types-PY43OKEP.d.ts +0 -27
package/dist/index.d.mts
CHANGED
|
@@ -4,8 +4,10 @@ import { G as Generator } from './core-Bc2ENEHX.mjs';
|
|
|
4
4
|
export { F as Factory, O as Options, c as createPhecda, e as emitter } from './core-Bc2ENEHX.mjs';
|
|
5
5
|
import { Base, Construct, AbConstruct } from 'phecda-core';
|
|
6
6
|
export * from 'phecda-core';
|
|
7
|
-
|
|
8
|
-
export {
|
|
7
|
+
import { H as HttpContext } from './types-Dgxirc9f.mjs';
|
|
8
|
+
export { C as CookieSerializeOptions, a as HttpOptions } from './types-Dgxirc9f.mjs';
|
|
9
|
+
import { R as RpcContext } from './types-AgVwUXPC.mjs';
|
|
10
|
+
export { b as RpcClientOptions, a as RpcServerOptions } from './types-AgVwUXPC.mjs';
|
|
9
11
|
import 'node:http';
|
|
10
12
|
|
|
11
13
|
declare class Exception extends Error {
|
|
@@ -176,9 +178,14 @@ declare function Define(key: string, value: any): any;
|
|
|
176
178
|
declare const defaultPipe: PipeType;
|
|
177
179
|
|
|
178
180
|
declare class ServerBase extends Base {
|
|
179
|
-
protected context: BaseContext;
|
|
180
181
|
emitter: Emitter;
|
|
181
182
|
}
|
|
183
|
+
declare class HttpBase extends ServerBase {
|
|
184
|
+
context: HttpContext;
|
|
185
|
+
}
|
|
186
|
+
declare class RpcBase extends ServerBase {
|
|
187
|
+
context: RpcContext;
|
|
188
|
+
}
|
|
182
189
|
|
|
183
190
|
declare abstract class PFilter<C extends BaseContext = any, E extends Exception = Exception> extends ServerBase {
|
|
184
191
|
readonly key: PropertyKey;
|
|
@@ -241,4 +248,4 @@ declare function setLogger(logger: Record<LogLevel, (msg: string) => void>): voi
|
|
|
241
248
|
declare function log(msg: string, level?: LogLevel): void;
|
|
242
249
|
declare function Mix<C1 extends Construct | AbConstruct, C2 extends Construct>(InternalClass: C1, ExtendClass: C2): new (...args: ConstructorParameters<C2>) => InstanceType<C1> & InstanceType<C2>;
|
|
243
250
|
|
|
244
|
-
export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Event, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, Injectable, Interceptor, type InterceptorType, InvalidInputException, MetaData, Mix, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, defaultPipe, log, setLogger };
|
|
251
|
+
export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Event, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpContext, Injectable, Interceptor, type InterceptorType, InvalidInputException, MetaData, Mix, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcContext, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, defaultPipe, log, setLogger };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,10 @@ import { G as Generator } from './core-dx9E5x2N.js';
|
|
|
4
4
|
export { F as Factory, O as Options, c as createPhecda, e as emitter } from './core-dx9E5x2N.js';
|
|
5
5
|
import { Base, Construct, AbConstruct } from 'phecda-core';
|
|
6
6
|
export * from 'phecda-core';
|
|
7
|
-
|
|
8
|
-
export {
|
|
7
|
+
import { H as HttpContext } from './types-BCJhmpQh.js';
|
|
8
|
+
export { C as CookieSerializeOptions, a as HttpOptions } from './types-BCJhmpQh.js';
|
|
9
|
+
import { R as RpcContext } from './types-B-ZFZajI.js';
|
|
10
|
+
export { b as RpcClientOptions, a as RpcServerOptions } from './types-B-ZFZajI.js';
|
|
9
11
|
import 'node:http';
|
|
10
12
|
|
|
11
13
|
declare class Exception extends Error {
|
|
@@ -176,9 +178,14 @@ declare function Define(key: string, value: any): any;
|
|
|
176
178
|
declare const defaultPipe: PipeType;
|
|
177
179
|
|
|
178
180
|
declare class ServerBase extends Base {
|
|
179
|
-
protected context: BaseContext;
|
|
180
181
|
emitter: Emitter;
|
|
181
182
|
}
|
|
183
|
+
declare class HttpBase extends ServerBase {
|
|
184
|
+
context: HttpContext;
|
|
185
|
+
}
|
|
186
|
+
declare class RpcBase extends ServerBase {
|
|
187
|
+
context: RpcContext;
|
|
188
|
+
}
|
|
182
189
|
|
|
183
190
|
declare abstract class PFilter<C extends BaseContext = any, E extends Exception = Exception> extends ServerBase {
|
|
184
191
|
readonly key: PropertyKey;
|
|
@@ -241,4 +248,4 @@ declare function setLogger(logger: Record<LogLevel, (msg: string) => void>): voi
|
|
|
241
248
|
declare function log(msg: string, level?: LogLevel): void;
|
|
242
249
|
declare function Mix<C1 extends Construct | AbConstruct, C2 extends Construct>(InternalClass: C1, ExtendClass: C2): new (...args: ConstructorParameters<C2>) => InstanceType<C1> & InstanceType<C2>;
|
|
243
250
|
|
|
244
|
-
export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Event, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, Injectable, Interceptor, type InterceptorType, InvalidInputException, MetaData, Mix, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, defaultPipe, log, setLogger };
|
|
251
|
+
export { Arg, BadGatewayException, BadRequestException, BaseContext, BaseError, BaseParam, Body, ConflictException, Context, Controller, ControllerMetaData, Ctx, DefaultOptions, Define, Delete, Emitter, Event, Exception, Filter, type FilterType, ForbiddenException, FrameworkException, Generator, Get, Guard, type GuardType, HTTPGenerator, Head, Header, HttpBase, HttpContext, Injectable, Interceptor, type InterceptorType, InvalidInputException, MetaData, Mix, NotFoundException, PExtension, PFilter, PGuard, PInterceptor, PPipe, PPlugin, Param, Patch, PayloadLargeException, Pipe, type PipeArg, type PipeType, Plugin, Post, Put, Query, Queue, RPCGenerator, Route, Rpc, RpcBase, RpcContext, ServerBase, ServiceUnavailableException, TimeoutException, TimerException, UnauthorizedException, UndefinedException, UnsupportedMediaTypeException, ValidateException, WorkerException, addFilter, addGuard, addInterceptor, addPipe, addPlugin, defaultPipe, log, setLogger };
|
package/dist/index.js
CHANGED
|
@@ -88,16 +88,39 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
88
88
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
89
89
|
}
|
|
90
90
|
_chunkRVWBJ6LVjs.__name.call(void 0, _ts_decorate, "_ts_decorate");
|
|
91
|
+
function _ts_metadata(k, v) {
|
|
92
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
93
|
+
}
|
|
94
|
+
_chunkRVWBJ6LVjs.__name.call(void 0, _ts_metadata, "_ts_metadata");
|
|
91
95
|
var ServerBase = (_class = class extends _phecdacore.Base {constructor(...args2) { super(...args2); _class.prototype.__init.call(this); }
|
|
92
96
|
static {
|
|
93
97
|
_chunkRVWBJ6LVjs.__name.call(void 0, this, "ServerBase");
|
|
94
98
|
}
|
|
95
|
-
|
|
96
99
|
__init() {this.emitter = exports.emitter = _chunkN4ULJDEQjs.emitter}
|
|
97
100
|
}, _class);
|
|
98
101
|
ServerBase = exports.ServerBase = _ts_decorate([
|
|
99
102
|
_phecdacore.Empty
|
|
100
103
|
], ServerBase);
|
|
104
|
+
var HttpBase = class extends ServerBase {
|
|
105
|
+
static {
|
|
106
|
+
_chunkRVWBJ6LVjs.__name.call(void 0, this, "HttpBase");
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
};
|
|
110
|
+
_ts_decorate([
|
|
111
|
+
_chunkAUAAKHWSjs.Ctx,
|
|
112
|
+
_ts_metadata("design:type", typeof HttpContext === "undefined" ? Object : HttpContext)
|
|
113
|
+
], HttpBase.prototype, "context", void 0);
|
|
114
|
+
var RpcBase = class extends ServerBase {
|
|
115
|
+
static {
|
|
116
|
+
_chunkRVWBJ6LVjs.__name.call(void 0, this, "RpcBase");
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
};
|
|
120
|
+
_ts_decorate([
|
|
121
|
+
_chunkAUAAKHWSjs.Ctx,
|
|
122
|
+
_ts_metadata("design:type", typeof RpcContext === "undefined" ? Object : RpcContext)
|
|
123
|
+
], RpcBase.prototype, "context", void 0);
|
|
101
124
|
|
|
102
125
|
// src/modules/filter.ts
|
|
103
126
|
|
|
@@ -398,4 +421,6 @@ return ret
|
|
|
398
421
|
|
|
399
422
|
|
|
400
423
|
|
|
401
|
-
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
exports.Arg = _chunkAUAAKHWSjs.Arg; exports.BadGatewayException = _chunkQYX5Q7KOjs.BadGatewayException; exports.BadRequestException = _chunkQYX5Q7KOjs.BadRequestException; exports.BaseParam = _chunkAUAAKHWSjs.BaseParam; exports.Body = _chunkAUAAKHWSjs.Body; exports.ConflictException = _chunkQYX5Q7KOjs.ConflictException; exports.Context = _chunkQYX5Q7KOjs.Context; exports.Controller = _chunkAUAAKHWSjs.Controller; exports.Ctx = _chunkAUAAKHWSjs.Ctx; exports.CustomResponse = CustomResponse; exports.Define = _chunkAUAAKHWSjs.Define; exports.Delete = _chunkAUAAKHWSjs.Delete; exports.ERROR_SYMBOL = _chunkRVWBJ6LVjs.ERROR_SYMBOL; exports.Event = _chunkAUAAKHWSjs.Event; exports.Exception = _chunkQYX5Q7KOjs.Exception; exports.Factory = _chunkN4ULJDEQjs.Factory; exports.Filter = _chunkAUAAKHWSjs.Filter; exports.ForbiddenException = _chunkQYX5Q7KOjs.ForbiddenException; exports.FrameworkException = _chunkQYX5Q7KOjs.FrameworkException; exports.Generator = Generator; exports.Get = _chunkAUAAKHWSjs.Get; exports.Guard = _chunkAUAAKHWSjs.Guard; exports.HTTPGenerator = HTTPGenerator; exports.Head = _chunkAUAAKHWSjs.Head; exports.Header = _chunkAUAAKHWSjs.Header; exports.HttpBase = HttpBase; exports.IS_HMR = _chunkRVWBJ6LVjs.IS_HMR; exports.IS_ONLY_GENERATE = _chunkRVWBJ6LVjs.IS_ONLY_GENERATE; exports.IS_STRICT = _chunkRVWBJ6LVjs.IS_STRICT; exports.Injectable = _chunkAUAAKHWSjs.Injectable; exports.Interceptor = _chunkAUAAKHWSjs.Interceptor; exports.InvalidInputException = _chunkQYX5Q7KOjs.InvalidInputException; exports.LOG_LEVEL = _chunkRVWBJ6LVjs.LOG_LEVEL; exports.Meta = _chunkN4ULJDEQjs.Meta; exports.Mix = _chunkRVWBJ6LVjs.Mix; exports.NotFoundException = _chunkQYX5Q7KOjs.NotFoundException; exports.PExtension = PExtension; exports.PFilter = PFilter; exports.PGuard = PGuard; exports.PInterceptor = PInterceptor; exports.PPipe = PPipe; exports.PPlugin = PPlugin; exports.PS_EXIT_CODE = _chunkRVWBJ6LVjs.PS_EXIT_CODE; exports.Param = _chunkAUAAKHWSjs.Param; exports.Patch = _chunkAUAAKHWSjs.Patch; exports.PayloadLargeException = _chunkQYX5Q7KOjs.PayloadLargeException; exports.Pipe = _chunkAUAAKHWSjs.Pipe; exports.Plugin = _chunkAUAAKHWSjs.Plugin; exports.Post = _chunkAUAAKHWSjs.Post; exports.Put = _chunkAUAAKHWSjs.Put; exports.Query = _chunkAUAAKHWSjs.Query; exports.Queue = _chunkAUAAKHWSjs.Queue; exports.RPCGenerator = RPCGenerator; exports.Route = _chunkAUAAKHWSjs.Route; exports.Rpc = _chunkAUAAKHWSjs.Rpc; exports.RpcBase = RpcBase; exports.ServerBase = ServerBase; exports.ServiceUnavailableException = _chunkQYX5Q7KOjs.ServiceUnavailableException; exports.TimeoutException = _chunkQYX5Q7KOjs.TimeoutException; exports.TimerException = _chunkQYX5Q7KOjs.TimerException; exports.UnauthorizedException = _chunkQYX5Q7KOjs.UnauthorizedException; exports.UndefinedException = _chunkQYX5Q7KOjs.UndefinedException; exports.UnsupportedMediaTypeException = _chunkQYX5Q7KOjs.UnsupportedMediaTypeException; exports.ValidateException = _chunkQYX5Q7KOjs.ValidateException; exports.WorkerException = _chunkQYX5Q7KOjs.WorkerException; exports.addFilter = _chunkQYX5Q7KOjs.addFilter; exports.addGuard = _chunkQYX5Q7KOjs.addGuard; exports.addInterceptor = _chunkQYX5Q7KOjs.addInterceptor; exports.addPipe = _chunkQYX5Q7KOjs.addPipe; exports.addPlugin = _chunkQYX5Q7KOjs.addPlugin; exports.createPhecda = _chunkN4ULJDEQjs.createPhecda; exports.defaultPipe = _chunkQYX5Q7KOjs.defaultPipe; exports.emitter = _chunkN4ULJDEQjs.emitter; exports.log = _chunkRVWBJ6LVjs.log; exports.setLogger = _chunkRVWBJ6LVjs.setLogger;
|
package/dist/index.mjs
CHANGED
|
@@ -88,16 +88,39 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
88
88
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
89
89
|
}
|
|
90
90
|
__name(_ts_decorate, "_ts_decorate");
|
|
91
|
+
function _ts_metadata(k, v) {
|
|
92
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
93
|
+
}
|
|
94
|
+
__name(_ts_metadata, "_ts_metadata");
|
|
91
95
|
var ServerBase = class extends Base {
|
|
92
96
|
static {
|
|
93
97
|
__name(this, "ServerBase");
|
|
94
98
|
}
|
|
95
|
-
context;
|
|
96
99
|
emitter = emitter;
|
|
97
100
|
};
|
|
98
101
|
ServerBase = _ts_decorate([
|
|
99
102
|
Empty
|
|
100
103
|
], ServerBase);
|
|
104
|
+
var HttpBase = class extends ServerBase {
|
|
105
|
+
static {
|
|
106
|
+
__name(this, "HttpBase");
|
|
107
|
+
}
|
|
108
|
+
context;
|
|
109
|
+
};
|
|
110
|
+
_ts_decorate([
|
|
111
|
+
Ctx,
|
|
112
|
+
_ts_metadata("design:type", typeof HttpContext === "undefined" ? Object : HttpContext)
|
|
113
|
+
], HttpBase.prototype, "context", void 0);
|
|
114
|
+
var RpcBase = class extends ServerBase {
|
|
115
|
+
static {
|
|
116
|
+
__name(this, "RpcBase");
|
|
117
|
+
}
|
|
118
|
+
context;
|
|
119
|
+
};
|
|
120
|
+
_ts_decorate([
|
|
121
|
+
Ctx,
|
|
122
|
+
_ts_metadata("design:type", typeof RpcContext === "undefined" ? Object : RpcContext)
|
|
123
|
+
], RpcBase.prototype, "context", void 0);
|
|
101
124
|
|
|
102
125
|
// src/modules/filter.ts
|
|
103
126
|
import { getTag } from "phecda-core";
|
|
@@ -350,6 +373,7 @@ export {
|
|
|
350
373
|
HTTPGenerator,
|
|
351
374
|
Head,
|
|
352
375
|
Header,
|
|
376
|
+
HttpBase,
|
|
353
377
|
IS_HMR,
|
|
354
378
|
IS_ONLY_GENERATE,
|
|
355
379
|
IS_STRICT,
|
|
@@ -379,6 +403,7 @@ export {
|
|
|
379
403
|
RPCGenerator,
|
|
380
404
|
Route,
|
|
381
405
|
Rpc,
|
|
406
|
+
RpcBase,
|
|
382
407
|
ServerBase,
|
|
383
408
|
ServiceUnavailableException,
|
|
384
409
|
TimeoutException,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
|
|
2
2
|
import { F as Factory } from '../../core-Bc2ENEHX.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-AgVwUXPC.mjs';
|
|
4
4
|
import { T as ToClientMap } from '../../types-BlIBlnVT.mjs';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkerOptions, QueueOptions, Worker, Queue } from 'bullmq';
|
|
2
2
|
import { F as Factory } from '../../core-dx9E5x2N.js';
|
|
3
|
-
import {
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-B-ZFZajI.js';
|
|
4
4
|
import { T as ToClientMap } from '../../types-BlIBlnVT.js';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Consumer, Producer } from 'kafkajs';
|
|
2
2
|
import { F as Factory } from '../../core-Bc2ENEHX.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-AgVwUXPC.mjs';
|
|
4
4
|
import { T as ToClientMap } from '../../types-BlIBlnVT.mjs';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Consumer, Producer } from 'kafkajs';
|
|
2
2
|
import { F as Factory } from '../../core-dx9E5x2N.js';
|
|
3
|
-
import {
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-B-ZFZajI.js';
|
|
4
4
|
import { T as ToClientMap } from '../../types-BlIBlnVT.js';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NatsConnection } from 'nats';
|
|
2
2
|
import { F as Factory } from '../../core-Bc2ENEHX.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-AgVwUXPC.mjs';
|
|
4
4
|
import { T as ToClientMap } from '../../types-BlIBlnVT.mjs';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
package/dist/rpc/nats/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NatsConnection } from 'nats';
|
|
2
2
|
import { F as Factory } from '../../core-dx9E5x2N.js';
|
|
3
|
-
import {
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-B-ZFZajI.js';
|
|
4
4
|
import { T as ToClientMap } from '../../types-BlIBlnVT.js';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import amqplib from 'amqplib';
|
|
2
2
|
import { F as Factory } from '../../core-Bc2ENEHX.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-AgVwUXPC.mjs';
|
|
4
4
|
import { T as ToClientMap } from '../../types-BlIBlnVT.mjs';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import amqplib from 'amqplib';
|
|
2
2
|
import { F as Factory } from '../../core-dx9E5x2N.js';
|
|
3
|
-
import {
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-B-ZFZajI.js';
|
|
4
4
|
import { T as ToClientMap } from '../../types-BlIBlnVT.js';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
2
|
import { F as Factory } from '../../core-Bc2ENEHX.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-AgVwUXPC.mjs';
|
|
4
4
|
import { T as ToClientMap } from '../../types-BlIBlnVT.mjs';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Redis from 'ioredis';
|
|
2
2
|
import { F as Factory } from '../../core-dx9E5x2N.js';
|
|
3
|
-
import {
|
|
3
|
+
import { R as RpcContext, a as RpcServerOptions, b as RpcClientOptions } from '../../types-B-ZFZajI.js';
|
|
4
4
|
import { T as ToClientMap } from '../../types-BlIBlnVT.js';
|
|
5
5
|
import 'phecda-core';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Elysia as Elysia$1, Context, LocalHook, InputSchema, RouteSchema, SingletonBase } from 'elysia';
|
|
2
2
|
import { BaseMacro } from 'elysia/dist/types';
|
|
3
|
-
import {
|
|
3
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-Dgxirc9f.mjs';
|
|
4
4
|
import { F as Factory } from '../../core-Bc2ENEHX.mjs';
|
|
5
5
|
import 'node:http';
|
|
6
6
|
import '../../types-BlIBlnVT.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Elysia as Elysia$1, Context, LocalHook, InputSchema, RouteSchema, SingletonBase } from 'elysia';
|
|
2
2
|
import { BaseMacro } from 'elysia/dist/types';
|
|
3
|
-
import {
|
|
3
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-BCJhmpQh.js';
|
|
4
4
|
import { F as Factory } from '../../core-dx9E5x2N.js';
|
|
5
5
|
import 'node:http';
|
|
6
6
|
import '../../types-BlIBlnVT.js';
|
|
@@ -68,7 +68,16 @@ function bind(app, data, opts = {}) {
|
|
|
68
68
|
tag,
|
|
69
69
|
func,
|
|
70
70
|
app,
|
|
71
|
-
..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, c.headers)
|
|
71
|
+
..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, c.headers),
|
|
72
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => c.cookie[key].value, "getCookie"),
|
|
73
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2 = {}) => c.cookie[key].set({
|
|
74
|
+
...opts2,
|
|
75
|
+
value
|
|
76
|
+
}), "setCookie"),
|
|
77
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => c.cookie[key].remove(), "delCookie"),
|
|
78
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url) => c.redirect(url), "redirect"),
|
|
79
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
|
|
80
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (status) => c.set.status = status, "setResStatus")
|
|
72
81
|
};
|
|
73
82
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
74
83
|
context.run({
|
|
@@ -107,7 +116,16 @@ function bind(app, data, opts = {}) {
|
|
|
107
116
|
body: c.body,
|
|
108
117
|
params: c.params,
|
|
109
118
|
headers: c.headers,
|
|
110
|
-
app
|
|
119
|
+
app,
|
|
120
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => c.cookie[key].value, "getCookie"),
|
|
121
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2 = {}) => c.cookie[key].set({
|
|
122
|
+
...opts2,
|
|
123
|
+
value
|
|
124
|
+
}), "setCookie"),
|
|
125
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => c.cookie[key].remove(), "delCookie"),
|
|
126
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url) => c.redirect(url), "redirect"),
|
|
127
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
|
|
128
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (status) => c.set.status = status, "setResStatus")
|
|
111
129
|
};
|
|
112
130
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
113
131
|
if (http.headers) c.set.headers = http.headers;
|
|
@@ -68,7 +68,16 @@ function bind(app, data, opts = {}) {
|
|
|
68
68
|
tag,
|
|
69
69
|
func,
|
|
70
70
|
app,
|
|
71
|
-
...argToReq(params, item.args, c.headers)
|
|
71
|
+
...argToReq(params, item.args, c.headers),
|
|
72
|
+
getCookie: /* @__PURE__ */ __name((key) => c.cookie[key].value, "getCookie"),
|
|
73
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2 = {}) => c.cookie[key].set({
|
|
74
|
+
...opts2,
|
|
75
|
+
value
|
|
76
|
+
}), "setCookie"),
|
|
77
|
+
delCookie: /* @__PURE__ */ __name((key) => c.cookie[key].remove(), "delCookie"),
|
|
78
|
+
redirect: /* @__PURE__ */ __name((url) => c.redirect(url), "redirect"),
|
|
79
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
|
|
80
|
+
setResStatus: /* @__PURE__ */ __name((status) => c.set.status = status, "setResStatus")
|
|
72
81
|
};
|
|
73
82
|
const context = new Context(contextData);
|
|
74
83
|
context.run({
|
|
@@ -107,7 +116,16 @@ function bind(app, data, opts = {}) {
|
|
|
107
116
|
body: c.body,
|
|
108
117
|
params: c.params,
|
|
109
118
|
headers: c.headers,
|
|
110
|
-
app
|
|
119
|
+
app,
|
|
120
|
+
getCookie: /* @__PURE__ */ __name((key) => c.cookie[key].value, "getCookie"),
|
|
121
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2 = {}) => c.cookie[key].set({
|
|
122
|
+
...opts2,
|
|
123
|
+
value
|
|
124
|
+
}), "setCookie"),
|
|
125
|
+
delCookie: /* @__PURE__ */ __name((key) => c.cookie[key].remove(), "delCookie"),
|
|
126
|
+
redirect: /* @__PURE__ */ __name((url) => c.redirect(url), "redirect"),
|
|
127
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => Object.assign(c.set.headers, headers), "setResHeaders"),
|
|
128
|
+
setResStatus: /* @__PURE__ */ __name((status) => c.set.status = status, "setResStatus")
|
|
111
129
|
};
|
|
112
130
|
const context = new Context(contextData);
|
|
113
131
|
if (http.headers) c.set.headers = http.headers;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Request, Response, Router, RequestHandler } from 'express';
|
|
2
|
-
import {
|
|
2
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-Dgxirc9f.mjs';
|
|
3
3
|
import { F as Factory } from '../../core-Bc2ENEHX.mjs';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import '../../types-BlIBlnVT.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Request, Response, Router, RequestHandler } from 'express';
|
|
2
|
-
import {
|
|
2
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-BCJhmpQh.js';
|
|
3
3
|
import { F as Factory } from '../../core-dx9E5x2N.js';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import '../../types-BlIBlnVT.js';
|
|
@@ -69,7 +69,15 @@ function bind(router, data, opts = {}) {
|
|
|
69
69
|
func,
|
|
70
70
|
next,
|
|
71
71
|
app: router,
|
|
72
|
-
..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, req.headers)
|
|
72
|
+
..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, req.headers),
|
|
73
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
|
|
74
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => res.cookie(key, value, opts2 || {}), "setCookie"),
|
|
75
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => res.cookie(key, "", {
|
|
76
|
+
expires: /* @__PURE__ */ new Date(0)
|
|
77
|
+
}), "delCookie"),
|
|
78
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
|
|
79
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => res.set(headers), "setResHeaders"),
|
|
80
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (code) => res.status(code), "setResStatus")
|
|
73
81
|
};
|
|
74
82
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
75
83
|
context.run({
|
|
@@ -107,12 +115,18 @@ function bind(router, data, opts = {}) {
|
|
|
107
115
|
params: req.params,
|
|
108
116
|
headers: req.headers,
|
|
109
117
|
app: router,
|
|
110
|
-
next
|
|
118
|
+
next,
|
|
119
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
|
|
120
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => res.cookie(key, value, opts2 || {}), "setCookie"),
|
|
121
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => res.cookie(key, "", {
|
|
122
|
+
expires: /* @__PURE__ */ new Date(0)
|
|
123
|
+
}), "delCookie"),
|
|
124
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
|
|
125
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => res.set(headers), "setResHeaders"),
|
|
126
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (code) => res.status(code), "setResStatus")
|
|
111
127
|
};
|
|
112
128
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
113
|
-
if (http.headers)
|
|
114
|
-
for (const name in http.headers) res.set(name, http.headers[name]);
|
|
115
|
-
}
|
|
129
|
+
if (http.headers) res.set(http.headers);
|
|
116
130
|
await context.run({
|
|
117
131
|
globalGuards,
|
|
118
132
|
globalInterceptors,
|
|
@@ -69,7 +69,15 @@ function bind(router, data, opts = {}) {
|
|
|
69
69
|
func,
|
|
70
70
|
next,
|
|
71
71
|
app: router,
|
|
72
|
-
...argToReq(params, item.args, req.headers)
|
|
72
|
+
...argToReq(params, item.args, req.headers),
|
|
73
|
+
getCookie: /* @__PURE__ */ __name((key) => req.cookies[key], "getCookie"),
|
|
74
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2) => res.cookie(key, value, opts2 || {}), "setCookie"),
|
|
75
|
+
delCookie: /* @__PURE__ */ __name((key) => res.cookie(key, "", {
|
|
76
|
+
expires: /* @__PURE__ */ new Date(0)
|
|
77
|
+
}), "delCookie"),
|
|
78
|
+
redirect: /* @__PURE__ */ __name((url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
|
|
79
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => res.set(headers), "setResHeaders"),
|
|
80
|
+
setResStatus: /* @__PURE__ */ __name((code) => res.status(code), "setResStatus")
|
|
73
81
|
};
|
|
74
82
|
const context = new Context(contextData);
|
|
75
83
|
context.run({
|
|
@@ -107,12 +115,18 @@ function bind(router, data, opts = {}) {
|
|
|
107
115
|
params: req.params,
|
|
108
116
|
headers: req.headers,
|
|
109
117
|
app: router,
|
|
110
|
-
next
|
|
118
|
+
next,
|
|
119
|
+
getCookie: /* @__PURE__ */ __name((key) => req.cookies[key], "getCookie"),
|
|
120
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2) => res.cookie(key, value, opts2 || {}), "setCookie"),
|
|
121
|
+
delCookie: /* @__PURE__ */ __name((key) => res.cookie(key, "", {
|
|
122
|
+
expires: /* @__PURE__ */ new Date(0)
|
|
123
|
+
}), "delCookie"),
|
|
124
|
+
redirect: /* @__PURE__ */ __name((url, status) => status ? res.redirect(status, url) : res.redirect(url), "redirect"),
|
|
125
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => res.set(headers), "setResHeaders"),
|
|
126
|
+
setResStatus: /* @__PURE__ */ __name((code) => res.status(code), "setResStatus")
|
|
111
127
|
};
|
|
112
128
|
const context = new Context(contextData);
|
|
113
|
-
if (http.headers)
|
|
114
|
-
for (const name in http.headers) res.set(name, http.headers[name]);
|
|
115
|
-
}
|
|
129
|
+
if (http.headers) res.set(http.headers);
|
|
116
130
|
await context.run({
|
|
117
131
|
globalGuards,
|
|
118
132
|
globalInterceptors,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FastifyRequest, FastifyReply, FastifyInstance, FastifyPluginCallback, FastifyRegisterOptions, FastifyPluginOptions, RouteShorthandOptions } from 'fastify';
|
|
2
|
-
import {
|
|
2
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-Dgxirc9f.mjs';
|
|
3
3
|
import { F as Factory } from '../../core-Bc2ENEHX.mjs';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import '../../types-BlIBlnVT.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FastifyRequest, FastifyReply, FastifyInstance, FastifyPluginCallback, FastifyRegisterOptions, FastifyPluginOptions, RouteShorthandOptions } from 'fastify';
|
|
2
|
-
import {
|
|
2
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-BCJhmpQh.js';
|
|
3
3
|
import { F as Factory } from '../../core-dx9E5x2N.js';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import '../../types-BlIBlnVT.js';
|
|
@@ -72,7 +72,16 @@ function bind(fastify, data, opts = {}) {
|
|
|
72
72
|
tag,
|
|
73
73
|
func,
|
|
74
74
|
app: fastify3,
|
|
75
|
-
..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, req.headers)
|
|
75
|
+
..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, req.headers),
|
|
76
|
+
// @ts-expect-error need @fastify/cookie
|
|
77
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
|
|
78
|
+
// @ts-expect-error need @fastify/cookie
|
|
79
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => res.setCookie(key, value, opts2), "setCookie"),
|
|
80
|
+
// @ts-expect-error need @fastify/cookie
|
|
81
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => res.clearCookie(key), "delCookie"),
|
|
82
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url, status) => res.redirect(url, status), "redirect"),
|
|
83
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => res.headers(headers), "setResHeaders"),
|
|
84
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (code) => res.status(code), "setResStatus")
|
|
76
85
|
};
|
|
77
86
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
78
87
|
context.run({
|
|
@@ -116,12 +125,21 @@ function bind(fastify, data, opts = {}) {
|
|
|
116
125
|
body: req.body,
|
|
117
126
|
params: req.params,
|
|
118
127
|
headers: req.headers,
|
|
119
|
-
app: fastify3
|
|
128
|
+
app: fastify3,
|
|
129
|
+
// @ts-expect-error need @fastify/cookie
|
|
130
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
|
|
131
|
+
// @ts-expect-error need @fastify/cookie
|
|
132
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => res.setCookie(key, value, opts2), "setCookie"),
|
|
133
|
+
// @ts-expect-error need @fastify/cookie
|
|
134
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => res.clearCookie(key, {
|
|
135
|
+
path: ""
|
|
136
|
+
}), "delCookie"),
|
|
137
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url, status) => res.redirect(url, status), "redirect"),
|
|
138
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => res.headers(headers), "setResHeaders"),
|
|
139
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (code) => res.status(code), "setResStatus")
|
|
120
140
|
};
|
|
121
141
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
122
|
-
if (http.headers)
|
|
123
|
-
for (const name in http.headers) res.header(name, http.headers[name]);
|
|
124
|
-
}
|
|
142
|
+
if (http.headers) res.headers(http.headers);
|
|
125
143
|
return context.run({
|
|
126
144
|
globalGuards,
|
|
127
145
|
globalInterceptors,
|
|
@@ -72,7 +72,16 @@ function bind(fastify, data, opts = {}) {
|
|
|
72
72
|
tag,
|
|
73
73
|
func,
|
|
74
74
|
app: fastify3,
|
|
75
|
-
...argToReq(params, item.args, req.headers)
|
|
75
|
+
...argToReq(params, item.args, req.headers),
|
|
76
|
+
// @ts-expect-error need @fastify/cookie
|
|
77
|
+
getCookie: /* @__PURE__ */ __name((key) => req.cookies[key], "getCookie"),
|
|
78
|
+
// @ts-expect-error need @fastify/cookie
|
|
79
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2) => res.setCookie(key, value, opts2), "setCookie"),
|
|
80
|
+
// @ts-expect-error need @fastify/cookie
|
|
81
|
+
delCookie: /* @__PURE__ */ __name((key) => res.clearCookie(key), "delCookie"),
|
|
82
|
+
redirect: /* @__PURE__ */ __name((url, status) => res.redirect(url, status), "redirect"),
|
|
83
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => res.headers(headers), "setResHeaders"),
|
|
84
|
+
setResStatus: /* @__PURE__ */ __name((code) => res.status(code), "setResStatus")
|
|
76
85
|
};
|
|
77
86
|
const context = new Context(contextData);
|
|
78
87
|
context.run({
|
|
@@ -116,12 +125,21 @@ function bind(fastify, data, opts = {}) {
|
|
|
116
125
|
body: req.body,
|
|
117
126
|
params: req.params,
|
|
118
127
|
headers: req.headers,
|
|
119
|
-
app: fastify3
|
|
128
|
+
app: fastify3,
|
|
129
|
+
// @ts-expect-error need @fastify/cookie
|
|
130
|
+
getCookie: /* @__PURE__ */ __name((key) => req.cookies[key], "getCookie"),
|
|
131
|
+
// @ts-expect-error need @fastify/cookie
|
|
132
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2) => res.setCookie(key, value, opts2), "setCookie"),
|
|
133
|
+
// @ts-expect-error need @fastify/cookie
|
|
134
|
+
delCookie: /* @__PURE__ */ __name((key) => res.clearCookie(key, {
|
|
135
|
+
path: ""
|
|
136
|
+
}), "delCookie"),
|
|
137
|
+
redirect: /* @__PURE__ */ __name((url, status) => res.redirect(url, status), "redirect"),
|
|
138
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => res.headers(headers), "setResHeaders"),
|
|
139
|
+
setResStatus: /* @__PURE__ */ __name((code) => res.status(code), "setResStatus")
|
|
120
140
|
};
|
|
121
141
|
const context = new Context(contextData);
|
|
122
|
-
if (http.headers)
|
|
123
|
-
for (const name in http.headers) res.header(name, http.headers[name]);
|
|
124
|
-
}
|
|
142
|
+
if (http.headers) res.headers(http.headers);
|
|
125
143
|
return context.run({
|
|
126
144
|
globalGuards,
|
|
127
145
|
globalInterceptors,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { H3Event, Router, _RequestMiddleware } from 'h3';
|
|
2
2
|
import { F as Factory } from '../../core-Bc2ENEHX.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-Dgxirc9f.mjs';
|
|
4
4
|
import 'phecda-core';
|
|
5
5
|
import '../../types-BlIBlnVT.mjs';
|
|
6
6
|
import 'node:http';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { H3Event, Router, _RequestMiddleware } from 'h3';
|
|
2
2
|
import { F as Factory } from '../../core-dx9E5x2N.js';
|
|
3
|
-
import {
|
|
3
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-BCJhmpQh.js';
|
|
4
4
|
import 'phecda-core';
|
|
5
5
|
import '../../types-BlIBlnVT.js';
|
|
6
6
|
import 'node:http';
|
package/dist/server/h3/index.js
CHANGED
|
@@ -69,7 +69,13 @@ function bind(router, data, opts = {}) {
|
|
|
69
69
|
func,
|
|
70
70
|
parallel: true,
|
|
71
71
|
app: router,
|
|
72
|
-
..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, _h3.getRequestHeaders.call(void 0, event))
|
|
72
|
+
..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, _h3.getRequestHeaders.call(void 0, event)),
|
|
73
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => _h3.getCookie.call(void 0, event, key), "getCookie"),
|
|
74
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => _h3.setCookie.call(void 0, event, key, value, opts2), "setCookie"),
|
|
75
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => _h3.deleteCookie.call(void 0, event, key), "delCookie"),
|
|
76
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url, status) => _h3.sendRedirect.call(void 0, event, url, status), "redirect"),
|
|
77
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => _h3.setResponseHeaders.call(void 0, event, headers), "setResHeaders"),
|
|
78
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (code) => _h3.setResponseStatus.call(void 0, event, code), "setResStatus")
|
|
73
79
|
};
|
|
74
80
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
75
81
|
context.run({
|
|
@@ -112,7 +118,13 @@ function bind(router, data, opts = {}) {
|
|
|
112
118
|
app: router,
|
|
113
119
|
body: needBody ? await _h3.readBody.call(void 0, event, {
|
|
114
120
|
strict: true
|
|
115
|
-
}) : void 0
|
|
121
|
+
}) : void 0,
|
|
122
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => _h3.getCookie.call(void 0, event, key), "getCookie"),
|
|
123
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => _h3.setCookie.call(void 0, event, key, value, opts2), "setCookie"),
|
|
124
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url) => _h3.sendRedirect.call(void 0, event, url), "redirect"),
|
|
125
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => _h3.setResponseHeaders.call(void 0, event, headers), "setResHeaders"),
|
|
126
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (code) => _h3.setResponseStatus.call(void 0, event, code), "setResStatus"),
|
|
127
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => _h3.deleteCookie.call(void 0, event, key), "delCookie")
|
|
116
128
|
};
|
|
117
129
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
118
130
|
_h3.setHeaders.call(void 0, event, http.headers || {});
|
package/dist/server/h3/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "../../chunk-MESZCLSS.mjs";
|
|
11
11
|
|
|
12
12
|
// src/server/h3/bind.ts
|
|
13
|
-
import { defineRequestMiddleware, eventHandler, getQuery, getRequestHeaders, getRouterParams, readBody, setHeaders, setResponseStatus } from "h3";
|
|
13
|
+
import { defineRequestMiddleware, deleteCookie, eventHandler, getCookie, getQuery, getRequestHeaders, getRouterParams, readBody, sendRedirect, setCookie, setHeaders, setResponseHeaders, setResponseStatus } from "h3";
|
|
14
14
|
import Debug from "debug";
|
|
15
15
|
var debug = Debug("phecda-server/h3");
|
|
16
16
|
function bind(router, data, opts = {}) {
|
|
@@ -69,7 +69,13 @@ function bind(router, data, opts = {}) {
|
|
|
69
69
|
func,
|
|
70
70
|
parallel: true,
|
|
71
71
|
app: router,
|
|
72
|
-
...argToReq(params, item.args, getRequestHeaders(event))
|
|
72
|
+
...argToReq(params, item.args, getRequestHeaders(event)),
|
|
73
|
+
getCookie: /* @__PURE__ */ __name((key) => getCookie(event, key), "getCookie"),
|
|
74
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2) => setCookie(event, key, value, opts2), "setCookie"),
|
|
75
|
+
delCookie: /* @__PURE__ */ __name((key) => deleteCookie(event, key), "delCookie"),
|
|
76
|
+
redirect: /* @__PURE__ */ __name((url, status) => sendRedirect(event, url, status), "redirect"),
|
|
77
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => setResponseHeaders(event, headers), "setResHeaders"),
|
|
78
|
+
setResStatus: /* @__PURE__ */ __name((code) => setResponseStatus(event, code), "setResStatus")
|
|
73
79
|
};
|
|
74
80
|
const context = new Context(contextData);
|
|
75
81
|
context.run({
|
|
@@ -112,7 +118,13 @@ function bind(router, data, opts = {}) {
|
|
|
112
118
|
app: router,
|
|
113
119
|
body: needBody ? await readBody(event, {
|
|
114
120
|
strict: true
|
|
115
|
-
}) : void 0
|
|
121
|
+
}) : void 0,
|
|
122
|
+
getCookie: /* @__PURE__ */ __name((key) => getCookie(event, key), "getCookie"),
|
|
123
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2) => setCookie(event, key, value, opts2), "setCookie"),
|
|
124
|
+
redirect: /* @__PURE__ */ __name((url) => sendRedirect(event, url), "redirect"),
|
|
125
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => setResponseHeaders(event, headers), "setResHeaders"),
|
|
126
|
+
setResStatus: /* @__PURE__ */ __name((code) => setResponseStatus(event, code), "setResStatus"),
|
|
127
|
+
delCookie: /* @__PURE__ */ __name((key) => deleteCookie(event, key), "delCookie")
|
|
116
128
|
};
|
|
117
129
|
const context = new Context(contextData);
|
|
118
130
|
setHeaders(event, http.headers || {});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, Hono, MiddlewareHandler } from 'hono';
|
|
2
|
-
import {
|
|
2
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-Dgxirc9f.mjs';
|
|
3
3
|
import { F as Factory } from '../../core-Bc2ENEHX.mjs';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import '../../types-BlIBlnVT.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, Hono, MiddlewareHandler } from 'hono';
|
|
2
|
-
import {
|
|
2
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-BCJhmpQh.js';
|
|
3
3
|
import { F as Factory } from '../../core-dx9E5x2N.js';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import '../../types-BlIBlnVT.js';
|
|
@@ -11,6 +11,7 @@ var _chunkRVWBJ6LVjs = require('../../chunk-RVWBJ6LV.js');
|
|
|
11
11
|
|
|
12
12
|
// src/server/hono/bind.ts
|
|
13
13
|
var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
14
|
+
var _cookie = require('hono/cookie');
|
|
14
15
|
var debug = _debug2.default.call(void 0, "phecda-server/hono");
|
|
15
16
|
function bind(router, data, opts = {}) {
|
|
16
17
|
const { globalGuards, globalInterceptors, parallelRoute = "/__PHECDA_SERVER__", globalPlugins = [], parallelPlugins = [], globalFilter, globalPipe } = opts;
|
|
@@ -62,7 +63,15 @@ function bind(router, data, opts = {}) {
|
|
|
62
63
|
tag,
|
|
63
64
|
func,
|
|
64
65
|
app: router,
|
|
65
|
-
..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, c.req.header())
|
|
66
|
+
..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, c.req.header()),
|
|
67
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => _cookie.getCookie.call(void 0, c, key), "getCookie"),
|
|
68
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => _cookie.deleteCookie.call(void 0, c, key), "delCookie"),
|
|
69
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => _cookie.setCookie.call(void 0, c, key, value, opts2), "setCookie"),
|
|
70
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url) => c.redirect(url), "redirect"),
|
|
71
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => {
|
|
72
|
+
for (const name in headers) c.header(name, headers[name]);
|
|
73
|
+
}, "setResHeaders"),
|
|
74
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (status) => c.status(status), "setResStatus")
|
|
66
75
|
};
|
|
67
76
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
68
77
|
context.run({
|
|
@@ -99,7 +108,15 @@ function bind(router, data, opts = {}) {
|
|
|
99
108
|
body: needBody ? await c.req.json() : void 0,
|
|
100
109
|
params: c.req.param(),
|
|
101
110
|
headers: c.req.header(),
|
|
102
|
-
app: router
|
|
111
|
+
app: router,
|
|
112
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => _cookie.getCookie.call(void 0, c, key), "getCookie"),
|
|
113
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => _cookie.deleteCookie.call(void 0, c, key), "delCookie"),
|
|
114
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => _cookie.setCookie.call(void 0, c, key, value, opts2), "setCookie"),
|
|
115
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url) => c.redirect(url), "redirect"),
|
|
116
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => {
|
|
117
|
+
for (const name in headers) c.header(name, headers[name]);
|
|
118
|
+
}, "setResHeaders"),
|
|
119
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (status) => c.status(status), "setResStatus")
|
|
103
120
|
};
|
|
104
121
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
105
122
|
if (http.headers) {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
|
|
12
12
|
// src/server/hono/bind.ts
|
|
13
13
|
import Debug from "debug";
|
|
14
|
+
import { deleteCookie, getCookie, setCookie } from "hono/cookie";
|
|
14
15
|
var debug = Debug("phecda-server/hono");
|
|
15
16
|
function bind(router, data, opts = {}) {
|
|
16
17
|
const { globalGuards, globalInterceptors, parallelRoute = "/__PHECDA_SERVER__", globalPlugins = [], parallelPlugins = [], globalFilter, globalPipe } = opts;
|
|
@@ -62,7 +63,15 @@ function bind(router, data, opts = {}) {
|
|
|
62
63
|
tag,
|
|
63
64
|
func,
|
|
64
65
|
app: router,
|
|
65
|
-
...argToReq(params, item.args, c.req.header())
|
|
66
|
+
...argToReq(params, item.args, c.req.header()),
|
|
67
|
+
getCookie: /* @__PURE__ */ __name((key) => getCookie(c, key), "getCookie"),
|
|
68
|
+
delCookie: /* @__PURE__ */ __name((key) => deleteCookie(c, key), "delCookie"),
|
|
69
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2) => setCookie(c, key, value, opts2), "setCookie"),
|
|
70
|
+
redirect: /* @__PURE__ */ __name((url) => c.redirect(url), "redirect"),
|
|
71
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => {
|
|
72
|
+
for (const name in headers) c.header(name, headers[name]);
|
|
73
|
+
}, "setResHeaders"),
|
|
74
|
+
setResStatus: /* @__PURE__ */ __name((status) => c.status(status), "setResStatus")
|
|
66
75
|
};
|
|
67
76
|
const context = new Context(contextData);
|
|
68
77
|
context.run({
|
|
@@ -99,7 +108,15 @@ function bind(router, data, opts = {}) {
|
|
|
99
108
|
body: needBody ? await c.req.json() : void 0,
|
|
100
109
|
params: c.req.param(),
|
|
101
110
|
headers: c.req.header(),
|
|
102
|
-
app: router
|
|
111
|
+
app: router,
|
|
112
|
+
getCookie: /* @__PURE__ */ __name((key) => getCookie(c, key), "getCookie"),
|
|
113
|
+
delCookie: /* @__PURE__ */ __name((key) => deleteCookie(c, key), "delCookie"),
|
|
114
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2) => setCookie(c, key, value, opts2), "setCookie"),
|
|
115
|
+
redirect: /* @__PURE__ */ __name((url) => c.redirect(url), "redirect"),
|
|
116
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => {
|
|
117
|
+
for (const name in headers) c.header(name, headers[name]);
|
|
118
|
+
}, "setResHeaders"),
|
|
119
|
+
setResStatus: /* @__PURE__ */ __name((status) => c.status(status), "setResStatus")
|
|
103
120
|
};
|
|
104
121
|
const context = new Context(contextData);
|
|
105
122
|
if (http.headers) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Request, Response, Router, MiddlewareHandler } from 'hyper-express';
|
|
2
|
-
import {
|
|
2
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-Dgxirc9f.mjs';
|
|
3
3
|
import { F as Factory } from '../../core-Bc2ENEHX.mjs';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import '../../types-BlIBlnVT.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Request, Response, Router, MiddlewareHandler } from 'hyper-express';
|
|
2
|
-
import {
|
|
2
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-BCJhmpQh.js';
|
|
3
3
|
import { F as Factory } from '../../core-dx9E5x2N.js';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import '../../types-BlIBlnVT.js';
|
|
@@ -65,7 +65,13 @@ function bind(router, data, opts = {}) {
|
|
|
65
65
|
func,
|
|
66
66
|
next,
|
|
67
67
|
app: router,
|
|
68
|
-
..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, req.headers)
|
|
68
|
+
..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, req.headers),
|
|
69
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
|
|
70
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => res.cookie(key, value, _optionalChain([opts2, 'optionalAccess', _2 => _2.expires]) && opts2.expires.getTime() - Date.now(), opts2 || {}), "setCookie"),
|
|
71
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => res.clearCookie(key), "delCookie"),
|
|
72
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url) => res.redirect(url), "redirect"),
|
|
73
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => res.set(headers), "setResHeaders"),
|
|
74
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (code) => res.status(code), "setResStatus")
|
|
69
75
|
};
|
|
70
76
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
71
77
|
context.run({
|
|
@@ -87,7 +93,7 @@ function bind(router, data, opts = {}) {
|
|
|
87
93
|
for (const func in record) {
|
|
88
94
|
const meta2 = metaMap.get(tag)[func];
|
|
89
95
|
const { data: { params, plugins, http } } = meta2;
|
|
90
|
-
if (!_optionalChain([http, 'optionalAccess',
|
|
96
|
+
if (!_optionalChain([http, 'optionalAccess', _3 => _3.type])) continue;
|
|
91
97
|
const needBody = params.some((item) => item.type === "body");
|
|
92
98
|
router[http.type](http.prefix + http.route, ..._chunkQYX5Q7KOjs.Context.usePlugin(plugins, "hyper-express"), async (req, res, next) => {
|
|
93
99
|
debug(`invoke method "${func}" in module "${tag}"`);
|
|
@@ -104,7 +110,13 @@ function bind(router, data, opts = {}) {
|
|
|
104
110
|
app: router,
|
|
105
111
|
params: req.path_parameters,
|
|
106
112
|
headers: req.headers,
|
|
107
|
-
next
|
|
113
|
+
next,
|
|
114
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => req.cookies[key], "getCookie"),
|
|
115
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => res.cookie(key, value, _optionalChain([opts2, 'optionalAccess', _4 => _4.expires]) && opts2.expires.getTime() - Date.now(), opts2 || {}), "setCookie"),
|
|
116
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => res.clearCookie(key), "delCookie"),
|
|
117
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url) => res.redirect(url), "redirect"),
|
|
118
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => res.set(headers), "setResHeaders"),
|
|
119
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (code) => res.status(code), "setResStatus")
|
|
108
120
|
};
|
|
109
121
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
110
122
|
if (http.headers) {
|
|
@@ -65,7 +65,13 @@ function bind(router, data, opts = {}) {
|
|
|
65
65
|
func,
|
|
66
66
|
next,
|
|
67
67
|
app: router,
|
|
68
|
-
...argToReq(params, item.args, req.headers)
|
|
68
|
+
...argToReq(params, item.args, req.headers),
|
|
69
|
+
getCookie: /* @__PURE__ */ __name((key) => req.cookies[key], "getCookie"),
|
|
70
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2) => res.cookie(key, value, opts2?.expires && opts2.expires.getTime() - Date.now(), opts2 || {}), "setCookie"),
|
|
71
|
+
delCookie: /* @__PURE__ */ __name((key) => res.clearCookie(key), "delCookie"),
|
|
72
|
+
redirect: /* @__PURE__ */ __name((url) => res.redirect(url), "redirect"),
|
|
73
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => res.set(headers), "setResHeaders"),
|
|
74
|
+
setResStatus: /* @__PURE__ */ __name((code) => res.status(code), "setResStatus")
|
|
69
75
|
};
|
|
70
76
|
const context = new Context(contextData);
|
|
71
77
|
context.run({
|
|
@@ -104,7 +110,13 @@ function bind(router, data, opts = {}) {
|
|
|
104
110
|
app: router,
|
|
105
111
|
params: req.path_parameters,
|
|
106
112
|
headers: req.headers,
|
|
107
|
-
next
|
|
113
|
+
next,
|
|
114
|
+
getCookie: /* @__PURE__ */ __name((key) => req.cookies[key], "getCookie"),
|
|
115
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2) => res.cookie(key, value, opts2?.expires && opts2.expires.getTime() - Date.now(), opts2 || {}), "setCookie"),
|
|
116
|
+
delCookie: /* @__PURE__ */ __name((key) => res.clearCookie(key), "delCookie"),
|
|
117
|
+
redirect: /* @__PURE__ */ __name((url) => res.redirect(url), "redirect"),
|
|
118
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => res.set(headers), "setResHeaders"),
|
|
119
|
+
setResStatus: /* @__PURE__ */ __name((code) => res.status(code), "setResStatus")
|
|
108
120
|
};
|
|
109
121
|
const context = new Context(contextData);
|
|
110
122
|
if (http.headers) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Router, { RouterParamContext } from '@koa/router';
|
|
2
2
|
import { DefaultContext, DefaultState } from 'koa';
|
|
3
|
-
import {
|
|
3
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-Dgxirc9f.mjs';
|
|
4
4
|
import { F as Factory } from '../../core-Bc2ENEHX.mjs';
|
|
5
5
|
import 'node:http';
|
|
6
6
|
import '../../types-BlIBlnVT.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Router, { RouterParamContext } from '@koa/router';
|
|
2
2
|
import { DefaultContext, DefaultState } from 'koa';
|
|
3
|
-
import {
|
|
3
|
+
import { H as HttpContext, a as HttpOptions } from '../../types-BCJhmpQh.js';
|
|
4
4
|
import { F as Factory } from '../../core-dx9E5x2N.js';
|
|
5
5
|
import 'node:http';
|
|
6
6
|
import '../../types-BlIBlnVT.js';
|
package/dist/server/koa/index.js
CHANGED
|
@@ -65,7 +65,15 @@ function bind(router, data, opts = {}) {
|
|
|
65
65
|
app: router,
|
|
66
66
|
..._chunkQYX5Q7KOjs.argToReq.call(void 0, params, item.args, ctx.headers),
|
|
67
67
|
tag,
|
|
68
|
-
func
|
|
68
|
+
func,
|
|
69
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => ctx.cookies.get(key), "getCookie"),
|
|
70
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => ctx.cookies.set(key, value, opts2), "setCookie"),
|
|
71
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => ctx.cookies.set(key, "", {
|
|
72
|
+
expires: /* @__PURE__ */ new Date(0)
|
|
73
|
+
}), "delCookie"),
|
|
74
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url) => ctx.redirect(url), "redirect"),
|
|
75
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => ctx.set(headers), "setResHeaders"),
|
|
76
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (status) => ctx.status = status, "setResStatus")
|
|
69
77
|
};
|
|
70
78
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
71
79
|
context.run({
|
|
@@ -102,12 +110,18 @@ function bind(router, data, opts = {}) {
|
|
|
102
110
|
params: ctx.params,
|
|
103
111
|
body: ctx.request.body,
|
|
104
112
|
headers: ctx.headers,
|
|
105
|
-
next
|
|
113
|
+
next,
|
|
114
|
+
getCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => ctx.cookies.get(key), "getCookie"),
|
|
115
|
+
setCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key, value, opts2) => ctx.cookies.set(key, value, opts2), "setCookie"),
|
|
116
|
+
delCookie: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (key) => ctx.cookies.set(key, "", {
|
|
117
|
+
expires: /* @__PURE__ */ new Date(0)
|
|
118
|
+
}), "delCookie"),
|
|
119
|
+
redirect: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (url) => ctx.redirect(url), "redirect"),
|
|
120
|
+
setResHeaders: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (headers) => ctx.set(headers), "setResHeaders"),
|
|
121
|
+
setResStatus: /* @__PURE__ */ _chunkRVWBJ6LVjs.__name.call(void 0, (status) => ctx.status = status, "setResStatus")
|
|
106
122
|
};
|
|
107
123
|
const context = new (0, _chunkQYX5Q7KOjs.Context)(contextData);
|
|
108
|
-
if (http.headers)
|
|
109
|
-
for (const name in http.headers) ctx.set(name, http.headers[name]);
|
|
110
|
-
}
|
|
124
|
+
if (http.headers) ctx.set(http.headers);
|
|
111
125
|
await context.run({
|
|
112
126
|
globalGuards,
|
|
113
127
|
globalInterceptors,
|
|
@@ -65,7 +65,15 @@ function bind(router, data, opts = {}) {
|
|
|
65
65
|
app: router,
|
|
66
66
|
...argToReq(params, item.args, ctx.headers),
|
|
67
67
|
tag,
|
|
68
|
-
func
|
|
68
|
+
func,
|
|
69
|
+
getCookie: /* @__PURE__ */ __name((key) => ctx.cookies.get(key), "getCookie"),
|
|
70
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2) => ctx.cookies.set(key, value, opts2), "setCookie"),
|
|
71
|
+
delCookie: /* @__PURE__ */ __name((key) => ctx.cookies.set(key, "", {
|
|
72
|
+
expires: /* @__PURE__ */ new Date(0)
|
|
73
|
+
}), "delCookie"),
|
|
74
|
+
redirect: /* @__PURE__ */ __name((url) => ctx.redirect(url), "redirect"),
|
|
75
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => ctx.set(headers), "setResHeaders"),
|
|
76
|
+
setResStatus: /* @__PURE__ */ __name((status) => ctx.status = status, "setResStatus")
|
|
69
77
|
};
|
|
70
78
|
const context = new Context(contextData);
|
|
71
79
|
context.run({
|
|
@@ -102,12 +110,18 @@ function bind(router, data, opts = {}) {
|
|
|
102
110
|
params: ctx.params,
|
|
103
111
|
body: ctx.request.body,
|
|
104
112
|
headers: ctx.headers,
|
|
105
|
-
next
|
|
113
|
+
next,
|
|
114
|
+
getCookie: /* @__PURE__ */ __name((key) => ctx.cookies.get(key), "getCookie"),
|
|
115
|
+
setCookie: /* @__PURE__ */ __name((key, value, opts2) => ctx.cookies.set(key, value, opts2), "setCookie"),
|
|
116
|
+
delCookie: /* @__PURE__ */ __name((key) => ctx.cookies.set(key, "", {
|
|
117
|
+
expires: /* @__PURE__ */ new Date(0)
|
|
118
|
+
}), "delCookie"),
|
|
119
|
+
redirect: /* @__PURE__ */ __name((url) => ctx.redirect(url), "redirect"),
|
|
120
|
+
setResHeaders: /* @__PURE__ */ __name((headers) => ctx.set(headers), "setResHeaders"),
|
|
121
|
+
setResStatus: /* @__PURE__ */ __name((status) => ctx.status = status, "setResStatus")
|
|
106
122
|
};
|
|
107
123
|
const context = new Context(contextData);
|
|
108
|
-
if (http.headers)
|
|
109
|
-
for (const name in http.headers) ctx.set(name, http.headers[name]);
|
|
110
|
-
}
|
|
124
|
+
if (http.headers) ctx.set(http.headers);
|
|
111
125
|
await context.run({
|
|
112
126
|
globalGuards,
|
|
113
127
|
globalInterceptors,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IncomingHttpHeaders } from 'node:http';
|
|
2
|
+
import { D as DefaultOptions, B as BaseContext } from './types-BlIBlnVT.js';
|
|
3
|
+
|
|
4
|
+
interface HttpOptions extends DefaultOptions {
|
|
5
|
+
/**
|
|
6
|
+
* 专用路由的值,默认为/__PHECDA_SERVER__,处理phecda-client发出的合并请求
|
|
7
|
+
*/
|
|
8
|
+
parallelRoute?: string | false;
|
|
9
|
+
/**
|
|
10
|
+
* 专用路由的插件(work for merge request),
|
|
11
|
+
*/
|
|
12
|
+
parallelPlugins?: string[];
|
|
13
|
+
/**
|
|
14
|
+
* only work for http server
|
|
15
|
+
*/
|
|
16
|
+
globalPlugins?: string[];
|
|
17
|
+
}
|
|
18
|
+
interface HttpContext extends BaseContext {
|
|
19
|
+
parallel?: true;
|
|
20
|
+
index?: number;
|
|
21
|
+
query: Record<string, any>;
|
|
22
|
+
params: Record<string, string>;
|
|
23
|
+
body: Record<string, any>;
|
|
24
|
+
headers: IncomingHttpHeaders;
|
|
25
|
+
redirect: (url: string, status?: number) => void;
|
|
26
|
+
getCookie(key: string): string | undefined;
|
|
27
|
+
setCookie(key: string, value: string, opts?: CookieSerializeOptions): void;
|
|
28
|
+
delCookie(key: string): void;
|
|
29
|
+
setResHeaders: (headers: Record<string, string>) => void;
|
|
30
|
+
setResStatus: (status: number) => void;
|
|
31
|
+
}
|
|
32
|
+
interface CookieSerializeOptions {
|
|
33
|
+
domain?: string | undefined;
|
|
34
|
+
encode?(value: string): string;
|
|
35
|
+
expires?: Date | undefined;
|
|
36
|
+
httpOnly?: boolean | undefined;
|
|
37
|
+
maxAge?: number | undefined;
|
|
38
|
+
path?: string | undefined;
|
|
39
|
+
priority?: 'low' | 'medium' | 'high' | undefined;
|
|
40
|
+
sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
|
|
41
|
+
secure?: boolean | undefined;
|
|
42
|
+
partitioned?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type { CookieSerializeOptions as C, HttpContext as H, HttpOptions as a };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IncomingHttpHeaders } from 'node:http';
|
|
2
|
+
import { D as DefaultOptions, B as BaseContext } from './types-BlIBlnVT.mjs';
|
|
3
|
+
|
|
4
|
+
interface HttpOptions extends DefaultOptions {
|
|
5
|
+
/**
|
|
6
|
+
* 专用路由的值,默认为/__PHECDA_SERVER__,处理phecda-client发出的合并请求
|
|
7
|
+
*/
|
|
8
|
+
parallelRoute?: string | false;
|
|
9
|
+
/**
|
|
10
|
+
* 专用路由的插件(work for merge request),
|
|
11
|
+
*/
|
|
12
|
+
parallelPlugins?: string[];
|
|
13
|
+
/**
|
|
14
|
+
* only work for http server
|
|
15
|
+
*/
|
|
16
|
+
globalPlugins?: string[];
|
|
17
|
+
}
|
|
18
|
+
interface HttpContext extends BaseContext {
|
|
19
|
+
parallel?: true;
|
|
20
|
+
index?: number;
|
|
21
|
+
query: Record<string, any>;
|
|
22
|
+
params: Record<string, string>;
|
|
23
|
+
body: Record<string, any>;
|
|
24
|
+
headers: IncomingHttpHeaders;
|
|
25
|
+
redirect: (url: string, status?: number) => void;
|
|
26
|
+
getCookie(key: string): string | undefined;
|
|
27
|
+
setCookie(key: string, value: string, opts?: CookieSerializeOptions): void;
|
|
28
|
+
delCookie(key: string): void;
|
|
29
|
+
setResHeaders: (headers: Record<string, string>) => void;
|
|
30
|
+
setResStatus: (status: number) => void;
|
|
31
|
+
}
|
|
32
|
+
interface CookieSerializeOptions {
|
|
33
|
+
domain?: string | undefined;
|
|
34
|
+
encode?(value: string): string;
|
|
35
|
+
expires?: Date | undefined;
|
|
36
|
+
httpOnly?: boolean | undefined;
|
|
37
|
+
maxAge?: number | undefined;
|
|
38
|
+
path?: string | undefined;
|
|
39
|
+
priority?: 'low' | 'medium' | 'high' | undefined;
|
|
40
|
+
sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
|
|
41
|
+
secure?: boolean | undefined;
|
|
42
|
+
partitioned?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type { CookieSerializeOptions as C, HttpContext as H, HttpOptions as a };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phecda-server",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "server framework that provide IOC/type-reuse/http&rpc-adaptor",
|
|
5
5
|
"author": "fgsreally",
|
|
6
6
|
"license": "MIT",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"fs-extra": "^11.2.0",
|
|
146
146
|
"picocolors": "^1.0.0",
|
|
147
147
|
"reflect-metadata": "^0.1.13",
|
|
148
|
-
"phecda-core": "3.0
|
|
148
|
+
"phecda-core": "3.1.0"
|
|
149
149
|
},
|
|
150
150
|
"devDependencies": {
|
|
151
151
|
"@koa/router": "^12.0.1",
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { IncomingHttpHeaders } from 'node:http';
|
|
2
|
-
import { D as DefaultOptions, B as BaseContext } from './types-BlIBlnVT.mjs';
|
|
3
|
-
|
|
4
|
-
interface HttpOptions extends DefaultOptions {
|
|
5
|
-
/**
|
|
6
|
-
* 专用路由的值,默认为/__PHECDA_SERVER__,处理phecda-client发出的合并请求
|
|
7
|
-
*/
|
|
8
|
-
parallelRoute?: string | false;
|
|
9
|
-
/**
|
|
10
|
-
* 专用路由的插件(work for merge request),
|
|
11
|
-
*/
|
|
12
|
-
parallelPlugins?: string[];
|
|
13
|
-
/**
|
|
14
|
-
* only work for http server
|
|
15
|
-
*/
|
|
16
|
-
globalPlugins?: string[];
|
|
17
|
-
}
|
|
18
|
-
interface HttpContext extends BaseContext {
|
|
19
|
-
parallel?: true;
|
|
20
|
-
index?: number;
|
|
21
|
-
query: Record<string, any>;
|
|
22
|
-
params: Record<string, string>;
|
|
23
|
-
body: Record<string, any>;
|
|
24
|
-
headers: IncomingHttpHeaders;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type { HttpOptions as H, HttpContext as a };
|
package/dist/types-PY43OKEP.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { IncomingHttpHeaders } from 'node:http';
|
|
2
|
-
import { D as DefaultOptions, B as BaseContext } from './types-BlIBlnVT.js';
|
|
3
|
-
|
|
4
|
-
interface HttpOptions extends DefaultOptions {
|
|
5
|
-
/**
|
|
6
|
-
* 专用路由的值,默认为/__PHECDA_SERVER__,处理phecda-client发出的合并请求
|
|
7
|
-
*/
|
|
8
|
-
parallelRoute?: string | false;
|
|
9
|
-
/**
|
|
10
|
-
* 专用路由的插件(work for merge request),
|
|
11
|
-
*/
|
|
12
|
-
parallelPlugins?: string[];
|
|
13
|
-
/**
|
|
14
|
-
* only work for http server
|
|
15
|
-
*/
|
|
16
|
-
globalPlugins?: string[];
|
|
17
|
-
}
|
|
18
|
-
interface HttpContext extends BaseContext {
|
|
19
|
-
parallel?: true;
|
|
20
|
-
index?: number;
|
|
21
|
-
query: Record<string, any>;
|
|
22
|
-
params: Record<string, string>;
|
|
23
|
-
body: Record<string, any>;
|
|
24
|
-
headers: IncomingHttpHeaders;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type { HttpOptions as H, HttpContext as a };
|