@effect/rpc
Advanced tools
Comparing version 0.31.27 to 0.32.0
@@ -33,3 +33,3 @@ "use strict"; | ||
const makeRequest = options => { | ||
const isStream = (StreamRequestTypeId in options.request); | ||
const isStream = StreamRequestTypeId in options.request; | ||
const hash = Hash.hash(options.request); | ||
@@ -36,0 +36,0 @@ return { |
@@ -88,3 +88,3 @@ "use strict"; | ||
const spanPrefix = options?.spanPrefix ?? "Rpc.router "; | ||
const schema = Schema.Union(...[...router.rpcs].map(rpc => Schema.transform(rpc.schema, Schema.typeSchema(Schema.Tuple(rpc.schema, Schema.Any)), { | ||
const schema = Schema.Union(...[...router.rpcs].map(rpc => Schema.transform(rpc.schema, Schema.Tuple(Schema.typeSchema(rpc.schema), Schema.Any), { | ||
strict: true, | ||
@@ -198,3 +198,3 @@ decode: request => [request, rpc], | ||
return request => { | ||
const isStream = (_rpc.StreamRequestTypeId in request); | ||
const isStream = _rpc.StreamRequestTypeId in request; | ||
const withHandler = parse(request); | ||
@@ -201,0 +201,0 @@ if (isStream) { |
@@ -137,3 +137,3 @@ "use strict"; | ||
const call = (req, resolver, options) => { | ||
const isStream = (Internal.StreamRequestTypeId in req); | ||
const isStream = Internal.StreamRequestTypeId in req; | ||
const res = (0, _Function.pipe)(request(req, options), Effect.flatMap(_ => Effect.request(_, resolver))); | ||
@@ -140,0 +140,0 @@ return isStream ? Stream.unwrapScoped(res) : Effect.scoped(res); |
@@ -24,3 +24,3 @@ import * as Schema from "@effect/schema/Schema"; | ||
export const makeRequest = options => { | ||
const isStream = (StreamRequestTypeId in options.request); | ||
const isStream = StreamRequestTypeId in options.request; | ||
const hash = Hash.hash(options.request); | ||
@@ -27,0 +27,0 @@ return { |
@@ -78,3 +78,3 @@ import * as Schema from "@effect/schema/Schema"; | ||
const spanPrefix = options?.spanPrefix ?? "Rpc.router "; | ||
const schema = Schema.Union(...[...router.rpcs].map(rpc => Schema.transform(rpc.schema, Schema.typeSchema(Schema.Tuple(rpc.schema, Schema.Any)), { | ||
const schema = Schema.Union(...[...router.rpcs].map(rpc => Schema.transform(rpc.schema, Schema.Tuple(Schema.typeSchema(rpc.schema), Schema.Any), { | ||
strict: true, | ||
@@ -186,3 +186,3 @@ decode: request => [request, rpc], | ||
return request => { | ||
const isStream = (StreamRequestTypeId in request); | ||
const isStream = StreamRequestTypeId in request; | ||
const withHandler = parse(request); | ||
@@ -189,0 +189,0 @@ if (isStream) { |
@@ -121,3 +121,3 @@ /** | ||
export const call = (req, resolver, options) => { | ||
const isStream = (Internal.StreamRequestTypeId in req); | ||
const isStream = Internal.StreamRequestTypeId in req; | ||
const res = pipe(request(req, options), Effect.flatMap(_ => Effect.request(_, resolver))); | ||
@@ -124,0 +124,0 @@ return isStream ? Stream.unwrapScoped(res) : Effect.scoped(res); |
{ | ||
"name": "@effect/rpc", | ||
"version": "0.31.27", | ||
"version": "0.32.0", | ||
"description": "Functional programming in TypeScript", | ||
@@ -13,5 +13,5 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@effect/platform": "^0.58.27", | ||
"@effect/schema": "^0.68.23", | ||
"effect": "^3.5.3" | ||
"@effect/platform": "^0.59.0", | ||
"@effect/schema": "^0.68.24", | ||
"effect": "^3.5.4" | ||
}, | ||
@@ -18,0 +18,0 @@ "publishConfig": { |
@@ -206,3 +206,3 @@ /** | ||
rpc.schema, | ||
Schema.typeSchema(Schema.Tuple(rpc.schema, Schema.Any)), | ||
Schema.Tuple(Schema.typeSchema(rpc.schema), Schema.Any), | ||
{ strict: true, decode: (request) => [request, rpc] as const, encode: ([request]) => request } | ||
@@ -209,0 +209,0 @@ ) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
199625