@mcp-ts/sdk 1.3.7 → 1.3.9
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/LICENSE +21 -21
- package/README.md +398 -404
- package/dist/adapters/agui-middleware.js.map +1 -1
- package/dist/adapters/agui-middleware.mjs.map +1 -1
- package/dist/bin/mcp-ts.js +0 -0
- package/dist/bin/mcp-ts.js.map +1 -1
- package/dist/bin/mcp-ts.mjs +0 -0
- package/dist/bin/mcp-ts.mjs.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs.map +1 -1
- package/dist/client/react.d.mts +2 -2
- package/dist/client/react.d.ts +2 -2
- package/dist/client/react.js +25 -2
- package/dist/client/react.js.map +1 -1
- package/dist/client/react.mjs +26 -3
- package/dist/client/react.mjs.map +1 -1
- package/dist/client/vue.js.map +1 -1
- package/dist/client/vue.mjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/index.mjs.map +1 -1
- package/package.json +185 -185
- package/src/adapters/agui-middleware.ts +382 -382
- package/src/bin/mcp-ts.ts +102 -102
- package/src/client/core/app-host.ts +417 -417
- package/src/client/core/sse-client.ts +371 -371
- package/src/client/core/types.ts +31 -31
- package/src/client/index.ts +27 -27
- package/src/client/react/index.ts +16 -16
- package/src/client/react/use-app-host.ts +73 -73
- package/src/client/react/use-mcp-apps.tsx +247 -214
- package/src/client/react/use-mcp.ts +641 -641
- package/src/client/vue/index.ts +10 -10
- package/src/client/vue/use-mcp.ts +617 -617
- package/src/index.ts +11 -11
- package/src/server/handlers/nextjs-handler.ts +204 -204
- package/src/server/handlers/sse-handler.ts +631 -631
- package/src/server/index.ts +57 -57
- package/src/server/mcp/multi-session-client.ts +228 -228
- package/src/server/mcp/oauth-client.ts +1188 -1188
- package/src/server/mcp/storage-oauth-provider.ts +272 -272
- package/src/server/storage/file-backend.ts +157 -157
- package/src/server/storage/index.ts +176 -176
- package/src/server/storage/memory-backend.ts +123 -123
- package/src/server/storage/redis-backend.ts +276 -276
- package/src/server/storage/redis.ts +160 -160
- package/src/server/storage/sqlite-backend.ts +182 -182
- package/src/server/storage/supabase-backend.ts +228 -228
- package/src/server/storage/types.ts +116 -116
- package/src/shared/constants.ts +29 -29
- package/src/shared/errors.ts +133 -133
- package/src/shared/event-routing.ts +28 -28
- package/src/shared/events.ts +180 -180
- package/src/shared/index.ts +75 -75
- package/src/shared/tool-utils.ts +61 -61
- package/src/shared/types.ts +282 -282
- package/src/shared/utils.ts +38 -38
- package/supabase/migrations/20260330195700_install_mcp_sessions.sql +84 -84
package/src/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Redis
|
|
3
|
-
* Redis-backed MCP client with OAuth 2.1 and real-time SSE connections
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// Re-export everything from subpackages
|
|
9
|
-
export * from './server';
|
|
10
|
-
export * from './client';
|
|
11
|
-
export * from './shared';
|
|
1
|
+
/**
|
|
2
|
+
* MCP Redis
|
|
3
|
+
* Redis-backed MCP client with OAuth 2.1 and real-time SSE connections
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Re-export everything from subpackages
|
|
9
|
+
export * from './server';
|
|
10
|
+
export * from './client';
|
|
11
|
+
export * from './shared';
|
|
@@ -1,204 +1,204 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Next.js App Router Handler for MCP
|
|
3
|
-
* Stateless transport for serverless environments:
|
|
4
|
-
* - POST + `Accept: text/event-stream` streams progress + rpc-response
|
|
5
|
-
* - POST + JSON accepts direct RPC result response
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { SSEConnectionManager, type ClientMetadata } from './sse-handler.js';
|
|
9
|
-
import type { McpConnectionEvent, McpObservabilityEvent } from '../../shared/events.js';
|
|
10
|
-
import { isConnectionEvent, isRpcResponseEvent } from '../../shared/event-routing.js';
|
|
11
|
-
import type { McpRpcResponse } from '../../shared/types.js';
|
|
12
|
-
|
|
13
|
-
export interface NextMcpHandlerOptions {
|
|
14
|
-
/**
|
|
15
|
-
* Extract identity from request (default: from 'identity' query param)
|
|
16
|
-
*/
|
|
17
|
-
getIdentity?: (request: Request) => string | null;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Extract auth token from request (default: from 'token' query param or Authorization header)
|
|
21
|
-
*/
|
|
22
|
-
getAuthToken?: (request: Request) => string | null;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Authenticate user and verify access (optional)
|
|
26
|
-
* Return true if user is authenticated, false otherwise
|
|
27
|
-
*/
|
|
28
|
-
authenticate?: (identity: string, token: string | null) => Promise<boolean> | boolean;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Heartbeat interval in milliseconds (default: 30000)
|
|
32
|
-
*/
|
|
33
|
-
heartbeatInterval?: number;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Static OAuth client metadata defaults (for all connections)
|
|
37
|
-
*/
|
|
38
|
-
clientDefaults?: ClientMetadata;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Dynamic OAuth client metadata getter (per-request)
|
|
42
|
-
*/
|
|
43
|
-
getClientMetadata?: (request: Request) => ClientMetadata | Promise<ClientMetadata>;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function createNextMcpHandler(options: NextMcpHandlerOptions = {}) {
|
|
47
|
-
const {
|
|
48
|
-
getIdentity = (request: Request) => new URL(request.url).searchParams.get('identity'),
|
|
49
|
-
getAuthToken = (request: Request) => {
|
|
50
|
-
const url = new URL(request.url);
|
|
51
|
-
return url.searchParams.get('token') || request.headers.get('authorization');
|
|
52
|
-
},
|
|
53
|
-
authenticate = () => true,
|
|
54
|
-
heartbeatInterval = 30000,
|
|
55
|
-
clientDefaults,
|
|
56
|
-
getClientMetadata,
|
|
57
|
-
} = options;
|
|
58
|
-
|
|
59
|
-
const toManagerOptions = (identity: string, resolvedClientMetadata?: ClientMetadata) => ({
|
|
60
|
-
identity,
|
|
61
|
-
heartbeatInterval,
|
|
62
|
-
clientDefaults: resolvedClientMetadata,
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
async function resolveClientMetadata(request: Request): Promise<ClientMetadata | undefined> {
|
|
66
|
-
return getClientMetadata ? await getClientMetadata(request) : clientDefaults;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
async function GET(): Promise<Response> {
|
|
70
|
-
return Response.json(
|
|
71
|
-
{
|
|
72
|
-
error: {
|
|
73
|
-
code: 'METHOD_NOT_ALLOWED',
|
|
74
|
-
message: 'Use POST /api/mcp. For streaming use Accept: text/event-stream.',
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
{ status: 405 }
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
async function POST(request: Request): Promise<Response> {
|
|
82
|
-
const identity = getIdentity(request);
|
|
83
|
-
const authToken = getAuthToken(request);
|
|
84
|
-
const acceptsEventStream = (request.headers.get('accept') || '').toLowerCase().includes('text/event-stream');
|
|
85
|
-
|
|
86
|
-
if (!identity) {
|
|
87
|
-
return Response.json({ error: { code: 'MISSING_IDENTITY', message: 'Missing identity' } }, { status: 400 });
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const isAuthorized = await authenticate(identity, authToken);
|
|
91
|
-
if (!isAuthorized) {
|
|
92
|
-
return Response.json({ error: { code: 'UNAUTHORIZED', message: 'Unauthorized' } }, { status: 401 });
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
let rawBody = '';
|
|
96
|
-
try {
|
|
97
|
-
rawBody = await request.text();
|
|
98
|
-
const body = rawBody ? JSON.parse(rawBody) : null;
|
|
99
|
-
|
|
100
|
-
if (!body || typeof body !== 'object') {
|
|
101
|
-
return Response.json(
|
|
102
|
-
{
|
|
103
|
-
error: {
|
|
104
|
-
code: 'INVALID_REQUEST',
|
|
105
|
-
message: 'Invalid JSON-RPC request body',
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
{ status: 400 }
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const resolvedClientMetadata = await resolveClientMetadata(request);
|
|
113
|
-
|
|
114
|
-
if (!acceptsEventStream) {
|
|
115
|
-
const manager = new SSEConnectionManager(
|
|
116
|
-
toManagerOptions(identity, resolvedClientMetadata),
|
|
117
|
-
() => { }
|
|
118
|
-
);
|
|
119
|
-
try {
|
|
120
|
-
const response = await manager.handleRequest(body as any);
|
|
121
|
-
return Response.json(response);
|
|
122
|
-
} finally {
|
|
123
|
-
manager.dispose();
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const stream = new TransformStream();
|
|
128
|
-
const writer = stream.writable.getWriter();
|
|
129
|
-
const encoder = new TextEncoder();
|
|
130
|
-
let streamWritable = true;
|
|
131
|
-
|
|
132
|
-
const sendSSE = (event: string, data: unknown) => {
|
|
133
|
-
if (!streamWritable) return;
|
|
134
|
-
const message = `event: ${event}\ndata: ${JSON.stringify(data)}\n\n`;
|
|
135
|
-
writer.write(encoder.encode(message)).catch(() => {
|
|
136
|
-
streamWritable = false;
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
const manager = new SSEConnectionManager(
|
|
141
|
-
toManagerOptions(identity, resolvedClientMetadata),
|
|
142
|
-
(event: McpConnectionEvent | McpObservabilityEvent | McpRpcResponse) => {
|
|
143
|
-
if (isRpcResponseEvent(event)) {
|
|
144
|
-
sendSSE('rpc-response', event);
|
|
145
|
-
} else if (isConnectionEvent(event)) {
|
|
146
|
-
sendSSE('connection', event);
|
|
147
|
-
} else {
|
|
148
|
-
sendSSE('observability', event);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
);
|
|
152
|
-
|
|
153
|
-
sendSSE('connected', { timestamp: Date.now() });
|
|
154
|
-
|
|
155
|
-
void (async () => {
|
|
156
|
-
try {
|
|
157
|
-
await manager.handleRequest(body as any);
|
|
158
|
-
} catch (error) {
|
|
159
|
-
const err = error instanceof Error ? error : new Error('Unknown error');
|
|
160
|
-
sendSSE('rpc-response', {
|
|
161
|
-
id: (body as any).id || 'unknown',
|
|
162
|
-
error: {
|
|
163
|
-
code: 'EXECUTION_ERROR',
|
|
164
|
-
message: err.message,
|
|
165
|
-
},
|
|
166
|
-
} satisfies McpRpcResponse);
|
|
167
|
-
} finally {
|
|
168
|
-
streamWritable = false;
|
|
169
|
-
manager.dispose();
|
|
170
|
-
writer.close().catch(() => { });
|
|
171
|
-
}
|
|
172
|
-
})();
|
|
173
|
-
|
|
174
|
-
return new Response(stream.readable, {
|
|
175
|
-
status: 200,
|
|
176
|
-
headers: {
|
|
177
|
-
'Content-Type': 'text/event-stream',
|
|
178
|
-
'Cache-Control': 'no-cache, no-transform',
|
|
179
|
-
'Connection': 'keep-alive',
|
|
180
|
-
'X-Accel-Buffering': 'no',
|
|
181
|
-
},
|
|
182
|
-
});
|
|
183
|
-
} catch (error) {
|
|
184
|
-
const err = error instanceof Error ? error : new Error('Unknown error');
|
|
185
|
-
console.error('[MCP Next Handler] Failed to handle RPC', {
|
|
186
|
-
identity,
|
|
187
|
-
message: err.message,
|
|
188
|
-
stack: err.stack,
|
|
189
|
-
rawBody: rawBody.slice(0, 500),
|
|
190
|
-
});
|
|
191
|
-
return Response.json(
|
|
192
|
-
{
|
|
193
|
-
error: {
|
|
194
|
-
code: 'EXECUTION_ERROR',
|
|
195
|
-
message: err.message,
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
{ status: 500 }
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
return { GET, POST };
|
|
204
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Next.js App Router Handler for MCP
|
|
3
|
+
* Stateless transport for serverless environments:
|
|
4
|
+
* - POST + `Accept: text/event-stream` streams progress + rpc-response
|
|
5
|
+
* - POST + JSON accepts direct RPC result response
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { SSEConnectionManager, type ClientMetadata } from './sse-handler.js';
|
|
9
|
+
import type { McpConnectionEvent, McpObservabilityEvent } from '../../shared/events.js';
|
|
10
|
+
import { isConnectionEvent, isRpcResponseEvent } from '../../shared/event-routing.js';
|
|
11
|
+
import type { McpRpcResponse } from '../../shared/types.js';
|
|
12
|
+
|
|
13
|
+
export interface NextMcpHandlerOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Extract identity from request (default: from 'identity' query param)
|
|
16
|
+
*/
|
|
17
|
+
getIdentity?: (request: Request) => string | null;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Extract auth token from request (default: from 'token' query param or Authorization header)
|
|
21
|
+
*/
|
|
22
|
+
getAuthToken?: (request: Request) => string | null;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Authenticate user and verify access (optional)
|
|
26
|
+
* Return true if user is authenticated, false otherwise
|
|
27
|
+
*/
|
|
28
|
+
authenticate?: (identity: string, token: string | null) => Promise<boolean> | boolean;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Heartbeat interval in milliseconds (default: 30000)
|
|
32
|
+
*/
|
|
33
|
+
heartbeatInterval?: number;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Static OAuth client metadata defaults (for all connections)
|
|
37
|
+
*/
|
|
38
|
+
clientDefaults?: ClientMetadata;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Dynamic OAuth client metadata getter (per-request)
|
|
42
|
+
*/
|
|
43
|
+
getClientMetadata?: (request: Request) => ClientMetadata | Promise<ClientMetadata>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function createNextMcpHandler(options: NextMcpHandlerOptions = {}) {
|
|
47
|
+
const {
|
|
48
|
+
getIdentity = (request: Request) => new URL(request.url).searchParams.get('identity'),
|
|
49
|
+
getAuthToken = (request: Request) => {
|
|
50
|
+
const url = new URL(request.url);
|
|
51
|
+
return url.searchParams.get('token') || request.headers.get('authorization');
|
|
52
|
+
},
|
|
53
|
+
authenticate = () => true,
|
|
54
|
+
heartbeatInterval = 30000,
|
|
55
|
+
clientDefaults,
|
|
56
|
+
getClientMetadata,
|
|
57
|
+
} = options;
|
|
58
|
+
|
|
59
|
+
const toManagerOptions = (identity: string, resolvedClientMetadata?: ClientMetadata) => ({
|
|
60
|
+
identity,
|
|
61
|
+
heartbeatInterval,
|
|
62
|
+
clientDefaults: resolvedClientMetadata,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
async function resolveClientMetadata(request: Request): Promise<ClientMetadata | undefined> {
|
|
66
|
+
return getClientMetadata ? await getClientMetadata(request) : clientDefaults;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function GET(): Promise<Response> {
|
|
70
|
+
return Response.json(
|
|
71
|
+
{
|
|
72
|
+
error: {
|
|
73
|
+
code: 'METHOD_NOT_ALLOWED',
|
|
74
|
+
message: 'Use POST /api/mcp. For streaming use Accept: text/event-stream.',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{ status: 405 }
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async function POST(request: Request): Promise<Response> {
|
|
82
|
+
const identity = getIdentity(request);
|
|
83
|
+
const authToken = getAuthToken(request);
|
|
84
|
+
const acceptsEventStream = (request.headers.get('accept') || '').toLowerCase().includes('text/event-stream');
|
|
85
|
+
|
|
86
|
+
if (!identity) {
|
|
87
|
+
return Response.json({ error: { code: 'MISSING_IDENTITY', message: 'Missing identity' } }, { status: 400 });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const isAuthorized = await authenticate(identity, authToken);
|
|
91
|
+
if (!isAuthorized) {
|
|
92
|
+
return Response.json({ error: { code: 'UNAUTHORIZED', message: 'Unauthorized' } }, { status: 401 });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
let rawBody = '';
|
|
96
|
+
try {
|
|
97
|
+
rawBody = await request.text();
|
|
98
|
+
const body = rawBody ? JSON.parse(rawBody) : null;
|
|
99
|
+
|
|
100
|
+
if (!body || typeof body !== 'object') {
|
|
101
|
+
return Response.json(
|
|
102
|
+
{
|
|
103
|
+
error: {
|
|
104
|
+
code: 'INVALID_REQUEST',
|
|
105
|
+
message: 'Invalid JSON-RPC request body',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{ status: 400 }
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const resolvedClientMetadata = await resolveClientMetadata(request);
|
|
113
|
+
|
|
114
|
+
if (!acceptsEventStream) {
|
|
115
|
+
const manager = new SSEConnectionManager(
|
|
116
|
+
toManagerOptions(identity, resolvedClientMetadata),
|
|
117
|
+
() => { }
|
|
118
|
+
);
|
|
119
|
+
try {
|
|
120
|
+
const response = await manager.handleRequest(body as any);
|
|
121
|
+
return Response.json(response);
|
|
122
|
+
} finally {
|
|
123
|
+
manager.dispose();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const stream = new TransformStream();
|
|
128
|
+
const writer = stream.writable.getWriter();
|
|
129
|
+
const encoder = new TextEncoder();
|
|
130
|
+
let streamWritable = true;
|
|
131
|
+
|
|
132
|
+
const sendSSE = (event: string, data: unknown) => {
|
|
133
|
+
if (!streamWritable) return;
|
|
134
|
+
const message = `event: ${event}\ndata: ${JSON.stringify(data)}\n\n`;
|
|
135
|
+
writer.write(encoder.encode(message)).catch(() => {
|
|
136
|
+
streamWritable = false;
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const manager = new SSEConnectionManager(
|
|
141
|
+
toManagerOptions(identity, resolvedClientMetadata),
|
|
142
|
+
(event: McpConnectionEvent | McpObservabilityEvent | McpRpcResponse) => {
|
|
143
|
+
if (isRpcResponseEvent(event)) {
|
|
144
|
+
sendSSE('rpc-response', event);
|
|
145
|
+
} else if (isConnectionEvent(event)) {
|
|
146
|
+
sendSSE('connection', event);
|
|
147
|
+
} else {
|
|
148
|
+
sendSSE('observability', event);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
sendSSE('connected', { timestamp: Date.now() });
|
|
154
|
+
|
|
155
|
+
void (async () => {
|
|
156
|
+
try {
|
|
157
|
+
await manager.handleRequest(body as any);
|
|
158
|
+
} catch (error) {
|
|
159
|
+
const err = error instanceof Error ? error : new Error('Unknown error');
|
|
160
|
+
sendSSE('rpc-response', {
|
|
161
|
+
id: (body as any).id || 'unknown',
|
|
162
|
+
error: {
|
|
163
|
+
code: 'EXECUTION_ERROR',
|
|
164
|
+
message: err.message,
|
|
165
|
+
},
|
|
166
|
+
} satisfies McpRpcResponse);
|
|
167
|
+
} finally {
|
|
168
|
+
streamWritable = false;
|
|
169
|
+
manager.dispose();
|
|
170
|
+
writer.close().catch(() => { });
|
|
171
|
+
}
|
|
172
|
+
})();
|
|
173
|
+
|
|
174
|
+
return new Response(stream.readable, {
|
|
175
|
+
status: 200,
|
|
176
|
+
headers: {
|
|
177
|
+
'Content-Type': 'text/event-stream',
|
|
178
|
+
'Cache-Control': 'no-cache, no-transform',
|
|
179
|
+
'Connection': 'keep-alive',
|
|
180
|
+
'X-Accel-Buffering': 'no',
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
} catch (error) {
|
|
184
|
+
const err = error instanceof Error ? error : new Error('Unknown error');
|
|
185
|
+
console.error('[MCP Next Handler] Failed to handle RPC', {
|
|
186
|
+
identity,
|
|
187
|
+
message: err.message,
|
|
188
|
+
stack: err.stack,
|
|
189
|
+
rawBody: rawBody.slice(0, 500),
|
|
190
|
+
});
|
|
191
|
+
return Response.json(
|
|
192
|
+
{
|
|
193
|
+
error: {
|
|
194
|
+
code: 'EXECUTION_ERROR',
|
|
195
|
+
message: err.message,
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
{ status: 500 }
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return { GET, POST };
|
|
204
|
+
}
|