@elevasis/ui 1.28.0 → 1.28.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.
@@ -296,51 +296,9 @@ interface FetchEventSourceWithTokenRefreshOptions {
296
296
  onclose?: () => void;
297
297
  }
298
298
 
299
- interface SSEConnectionManagerOptions {
300
- /** Grace period in ms before closing idle connections. Defaults to 5000. */
301
- closeGracePeriodMs?: number;
302
- }
303
- /**
304
- * SSE Connection Manager
305
- *
306
- * Ensures only ONE SSE connection exists per endpoint, preventing duplicate
307
- * connections when components re-render or remount.
308
- *
309
- * Benefits:
310
- * - Prevents resource waste from duplicate connections
311
- * - Eliminates race conditions from overlapping connections
312
- * - Automatically manages connection lifecycle
313
- * - Shares single connection across multiple subscribers
314
- */
315
- declare class SSEConnectionManager {
316
- private connections;
317
- private closeGracePeriodMs;
318
- constructor(options?: SSEConnectionManagerOptions);
319
- /**
320
- * Subscribe to an SSE endpoint
321
- *
322
- * If a connection already exists for this endpoint, reuses it.
323
- * Otherwise, creates a new connection.
324
- *
325
- * @param key - Unique identifier for the connection (e.g., 'notifications', 'resource-executive-agent')
326
- * @param subscriberId - Unique identifier for this subscriber (usually component instance)
327
- * @param options - SSE connection options
328
- * @returns Unsubscribe function to call when component unmounts
329
- */
299
+ interface SSEConnectionManagerLike {
330
300
  subscribe(key: string, subscriberId: string, options: Omit<FetchEventSourceWithTokenRefreshOptions, 'signal'>): () => void;
331
- /**
332
- * Unsubscribe from an SSE endpoint
333
- *
334
- * If this is the last subscriber, closes the connection after grace period.
335
- */
336
- private unsubscribe;
337
- /**
338
- * Force close a connection and all its subscribers
339
- */
340
301
  closeConnection(key: string): void;
341
- /**
342
- * Get current connection status
343
- */
344
302
  getConnectionInfo(): Map<string, {
345
303
  url: string;
346
304
  subscribers: number;
@@ -377,7 +335,7 @@ interface ElevasisFeaturesProviderProps {
377
335
  features: FeatureModule[];
378
336
  timeRange?: TimeRange;
379
337
  operationsApiUrl?: string;
380
- operationsSSEManager?: SSEConnectionManager;
338
+ operationsSSEManager?: SSEConnectionManagerLike;
381
339
  children: ReactNode;
382
340
  }
383
341
  interface ElevasisFeaturesContextValue {
@@ -386,12 +344,13 @@ interface ElevasisFeaturesContextValue {
386
344
  allFeatures: FeatureModule[];
387
345
  timeRange?: TimeRange;
388
346
  operationsApiUrl?: string;
389
- operationsSSEManager?: SSEConnectionManager;
347
+ operationsSSEManager?: SSEConnectionManagerLike;
390
348
  isFeatureEnabled: (key: string) => boolean;
391
349
  getFeature: (key: string) => FeatureModule | undefined;
392
350
  }
393
351
 
394
352
  declare function useElevasisFeatures(): ElevasisFeaturesContextValue;
353
+ declare function useOptionalElevasisFeatures(): ElevasisFeaturesContextValue | null;
395
354
  declare function ElevasisFeaturesProvider({ features, timeRange, operationsApiUrl, operationsSSEManager, children }: ElevasisFeaturesProviderProps): react_jsx_runtime.JSX.Element;
396
355
 
397
356
  declare function FeatureShell({ children }: {
@@ -439,5 +398,5 @@ declare function useElevasisServices(): ElevasisServiceContextValue;
439
398
  */
440
399
  declare function ElevasisServiceProvider({ apiRequest, organizationId, isReady, children }: ElevasisServiceProviderProps): react_jsx_runtime.JSX.Element;
441
400
 
442
- export { AppearanceProvider, ElevasisCoreProvider, ElevasisFeaturesProvider, ElevasisServiceProvider, FeatureShell, NotificationProvider, useAppearance, useElevasisFeatures, useElevasisServices, useNotificationAdapter };
401
+ export { AppearanceProvider, ElevasisCoreProvider, ElevasisFeaturesProvider, ElevasisServiceProvider, FeatureShell, NotificationProvider, useAppearance, useElevasisFeatures, useElevasisServices, useNotificationAdapter, useOptionalElevasisFeatures };
443
402
  export type { ApiKeyConfig, AppearanceConfig, AuthConfig, AuthKitConfig, ElevasisCoreProviderProps, ElevasisCoreThemeConfig, ElevasisFeaturesContextValue, ElevasisFeaturesProviderProps, ElevasisServiceContextValue, ElevasisServiceProviderProps, ElevasisTokenOverrides, FeatureModule, FeatureNavEntry, FeatureNavLink, FeatureRegistry, FeatureSidebarComponent, NotificationAdapter, WithSchemes };
@@ -1,4 +1,4 @@
1
- export { ElevasisCoreProvider, ElevasisFeaturesProvider, FeatureShell, NotificationProvider, useElevasisFeatures, useNotificationAdapter } from '../chunk-KLG4H5NM.js';
1
+ export { ElevasisCoreProvider, ElevasisFeaturesProvider, FeatureShell, NotificationProvider, useElevasisFeatures, useNotificationAdapter, useOptionalElevasisFeatures } from '../chunk-45MS3IAW.js';
2
2
  import '../chunk-5COLSYBE.js';
3
3
  import '../chunk-NVOCKXUQ.js';
4
4
  import '../chunk-2IFYDILW.js';
@@ -32,6 +32,14 @@ interface SSEConnectionManagerOptions {
32
32
  /** Grace period in ms before closing idle connections. Defaults to 5000. */
33
33
  closeGracePeriodMs?: number;
34
34
  }
35
+ interface SSEConnectionManagerLike {
36
+ subscribe(key: string, subscriberId: string, options: Omit<FetchEventSourceWithTokenRefreshOptions, 'signal'>): () => void;
37
+ closeConnection(key: string): void;
38
+ getConnectionInfo(): Map<string, {
39
+ url: string;
40
+ subscribers: number;
41
+ }>;
42
+ }
35
43
  /**
36
44
  * SSE Connection Manager
37
45
  *
@@ -44,7 +52,7 @@ interface SSEConnectionManagerOptions {
44
52
  * - Automatically manages connection lifecycle
45
53
  * - Shares single connection across multiple subscribers
46
54
  */
47
- declare class SSEConnectionManager {
55
+ declare class SSEConnectionManager implements SSEConnectionManagerLike {
48
56
  private connections;
49
57
  private closeGracePeriodMs;
50
58
  constructor(options?: SSEConnectionManagerOptions);
@@ -80,4 +88,4 @@ declare class SSEConnectionManager {
80
88
  }
81
89
 
82
90
  export { SSEConnectionManager, fetchEventSourceWithTokenRefresh };
83
- export type { FetchEventSourceWithTokenRefreshOptions, SSEConnectionManagerOptions };
91
+ export type { FetchEventSourceWithTokenRefreshOptions, SSEConnectionManagerLike, SSEConnectionManagerOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/ui",
3
- "version": "1.28.0",
3
+ "version": "1.28.2",
4
4
  "description": "UI components and platform-aware hooks for building custom frontends on the Elevasis platform",
5
5
  "type": "module",
6
6
  "license": "MIT",