@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.
@@ -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
- declare const NexusProvider: ({ children, projectId }: {
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
- }) => react_jsx_runtime.JSX.Element;
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 Advanced Caching System
338
+ * NexusHub Shared Cache Implementations
321
339
  *
322
- * Features:
323
- * 1. Multi-layer caching (Memory > Local > Remote)
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, LocalCache, type LoginCredentials, MemoryCache, type MinimalNexusConfig, NexusClient, type NexusConfig, NexusProvider, type RegisterCredentials, type SiteUser, VERSION, createNexusClient, getEnvConfig, getFullConfig, mergeConfigs, nexus, useNexusAuth, validateConfig };
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
- declare const NexusProvider: ({ children, projectId }: {
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
- }) => react_jsx_runtime.JSX.Element;
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 Advanced Caching System
338
+ * NexusHub Shared Cache Implementations
321
339
  *
322
- * Features:
323
- * 1. Multi-layer caching (Memory > Local > Remote)
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, LocalCache, type LoginCredentials, MemoryCache, type MinimalNexusConfig, NexusClient, type NexusConfig, NexusProvider, type RegisterCredentials, type SiteUser, VERSION, createNexusClient, getEnvConfig, getFullConfig, mergeConfigs, nexus, useNexusAuth, validateConfig };
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 };