@connectrpc/connect
Advanced tools
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
+1
-1
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
+1
-1
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -31,12 +31,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| function transformConnectPostToGetRequest(request, message, useBase64) { | ||
| // Parameters are ordered per the Connect protocol Query-Get rule | ||
| // (connect, base64, compression, encoding, message). | ||
| let query = `?connect=v${version_js_1.protocolVersion}`; | ||
| const contentType = request.header.get(headers_js_1.headerContentType); | ||
| if ((contentType === null || contentType === void 0 ? void 0 : contentType.indexOf(contentTypePrefix)) === 0) { | ||
| query += | ||
| "&encoding=" + | ||
| encodeURIComponent(contentType.slice(contentTypePrefix.length)); | ||
| } | ||
| let compressionQuery = ""; | ||
| const compression = request.header.get(headers_js_1.headerUnaryEncoding); | ||
| if (compression !== null && compression !== "identity") { | ||
| query += "&compression=" + encodeURIComponent(compression); | ||
| compressionQuery = "&compression=" + encodeURIComponent(compression); | ||
| // Force base64 for compressed payloads. | ||
@@ -48,2 +45,9 @@ useBase64 = true; | ||
| } | ||
| query += compressionQuery; | ||
| const contentType = request.header.get(headers_js_1.headerContentType); | ||
| if ((contentType === null || contentType === void 0 ? void 0 : contentType.indexOf(contentTypePrefix)) === 0) { | ||
| query += | ||
| "&encoding=" + | ||
| encodeURIComponent(contentType.slice(contentTypePrefix.length)); | ||
| } | ||
| query += "&message=" + encodeMessageForUrl(message, useBase64); | ||
@@ -50,0 +54,0 @@ const url = request.url + query; |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -43,3 +43,3 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // See https://github.com/grpc/grpc/blob/c462bb8d485fc1434ecfae438823ca8d14cf3154/doc/PROTOCOL-HTTP2.md#user-agents | ||
| result.set(headers_js_1.headerUserAgent, "connect-es/2.1.1"); | ||
| result.set(headers_js_1.headerUserAgent, "connect-es/2.1.2"); | ||
| } | ||
@@ -46,0 +46,0 @@ return result; |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -35,3 +35,3 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // See https://github.com/grpc/grpc/blob/c462bb8d485fc1434ecfae438823ca8d14cf3154/doc/PROTOCOL-HTTP2.md#user-agents | ||
| const userAgent = (_b = (_a = result.get(headers_js_1.headerUserAgent)) !== null && _a !== void 0 ? _a : result.get(headers_js_1.headerXUserAgent)) !== null && _b !== void 0 ? _b : "connect-es/2.1.1"; | ||
| const userAgent = (_b = (_a = result.get(headers_js_1.headerUserAgent)) !== null && _a !== void 0 ? _a : result.get(headers_js_1.headerXUserAgent)) !== null && _b !== void 0 ? _b : "connect-es/2.1.2"; | ||
| result.set(headers_js_1.headerXUserAgent, userAgent); | ||
@@ -38,0 +38,0 @@ if (setUserAgent) { |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -32,3 +32,3 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // See https://github.com/grpc/grpc/blob/c462bb8d485fc1434ecfae438823ca8d14cf3154/doc/PROTOCOL-HTTP2.md#user-agents | ||
| result.set(headers_js_1.headerUserAgent, "connect-es/2.1.1"); | ||
| result.set(headers_js_1.headerUserAgent, "connect-es/2.1.2"); | ||
| } | ||
@@ -35,0 +35,0 @@ if (timeoutMs !== undefined) { |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -22,2 +22,3 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| const normalize_js_1 = require("./normalize.js"); | ||
| const code_js_1 = require("../code.js"); | ||
| /** | ||
@@ -108,5 +109,7 @@ * Runs a unary method with the given interceptors. Note that this function | ||
| function abort(reason) { | ||
| // We peek at the deadline signal because fetch() will throw an error on | ||
| // abort that discards the signal reason. | ||
| const e = connect_error_js_1.ConnectError.from(signal.aborted ? (0, signals_js_1.getAbortSignalReason)(signal) : reason); | ||
| // We peek at the signal because fetch() will throw an error on abort | ||
| // that discards the signal reason. | ||
| const e = controller.signal.aborted | ||
| ? connect_error_js_1.ConnectError.from((0, signals_js_1.getAbortSignalReason)(controller.signal), code_js_1.Code.Canceled) | ||
| : connect_error_js_1.ConnectError.from(reason); | ||
| controller.abort(e); | ||
@@ -113,0 +116,0 @@ cleanup(); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
| "use strict"; | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -4,0 +4,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
+1
-1
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
+1
-1
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -28,12 +28,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| export function transformConnectPostToGetRequest(request, message, useBase64) { | ||
| // Parameters are ordered per the Connect protocol Query-Get rule | ||
| // (connect, base64, compression, encoding, message). | ||
| let query = `?connect=v${protocolVersion}`; | ||
| const contentType = request.header.get(headerContentType); | ||
| if ((contentType === null || contentType === void 0 ? void 0 : contentType.indexOf(contentTypePrefix)) === 0) { | ||
| query += | ||
| "&encoding=" + | ||
| encodeURIComponent(contentType.slice(contentTypePrefix.length)); | ||
| } | ||
| let compressionQuery = ""; | ||
| const compression = request.header.get(headerUnaryEncoding); | ||
| if (compression !== null && compression !== "identity") { | ||
| query += "&compression=" + encodeURIComponent(compression); | ||
| compressionQuery = "&compression=" + encodeURIComponent(compression); | ||
| // Force base64 for compressed payloads. | ||
@@ -45,2 +42,9 @@ useBase64 = true; | ||
| } | ||
| query += compressionQuery; | ||
| const contentType = request.header.get(headerContentType); | ||
| if ((contentType === null || contentType === void 0 ? void 0 : contentType.indexOf(contentTypePrefix)) === 0) { | ||
| query += | ||
| "&encoding=" + | ||
| encodeURIComponent(contentType.slice(contentTypePrefix.length)); | ||
| } | ||
| query += "&message=" + encodeMessageForUrl(message, useBase64); | ||
@@ -47,0 +51,0 @@ const url = request.url + query; |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -39,3 +39,3 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // See https://github.com/grpc/grpc/blob/c462bb8d485fc1434ecfae438823ca8d14cf3154/doc/PROTOCOL-HTTP2.md#user-agents | ||
| result.set(headerUserAgent, "connect-es/2.1.1"); | ||
| result.set(headerUserAgent, "connect-es/2.1.2"); | ||
| } | ||
@@ -42,0 +42,0 @@ return result; |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -31,3 +31,3 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // See https://github.com/grpc/grpc/blob/c462bb8d485fc1434ecfae438823ca8d14cf3154/doc/PROTOCOL-HTTP2.md#user-agents | ||
| const userAgent = (_b = (_a = result.get(headerUserAgent)) !== null && _a !== void 0 ? _a : result.get(headerXUserAgent)) !== null && _b !== void 0 ? _b : "connect-es/2.1.1"; | ||
| const userAgent = (_b = (_a = result.get(headerUserAgent)) !== null && _a !== void 0 ? _a : result.get(headerXUserAgent)) !== null && _b !== void 0 ? _b : "connect-es/2.1.2"; | ||
| result.set(headerXUserAgent, userAgent); | ||
@@ -34,0 +34,0 @@ if (setUserAgent) { |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -28,3 +28,3 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // See https://github.com/grpc/grpc/blob/c462bb8d485fc1434ecfae438823ca8d14cf3154/doc/PROTOCOL-HTTP2.md#user-agents | ||
| result.set(headerUserAgent, "connect-es/2.1.1"); | ||
| result.set(headerUserAgent, "connect-es/2.1.2"); | ||
| } | ||
@@ -31,0 +31,0 @@ if (timeoutMs !== undefined) { |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -18,2 +18,3 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| import { normalize, normalizeIterable } from "./normalize.js"; | ||
| import { Code } from "../code.js"; | ||
| /** | ||
@@ -104,5 +105,7 @@ * Runs a unary method with the given interceptors. Note that this function | ||
| function abort(reason) { | ||
| // We peek at the deadline signal because fetch() will throw an error on | ||
| // abort that discards the signal reason. | ||
| const e = ConnectError.from(signal.aborted ? getAbortSignalReason(signal) : reason); | ||
| // We peek at the signal because fetch() will throw an error on abort | ||
| // that discards the signal reason. | ||
| const e = controller.signal.aborted | ||
| ? ConnectError.from(getAbortSignalReason(controller.signal), Code.Canceled) | ||
| : ConnectError.from(reason); | ||
| controller.abort(e); | ||
@@ -109,0 +112,0 @@ cleanup(); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1,2 +0,2 @@ | ||
| // Copyright 2021-2025 The Connect Authors | ||
| // Copyright 2021-2026 The Connect Authors | ||
| // | ||
@@ -3,0 +3,0 @@ // Licensed under the Apache License, Version 2.0 (the "License"); |
+4
-4
| { | ||
| "name": "@connectrpc/connect", | ||
| "version": "2.1.1", | ||
| "version": "2.1.2", | ||
| "description": "Type-safe APIs with Protobuf and TypeScript.", | ||
@@ -62,7 +62,7 @@ "license": "Apache-2.0", | ||
| "devDependencies": { | ||
| "@bufbuild/buf": "^1.59.0", | ||
| "@bufbuild/buf": "^1.66.1", | ||
| "@bufbuild/protoc-gen-es": "^2.10.0", | ||
| "@types/jasmine": "^5.1.12", | ||
| "jasmine": "^5.12.0" | ||
| "@types/jasmine": "^5.1.13", | ||
| "jasmine": "^5.13.0" | ||
| } | ||
| } |
857761
0.08%18625
0.08%