@graffy/server 0.15.10 → 0.15.11-alpha.1

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 (3) hide show
  1. package/index.cjs +2 -1
  2. package/index.mjs +2 -1
  3. package/package.json +2 -2
package/index.cjs CHANGED
@@ -37,7 +37,7 @@ function server$1(store) {
37
37
  return async (req, res) => {
38
38
  const parsed = url__default["default"].parse(req.url, true);
39
39
  const query = parsed.query.q && common.decodeUrl(parsed.query.q);
40
- const options = parsed.query.opts && common.deserialize(decodeURIComponent(parsed.query.opts));
40
+ const options = parsed.query.opts && !Array.isArray(parsed.query.opts) && common.deserialize(decodeURIComponent(parsed.query.opts));
41
41
  if (req.method === "GET") {
42
42
  try {
43
43
  if (req.headers["accept"] === "text/event-stream") {
@@ -88,6 +88,7 @@ data: ${e.message}
88
88
  const payload = common.deserialize(Buffer.concat(chunks).toString());
89
89
  const value = await store.call(op, payload, options);
90
90
  res.writeHead(200);
91
+ console.log("Responding with", value);
91
92
  res.end(common.serialize(value));
92
93
  } catch (e) {
93
94
  res.writeHead(400);
package/index.mjs CHANGED
@@ -28,7 +28,7 @@ function server$1(store) {
28
28
  return async (req, res) => {
29
29
  const parsed = url.parse(req.url, true);
30
30
  const query = parsed.query.q && decodeUrl(parsed.query.q);
31
- const options = parsed.query.opts && deserialize(decodeURIComponent(parsed.query.opts));
31
+ const options = parsed.query.opts && !Array.isArray(parsed.query.opts) && deserialize(decodeURIComponent(parsed.query.opts));
32
32
  if (req.method === "GET") {
33
33
  try {
34
34
  if (req.headers["accept"] === "text/event-stream") {
@@ -79,6 +79,7 @@ data: ${e.message}
79
79
  const payload = deserialize(Buffer.concat(chunks).toString());
80
80
  const value = await store.call(op, payload, options);
81
81
  res.writeHead(200);
82
+ console.log("Responding with", value);
82
83
  res.end(serialize(value));
83
84
  } catch (e) {
84
85
  res.writeHead(400);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graffy/server",
3
3
  "description": "Node.js library for building an API for a Graffy store.",
4
4
  "author": "aravind (https://github.com/aravindet)",
5
- "version": "0.15.10",
5
+ "version": "0.15.11-alpha.1",
6
6
  "main": "./index.cjs",
7
7
  "exports": {
8
8
  "import": "./index.mjs",
@@ -17,7 +17,7 @@
17
17
  "license": "Apache-2.0",
18
18
  "dependencies": {
19
19
  "ws": "^7.0.0",
20
- "@graffy/common": "0.15.10",
20
+ "@graffy/common": "0.15.11-alpha.1",
21
21
  "debug": "^4.3.2"
22
22
  }
23
23
  }