@nexushub/client 1.1.0 → 1.1.2
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/{chunk-Z7UZC7IK.cjs → chunk-OP3LNZPC.cjs} +8 -8
- package/dist/{chunk-CBSACQXV.js → chunk-PB3YCBFH.js} +8 -8
- package/dist/cli.cjs +201 -444
- package/dist/content/local-cache-server.cjs +8 -8
- package/dist/content/local-cache-server.js +8 -8
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -8
- package/dist/{local-cache-server-AMGC6BOZ.cjs → local-cache-server-EKRKNL6N.cjs} +4 -4
- package/dist/{local-cache-server-SD3K7MZG.js → local-cache-server-POO2S6OU.js} +1 -1
- package/dist/react.cjs +14 -14
- package/dist/react.js +2 -2
- package/package.json +6 -2
|
@@ -42,14 +42,14 @@ var DEFAULT_ANALYTICS_URL = "https://sentry.gnapex.com";
|
|
|
42
42
|
var LOCAL_NEST_URL = "https://api.gnapex.com";
|
|
43
43
|
var LOCAL_RUST_URL = "https://sentry.gnapex.com";
|
|
44
44
|
var getEnvConfig = () => {
|
|
45
|
-
const NEXT_PUBLIC_ID = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_ID : void 0;
|
|
46
|
-
const NEXT_PUBLIC_KEY = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_KEY : void 0;
|
|
47
|
-
const NEXT_PUBLIC_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_API_URL : void 0;
|
|
48
|
-
const NEXT_PUBLIC_ANALYTICS_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_ANALYTICS_URL : void 0;
|
|
49
|
-
const NODE_ID = typeof process !== "undefined" ? process.env.NEXUS_PROJECT_ID : void 0;
|
|
50
|
-
const NODE_KEY = typeof process !== "undefined" ? process.env.NEXUS_API_KEY : void 0;
|
|
51
|
-
const NODE_URL = typeof process !== "undefined" ? process.env.NEXUS_API_URL : void 0;
|
|
52
|
-
const NODE_ANALYTICS_URL = typeof process !== "undefined" ? process.env.NEXUS_ANALYTICS_URL : void 0;
|
|
45
|
+
const NEXT_PUBLIC_ID = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_ID ?? process.env.NEXT_PUBLIC_NEXUS_ID : void 0;
|
|
46
|
+
const NEXT_PUBLIC_KEY = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_KEY ?? process.env.NEXT_PUBLIC_NEXUS_KEY : void 0;
|
|
47
|
+
const NEXT_PUBLIC_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_API_URL ?? process.env.NEXT_PUBLIC_NEXUS_API_URL : void 0;
|
|
48
|
+
const NEXT_PUBLIC_ANALYTICS_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_ANALYTICS_URL ?? process.env.NEXT_PUBLIC_NEXUS_ANALYTICS_URL : void 0;
|
|
49
|
+
const NODE_ID = typeof process !== "undefined" ? process.env.GNAPEX_PROJECT_ID ?? process.env.NEXUS_PROJECT_ID : void 0;
|
|
50
|
+
const NODE_KEY = typeof process !== "undefined" ? process.env.GNAPEX_API_KEY ?? process.env.NEXUS_API_KEY : void 0;
|
|
51
|
+
const NODE_URL = typeof process !== "undefined" ? process.env.GNAPEX_API_URL ?? process.env.NEXUS_API_URL : void 0;
|
|
52
|
+
const NODE_ANALYTICS_URL = typeof process !== "undefined" ? process.env.GNAPEX_ANALYTICS_URL ?? process.env.NEXUS_ANALYTICS_URL : void 0;
|
|
53
53
|
const NODE_ENV = typeof process !== "undefined" ? process.env.NODE_ENV : "production";
|
|
54
54
|
const isDev = NODE_ENV === "development" || typeof window !== "undefined" && window.location.hostname === "localhost";
|
|
55
55
|
const runtime = typeof window !== "undefined" ? window.__GNAPEX__ ?? window.__NEXUS__ : void 0;
|
|
@@ -8,14 +8,14 @@ var DEFAULT_ANALYTICS_URL = "https://sentry.gnapex.com";
|
|
|
8
8
|
var LOCAL_NEST_URL = "https://api.gnapex.com";
|
|
9
9
|
var LOCAL_RUST_URL = "https://sentry.gnapex.com";
|
|
10
10
|
var getEnvConfig = () => {
|
|
11
|
-
const NEXT_PUBLIC_ID = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_ID : void 0;
|
|
12
|
-
const NEXT_PUBLIC_KEY = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_KEY : void 0;
|
|
13
|
-
const NEXT_PUBLIC_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_API_URL : void 0;
|
|
14
|
-
const NEXT_PUBLIC_ANALYTICS_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_ANALYTICS_URL : void 0;
|
|
15
|
-
const NODE_ID = typeof process !== "undefined" ? process.env.NEXUS_PROJECT_ID : void 0;
|
|
16
|
-
const NODE_KEY = typeof process !== "undefined" ? process.env.NEXUS_API_KEY : void 0;
|
|
17
|
-
const NODE_URL = typeof process !== "undefined" ? process.env.NEXUS_API_URL : void 0;
|
|
18
|
-
const NODE_ANALYTICS_URL = typeof process !== "undefined" ? process.env.NEXUS_ANALYTICS_URL : void 0;
|
|
11
|
+
const NEXT_PUBLIC_ID = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_ID ?? process.env.NEXT_PUBLIC_NEXUS_ID : void 0;
|
|
12
|
+
const NEXT_PUBLIC_KEY = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_KEY ?? process.env.NEXT_PUBLIC_NEXUS_KEY : void 0;
|
|
13
|
+
const NEXT_PUBLIC_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_API_URL ?? process.env.NEXT_PUBLIC_NEXUS_API_URL : void 0;
|
|
14
|
+
const NEXT_PUBLIC_ANALYTICS_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_ANALYTICS_URL ?? process.env.NEXT_PUBLIC_NEXUS_ANALYTICS_URL : void 0;
|
|
15
|
+
const NODE_ID = typeof process !== "undefined" ? process.env.GNAPEX_PROJECT_ID ?? process.env.NEXUS_PROJECT_ID : void 0;
|
|
16
|
+
const NODE_KEY = typeof process !== "undefined" ? process.env.GNAPEX_API_KEY ?? process.env.NEXUS_API_KEY : void 0;
|
|
17
|
+
const NODE_URL = typeof process !== "undefined" ? process.env.GNAPEX_API_URL ?? process.env.NEXUS_API_URL : void 0;
|
|
18
|
+
const NODE_ANALYTICS_URL = typeof process !== "undefined" ? process.env.GNAPEX_ANALYTICS_URL ?? process.env.NEXUS_ANALYTICS_URL : void 0;
|
|
19
19
|
const NODE_ENV = typeof process !== "undefined" ? process.env.NODE_ENV : "production";
|
|
20
20
|
const isDev = NODE_ENV === "development" || typeof window !== "undefined" && window.location.hostname === "localhost";
|
|
21
21
|
const runtime = typeof window !== "undefined" ? window.__GNAPEX__ ?? window.__NEXUS__ : void 0;
|
package/dist/index.cjs
CHANGED
|
@@ -41,14 +41,14 @@ var init_config = __esm({
|
|
|
41
41
|
LOCAL_NEST_URL = "https://api.gnapex.com";
|
|
42
42
|
LOCAL_RUST_URL = "https://sentry.gnapex.com";
|
|
43
43
|
getEnvConfig = () => {
|
|
44
|
-
const NEXT_PUBLIC_ID = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_ID : void 0;
|
|
45
|
-
const NEXT_PUBLIC_KEY = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_KEY : void 0;
|
|
46
|
-
const NEXT_PUBLIC_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_API_URL : void 0;
|
|
47
|
-
const NEXT_PUBLIC_ANALYTICS_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_ANALYTICS_URL : void 0;
|
|
48
|
-
const NODE_ID = typeof process !== "undefined" ? process.env.NEXUS_PROJECT_ID : void 0;
|
|
49
|
-
const NODE_KEY = typeof process !== "undefined" ? process.env.NEXUS_API_KEY : void 0;
|
|
50
|
-
const NODE_URL = typeof process !== "undefined" ? process.env.NEXUS_API_URL : void 0;
|
|
51
|
-
const NODE_ANALYTICS_URL = typeof process !== "undefined" ? process.env.NEXUS_ANALYTICS_URL : void 0;
|
|
44
|
+
const NEXT_PUBLIC_ID = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_ID ?? process.env.NEXT_PUBLIC_NEXUS_ID : void 0;
|
|
45
|
+
const NEXT_PUBLIC_KEY = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_KEY ?? process.env.NEXT_PUBLIC_NEXUS_KEY : void 0;
|
|
46
|
+
const NEXT_PUBLIC_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_API_URL ?? process.env.NEXT_PUBLIC_NEXUS_API_URL : void 0;
|
|
47
|
+
const NEXT_PUBLIC_ANALYTICS_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_ANALYTICS_URL ?? process.env.NEXT_PUBLIC_NEXUS_ANALYTICS_URL : void 0;
|
|
48
|
+
const NODE_ID = typeof process !== "undefined" ? process.env.GNAPEX_PROJECT_ID ?? process.env.NEXUS_PROJECT_ID : void 0;
|
|
49
|
+
const NODE_KEY = typeof process !== "undefined" ? process.env.GNAPEX_API_KEY ?? process.env.NEXUS_API_KEY : void 0;
|
|
50
|
+
const NODE_URL = typeof process !== "undefined" ? process.env.GNAPEX_API_URL ?? process.env.NEXUS_API_URL : void 0;
|
|
51
|
+
const NODE_ANALYTICS_URL = typeof process !== "undefined" ? process.env.GNAPEX_ANALYTICS_URL ?? process.env.NEXUS_ANALYTICS_URL : void 0;
|
|
52
52
|
const NODE_ENV = typeof process !== "undefined" ? process.env.NODE_ENV : "production";
|
|
53
53
|
const isDev = NODE_ENV === "development" || typeof window !== "undefined" && window.location.hostname === "localhost";
|
|
54
54
|
const runtime = typeof window !== "undefined" ? window.__GNAPEX__ ?? window.__NEXUS__ : void 0;
|
package/dist/index.d.cts
CHANGED
|
@@ -14,9 +14,9 @@ declare const LOCAL_RUST_URL = "https://sentry.gnapex.com";
|
|
|
14
14
|
/**
|
|
15
15
|
* Automatically discovers runtime configuration across:
|
|
16
16
|
* 1. Window Global (__GNAPEX__ or __NEXUS__)
|
|
17
|
-
* 2. HTML Meta Tags (<meta name="gnapex-project">)
|
|
18
|
-
* 3. Next.js Public Environment Variables (NEXT_PUBLIC_NEXUS_*)
|
|
19
|
-
* 4. Node.js Standard Process Variables (NEXUS_*)
|
|
17
|
+
* 2. HTML Meta Tags (<meta name="gnapex-project"> / <meta name="nexus-project">)
|
|
18
|
+
* 3. Next.js Public Environment Variables (NEXT_PUBLIC_GNAPEX_* / NEXT_PUBLIC_NEXUS_*)
|
|
19
|
+
* 4. Node.js Standard Process Variables (GNAPEX_* / NEXUS_*)
|
|
20
20
|
*/
|
|
21
21
|
declare const getEnvConfig: () => MinimalNexusConfig;
|
|
22
22
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ declare const LOCAL_RUST_URL = "https://sentry.gnapex.com";
|
|
|
14
14
|
/**
|
|
15
15
|
* Automatically discovers runtime configuration across:
|
|
16
16
|
* 1. Window Global (__GNAPEX__ or __NEXUS__)
|
|
17
|
-
* 2. HTML Meta Tags (<meta name="gnapex-project">)
|
|
18
|
-
* 3. Next.js Public Environment Variables (NEXT_PUBLIC_NEXUS_*)
|
|
19
|
-
* 4. Node.js Standard Process Variables (NEXUS_*)
|
|
17
|
+
* 2. HTML Meta Tags (<meta name="gnapex-project"> / <meta name="nexus-project">)
|
|
18
|
+
* 3. Next.js Public Environment Variables (NEXT_PUBLIC_GNAPEX_* / NEXT_PUBLIC_NEXUS_*)
|
|
19
|
+
* 4. Node.js Standard Process Variables (GNAPEX_* / NEXUS_*)
|
|
20
20
|
*/
|
|
21
21
|
declare const getEnvConfig: () => MinimalNexusConfig;
|
|
22
22
|
/**
|
package/dist/index.js
CHANGED
|
@@ -19,14 +19,14 @@ var init_config = __esm({
|
|
|
19
19
|
LOCAL_NEST_URL = "https://api.gnapex.com";
|
|
20
20
|
LOCAL_RUST_URL = "https://sentry.gnapex.com";
|
|
21
21
|
getEnvConfig = () => {
|
|
22
|
-
const NEXT_PUBLIC_ID = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_ID : void 0;
|
|
23
|
-
const NEXT_PUBLIC_KEY = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_KEY : void 0;
|
|
24
|
-
const NEXT_PUBLIC_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_API_URL : void 0;
|
|
25
|
-
const NEXT_PUBLIC_ANALYTICS_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_ANALYTICS_URL : void 0;
|
|
26
|
-
const NODE_ID = typeof process !== "undefined" ? process.env.NEXUS_PROJECT_ID : void 0;
|
|
27
|
-
const NODE_KEY = typeof process !== "undefined" ? process.env.NEXUS_API_KEY : void 0;
|
|
28
|
-
const NODE_URL = typeof process !== "undefined" ? process.env.NEXUS_API_URL : void 0;
|
|
29
|
-
const NODE_ANALYTICS_URL = typeof process !== "undefined" ? process.env.NEXUS_ANALYTICS_URL : void 0;
|
|
22
|
+
const NEXT_PUBLIC_ID = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_ID ?? process.env.NEXT_PUBLIC_NEXUS_ID : void 0;
|
|
23
|
+
const NEXT_PUBLIC_KEY = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_KEY ?? process.env.NEXT_PUBLIC_NEXUS_KEY : void 0;
|
|
24
|
+
const NEXT_PUBLIC_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_API_URL ?? process.env.NEXT_PUBLIC_NEXUS_API_URL : void 0;
|
|
25
|
+
const NEXT_PUBLIC_ANALYTICS_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_GNAPEX_ANALYTICS_URL ?? process.env.NEXT_PUBLIC_NEXUS_ANALYTICS_URL : void 0;
|
|
26
|
+
const NODE_ID = typeof process !== "undefined" ? process.env.GNAPEX_PROJECT_ID ?? process.env.NEXUS_PROJECT_ID : void 0;
|
|
27
|
+
const NODE_KEY = typeof process !== "undefined" ? process.env.GNAPEX_API_KEY ?? process.env.NEXUS_API_KEY : void 0;
|
|
28
|
+
const NODE_URL = typeof process !== "undefined" ? process.env.GNAPEX_API_URL ?? process.env.NEXUS_API_URL : void 0;
|
|
29
|
+
const NODE_ANALYTICS_URL = typeof process !== "undefined" ? process.env.GNAPEX_ANALYTICS_URL ?? process.env.NEXUS_ANALYTICS_URL : void 0;
|
|
30
30
|
const NODE_ENV = typeof process !== "undefined" ? process.env.NODE_ENV : "production";
|
|
31
31
|
const isDev = NODE_ENV === "development" || typeof window !== "undefined" && window.location.hostname === "localhost";
|
|
32
32
|
const runtime = typeof window !== "undefined" ? window.__GNAPEX__ ?? window.__NEXUS__ : void 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
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 }; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkOP3LNZPCcjs = require('./chunk-OP3LNZPC.cjs');
|
|
5
5
|
|
|
6
6
|
// src/content/local-cache-server.ts
|
|
7
7
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
@@ -110,7 +110,7 @@ var LocalCache = class {
|
|
|
110
110
|
constructor(customPath, apiKey) {
|
|
111
111
|
this.apiKey = "";
|
|
112
112
|
this.baseDir = customPath || ".nexus/local";
|
|
113
|
-
const config =
|
|
113
|
+
const config = _chunkOP3LNZPCcjs.getEnvConfig.call(void 0, );
|
|
114
114
|
this.apiKey = apiKey || config.apiKey || "";
|
|
115
115
|
}
|
|
116
116
|
isLoaded() {
|
|
@@ -148,7 +148,7 @@ var LocalCache = class {
|
|
|
148
148
|
*/
|
|
149
149
|
async getPage(slug) {
|
|
150
150
|
try {
|
|
151
|
-
|
|
151
|
+
_chunkOP3LNZPCcjs.validateSlug.call(void 0, slug);
|
|
152
152
|
} catch (e) {
|
|
153
153
|
return null;
|
|
154
154
|
}
|
|
@@ -174,7 +174,7 @@ var LocalCache = class {
|
|
|
174
174
|
*/
|
|
175
175
|
async getCollection(collectionId) {
|
|
176
176
|
try {
|
|
177
|
-
|
|
177
|
+
_chunkOP3LNZPCcjs.validateSlug.call(void 0, collectionId);
|
|
178
178
|
} catch (e2) {
|
|
179
179
|
return null;
|
|
180
180
|
}
|
package/dist/react.cjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkOP3LNZPCcjs = require('./chunk-OP3LNZPC.cjs');
|
|
10
10
|
|
|
11
11
|
// src/components/NexusRenderer.tsx
|
|
12
12
|
|
|
@@ -692,7 +692,7 @@ var LocalCacheProxy = class {
|
|
|
692
692
|
async getInstance() {
|
|
693
693
|
if (this.instance) return this.instance;
|
|
694
694
|
if (typeof window === "undefined") {
|
|
695
|
-
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./local-cache-server-
|
|
695
|
+
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./local-cache-server-EKRKNL6N.cjs")));
|
|
696
696
|
this.instance = new mod.LocalCache(this.cachePath);
|
|
697
697
|
} else {
|
|
698
698
|
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./local-cache-client-IGAL7SZ6.cjs")));
|
|
@@ -863,7 +863,7 @@ var ContentEngine = class {
|
|
|
863
863
|
* Fetch a Single Page with full strategy pipeline
|
|
864
864
|
*/
|
|
865
865
|
async getPage(slug, options = {}) {
|
|
866
|
-
const { result, duration } =
|
|
866
|
+
const { result, duration } = _chunkOP3LNZPCcjs.measurePerformance.call(void 0,
|
|
867
867
|
`getPage("${slug}")`,
|
|
868
868
|
() => this._getPage(slug, options)
|
|
869
869
|
);
|
|
@@ -875,7 +875,7 @@ var ContentEngine = class {
|
|
|
875
875
|
return result;
|
|
876
876
|
}
|
|
877
877
|
async _getPage(slug, options = {}) {
|
|
878
|
-
|
|
878
|
+
_chunkOP3LNZPCcjs.validateSlug.call(void 0, slug);
|
|
879
879
|
const {
|
|
880
880
|
revalidate = this.defaultRevalidate,
|
|
881
881
|
tags = [],
|
|
@@ -931,7 +931,7 @@ var ContentEngine = class {
|
|
|
931
931
|
* Fetch a Collection (Optimized)
|
|
932
932
|
*/
|
|
933
933
|
async getCollection(collectionId, query = {}, options = {}) {
|
|
934
|
-
const { result, duration } =
|
|
934
|
+
const { result, duration } = _chunkOP3LNZPCcjs.measurePerformance.call(void 0,
|
|
935
935
|
`getCollection("${collectionId}")`,
|
|
936
936
|
() => this._getCollection(collectionId, query, options)
|
|
937
937
|
);
|
|
@@ -943,14 +943,14 @@ var ContentEngine = class {
|
|
|
943
943
|
return result;
|
|
944
944
|
}
|
|
945
945
|
async _getCollection(collectionId, query = {}, options = {}) {
|
|
946
|
-
const normalizedQuery =
|
|
946
|
+
const normalizedQuery = _chunkOP3LNZPCcjs.normalizeQuery.call(void 0, query);
|
|
947
947
|
const {
|
|
948
948
|
revalidate = this.defaultRevalidate,
|
|
949
949
|
tags = [],
|
|
950
950
|
forceRefresh = false,
|
|
951
951
|
includeMetadata = false
|
|
952
952
|
} = options;
|
|
953
|
-
const queryString =
|
|
953
|
+
const queryString = _chunkOP3LNZPCcjs.buildQueryString.call(void 0, normalizedQuery);
|
|
954
954
|
const cacheKey = `collection:${collectionId}:${queryString}`;
|
|
955
955
|
const cached = await this.checkCaches(
|
|
956
956
|
cacheKey,
|
|
@@ -1377,7 +1377,7 @@ var ContentEngine = class {
|
|
|
1377
1377
|
return cacheEntry;
|
|
1378
1378
|
}
|
|
1379
1379
|
async fetchCollection(collectionId, query, cacheKey, tags, revalidate) {
|
|
1380
|
-
const params =
|
|
1380
|
+
const params = _chunkOP3LNZPCcjs.buildQueryString.call(void 0, query);
|
|
1381
1381
|
const url = `${this.config.apiUrl}/content/${this.config.projectId}/collection/${collectionId}?${params}`;
|
|
1382
1382
|
const fetchTags = [
|
|
1383
1383
|
CacheTags.project(this.config.projectId),
|
|
@@ -1893,7 +1893,7 @@ var Tracker = class {
|
|
|
1893
1893
|
anonymousId: this.anonymousId,
|
|
1894
1894
|
messageId: generateUUID(),
|
|
1895
1895
|
sentAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1896
|
-
version:
|
|
1896
|
+
version: _chunkOP3LNZPCcjs.SDK_VERSION,
|
|
1897
1897
|
// Dynamically synced to SDK 1.1.0
|
|
1898
1898
|
url: window.location.href,
|
|
1899
1899
|
referrer: document.referrer,
|
|
@@ -1943,7 +1943,7 @@ var Tracker = class {
|
|
|
1943
1943
|
const headers = {
|
|
1944
1944
|
"Content-Type": "application/json",
|
|
1945
1945
|
Authorization: this.config.apiKey ? `Bearer ${this.config.apiKey}` : "",
|
|
1946
|
-
"X-Nexus-Client": `analytics/${
|
|
1946
|
+
"X-Nexus-Client": `analytics/${_chunkOP3LNZPCcjs.SDK_VERSION}`,
|
|
1947
1947
|
"X-Nexus-Project": this.config.projectId
|
|
1948
1948
|
};
|
|
1949
1949
|
let response;
|
|
@@ -2705,14 +2705,14 @@ var getDiagnostics = (version, environment) => ({ version, environment, online:
|
|
|
2705
2705
|
// src/client.ts
|
|
2706
2706
|
var NexusClient = class {
|
|
2707
2707
|
constructor(config = {}) {
|
|
2708
|
-
const full =
|
|
2708
|
+
const full = _chunkOP3LNZPCcjs.getFullConfig.call(void 0, config);
|
|
2709
2709
|
this.config = {
|
|
2710
2710
|
debug: false,
|
|
2711
2711
|
cacheStrategy: "memory",
|
|
2712
2712
|
revalidateTime: false,
|
|
2713
2713
|
timeout: 1e4,
|
|
2714
2714
|
retries: 3,
|
|
2715
|
-
sdkVersion:
|
|
2715
|
+
sdkVersion: _chunkOP3LNZPCcjs.SDK_VERSION,
|
|
2716
2716
|
cacheInvalidation: "platform",
|
|
2717
2717
|
environment: typeof process !== "undefined" && _optionalChain([process, 'access', _57 => _57.env, 'optionalAccess', _58 => _58.NODE_ENV]) === "development" ? "development" : "production",
|
|
2718
2718
|
autoTracking: true,
|
|
@@ -2722,7 +2722,7 @@ var NexusClient = class {
|
|
|
2722
2722
|
...full,
|
|
2723
2723
|
...config
|
|
2724
2724
|
};
|
|
2725
|
-
const errors =
|
|
2725
|
+
const errors = _chunkOP3LNZPCcjs.validateConfig.call(void 0, this.config);
|
|
2726
2726
|
if (errors.length && this.config.debug) {
|
|
2727
2727
|
console.warn("[GN-Apex] Configuration warnings:", errors);
|
|
2728
2728
|
}
|
|
@@ -2775,7 +2775,7 @@ var NexusClient = class {
|
|
|
2775
2775
|
*/
|
|
2776
2776
|
diagnostics() {
|
|
2777
2777
|
return {
|
|
2778
|
-
...getDiagnostics(
|
|
2778
|
+
...getDiagnostics(_chunkOP3LNZPCcjs.SDK_VERSION, _nullishCoalesce(this.config.environment, () => ( "production"))),
|
|
2779
2779
|
cache: this.content.getCacheStats(),
|
|
2780
2780
|
http: this.http.getStats(),
|
|
2781
2781
|
analyticsQueue: this.analytics ? void 0 : 0
|
package/dist/react.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
normalizeQuery,
|
|
7
7
|
validateConfig,
|
|
8
8
|
validateSlug
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PB3YCBFH.js";
|
|
10
10
|
|
|
11
11
|
// src/components/NexusRenderer.tsx
|
|
12
12
|
import {
|
|
@@ -692,7 +692,7 @@ var LocalCacheProxy = class {
|
|
|
692
692
|
async getInstance() {
|
|
693
693
|
if (this.instance) return this.instance;
|
|
694
694
|
if (typeof window === "undefined") {
|
|
695
|
-
const mod = await import("./local-cache-server-
|
|
695
|
+
const mod = await import("./local-cache-server-POO2S6OU.js");
|
|
696
696
|
this.instance = new mod.LocalCache(this.cachePath);
|
|
697
697
|
} else {
|
|
698
698
|
const mod = await import("./local-cache-client-I6UYVJJV.js");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexushub/client",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"description": "GN-Apex zero-config production runtime SDK",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"bin": {
|
|
32
|
+
"apex": "./dist/cli.cjs",
|
|
32
33
|
"nexus": "./dist/cli.cjs"
|
|
33
34
|
},
|
|
34
35
|
"browser": {
|
|
@@ -43,6 +44,9 @@
|
|
|
43
44
|
"README.md"
|
|
44
45
|
],
|
|
45
46
|
"scripts": {
|
|
47
|
+
"release": "npm version patch && npm publish",
|
|
48
|
+
"release:minor": "npm version minor && npm publish",
|
|
49
|
+
"release:major": "npm version major && npm publish",
|
|
46
50
|
"build": "tsup && npm run build --prefix ../app/studio",
|
|
47
51
|
"dev": "tsup src/index.ts tools/cli.ts --format esm,cjs --dts --watch",
|
|
48
52
|
"test": "jest --config jest.config.cjs",
|
|
@@ -118,4 +122,4 @@
|
|
|
118
122
|
"engines": {
|
|
119
123
|
"node": ">=18.0.0"
|
|
120
124
|
}
|
|
121
|
-
}
|
|
125
|
+
}
|