@receptron/graphai_express 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/agents.js +3 -2
  2. package/package.json +10 -12
package/lib/agents.js CHANGED
@@ -40,7 +40,7 @@ exports.agentsList = agentsList;
40
40
  const agentDoc = (agentDictionary, hostName = "https://example.com", urlPath = "/agent") => {
41
41
  return async (req, res) => {
42
42
  const { params } = req;
43
- const { agentId } = params;
43
+ const agentId = Array.isArray(params.agentId) ? params.agentId[0] : params.agentId;
44
44
  const agent = agentDictionary[agentId];
45
45
  if (agent === undefined) {
46
46
  res.status(404).send("Not found");
@@ -163,7 +163,8 @@ const agentDispatcherInternal = (agentDictionary, agentFilters = [], isDispatch
163
163
  console.log("agentDispatcherInternal");
164
164
  }
165
165
  const { params } = req;
166
- const { agentId } = isDispatch ? params : req.body.debugInfo;
166
+ const agentIdRaw = isDispatch ? params.agentId : req.body.debugInfo.agentId;
167
+ const agentId = Array.isArray(agentIdRaw) ? agentIdRaw[0] : agentIdRaw;
167
168
  const { params: agentParams, debugInfo, filterParams, namedInputs /* graphData */ } = req.body;
168
169
  const agent = agentDictionary[agentId];
169
170
  if (agent === undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@receptron/graphai_express",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "GraphAI express web server middleware.",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -9,10 +9,10 @@
9
9
  "scripts": {
10
10
  "build": "tsc && tsc-alias",
11
11
  "eslint": "eslint --fix",
12
- "server": "ts-node -r tsconfig-paths/register test/express.ts",
13
- "test_stream": "ts-node -r tsconfig-paths/register test/test_stream_client.ts",
14
- "test_stream2": "ts-node -r tsconfig-paths/register test/test_stream_graph.ts",
15
- "test": "node --test -r tsconfig-paths/register --require ts-node/register ./test/test_*.ts",
12
+ "server": "tsx test/server.ts",
13
+ "test_stream": "tsx test/test_stream_client.ts",
14
+ "test_stream2": "tsx test/test_stream_graph.ts",
15
+ "test": "node --import tsx --test ./test/test_*.ts",
16
16
  "format": "prettier --write '{src,test}/**/*.{yaml,ts,json}'",
17
17
  "ci": "yarn run format && yarn run eslint && yarn run build"
18
18
  },
@@ -28,16 +28,14 @@
28
28
  "homepage": "https://github.com/receptron/graphai_utils/tree/main/packages/express#readme",
29
29
  "devDependencies": {
30
30
  "@types/cors": "^2.8.18",
31
- "@types/express-serve-static-core": "^5.0.6",
32
- "sinon": "^20.0.0",
33
- "sinon-express-mock": "^2.2.1"
31
+ "@types/express-serve-static-core": "^5.1.3"
34
32
  },
35
33
  "dependencies": {
36
34
  "@graphai/agent_filter_utils": "^2.0.0",
37
- "@graphai/stream_agent_filter": "^2.0.2",
38
- "cors": "^2.8.5",
39
- "dotenv": "^16.5.0",
40
- "express": "^5.1.0"
35
+ "@graphai/stream_agent_filter": "^2.0.3",
36
+ "cors": "^2.8.6",
37
+ "dotenv": "^17.2.4",
38
+ "express": "^5.2.1"
41
39
  },
42
40
  "types": "./lib/index.d.ts",
43
41
  "directories": {