@nexushub/client 0.1.3 → 0.1.4

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.
package/dist/index.cjs CHANGED
@@ -1336,7 +1336,7 @@ var initVitals = (tracker) => {
1336
1336
  // src/analytics/storage.ts
1337
1337
  var DB_NAME = "NexusHub_Analytics";
1338
1338
  var STORE_NAME = "events_queue";
1339
- var DB_VERSION = 1;
1339
+ var DB_VERSION = 2;
1340
1340
  var EventStorage = class {
1341
1341
  constructor() {
1342
1342
  this.db = null;
@@ -1349,7 +1349,9 @@ var EventStorage = class {
1349
1349
  return new Promise((resolve, reject) => {
1350
1350
  const request = indexedDB.open(DB_NAME, DB_VERSION);
1351
1351
  request.onerror = () => {
1352
- console.warn("[NexusHub] Failed to open IndexedDB. Falling back to memory.");
1352
+ console.warn(
1353
+ "[NexusHub] Failed to open IndexedDB. Falling back to memory."
1354
+ );
1353
1355
  resolve();
1354
1356
  };
1355
1357
  request.onsuccess = (event) => {
@@ -1358,9 +1360,13 @@ var EventStorage = class {
1358
1360
  };
1359
1361
  request.onupgradeneeded = (event) => {
1360
1362
  const db = event.target.result;
1361
- if (!db.objectStoreNames.contains(STORE_NAME)) {
1362
- db.createObjectStore(STORE_NAME, { keyPath: "id", autoIncrement: true });
1363
+ if (db.objectStoreNames.contains(STORE_NAME)) {
1364
+ db.deleteObjectStore(STORE_NAME);
1363
1365
  }
1366
+ db.createObjectStore(STORE_NAME, {
1367
+ keyPath: "id",
1368
+ autoIncrement: true
1369
+ });
1364
1370
  };
1365
1371
  });
1366
1372
  }
package/dist/index.js CHANGED
@@ -1336,7 +1336,7 @@ var initVitals = (tracker) => {
1336
1336
  // src/analytics/storage.ts
1337
1337
  var DB_NAME = "NexusHub_Analytics";
1338
1338
  var STORE_NAME = "events_queue";
1339
- var DB_VERSION = 1;
1339
+ var DB_VERSION = 2;
1340
1340
  var EventStorage = class {
1341
1341
  constructor() {
1342
1342
  this.db = null;
@@ -1349,7 +1349,9 @@ var EventStorage = class {
1349
1349
  return new Promise((resolve, reject) => {
1350
1350
  const request = indexedDB.open(DB_NAME, DB_VERSION);
1351
1351
  request.onerror = () => {
1352
- console.warn("[NexusHub] Failed to open IndexedDB. Falling back to memory.");
1352
+ console.warn(
1353
+ "[NexusHub] Failed to open IndexedDB. Falling back to memory."
1354
+ );
1353
1355
  resolve();
1354
1356
  };
1355
1357
  request.onsuccess = (event) => {
@@ -1358,9 +1360,13 @@ var EventStorage = class {
1358
1360
  };
1359
1361
  request.onupgradeneeded = (event) => {
1360
1362
  const db = event.target.result;
1361
- if (!db.objectStoreNames.contains(STORE_NAME)) {
1362
- db.createObjectStore(STORE_NAME, { keyPath: "id", autoIncrement: true });
1363
+ if (db.objectStoreNames.contains(STORE_NAME)) {
1364
+ db.deleteObjectStore(STORE_NAME);
1363
1365
  }
1366
+ db.createObjectStore(STORE_NAME, {
1367
+ keyPath: "id",
1368
+ autoIncrement: true
1369
+ });
1364
1370
  };
1365
1371
  });
1366
1372
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nexushub/client",
3
3
  "private": false,
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "description": "The God-Tier NexusHub SDK",
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs",