@connectrpc/connect-express
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -16,3 +16,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.expressConnectMiddleware = void 0; | ||
exports.expressConnectMiddleware = expressConnectMiddleware; | ||
const connect_1 = require("@connectrpc/connect"); | ||
@@ -42,3 +42,3 @@ const connect_node_1 = require("@connectrpc/connect-node"); | ||
} | ||
const uReq = (0, connect_node_1.universalRequestFromNodeRequest)(req, getPreparsedBody(req), (_a = options.contextValues) === null || _a === void 0 ? void 0 : _a.call(options, req)); | ||
const uReq = (0, connect_node_1.universalRequestFromNodeRequest)(req, res, getPreparsedBody(req), (_a = options.contextValues) === null || _a === void 0 ? void 0 : _a.call(options, req)); | ||
uHandler(uReq) | ||
@@ -55,3 +55,2 @@ .then((uRes) => (0, connect_node_1.universalResponseToNodeResponse)(uRes, res)) | ||
} | ||
exports.expressConnectMiddleware = expressConnectMiddleware; | ||
/** | ||
@@ -58,0 +57,0 @@ * Get a pre-parsed JSON value from the request object, or undefined if |
@@ -38,3 +38,3 @@ // Copyright 2021-2024 The Connect Authors | ||
} | ||
const uReq = universalRequestFromNodeRequest(req, getPreparsedBody(req), (_a = options.contextValues) === null || _a === void 0 ? void 0 : _a.call(options, req)); | ||
const uReq = universalRequestFromNodeRequest(req, res, getPreparsedBody(req), (_a = options.contextValues) === null || _a === void 0 ? void 0 : _a.call(options, req)); | ||
uHandler(uReq) | ||
@@ -41,0 +41,0 @@ .then((uRes) => universalResponseToNodeResponse(uRes, res)) |
{ | ||
"name": "@connectrpc/connect-express", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"license": "Apache-2.0", | ||
@@ -11,6 +11,11 @@ "repository": { | ||
"scripts": { | ||
"clean": "rm -rf ./dist/*", | ||
"prebuild": "rm -rf ./dist/*", | ||
"build": "npm run build:cjs && npm run build:esm", | ||
"build:cjs": "tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'", | ||
"build:esm": "tsc --project tsconfig.json --module ES2015 --verbatimModuleSyntax --outDir ./dist/esm --declaration --declarationDir ./dist/esm", | ||
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'", | ||
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm", | ||
"test": "jasmine --config=jasmine.json", | ||
"conformance": "tsc --noEmit && connectconformance --mode server --conf ./conformance/conformance-express.yaml -v -- tsx ./conformance/server.ts", | ||
"format": "prettier --write --ignore-unknown '.' '!dist'", | ||
"license-header": "license-header", | ||
"lint": "eslint --max-warnings 0 .", | ||
"attw": "attw --pack" | ||
@@ -30,13 +35,15 @@ }, | ||
}, | ||
"dependencies": { | ||
"@types/express": "^4.17.18" | ||
"devDependencies": { | ||
"@connectrpc/connect-conformance": "^1.5.0", | ||
"@connectrpc/connect": "1.5.0", | ||
"@connectrpc/connect-node": "1.5.0", | ||
"@types/express": "^4.17.18", | ||
"express": "^4.19.2", | ||
"tsx": "^4.19.0" | ||
}, | ||
"peerDependencies": { | ||
"@bufbuild/protobuf": "^1.4.2", | ||
"@connectrpc/connect": "1.4.0", | ||
"@connectrpc/connect-node": "1.4.0" | ||
}, | ||
"files": [ | ||
"dist/**" | ||
] | ||
"@bufbuild/protobuf": "^1.10.0", | ||
"@connectrpc/connect": "1.5.0", | ||
"@connectrpc/connect-node": "1.5.0" | ||
} | ||
} |
@@ -18,3 +18,3 @@ # @connectrpc/connect-express | ||
export default function(router: ConnectRouter) { | ||
export default function (router: ConnectRouter) { | ||
// implement rpc Say(SayRequest) returns (SayResponse) | ||
@@ -68,3 +68,3 @@ router.rpc(ElizaService, ElizaService.methods.say, async (req) => ({ | ||
const { sentence } = await client.say({ sentence: "I feel happy." }); | ||
console.log(sentence) // you said: I feel happy. | ||
console.log(sentence); // you said: I feel happy. | ||
``` | ||
@@ -79,3 +79,2 @@ | ||
## Getting started | ||
@@ -82,0 +81,0 @@ |
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
14634
3
6
245
81
+ Added@connectrpc/connect@1.5.0(transitive)
+ Added@connectrpc/connect-node@1.5.0(transitive)
- Removed@types/express@^4.17.18
- Removed@connectrpc/connect@1.4.0(transitive)
- Removed@connectrpc/connect-node@1.4.0(transitive)
- Removed@types/body-parser@1.19.5(transitive)
- Removed@types/connect@3.4.38(transitive)
- Removed@types/express@4.17.21(transitive)
- Removed@types/express-serve-static-core@4.19.6(transitive)
- Removed@types/http-errors@2.0.4(transitive)
- Removed@types/mime@1.3.5(transitive)
- Removed@types/node@22.9.1(transitive)
- Removed@types/qs@6.9.17(transitive)
- Removed@types/range-parser@1.2.7(transitive)
- Removed@types/send@0.17.4(transitive)
- Removed@types/serve-static@1.15.7(transitive)
- Removedundici-types@6.19.8(transitive)