Socket
Socket
Sign inDemoInstall

@effect/rpc-http-node

Package Overview
Dependencies
7
Maintainers
3
Versions
68
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.1 to 0.3.2

10

package.json
{
"name": "@effect/rpc-http-node",
"version": "0.3.1",
"version": "0.3.2",
"license": "MIT",

@@ -10,6 +10,6 @@ "repository": {

"dependencies": {
"@effect/data": "^0.12.10",
"@effect/io": "^0.29.2",
"@effect/rpc": "0.3.1",
"@effect/rpc-http": "0.3.1"
"@effect/data": "^0.17.1",
"@effect/io": "^0.37.1",
"@effect/rpc": "0.3.2",
"@effect/rpc-http": "0.3.2"
},

@@ -16,0 +16,0 @@ "publishConfig": {

@@ -12,3 +12,3 @@ /// <reference types="node" />

*/
HttpRequest, } from "@effect/rpc-http/Server";
HttpRequest } from "@effect/rpc-http/Server";
/**

@@ -15,0 +15,0 @@ * @category models

@@ -28,3 +28,3 @@ "use strict";

return function handleRequestResponse(request, response) {
return Effect.catchAllCause(cause => Effect.flatMap(Effect.logErrorCause(cause), () => Effect.sync(() => {
return Effect.catchAllCause(cause => Effect.flatMap(Effect.logError(cause), () => Effect.sync(() => {
response.writeHead(500);

@@ -57,3 +57,6 @@ response.end();

});
const parseJson = body => Effect.tryCatch(() => JSON.parse(body), error => new Error(`Failed to parse JSON: ${error}`));
const parseJson = body => Effect.try({
try: () => JSON.parse(body),
catch: error => new Error(`Failed to parse JSON: ${error}`)
});
//# sourceMappingURL=Server.js.map

@@ -19,3 +19,3 @@ /**

*/
HttpRequest,
HttpRequest
} from "@effect/rpc-http/Server"

@@ -28,3 +28,6 @@

export interface RpcNodeHttpHandler<R extends RpcRouter.Base> {
(request: IncomingMessage, response: ServerResponse): Effect.Effect<
(
request: IncomingMessage,
response: ServerResponse
): Effect.Effect<
Exclude<RpcHandlers.Services<R["handlers"]>, HttpRequest | Span>,

@@ -41,3 +44,3 @@ never,

export function make<R extends RpcRouter.Base>(
router: R,
router: R
): RpcNodeHttpHandler<R> {

@@ -48,3 +51,3 @@ const handler = Server.make(router) as unknown as RpcServer

request: IncomingMessage,
response: ServerResponse,
response: ServerResponse
) {

@@ -58,4 +61,4 @@ return pipe(

headers: new Headers(request.headers as any),
body,
}),
body
})
),

@@ -65,15 +68,14 @@ Effect.tap((responses) =>

response.writeHead(200, {
"Content-Type": "application/json; charset=utf-8",
"Content-Type": "application/json; charset=utf-8"
})
response.end(JSON.stringify(responses))
}),
})
),
Effect.catchAllCause((cause) =>
Effect.flatMap(Effect.logErrorCause(cause), () =>
Effect.flatMap(Effect.logError(cause), () =>
Effect.sync(() => {
response.writeHead(500)
response.end()
}),
),
),
}))
)
)

@@ -99,5 +101,5 @@ } as any

const parseJson = (body: string) =>
Effect.tryCatch(
() => JSON.parse(body) as unknown,
(error) => new Error(`Failed to parse JSON: ${error}`),
)
Effect.try({
try: () => JSON.parse(body) as unknown,
catch: (error) => new Error(`Failed to parse JSON: ${error}`)
})
{
"extends": "../../tsconfig.base.json",
"references": [
{ "path": "./tsconfig.build.json" },
{ "path": "./tsconfig.test.json" },
{ "path": "./tsconfig.examples.json" }
]
}
"extends": "../../tsconfig.base.json",
"references": [
{ "path": "./tsconfig.build.json" },
{ "path": "./tsconfig.test.json" },
{ "path": "./tsconfig.examples.json" }
]
}

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc