mogobase 1.0.7 → 1.0.9

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/server/ws.js +10 -2
  2. package/package.json +3 -2
package/lib/server/ws.js CHANGED
@@ -40,7 +40,11 @@ class WebSocket {
40
40
  const changeStream = DB.model(modelName).watch(pipeline, {
41
41
  ...(options || {}),
42
42
  fullDocument: "updateLookup",
43
- resumeAfter: resumeToken,
43
+ ...(resumeToken
44
+ ? {
45
+ resumeAfter: resumeToken,
46
+ }
47
+ : {}),
44
48
  });
45
49
  this._state.set(id, { ...state, changeStream: changeStream });
46
50
  changeStream.on("change", (change) => {
@@ -69,7 +73,11 @@ class WebSocket {
69
73
  const changeStream = DB.model(modelName).watch(pipeline, {
70
74
  ...(options || {}),
71
75
  fullDocument: "updateLookup",
72
- resumeAfter: resumeToken,
76
+ ...(resumeToken
77
+ ? {
78
+ resumeAfter: resumeToken,
79
+ }
80
+ : {}),
73
81
  });
74
82
  this._state.set(id, { ...state, changeStream: changeStream });
75
83
  changeStream.on("change", (change) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mogobase",
3
3
  "type": "module",
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "types": "types/index.d.ts",
@@ -35,7 +35,8 @@
35
35
  "build": "rm -rf lib && tsc && tsc-alias",
36
36
  "start": "node lib/server/start.js",
37
37
  "deploy": "wrangler deploy --minify",
38
- "cf-typegen": "wrangler types --env-interface CloudflareBindings"
38
+ "cf-typegen": "wrangler types --env-interface CloudflareBindings",
39
+ "prepublish": "npm run build"
39
40
  },
40
41
  "dependencies": {
41
42
  "@hono/node-server": "^1.19.7",