@nexushub/client 0.3.2 → 0.3.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
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/config.ts
2
- var DEFAULT_API_URL = "http://localhost:3001";
3
- var DEFAULT_ANALYTICS_URL = "http://localhost:3002";
4
- var LOCAL_NEST_URL = "http://localhost:3001";
5
- var LOCAL_RUST_URL = "http://localhost:3002";
2
+ var DEFAULT_API_URL = "https://endpoints.gnexus.co.tz";
3
+ var DEFAULT_ANALYTICS_URL = "https://sentry.gnapex.co.tz";
4
+ var LOCAL_NEST_URL = "https://endpoints.gnexus.co.tz";
5
+ var LOCAL_RUST_URL = "https://sentry.gnapex.co.tz";
6
6
  var getEnvConfig = () => {
7
7
  const NEXT_PUBLIC_ID = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_ID : void 0;
8
8
  const NEXT_PUBLIC_KEY = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_KEY : void 0;
@@ -1364,10 +1364,13 @@ var VitalsCollector = class {
1364
1364
  if (resourceEntries.length > 0) {
1365
1365
  this.metrics.resources = resourceEntries.filter((r) => !r.name.includes("/api/collect")).sort((a, b) => b.duration - a.duration).slice(0, 20).map((r) => ({
1366
1366
  name: r.name,
1367
- initiator_type: r.initiatorType,
1367
+ initiatorType: r.initiatorType,
1368
1368
  duration: Math.round(r.duration),
1369
- transfer_size: r.transferSize > 0 ? r.transferSize : void 0,
1370
- encoded_body_size: r.encodedBodySize > 0 ? r.encodedBodySize : void 0
1369
+ transferSize: r.transferSize > 0 ? r.transferSize : void 0,
1370
+ encodedBodySize: r.encodedBodySize > 0 ? r.encodedBodySize : void 0,
1371
+ decodedBodySize: r.decodedBodySize > 0 ? r.decodedBodySize : void 0,
1372
+ startTime: Math.round(r.startTime),
1373
+ responseEnd: Math.round(r.responseEnd)
1371
1374
  }));
1372
1375
  this.hasUpdates = true;
1373
1376
  }
@@ -1809,7 +1812,7 @@ var AnalyticsEngine = class {
1809
1812
  for (const threshold of THRESHOLDS) {
1810
1813
  if (this.maxScrollDepth >= threshold && !this.scrollThresholdsFired.has(threshold)) {
1811
1814
  this.scrollThresholdsFired.add(threshold);
1812
- this.tracker.send("scroll_depth", {
1815
+ this.tracker.send("scroll", {
1813
1816
  depth: threshold / 100,
1814
1817
  depth_percent: threshold,
1815
1818
  path: window.location.pathname
package/dist/index.d.cts CHANGED
@@ -8,10 +8,10 @@ interface MinimalNexusConfig {
8
8
  apiKey?: string;
9
9
  projectId?: string;
10
10
  }
11
- declare const DEFAULT_API_URL = "http://localhost:3001";
12
- declare const DEFAULT_ANALYTICS_URL = "http://localhost:3002";
13
- declare const LOCAL_NEST_URL = "http://localhost:3001";
14
- declare const LOCAL_RUST_URL = "http://localhost:3002";
11
+ declare const DEFAULT_API_URL = "https://endpoints.gnexus.co.tz";
12
+ declare const DEFAULT_ANALYTICS_URL = "https://sentry.gnapex.co.tz";
13
+ declare const LOCAL_NEST_URL = "https://endpoints.gnexus.co.tz";
14
+ declare const LOCAL_RUST_URL = "https://sentry.gnapex.co.tz";
15
15
  declare const getEnvConfig: () => MinimalNexusConfig;
16
16
  declare const mergeConfigs: (base: MinimalNexusConfig, override: Partial<MinimalNexusConfig>) => MinimalNexusConfig;
17
17
  declare const getFullConfig: (partialConfig?: Partial<MinimalNexusConfig>) => MinimalNexusConfig;
package/dist/index.d.ts CHANGED
@@ -8,10 +8,10 @@ interface MinimalNexusConfig {
8
8
  apiKey?: string;
9
9
  projectId?: string;
10
10
  }
11
- declare const DEFAULT_API_URL = "http://localhost:3001";
12
- declare const DEFAULT_ANALYTICS_URL = "http://localhost:3002";
13
- declare const LOCAL_NEST_URL = "http://localhost:3001";
14
- declare const LOCAL_RUST_URL = "http://localhost:3002";
11
+ declare const DEFAULT_API_URL = "https://endpoints.gnexus.co.tz";
12
+ declare const DEFAULT_ANALYTICS_URL = "https://sentry.gnapex.co.tz";
13
+ declare const LOCAL_NEST_URL = "https://endpoints.gnexus.co.tz";
14
+ declare const LOCAL_RUST_URL = "https://sentry.gnapex.co.tz";
15
15
  declare const getEnvConfig: () => MinimalNexusConfig;
16
16
  declare const mergeConfigs: (base: MinimalNexusConfig, override: Partial<MinimalNexusConfig>) => MinimalNexusConfig;
17
17
  declare const getFullConfig: (partialConfig?: Partial<MinimalNexusConfig>) => MinimalNexusConfig;
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  // src/config.ts
2
- var DEFAULT_API_URL = "http://localhost:3001";
3
- var DEFAULT_ANALYTICS_URL = "http://localhost:3002";
4
- var LOCAL_NEST_URL = "http://localhost:3001";
5
- var LOCAL_RUST_URL = "http://localhost:3002";
2
+ var DEFAULT_API_URL = "https://endpoints.gnexus.co.tz";
3
+ var DEFAULT_ANALYTICS_URL = "https://sentry.gnapex.co.tz";
4
+ var LOCAL_NEST_URL = "https://endpoints.gnexus.co.tz";
5
+ var LOCAL_RUST_URL = "https://sentry.gnapex.co.tz";
6
6
  var getEnvConfig = () => {
7
7
  const NEXT_PUBLIC_ID = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_ID : void 0;
8
8
  const NEXT_PUBLIC_KEY = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_KEY : void 0;
@@ -1364,10 +1364,13 @@ var VitalsCollector = class {
1364
1364
  if (resourceEntries.length > 0) {
1365
1365
  this.metrics.resources = resourceEntries.filter((r) => !r.name.includes("/api/collect")).sort((a, b) => b.duration - a.duration).slice(0, 20).map((r) => ({
1366
1366
  name: r.name,
1367
- initiator_type: r.initiatorType,
1367
+ initiatorType: r.initiatorType,
1368
1368
  duration: Math.round(r.duration),
1369
- transfer_size: r.transferSize > 0 ? r.transferSize : void 0,
1370
- encoded_body_size: r.encodedBodySize > 0 ? r.encodedBodySize : void 0
1369
+ transferSize: r.transferSize > 0 ? r.transferSize : void 0,
1370
+ encodedBodySize: r.encodedBodySize > 0 ? r.encodedBodySize : void 0,
1371
+ decodedBodySize: r.decodedBodySize > 0 ? r.decodedBodySize : void 0,
1372
+ startTime: Math.round(r.startTime),
1373
+ responseEnd: Math.round(r.responseEnd)
1371
1374
  }));
1372
1375
  this.hasUpdates = true;
1373
1376
  }
@@ -1809,7 +1812,7 @@ var AnalyticsEngine = class {
1809
1812
  for (const threshold of THRESHOLDS) {
1810
1813
  if (this.maxScrollDepth >= threshold && !this.scrollThresholdsFired.has(threshold)) {
1811
1814
  this.scrollThresholdsFired.add(threshold);
1812
- this.tracker.send("scroll_depth", {
1815
+ this.tracker.send("scroll", {
1813
1816
  depth: threshold / 100,
1814
1817
  depth_percent: threshold,
1815
1818
  path: window.location.pathname
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nexushub/client",
3
3
  "private": false,
4
- "version": "0.3.2",
4
+ "version": "0.3.4",
5
5
  "description": "The God-Tier NexusHub SDK",
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs",