@effect/rpc
Advanced tools
Comparing version 0.0.0-snapshot-e1ebaaa379fd8da009fc70115350394e6295b9d4 to 0.0.0-snapshot-fcdba24de686805e60dc4b9fbccd460054faf46d
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.stream = exports.schemaHeaders = exports.request = exports.provideServiceEffect = exports.provideService = exports.isRpc = exports.effect = exports.currentHeaders = exports.call = exports.annotateHeaders = exports.TypeId = exports.StreamRequest = exports.RequestSchema = void 0; | ||
exports.stream = exports.schemaHeaders = exports.request = exports.provideServiceEffect = exports.provideService = exports.isRpc = exports.effect = exports.currentHeaders = exports.call = exports.annotateHeaders = exports.TypeId = exports.StreamRequestTypeId = exports.StreamRequest = exports.RequestSchema = void 0; | ||
var Headers = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Http/Headers")); | ||
@@ -73,5 +73,10 @@ var Schema = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/schema/Schema")); | ||
* @since 1.0.0 | ||
* @category type ids | ||
*/ | ||
exports.effect = effect; | ||
const StreamRequestTypeId = exports.StreamRequestTypeId = Internal.StreamRequestTypeId; | ||
/** | ||
* @since 1.0.0 | ||
* @category schemas | ||
*/ | ||
exports.effect = effect; | ||
const StreamRequest = () => (tag, failure, success, fields) => { | ||
@@ -78,0 +83,0 @@ return class extends Schema.TaggedRequest()(tag, failure, success, fields) { |
@@ -83,3 +83,3 @@ /** | ||
*/ | ||
type Result<A extends Schema.TaggedRequest.Any, R = never> = EffectRequest.Request.Success<A> extends Stream.Stream<infer A, infer E, infer _R> ? Stream.Stream<A, E, R> : Effect.Effect<EffectRequest.Request.Success<A>, EffectRequest.Request.Error<A>, R>; | ||
type Result<A extends Schema.TaggedRequest.Any, R = never> = StreamRequestTypeId extends keyof A ? EffectRequest.Request.Success<A> : Effect.Effect<EffectRequest.Request.Success<A>, EffectRequest.Request.Error<A>, R>; | ||
/** | ||
@@ -89,3 +89,3 @@ * @since 1.0.0 | ||
*/ | ||
type ResultUndecoded<A extends Schema.TaggedRequest.Any, R = never> = A extends Serializable.WithResult<infer _A, infer I, infer _E, infer _EI, infer _R> ? EffectRequest.Request.Success<A> extends Stream.Stream<infer _A, infer E, infer _R> ? Stream.Stream<I, E, R> : Effect.Effect<I, EffectRequest.Request.Error<A>, R> : never; | ||
type ResultUndecoded<A extends Schema.TaggedRequest.Any, R = never> = A extends Serializable.WithResult<infer _A, infer I, infer E, infer _EI, infer _R> ? StreamRequestTypeId extends keyof A ? Stream.Stream<I, E, R> : Effect.Effect<I, E, R> : never; | ||
} | ||
@@ -99,5 +99,16 @@ /** | ||
* @since 1.0.0 | ||
* @category type ids | ||
*/ | ||
export declare const StreamRequestTypeId: unique symbol; | ||
/** | ||
* @since 1.0.0 | ||
* @category type ids | ||
*/ | ||
export type StreamRequestTypeId = typeof StreamRequestTypeId; | ||
/** | ||
* @since 1.0.0 | ||
* @category schemas | ||
*/ | ||
export interface StreamRequest<Tag extends string, SR, SI, S, RR, EI, E, AI, A> extends EffectRequest.Request<Stream.Stream<A, E, never>>, Serializable.SerializableWithResult<S, SI, SR, A, AI, E, EI, RR> { | ||
readonly [StreamRequestTypeId]: StreamRequestTypeId; | ||
readonly _tag: Tag; | ||
@@ -104,0 +115,0 @@ } |
@@ -39,2 +39,7 @@ /** | ||
* @since 1.0.0 | ||
* @category type ids | ||
*/ | ||
export const StreamRequestTypeId = Internal.StreamRequestTypeId; | ||
/** | ||
* @since 1.0.0 | ||
* @category schemas | ||
@@ -41,0 +46,0 @@ */ |
{ | ||
"name": "@effect/rpc", | ||
"version": "0.0.0-snapshot-e1ebaaa379fd8da009fc70115350394e6295b9d4", | ||
"version": "0.0.0-snapshot-fcdba24de686805e60dc4b9fbccd460054faf46d", | ||
"description": "Functional programming in TypeScript", | ||
@@ -13,5 +13,5 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@effect/platform": "^0.0.0-snapshot-e1ebaaa379fd8da009fc70115350394e6295b9d4", | ||
"@effect/schema": "^0.0.0-snapshot-e1ebaaa379fd8da009fc70115350394e6295b9d4", | ||
"effect": "^0.0.0-snapshot-e1ebaaa379fd8da009fc70115350394e6295b9d4" | ||
"@effect/platform": "^0.0.0-snapshot-fcdba24de686805e60dc4b9fbccd460054faf46d", | ||
"@effect/schema": "^0.0.0-snapshot-fcdba24de686805e60dc4b9fbccd460054faf46d", | ||
"effect": "^0.0.0-snapshot-fcdba24de686805e60dc4b9fbccd460054faf46d" | ||
}, | ||
@@ -18,0 +18,0 @@ "publishConfig": { |
@@ -29,3 +29,5 @@ import type * as Headers from "@effect/platform/Http/Headers" | ||
/** @internal */ | ||
export const StreamRequestTypeId = Symbol.for("@effect/rpc/Rpc/StreamRequest") | ||
export const StreamRequestTypeId: Rpc.StreamRequestTypeId = Symbol.for( | ||
"@effect/rpc/Rpc/StreamRequest" | ||
) as Rpc.StreamRequestTypeId | ||
@@ -32,0 +34,0 @@ /** @internal */ |
@@ -415,4 +415,4 @@ /** | ||
const encode = getEncodeChunk(request) | ||
return Stream.mapChunksEffect(result, encode) as any | ||
return Stream.mapChunksEffect(result as any, encode) as any | ||
} | ||
} |
@@ -111,5 +111,5 @@ /** | ||
*/ | ||
export type Result<A extends Schema.TaggedRequest.Any, R = never> = EffectRequest.Request.Success<A> extends | ||
Stream.Stream<infer A, infer E, infer _R> ? Stream.Stream<A, E, R> | ||
: Effect.Effect<EffectRequest.Request.Success<A>, EffectRequest.Request.Error<A>, R> | ||
export type Result<A extends Schema.TaggedRequest.Any, R = never> = StreamRequestTypeId extends keyof A ? | ||
EffectRequest.Request.Success<A> : | ||
Effect.Effect<EffectRequest.Request.Success<A>, EffectRequest.Request.Error<A>, R> | ||
@@ -121,5 +121,5 @@ /** | ||
export type ResultUndecoded<A extends Schema.TaggedRequest.Any, R = never> = A extends | ||
Serializable.WithResult<infer _A, infer I, infer _E, infer _EI, infer _R> | ||
? EffectRequest.Request.Success<A> extends Stream.Stream<infer _A, infer E, infer _R> ? Stream.Stream<I, E, R> | ||
: Effect.Effect<I, EffectRequest.Request.Error<A>, R> | ||
Serializable.WithResult<infer _A, infer I, infer E, infer _EI, infer _R> | ||
? StreamRequestTypeId extends keyof A ? Stream.Stream<I, E, R> | ||
: Effect.Effect<I, E, R> | ||
: never | ||
@@ -147,2 +147,14 @@ } | ||
* @since 1.0.0 | ||
* @category type ids | ||
*/ | ||
export const StreamRequestTypeId: unique symbol = Internal.StreamRequestTypeId | ||
/** | ||
* @since 1.0.0 | ||
* @category type ids | ||
*/ | ||
export type StreamRequestTypeId = typeof StreamRequestTypeId | ||
/** | ||
* @since 1.0.0 | ||
* @category schemas | ||
@@ -155,2 +167,3 @@ */ | ||
{ | ||
readonly [StreamRequestTypeId]: StreamRequestTypeId | ||
readonly _tag: Tag | ||
@@ -157,0 +170,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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
193206
2842
0