@nexushub/client 0.0.6 → 0.0.7
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-2JRYABGG.cjs +117 -0
- package/dist/chunk-BPQMAYT3.js +110 -0
- package/dist/{tools/cli.js → cli.cjs} +12 -6
- package/dist/content/local-cache-client.cjs +56 -0
- package/dist/content/local-cache-client.d.cts +48 -0
- package/dist/content/local-cache-client.d.ts +48 -0
- package/dist/content/local-cache-client.js +54 -0
- package/dist/content/local-cache-server.cjs +10 -0
- package/dist/content/local-cache-server.d.cts +38 -0
- package/dist/content/local-cache-server.d.ts +38 -0
- package/dist/content/local-cache-server.js +1 -0
- package/dist/index.cjs +2008 -0
- package/dist/{src/index.d.mts → index.d.cts} +24 -23
- package/dist/{src/index.d.ts → index.d.ts} +24 -23
- package/dist/index.js +1984 -0
- package/package.json +16 -11
- package/dist/src/index.js +0 -7265
- package/dist/src/index.mjs +0 -7243
- package/dist/tools/cli.d.mts +0 -1
- package/dist/tools/cli.d.ts +0 -1
- package/dist/tools/cli.mjs +0 -639
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
export { LocalCache } from './content/local-cache-server.cjs';
|
|
3
4
|
|
|
4
5
|
interface MinimalNexusConfig {
|
|
5
6
|
apiUrl?: string;
|
|
@@ -261,10 +262,27 @@ declare class NexusClient {
|
|
|
261
262
|
declare const nexus: NexusClient;
|
|
262
263
|
declare const createNexusClient: (config: Partial<NexusConfig>) => NexusClient;
|
|
263
264
|
|
|
264
|
-
|
|
265
|
+
interface NexusProviderProps {
|
|
265
266
|
children: React.ReactNode;
|
|
267
|
+
/**
|
|
268
|
+
* Optional project ID override.
|
|
269
|
+
* If provided, this will override the environment variable NEXT_PUBLIC_NEXUS_ID.
|
|
270
|
+
*/
|
|
266
271
|
projectId?: string;
|
|
267
|
-
|
|
272
|
+
/**
|
|
273
|
+
* Optional configuration to disable analytics tracking (e.g., for GDPR compliance).
|
|
274
|
+
*/
|
|
275
|
+
disableAnalytics?: boolean;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* The God-Tier NexusHub Provider.
|
|
279
|
+
*
|
|
280
|
+
* 1. Orchestrates the Authentication state.
|
|
281
|
+
* 2. Manages the Analytics lifecycle.
|
|
282
|
+
* 3. Automates Page View tracking on route changes.
|
|
283
|
+
* 4. Provides the NexusClient singleton via Context.
|
|
284
|
+
*/
|
|
285
|
+
declare const NexusProvider: ({ children, projectId, disableAnalytics, }: NexusProviderProps) => react_jsx_runtime.JSX.Element;
|
|
268
286
|
|
|
269
287
|
interface SiteUser {
|
|
270
288
|
id: string;
|
|
@@ -317,14 +335,10 @@ declare const AuthProvider: ({ children, config }: {
|
|
|
317
335
|
declare const useNexusAuth: () => AuthContextType;
|
|
318
336
|
|
|
319
337
|
/**
|
|
320
|
-
* NexusHub
|
|
338
|
+
* NexusHub Shared Cache Implementations
|
|
321
339
|
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
* 2. Cache tagging for precise invalidation
|
|
325
|
-
* 3. LRU eviction policy
|
|
326
|
-
* 4. Cache statistics and monitoring
|
|
327
|
-
* 5. Development mode with filesystem cache
|
|
340
|
+
* Contains MemoryCache (LRU) and BrowserCache (LocalStorage)
|
|
341
|
+
* which are safe for universal usage.
|
|
328
342
|
*/
|
|
329
343
|
interface CacheOptions {
|
|
330
344
|
maxSize?: number;
|
|
@@ -367,19 +381,6 @@ declare class MemoryCache {
|
|
|
367
381
|
private calculateSize;
|
|
368
382
|
private updateHitRate;
|
|
369
383
|
}
|
|
370
|
-
declare class LocalCache {
|
|
371
|
-
private data;
|
|
372
|
-
private hasLoaded;
|
|
373
|
-
private cachePath;
|
|
374
|
-
constructor(customPath?: string);
|
|
375
|
-
isLoaded(): boolean;
|
|
376
|
-
private load;
|
|
377
|
-
getPage(slug: string): any;
|
|
378
|
-
getCollection(collectionId: string): any[] | null;
|
|
379
|
-
getGlobals(): any;
|
|
380
|
-
getAllData(): any;
|
|
381
|
-
private shouldWarnAboutMissingCache;
|
|
382
|
-
}
|
|
383
384
|
declare class BrowserCache {
|
|
384
385
|
private projectId;
|
|
385
386
|
private prefix;
|
|
@@ -398,4 +399,4 @@ declare class BrowserCache {
|
|
|
398
399
|
|
|
399
400
|
declare const VERSION = "0.0.1";
|
|
400
401
|
|
|
401
|
-
export { AnalyticsEngine, type AuthContextType, type AuthError, AuthProvider, type AuthState, BrowserCache, type CacheEntry, type CacheMetadata, CacheTags, type CollectionQuery, type CollectionResponse, ContentEngine, type ContentResponse, DEFAULT_ANALYTICS_URL, DEFAULT_API_URL, type ErrorResponse, LOCAL_NEST_URL, LOCAL_RUST_URL,
|
|
402
|
+
export { AnalyticsEngine, type AuthContextType, type AuthError, AuthProvider, type AuthState, BrowserCache, type CacheEntry, type CacheMetadata, CacheTags, type CollectionQuery, type CollectionResponse, ContentEngine, type ContentResponse, DEFAULT_ANALYTICS_URL, DEFAULT_API_URL, type ErrorResponse, LOCAL_NEST_URL, LOCAL_RUST_URL, type LoginCredentials, MemoryCache, type MinimalNexusConfig, NexusClient, type NexusConfig, NexusProvider, type RegisterCredentials, type SiteUser, VERSION, createNexusClient, getEnvConfig, getFullConfig, mergeConfigs, nexus, useNexusAuth, validateConfig };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
export { LocalCache } from './content/local-cache-server.js';
|
|
3
4
|
|
|
4
5
|
interface MinimalNexusConfig {
|
|
5
6
|
apiUrl?: string;
|
|
@@ -261,10 +262,27 @@ declare class NexusClient {
|
|
|
261
262
|
declare const nexus: NexusClient;
|
|
262
263
|
declare const createNexusClient: (config: Partial<NexusConfig>) => NexusClient;
|
|
263
264
|
|
|
264
|
-
|
|
265
|
+
interface NexusProviderProps {
|
|
265
266
|
children: React.ReactNode;
|
|
267
|
+
/**
|
|
268
|
+
* Optional project ID override.
|
|
269
|
+
* If provided, this will override the environment variable NEXT_PUBLIC_NEXUS_ID.
|
|
270
|
+
*/
|
|
266
271
|
projectId?: string;
|
|
267
|
-
|
|
272
|
+
/**
|
|
273
|
+
* Optional configuration to disable analytics tracking (e.g., for GDPR compliance).
|
|
274
|
+
*/
|
|
275
|
+
disableAnalytics?: boolean;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* The God-Tier NexusHub Provider.
|
|
279
|
+
*
|
|
280
|
+
* 1. Orchestrates the Authentication state.
|
|
281
|
+
* 2. Manages the Analytics lifecycle.
|
|
282
|
+
* 3. Automates Page View tracking on route changes.
|
|
283
|
+
* 4. Provides the NexusClient singleton via Context.
|
|
284
|
+
*/
|
|
285
|
+
declare const NexusProvider: ({ children, projectId, disableAnalytics, }: NexusProviderProps) => react_jsx_runtime.JSX.Element;
|
|
268
286
|
|
|
269
287
|
interface SiteUser {
|
|
270
288
|
id: string;
|
|
@@ -317,14 +335,10 @@ declare const AuthProvider: ({ children, config }: {
|
|
|
317
335
|
declare const useNexusAuth: () => AuthContextType;
|
|
318
336
|
|
|
319
337
|
/**
|
|
320
|
-
* NexusHub
|
|
338
|
+
* NexusHub Shared Cache Implementations
|
|
321
339
|
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
* 2. Cache tagging for precise invalidation
|
|
325
|
-
* 3. LRU eviction policy
|
|
326
|
-
* 4. Cache statistics and monitoring
|
|
327
|
-
* 5. Development mode with filesystem cache
|
|
340
|
+
* Contains MemoryCache (LRU) and BrowserCache (LocalStorage)
|
|
341
|
+
* which are safe for universal usage.
|
|
328
342
|
*/
|
|
329
343
|
interface CacheOptions {
|
|
330
344
|
maxSize?: number;
|
|
@@ -367,19 +381,6 @@ declare class MemoryCache {
|
|
|
367
381
|
private calculateSize;
|
|
368
382
|
private updateHitRate;
|
|
369
383
|
}
|
|
370
|
-
declare class LocalCache {
|
|
371
|
-
private data;
|
|
372
|
-
private hasLoaded;
|
|
373
|
-
private cachePath;
|
|
374
|
-
constructor(customPath?: string);
|
|
375
|
-
isLoaded(): boolean;
|
|
376
|
-
private load;
|
|
377
|
-
getPage(slug: string): any;
|
|
378
|
-
getCollection(collectionId: string): any[] | null;
|
|
379
|
-
getGlobals(): any;
|
|
380
|
-
getAllData(): any;
|
|
381
|
-
private shouldWarnAboutMissingCache;
|
|
382
|
-
}
|
|
383
384
|
declare class BrowserCache {
|
|
384
385
|
private projectId;
|
|
385
386
|
private prefix;
|
|
@@ -398,4 +399,4 @@ declare class BrowserCache {
|
|
|
398
399
|
|
|
399
400
|
declare const VERSION = "0.0.1";
|
|
400
401
|
|
|
401
|
-
export { AnalyticsEngine, type AuthContextType, type AuthError, AuthProvider, type AuthState, BrowserCache, type CacheEntry, type CacheMetadata, CacheTags, type CollectionQuery, type CollectionResponse, ContentEngine, type ContentResponse, DEFAULT_ANALYTICS_URL, DEFAULT_API_URL, type ErrorResponse, LOCAL_NEST_URL, LOCAL_RUST_URL,
|
|
402
|
+
export { AnalyticsEngine, type AuthContextType, type AuthError, AuthProvider, type AuthState, BrowserCache, type CacheEntry, type CacheMetadata, CacheTags, type CollectionQuery, type CollectionResponse, ContentEngine, type ContentResponse, DEFAULT_ANALYTICS_URL, DEFAULT_API_URL, type ErrorResponse, LOCAL_NEST_URL, LOCAL_RUST_URL, type LoginCredentials, MemoryCache, type MinimalNexusConfig, NexusClient, type NexusConfig, NexusProvider, type RegisterCredentials, type SiteUser, VERSION, createNexusClient, getEnvConfig, getFullConfig, mergeConfigs, nexus, useNexusAuth, validateConfig };
|