@trpc/server 11.3.1 → 11.3.2-canary.4
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/adapters/aws-lambda/package.json +1 -0
- package/adapters/express/package.json +1 -0
- package/adapters/fastify/package.json +1 -0
- package/adapters/fetch/package.json +1 -0
- package/adapters/next/package.json +1 -0
- package/adapters/next-app-dir/package.json +1 -0
- package/adapters/node-http/package.json +1 -0
- package/adapters/standalone/package.json +1 -0
- package/adapters/ws/package.json +1 -0
- package/dist/adapters/aws-lambda/index.cjs +255 -0
- package/dist/adapters/aws-lambda/index.d.cts +31 -0
- package/dist/adapters/aws-lambda/index.d.cts.map +1 -0
- package/dist/adapters/aws-lambda/index.d.mts +31 -0
- package/dist/adapters/aws-lambda/index.d.mts.map +1 -0
- package/dist/adapters/aws-lambda/index.mjs +248 -57
- package/dist/adapters/aws-lambda/index.mjs.map +1 -0
- package/dist/adapters/express.cjs +34 -0
- package/dist/adapters/express.d.cts +15 -0
- package/dist/adapters/express.d.cts.map +1 -0
- package/dist/adapters/express.d.mts +15 -0
- package/dist/adapters/express.d.mts.map +1 -0
- package/dist/adapters/express.mjs +30 -32
- package/dist/adapters/express.mjs.map +1 -0
- package/dist/adapters/fastify/index.cjs +75 -0
- package/dist/adapters/fastify/index.d.cts +29 -0
- package/dist/adapters/fastify/index.d.cts.map +1 -0
- package/dist/adapters/fastify/index.d.mts +29 -0
- package/dist/adapters/fastify/index.d.mts.map +1 -0
- package/dist/adapters/fastify/index.mjs +75 -2
- package/dist/adapters/fastify/index.mjs.map +1 -0
- package/dist/adapters/fetch/index.cjs +58 -0
- package/dist/adapters/fetch/index.d.cts +30 -0
- package/dist/adapters/fetch/index.d.cts.map +1 -0
- package/dist/adapters/fetch/index.d.mts +30 -0
- package/dist/adapters/fetch/index.d.mts.map +1 -0
- package/dist/adapters/fetch/index.mjs +59 -1
- package/dist/adapters/fetch/index.mjs.map +1 -0
- package/dist/adapters/next-app-dir.cjs +3050 -0
- package/dist/adapters/next-app-dir.d.cts +58 -0
- package/dist/adapters/next-app-dir.d.cts.map +1 -0
- package/dist/adapters/next-app-dir.d.mts +58 -0
- package/dist/adapters/next-app-dir.d.mts.map +1 -0
- package/dist/adapters/next-app-dir.mjs +3048 -4
- package/dist/adapters/next-app-dir.mjs.map +1 -0
- package/dist/adapters/next.cjs +41 -0
- package/dist/adapters/next.d.cts +19 -0
- package/dist/adapters/next.d.cts.map +1 -0
- package/dist/adapters/next.d.mts +19 -0
- package/dist/adapters/next.d.mts.map +1 -0
- package/dist/adapters/next.mjs +37 -44
- package/dist/adapters/next.mjs.map +1 -0
- package/dist/adapters/node-http/index.cjs +15 -0
- package/dist/adapters/node-http/index.d.cts +5 -0
- package/dist/adapters/node-http/index.d.mts +5 -0
- package/dist/adapters/node-http/index.mjs +12 -2
- package/dist/adapters/standalone.cjs +52 -0
- package/dist/adapters/standalone.d.cts +33 -0
- package/dist/adapters/standalone.d.cts.map +1 -0
- package/dist/adapters/standalone.d.mts +33 -0
- package/dist/adapters/standalone.d.mts.map +1 -0
- package/dist/adapters/standalone.mjs +40 -34
- package/dist/adapters/standalone.mjs.map +1 -0
- package/dist/adapters/ws.cjs +17 -0
- package/dist/adapters/ws.d.cts +61 -0
- package/dist/adapters/ws.d.cts.map +1 -0
- package/dist/adapters/ws.d.mts +61 -0
- package/dist/adapters/ws.d.mts.map +1 -0
- package/dist/adapters/ws.mjs +14 -539
- package/dist/contentTypeParsers-SN4WL9ze.mjs +13 -0
- package/dist/contentTypeParsers-SN4WL9ze.mjs.map +1 -0
- package/dist/contentTypeParsers-iAFF_pJG.cjs +18 -0
- package/dist/getErrorShape-CsikfkAc.cjs +201 -0
- package/dist/getErrorShape-DyYil4aT.mjs +149 -0
- package/dist/getErrorShape-DyYil4aT.mjs.map +1 -0
- package/dist/http-CWyjOa1l.mjs +0 -0
- package/dist/http-DXy3XyhL.cjs +0 -0
- package/dist/http.cjs +14 -0
- package/dist/http.d.cts +3 -0
- package/dist/http.d.mts +3 -0
- package/dist/http.mjs +9 -8
- package/dist/index.cjs +22 -0
- package/dist/index.d-BiUz7kM_.d.cts +65 -0
- package/dist/index.d-BiUz7kM_.d.cts.map +1 -0
- package/dist/index.d-ChWYhXbd.d.cts +99 -0
- package/dist/index.d-ChWYhXbd.d.cts.map +1 -0
- package/dist/index.d-CvZXeEyR.d.cts +11 -0
- package/dist/index.d-CvZXeEyR.d.cts.map +1 -0
- package/dist/index.d-D4qZxQJh.d.mts +65 -0
- package/dist/index.d-D4qZxQJh.d.mts.map +1 -0
- package/dist/index.d-Ocy_AnXj.d.mts +99 -0
- package/dist/index.d-Ocy_AnXj.d.mts.map +1 -0
- package/dist/index.d-vq_QHko2.d.mts +11 -0
- package/dist/index.d-vq_QHko2.d.mts.map +1 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +6 -13
- package/dist/initTRPC-COaJMShh.mjs +339 -0
- package/dist/initTRPC-COaJMShh.mjs.map +1 -0
- package/dist/initTRPC-DjEpHmY2.cjs +397 -0
- package/dist/node-http-BPR68yI4.cjs +243 -0
- package/dist/node-http-BUQnHuGI.mjs +221 -0
- package/dist/node-http-BUQnHuGI.mjs.map +1 -0
- package/dist/observable/index.cjs +13 -0
- package/dist/observable/index.d.cts +2 -0
- package/dist/observable/index.d.mts +2 -0
- package/dist/observable/index.mjs +4 -3
- package/dist/observable-B1orLHHI.mjs +155 -0
- package/dist/observable-B1orLHHI.mjs.map +1 -0
- package/dist/observable-BwdrSFZU.cjs +178 -0
- package/dist/observable-C6qq2Ydk.cjs +180 -0
- package/dist/observable-CFXA_tyK.mjs +146 -0
- package/dist/observable-CFXA_tyK.mjs.map +1 -0
- package/dist/parseTRPCMessage-ByQWigsq.cjs +73 -0
- package/dist/parseTRPCMessage-CNyYMSRB.mjs +63 -0
- package/dist/parseTRPCMessage-CNyYMSRB.mjs.map +1 -0
- package/dist/resolveResponse-B2CuaT_1.cjs +2042 -0
- package/dist/resolveResponse-DPbYgJDD.mjs +1912 -0
- package/dist/resolveResponse-DPbYgJDD.mjs.map +1 -0
- package/dist/rpc.cjs +6 -0
- package/dist/rpc.d.cts +3 -0
- package/dist/rpc.d.mts +3 -0
- package/dist/rpc.mjs +4 -5
- package/dist/shared.cjs +5 -0
- package/dist/shared.d.cts +4 -0
- package/dist/shared.d.mts +4 -0
- package/dist/shared.mjs +4 -6
- package/dist/tracked-Dl9sBZxY.cjs +483 -0
- package/dist/tracked-GEWPoL0C.mjs +383 -0
- package/dist/tracked-GEWPoL0C.mjs.map +1 -0
- package/dist/unstable-core-do-not-import-D89CaGtL.mjs +29 -0
- package/dist/unstable-core-do-not-import-D89CaGtL.mjs.map +1 -0
- package/dist/unstable-core-do-not-import-DFQys1IC.cjs +34 -0
- package/dist/unstable-core-do-not-import.cjs +83 -0
- package/dist/unstable-core-do-not-import.d-CSxj_rbP.d.cts +1974 -0
- package/dist/unstable-core-do-not-import.d-CSxj_rbP.d.cts.map +1 -0
- package/dist/unstable-core-do-not-import.d-ptrxwuSa.d.mts +1974 -0
- package/dist/unstable-core-do-not-import.d-ptrxwuSa.d.mts.map +1 -0
- package/dist/unstable-core-do-not-import.d.cts +3 -0
- package/dist/unstable-core-do-not-import.d.mts +3 -0
- package/dist/unstable-core-do-not-import.mjs +11 -30
- package/dist/utils-BHZJcBRv.mjs +137 -0
- package/dist/utils-BHZJcBRv.mjs.map +1 -0
- package/dist/utils-DVO6HZiR.cjs +220 -0
- package/dist/ws-C2nEUNk_.cjs +425 -0
- package/dist/ws-eIVIMTrw.mjs +409 -0
- package/dist/ws-eIVIMTrw.mjs.map +1 -0
- package/http/package.json +1 -0
- package/observable/package.json +1 -0
- package/package.json +131 -55
- package/rpc/package.json +1 -0
- package/shared/package.json +1 -0
- package/src/@trpc/server/index.ts +24 -0
- package/src/unstable-core-do-not-import/http/contentType.ts +5 -4
- package/src/unstable-core-do-not-import/initTRPC.ts +79 -4
- package/src/unstable-core-do-not-import/router.ts +36 -12
- package/src/unstable-core-do-not-import/utils.ts +3 -2
- package/unstable-core-do-not-import/package.json +1 -0
- package/adapters/aws-lambda/index.d.ts +0 -1
- package/adapters/aws-lambda/index.js +0 -1
- package/adapters/express/index.d.ts +0 -1
- package/adapters/express/index.js +0 -1
- package/adapters/fastify/index.d.ts +0 -1
- package/adapters/fastify/index.js +0 -1
- package/adapters/fetch/index.d.ts +0 -1
- package/adapters/fetch/index.js +0 -1
- package/adapters/next/index.d.ts +0 -1
- package/adapters/next/index.js +0 -1
- package/adapters/next-app-dir/index.d.ts +0 -1
- package/adapters/next-app-dir/index.js +0 -1
- package/adapters/node-http/content-type/form-data/index.d.ts +0 -1
- package/adapters/node-http/content-type/form-data/index.js +0 -1
- package/adapters/node-http/content-type/json/index.d.ts +0 -1
- package/adapters/node-http/content-type/json/index.js +0 -1
- package/adapters/node-http/index.d.ts +0 -1
- package/adapters/node-http/index.js +0 -1
- package/adapters/standalone/index.d.ts +0 -1
- package/adapters/standalone/index.js +0 -1
- package/adapters/ws/index.d.ts +0 -1
- package/adapters/ws/index.js +0 -1
- package/dist/@trpc/server/http.d.ts +0 -8
- package/dist/@trpc/server/http.d.ts.map +0 -1
- package/dist/@trpc/server/index.d.ts +0 -65
- package/dist/@trpc/server/index.d.ts.map +0 -1
- package/dist/@trpc/server/rpc.d.ts +0 -3
- package/dist/@trpc/server/rpc.d.ts.map +0 -1
- package/dist/adapters/aws-lambda/getPlanner.d.ts +0 -15
- package/dist/adapters/aws-lambda/getPlanner.d.ts.map +0 -1
- package/dist/adapters/aws-lambda/getPlanner.js +0 -179
- package/dist/adapters/aws-lambda/getPlanner.mjs +0 -177
- package/dist/adapters/aws-lambda/index.d.ts +0 -23
- package/dist/adapters/aws-lambda/index.d.ts.map +0 -1
- package/dist/adapters/aws-lambda/index.js +0 -67
- package/dist/adapters/express.d.ts +0 -15
- package/dist/adapters/express.d.ts.map +0 -1
- package/dist/adapters/express.js +0 -39
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts +0 -22
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +0 -1
- package/dist/adapters/fastify/fastifyRequestHandler.js +0 -49
- package/dist/adapters/fastify/fastifyRequestHandler.mjs +0 -47
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +0 -21
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +0 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.js +0 -56
- package/dist/adapters/fastify/fastifyTRPCPlugin.mjs +0 -54
- package/dist/adapters/fastify/index.d.ts +0 -3
- package/dist/adapters/fastify/index.d.ts.map +0 -1
- package/dist/adapters/fastify/index.js +0 -9
- package/dist/adapters/fetch/fetchRequestHandler.d.ts +0 -13
- package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +0 -1
- package/dist/adapters/fetch/fetchRequestHandler.js +0 -77
- package/dist/adapters/fetch/fetchRequestHandler.mjs +0 -75
- package/dist/adapters/fetch/index.d.ts +0 -3
- package/dist/adapters/fetch/index.d.ts.map +0 -1
- package/dist/adapters/fetch/index.js +0 -7
- package/dist/adapters/fetch/types.d.ts +0 -27
- package/dist/adapters/fetch/types.d.ts.map +0 -1
- package/dist/adapters/next-app-dir/nextAppDirCaller.d.ts +0 -25
- package/dist/adapters/next-app-dir/nextAppDirCaller.d.ts.map +0 -1
- package/dist/adapters/next-app-dir/nextAppDirCaller.js +0 -94
- package/dist/adapters/next-app-dir/nextAppDirCaller.mjs +0 -92
- package/dist/adapters/next-app-dir/notFound.d.ts +0 -7
- package/dist/adapters/next-app-dir/notFound.d.ts.map +0 -1
- package/dist/adapters/next-app-dir/notFound.js +0 -18
- package/dist/adapters/next-app-dir/notFound.mjs +0 -16
- package/dist/adapters/next-app-dir/redirect.d.ts +0 -18
- package/dist/adapters/next-app-dir/redirect.d.ts.map +0 -1
- package/dist/adapters/next-app-dir/redirect.js +0 -49
- package/dist/adapters/next-app-dir/redirect.mjs +0 -46
- package/dist/adapters/next-app-dir/rethrowNextErrors.d.ts +0 -6
- package/dist/adapters/next-app-dir/rethrowNextErrors.d.ts.map +0 -1
- package/dist/adapters/next-app-dir/rethrowNextErrors.js +0 -70
- package/dist/adapters/next-app-dir/rethrowNextErrors.mjs +0 -49
- package/dist/adapters/next-app-dir.d.ts +0 -7
- package/dist/adapters/next-app-dir.d.ts.map +0 -1
- package/dist/adapters/next-app-dir.js +0 -13
- package/dist/adapters/next.d.ts +0 -19
- package/dist/adapters/next.d.ts.map +0 -1
- package/dist/adapters/next.js +0 -51
- package/dist/adapters/node-http/incomingMessageToRequest.d.ts +0 -12
- package/dist/adapters/node-http/incomingMessageToRequest.d.ts.map +0 -1
- package/dist/adapters/node-http/incomingMessageToRequest.js +0 -123
- package/dist/adapters/node-http/incomingMessageToRequest.mjs +0 -120
- package/dist/adapters/node-http/index.d.ts +0 -4
- package/dist/adapters/node-http/index.d.ts.map +0 -1
- package/dist/adapters/node-http/index.js +0 -11
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +0 -20
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +0 -1
- package/dist/adapters/node-http/nodeHTTPRequestHandler.js +0 -96
- package/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +0 -93
- package/dist/adapters/node-http/types.d.ts +0 -81
- package/dist/adapters/node-http/types.d.ts.map +0 -1
- package/dist/adapters/node-http/writeResponse.d.ts +0 -18
- package/dist/adapters/node-http/writeResponse.d.ts.map +0 -1
- package/dist/adapters/node-http/writeResponse.js +0 -83
- package/dist/adapters/node-http/writeResponse.mjs +0 -80
- package/dist/adapters/standalone.d.ts +0 -36
- package/dist/adapters/standalone.d.ts.map +0 -1
- package/dist/adapters/standalone.js +0 -49
- package/dist/adapters/ws.d.ts +0 -54
- package/dist/adapters/ws.d.ts.map +0 -1
- package/dist/adapters/ws.js +0 -544
- package/dist/http.d.ts +0 -2
- package/dist/http.d.ts.map +0 -1
- package/dist/http.js +0 -19
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -35
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@12.1.2_rollup@4.34.8_tslib@2.8.1_typescript@5.8.2/node_modules/tslib/tslib.es6.js +0 -73
- package/dist/observable/behaviorSubject.d.ts +0 -15
- package/dist/observable/behaviorSubject.d.ts.map +0 -1
- package/dist/observable/behaviorSubject.js +0 -40
- package/dist/observable/behaviorSubject.mjs +0 -38
- package/dist/observable/index.d.ts +0 -5
- package/dist/observable/index.d.ts.map +0 -1
- package/dist/observable/index.js +0 -18
- package/dist/observable/observable.d.ts +0 -12
- package/dist/observable/observable.d.ts.map +0 -1
- package/dist/observable/observable.js +0 -180
- package/dist/observable/observable.mjs +0 -175
- package/dist/observable/operators.d.ts +0 -10
- package/dist/observable/operators.d.ts.map +0 -1
- package/dist/observable/operators.js +0 -134
- package/dist/observable/operators.mjs +0 -128
- package/dist/observable/types.d.ts +0 -26
- package/dist/observable/types.d.ts.map +0 -1
- package/dist/rpc.d.ts +0 -2
- package/dist/rpc.d.ts.map +0 -1
- package/dist/rpc.js +0 -13
- package/dist/shared.d.ts +0 -26
- package/dist/shared.d.ts.map +0 -1
- package/dist/shared.js +0 -13
- package/dist/unstable-core-do-not-import/clientish/inference.d.ts +0 -17
- package/dist/unstable-core-do-not-import/clientish/inference.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/clientish/inferrable.d.ts +0 -36
- package/dist/unstable-core-do-not-import/clientish/inferrable.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/clientish/serialize.d.ts +0 -69
- package/dist/unstable-core-do-not-import/clientish/serialize.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/createProxy.d.ts +0 -19
- package/dist/unstable-core-do-not-import/createProxy.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/createProxy.js +0 -76
- package/dist/unstable-core-do-not-import/createProxy.mjs +0 -73
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +0 -13
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/error/TRPCError.js +0 -76
- package/dist/unstable-core-do-not-import/error/TRPCError.mjs +0 -72
- package/dist/unstable-core-do-not-import/error/formatter.d.ts +0 -38
- package/dist/unstable-core-do-not-import/error/formatter.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/error/formatter.js +0 -7
- package/dist/unstable-core-do-not-import/error/formatter.mjs +0 -5
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts +0 -15
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/error/getErrorShape.js +0 -31
- package/dist/unstable-core-do-not-import/error/getErrorShape.mjs +0 -29
- package/dist/unstable-core-do-not-import/http/abortError.d.ts +0 -5
- package/dist/unstable-core-do-not-import/http/abortError.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/abortError.js +0 -13
- package/dist/unstable-core-do-not-import/http/abortError.mjs +0 -10
- package/dist/unstable-core-do-not-import/http/contentType.d.ts +0 -13
- package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/contentType.js +0 -229
- package/dist/unstable-core-do-not-import/http/contentType.mjs +0 -227
- package/dist/unstable-core-do-not-import/http/contentTypeParsers.d.ts +0 -14
- package/dist/unstable-core-do-not-import/http/contentTypeParsers.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/contentTypeParsers.js +0 -14
- package/dist/unstable-core-do-not-import/http/contentTypeParsers.mjs +0 -12
- package/dist/unstable-core-do-not-import/http/formDataToObject.d.ts +0 -2
- package/dist/unstable-core-do-not-import/http/formDataToObject.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/formDataToObject.js +0 -40
- package/dist/unstable-core-do-not-import/http/formDataToObject.mjs +0 -38
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts +0 -10
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.js +0 -85
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +0 -78
- package/dist/unstable-core-do-not-import/http/parseConnectionParams.d.ts +0 -4
- package/dist/unstable-core-do-not-import/http/parseConnectionParams.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/parseConnectionParams.js +0 -42
- package/dist/unstable-core-do-not-import/http/parseConnectionParams.mjs +0 -39
- package/dist/unstable-core-do-not-import/http/resolveResponse.d.ts +0 -15
- package/dist/unstable-core-do-not-import/http/resolveResponse.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/resolveResponse.js +0 -572
- package/dist/unstable-core-do-not-import/http/resolveResponse.mjs +0 -570
- package/dist/unstable-core-do-not-import/http/types.d.ts +0 -138
- package/dist/unstable-core-do-not-import/http/types.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/initTRPC.d.ts +0 -94
- package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/initTRPC.js +0 -82
- package/dist/unstable-core-do-not-import/initTRPC.mjs +0 -80
- package/dist/unstable-core-do-not-import/middleware.d.ts +0 -107
- package/dist/unstable-core-do-not-import/middleware.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/middleware.js +0 -96
- package/dist/unstable-core-do-not-import/middleware.mjs +0 -90
- package/dist/unstable-core-do-not-import/parser.d.ts +0 -44
- package/dist/unstable-core-do-not-import/parser.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/parser.js +0 -54
- package/dist/unstable-core-do-not-import/parser.mjs +0 -52
- package/dist/unstable-core-do-not-import/procedure.d.ts +0 -77
- package/dist/unstable-core-do-not-import/procedure.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/procedure.js +0 -9
- package/dist/unstable-core-do-not-import/procedure.mjs +0 -7
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +0 -161
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/procedureBuilder.js +0 -201
- package/dist/unstable-core-do-not-import/procedureBuilder.mjs +0 -199
- package/dist/unstable-core-do-not-import/rootConfig.d.ts +0 -98
- package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rootConfig.js +0 -8
- package/dist/unstable-core-do-not-import/rootConfig.mjs +0 -6
- package/dist/unstable-core-do-not-import/router.d.ts +0 -98
- package/dist/unstable-core-do-not-import/router.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/router.js +0 -285
- package/dist/unstable-core-do-not-import/router.mjs +0 -278
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts +0 -45
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/codes.js +0 -69
- package/dist/unstable-core-do-not-import/rpc/codes.mjs +0 -65
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts +0 -109
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/index.d.ts +0 -5
- package/dist/unstable-core-do-not-import/rpc/index.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts +0 -5
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.js +0 -63
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.mjs +0 -61
- package/dist/unstable-core-do-not-import/stream/jsonl.d.ts +0 -119
- package/dist/unstable-core-do-not-import/stream/jsonl.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/jsonl.js +0 -607
- package/dist/unstable-core-do-not-import/stream/jsonl.mjs +0 -603
- package/dist/unstable-core-do-not-import/stream/sse.d.ts +0 -108
- package/dist/unstable-core-do-not-import/stream/sse.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/sse.js +0 -373
- package/dist/unstable-core-do-not-import/stream/sse.mjs +0 -369
- package/dist/unstable-core-do-not-import/stream/sse.types.d.ts +0 -31
- package/dist/unstable-core-do-not-import/stream/sse.types.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/tracked.d.ts +0 -31
- package/dist/unstable-core-do-not-import/stream/tracked.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/tracked.js +0 -29
- package/dist/unstable-core-do-not-import/stream/tracked.mjs +0 -25
- package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.d.ts +0 -17
- package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.js +0 -174
- package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.mjs +0 -170
- package/dist/unstable-core-do-not-import/stream/utils/createDeferred.d.ts +0 -7
- package/dist/unstable-core-do-not-import/stream/utils/createDeferred.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/createDeferred.js +0 -17
- package/dist/unstable-core-do-not-import/stream/utils/createDeferred.mjs +0 -15
- package/dist/unstable-core-do-not-import/stream/utils/disposable.d.ts +0 -17
- package/dist/unstable-core-do-not-import/stream/utils/disposable.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/disposable.js +0 -46
- package/dist/unstable-core-do-not-import/stream/utils/disposable.mjs +0 -43
- package/dist/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.d.ts +0 -17
- package/dist/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.js +0 -241
- package/dist/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.mjs +0 -239
- package/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.d.ts +0 -8
- package/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.js +0 -25
- package/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.mjs +0 -23
- package/dist/unstable-core-do-not-import/stream/utils/timerResource.d.ts +0 -5
- package/dist/unstable-core-do-not-import/stream/utils/timerResource.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/timerResource.js +0 -26
- package/dist/unstable-core-do-not-import/stream/utils/timerResource.mjs +0 -23
- package/dist/unstable-core-do-not-import/stream/utils/withPing.d.ts +0 -7
- package/dist/unstable-core-do-not-import/stream/utils/withPing.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/withPing.js +0 -130
- package/dist/unstable-core-do-not-import/stream/utils/withPing.mjs +0 -127
- package/dist/unstable-core-do-not-import/transformer.d.ts +0 -99
- package/dist/unstable-core-do-not-import/transformer.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/transformer.js +0 -106
- package/dist/unstable-core-do-not-import/transformer.mjs +0 -101
- package/dist/unstable-core-do-not-import/types.d.ts +0 -127
- package/dist/unstable-core-do-not-import/types.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/utils.d.ts +0 -42
- package/dist/unstable-core-do-not-import/utils.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/utils.js +0 -96
- package/dist/unstable-core-do-not-import/utils.mjs +0 -83
- package/dist/unstable-core-do-not-import.d.ts +0 -47
- package/dist/unstable-core-do-not-import.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import.js +0 -109
- package/dist/vendor/cookie-es/set-cookie/split.d.ts +0 -18
- package/dist/vendor/cookie-es/set-cookie/split.d.ts.map +0 -1
- package/dist/vendor/cookie-es/set-cookie/split.js +0 -79
- package/dist/vendor/cookie-es/set-cookie/split.mjs +0 -77
- package/dist/vendor/standard-schema-v1/error.d.ts +0 -13
- package/dist/vendor/standard-schema-v1/error.d.ts.map +0 -1
- package/dist/vendor/standard-schema-v1/error.js +0 -28
- package/dist/vendor/standard-schema-v1/error.mjs +0 -26
- package/dist/vendor/standard-schema-v1/spec.d.ts +0 -60
- package/dist/vendor/standard-schema-v1/spec.d.ts.map +0 -1
- package/dist/vendor/unpromise/index.d.ts +0 -3
- package/dist/vendor/unpromise/index.d.ts.map +0 -1
- package/dist/vendor/unpromise/types.d.ts +0 -28
- package/dist/vendor/unpromise/types.d.ts.map +0 -1
- package/dist/vendor/unpromise/unpromise.d.ts +0 -121
- package/dist/vendor/unpromise/unpromise.d.ts.map +0 -1
- package/dist/vendor/unpromise/unpromise.js +0 -292
- package/dist/vendor/unpromise/unpromise.mjs +0 -289
- package/http/index.d.ts +0 -1
- package/http/index.js +0 -1
- package/observable/index.d.ts +0 -1
- package/observable/index.js +0 -1
- package/rpc/index.d.ts +0 -1
- package/rpc/index.js +0 -1
- package/shared/index.d.ts +0 -1
- package/shared/index.js +0 -1
- package/unstable-core-do-not-import/index.d.ts +0 -1
- package/unstable-core-do-not-import/index.js +0 -1
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var unpromise = require('../../../vendor/unpromise/unpromise.js');
|
|
4
|
-
var abortError = require('../../http/abortError.js');
|
|
5
|
-
var disposable = require('./disposable.js');
|
|
6
|
-
var timerResource = require('./timerResource.js');
|
|
7
|
-
|
|
8
|
-
function _ts_add_disposable_resource(env, value, async) {
|
|
9
|
-
if (value !== null && value !== void 0) {
|
|
10
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
11
|
-
var dispose, inner;
|
|
12
|
-
if (async) {
|
|
13
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
14
|
-
dispose = value[Symbol.asyncDispose];
|
|
15
|
-
}
|
|
16
|
-
if (dispose === void 0) {
|
|
17
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
18
|
-
dispose = value[Symbol.dispose];
|
|
19
|
-
if (async) inner = dispose;
|
|
20
|
-
}
|
|
21
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
22
|
-
if (inner) dispose = function() {
|
|
23
|
-
try {
|
|
24
|
-
inner.call(this);
|
|
25
|
-
} catch (e) {
|
|
26
|
-
return Promise.reject(e);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
env.stack.push({
|
|
30
|
-
value: value,
|
|
31
|
-
dispose: dispose,
|
|
32
|
-
async: async
|
|
33
|
-
});
|
|
34
|
-
} else if (async) {
|
|
35
|
-
env.stack.push({
|
|
36
|
-
async: true
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
return value;
|
|
40
|
-
}
|
|
41
|
-
function _ts_dispose_resources(env) {
|
|
42
|
-
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
43
|
-
var e = new Error(message);
|
|
44
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
45
|
-
};
|
|
46
|
-
return (_ts_dispose_resources = function _ts_dispose_resources(env) {
|
|
47
|
-
function fail(e) {
|
|
48
|
-
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
49
|
-
env.hasError = true;
|
|
50
|
-
}
|
|
51
|
-
var r, s = 0;
|
|
52
|
-
function next() {
|
|
53
|
-
while(r = env.stack.pop()){
|
|
54
|
-
try {
|
|
55
|
-
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
56
|
-
if (r.dispose) {
|
|
57
|
-
var result = r.dispose.call(r.value);
|
|
58
|
-
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
|
|
59
|
-
fail(e);
|
|
60
|
-
return next();
|
|
61
|
-
});
|
|
62
|
-
} else s |= 1;
|
|
63
|
-
} catch (e) {
|
|
64
|
-
fail(e);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
68
|
-
if (env.hasError) throw env.error;
|
|
69
|
-
}
|
|
70
|
-
return next();
|
|
71
|
-
})(env);
|
|
72
|
-
}
|
|
73
|
-
function iteratorResource(iterable) {
|
|
74
|
-
const iterator = iterable[Symbol.asyncIterator]();
|
|
75
|
-
// @ts-expect-error - this is added in node 24 which we don't officially support yet
|
|
76
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
77
|
-
if (iterator[Symbol.asyncDispose]) {
|
|
78
|
-
return iterator;
|
|
79
|
-
}
|
|
80
|
-
return disposable.makeAsyncResource(iterator, async ()=>{
|
|
81
|
-
await iterator.return?.();
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Derives a new {@link AsyncGenerator} based on {@link iterable}, that automatically aborts after the specified duration.
|
|
86
|
-
*/ async function* withMaxDuration(iterable, opts) {
|
|
87
|
-
const env = {
|
|
88
|
-
stack: [],
|
|
89
|
-
error: void 0,
|
|
90
|
-
hasError: false
|
|
91
|
-
};
|
|
92
|
-
try {
|
|
93
|
-
const iterator = _ts_add_disposable_resource(env, iteratorResource(iterable), true);
|
|
94
|
-
;
|
|
95
|
-
const timer = _ts_add_disposable_resource(env, timerResource.timerResource(opts.maxDurationMs), false);
|
|
96
|
-
;
|
|
97
|
-
const timerPromise = timer.start();
|
|
98
|
-
// declaration outside the loop for garbage collection reasons
|
|
99
|
-
let result;
|
|
100
|
-
while(true){
|
|
101
|
-
result = await unpromise.Unpromise.race([
|
|
102
|
-
iterator.next(),
|
|
103
|
-
timerPromise
|
|
104
|
-
]);
|
|
105
|
-
if (result === timerResource.disposablePromiseTimerResult) {
|
|
106
|
-
// cancelled due to timeout
|
|
107
|
-
abortError.throwAbortError();
|
|
108
|
-
}
|
|
109
|
-
if (result.done) {
|
|
110
|
-
return result;
|
|
111
|
-
}
|
|
112
|
-
yield result.value;
|
|
113
|
-
// free up reference for garbage collection
|
|
114
|
-
result = null;
|
|
115
|
-
}
|
|
116
|
-
} catch (e) {
|
|
117
|
-
env.error = e;
|
|
118
|
-
env.hasError = true;
|
|
119
|
-
} finally{
|
|
120
|
-
const result = _ts_dispose_resources(env);
|
|
121
|
-
if (result) await result;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Derives a new {@link AsyncGenerator} based of {@link iterable}, that yields its first
|
|
126
|
-
* {@link count} values. Then, a grace period of {@link gracePeriodMs} is started in which further
|
|
127
|
-
* values may still come through. After this period, the generator aborts.
|
|
128
|
-
*/ async function* takeWithGrace(iterable, opts) {
|
|
129
|
-
const env = {
|
|
130
|
-
stack: [],
|
|
131
|
-
error: void 0,
|
|
132
|
-
hasError: false
|
|
133
|
-
};
|
|
134
|
-
try {
|
|
135
|
-
const iterator = _ts_add_disposable_resource(env, iteratorResource(iterable), true);
|
|
136
|
-
;
|
|
137
|
-
// declaration outside the loop for garbage collection reasons
|
|
138
|
-
let result;
|
|
139
|
-
const timer = _ts_add_disposable_resource(env, timerResource.timerResource(opts.gracePeriodMs), false);
|
|
140
|
-
;
|
|
141
|
-
let count = opts.count;
|
|
142
|
-
let timerPromise = new Promise(()=>{
|
|
143
|
-
// never resolves
|
|
144
|
-
});
|
|
145
|
-
while(true){
|
|
146
|
-
result = await unpromise.Unpromise.race([
|
|
147
|
-
iterator.next(),
|
|
148
|
-
timerPromise
|
|
149
|
-
]);
|
|
150
|
-
if (result === timerResource.disposablePromiseTimerResult) {
|
|
151
|
-
abortError.throwAbortError();
|
|
152
|
-
}
|
|
153
|
-
if (result.done) {
|
|
154
|
-
return result.value;
|
|
155
|
-
}
|
|
156
|
-
yield result.value;
|
|
157
|
-
if (--count === 0) {
|
|
158
|
-
timerPromise = timer.start();
|
|
159
|
-
}
|
|
160
|
-
// free up reference for garbage collection
|
|
161
|
-
result = null;
|
|
162
|
-
}
|
|
163
|
-
} catch (e) {
|
|
164
|
-
env.error = e;
|
|
165
|
-
env.hasError = true;
|
|
166
|
-
} finally{
|
|
167
|
-
const result = _ts_dispose_resources(env);
|
|
168
|
-
if (result) await result;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
exports.iteratorResource = iteratorResource;
|
|
173
|
-
exports.takeWithGrace = takeWithGrace;
|
|
174
|
-
exports.withMaxDuration = withMaxDuration;
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { Unpromise } from '../../../vendor/unpromise/unpromise.mjs';
|
|
2
|
-
import { throwAbortError } from '../../http/abortError.mjs';
|
|
3
|
-
import { makeAsyncResource } from './disposable.mjs';
|
|
4
|
-
import { timerResource, disposablePromiseTimerResult } from './timerResource.mjs';
|
|
5
|
-
|
|
6
|
-
function _ts_add_disposable_resource(env, value, async) {
|
|
7
|
-
if (value !== null && value !== void 0) {
|
|
8
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
9
|
-
var dispose, inner;
|
|
10
|
-
if (async) {
|
|
11
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
12
|
-
dispose = value[Symbol.asyncDispose];
|
|
13
|
-
}
|
|
14
|
-
if (dispose === void 0) {
|
|
15
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
16
|
-
dispose = value[Symbol.dispose];
|
|
17
|
-
if (async) inner = dispose;
|
|
18
|
-
}
|
|
19
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
20
|
-
if (inner) dispose = function() {
|
|
21
|
-
try {
|
|
22
|
-
inner.call(this);
|
|
23
|
-
} catch (e) {
|
|
24
|
-
return Promise.reject(e);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
env.stack.push({
|
|
28
|
-
value: value,
|
|
29
|
-
dispose: dispose,
|
|
30
|
-
async: async
|
|
31
|
-
});
|
|
32
|
-
} else if (async) {
|
|
33
|
-
env.stack.push({
|
|
34
|
-
async: true
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return value;
|
|
38
|
-
}
|
|
39
|
-
function _ts_dispose_resources(env) {
|
|
40
|
-
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
41
|
-
var e = new Error(message);
|
|
42
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
43
|
-
};
|
|
44
|
-
return (_ts_dispose_resources = function _ts_dispose_resources(env) {
|
|
45
|
-
function fail(e) {
|
|
46
|
-
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
47
|
-
env.hasError = true;
|
|
48
|
-
}
|
|
49
|
-
var r, s = 0;
|
|
50
|
-
function next() {
|
|
51
|
-
while(r = env.stack.pop()){
|
|
52
|
-
try {
|
|
53
|
-
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
54
|
-
if (r.dispose) {
|
|
55
|
-
var result = r.dispose.call(r.value);
|
|
56
|
-
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
|
|
57
|
-
fail(e);
|
|
58
|
-
return next();
|
|
59
|
-
});
|
|
60
|
-
} else s |= 1;
|
|
61
|
-
} catch (e) {
|
|
62
|
-
fail(e);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
66
|
-
if (env.hasError) throw env.error;
|
|
67
|
-
}
|
|
68
|
-
return next();
|
|
69
|
-
})(env);
|
|
70
|
-
}
|
|
71
|
-
function iteratorResource(iterable) {
|
|
72
|
-
const iterator = iterable[Symbol.asyncIterator]();
|
|
73
|
-
// @ts-expect-error - this is added in node 24 which we don't officially support yet
|
|
74
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
75
|
-
if (iterator[Symbol.asyncDispose]) {
|
|
76
|
-
return iterator;
|
|
77
|
-
}
|
|
78
|
-
return makeAsyncResource(iterator, async ()=>{
|
|
79
|
-
await iterator.return?.();
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Derives a new {@link AsyncGenerator} based on {@link iterable}, that automatically aborts after the specified duration.
|
|
84
|
-
*/ async function* withMaxDuration(iterable, opts) {
|
|
85
|
-
const env = {
|
|
86
|
-
stack: [],
|
|
87
|
-
error: void 0,
|
|
88
|
-
hasError: false
|
|
89
|
-
};
|
|
90
|
-
try {
|
|
91
|
-
const iterator = _ts_add_disposable_resource(env, iteratorResource(iterable), true);
|
|
92
|
-
;
|
|
93
|
-
const timer = _ts_add_disposable_resource(env, timerResource(opts.maxDurationMs), false);
|
|
94
|
-
;
|
|
95
|
-
const timerPromise = timer.start();
|
|
96
|
-
// declaration outside the loop for garbage collection reasons
|
|
97
|
-
let result;
|
|
98
|
-
while(true){
|
|
99
|
-
result = await Unpromise.race([
|
|
100
|
-
iterator.next(),
|
|
101
|
-
timerPromise
|
|
102
|
-
]);
|
|
103
|
-
if (result === disposablePromiseTimerResult) {
|
|
104
|
-
// cancelled due to timeout
|
|
105
|
-
throwAbortError();
|
|
106
|
-
}
|
|
107
|
-
if (result.done) {
|
|
108
|
-
return result;
|
|
109
|
-
}
|
|
110
|
-
yield result.value;
|
|
111
|
-
// free up reference for garbage collection
|
|
112
|
-
result = null;
|
|
113
|
-
}
|
|
114
|
-
} catch (e) {
|
|
115
|
-
env.error = e;
|
|
116
|
-
env.hasError = true;
|
|
117
|
-
} finally{
|
|
118
|
-
const result = _ts_dispose_resources(env);
|
|
119
|
-
if (result) await result;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Derives a new {@link AsyncGenerator} based of {@link iterable}, that yields its first
|
|
124
|
-
* {@link count} values. Then, a grace period of {@link gracePeriodMs} is started in which further
|
|
125
|
-
* values may still come through. After this period, the generator aborts.
|
|
126
|
-
*/ async function* takeWithGrace(iterable, opts) {
|
|
127
|
-
const env = {
|
|
128
|
-
stack: [],
|
|
129
|
-
error: void 0,
|
|
130
|
-
hasError: false
|
|
131
|
-
};
|
|
132
|
-
try {
|
|
133
|
-
const iterator = _ts_add_disposable_resource(env, iteratorResource(iterable), true);
|
|
134
|
-
;
|
|
135
|
-
// declaration outside the loop for garbage collection reasons
|
|
136
|
-
let result;
|
|
137
|
-
const timer = _ts_add_disposable_resource(env, timerResource(opts.gracePeriodMs), false);
|
|
138
|
-
;
|
|
139
|
-
let count = opts.count;
|
|
140
|
-
let timerPromise = new Promise(()=>{
|
|
141
|
-
// never resolves
|
|
142
|
-
});
|
|
143
|
-
while(true){
|
|
144
|
-
result = await Unpromise.race([
|
|
145
|
-
iterator.next(),
|
|
146
|
-
timerPromise
|
|
147
|
-
]);
|
|
148
|
-
if (result === disposablePromiseTimerResult) {
|
|
149
|
-
throwAbortError();
|
|
150
|
-
}
|
|
151
|
-
if (result.done) {
|
|
152
|
-
return result.value;
|
|
153
|
-
}
|
|
154
|
-
yield result.value;
|
|
155
|
-
if (--count === 0) {
|
|
156
|
-
timerPromise = timer.start();
|
|
157
|
-
}
|
|
158
|
-
// free up reference for garbage collection
|
|
159
|
-
result = null;
|
|
160
|
-
}
|
|
161
|
-
} catch (e) {
|
|
162
|
-
env.error = e;
|
|
163
|
-
env.hasError = true;
|
|
164
|
-
} finally{
|
|
165
|
-
const result = _ts_dispose_resources(env);
|
|
166
|
-
if (result) await result;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export { iteratorResource, takeWithGrace, withMaxDuration };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare function createDeferred<TValue = void>(): {
|
|
2
|
-
promise: Promise<TValue>;
|
|
3
|
-
resolve: (value: TValue) => void;
|
|
4
|
-
reject: (error: unknown) => void;
|
|
5
|
-
};
|
|
6
|
-
export type Deferred<TValue> = ReturnType<typeof createDeferred<TValue>>;
|
|
7
|
-
//# sourceMappingURL=createDeferred.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createDeferred.d.ts","sourceRoot":"","sources":["../../../../src/unstable-core-do-not-import/stream/utils/createDeferred.ts"],"names":[],"mappings":"AACA,wBAAgB,cAAc,CAAC,MAAM,GAAG,IAAI;;qBACrB,MAAM,KAAK,IAAI;oBAChB,OAAO,KAAK,IAAI;EAOrC;AACD,MAAM,MAAM,QAAQ,CAAC,MAAM,IAAI,UAAU,CAAC,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */ function createDeferred() {
|
|
4
|
-
let resolve;
|
|
5
|
-
let reject;
|
|
6
|
-
const promise = new Promise((res, rej)=>{
|
|
7
|
-
resolve = res;
|
|
8
|
-
reject = rej;
|
|
9
|
-
});
|
|
10
|
-
return {
|
|
11
|
-
promise,
|
|
12
|
-
resolve: resolve,
|
|
13
|
-
reject: reject
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
exports.createDeferred = createDeferred;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */ function createDeferred() {
|
|
2
|
-
let resolve;
|
|
3
|
-
let reject;
|
|
4
|
-
const promise = new Promise((res, rej)=>{
|
|
5
|
-
resolve = res;
|
|
6
|
-
reject = rej;
|
|
7
|
-
});
|
|
8
|
-
return {
|
|
9
|
-
promise,
|
|
10
|
-
resolve: resolve,
|
|
11
|
-
reject: reject
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { createDeferred };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Takes a value and a dispose function and returns a new object that implements the Disposable interface.
|
|
3
|
-
* The returned object is the original value augmented with a Symbol.dispose method.
|
|
4
|
-
* @param thing The value to make disposable
|
|
5
|
-
* @param dispose Function to call when disposing the resource
|
|
6
|
-
* @returns The original value with Symbol.dispose method added
|
|
7
|
-
*/
|
|
8
|
-
export declare function makeResource<T>(thing: T, dispose: () => void): T & Disposable;
|
|
9
|
-
/**
|
|
10
|
-
* Takes a value and an async dispose function and returns a new object that implements the AsyncDisposable interface.
|
|
11
|
-
* The returned object is the original value augmented with a Symbol.asyncDispose method.
|
|
12
|
-
* @param thing The value to make async disposable
|
|
13
|
-
* @param dispose Async function to call when disposing the resource
|
|
14
|
-
* @returns The original value with Symbol.asyncDispose method added
|
|
15
|
-
*/
|
|
16
|
-
export declare function makeAsyncResource<T>(thing: T, dispose: () => Promise<void>): T & AsyncDisposable;
|
|
17
|
-
//# sourceMappingURL=disposable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"disposable.d.ts","sourceRoot":"","sources":["../../../../src/unstable-core-do-not-import/stream/utils/disposable.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,CAAC,GAAG,UAAU,CAa7E;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAC3B,CAAC,GAAG,eAAe,CAarB"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// @ts-expect-error - polyfilling symbol
|
|
4
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
5
|
-
var _Symbol, // @ts-expect-error - polyfilling symbol
|
|
6
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
7
|
-
_Symbol1;
|
|
8
|
-
(_Symbol = Symbol).dispose ?? (_Symbol.dispose = Symbol());
|
|
9
|
-
(_Symbol1 = Symbol).asyncDispose ?? (_Symbol1.asyncDispose = Symbol());
|
|
10
|
-
/**
|
|
11
|
-
* Takes a value and a dispose function and returns a new object that implements the Disposable interface.
|
|
12
|
-
* The returned object is the original value augmented with a Symbol.dispose method.
|
|
13
|
-
* @param thing The value to make disposable
|
|
14
|
-
* @param dispose Function to call when disposing the resource
|
|
15
|
-
* @returns The original value with Symbol.dispose method added
|
|
16
|
-
*/ function makeResource(thing, dispose) {
|
|
17
|
-
const it = thing;
|
|
18
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
19
|
-
const existing = it[Symbol.dispose];
|
|
20
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
21
|
-
it[Symbol.dispose] = ()=>{
|
|
22
|
-
dispose();
|
|
23
|
-
existing?.();
|
|
24
|
-
};
|
|
25
|
-
return it;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Takes a value and an async dispose function and returns a new object that implements the AsyncDisposable interface.
|
|
29
|
-
* The returned object is the original value augmented with a Symbol.asyncDispose method.
|
|
30
|
-
* @param thing The value to make async disposable
|
|
31
|
-
* @param dispose Async function to call when disposing the resource
|
|
32
|
-
* @returns The original value with Symbol.asyncDispose method added
|
|
33
|
-
*/ function makeAsyncResource(thing, dispose) {
|
|
34
|
-
const it = thing;
|
|
35
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
36
|
-
const existing = it[Symbol.asyncDispose];
|
|
37
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
38
|
-
it[Symbol.asyncDispose] = async ()=>{
|
|
39
|
-
await dispose();
|
|
40
|
-
await existing?.();
|
|
41
|
-
};
|
|
42
|
-
return it;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
exports.makeAsyncResource = makeAsyncResource;
|
|
46
|
-
exports.makeResource = makeResource;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// @ts-expect-error - polyfilling symbol
|
|
2
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
3
|
-
var _Symbol, // @ts-expect-error - polyfilling symbol
|
|
4
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
5
|
-
_Symbol1;
|
|
6
|
-
(_Symbol = Symbol).dispose ?? (_Symbol.dispose = Symbol());
|
|
7
|
-
(_Symbol1 = Symbol).asyncDispose ?? (_Symbol1.asyncDispose = Symbol());
|
|
8
|
-
/**
|
|
9
|
-
* Takes a value and a dispose function and returns a new object that implements the Disposable interface.
|
|
10
|
-
* The returned object is the original value augmented with a Symbol.dispose method.
|
|
11
|
-
* @param thing The value to make disposable
|
|
12
|
-
* @param dispose Function to call when disposing the resource
|
|
13
|
-
* @returns The original value with Symbol.dispose method added
|
|
14
|
-
*/ function makeResource(thing, dispose) {
|
|
15
|
-
const it = thing;
|
|
16
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
17
|
-
const existing = it[Symbol.dispose];
|
|
18
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
19
|
-
it[Symbol.dispose] = ()=>{
|
|
20
|
-
dispose();
|
|
21
|
-
existing?.();
|
|
22
|
-
};
|
|
23
|
-
return it;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Takes a value and an async dispose function and returns a new object that implements the AsyncDisposable interface.
|
|
27
|
-
* The returned object is the original value augmented with a Symbol.asyncDispose method.
|
|
28
|
-
* @param thing The value to make async disposable
|
|
29
|
-
* @param dispose Async function to call when disposing the resource
|
|
30
|
-
* @returns The original value with Symbol.asyncDispose method added
|
|
31
|
-
*/ function makeAsyncResource(thing, dispose) {
|
|
32
|
-
const it = thing;
|
|
33
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
34
|
-
const existing = it[Symbol.asyncDispose];
|
|
35
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
36
|
-
it[Symbol.asyncDispose] = async ()=>{
|
|
37
|
-
await dispose();
|
|
38
|
-
await existing?.();
|
|
39
|
-
};
|
|
40
|
-
return it;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { makeAsyncResource, makeResource };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
interface MergedAsyncIterables<TYield> extends AsyncIterable<TYield, void, unknown> {
|
|
2
|
-
add(iterable: AsyncIterable<TYield>): void;
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Creates a new async iterable that merges multiple async iterables into a single stream.
|
|
6
|
-
* Values from the input iterables are yielded in the order they resolve, similar to Promise.race().
|
|
7
|
-
*
|
|
8
|
-
* New iterables can be added dynamically using the returned {@link MergedAsyncIterables.add} method, even after iteration has started.
|
|
9
|
-
*
|
|
10
|
-
* If any of the input iterables throws an error, that error will be propagated through the merged stream.
|
|
11
|
-
* Other iterables will not continue to be processed.
|
|
12
|
-
*
|
|
13
|
-
* @template TYield The type of values yielded by the input iterables
|
|
14
|
-
*/
|
|
15
|
-
export declare function mergeAsyncIterables<TYield>(): MergedAsyncIterables<TYield>;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=mergeAsyncIterables.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mergeAsyncIterables.d.ts","sourceRoot":"","sources":["../../../../src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts"],"names":[],"mappings":"AAyDA,UAAU,oBAAoB,CAAC,MAAM,CACnC,SAAQ,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC;IAC5C,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;CAC5C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,KAAK,oBAAoB,CAAC,MAAM,CAAC,CAuH1E"}
|