Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@electric-sql/next

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@electric-sql/next - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

dist/client.d.ts

@@ -28,2 +28,3 @@ import { Message, JsonSerializable, Offset } from './types';

signal?: AbortSignal;
fetchClient?: typeof fetch;
}

@@ -71,2 +72,3 @@ export declare class FetchError extends Error {

private backoffOptions;
private fetchClient;
private subscribers;

@@ -73,0 +75,0 @@ private upToDateSubscribers;

20

dist/client.js

@@ -99,3 +99,3 @@ var __defProp = Object.defineProperty;

this.isUpToDate = false;
var _a, _b;
var _a, _b, _c;
this.validateOptions(options);

@@ -106,2 +106,3 @@ this.options = __spreadValues({ subscribe: true }, options);

this.backoffOptions = (_b = options.backoffOptions) != null ? _b : BackoffDefaults;
this.fetchClient = (_c = options.fetchClient) != null ? _c : fetch;
this.start();

@@ -120,4 +121,3 @@ }

);
if (shape.where)
url.searchParams.set(`where`, shape.where);
if (shape.where) url.searchParams.set(`where`, shape.where);
url.searchParams.set(`offset`, this.lastOffset);

@@ -131,4 +131,3 @@ if (this.isUpToDate) {

try {
yield fetch(url.toString(), { signal }).then((response) => __async(this, null, function* () {
var _a;
yield this.fetchClient(url.toString(), { signal }).then((response) => __async(this, null, function* () {
if (!response.ok) {

@@ -138,6 +137,10 @@ throw yield FetchError.fromResponse(response, url.toString());

const { headers, status } = response;
const shapeId = (_a = headers.get(`X-Electric-Shape-Id`)) != null ? _a : void 0;
const shapeId = headers.get(`X-Electric-Shape-Id`);
if (shapeId) {
this.shapeId = shapeId;
}
const lastOffset = headers.get(`X-Electric-Chunk-Last-Offset`);
if (lastOffset) {
this.lastOffset = lastOffset;
}
attempt = 0;

@@ -161,5 +164,2 @@ if (status === 204) {

}
if (`offset` in message) {
this.lastOffset = message.offset;
}
});

@@ -307,3 +307,3 @@ this.publish(batch);

var _a, _b;
if (`key` in message && message.value) {
if (`key` in message) {
switch ((_a = message.headers) == null ? void 0 : _a[`action`]) {

@@ -310,0 +310,0 @@ case `insert`:

{
"name": "@electric-sql/next",
"version": "0.0.2",
"description": "The Next Electric",
"version": "0.0.3",
"description": "Postgres everywhere - your data, in sync, wherever you need it.",
"main": "dist/index.js",

@@ -23,8 +23,8 @@ "types": "dist/index.d.ts",

},
"author": "",
"license": "ISC",
"author": "ElectricSQL team and contributors.",
"license": "Apache-2",
"bugs": {
"url": "https://github.com/electric-sql/electric-next/issues"
},
"homepage": "https://github.com/electric-sql/electric-next#readme",
"homepage": "https://next.electric-sql.com",
"dependencies": {},

@@ -31,0 +31,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc