@highstate/designer 0.7.2 → 0.7.3
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/package.json +14 -7
- package/.output/nitro.json +0 -15
- package/.output/public/_nuxt/1_b4y8eQ.js +0 -1
- package/.output/public/_nuxt/BjOhMR1f.js +0 -242
- package/.output/public/_nuxt/CPAAHz3G.js +0 -1
- package/.output/public/_nuxt/CmGpyJTe.js +0 -1
- package/.output/public/_nuxt/builds/latest.json +0 -1
- package/.output/public/_nuxt/builds/meta/f777d22c-e958-4e7c-865d-11bb8a560858.json +0 -1
- package/.output/public/_nuxt/entry.Vs8IncyG.css +0 -5
- package/.output/public/_nuxt/error-404.BJkSn6RI.css +0 -1
- package/.output/public/_nuxt/error-500.TOCKLquH.css +0 -1
- package/.output/public/_nuxt/materialdesignicons-webfont.B6OSyW2I.woff2 +0 -0
- package/.output/public/_nuxt/materialdesignicons-webfont.BpRar1d5.ttf +0 -0
- package/.output/public/_nuxt/materialdesignicons-webfont.Bvl3VxMs.woff +0 -0
- package/.output/public/_nuxt/materialdesignicons-webfont.TEmAk13K.eot +0 -0
- package/.output/public/favicon.ico +0 -0
- package/.output/public/libavoid.wasm +0 -0
- package/.output/public/robots.txt +0 -1
- package/.output/server/index.mjs +0 -11426
- package/.output/server/index.mjs.map +0 -1
- package/.output/server/node_modules/@babel/parser/lib/index.js +0 -14246
- package/.output/server/node_modules/@babel/parser/package.json +0 -50
- package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/fetchRequestHandler.mjs +0 -74
- package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/index.mjs +0 -1
- package/.output/server/node_modules/@trpc/server/dist/adapters/node-http/incomingMessageToRequest.mjs +0 -119
- package/.output/server/node_modules/@trpc/server/dist/adapters/node-http/index.mjs +0 -2
- package/.output/server/node_modules/@trpc/server/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +0 -92
- package/.output/server/node_modules/@trpc/server/dist/adapters/node-http/writeResponse.mjs +0 -79
- package/.output/server/node_modules/@trpc/server/dist/index.mjs +0 -12
- package/.output/server/node_modules/@trpc/server/dist/observable/observable.mjs +0 -175
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/createProxy.mjs +0 -73
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/error/TRPCError.mjs +0 -79
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/error/formatter.mjs +0 -5
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/error/getErrorShape.mjs +0 -29
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/abortError.mjs +0 -10
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/contentType.mjs +0 -229
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +0 -76
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/parseConnectionParams.mjs +0 -39
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/resolveResponse.mjs +0 -570
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/initTRPC.mjs +0 -80
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/middleware.mjs +0 -90
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/parser.mjs +0 -52
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs +0 -198
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/rootConfig.mjs +0 -6
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs +0 -278
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/rpc/codes.mjs +0 -54
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/jsonl.mjs +0 -603
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/sse.mjs +0 -369
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/tracked.mjs +0 -25
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/asyncIterable.mjs +0 -165
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/createDeferred.mjs +0 -15
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/disposable.mjs +0 -43
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.mjs +0 -239
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.mjs +0 -23
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/timerResource.mjs +0 -23
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/withPing.mjs +0 -127
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/transformer.mjs +0 -101
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/utils.mjs +0 -83
- package/.output/server/node_modules/@trpc/server/dist/vendor/standard-schema-v1/error.mjs +0 -26
- package/.output/server/node_modules/@trpc/server/dist/vendor/unpromise/unpromise.mjs +0 -289
- package/.output/server/node_modules/@trpc/server/package.json +0 -156
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +0 -6690
- package/.output/server/node_modules/@vue/compiler-core/package.json +0 -58
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +0 -686
- package/.output/server/node_modules/@vue/compiler-dom/package.json +0 -57
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +0 -1404
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +0 -34
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +0 -1789
- package/.output/server/node_modules/@vue/reactivity/package.json +0 -55
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +0 -6654
- package/.output/server/node_modules/@vue/runtime-core/package.json +0 -52
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +0 -1669
- package/.output/server/node_modules/@vue/runtime-dom/package.json +0 -60
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +0 -857
- package/.output/server/node_modules/@vue/server-renderer/package.json +0 -55
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +0 -594
- package/.output/server/node_modules/@vue/shared/package.json +0 -47
- package/.output/server/node_modules/devalue/index.js +0 -3
- package/.output/server/node_modules/devalue/package.json +0 -34
- package/.output/server/node_modules/devalue/src/base64.js +0 -110
- package/.output/server/node_modules/devalue/src/constants.js +0 -6
- package/.output/server/node_modules/devalue/src/parse.js +0 -160
- package/.output/server/node_modules/devalue/src/stringify.js +0 -232
- package/.output/server/node_modules/devalue/src/uneval.js +0 -351
- package/.output/server/node_modules/devalue/src/utils.js +0 -113
- package/.output/server/node_modules/entities/lib/decode.js +0 -536
- package/.output/server/node_modules/entities/lib/decode_codepoint.js +0 -76
- package/.output/server/node_modules/entities/lib/generated/decode-data-html.js +0 -9
- package/.output/server/node_modules/entities/lib/generated/decode-data-xml.js +0 -9
- package/.output/server/node_modules/entities/package.json +0 -90
- package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +0 -344
- package/.output/server/node_modules/estree-walker/package.json +0 -37
- package/.output/server/node_modules/hookable/dist/index.mjs +0 -290
- package/.output/server/node_modules/hookable/package.json +0 -49
- package/.output/server/node_modules/source-map-js/lib/array-set.js +0 -121
- package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +0 -140
- package/.output/server/node_modules/source-map-js/lib/base64.js +0 -67
- package/.output/server/node_modules/source-map-js/lib/binary-search.js +0 -111
- package/.output/server/node_modules/source-map-js/lib/mapping-list.js +0 -79
- package/.output/server/node_modules/source-map-js/lib/quick-sort.js +0 -132
- package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +0 -1188
- package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +0 -444
- package/.output/server/node_modules/source-map-js/lib/source-node.js +0 -413
- package/.output/server/node_modules/source-map-js/lib/util.js +0 -594
- package/.output/server/node_modules/source-map-js/package.json +0 -71
- package/.output/server/node_modules/source-map-js/source-map.js +0 -8
- package/.output/server/node_modules/ufo/dist/index.mjs +0 -630
- package/.output/server/node_modules/ufo/package.json +0 -47
- package/.output/server/node_modules/unhead/dist/plugins.mjs +0 -94
- package/.output/server/node_modules/unhead/dist/server.mjs +0 -220
- package/.output/server/node_modules/unhead/dist/shared/unhead.C13swrCa.mjs +0 -48
- package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +0 -148
- package/.output/server/node_modules/unhead/dist/shared/unhead.Cp0iF6eN.mjs +0 -177
- package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +0 -196
- package/.output/server/node_modules/unhead/dist/shared/unhead.DZbvapt-.mjs +0 -70
- package/.output/server/node_modules/unhead/dist/shared/unhead.DeCxexjU.mjs +0 -166
- package/.output/server/node_modules/unhead/dist/shared/unhead.Txd0XTIP.mjs +0 -172
- package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +0 -38
- package/.output/server/node_modules/unhead/dist/utils.mjs +0 -5
- package/.output/server/node_modules/unhead/package.json +0 -101
- package/.output/server/node_modules/vue/dist/vue.cjs.js +0 -80
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +0 -66
- package/.output/server/node_modules/vue/index.js +0 -7
- package/.output/server/node_modules/vue/index.mjs +0 -1
- package/.output/server/node_modules/vue/package.json +0 -112
- package/.output/server/node_modules/vue/server-renderer/index.mjs +0 -1
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +0 -196
- package/.output/server/node_modules/vue-bundle-renderer/package.json +0 -50
- package/.output/server/node_modules/zod/lib/index.mjs +0 -4405
- package/.output/server/node_modules/zod/package.json +0 -122
- package/.output/server/package.json +0 -1
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@babel/parser",
|
|
3
|
-
"version": "7.27.0",
|
|
4
|
-
"description": "A JavaScript parser",
|
|
5
|
-
"author": "The Babel Team (https://babel.dev/team)",
|
|
6
|
-
"homepage": "https://babel.dev/docs/en/next/babel-parser",
|
|
7
|
-
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen",
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"publishConfig": {
|
|
10
|
-
"access": "public"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"babel",
|
|
14
|
-
"javascript",
|
|
15
|
-
"parser",
|
|
16
|
-
"tc39",
|
|
17
|
-
"ecmascript",
|
|
18
|
-
"@babel/parser"
|
|
19
|
-
],
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "https://github.com/babel/babel.git",
|
|
23
|
-
"directory": "packages/babel-parser"
|
|
24
|
-
},
|
|
25
|
-
"main": "./lib/index.js",
|
|
26
|
-
"types": "./typings/babel-parser.d.ts",
|
|
27
|
-
"files": [
|
|
28
|
-
"bin",
|
|
29
|
-
"lib",
|
|
30
|
-
"typings/babel-parser.d.ts",
|
|
31
|
-
"index.cjs"
|
|
32
|
-
],
|
|
33
|
-
"engines": {
|
|
34
|
-
"node": ">=6.0.0"
|
|
35
|
-
},
|
|
36
|
-
"# dependencies": "This package doesn't actually have runtime dependencies. @babel/types is only needed for type definitions.",
|
|
37
|
-
"dependencies": {
|
|
38
|
-
"@babel/types": "^7.27.0"
|
|
39
|
-
},
|
|
40
|
-
"devDependencies": {
|
|
41
|
-
"@babel/code-frame": "^7.26.2",
|
|
42
|
-
"@babel/helper-check-duplicate-nodes": "^7.25.9",
|
|
43
|
-
"@babel/helper-fixtures": "^7.26.0",
|
|
44
|
-
"@babel/helper-string-parser": "^7.25.9",
|
|
45
|
-
"@babel/helper-validator-identifier": "^7.25.9",
|
|
46
|
-
"charcodes": "^0.2.0"
|
|
47
|
-
},
|
|
48
|
-
"bin": "./bin/babel-parser.js",
|
|
49
|
-
"type": "commonjs"
|
|
50
|
-
}
|
package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/fetchRequestHandler.mjs
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { resolveResponse } from '../../unstable-core-do-not-import/http/resolveResponse.mjs';
|
|
2
|
-
import '../../unstable-core-do-not-import/rootConfig.mjs';
|
|
3
|
-
import '../../vendor/unpromise/unpromise.mjs';
|
|
4
|
-
import '../../unstable-core-do-not-import/stream/utils/disposable.mjs';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
12
|
-
* import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
|
|
13
|
-
* ```
|
|
14
|
-
*/ // @trpc/server
|
|
15
|
-
const trimSlashes = (path)=>{
|
|
16
|
-
path = path.startsWith('/') ? path.slice(1) : path;
|
|
17
|
-
path = path.endsWith('/') ? path.slice(0, -1) : path;
|
|
18
|
-
return path;
|
|
19
|
-
};
|
|
20
|
-
async function fetchRequestHandler(opts) {
|
|
21
|
-
const resHeaders = new Headers();
|
|
22
|
-
const createContext = async (innerOpts)=>{
|
|
23
|
-
return opts.createContext?.({
|
|
24
|
-
req: opts.req,
|
|
25
|
-
resHeaders,
|
|
26
|
-
...innerOpts
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
const url = new URL(opts.req.url);
|
|
30
|
-
const pathname = trimSlashes(url.pathname);
|
|
31
|
-
const endpoint = trimSlashes(opts.endpoint);
|
|
32
|
-
const path = trimSlashes(pathname.slice(endpoint.length));
|
|
33
|
-
return await resolveResponse({
|
|
34
|
-
...opts,
|
|
35
|
-
req: opts.req,
|
|
36
|
-
createContext,
|
|
37
|
-
path,
|
|
38
|
-
error: null,
|
|
39
|
-
onError (o) {
|
|
40
|
-
opts?.onError?.({
|
|
41
|
-
...o,
|
|
42
|
-
req: opts.req
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
responseMeta (data) {
|
|
46
|
-
const meta = opts.responseMeta?.(data);
|
|
47
|
-
if (meta?.headers) {
|
|
48
|
-
if (meta.headers instanceof Headers) {
|
|
49
|
-
for (const [key, value] of meta.headers.entries()){
|
|
50
|
-
resHeaders.append(key, value);
|
|
51
|
-
}
|
|
52
|
-
} else {
|
|
53
|
-
/**
|
|
54
|
-
* @deprecated, delete in v12
|
|
55
|
-
*/ for (const [key, value] of Object.entries(meta.headers)){
|
|
56
|
-
if (Array.isArray(value)) {
|
|
57
|
-
for (const v of value){
|
|
58
|
-
resHeaders.append(key, v);
|
|
59
|
-
}
|
|
60
|
-
} else if (typeof value === 'string') {
|
|
61
|
-
resHeaders.set(key, value);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return {
|
|
67
|
-
headers: resHeaders,
|
|
68
|
-
status: meta?.status
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export { fetchRequestHandler };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { fetchRequestHandler } from './fetchRequestHandler.mjs';
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { TRPCError } from '../../unstable-core-do-not-import/error/TRPCError.mjs';
|
|
2
|
-
import '../../vendor/unpromise/unpromise.mjs';
|
|
3
|
-
import '../../unstable-core-do-not-import/stream/utils/disposable.mjs';
|
|
4
|
-
import '../../unstable-core-do-not-import/rootConfig.mjs';
|
|
5
|
-
|
|
6
|
-
function createBody(req, opts) {
|
|
7
|
-
// Some adapters will pre-parse the body and add it to the request object
|
|
8
|
-
if ('body' in req) {
|
|
9
|
-
if (req.body === undefined) {
|
|
10
|
-
// If body property exists but is undefined, return undefined
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|
|
13
|
-
// If the body is already a string, return it directly
|
|
14
|
-
if (typeof req.body === 'string') {
|
|
15
|
-
return req.body;
|
|
16
|
-
}
|
|
17
|
-
// If body exists but isn't a string, stringify it as JSON
|
|
18
|
-
return JSON.stringify(req.body);
|
|
19
|
-
}
|
|
20
|
-
let size = 0;
|
|
21
|
-
let hasClosed = false;
|
|
22
|
-
return new ReadableStream({
|
|
23
|
-
start (controller) {
|
|
24
|
-
const onData = (chunk)=>{
|
|
25
|
-
size += chunk.length;
|
|
26
|
-
if (!opts.maxBodySize || size <= opts.maxBodySize) {
|
|
27
|
-
controller.enqueue(new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength));
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
controller.error(new TRPCError({
|
|
31
|
-
code: 'PAYLOAD_TOO_LARGE'
|
|
32
|
-
}));
|
|
33
|
-
hasClosed = true;
|
|
34
|
-
req.off('data', onData);
|
|
35
|
-
req.off('end', onEnd);
|
|
36
|
-
};
|
|
37
|
-
const onEnd = ()=>{
|
|
38
|
-
if (hasClosed) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
hasClosed = true;
|
|
42
|
-
req.off('data', onData);
|
|
43
|
-
req.off('end', onEnd);
|
|
44
|
-
controller.close();
|
|
45
|
-
};
|
|
46
|
-
req.on('data', onData);
|
|
47
|
-
req.on('end', onEnd);
|
|
48
|
-
},
|
|
49
|
-
cancel () {
|
|
50
|
-
req.destroy();
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function createURL(req) {
|
|
55
|
-
try {
|
|
56
|
-
const protocol = // http2
|
|
57
|
-
req.headers[':scheme'] && req.headers[':scheme'] === 'https' || // http1
|
|
58
|
-
req.socket && 'encrypted' in req.socket && req.socket.encrypted ? 'https:' : 'http:';
|
|
59
|
-
const host = req.headers.host ?? req.headers[':authority'] ?? 'localhost';
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
61
|
-
return new URL(req.url, `${protocol}//${host}`);
|
|
62
|
-
} catch (cause) {
|
|
63
|
-
throw new TRPCError({
|
|
64
|
-
code: 'BAD_REQUEST',
|
|
65
|
-
message: 'Invalid URL',
|
|
66
|
-
cause
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function createHeaders(incoming) {
|
|
71
|
-
const headers = new Headers();
|
|
72
|
-
for(const key in incoming){
|
|
73
|
-
const value = incoming[key];
|
|
74
|
-
if (typeof key === 'string' && key.startsWith(':')) {
|
|
75
|
-
continue;
|
|
76
|
-
}
|
|
77
|
-
if (Array.isArray(value)) {
|
|
78
|
-
for (const item of value){
|
|
79
|
-
headers.append(key, item);
|
|
80
|
-
}
|
|
81
|
-
} else if (value != null) {
|
|
82
|
-
headers.append(key, value);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return headers;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Convert an [`IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage) to a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request)
|
|
89
|
-
*/ function incomingMessageToRequest(req, res, opts) {
|
|
90
|
-
const ac = new AbortController();
|
|
91
|
-
const onAbort = ()=>{
|
|
92
|
-
res.off('close', onAbort);
|
|
93
|
-
req.socket?.off?.('close', onAbort);
|
|
94
|
-
// abort the request
|
|
95
|
-
ac.abort();
|
|
96
|
-
};
|
|
97
|
-
res.once('close', onAbort);
|
|
98
|
-
req.socket?.once?.('close', onAbort);
|
|
99
|
-
// Get host from either regular header or HTTP/2 pseudo-header
|
|
100
|
-
const url = createURL(req);
|
|
101
|
-
const init = {
|
|
102
|
-
headers: createHeaders(req.headers),
|
|
103
|
-
method: req.method,
|
|
104
|
-
signal: ac.signal
|
|
105
|
-
};
|
|
106
|
-
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
|
107
|
-
init.body = createBody(req, opts);
|
|
108
|
-
// init.duplex = 'half' must be set when body is a ReadableStream, and Node follows the spec.
|
|
109
|
-
// However, this property is not defined in the TypeScript types for RequestInit, so we have
|
|
110
|
-
// to cast it here in order to set it without a type error.
|
|
111
|
-
// See https://fetch.spec.whatwg.org/#dom-requestinit-duplex
|
|
112
|
-
// @ts-expect-error this is fine
|
|
113
|
-
init.duplex = 'half';
|
|
114
|
-
}
|
|
115
|
-
const request = new Request(url, init);
|
|
116
|
-
return request;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export { createURL, incomingMessageToRequest };
|
package/.output/server/node_modules/@trpc/server/dist/adapters/node-http/nodeHTTPRequestHandler.mjs
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { getErrorShape } from '../../unstable-core-do-not-import/error/getErrorShape.mjs';
|
|
2
|
-
import { getTRPCErrorFromUnknown } from '../../unstable-core-do-not-import/error/TRPCError.mjs';
|
|
3
|
-
import { transformTRPCResponse } from '../../unstable-core-do-not-import/transformer.mjs';
|
|
4
|
-
import { run } from '../../unstable-core-do-not-import/utils.mjs';
|
|
5
|
-
import { resolveResponse } from '../../unstable-core-do-not-import/http/resolveResponse.mjs';
|
|
6
|
-
import '../../unstable-core-do-not-import/rootConfig.mjs';
|
|
7
|
-
import '../../vendor/unpromise/unpromise.mjs';
|
|
8
|
-
import '../../unstable-core-do-not-import/stream/utils/disposable.mjs';
|
|
9
|
-
import { incomingMessageToRequest } from './incomingMessageToRequest.mjs';
|
|
10
|
-
import { writeResponse } from './writeResponse.mjs';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
18
|
-
* import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
|
|
19
|
-
* ```
|
|
20
|
-
*/ // @trpc/server
|
|
21
|
-
/**
|
|
22
|
-
* @internal
|
|
23
|
-
*/ function internal_exceptionHandler(opts) {
|
|
24
|
-
return (cause)=>{
|
|
25
|
-
const { res, req } = opts;
|
|
26
|
-
const error = getTRPCErrorFromUnknown(cause);
|
|
27
|
-
const shape = getErrorShape({
|
|
28
|
-
config: opts.router._def._config,
|
|
29
|
-
error,
|
|
30
|
-
type: 'unknown',
|
|
31
|
-
path: undefined,
|
|
32
|
-
input: undefined,
|
|
33
|
-
ctx: undefined
|
|
34
|
-
});
|
|
35
|
-
opts.onError?.({
|
|
36
|
-
req,
|
|
37
|
-
error,
|
|
38
|
-
type: 'unknown',
|
|
39
|
-
path: undefined,
|
|
40
|
-
input: undefined,
|
|
41
|
-
ctx: undefined
|
|
42
|
-
});
|
|
43
|
-
const transformed = transformTRPCResponse(opts.router._def._config, {
|
|
44
|
-
error: shape
|
|
45
|
-
});
|
|
46
|
-
res.statusCode = shape.data.httpStatus;
|
|
47
|
-
res.end(JSON.stringify(transformed));
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* @remark the promise never rejects
|
|
52
|
-
*/ async function nodeHTTPRequestHandler(opts) {
|
|
53
|
-
return new Promise((resolve)=>{
|
|
54
|
-
const handleViaMiddleware = opts.middleware ?? ((_req, _res, next)=>next());
|
|
55
|
-
opts.res.once('finish', ()=>{
|
|
56
|
-
resolve();
|
|
57
|
-
});
|
|
58
|
-
return handleViaMiddleware(opts.req, opts.res, (err)=>{
|
|
59
|
-
run(async ()=>{
|
|
60
|
-
const request = incomingMessageToRequest(opts.req, opts.res, {
|
|
61
|
-
maxBodySize: opts.maxBodySize ?? null
|
|
62
|
-
});
|
|
63
|
-
// Build tRPC dependencies
|
|
64
|
-
const createContext = async (innerOpts)=>{
|
|
65
|
-
return await opts.createContext?.({
|
|
66
|
-
...opts,
|
|
67
|
-
...innerOpts
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
const response = await resolveResponse({
|
|
71
|
-
...opts,
|
|
72
|
-
req: request,
|
|
73
|
-
error: err ? getTRPCErrorFromUnknown(err) : null,
|
|
74
|
-
createContext,
|
|
75
|
-
onError (o) {
|
|
76
|
-
opts?.onError?.({
|
|
77
|
-
...o,
|
|
78
|
-
req: opts.req
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
await writeResponse({
|
|
83
|
-
request,
|
|
84
|
-
response,
|
|
85
|
-
rawResponse: opts.res
|
|
86
|
-
});
|
|
87
|
-
}).catch(internal_exceptionHandler(opts));
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export { internal_exceptionHandler, nodeHTTPRequestHandler };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { isAbortError } from '../../unstable-core-do-not-import/http/abortError.mjs';
|
|
2
|
-
import '../../vendor/unpromise/unpromise.mjs';
|
|
3
|
-
import '../../unstable-core-do-not-import/stream/utils/disposable.mjs';
|
|
4
|
-
import '../../unstable-core-do-not-import/rootConfig.mjs';
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line no-restricted-imports
|
|
7
|
-
async function writeResponseBodyChunk(res, chunk) {
|
|
8
|
-
// useful for debugging 🙃
|
|
9
|
-
// console.debug('writing', new TextDecoder().decode(chunk));
|
|
10
|
-
if (res.write(chunk) === false) {
|
|
11
|
-
await new Promise((resolve, reject)=>{
|
|
12
|
-
const onError = (err)=>{
|
|
13
|
-
reject(err);
|
|
14
|
-
cleanup();
|
|
15
|
-
};
|
|
16
|
-
const onDrain = ()=>{
|
|
17
|
-
resolve();
|
|
18
|
-
cleanup();
|
|
19
|
-
};
|
|
20
|
-
const cleanup = ()=>{
|
|
21
|
-
res.off('error', onError);
|
|
22
|
-
res.off('drain', onDrain);
|
|
23
|
-
};
|
|
24
|
-
res.once('error', onError);
|
|
25
|
-
res.once('drain', onDrain);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @internal
|
|
31
|
-
*/ async function writeResponseBody(opts) {
|
|
32
|
-
const { res } = opts;
|
|
33
|
-
try {
|
|
34
|
-
const writableStream = new WritableStream({
|
|
35
|
-
async write (chunk) {
|
|
36
|
-
await writeResponseBodyChunk(res, chunk);
|
|
37
|
-
res.flush?.();
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
await opts.body.pipeTo(writableStream, {
|
|
41
|
-
signal: opts.signal
|
|
42
|
-
});
|
|
43
|
-
} catch (err) {
|
|
44
|
-
if (isAbortError(err)) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
throw err;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* @internal
|
|
52
|
-
*/ async function writeResponse(opts) {
|
|
53
|
-
const { response, rawResponse } = opts;
|
|
54
|
-
// Only override status code if it hasn't been explicitly set in a procedure etc
|
|
55
|
-
if (rawResponse.statusCode === 200) {
|
|
56
|
-
rawResponse.statusCode = response.status;
|
|
57
|
-
}
|
|
58
|
-
for (const [key, value] of response.headers){
|
|
59
|
-
rawResponse.setHeader(key, value);
|
|
60
|
-
}
|
|
61
|
-
try {
|
|
62
|
-
if (response.body) {
|
|
63
|
-
await writeResponseBody({
|
|
64
|
-
res: rawResponse,
|
|
65
|
-
signal: opts.request.signal,
|
|
66
|
-
body: response.body
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
} catch (err) {
|
|
70
|
-
if (!rawResponse.headersSent) {
|
|
71
|
-
rawResponse.statusCode = 500;
|
|
72
|
-
}
|
|
73
|
-
throw err;
|
|
74
|
-
} finally{
|
|
75
|
-
rawResponse.end();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export { writeResponse, writeResponseBody };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { createFlatProxy as createTRPCFlatProxy, createRecursiveProxy as createTRPCRecursiveProxy } from './unstable-core-do-not-import/createProxy.mjs';
|
|
2
|
-
export { getErrorShape } from './unstable-core-do-not-import/error/getErrorShape.mjs';
|
|
3
|
-
export { TRPCError, getTRPCErrorFromUnknown } from './unstable-core-do-not-import/error/TRPCError.mjs';
|
|
4
|
-
export { callProcedure as callTRPCProcedure, lazy as experimental_lazy, lazy } from './unstable-core-do-not-import/router.mjs';
|
|
5
|
-
import './vendor/unpromise/unpromise.mjs';
|
|
6
|
-
import './unstable-core-do-not-import/stream/utils/disposable.mjs';
|
|
7
|
-
export { isTrackedEnvelope, sse, tracked } from './unstable-core-do-not-import/stream/tracked.mjs';
|
|
8
|
-
export { transformTRPCResponse } from './unstable-core-do-not-import/transformer.mjs';
|
|
9
|
-
export { initTRPC } from './unstable-core-do-not-import/initTRPC.mjs';
|
|
10
|
-
export { experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware } from './unstable-core-do-not-import/middleware.mjs';
|
|
11
|
-
export { StandardSchemaV1Error } from './vendor/standard-schema-v1/error.mjs';
|
|
12
|
-
import './unstable-core-do-not-import/rootConfig.mjs';
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
/** @public */ function isObservable(x) {
|
|
2
|
-
return typeof x === 'object' && x !== null && 'subscribe' in x;
|
|
3
|
-
}
|
|
4
|
-
/** @public */ function observable(subscribe) {
|
|
5
|
-
const self = {
|
|
6
|
-
subscribe (observer) {
|
|
7
|
-
let teardownRef = null;
|
|
8
|
-
let isDone = false;
|
|
9
|
-
let unsubscribed = false;
|
|
10
|
-
let teardownImmediately = false;
|
|
11
|
-
function unsubscribe() {
|
|
12
|
-
if (teardownRef === null) {
|
|
13
|
-
teardownImmediately = true;
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
if (unsubscribed) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
unsubscribed = true;
|
|
20
|
-
if (typeof teardownRef === 'function') {
|
|
21
|
-
teardownRef();
|
|
22
|
-
} else if (teardownRef) {
|
|
23
|
-
teardownRef.unsubscribe();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
teardownRef = subscribe({
|
|
27
|
-
next (value) {
|
|
28
|
-
if (isDone) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
observer.next?.(value);
|
|
32
|
-
},
|
|
33
|
-
error (err) {
|
|
34
|
-
if (isDone) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
isDone = true;
|
|
38
|
-
observer.error?.(err);
|
|
39
|
-
unsubscribe();
|
|
40
|
-
},
|
|
41
|
-
complete () {
|
|
42
|
-
if (isDone) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
isDone = true;
|
|
46
|
-
observer.complete?.();
|
|
47
|
-
unsubscribe();
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
if (teardownImmediately) {
|
|
51
|
-
unsubscribe();
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
unsubscribe
|
|
55
|
-
};
|
|
56
|
-
},
|
|
57
|
-
pipe (...operations) {
|
|
58
|
-
return operations.reduce(pipeReducer, self);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
return self;
|
|
62
|
-
}
|
|
63
|
-
function pipeReducer(prev, fn) {
|
|
64
|
-
return fn(prev);
|
|
65
|
-
}
|
|
66
|
-
/** @internal */ function observableToPromise(observable) {
|
|
67
|
-
const ac = new AbortController();
|
|
68
|
-
const promise = new Promise((resolve, reject)=>{
|
|
69
|
-
let isDone = false;
|
|
70
|
-
function onDone() {
|
|
71
|
-
if (isDone) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
isDone = true;
|
|
75
|
-
obs$.unsubscribe();
|
|
76
|
-
}
|
|
77
|
-
ac.signal.addEventListener('abort', ()=>{
|
|
78
|
-
reject(ac.signal.reason);
|
|
79
|
-
});
|
|
80
|
-
const obs$ = observable.subscribe({
|
|
81
|
-
next (data) {
|
|
82
|
-
isDone = true;
|
|
83
|
-
resolve(data);
|
|
84
|
-
onDone();
|
|
85
|
-
},
|
|
86
|
-
error (data) {
|
|
87
|
-
reject(data);
|
|
88
|
-
},
|
|
89
|
-
complete () {
|
|
90
|
-
ac.abort();
|
|
91
|
-
onDone();
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
return promise;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* @internal
|
|
99
|
-
*/ function observableToReadableStream(observable, signal) {
|
|
100
|
-
let unsub = null;
|
|
101
|
-
const onAbort = ()=>{
|
|
102
|
-
unsub?.unsubscribe();
|
|
103
|
-
unsub = null;
|
|
104
|
-
signal.removeEventListener('abort', onAbort);
|
|
105
|
-
};
|
|
106
|
-
return new ReadableStream({
|
|
107
|
-
start (controller) {
|
|
108
|
-
unsub = observable.subscribe({
|
|
109
|
-
next (data) {
|
|
110
|
-
controller.enqueue({
|
|
111
|
-
ok: true,
|
|
112
|
-
value: data
|
|
113
|
-
});
|
|
114
|
-
},
|
|
115
|
-
error (error) {
|
|
116
|
-
controller.enqueue({
|
|
117
|
-
ok: false,
|
|
118
|
-
error
|
|
119
|
-
});
|
|
120
|
-
controller.close();
|
|
121
|
-
},
|
|
122
|
-
complete () {
|
|
123
|
-
controller.close();
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
if (signal.aborted) {
|
|
127
|
-
onAbort();
|
|
128
|
-
} else {
|
|
129
|
-
signal.addEventListener('abort', onAbort, {
|
|
130
|
-
once: true
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
cancel () {
|
|
135
|
-
onAbort();
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
/** @internal */ function observableToAsyncIterable(observable, signal) {
|
|
140
|
-
const stream = observableToReadableStream(observable, signal);
|
|
141
|
-
const reader = stream.getReader();
|
|
142
|
-
const iterator = {
|
|
143
|
-
async next () {
|
|
144
|
-
const value = await reader.read();
|
|
145
|
-
if (value.done) {
|
|
146
|
-
return {
|
|
147
|
-
value: undefined,
|
|
148
|
-
done: true
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
const { value: result } = value;
|
|
152
|
-
if (!result.ok) {
|
|
153
|
-
throw result.error;
|
|
154
|
-
}
|
|
155
|
-
return {
|
|
156
|
-
value: result.value,
|
|
157
|
-
done: false
|
|
158
|
-
};
|
|
159
|
-
},
|
|
160
|
-
async return () {
|
|
161
|
-
await reader.cancel();
|
|
162
|
-
return {
|
|
163
|
-
value: undefined,
|
|
164
|
-
done: true
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
return {
|
|
169
|
-
[Symbol.asyncIterator] () {
|
|
170
|
-
return iterator;
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export { isObservable, observable, observableToAsyncIterable, observableToPromise };
|
package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/createProxy.mjs
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
const noop = ()=>{
|
|
2
|
-
// noop
|
|
3
|
-
};
|
|
4
|
-
const freezeIfAvailable = (obj)=>{
|
|
5
|
-
if (Object.freeze) {
|
|
6
|
-
Object.freeze(obj);
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
function createInnerProxy(callback, path, memo) {
|
|
10
|
-
var _memo, _cacheKey;
|
|
11
|
-
const cacheKey = path.join('.');
|
|
12
|
-
(_memo = memo)[_cacheKey = cacheKey] ?? (_memo[_cacheKey] = new Proxy(noop, {
|
|
13
|
-
get (_obj, key) {
|
|
14
|
-
if (typeof key !== 'string' || key === 'then') {
|
|
15
|
-
// special case for if the proxy is accidentally treated
|
|
16
|
-
// like a PromiseLike (like in `Promise.resolve(proxy)`)
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
return createInnerProxy(callback, [
|
|
20
|
-
...path,
|
|
21
|
-
key
|
|
22
|
-
], memo);
|
|
23
|
-
},
|
|
24
|
-
apply (_1, _2, args) {
|
|
25
|
-
const lastOfPath = path[path.length - 1];
|
|
26
|
-
let opts = {
|
|
27
|
-
args,
|
|
28
|
-
path
|
|
29
|
-
};
|
|
30
|
-
// special handling for e.g. `trpc.hello.call(this, 'there')` and `trpc.hello.apply(this, ['there'])
|
|
31
|
-
if (lastOfPath === 'call') {
|
|
32
|
-
opts = {
|
|
33
|
-
args: args.length >= 2 ? [
|
|
34
|
-
args[1]
|
|
35
|
-
] : [],
|
|
36
|
-
path: path.slice(0, -1)
|
|
37
|
-
};
|
|
38
|
-
} else if (lastOfPath === 'apply') {
|
|
39
|
-
opts = {
|
|
40
|
-
args: args.length >= 2 ? args[1] : [],
|
|
41
|
-
path: path.slice(0, -1)
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
freezeIfAvailable(opts.args);
|
|
45
|
-
freezeIfAvailable(opts.path);
|
|
46
|
-
return callback(opts);
|
|
47
|
-
}
|
|
48
|
-
}));
|
|
49
|
-
return memo[cacheKey];
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Creates a proxy that calls the callback with the path and arguments
|
|
53
|
-
*
|
|
54
|
-
* @internal
|
|
55
|
-
*/ const createRecursiveProxy = (callback)=>createInnerProxy(callback, [], Object.create(null));
|
|
56
|
-
/**
|
|
57
|
-
* Used in place of `new Proxy` where each handler will map 1 level deep to another value.
|
|
58
|
-
*
|
|
59
|
-
* @internal
|
|
60
|
-
*/ const createFlatProxy = (callback)=>{
|
|
61
|
-
return new Proxy(noop, {
|
|
62
|
-
get (_obj, name) {
|
|
63
|
-
if (name === 'then') {
|
|
64
|
-
// special case for if the proxy is accidentally treated
|
|
65
|
-
// like a PromiseLike (like in `Promise.resolve(proxy)`)
|
|
66
|
-
return undefined;
|
|
67
|
-
}
|
|
68
|
-
return callback(name);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export { createFlatProxy, createRecursiveProxy };
|