@optifye/dashboard-core 3.0.1 → 4.0.0

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/index.d.ts CHANGED
@@ -5,9 +5,10 @@ import * as React$1 from 'react';
5
5
  import React__default, { ReactNode, HTMLAttributes } from 'react';
6
6
  import * as querystring from 'querystring';
7
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
8
- import * as SelectPrimitive from '@radix-ui/react-select';
9
8
  import { Modifiers } from 'react-day-picker';
10
9
  import html2canvas from 'html2canvas';
10
+ import * as SelectPrimitive from '@radix-ui/react-select';
11
+ import { NextApiRequest, NextApiResponse } from 'next';
11
12
  import { ClassValue } from 'clsx';
12
13
 
13
14
  interface LineInfo {
@@ -922,36 +923,6 @@ interface VideoMetadata {
922
923
  type VideoType = 'bottleneck' | 'low_value' | 'best_cycle_time' | 'worst_cycle_time' | 'missing_quality_check';
923
924
  type VideoSeverity = 'low' | 'medium' | 'high';
924
925
 
925
- declare const DEFAULT_DATABASE_CONFIG: DatabaseConfig;
926
- declare const DEFAULT_ENTITY_CONFIG: EntityConfig;
927
- declare const DEFAULT_SHIFT_CONFIG: ShiftConfig;
928
- declare const DEFAULT_WORKSPACE_CONFIG: WorkspaceConfig;
929
- declare const DEFAULT_DATE_TIME_CONFIG: DateTimeConfig;
930
- declare const DEFAULT_ENDPOINTS_CONFIG: EndpointsConfig;
931
- declare const DEFAULT_THEME_CONFIG: ThemeConfig;
932
- declare const DEFAULT_ANALYTICS_CONFIG: AnalyticsConfig;
933
- declare const DEFAULT_AUTH_CONFIG: AuthConfig;
934
- declare const LINE_1_UUID = "910a224b-0abc-459a-babb-4c899824cfe7";
935
- declare const DEFAULT_CONFIG: Omit<DashboardConfig, 'supabaseUrl' | 'supabaseKey'>;
936
-
937
- /**
938
- * Standard action names used across the dashboard.
939
- * These represent common operations or activities tracked in the system.
940
- */
941
- declare const ACTION_NAMES: {
942
- /** Assembly operations */
943
- readonly ASSEMBLY: "Assembly";
944
- /** Packaging operations */
945
- readonly PACKAGING: "Packaging";
946
- /** Inspection operations */
947
- readonly INSPECTION: "Inspection";
948
- /** Testing operations */
949
- readonly TESTING: "Testing";
950
- /** Quality control operations */
951
- readonly QUALITY_CONTROL: "Quality Control";
952
- };
953
- type ActionName = typeof ACTION_NAMES[keyof typeof ACTION_NAMES];
954
-
955
926
  interface DashboardProviderProps {
956
927
  config: Partial<DashboardConfig>;
957
928
  children: React$1.ReactNode;
@@ -2186,6 +2157,36 @@ declare const authOTPService: {
2186
2157
  }>;
2187
2158
  };
2188
2159
 
2160
+ /**
2161
+ * Auth Rate Limiting Service
2162
+ * Provides rate limiting functionality for authentication operations
2163
+ */
2164
+ interface RateLimitResult$1 {
2165
+ allowed: boolean;
2166
+ retryAfter?: number;
2167
+ error?: string;
2168
+ }
2169
+ /**
2170
+ * Check if a given identifier (email) is rate limited
2171
+ * @param identifier - The identifier to check (typically an email)
2172
+ * @returns Object indicating if the request is allowed and retry time if not
2173
+ */
2174
+ declare function checkRateLimit$1(identifier: string): RateLimitResult$1;
2175
+ /**
2176
+ * Clear rate limit for a specific identifier
2177
+ * @param identifier - The identifier to clear
2178
+ */
2179
+ declare function clearRateLimit$1(identifier: string): void;
2180
+ /**
2181
+ * Clear all rate limits
2182
+ */
2183
+ declare function clearAllRateLimits$1(): void;
2184
+ declare const authRateLimitService: {
2185
+ checkRateLimit: typeof checkRateLimit$1;
2186
+ clearRateLimit: typeof clearRateLimit$1;
2187
+ clearAllRateLimits: typeof clearAllRateLimits$1;
2188
+ };
2189
+
2189
2190
  /**
2190
2191
  * Initializes Mixpanel with the provided token.
2191
2192
  * Should be called once from the application setup (e.g., within DashboardProvider)
@@ -2200,65 +2201,6 @@ declare const trackCoreEvent: (eventName: string, properties?: Record<string, an
2200
2201
  declare const identifyCoreUser: (userId: string, userProperties?: Record<string, any>) => void;
2201
2202
  declare const resetCoreMixpanel: () => void;
2202
2203
 
2203
- interface BottleneckVideo {
2204
- id: string;
2205
- src: string;
2206
- timestamp: string;
2207
- severity: 'low' | 'medium' | 'high';
2208
- description: string;
2209
- type: 'bottleneck' | 'low_value';
2210
- originalUri: string;
2211
- }
2212
- interface S3ServiceConfig {
2213
- region?: string;
2214
- bucketName: string;
2215
- signedUrlExpiresIn?: number;
2216
- accessKeyId?: string;
2217
- secretAccessKey?: string;
2218
- sessionToken?: string;
2219
- endpoint?: string;
2220
- useAccelerateEndpoint?: boolean;
2221
- customUserAgent?: string;
2222
- useSimulatedMode?: boolean;
2223
- publicBaseUrl?: string;
2224
- }
2225
- declare class S3Service {
2226
- private s3Client;
2227
- private bucketName;
2228
- private signedUrlExpiresIn;
2229
- private useSimulatedMode;
2230
- private publicBaseUrl;
2231
- constructor(config: S3ServiceConfig);
2232
- /**
2233
- * Check if service is in simulated mode
2234
- */
2235
- isSimulated(): boolean;
2236
- /**
2237
- * List S3 clips for a specific workspace and date
2238
- */
2239
- listS3Clips(workspaceId: string, date?: string): Promise<string[]>;
2240
- /**
2241
- * Generate mock S3 URIs for simulated mode
2242
- */
2243
- private generateMockS3Uris;
2244
- /**
2245
- * Generate a signed URL for an S3 URI
2246
- */
2247
- generateSignedS3Url(s3Uri: string): Promise<string | null>;
2248
- /**
2249
- * Parse simulated URI for demo mode
2250
- */
2251
- private parseSimulatedUri;
2252
- /**
2253
- * Parse S3 URI to extract information about the video
2254
- */
2255
- parseS3Uri(s3Uri: string): Omit<BottleneckVideo, 'id' | 'src'> | null;
2256
- /**
2257
- * Get all clips for a workspace on a specific date
2258
- */
2259
- getWorkspaceClips(workspaceId: string, date?: string): Promise<BottleneckVideo[]>;
2260
- }
2261
-
2262
2204
  /**
2263
2205
  * Helper object for making authenticated API requests using Supabase auth token.
2264
2206
  * Assumes endpoints are relative to the apiBaseUrl configured in DashboardConfig.
@@ -2541,6 +2483,31 @@ declare const videoPreloader: VideoPreloader;
2541
2483
  declare const preloadVideoUrl: (url: string | null | undefined) => void;
2542
2484
  declare const preloadVideosUrl: (urls: (string | null | undefined)[]) => void;
2543
2485
 
2486
+ interface RateLimitOptions {
2487
+ windowMs?: number;
2488
+ maxRequests?: number;
2489
+ }
2490
+ interface RateLimitResult {
2491
+ allowed: boolean;
2492
+ retryAfter?: number;
2493
+ }
2494
+ /**
2495
+ * Check if a request is allowed based on rate limiting
2496
+ * @param identifier - Unique identifier for the user (e.g., email, IP)
2497
+ * @param options - Rate limiting options
2498
+ * @returns Whether the request is allowed and retry time if not
2499
+ */
2500
+ declare function checkRateLimit(identifier: string, options?: RateLimitOptions): RateLimitResult;
2501
+ /**
2502
+ * Clear rate limit for a specific identifier
2503
+ * @param identifier - Unique identifier to clear
2504
+ */
2505
+ declare function clearRateLimit(identifier: string): void;
2506
+ /**
2507
+ * Clear all rate limits
2508
+ */
2509
+ declare function clearAllRateLimits(): void;
2510
+
2544
2511
  /**
2545
2512
  * S3 Video preloader utility for caching and efficiently loading videos from S3 with CloudFront integration
2546
2513
  */
@@ -2606,229 +2573,66 @@ declare const throttledReloadDashboard: () => void;
2606
2573
  */
2607
2574
  declare const formatIdleTime: (idleTimeInSeconds: number | null | undefined) => string;
2608
2575
 
2609
- interface OptifyeAgentContext {
2610
- timeframe?: string;
2611
- focus?: string;
2612
- [key: string]: any;
2613
- }
2614
- interface OptifyeAgentRequest {
2615
- prompt: string;
2616
- line_id: string;
2617
- shift_id: number;
2618
- company_id: string;
2619
- context?: OptifyeAgentContext;
2620
- }
2621
- interface OptifyeAgentResponse {
2622
- success: boolean;
2623
- analysis?: string;
2624
- timestamp?: string;
2625
- error?: string;
2626
- }
2627
- /**
2628
- * Client for integrating with Optifye Agent API
2629
- */
2630
- declare class OptifyeAgentClient {
2631
- private apiUrl;
2632
- constructor(apiUrl?: string);
2633
- /**
2634
- * Call Optifye Agent for manufacturing analysis
2635
- */
2636
- getManufacturingInsights(userQuestion: string, lineId: string, shiftId: number, companyId: string, context?: OptifyeAgentContext): Promise<OptifyeAgentResponse>;
2637
- /**
2638
- * Check if Optifye Agent API is healthy
2639
- */
2640
- checkHealth(): Promise<boolean>;
2641
- }
2642
- declare const optifyeAgentClient: OptifyeAgentClient;
2643
- /**
2644
- * Simple function to get manufacturing insights with better error handling
2645
- */
2646
- declare function getManufacturingInsights(userQuestion: string, lineId: string, shiftId: number, companyId: string, context?: OptifyeAgentContext): Promise<OptifyeAgentResponse>;
2576
+ declare function useSupabaseClient(): _supabase_supabase_js.SupabaseClient<any, "public", any>;
2647
2577
 
2648
2578
  declare const createSupabaseClient: (url: string, key: string) => _supabase_supabase_js.SupabaseClient<any, "public", any>;
2649
2579
  declare const getAnonClient: () => _supabase_supabase_js.SupabaseClient<any, "public", any>;
2650
2580
 
2651
- interface LoadingSpinnerProps {
2652
- size?: 'sm' | 'md' | 'lg';
2653
- message?: string;
2654
- className?: string;
2655
- }
2656
- declare const LoadingSpinner: React__default.FC<LoadingSpinnerProps>;
2657
-
2658
- declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
2659
-
2660
- declare const Select: React$1.FC<SelectPrimitive.SelectProps>;
2661
- declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
2662
- declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
2663
- declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<never>>;
2664
- declare const SelectScrollUpButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<never>>;
2665
- declare const SelectScrollDownButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<never>>;
2666
- declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<never>>;
2667
- declare const SelectLabel: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<never>>;
2668
- declare const SelectItem: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<never>>;
2669
- declare const SelectSeparator: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<never>>;
2670
-
2671
- declare const Card: (props: HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
2672
- declare const CardHeader: (props: HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
2673
- declare const CardTitle: (props: HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
2674
- declare const CardDescription: (props: HTMLAttributes<HTMLParagraphElement>) => react_jsx_runtime.JSX.Element;
2675
- declare const CardContent: (props: HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
2676
- declare const CardFooter: (props: HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
2581
+ declare const withAuth: <P extends object>(WrappedComponent: React$1.ComponentType<P>, options?: {
2582
+ redirectTo?: string;
2583
+ requireAuth?: boolean;
2584
+ }) => (props: P) => react_jsx_runtime.JSX.Element | null;
2677
2585
 
2678
- interface LoadingOverlayProps {
2679
- isVisible: boolean;
2680
- message?: string;
2681
- className?: string;
2586
+ interface LoginPageProps {
2587
+ onRateLimitCheck?: (email: string) => Promise<{
2588
+ allowed: boolean;
2589
+ error?: string;
2590
+ }>;
2591
+ logoSrc?: string;
2592
+ logoAlt?: string;
2593
+ brandName?: string;
2682
2594
  }
2683
- declare const LoadingOverlay: React__default.FC<LoadingOverlayProps>;
2595
+ declare const LoginPage: React__default.FC<LoginPageProps>;
2684
2596
 
2685
- interface LoadingPageProps {
2686
- message?: string;
2687
- subMessage?: string;
2688
- className?: string;
2597
+ interface AuthCallbackProps {
2598
+ redirectTo?: string;
2599
+ errorRedirect?: string;
2689
2600
  }
2690
- declare const LoadingPage: React__default.FC<LoadingPageProps>;
2601
+ declare const AuthCallback: React.FC<AuthCallbackProps>;
2691
2602
 
2692
- interface TimeDisplayProps {
2693
- className?: string;
2694
- variant?: 'default' | 'minimal';
2695
- }
2696
- declare const TimeDisplay: React__default.FC<TimeDisplayProps>;
2603
+ declare const DebugAuth: React__default.FC;
2697
2604
 
2698
- interface DateDisplayProps {
2699
- className?: string;
2700
- variant?: 'default' | 'minimal';
2605
+ interface BarChartDataItem {
2606
+ name: string;
2607
+ [key: string]: string | number | undefined;
2701
2608
  }
2702
- declare const DateDisplay: React__default.FC<DateDisplayProps>;
2703
-
2704
- interface MetricCardProps {
2705
- title: string;
2706
- value: number | string;
2707
- unit?: string;
2708
- trend?: number | null;
2609
+ interface BarProps {
2610
+ dataKey: string;
2611
+ name?: string;
2612
+ fill?: string;
2613
+ radius?: number | [number, number, number, number];
2614
+ labelList?: boolean | React__default.ReactElement | object;
2615
+ [key: string]: any;
2709
2616
  }
2710
- declare const MetricCard: React__default.FC<MetricCardProps>;
2711
-
2712
- interface DateTimeDisplayProps {
2617
+ interface BarChartProps {
2618
+ data: BarChartDataItem[];
2619
+ bars: BarProps[];
2620
+ xAxisDataKey?: string;
2621
+ xAxisLabel?: string;
2622
+ yAxisLabel?: string;
2623
+ yAxisUnit?: string;
2624
+ tooltipFormatter?: (value: any, name: any, props: any) => any;
2625
+ legendPayload?: any[];
2626
+ layout?: 'horizontal' | 'vertical';
2713
2627
  className?: string;
2714
- showDate?: boolean;
2715
- showTime?: boolean;
2628
+ showGrid?: boolean;
2629
+ showLegend?: boolean;
2630
+ showTooltip?: boolean;
2631
+ responsive?: boolean;
2632
+ aspect?: number;
2633
+ [key: string]: any;
2716
2634
  }
2717
- declare const DateTimeDisplay: React__default.FC<DateTimeDisplayProps>;
2718
-
2719
- declare const IconMap: {
2720
- readonly info: React$1.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
2721
- readonly warning: React$1.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
2722
- readonly success: React$1.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
2723
- readonly search: React$1.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
2724
- };
2725
- type IconKey = keyof typeof IconMap;
2726
- interface EmptyStateMessageProps {
2727
- iconType?: IconKey | React__default.ComponentType<LucideProps> | React__default.ReactNode;
2728
- title: string;
2729
- message?: string;
2730
- actionButton?: {
2731
- text: string;
2732
- onClick: () => void;
2733
- className?: string;
2734
- };
2735
- className?: string;
2736
- titleClassName?: string;
2737
- messageClassName?: string;
2738
- iconClassName?: string;
2739
- }
2740
- declare const EmptyStateMessage: React__default.FC<EmptyStateMessageProps>;
2741
-
2742
- interface WhatsAppShareButtonProps {
2743
- /** The message text to pre-fill. It will be URL-encoded. */
2744
- message: string;
2745
- /** Optional phone number to pre-fill. Should include country code without '+' or spaces. */
2746
- phoneNumber?: string;
2747
- /** Text for the button. Defaults to "Share on WhatsApp". */
2748
- buttonText?: string;
2749
- /** Additional classes for the button. */
2750
- className?: string;
2751
- /** Props for the icon, if you want to customize it or pass a custom icon node. */
2752
- iconProps?: React__default.ComponentProps<typeof Share2>;
2753
- /** Custom icon node to replace the default. */
2754
- customIcon?: React__default.ReactNode;
2755
- /** Aria-label for the button for accessibility. */
2756
- ariaLabel?: string;
2757
- }
2758
- declare const WhatsAppShareButton: React__default.FC<WhatsAppShareButtonProps>;
2759
-
2760
- interface BaseHistoryCalendarProps {
2761
- dailyData: Record<string, DaySummaryData>;
2762
- displayMonth: Date;
2763
- onMonthChange: (newMonth: Date) => void;
2764
- onDateSelect?: (date: string, shiftId?: string | number) => void;
2765
- renderDayCellContent: (params: {
2766
- date: Date;
2767
- daySummary?: DaySummaryData;
2768
- selectedShiftSummary?: ShiftSummaryData;
2769
- isToday: boolean;
2770
- isFuture: boolean;
2771
- isOutside: boolean;
2772
- modifiers: Modifiers;
2773
- }) => React__default.ReactElement | null;
2774
- getPerformanceColor?: (params: {
2775
- daySummary?: DaySummaryData;
2776
- selectedShiftSummary?: ShiftSummaryData;
2777
- date: Date;
2778
- isFuture: boolean;
2779
- isToday: boolean;
2780
- isOutside: boolean;
2781
- }) => string;
2782
- selectedShiftId?: string | number;
2783
- disableFutureDates?: boolean;
2784
- highlightToday?: boolean;
2785
- className?: string;
2786
- dayCellClassName?: string | ((date: Date, modifiers: Modifiers) => string);
2787
- }
2788
- declare const BaseHistoryCalendar: React__default.FC<BaseHistoryCalendarProps>;
2789
-
2790
- interface ShiftDisplayProps {
2791
- className?: string;
2792
- }
2793
- declare const ShiftDisplay: React__default.FC<ShiftDisplayProps>;
2794
-
2795
- /**
2796
- * ISTTimer composes TimeDisplay and ShiftDisplay from within @optifye/dashboard-core.
2797
- * Assumes DashboardProvider is configured with necessary dateTimeConfig and shiftConfig.
2798
- */
2799
- declare const ISTTimer: React__default.FC;
2800
-
2801
- interface BarChartDataItem {
2802
- name: string;
2803
- [key: string]: string | number | undefined;
2804
- }
2805
- interface BarProps {
2806
- dataKey: string;
2807
- name?: string;
2808
- fill?: string;
2809
- radius?: number | [number, number, number, number];
2810
- labelList?: boolean | React__default.ReactElement | object;
2811
- [key: string]: any;
2812
- }
2813
- interface BarChartProps {
2814
- data: BarChartDataItem[];
2815
- bars: BarProps[];
2816
- xAxisDataKey?: string;
2817
- xAxisLabel?: string;
2818
- yAxisLabel?: string;
2819
- yAxisUnit?: string;
2820
- tooltipFormatter?: (value: any, name: any, props: any) => any;
2821
- legendPayload?: any[];
2822
- layout?: 'horizontal' | 'vertical';
2823
- className?: string;
2824
- showGrid?: boolean;
2825
- showLegend?: boolean;
2826
- showTooltip?: boolean;
2827
- responsive?: boolean;
2828
- aspect?: number;
2829
- [key: string]: any;
2830
- }
2831
- declare const BarChart: React__default.FC<BarChartProps>;
2635
+ declare const BarChart: React__default.FC<BarChartProps>;
2832
2636
 
2833
2637
  interface LineChartDataItem {
2834
2638
  name: string;
@@ -2925,6 +2729,108 @@ interface SOPComplianceChartProps {
2925
2729
  }
2926
2730
  declare const SOPComplianceChart: React__default.FC<SOPComplianceChartProps>;
2927
2731
 
2732
+ type TrendDirection = 'up' | 'down' | 'neutral';
2733
+ interface MetricCardProps$1 {
2734
+ title: string;
2735
+ value: string | number;
2736
+ unit?: string;
2737
+ trend?: TrendDirection;
2738
+ trendText?: string;
2739
+ isLoading?: boolean;
2740
+ className?: string;
2741
+ onCardClick?: () => void;
2742
+ ariaLabel?: string;
2743
+ }
2744
+
2745
+ interface DateTimeDisplayProps {
2746
+ className?: string;
2747
+ showDate?: boolean;
2748
+ showTime?: boolean;
2749
+ }
2750
+ declare const DateTimeDisplay: React__default.FC<DateTimeDisplayProps>;
2751
+
2752
+ declare const IconMap: {
2753
+ readonly info: React$1.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
2754
+ readonly warning: React$1.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
2755
+ readonly success: React$1.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
2756
+ readonly search: React$1.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
2757
+ };
2758
+ type IconKey = keyof typeof IconMap;
2759
+ interface EmptyStateMessageProps {
2760
+ iconType?: IconKey | React__default.ComponentType<LucideProps> | React__default.ReactNode;
2761
+ title: string;
2762
+ message?: string;
2763
+ actionButton?: {
2764
+ text: string;
2765
+ onClick: () => void;
2766
+ className?: string;
2767
+ };
2768
+ className?: string;
2769
+ titleClassName?: string;
2770
+ messageClassName?: string;
2771
+ iconClassName?: string;
2772
+ }
2773
+ declare const EmptyStateMessage: React__default.FC<EmptyStateMessageProps>;
2774
+
2775
+ interface WhatsAppShareButtonProps {
2776
+ /** The message text to pre-fill. It will be URL-encoded. */
2777
+ message: string;
2778
+ /** Optional phone number to pre-fill. Should include country code without '+' or spaces. */
2779
+ phoneNumber?: string;
2780
+ /** Text for the button. Defaults to "Share on WhatsApp". */
2781
+ buttonText?: string;
2782
+ /** Additional classes for the button. */
2783
+ className?: string;
2784
+ /** Props for the icon, if you want to customize it or pass a custom icon node. */
2785
+ iconProps?: React__default.ComponentProps<typeof Share2>;
2786
+ /** Custom icon node to replace the default. */
2787
+ customIcon?: React__default.ReactNode;
2788
+ /** Aria-label for the button for accessibility. */
2789
+ ariaLabel?: string;
2790
+ }
2791
+ declare const WhatsAppShareButton: React__default.FC<WhatsAppShareButtonProps>;
2792
+
2793
+ interface BaseHistoryCalendarProps {
2794
+ dailyData: Record<string, DaySummaryData>;
2795
+ displayMonth: Date;
2796
+ onMonthChange: (newMonth: Date) => void;
2797
+ onDateSelect?: (date: string, shiftId?: string | number) => void;
2798
+ renderDayCellContent: (params: {
2799
+ date: Date;
2800
+ daySummary?: DaySummaryData;
2801
+ selectedShiftSummary?: ShiftSummaryData;
2802
+ isToday: boolean;
2803
+ isFuture: boolean;
2804
+ isOutside: boolean;
2805
+ modifiers: Modifiers;
2806
+ }) => React__default.ReactElement | null;
2807
+ getPerformanceColor?: (params: {
2808
+ daySummary?: DaySummaryData;
2809
+ selectedShiftSummary?: ShiftSummaryData;
2810
+ date: Date;
2811
+ isFuture: boolean;
2812
+ isToday: boolean;
2813
+ isOutside: boolean;
2814
+ }) => string;
2815
+ selectedShiftId?: string | number;
2816
+ disableFutureDates?: boolean;
2817
+ highlightToday?: boolean;
2818
+ className?: string;
2819
+ dayCellClassName?: string | ((date: Date, modifiers: Modifiers) => string);
2820
+ }
2821
+ declare const BaseHistoryCalendar: React__default.FC<BaseHistoryCalendarProps>;
2822
+
2823
+ interface ShiftDisplayProps {
2824
+ className?: string;
2825
+ }
2826
+ declare const ShiftDisplay: React__default.FC<ShiftDisplayProps>;
2827
+
2828
+ /**
2829
+ * ISTTimer composes TimeDisplay and ShiftDisplay from within @optifye/dashboard-core.
2830
+ * Assumes DashboardProvider is configured with necessary dateTimeConfig and shiftConfig.
2831
+ */
2832
+ declare const ISTTimer: React__default.FC;
2833
+
2928
2834
  interface LinePdfExportButtonProps {
2929
2835
  /** The DOM element or a selector string for the element to capture. */
2930
2836
  targetElement: HTMLElement | string;
@@ -3569,12 +3475,32 @@ interface NoWorkspaceDataProps {
3569
3475
  */
3570
3476
  declare const NoWorkspaceData: React__default.MemoExoticComponent<({ className }: NoWorkspaceDataProps) => react_jsx_runtime.JSX.Element>;
3571
3477
 
3478
+ interface WorkspaceMonthlyDataFetcherProps {
3479
+ /**
3480
+ * The ID of the workspace to fetch monthly data for
3481
+ */
3482
+ workspaceId: string;
3483
+ /**
3484
+ * The month to fetch data for (0-based, where 0 = January)
3485
+ */
3486
+ selectedMonth: number;
3487
+ /**
3488
+ * The year to fetch data for
3489
+ */
3490
+ selectedYear: number;
3491
+ /**
3492
+ * Callback function that receives the loaded data
3493
+ */
3494
+ onDataLoaded: (data: any[]) => void;
3495
+ /**
3496
+ * Callback function that receives the loading state
3497
+ */
3498
+ onLoadingChange: (isLoading: boolean) => void;
3499
+ }
3572
3500
  /**
3573
- * SideNavBar is a fixed implementation for the original src version,
3574
- * hardcoded with specific routes and icons.
3575
- * It does not use the navItems prop for backward compatibility.
3501
+ * A non-visual component that fetches monthly workspace data and passes it to its parent via callbacks.
3576
3502
  */
3577
- declare const SideNavBar: React__default.FC<SideNavBarProps>;
3503
+ declare const WorkspaceMonthlyDataFetcher: React__default.FC<WorkspaceMonthlyDataFetcherProps>;
3578
3504
 
3579
3505
  declare const PageHeader: React__default.FC<PageHeaderProps>;
3580
3506
 
@@ -3611,34 +3537,97 @@ interface HeaderProps {
3611
3537
  }
3612
3538
  declare const Header: React__default.FC<HeaderProps>;
3613
3539
 
3614
- declare const withAuth: <P extends object>(WrappedComponent: React$1.ComponentType<P>, options?: {
3615
- redirectTo?: string;
3616
- requireAuth?: boolean;
3617
- }) => (props: P) => react_jsx_runtime.JSX.Element | null;
3540
+ /**
3541
+ * SideNavBar is a fixed implementation for the original src version,
3542
+ * hardcoded with specific routes and icons.
3543
+ * It does not use the navItems prop for backward compatibility.
3544
+ */
3545
+ declare const SideNavBar: React__default.FC<SideNavBarProps>;
3618
3546
 
3619
- declare const DEFAULT_HLS_CONFIG: {
3620
- maxBufferLength: number;
3621
- maxMaxBufferLength: number;
3622
- maxBufferSize: number;
3623
- maxBufferHole: number;
3624
- lowLatencyMode: boolean;
3625
- enableWorker: boolean;
3626
- backBufferLength: number;
3627
- };
3628
- interface SingleVideoStreamProps {
3629
- /**
3630
- * Workspace ID for the stream
3631
- */
3632
- workspaceId: string;
3633
- /**
3634
- * Workspace name used to determine the camera number
3635
- */
3636
- workspaceName: string;
3637
- /**
3638
- * Optional direct stream URL. If not provided, will be generated based on workspaceName and baseUrl
3639
- */
3640
- streamUrl?: string;
3641
- /**
3547
+ interface LoadingSpinnerProps {
3548
+ size?: 'sm' | 'md' | 'lg';
3549
+ message?: string;
3550
+ className?: string;
3551
+ }
3552
+ declare const LoadingSpinner: React__default.FC<LoadingSpinnerProps>;
3553
+
3554
+ declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
3555
+
3556
+ declare const Select: React$1.FC<SelectPrimitive.SelectProps>;
3557
+ declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
3558
+ declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
3559
+ declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<never>>;
3560
+ declare const SelectScrollUpButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<never>>;
3561
+ declare const SelectScrollDownButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<never>>;
3562
+ declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<never>>;
3563
+ declare const SelectLabel: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<never>>;
3564
+ declare const SelectItem: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<never>>;
3565
+ declare const SelectSeparator: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<never>>;
3566
+
3567
+ declare const Card: (props: HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
3568
+ declare const CardHeader: (props: HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
3569
+ declare const CardTitle: (props: HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
3570
+ declare const CardDescription: (props: HTMLAttributes<HTMLParagraphElement>) => react_jsx_runtime.JSX.Element;
3571
+ declare const CardContent: (props: HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
3572
+ declare const CardFooter: (props: HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
3573
+
3574
+ interface LoadingOverlayProps {
3575
+ isVisible: boolean;
3576
+ message?: string;
3577
+ className?: string;
3578
+ }
3579
+ declare const LoadingOverlay: React__default.FC<LoadingOverlayProps>;
3580
+
3581
+ interface LoadingPageProps {
3582
+ message?: string;
3583
+ subMessage?: string;
3584
+ className?: string;
3585
+ }
3586
+ declare const LoadingPage: React__default.FC<LoadingPageProps>;
3587
+
3588
+ interface TimeDisplayProps {
3589
+ className?: string;
3590
+ variant?: 'default' | 'minimal';
3591
+ }
3592
+ declare const TimeDisplay: React__default.FC<TimeDisplayProps>;
3593
+
3594
+ interface DateDisplayProps {
3595
+ className?: string;
3596
+ variant?: 'default' | 'minimal';
3597
+ }
3598
+ declare const DateDisplay: React__default.FC<DateDisplayProps>;
3599
+
3600
+ interface MetricCardProps {
3601
+ title: string;
3602
+ value: number | string;
3603
+ unit?: string;
3604
+ trend?: number | null;
3605
+ }
3606
+ declare const MetricCard: React__default.FC<MetricCardProps>;
3607
+
3608
+ declare const DEFAULT_HLS_CONFIG: {
3609
+ maxBufferLength: number;
3610
+ maxMaxBufferLength: number;
3611
+ maxBufferSize: number;
3612
+ maxBufferHole: number;
3613
+ lowLatencyMode: boolean;
3614
+ enableWorker: boolean;
3615
+ backBufferLength: number;
3616
+ };
3617
+ interface SingleVideoStreamProps {
3618
+ /**
3619
+ * Workspace ID for the stream
3620
+ */
3621
+ workspaceId: string;
3622
+ /**
3623
+ * Workspace name used to determine the camera number
3624
+ */
3625
+ workspaceName: string;
3626
+ /**
3627
+ * Optional direct stream URL. If not provided, will be generated based on workspaceName and baseUrl
3628
+ */
3629
+ streamUrl?: string;
3630
+ /**
3642
3631
  * Base URL for HLS streams. Default is 'https://172.20.135.100:8443/'
3643
3632
  */
3644
3633
  baseUrl?: string;
@@ -3680,53 +3669,35 @@ declare const getDefaultCameraStreamUrl: (workspaceName: string, baseUrl: string
3680
3669
  */
3681
3670
  declare const SingleVideoStream: React__default.FC<SingleVideoStreamProps>;
3682
3671
 
3683
- interface WorkspaceMonthlyDataFetcherProps {
3684
- /**
3685
- * The ID of the workspace to fetch monthly data for
3686
- */
3687
- workspaceId: string;
3688
- /**
3689
- * The month to fetch data for (0-based, where 0 = January)
3690
- */
3691
- selectedMonth: number;
3692
- /**
3693
- * The year to fetch data for
3694
- */
3695
- selectedYear: number;
3672
+ declare const AIAgentView: React__default.FC;
3673
+
3674
+ interface AuthCallbackViewProps {
3696
3675
  /**
3697
- * Callback function that receives the loaded data
3676
+ * Where to redirect after successful authentication
3698
3677
  */
3699
- onDataLoaded: (data: any[]) => void;
3678
+ redirectTo?: string;
3700
3679
  /**
3701
- * Callback function that receives the loading state
3680
+ * Where to redirect on error
3702
3681
  */
3703
- onLoadingChange: (isLoading: boolean) => void;
3682
+ errorRedirect?: string;
3704
3683
  }
3705
3684
  /**
3706
- * A non-visual component that fetches monthly workspace data and passes it to its parent via callbacks.
3685
+ * AuthCallbackView component - Handles OAuth callback redirects
3686
+ * This view wraps the AuthCallback component and follows the same pattern as other views
3707
3687
  */
3708
- declare const WorkspaceMonthlyDataFetcher: React__default.FC<WorkspaceMonthlyDataFetcherProps>;
3688
+ declare function AuthCallbackView({ redirectTo, errorRedirect }: AuthCallbackViewProps): React__default.ReactNode;
3709
3689
 
3710
- type CoreComponents = {
3711
- Card: any;
3712
- CardHeader: any;
3713
- CardTitle: any;
3714
- CardDescription: any;
3715
- CardContent: any;
3716
- CardFooter: any;
3717
- Button: any;
3718
- HourlyOutputChart: any;
3719
- };
3720
- declare const useRegistry: () => CoreComponents;
3721
- interface RegistryProviderProps {
3722
- children: ReactNode;
3723
- components?: Partial<CoreComponents>;
3724
- }
3725
- declare function RegistryProvider({ children, components }: RegistryProviderProps): react_jsx_runtime.JSX.Element;
3726
- declare function withRegistry<P extends object>(Component: React__default.ComponentType<P>): {
3727
- (props: P): react_jsx_runtime.JSX.Element;
3728
- displayName: string;
3729
- };
3690
+ /**
3691
+ * DebugAuthView component - Debug page for authentication setup
3692
+ * This view wraps the DebugAuth component and follows the same pattern as other views
3693
+ */
3694
+ declare function DebugAuthView(): React__default.ReactNode;
3695
+
3696
+ /**
3697
+ * FactoryView Component - Displays factory-level overview with metrics for each production line
3698
+ */
3699
+ declare const FactoryView: React__default.FC<FactoryViewProps>;
3700
+ declare const AuthenticatedFactoryView: (props: FactoryViewProps) => react_jsx_runtime.JSX.Element | null;
3730
3701
 
3731
3702
  interface HomeViewProps {
3732
3703
  /**
@@ -3767,57 +3738,6 @@ interface HomeViewProps {
3767
3738
  declare function HomeView({ defaultLineId, factoryViewId, line1Uuid, line2Uuid, lineNames, videoSources, factoryName }: HomeViewProps): React__default.ReactNode;
3768
3739
  declare const AuthenticatedHomeView: (props: HomeViewProps) => react_jsx_runtime.JSX.Element | null;
3769
3740
 
3770
- /**
3771
- * FactoryView Component - Displays factory-level overview with metrics for each production line
3772
- */
3773
- declare const FactoryView: React__default.FC<FactoryViewProps>;
3774
- declare const AuthenticatedFactoryView: (props: FactoryViewProps) => react_jsx_runtime.JSX.Element | null;
3775
-
3776
- /**
3777
- * LeaderboardIndexView component for displaying a list of lines that can be selected for the leaderboard
3778
- */
3779
- declare const LeaderboardIndexView: React__default.FC<LeaderboardIndexViewProps>;
3780
-
3781
- /**
3782
- * LeaderboardDetailView component for displaying a detailed leaderboard for a specific line
3783
- */
3784
- declare const LeaderboardDetailView: React__default.FC<LeaderboardDetailViewProps>;
3785
-
3786
- interface TargetsViewProps {
3787
- /** Line UUIDs to display and configure in the view */
3788
- lineIds: string[];
3789
- /** Line display names mapping (lineId to display name) */
3790
- lineNames: Record<string, string>;
3791
- /** Company UUID for fetching actions */
3792
- companyId: string;
3793
- /** Optional router instance for navigation */
3794
- router?: {
3795
- push: (path: string) => void;
3796
- };
3797
- /** Optional user ID for tracking who made changes */
3798
- userId?: string;
3799
- /** Callback when changes are saved */
3800
- onSaveChanges?: (lineId: string) => void;
3801
- }
3802
-
3803
- /**
3804
- * TargetsView component for managing production targets
3805
- *
3806
- * This component allows for configuring:
3807
- * - Production targets (PPH, cycle time, day output)
3808
- * - Action types per workspace
3809
- * - Product codes
3810
- * - Supports both day and night shifts
3811
- */
3812
- declare const TargetsView: React__default.FC<TargetsViewProps>;
3813
-
3814
- declare const AuthenticatedTargetsView: (props: TargetsViewProps) => react_jsx_runtime.JSX.Element | null;
3815
-
3816
- /**
3817
- * ShiftsView component for managing day and night shift configurations
3818
- */
3819
- declare const ShiftsView: React__default.FC<ShiftsViewProps>;
3820
-
3821
3741
  interface KPIDetailViewProps {
3822
3742
  /**
3823
3743
  * The ID of the line to display details for
@@ -3879,6 +3799,82 @@ interface KPIDetailViewProps {
3879
3799
  */
3880
3800
  declare const KPIDetailView: React__default.FC<KPIDetailViewProps>;
3881
3801
 
3802
+ /**
3803
+ * LeaderboardDetailView component for displaying a detailed leaderboard for a specific line
3804
+ */
3805
+ declare const LeaderboardDetailView: React__default.FC<LeaderboardDetailViewProps>;
3806
+
3807
+ /**
3808
+ * LeaderboardIndexView component for displaying a list of lines that can be selected for the leaderboard
3809
+ */
3810
+ declare const LeaderboardIndexView: React__default.FC<LeaderboardIndexViewProps>;
3811
+
3812
+ interface LoginViewProps {
3813
+ /**
3814
+ * Optional logo source URL
3815
+ */
3816
+ logoSrc?: string;
3817
+ /**
3818
+ * Optional logo alt text
3819
+ */
3820
+ logoAlt?: string;
3821
+ /**
3822
+ * Optional brand name to display
3823
+ */
3824
+ brandName?: string;
3825
+ /**
3826
+ * Optional rate limit handler
3827
+ * @param email - The email to check
3828
+ * @returns Promise with allowed status and optional error message
3829
+ */
3830
+ onRateLimitCheck?: (email: string) => Promise<{
3831
+ allowed: boolean;
3832
+ error?: string;
3833
+ }>;
3834
+ }
3835
+ /**
3836
+ * LoginView component - Authentication page for the dashboard
3837
+ * This view wraps the LoginPage component and follows the same pattern as other views
3838
+ */
3839
+ declare function LoginView({ logoSrc, logoAlt, brandName, onRateLimitCheck }: LoginViewProps): React__default.ReactNode;
3840
+
3841
+ declare const ProfileView: React__default.FC;
3842
+
3843
+ /**
3844
+ * ShiftsView component for managing day and night shift configurations
3845
+ */
3846
+ declare const ShiftsView: React__default.FC<ShiftsViewProps>;
3847
+
3848
+ interface TargetsViewProps {
3849
+ /** Line UUIDs to display and configure in the view */
3850
+ lineIds: string[];
3851
+ /** Line display names mapping (lineId to display name) */
3852
+ lineNames: Record<string, string>;
3853
+ /** Company UUID for fetching actions */
3854
+ companyId: string;
3855
+ /** Optional router instance for navigation */
3856
+ router?: {
3857
+ push: (path: string) => void;
3858
+ };
3859
+ /** Optional user ID for tracking who made changes */
3860
+ userId?: string;
3861
+ /** Callback when changes are saved */
3862
+ onSaveChanges?: (lineId: string) => void;
3863
+ }
3864
+
3865
+ /**
3866
+ * TargetsView component for managing production targets
3867
+ *
3868
+ * This component allows for configuring:
3869
+ * - Production targets (PPH, cycle time, day output)
3870
+ * - Action types per workspace
3871
+ * - Product codes
3872
+ * - Supports both day and night shifts
3873
+ */
3874
+ declare const TargetsView: React__default.FC<TargetsViewProps>;
3875
+
3876
+ declare const AuthenticatedTargetsView: (props: TargetsViewProps) => react_jsx_runtime.JSX.Element | null;
3877
+
3882
3878
  type TabType = 'overview' | 'monthly_history' | 'bottlenecks';
3883
3879
  type NavigationHandler = (url: string) => void;
3884
3880
  interface WorkspaceDetailViewProps {
@@ -3950,8 +3946,194 @@ interface WorkspaceDetailViewProps {
3950
3946
  }
3951
3947
  declare const WrappedComponent: (props: WorkspaceDetailViewProps) => react_jsx_runtime.JSX.Element | null;
3952
3948
 
3953
- declare const AIAgentView: React__default.FC;
3949
+ type CoreComponents = {
3950
+ Card: any;
3951
+ CardHeader: any;
3952
+ CardTitle: any;
3953
+ CardDescription: any;
3954
+ CardContent: any;
3955
+ CardFooter: any;
3956
+ Button: any;
3957
+ HourlyOutputChart: any;
3958
+ };
3959
+ declare const useRegistry: () => CoreComponents;
3960
+ interface RegistryProviderProps {
3961
+ children: ReactNode;
3962
+ components?: Partial<CoreComponents>;
3963
+ }
3964
+ declare function RegistryProvider({ children, components }: RegistryProviderProps): react_jsx_runtime.JSX.Element;
3965
+ declare function withRegistry<P extends object>(Component: React__default.ComponentType<P>): {
3966
+ (props: P): react_jsx_runtime.JSX.Element;
3967
+ displayName: string;
3968
+ };
3954
3969
 
3955
- declare const ProfileView: React__default.FC;
3970
+ declare const DEFAULT_DATABASE_CONFIG: DatabaseConfig;
3971
+ declare const DEFAULT_ENTITY_CONFIG: EntityConfig;
3972
+ declare const DEFAULT_SHIFT_CONFIG: ShiftConfig;
3973
+ declare const DEFAULT_WORKSPACE_CONFIG: WorkspaceConfig;
3974
+ declare const DEFAULT_DATE_TIME_CONFIG: DateTimeConfig;
3975
+ declare const DEFAULT_ENDPOINTS_CONFIG: EndpointsConfig;
3976
+ declare const DEFAULT_THEME_CONFIG: ThemeConfig;
3977
+ declare const DEFAULT_ANALYTICS_CONFIG: AnalyticsConfig;
3978
+ declare const DEFAULT_AUTH_CONFIG: AuthConfig;
3979
+ declare const LINE_1_UUID = "910a224b-0abc-459a-babb-4c899824cfe7";
3980
+ declare const DEFAULT_CONFIG: Omit<DashboardConfig, 'supabaseUrl' | 'supabaseKey'>;
3981
+
3982
+ /**
3983
+ * Standard action names used across the dashboard.
3984
+ * These represent common operations or activities tracked in the system.
3985
+ */
3986
+ declare const ACTION_NAMES: {
3987
+ /** Assembly operations */
3988
+ readonly ASSEMBLY: "Assembly";
3989
+ /** Packaging operations */
3990
+ readonly PACKAGING: "Packaging";
3991
+ /** Inspection operations */
3992
+ readonly INSPECTION: "Inspection";
3993
+ /** Testing operations */
3994
+ readonly TESTING: "Testing";
3995
+ /** Quality control operations */
3996
+ readonly QUALITY_CONTROL: "Quality Control";
3997
+ };
3998
+ type ActionName = typeof ACTION_NAMES[keyof typeof ACTION_NAMES];
3999
+
4000
+ interface BottleneckVideo {
4001
+ id: string;
4002
+ src: string;
4003
+ timestamp: string;
4004
+ severity: 'low' | 'medium' | 'high';
4005
+ description: string;
4006
+ type: 'bottleneck' | 'low_value';
4007
+ originalUri: string;
4008
+ }
4009
+ interface S3ServiceConfig {
4010
+ region?: string;
4011
+ bucketName: string;
4012
+ signedUrlExpiresIn?: number;
4013
+ accessKeyId?: string;
4014
+ secretAccessKey?: string;
4015
+ sessionToken?: string;
4016
+ endpoint?: string;
4017
+ useAccelerateEndpoint?: boolean;
4018
+ customUserAgent?: string;
4019
+ useSimulatedMode?: boolean;
4020
+ publicBaseUrl?: string;
4021
+ }
4022
+ declare class S3Service {
4023
+ private s3Client;
4024
+ private bucketName;
4025
+ private signedUrlExpiresIn;
4026
+ private useSimulatedMode;
4027
+ private publicBaseUrl;
4028
+ constructor(config: S3ServiceConfig);
4029
+ /**
4030
+ * Check if service is in simulated mode
4031
+ */
4032
+ isSimulated(): boolean;
4033
+ /**
4034
+ * List S3 clips for a specific workspace and date
4035
+ */
4036
+ listS3Clips(workspaceId: string, date?: string): Promise<string[]>;
4037
+ /**
4038
+ * Generate mock S3 URIs for simulated mode
4039
+ */
4040
+ private generateMockS3Uris;
4041
+ /**
4042
+ * Generate a signed URL for an S3 URI
4043
+ */
4044
+ generateSignedS3Url(s3Uri: string): Promise<string | null>;
4045
+ /**
4046
+ * Parse simulated URI for demo mode
4047
+ */
4048
+ private parseSimulatedUri;
4049
+ /**
4050
+ * Parse S3 URI to extract information about the video
4051
+ */
4052
+ parseS3Uri(s3Uri: string): Omit<BottleneckVideo, 'id' | 'src'> | null;
4053
+ /**
4054
+ * Get all clips for a workspace on a specific date
4055
+ */
4056
+ getWorkspaceClips(workspaceId: string, date?: string): Promise<BottleneckVideo[]>;
4057
+ }
4058
+
4059
+ interface OptifyeAgentContext {
4060
+ timeframe?: string;
4061
+ focus?: string;
4062
+ [key: string]: any;
4063
+ }
4064
+ interface OptifyeAgentRequest {
4065
+ prompt: string;
4066
+ line_id: string;
4067
+ shift_id: number;
4068
+ company_id: string;
4069
+ context?: OptifyeAgentContext;
4070
+ }
4071
+ interface OptifyeAgentResponse {
4072
+ success: boolean;
4073
+ analysis?: string;
4074
+ timestamp?: string;
4075
+ error?: string;
4076
+ }
4077
+ /**
4078
+ * Client for integrating with Optifye Agent API
4079
+ */
4080
+ declare class OptifyeAgentClient {
4081
+ private apiUrl;
4082
+ constructor(apiUrl?: string);
4083
+ /**
4084
+ * Call Optifye Agent for manufacturing analysis
4085
+ */
4086
+ getManufacturingInsights(userQuestion: string, lineId: string, shiftId: number, companyId: string, context?: OptifyeAgentContext): Promise<OptifyeAgentResponse>;
4087
+ /**
4088
+ * Check if Optifye Agent API is healthy
4089
+ */
4090
+ checkHealth(): Promise<boolean>;
4091
+ }
4092
+ declare const optifyeAgentClient: OptifyeAgentClient;
4093
+ /**
4094
+ * Simple function to get manufacturing insights with better error handling
4095
+ */
4096
+ declare function getManufacturingInsights(userQuestion: string, lineId: string, shiftId: number, companyId: string, context?: OptifyeAgentContext): Promise<OptifyeAgentResponse>;
4097
+
4098
+ /**
4099
+ * Streaming proxy configuration
4100
+ */
4101
+ interface StreamProxyConfig {
4102
+ cloudFrontDomain?: string;
4103
+ }
4104
+ /**
4105
+ * Creates a streaming proxy handler for CloudFront HLS videos
4106
+ * This is required for local development to bypass CORS restrictions
4107
+ *
4108
+ * @param config - Optional configuration for the proxy
4109
+ * @returns Next.js API handler function
4110
+ *
4111
+ * @example
4112
+ * // In your Next.js API route (e.g., pages/api/stream/[...path].ts):
4113
+ * import { createStreamProxyHandler } from '@optifye/dashboard-core';
4114
+ *
4115
+ * export default createStreamProxyHandler();
4116
+ *
4117
+ * export const config = {
4118
+ * api: {
4119
+ * bodyParser: false,
4120
+ * responseLimit: false,
4121
+ * },
4122
+ * };
4123
+ */
4124
+ declare function createStreamProxyHandler(config?: StreamProxyConfig): (req: NextApiRequest, res: NextApiResponse) => Promise<void>;
4125
+ /**
4126
+ * Next.js API configuration for streaming endpoints
4127
+ * Export this from your API route file
4128
+ *
4129
+ * @example
4130
+ * export { streamProxyConfig as config } from '@optifye/dashboard-core';
4131
+ */
4132
+ declare const streamProxyConfig: {
4133
+ api: {
4134
+ bodyParser: boolean;
4135
+ responseLimit: boolean;
4136
+ };
4137
+ };
3956
4138
 
3957
- export { ACTION_NAMES, AIAgentView, type Action, type ActionName, type ActionService, type ActionThreshold, type AnalyticsConfig, type AuthConfig, AuthProvider, type AuthUser, AuthenticatedFactoryView, AuthenticatedHomeView, AuthenticatedTargetsView, BarChart, type BarChartDataItem, type BarChartProps, type BarProps, BaseHistoryCalendar, type BaseLineMetric, type BasePerformanceMetric, type BottleneckFilterType, type BottleneckVideo, type BottleneckVideoData, BottlenecksContent, type BottlenecksContentProps, type BreadcrumbItem, type Break, type BreakRowProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ClipCounts, type ComponentOverride, type CoreComponents, type CurrentShiftResult, CycleTimeChart, type CycleTimeChartProps, CycleTimeOverTimeChart, type CycleTimeOverTimeChartProps, DEFAULT_ANALYTICS_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CONFIG, DEFAULT_DATABASE_CONFIG, DEFAULT_DATE_TIME_CONFIG, DEFAULT_ENDPOINTS_CONFIG, DEFAULT_ENTITY_CONFIG, DEFAULT_SHIFT_CONFIG, DEFAULT_THEME_CONFIG, DEFAULT_WORKSPACE_CONFIG, DEFAULT_WORKSPACE_POSITIONS, type DashboardConfig, DashboardHeader, type DashboardKPIs, DashboardLayout, type DashboardLayoutProps, DashboardOverridesProvider, DashboardProvider, type DashboardService, type DatabaseConfig, DateDisplay, type DateTimeConfig, DateTimeDisplay, type DayHistoryData, type DaySummaryData, EmptyStateMessage, type EndpointsConfig, type EntityConfig, type FactoryOverviewData, FactoryView, type FactoryViewProps, type FormatNumberOptions, GridComponentsPlaceholder, Header, type HeaderProps, type HistoryCalendarProps, HomeView, type HomeViewProps, type HookOverride, HourlyOutputChart, type HourlyOutputChartProps, type HourlyPerformance, type ISTDateProps, ISTTimer, type ISTTimerProps, KPICard, type KPICardProps, KPIDetailView, KPIGrid, type KPIGridProps, KPIHeader, type KPIHeaderProps, KPISection, type KPITrend, LINE_1_UUID, LargeOutputProgressChart, type LargeOutputProgressChartProps, LeaderboardDetailView, type LeaderboardDetailViewProps, type LeaderboardEntry, LeaderboardIndexView, type LeaderboardIndexViewProps, type LeaderboardLineOption, Legend, LineChart, type LineChartDataItem, type LineChartProps, type LineDetails, type LineDisplayData, LineHistoryCalendar, type LineHistoryCalendarProps, type LineInfo, type LineMetrics, LineMonthlyHistory, type LineMonthlyHistoryProps, type LineMonthlyMetric, LineMonthlyPdfGenerator, type LineMonthlyPdfGeneratorProps, type LineNavigationParams, LinePdfExportButton, type LinePdfExportButtonProps, LinePdfGenerator, type LinePdfGeneratorProps, type LineProps, type LineShiftConfig, type LineSnapshot, type LineThreshold, LineWhatsAppShareButton, type LineWhatsAppShareProps, LiveTimer, LoadingOverlay, LoadingPage, LoadingSpinner, MainLayout, type MainLayoutProps, type Metric, MetricCard, type MetricsError, type NavItem, type NavItemTrackingEvent, NoWorkspaceData, type OperatorData, type OperatorInfo, OptifyeAgentClient, type OptifyeAgentContext, type OptifyeAgentRequest, type OptifyeAgentResponse, OutputProgressChart, type OutputProgressChartProps, type OverridesMap, type OverviewLineMetric, type OverviewWorkspaceMetric, PageHeader, type PageHeaderProps, type PageOverride, type PoorPerformingWorkspace, type ProfileMenuItem, ProfileView, type QualityMetric, type QualityOverview, type QualityService, type RealtimeService, RegistryProvider, type RoutePath, type S3ClipsAPIParams, type S3Config, type S3ListObjectsParams, S3Service, type S3ServiceConfig, SOPComplianceChart, type SOPComplianceChartProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type ShiftConfig, type ShiftConfiguration, type ShiftConfigurationRecord, type ShiftData$2 as ShiftData, ShiftDisplay, type ShiftHistoryData, type ShiftHoursMap, type ShiftPanelProps, type ShiftSummaryData, type ShiftTime, ShiftsView, type ShiftsViewProps, SideNavBar, type SideNavBarProps, type SimpleLine, SingleVideoStream, type SingleVideoStreamProps, Skeleton, type SupabaseClient, SupabaseProvider, type Target, TargetWorkspaceGrid, type TargetWorkspaceGridProps, TargetsView, type ThemeColorValue, type ThemeConfig, TimeDisplay, type TrackingEventProperties, type UnderperformingWorkspace, type UnderperformingWorkspaces, type UseDashboardMetricsProps, type UseFactoryOverviewOptions, type UseFormatNumberResult, type UseRealtimeLineMetricsProps, type UseTargetsOptions, type UseWorkspaceOperatorsOptions, type UserProfileConfig, VideoCard, VideoGridView, type VideoMetadata, VideoPreloader, type VideoSeverity, type VideoSummary, type VideoType, WORKSPACE_POSITIONS, type WhatsAppSendResult, WhatsAppShareButton, type WhatsappService, type Workspace, type WorkspaceActionUpdate, WorkspaceCard, type WorkspaceCardProps, type WorkspaceConfig, WrappedComponent as WorkspaceDetailView, type WorkspaceDetailedMetrics, WorkspaceGrid, WorkspaceGridItem, type WorkspaceGridItemProps, WorkspaceHistoryCalendar, WorkspaceMetricCards, type WorkspaceMetricCardsProps, type WorkspaceMetrics, WorkspaceMonthlyDataFetcher, type WorkspaceMonthlyDataFetcherProps, type WorkspaceMonthlyMetric, WorkspaceMonthlyPdfGenerator, type WorkspaceMonthlyPdfGeneratorProps, type WorkspaceNavigationParams, WorkspacePdfExportButton, type WorkspacePdfExportButtonProps, WorkspacePdfGenerator, type WorkspacePdfGeneratorProps, type WorkspacePosition, type WorkspaceQualityData, type WorkspaceUrlMapping, WorkspaceWhatsAppShareButton, type WorkspaceWhatsAppShareProps, actionService, apiUtils, authCoreService, authOTPService, clearS3VideoCache, clearS3VideoFromCache, clearWorkspaceDisplayNamesCache, cn, createSupabaseClient, createThrottledReload, dashboardService, formatDateInZone, formatDateTimeInZone, formatISTDate, formatIdleTime, formatTimeInZone, fromUrlFriendlyName, getAllWorkspaceDisplayNamesAsync, getAnonClient, getCameraNumber, getCompanyMetricsTableName, getConfigurableShortWorkspaceDisplayName, getConfigurableWorkspaceDisplayName, getCurrentShift, getCurrentTimeInZone, getDashboardHeaderTimeInZone, getDaysDifferenceInZone, getDefaultCameraStreamUrl, getDefaultTabForWorkspace, getManufacturingInsights, getMetricsTablePrefix, getOperationalDate, getS3SignedUrl, getS3VideoSrc, getShortWorkspaceDisplayName, getShortWorkspaceDisplayNameAsync, getStoredWorkspaceMappings, getWorkspaceDisplayName, getWorkspaceDisplayNameAsync, getWorkspaceDisplayNamesMap, getWorkspaceFromUrl, getWorkspaceNavigationParams, identifyCoreUser, initializeCoreMixpanel, isTransitionPeriod, isValidLineInfoPayload, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, mergeWithDefaultConfig, optifyeAgentClient, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, s3VideoPreloader, storeWorkspaceMapping, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, useAnalyticsConfig, useAuth, useAuthConfig, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHistoricWorkspaceMetrics, useHlsStream, useHookOverride, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineWorkspaceMetrics, useMetrics, useNavigation, useOverrides, usePageOverride, useRealtimeLineMetrics, useRegistry, useShiftConfig, useShifts, useSupabase, useTargets, useTheme, useThemeConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, videoPreloader, whatsappService, withAuth, withRegistry, workspaceService };
4139
+ export { ACTION_NAMES, AIAgentView, type Action, type ActionName, type ActionService, type ActionThreshold, type AnalyticsConfig, AuthCallback, type AuthCallbackProps, AuthCallbackView, type AuthCallbackViewProps, type AuthConfig, AuthProvider, type AuthUser, AuthenticatedFactoryView, AuthenticatedHomeView, AuthenticatedTargetsView, BarChart, type BarChartDataItem, type BarChartProps, type BarProps, BaseHistoryCalendar, type BaseHistoryCalendarProps, type BaseLineMetric, type BasePerformanceMetric, type BottleneckFilterType, type BottleneckVideo, type BottleneckVideoData, BottlenecksContent, type BottlenecksContentProps, type BreadcrumbItem, type Break, type BreakRowProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ClipCounts, type ComponentOverride, type CoreComponents, type CurrentShiftResult, CycleTimeChart, type CycleTimeChartProps, CycleTimeOverTimeChart, type CycleTimeOverTimeChartProps, DEFAULT_ANALYTICS_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CONFIG, DEFAULT_DATABASE_CONFIG, DEFAULT_DATE_TIME_CONFIG, DEFAULT_ENDPOINTS_CONFIG, DEFAULT_ENTITY_CONFIG, DEFAULT_SHIFT_CONFIG, DEFAULT_THEME_CONFIG, DEFAULT_WORKSPACE_CONFIG, DEFAULT_WORKSPACE_POSITIONS, type DashboardConfig, DashboardHeader, type DashboardKPIs, DashboardLayout, type DashboardLayoutProps, DashboardOverridesProvider, DashboardProvider, type DashboardService, type DatabaseConfig, DateDisplay, type DateTimeConfig, DateTimeDisplay, type DateTimeDisplayProps, type DayHistoryData, type DaySummaryData, DebugAuth, DebugAuthView, EmptyStateMessage, type EmptyStateMessageProps, type EndpointsConfig, type EntityConfig, type FactoryOverviewData, FactoryView, type FactoryViewProps, type FormatNumberOptions, GridComponentsPlaceholder, Header, type HeaderProps, type HistoryCalendarProps, HomeView, type HookOverride, HourlyOutputChart, type HourlyOutputChartProps, type HourlyPerformance, type ISTDateProps, ISTTimer, type ISTTimerProps, KPICard, type KPICardProps, KPIDetailView, type KPIDetailViewProps, KPIGrid, type KPIGridProps, KPIHeader, type KPIHeaderProps, KPISection, type KPITrend, LINE_1_UUID, LargeOutputProgressChart, type LargeOutputProgressChartProps, LeaderboardDetailView, type LeaderboardDetailViewProps, type LeaderboardEntry, LeaderboardIndexView, type LeaderboardIndexViewProps, type LeaderboardLineOption, Legend, LineChart, type LineChartDataItem, type LineChartProps, type LineDetails, type LineDisplayData, LineHistoryCalendar, type LineHistoryCalendarProps, type LineInfo, type LineMetrics, LineMonthlyHistory, type LineMonthlyHistoryProps, type LineMonthlyMetric, LineMonthlyPdfGenerator, type LineMonthlyPdfGeneratorProps, type LineNavigationParams, LinePdfExportButton, type LinePdfExportButtonProps, LinePdfGenerator, type LinePdfGeneratorProps, type LineProps, type LineShiftConfig, type LineSnapshot, type LineThreshold, LineWhatsAppShareButton, type LineWhatsAppShareProps, LiveTimer, LoadingOverlay, LoadingPage, LoadingSpinner, LoginPage, type LoginPageProps, LoginView, type LoginViewProps, MainLayout, type MainLayoutProps, type Metric, MetricCard, type MetricCardProps$1 as MetricCardProps, type MetricsError, type NavItem, type NavItemTrackingEvent, NoWorkspaceData, type OperatorData, type OperatorInfo, OptifyeAgentClient, type OptifyeAgentContext, type OptifyeAgentRequest, type OptifyeAgentResponse, OutputProgressChart, type OutputProgressChartProps, type OverridesMap, type OverviewLineMetric, type OverviewWorkspaceMetric, PageHeader, type PageHeaderProps, type PageOverride, type PoorPerformingWorkspace, type ProfileMenuItem, ProfileView, type QualityMetric, type QualityOverview, type QualityService, type RateLimitOptions, type RateLimitResult, type RealtimeService, RegistryProvider, type RoutePath, type S3ClipsAPIParams, type S3Config, type S3ListObjectsParams, S3Service, type S3ServiceConfig, SOPComplianceChart, type SOPComplianceChartProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type ShiftConfig, type ShiftConfiguration, type ShiftConfigurationRecord, type ShiftData$2 as ShiftData, ShiftDisplay, type ShiftHistoryData, type ShiftHoursMap, type ShiftPanelProps, type ShiftSummaryData, type ShiftTime, ShiftsView, type ShiftsViewProps, SideNavBar, type SideNavBarProps, type SimpleLine, SingleVideoStream, type SingleVideoStreamProps, Skeleton, type StreamProxyConfig, type SupabaseClient, SupabaseProvider, type Target, TargetWorkspaceGrid, type TargetWorkspaceGridProps, TargetsView, type TargetsViewProps, type ThemeColorValue, type ThemeConfig, TimeDisplay, type TrackingEventProperties, type TrendDirection, type UnderperformingWorkspace, type UnderperformingWorkspaces, type UseDashboardMetricsProps, type UseFactoryOverviewOptions, type UseFormatNumberResult, type UseRealtimeLineMetricsProps, type UseTargetsOptions, type UseWorkspaceOperatorsOptions, type UserProfileConfig, VideoCard, VideoGridView, type VideoMetadata, VideoPreloader, type VideoSeverity, type VideoSummary, type VideoType, WORKSPACE_POSITIONS, type WhatsAppSendResult, WhatsAppShareButton, type WhatsAppShareButtonProps, type WhatsappService, type Workspace, type WorkspaceActionUpdate, WorkspaceCard, type WorkspaceCardProps, type WorkspaceConfig, WrappedComponent as WorkspaceDetailView, type WorkspaceDetailedMetrics, WorkspaceGrid, WorkspaceGridItem, type WorkspaceGridItemProps, WorkspaceHistoryCalendar, WorkspaceMetricCards, type WorkspaceMetricCardsProps, type WorkspaceMetrics, WorkspaceMonthlyDataFetcher, type WorkspaceMonthlyDataFetcherProps, type WorkspaceMonthlyMetric, WorkspaceMonthlyPdfGenerator, type WorkspaceMonthlyPdfGeneratorProps, type WorkspaceNavigationParams, WorkspacePdfExportButton, type WorkspacePdfExportButtonProps, WorkspacePdfGenerator, type WorkspacePdfGeneratorProps, type WorkspacePosition, type WorkspaceQualityData, type WorkspaceUrlMapping, WorkspaceWhatsAppShareButton, type WorkspaceWhatsAppShareProps, actionService, apiUtils, authCoreService, authOTPService, authRateLimitService, checkRateLimit, clearAllRateLimits, clearRateLimit, clearS3VideoCache, clearS3VideoFromCache, clearWorkspaceDisplayNamesCache, cn, createStreamProxyHandler, createSupabaseClient, createThrottledReload, dashboardService, formatDateInZone, formatDateTimeInZone, formatISTDate, formatIdleTime, formatTimeInZone, fromUrlFriendlyName, getAllWorkspaceDisplayNamesAsync, getAnonClient, getCameraNumber, getCompanyMetricsTableName, getConfigurableShortWorkspaceDisplayName, getConfigurableWorkspaceDisplayName, getCurrentShift, getCurrentTimeInZone, getDashboardHeaderTimeInZone, getDaysDifferenceInZone, getDefaultCameraStreamUrl, getDefaultTabForWorkspace, getManufacturingInsights, getMetricsTablePrefix, getOperationalDate, getS3SignedUrl, getS3VideoSrc, getShortWorkspaceDisplayName, getShortWorkspaceDisplayNameAsync, getStoredWorkspaceMappings, getWorkspaceDisplayName, getWorkspaceDisplayNameAsync, getWorkspaceDisplayNamesMap, getWorkspaceFromUrl, getWorkspaceNavigationParams, identifyCoreUser, initializeCoreMixpanel, isTransitionPeriod, isValidLineInfoPayload, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, mergeWithDefaultConfig, optifyeAgentClient, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, s3VideoPreloader, storeWorkspaceMapping, streamProxyConfig, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, useAnalyticsConfig, useAuth, useAuthConfig, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHistoricWorkspaceMetrics, useHlsStream, useHookOverride, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineWorkspaceMetrics, useMetrics, useNavigation, useOverrides, usePageOverride, useRealtimeLineMetrics, useRegistry, useShiftConfig, useShifts, useSupabase, useSupabaseClient, useTargets, useTheme, useThemeConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, videoPreloader, whatsappService, withAuth, withRegistry, workspaceService };