@temporary-name/server 1.9.3-alpha.82e5e55517330d6049913c9b2f19e60239cd25d9 → 1.9.3-alpha.907c7c78d0193d34752279de92d699e50d6bc3a1
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/adapters/aws-lambda/index.d.mts +4 -6
- package/dist/adapters/aws-lambda/index.d.ts +4 -6
- package/dist/adapters/aws-lambda/index.mjs +5 -7
- package/dist/adapters/fetch/index.d.mts +8 -86
- package/dist/adapters/fetch/index.d.ts +8 -86
- package/dist/adapters/fetch/index.mjs +17 -158
- package/dist/adapters/node/index.d.mts +8 -63
- package/dist/adapters/node/index.d.ts +8 -63
- package/dist/adapters/node/index.mjs +15 -123
- package/dist/adapters/standard/index.d.mts +20 -33
- package/dist/adapters/standard/index.d.ts +20 -33
- package/dist/adapters/standard/index.mjs +5 -7
- package/dist/helpers/index.mjs +3 -29
- package/dist/index.d.mts +121 -469
- package/dist/index.d.ts +121 -469
- package/dist/index.mjs +242 -445
- package/dist/openapi/index.d.mts +12 -28
- package/dist/openapi/index.d.ts +12 -28
- package/dist/openapi/index.mjs +66 -150
- package/dist/shared/server.Bj_UpI5O.d.mts +372 -0
- package/dist/shared/server.Bj_UpI5O.d.ts +372 -0
- package/dist/shared/server.C1RJffw4.mjs +30 -0
- package/dist/shared/server.C6VnFy4S.d.mts +41 -0
- package/dist/shared/server.CQIFwyhc.mjs +40 -0
- package/dist/shared/server.ChOv1yG3.mjs +319 -0
- package/dist/shared/server.CnzXkSjj.d.ts +41 -0
- package/dist/shared/server.DXzEGRE2.mjs +403 -0
- package/dist/shared/server.DgzAlPjF.mjs +160 -0
- package/dist/shared/server.YUvuxHty.mjs +48 -0
- package/package.json +10 -26
- package/dist/plugins/index.d.mts +0 -160
- package/dist/plugins/index.d.ts +0 -160
- package/dist/plugins/index.mjs +0 -288
- package/dist/shared/server.BEHw7Eyx.mjs +0 -247
- package/dist/shared/server.BKSOrA6h.d.mts +0 -192
- package/dist/shared/server.BKSOrA6h.d.ts +0 -192
- package/dist/shared/server.BKh8I1Ny.mjs +0 -239
- package/dist/shared/server.BeuTpcmO.d.mts +0 -23
- package/dist/shared/server.C1fnTLq0.d.mts +0 -57
- package/dist/shared/server.CQyYNJ1H.d.ts +0 -57
- package/dist/shared/server.DLsti1Pv.mjs +0 -293
- package/dist/shared/server.SLLuK6_v.d.ts +0 -23
|
@@ -1,32 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Interceptor, MaybeOptionalOptions } from '@temporary-name/shared';
|
|
1
|
+
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
2
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@temporary-name/standard-server-node';
|
|
4
|
-
import {
|
|
5
|
-
import { F as FriendlyStandardHandleOptions } from '../../shared/server.
|
|
6
|
-
import
|
|
7
|
-
import '@temporary-name/contract';
|
|
8
|
-
import '@temporary-name/standard-server';
|
|
9
|
-
|
|
10
|
-
interface NodeHttpHandlerPlugin<T extends Context> extends StandardHandlerPlugin<T> {
|
|
11
|
-
initRuntimeAdapter?(options: NodeHttpHandlerOptions<T>): void;
|
|
12
|
-
}
|
|
13
|
-
declare class CompositeNodeHttpHandlerPlugin<T extends Context, TPlugin extends NodeHttpHandlerPlugin<T>> extends CompositeStandardHandlerPlugin<T, TPlugin> implements NodeHttpHandlerPlugin<T> {
|
|
14
|
-
initRuntimeAdapter(options: NodeHttpHandlerOptions<T>): void;
|
|
15
|
-
}
|
|
3
|
+
import { C as Context, m as Router } from '../../shared/server.Bj_UpI5O.js';
|
|
4
|
+
import { b as StandardHandlerOptions, F as FriendlyStandardHandleOptions } from '../../shared/server.CnzXkSjj.js';
|
|
5
|
+
import '@temporary-name/zod';
|
|
16
6
|
|
|
17
7
|
type NodeHttpHandleResult = {
|
|
18
8
|
matched: true;
|
|
19
9
|
} | {
|
|
20
10
|
matched: false;
|
|
21
11
|
};
|
|
22
|
-
interface
|
|
23
|
-
request: NodeHttpRequest;
|
|
24
|
-
response: NodeHttpResponse;
|
|
25
|
-
sendStandardResponseOptions: SendStandardResponseOptions;
|
|
26
|
-
}
|
|
27
|
-
interface NodeHttpHandlerOptions<T extends Context> extends SendStandardResponseOptions, Omit<StandardHandlerOptions<T>, 'plugins'> {
|
|
28
|
-
adapterInterceptors?: Interceptor<NodeHttpHandlerInterceptorOptions<T>, Promise<NodeHttpHandleResult>>[];
|
|
29
|
-
plugins?: NodeHttpHandlerPlugin<T>[];
|
|
12
|
+
interface NodeHttpHandlerOptions<T extends Context> extends SendStandardResponseOptions, StandardHandlerOptions<T> {
|
|
30
13
|
}
|
|
31
14
|
/**
|
|
32
15
|
* OpenAPI Handler for Node Server
|
|
@@ -36,48 +19,10 @@ interface NodeHttpHandlerOptions<T extends Context> extends SendStandardResponse
|
|
|
36
19
|
*/
|
|
37
20
|
declare class NodeHttpHandler<T extends Context> implements NodeHttpHandler<T> {
|
|
38
21
|
private readonly sendStandardResponseOptions;
|
|
39
|
-
private readonly adapterInterceptors;
|
|
40
22
|
private readonly standardHandler;
|
|
41
|
-
constructor(router: Router<
|
|
23
|
+
constructor(router: Router<T>, options?: NoInfer<NodeHttpHandlerOptions<T>>);
|
|
42
24
|
handle(request: NodeHttpRequest, response: NodeHttpResponse, ...rest: MaybeOptionalOptions<FriendlyStandardHandleOptions<T>>): Promise<NodeHttpHandleResult>;
|
|
43
25
|
}
|
|
44
26
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
* The maximum size of the body in bytes.
|
|
48
|
-
*/
|
|
49
|
-
maxBodySize: number;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* The Body Limit Plugin restricts the size of the request body for the Node.js HTTP Server.
|
|
53
|
-
*
|
|
54
|
-
* @see {@link https://orpc.unnoq.com/docs/plugins/body-limit Body Limit Plugin Docs}
|
|
55
|
-
*/
|
|
56
|
-
declare class BodyLimitPlugin<T extends Context> implements NodeHttpHandlerPlugin<T> {
|
|
57
|
-
private readonly maxBodySize;
|
|
58
|
-
constructor(options: BodyLimitPluginOptions);
|
|
59
|
-
initRuntimeAdapter(options: NodeHttpHandlerOptions<T>): void;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
interface CompressionPluginOptions extends compression.CompressionOptions {
|
|
63
|
-
/**
|
|
64
|
-
* Override the default content-type filter used to determine which responses should be compressed.
|
|
65
|
-
*
|
|
66
|
-
* @warning [Event Iterator](https://orpc.unnoq.com/docs/event-iterator) responses are never compressed, regardless of this filter's return value.
|
|
67
|
-
* @default only responses with compressible content types are compressed.
|
|
68
|
-
*/
|
|
69
|
-
filter?: (req: NodeHttpRequest, res: NodeHttpResponse) => boolean;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* The Compression Plugin adds response compression to the Node.js HTTP Server.
|
|
73
|
-
*
|
|
74
|
-
* @see {@link https://orpc.unnoq.com/docs/plugins/compression Compression Plugin Docs}
|
|
75
|
-
*/
|
|
76
|
-
declare class CompressionPlugin<T extends Context> implements NodeHttpHandlerPlugin<T> {
|
|
77
|
-
private readonly compressionHandler;
|
|
78
|
-
constructor(options?: CompressionPluginOptions);
|
|
79
|
-
initRuntimeAdapter(options: NodeHttpHandlerOptions<T>): void;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export { BodyLimitPlugin, CompositeNodeHttpHandlerPlugin, CompressionPlugin, NodeHttpHandler };
|
|
83
|
-
export type { BodyLimitPluginOptions, CompressionPluginOptions, NodeHttpHandleResult, NodeHttpHandlerInterceptorOptions, NodeHttpHandlerOptions, NodeHttpHandlerPlugin };
|
|
27
|
+
export { NodeHttpHandler };
|
|
28
|
+
export type { NodeHttpHandleResult, NodeHttpHandlerOptions };
|
|
@@ -1,139 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import compression from '@temporary-name/interop/compression';
|
|
1
|
+
import { resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
2
|
import { toStandardLazyRequest, sendStandardResponse } from '@temporary-name/standard-server-node';
|
|
4
|
-
import {
|
|
5
|
-
import '@temporary-name/contract';
|
|
3
|
+
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.DXzEGRE2.mjs';
|
|
6
4
|
import '@temporary-name/standard-server';
|
|
7
5
|
import '@temporary-name/server';
|
|
8
6
|
import 'rou3';
|
|
9
|
-
import '../../shared/server.
|
|
10
|
-
import '
|
|
11
|
-
import '
|
|
12
|
-
import '
|
|
13
|
-
import 'zod/v4/core';
|
|
14
|
-
|
|
15
|
-
class BodyLimitPlugin {
|
|
16
|
-
maxBodySize;
|
|
17
|
-
constructor(options) {
|
|
18
|
-
this.maxBodySize = options.maxBodySize;
|
|
19
|
-
}
|
|
20
|
-
initRuntimeAdapter(options) {
|
|
21
|
-
options.adapterInterceptors ??= [];
|
|
22
|
-
options.adapterInterceptors.push(async (options2) => {
|
|
23
|
-
const checkHeader = once(() => {
|
|
24
|
-
if (Number(options2.request.headers["content-length"]) > this.maxBodySize) {
|
|
25
|
-
throw new ORPCError("PAYLOAD_TOO_LARGE");
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
const originalEmit = options2.request.emit;
|
|
29
|
-
let currentBodySize = 0;
|
|
30
|
-
options2.request.emit = (event, ...args) => {
|
|
31
|
-
if (event === "data") {
|
|
32
|
-
checkHeader();
|
|
33
|
-
currentBodySize += args[0].length;
|
|
34
|
-
if (currentBodySize > this.maxBodySize) {
|
|
35
|
-
throw new ORPCError("PAYLOAD_TOO_LARGE");
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return originalEmit.call(options2.request, event, ...args);
|
|
39
|
-
};
|
|
40
|
-
try {
|
|
41
|
-
return await options2.next(options2);
|
|
42
|
-
} finally {
|
|
43
|
-
options2.request.emit = originalEmit;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
class CompressionPlugin {
|
|
50
|
-
compressionHandler;
|
|
51
|
-
constructor(options = {}) {
|
|
52
|
-
this.compressionHandler = compression({
|
|
53
|
-
...options,
|
|
54
|
-
filter: (req, res) => {
|
|
55
|
-
const hasContentDisposition = res.hasHeader("content-disposition");
|
|
56
|
-
const contentType = res.getHeader("content-type")?.toString();
|
|
57
|
-
if (!hasContentDisposition && contentType?.startsWith("text/event-stream")) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
return options.filter ? options.filter(req, res) : compression.filter(req, res);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
initRuntimeAdapter(options) {
|
|
65
|
-
options.adapterInterceptors ??= [];
|
|
66
|
-
options.adapterInterceptors.unshift(async (options2) => {
|
|
67
|
-
let resolve;
|
|
68
|
-
let reject;
|
|
69
|
-
const promise = new Promise((res, rej) => {
|
|
70
|
-
resolve = res;
|
|
71
|
-
reject = rej;
|
|
72
|
-
});
|
|
73
|
-
const originalWrite = options2.response.write;
|
|
74
|
-
const originalEnd = options2.response.end;
|
|
75
|
-
const originalOn = options2.response.on;
|
|
76
|
-
this.compressionHandler(options2.request, options2.response, async (err) => {
|
|
77
|
-
if (err) {
|
|
78
|
-
reject(err);
|
|
79
|
-
} else {
|
|
80
|
-
try {
|
|
81
|
-
resolve(await options2.next());
|
|
82
|
-
} catch (error) {
|
|
83
|
-
reject(error);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
try {
|
|
88
|
-
return await promise;
|
|
89
|
-
} finally {
|
|
90
|
-
options2.response.write = originalWrite;
|
|
91
|
-
options2.response.end = originalEnd;
|
|
92
|
-
options2.response.on = originalOn;
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
class CompositeNodeHttpHandlerPlugin extends CompositeStandardHandlerPlugin {
|
|
99
|
-
initRuntimeAdapter(options) {
|
|
100
|
-
for (const plugin of this.plugins) {
|
|
101
|
-
plugin.initRuntimeAdapter?.(options);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
7
|
+
import '../../shared/server.DgzAlPjF.mjs';
|
|
8
|
+
import '@temporary-name/zod';
|
|
9
|
+
import '../../shared/server.ChOv1yG3.mjs';
|
|
10
|
+
import '../../shared/server.CQIFwyhc.mjs';
|
|
105
11
|
|
|
106
12
|
class NodeHttpHandler {
|
|
107
13
|
sendStandardResponseOptions;
|
|
108
|
-
adapterInterceptors;
|
|
109
14
|
standardHandler;
|
|
110
15
|
constructor(router, options = {}) {
|
|
111
16
|
this.standardHandler = new StandardHandler(router, options);
|
|
112
|
-
const plugin = new CompositeNodeHttpHandlerPlugin(options.plugins);
|
|
113
|
-
plugin.initRuntimeAdapter(options);
|
|
114
|
-
this.adapterInterceptors = toArray(options.adapterInterceptors);
|
|
115
17
|
this.sendStandardResponseOptions = options;
|
|
116
18
|
}
|
|
117
19
|
async handle(request, response, ...rest) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
async ({ request: request2, response: response2, sendStandardResponseOptions, ...options }) => {
|
|
127
|
-
const standardRequest = toStandardLazyRequest(request2, response2);
|
|
128
|
-
const result = await this.standardHandler.handle(standardRequest, options);
|
|
129
|
-
if (!result.matched) {
|
|
130
|
-
return { matched: false };
|
|
131
|
-
}
|
|
132
|
-
await sendStandardResponse(response2, result.response, sendStandardResponseOptions);
|
|
133
|
-
return { matched: true };
|
|
134
|
-
}
|
|
135
|
-
);
|
|
20
|
+
const options = resolveFriendlyStandardHandleOptions(resolveMaybeOptionalOptions(rest));
|
|
21
|
+
const standardRequest = toStandardLazyRequest(request, response);
|
|
22
|
+
const result = await this.standardHandler.handle(standardRequest, options);
|
|
23
|
+
if (!result.matched) {
|
|
24
|
+
return { matched: false };
|
|
25
|
+
}
|
|
26
|
+
await sendStandardResponse(response, result.response, this.sendStandardResponseOptions);
|
|
27
|
+
return { matched: true };
|
|
136
28
|
}
|
|
137
29
|
}
|
|
138
30
|
|
|
139
|
-
export {
|
|
31
|
+
export { NodeHttpHandler };
|
|
@@ -1,42 +1,29 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { F as FriendlyStandardHandleOptions, S as StandardHandleOptions, a as StandardHandleResult, c as StandardHandler, b as StandardHandlerOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.C6VnFy4S.mjs';
|
|
2
2
|
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { h as AnyProcedure$1, f as AnyRouter$1 } from '../../shared/server.BKSOrA6h.mjs';
|
|
7
|
-
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.BeuTpcmO.mjs';
|
|
8
|
-
import '@temporary-name/contract';
|
|
3
|
+
import { StandardLazyRequest, StandardResponse, ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
+
import '../../shared/server.Bj_UpI5O.mjs';
|
|
5
|
+
import '@temporary-name/zod';
|
|
9
6
|
|
|
10
|
-
declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare class StandardOpenAPIMatcher implements StandardMatcher$1 {
|
|
19
|
-
private readonly tree;
|
|
20
|
-
private pendingRouters;
|
|
21
|
-
init(router: AnyRouter, path?: readonly string[]): void;
|
|
22
|
-
match(method: string, pathname: HTTPPath): Promise<StandardMatchResult$1>;
|
|
23
|
-
}
|
|
7
|
+
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<{
|
|
8
|
+
path: unknown;
|
|
9
|
+
query: unknown;
|
|
10
|
+
headers: Headers;
|
|
11
|
+
body: unknown;
|
|
12
|
+
}>;
|
|
13
|
+
declare function encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
|
14
|
+
declare function encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
24
15
|
|
|
25
|
-
type StandardParams = Record<string, string>;
|
|
26
16
|
type StandardMatchResult = {
|
|
27
17
|
path: readonly string[];
|
|
28
|
-
procedure: AnyProcedure
|
|
29
|
-
params?:
|
|
18
|
+
procedure: AnyProcedure;
|
|
19
|
+
params?: Record<string, string>;
|
|
30
20
|
} | undefined;
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
declare class StandardOpenAPIMatcher {
|
|
22
|
+
private readonly tree;
|
|
23
|
+
private pendingRouters;
|
|
24
|
+
init(router: AnyRouter, path?: readonly string[]): void;
|
|
33
25
|
match(method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
|
|
34
26
|
}
|
|
35
|
-
interface StandardCodec {
|
|
36
|
-
encode(output: unknown, procedure: AnyProcedure$1): StandardResponse;
|
|
37
|
-
encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
38
|
-
decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure$1): Promise<unknown>;
|
|
39
|
-
}
|
|
40
27
|
|
|
41
|
-
export {
|
|
42
|
-
export type {
|
|
28
|
+
export { StandardOpenAPIMatcher, decode, encode, encodeError };
|
|
29
|
+
export type { StandardMatchResult };
|
|
@@ -1,42 +1,29 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { F as FriendlyStandardHandleOptions, S as StandardHandleOptions, a as StandardHandleResult, c as StandardHandler, b as StandardHandlerOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.CnzXkSjj.js';
|
|
2
2
|
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { h as AnyProcedure$1, f as AnyRouter$1 } from '../../shared/server.BKSOrA6h.js';
|
|
7
|
-
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.SLLuK6_v.js';
|
|
8
|
-
import '@temporary-name/contract';
|
|
3
|
+
import { StandardLazyRequest, StandardResponse, ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
+
import '../../shared/server.Bj_UpI5O.js';
|
|
5
|
+
import '@temporary-name/zod';
|
|
9
6
|
|
|
10
|
-
declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare class StandardOpenAPIMatcher implements StandardMatcher$1 {
|
|
19
|
-
private readonly tree;
|
|
20
|
-
private pendingRouters;
|
|
21
|
-
init(router: AnyRouter, path?: readonly string[]): void;
|
|
22
|
-
match(method: string, pathname: HTTPPath): Promise<StandardMatchResult$1>;
|
|
23
|
-
}
|
|
7
|
+
declare function decode(request: StandardLazyRequest, pathParams: Record<string, string> | undefined): Promise<{
|
|
8
|
+
path: unknown;
|
|
9
|
+
query: unknown;
|
|
10
|
+
headers: Headers;
|
|
11
|
+
body: unknown;
|
|
12
|
+
}>;
|
|
13
|
+
declare function encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
|
14
|
+
declare function encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
24
15
|
|
|
25
|
-
type StandardParams = Record<string, string>;
|
|
26
16
|
type StandardMatchResult = {
|
|
27
17
|
path: readonly string[];
|
|
28
|
-
procedure: AnyProcedure
|
|
29
|
-
params?:
|
|
18
|
+
procedure: AnyProcedure;
|
|
19
|
+
params?: Record<string, string>;
|
|
30
20
|
} | undefined;
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
declare class StandardOpenAPIMatcher {
|
|
22
|
+
private readonly tree;
|
|
23
|
+
private pendingRouters;
|
|
24
|
+
init(router: AnyRouter, path?: readonly string[]): void;
|
|
33
25
|
match(method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
|
|
34
26
|
}
|
|
35
|
-
interface StandardCodec {
|
|
36
|
-
encode(output: unknown, procedure: AnyProcedure$1): StandardResponse;
|
|
37
|
-
encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
38
|
-
decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure$1): Promise<unknown>;
|
|
39
|
-
}
|
|
40
27
|
|
|
41
|
-
export {
|
|
42
|
-
export type {
|
|
28
|
+
export { StandardOpenAPIMatcher, decode, encode, encodeError };
|
|
29
|
+
export type { StandardMatchResult };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { S as StandardHandler, b as StandardOpenAPIMatcher, d as decode, c as decodeParams, e as encode, a as encodeError, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.DXzEGRE2.mjs';
|
|
2
2
|
import '@temporary-name/shared';
|
|
3
|
+
import '../../shared/server.DgzAlPjF.mjs';
|
|
3
4
|
import '@temporary-name/standard-server';
|
|
4
|
-
import '
|
|
5
|
-
import '
|
|
6
|
-
import '
|
|
7
|
-
import 'zod';
|
|
8
|
-
import 'zod/v4/core';
|
|
9
|
-
import '../../shared/server.BEHw7Eyx.mjs';
|
|
5
|
+
import '@temporary-name/zod';
|
|
6
|
+
import '../../shared/server.ChOv1yG3.mjs';
|
|
7
|
+
import '../../shared/server.CQIFwyhc.mjs';
|
|
10
8
|
import '@temporary-name/server';
|
|
11
9
|
import 'rou3';
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export { d as deleteCookie, g as getCookie, s as setCookie } from '../shared/server.C1RJffw4.mjs';
|
|
2
|
+
import 'cookie';
|
|
2
3
|
|
|
3
4
|
function encodeBase64url(data) {
|
|
4
5
|
const chunkSize = 8192;
|
|
@@ -30,33 +31,6 @@ function decodeBase64url(base64url) {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
function setCookie(headers, name, value, options = {}) {
|
|
34
|
-
if (headers === void 0) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const cookieString = serialize(name, value, {
|
|
38
|
-
path: "/",
|
|
39
|
-
...options
|
|
40
|
-
});
|
|
41
|
-
headers.append("Set-Cookie", cookieString);
|
|
42
|
-
}
|
|
43
|
-
function getCookie(headers, name, options = {}) {
|
|
44
|
-
if (headers === void 0) {
|
|
45
|
-
return void 0;
|
|
46
|
-
}
|
|
47
|
-
const cookieHeader = headers.get("cookie");
|
|
48
|
-
if (cookieHeader === null) {
|
|
49
|
-
return void 0;
|
|
50
|
-
}
|
|
51
|
-
return parse(cookieHeader, options)[name];
|
|
52
|
-
}
|
|
53
|
-
function deleteCookie(headers, name, options = {}) {
|
|
54
|
-
return setCookie(headers, name, "", {
|
|
55
|
-
...options,
|
|
56
|
-
maxAge: 0
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
34
|
const PBKDF2_CONFIG = {
|
|
61
35
|
name: "PBKDF2",
|
|
62
36
|
iterations: 6e4,
|
|
@@ -165,4 +139,4 @@ function getSignedValue(signedValue) {
|
|
|
165
139
|
return signedValue.slice(0, lastDotIndex);
|
|
166
140
|
}
|
|
167
141
|
|
|
168
|
-
export { decodeBase64url, decrypt,
|
|
142
|
+
export { decodeBase64url, decrypt, encodeBase64url, encrypt, getSignedValue, sign, unsign };
|