0.7.2 • Published 1 year ago

@vlcn.io/direct-connect-nodejs v0.7.2

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

@vlcn.io/direct-connect-nodejs

Libraries for facilitating direct connect sync from nodejs.

You can use these to easily create a REST server, WebSocket server, GRPC or anything else.

Rest Example

import {
  DefaultConfig,
  ServiceDB,
  DBCache,
  SyncService,
  jsonDecode,
  jsonEncode,
} from "@vlcn.io/direct-connect-nodejs";
const svcDb = new ServiceDB(DefaultConfig, true);
const cache = new DBCache(DefaultConfig, svcDb.defaultSchemaProvider);
let svc = new SyncService(DefaultConfig, cache, svcDb);

app.get("/changes", (req, res) => {
  const query = url.parse(req.url).query;
  const msg = jsonDecode(JSON.parse(decodeURIComponent(query)));
  res.json(svc.getChanges(msg));
});
app.post("/changes", (req, res) => {
  const msg = jsonDecode(req.body);
  res.json(svc.applyChanges(msg));
});
app.post("/last-seen", (req, res) => {
  const msg = jsonDecode(req.body);
  res.json(svc.getLastSeen(msg));
});
app.post("/change-stream", (req, res) => {
  const msg = jsonDecode(req.body);
  const stream = svc.startOutboundStream(msg);
  // set up server sent event stream
});
0.7.2

1 year ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.0-next.1

2 years ago

0.6.0-next.0

2 years ago

0.6.0-next.3

2 years ago

0.6.0-next.2

2 years ago

0.6.0-next.4

2 years ago

0.7.0-next.1

2 years ago

0.7.0-next.2

2 years ago

0.7.0-next.3

2 years ago

0.7.0-next.0

2 years ago

0.5.0-next.2

2 years ago

0.5.0-next.1

2 years ago

0.5.0-next.0

2 years ago

0.5.0-next.6

2 years ago

0.5.0-next.5

2 years ago

0.5.0-next.4

2 years ago

0.5.0-next.3

2 years ago

0.6.2

2 years ago

0.6.2-next.0

2 years ago

0.5.0-next.7

2 years ago

0.5.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.4.0

2 years ago

0.4.0-next.0

2 years ago

0.3.0

2 years ago

0.3.0-next.0

2 years ago

0.2.0

2 years ago

0.1.2-next.0

2 years ago

0.1.1

2 years ago