@nexushub/client 1.1.2 → 1.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/cli.cjs +149 -148
- package/dist/index.cjs +20 -19
- package/dist/index.js +20 -19
- package/dist/react.cjs +20 -19
- package/dist/react.js +20 -19
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1039,7 +1039,7 @@ var ContentEngine = class {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
return includeMetadata ? cached : cached.data;
|
|
1041
1041
|
}
|
|
1042
|
-
if (!forceRefresh
|
|
1042
|
+
if (!forceRefresh) {
|
|
1043
1043
|
try {
|
|
1044
1044
|
const localCollection = await this.localCache.getCollection(collectionId);
|
|
1045
1045
|
if (localCollection) {
|
|
@@ -1114,7 +1114,7 @@ var ContentEngine = class {
|
|
|
1114
1114
|
return cached;
|
|
1115
1115
|
}
|
|
1116
1116
|
}
|
|
1117
|
-
if (!forceRefresh
|
|
1117
|
+
if (!forceRefresh) {
|
|
1118
1118
|
try {
|
|
1119
1119
|
const localGlobals = await this.localCache.getGlobals();
|
|
1120
1120
|
if (localGlobals) {
|
|
@@ -1346,24 +1346,25 @@ var ContentEngine = class {
|
|
|
1346
1346
|
};
|
|
1347
1347
|
}
|
|
1348
1348
|
}
|
|
1349
|
-
if (
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1349
|
+
if (key.startsWith("page:")) {
|
|
1350
|
+
const slug = key.split(":")[1];
|
|
1351
|
+
try {
|
|
1352
|
+
const local = await this.localCache.getPage(slug);
|
|
1353
|
+
if (local && (process.env.NODE_ENV === "development" || !this.config.apiKey)) {
|
|
1354
|
+
return {
|
|
1355
|
+
data: local,
|
|
1356
|
+
metadata: {
|
|
1357
|
+
timestamp: Date.now(),
|
|
1358
|
+
expiresAt: Infinity,
|
|
1359
|
+
tags: [
|
|
1360
|
+
CacheTags.content(slug),
|
|
1361
|
+
CacheTags.project(this.config.projectId)
|
|
1362
|
+
],
|
|
1363
|
+
etag: void 0
|
|
1364
|
+
}
|
|
1365
|
+
};
|
|
1366
1366
|
}
|
|
1367
|
+
} catch {
|
|
1367
1368
|
}
|
|
1368
1369
|
}
|
|
1369
1370
|
return null;
|
package/dist/index.js
CHANGED
|
@@ -983,7 +983,7 @@ var ContentEngine = class {
|
|
|
983
983
|
}
|
|
984
984
|
return includeMetadata ? cached : cached.data;
|
|
985
985
|
}
|
|
986
|
-
if (!forceRefresh
|
|
986
|
+
if (!forceRefresh) {
|
|
987
987
|
try {
|
|
988
988
|
const localCollection = await this.localCache.getCollection(collectionId);
|
|
989
989
|
if (localCollection) {
|
|
@@ -1058,7 +1058,7 @@ var ContentEngine = class {
|
|
|
1058
1058
|
return cached;
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
|
-
if (!forceRefresh
|
|
1061
|
+
if (!forceRefresh) {
|
|
1062
1062
|
try {
|
|
1063
1063
|
const localGlobals = await this.localCache.getGlobals();
|
|
1064
1064
|
if (localGlobals) {
|
|
@@ -1290,24 +1290,25 @@ var ContentEngine = class {
|
|
|
1290
1290
|
};
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
|
-
if (
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1293
|
+
if (key.startsWith("page:")) {
|
|
1294
|
+
const slug = key.split(":")[1];
|
|
1295
|
+
try {
|
|
1296
|
+
const local = await this.localCache.getPage(slug);
|
|
1297
|
+
if (local && (process.env.NODE_ENV === "development" || !this.config.apiKey)) {
|
|
1298
|
+
return {
|
|
1299
|
+
data: local,
|
|
1300
|
+
metadata: {
|
|
1301
|
+
timestamp: Date.now(),
|
|
1302
|
+
expiresAt: Infinity,
|
|
1303
|
+
tags: [
|
|
1304
|
+
CacheTags.content(slug),
|
|
1305
|
+
CacheTags.project(this.config.projectId)
|
|
1306
|
+
],
|
|
1307
|
+
etag: void 0
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
1310
|
}
|
|
1311
|
+
} catch {
|
|
1311
1312
|
}
|
|
1312
1313
|
}
|
|
1313
1314
|
return null;
|
package/dist/react.cjs
CHANGED
|
@@ -965,7 +965,7 @@ var ContentEngine = class {
|
|
|
965
965
|
}
|
|
966
966
|
return includeMetadata ? cached : cached.data;
|
|
967
967
|
}
|
|
968
|
-
if (!forceRefresh
|
|
968
|
+
if (!forceRefresh) {
|
|
969
969
|
try {
|
|
970
970
|
const localCollection = await this.localCache.getCollection(collectionId);
|
|
971
971
|
if (localCollection) {
|
|
@@ -1040,7 +1040,7 @@ var ContentEngine = class {
|
|
|
1040
1040
|
return cached;
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
|
-
if (!forceRefresh
|
|
1043
|
+
if (!forceRefresh) {
|
|
1044
1044
|
try {
|
|
1045
1045
|
const localGlobals = await this.localCache.getGlobals();
|
|
1046
1046
|
if (localGlobals) {
|
|
@@ -1272,24 +1272,25 @@ var ContentEngine = class {
|
|
|
1272
1272
|
};
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
1275
|
-
if (
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1275
|
+
if (key.startsWith("page:")) {
|
|
1276
|
+
const slug = key.split(":")[1];
|
|
1277
|
+
try {
|
|
1278
|
+
const local = await this.localCache.getPage(slug);
|
|
1279
|
+
if (local && (process.env.NODE_ENV === "development" || !this.config.apiKey)) {
|
|
1280
|
+
return {
|
|
1281
|
+
data: local,
|
|
1282
|
+
metadata: {
|
|
1283
|
+
timestamp: Date.now(),
|
|
1284
|
+
expiresAt: Infinity,
|
|
1285
|
+
tags: [
|
|
1286
|
+
CacheTags.content(slug),
|
|
1287
|
+
CacheTags.project(this.config.projectId)
|
|
1288
|
+
],
|
|
1289
|
+
etag: void 0
|
|
1290
|
+
}
|
|
1291
|
+
};
|
|
1292
1292
|
}
|
|
1293
|
+
} catch (e8) {
|
|
1293
1294
|
}
|
|
1294
1295
|
}
|
|
1295
1296
|
return null;
|
package/dist/react.js
CHANGED
|
@@ -965,7 +965,7 @@ var ContentEngine = class {
|
|
|
965
965
|
}
|
|
966
966
|
return includeMetadata ? cached : cached.data;
|
|
967
967
|
}
|
|
968
|
-
if (!forceRefresh
|
|
968
|
+
if (!forceRefresh) {
|
|
969
969
|
try {
|
|
970
970
|
const localCollection = await this.localCache.getCollection(collectionId);
|
|
971
971
|
if (localCollection) {
|
|
@@ -1040,7 +1040,7 @@ var ContentEngine = class {
|
|
|
1040
1040
|
return cached;
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
|
-
if (!forceRefresh
|
|
1043
|
+
if (!forceRefresh) {
|
|
1044
1044
|
try {
|
|
1045
1045
|
const localGlobals = await this.localCache.getGlobals();
|
|
1046
1046
|
if (localGlobals) {
|
|
@@ -1272,24 +1272,25 @@ var ContentEngine = class {
|
|
|
1272
1272
|
};
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
1275
|
-
if (
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1275
|
+
if (key.startsWith("page:")) {
|
|
1276
|
+
const slug = key.split(":")[1];
|
|
1277
|
+
try {
|
|
1278
|
+
const local = await this.localCache.getPage(slug);
|
|
1279
|
+
if (local && (process.env.NODE_ENV === "development" || !this.config.apiKey)) {
|
|
1280
|
+
return {
|
|
1281
|
+
data: local,
|
|
1282
|
+
metadata: {
|
|
1283
|
+
timestamp: Date.now(),
|
|
1284
|
+
expiresAt: Infinity,
|
|
1285
|
+
tags: [
|
|
1286
|
+
CacheTags.content(slug),
|
|
1287
|
+
CacheTags.project(this.config.projectId)
|
|
1288
|
+
],
|
|
1289
|
+
etag: void 0
|
|
1290
|
+
}
|
|
1291
|
+
};
|
|
1292
1292
|
}
|
|
1293
|
+
} catch {
|
|
1293
1294
|
}
|
|
1294
1295
|
}
|
|
1295
1296
|
return null;
|