Socket
Socket
Sign inDemoInstall

@effect/rpc

Package Overview
Dependencies
Maintainers
3
Versions
249
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effect/rpc - npm Package Compare versions

Comparing version 0.0.0-snapshot-b4323ccacbf56b5c574bb69e7775d11cb8d2178a to 0.0.0-snapshot-b4e2d6446fdc267f3c789d6c141284b2dac08851

12

dist/cjs/Router.js

@@ -134,3 +134,4 @@ "use strict";

context: Context.empty()
}
},
captureStackTrace: false
}));

@@ -150,3 +151,4 @@ }

context: Context.empty()
}
},
captureStackTrace: false
}));

@@ -185,3 +187,4 @@ }, {

context: Context.empty()
}
},
captureStackTrace: false
}));

@@ -198,3 +201,4 @@ }

context: Context.empty()
}
},
captureStackTrace: false
}));

@@ -201,0 +205,0 @@ }, {

@@ -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) => {

@@ -142,3 +147,4 @@ return class extends Schema.TaggedRequest()(tag, failure, success, fields) {

const request = (request, options) => (0, _Function.pipe)(Effect.makeSpanScoped(`${options?.spanPrefix ?? "Rpc.request "}${request._tag}`, {
kind: "client"
kind: "client",
captureStackTrace: false
}), Effect.zip(FiberRef.get(currentHeaders)), Effect.map(([span, headers]) => Internal.makeRequest({

@@ -145,0 +151,0 @@ request,

@@ -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 @@ }

@@ -101,3 +101,4 @@ import * as Schema from "@effect/schema/Schema";

context: Context.empty()
}
},
captureStackTrace: false
}));

@@ -117,3 +118,4 @@ }

context: Context.empty()
}
},
captureStackTrace: false
}));

@@ -151,3 +153,4 @@ }, {

context: Context.empty()
}
},
captureStackTrace: false
}));

@@ -164,3 +167,4 @@ }

context: Context.empty()
}
},
captureStackTrace: false
}));

@@ -167,0 +171,0 @@ }, {

@@ -39,2 +39,7 @@ /**

* @since 1.0.0
* @category type ids
*/
export const StreamRequestTypeId = Internal.StreamRequestTypeId;
/**
* @since 1.0.0
* @category schemas

@@ -103,3 +108,4 @@ */

export const request = (request, options) => pipe(Effect.makeSpanScoped(`${options?.spanPrefix ?? "Rpc.request "}${request._tag}`, {
kind: "client"
kind: "client",
captureStackTrace: false
}), Effect.zip(FiberRef.get(currentHeaders)), Effect.map(([span, headers]) => Internal.makeRequest({

@@ -106,0 +112,0 @@ request,

{
"name": "@effect/rpc",
"version": "0.0.0-snapshot-b4323ccacbf56b5c574bb69e7775d11cb8d2178a",
"version": "0.0.0-snapshot-b4e2d6446fdc267f3c789d6c141284b2dac08851",
"description": "Functional programming in TypeScript",

@@ -13,5 +13,5 @@ "license": "MIT",

"peerDependencies": {
"@effect/platform": "^0.0.0-snapshot-b4323ccacbf56b5c574bb69e7775d11cb8d2178a",
"@effect/schema": "^0.0.0-snapshot-b4323ccacbf56b5c574bb69e7775d11cb8d2178a",
"effect": "^0.0.0-snapshot-b4323ccacbf56b5c574bb69e7775d11cb8d2178a"
"@effect/platform": "^0.0.0-snapshot-b4e2d6446fdc267f3c789d6c141284b2dac08851",
"@effect/schema": "^0.0.0-snapshot-b4e2d6446fdc267f3c789d6c141284b2dac08851",
"effect": "^0.0.0-snapshot-b4e2d6446fdc267f3c789d6c141284b2dac08851"
},

@@ -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 */

@@ -247,3 +247,4 @@ /**

context: Context.empty()
}
},
captureStackTrace: false
})

@@ -280,3 +281,4 @@ )

context: Context.empty()
}
},
captureStackTrace: false
})

@@ -337,3 +339,4 @@ )

context: Context.empty()
}
},
captureStackTrace: false
})

@@ -358,3 +361,4 @@ )

context: Context.empty()
}
},
captureStackTrace: false
})

@@ -415,4 +419,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

@@ -336,3 +349,4 @@ }

Effect.makeSpanScoped(`${options?.spanPrefix ?? "Rpc.request "}${request._tag}`, {
kind: "client"
kind: "client",
captureStackTrace: false
}),

@@ -339,0 +353,0 @@ Effect.zip(FiberRef.get(currentHeaders)),

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc