@bufbuild/connect-web
Advanced tools
Comparing version 0.10.1 to 0.11.0
@@ -40,6 +40,5 @@ "use strict"; | ||
function createConnectTransport(options) { | ||
var _a, _b; | ||
var _a; | ||
(0, assert_fetch_api_js_1.assertFetchApi)(); | ||
const useBinaryFormat = (_a = options.useBinaryFormat) !== null && _a !== void 0 ? _a : false; | ||
const fetch = (_b = options.fetch) !== null && _b !== void 0 ? _b : globalThis.fetch; | ||
return { | ||
@@ -68,2 +67,3 @@ async unary(service, method, signal, timeoutMs, header, message) { | ||
next: async (req) => { | ||
var _a; | ||
const useGet = options.useHttpGet === true && | ||
@@ -78,2 +78,3 @@ method.idempotency === protobuf_1.MethodIdempotency.NoSideEffects; | ||
} | ||
const fetch = (_a = options.fetch) !== null && _a !== void 0 ? _a : globalThis.fetch; | ||
const response = await fetch(req.url, Object.assign(Object.assign({}, req.init), { headers: req.header, signal: req.signal, body })); | ||
@@ -156,2 +157,4 @@ const { isUnaryError, unaryError } = (0, protocol_connect_1.validateResponse)(method.kind, response.status, response.headers); | ||
next: async (req) => { | ||
var _a; | ||
const fetch = (_a = options.fetch) !== null && _a !== void 0 ? _a : globalThis.fetch; | ||
const fRes = await fetch(req.url, Object.assign(Object.assign({}, req.init), { headers: req.header, signal: req.signal, body: await createRequestBody(req.message) })); | ||
@@ -158,0 +161,0 @@ (0, protocol_connect_1.validateResponse)(method.kind, fRes.status, fRes.headers); |
@@ -44,6 +44,5 @@ "use strict"; | ||
function createGrpcWebTransport(options) { | ||
var _a, _b; | ||
var _a; | ||
(0, assert_fetch_api_js_1.assertFetchApi)(); | ||
const useBinaryFormat = (_a = options.useBinaryFormat) !== null && _a !== void 0 ? _a : true; | ||
const fetch = (_b = options.fetch) !== null && _b !== void 0 ? _b : globalThis.fetch; | ||
return { | ||
@@ -72,2 +71,4 @@ async unary(service, method, signal, timeoutMs, header, message) { | ||
next: async (req) => { | ||
var _a; | ||
const fetch = (_a = options.fetch) !== null && _a !== void 0 ? _a : globalThis.fetch; | ||
const response = await fetch(req.url, Object.assign(Object.assign({}, req.init), { headers: req.header, signal: req.signal, body: (0, protocol_1.encodeEnvelope)(0, serialize(req.message)) })); | ||
@@ -195,2 +196,4 @@ (0, protocol_grpc_web_1.validateResponse)(response.status, response.headers); | ||
next: async (req) => { | ||
var _a; | ||
const fetch = (_a = options.fetch) !== null && _a !== void 0 ? _a : globalThis.fetch; | ||
const fRes = await fetch(req.url, Object.assign(Object.assign({}, req.init), { headers: req.header, signal: req.signal, body: await createRequestBody(req.message) })); | ||
@@ -197,0 +200,0 @@ const { foundStatus } = (0, protocol_grpc_web_1.validateResponse)(fRes.status, fRes.headers); |
@@ -37,6 +37,5 @@ // Copyright 2021-2023 Buf Technologies, Inc. | ||
export function createConnectTransport(options) { | ||
var _a, _b; | ||
var _a; | ||
assertFetchApi(); | ||
const useBinaryFormat = (_a = options.useBinaryFormat) !== null && _a !== void 0 ? _a : false; | ||
const fetch = (_b = options.fetch) !== null && _b !== void 0 ? _b : globalThis.fetch; | ||
return { | ||
@@ -65,2 +64,3 @@ async unary(service, method, signal, timeoutMs, header, message) { | ||
next: async (req) => { | ||
var _a; | ||
const useGet = options.useHttpGet === true && | ||
@@ -75,2 +75,3 @@ method.idempotency === MethodIdempotency.NoSideEffects; | ||
} | ||
const fetch = (_a = options.fetch) !== null && _a !== void 0 ? _a : globalThis.fetch; | ||
const response = await fetch(req.url, Object.assign(Object.assign({}, req.init), { headers: req.header, signal: req.signal, body })); | ||
@@ -153,2 +154,4 @@ const { isUnaryError, unaryError } = validateResponse(method.kind, response.status, response.headers); | ||
next: async (req) => { | ||
var _a; | ||
const fetch = (_a = options.fetch) !== null && _a !== void 0 ? _a : globalThis.fetch; | ||
const fRes = await fetch(req.url, Object.assign(Object.assign({}, req.init), { headers: req.header, signal: req.signal, body: await createRequestBody(req.message) })); | ||
@@ -155,0 +158,0 @@ validateResponse(method.kind, fRes.status, fRes.headers); |
@@ -41,6 +41,5 @@ // Copyright 2021-2023 Buf Technologies, Inc. | ||
export function createGrpcWebTransport(options) { | ||
var _a, _b; | ||
var _a; | ||
assertFetchApi(); | ||
const useBinaryFormat = (_a = options.useBinaryFormat) !== null && _a !== void 0 ? _a : true; | ||
const fetch = (_b = options.fetch) !== null && _b !== void 0 ? _b : globalThis.fetch; | ||
return { | ||
@@ -69,2 +68,4 @@ async unary(service, method, signal, timeoutMs, header, message) { | ||
next: async (req) => { | ||
var _a; | ||
const fetch = (_a = options.fetch) !== null && _a !== void 0 ? _a : globalThis.fetch; | ||
const response = await fetch(req.url, Object.assign(Object.assign({}, req.init), { headers: req.header, signal: req.signal, body: encodeEnvelope(0, serialize(req.message)) })); | ||
@@ -192,2 +193,4 @@ validateResponse(response.status, response.headers); | ||
next: async (req) => { | ||
var _a; | ||
const fetch = (_a = options.fetch) !== null && _a !== void 0 ? _a : globalThis.fetch; | ||
const fRes = await fetch(req.url, Object.assign(Object.assign({}, req.init), { headers: req.header, signal: req.signal, body: await createRequestBody(req.message) })); | ||
@@ -194,0 +197,0 @@ const { foundStatus } = validateResponse(fRes.status, fRes.headers); |
{ | ||
"name": "@bufbuild/connect-web", | ||
"version": "0.10.1", | ||
"version": "0.11.0", | ||
"license": "Apache-2.0", | ||
@@ -26,3 +26,3 @@ "repository": { | ||
"dependencies": { | ||
"@bufbuild/connect": "0.10.1" | ||
"@bufbuild/connect": "0.11.0" | ||
}, | ||
@@ -29,0 +29,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52344
968
+ Added@bufbuild/connect@0.11.0(transitive)
- Removed@bufbuild/connect@0.10.1(transitive)
Updated@bufbuild/connect@0.11.0