@seenn/types 0.2.2 → 0.4.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.mts CHANGED
@@ -67,6 +67,16 @@ interface SeennJob {
67
67
  startedAt?: string;
68
68
  /** Job completion timestamp (ISO 8601) */
69
69
  completedAt?: string;
70
+ /**
71
+ * CTA button text (optional backend override for Live Activity)
72
+ * If provided, overrides mobile SDK default CTA
73
+ */
74
+ ctaButtonText?: string;
75
+ /**
76
+ * CTA deep link (optional backend override for Live Activity)
77
+ * If provided, overrides mobile SDK default CTA
78
+ */
79
+ ctaDeepLink?: string;
70
80
  }
71
81
  /**
72
82
  * Stage information for multi-step jobs
@@ -312,6 +322,12 @@ interface EtaStats {
312
322
  * Connection mode for real-time updates
313
323
  */
314
324
  type ConnectionMode = 'sse' | 'polling';
325
+ /**
326
+ * iOS push authorization mode
327
+ * - 'standard': Shows permission prompt, full push access
328
+ * - 'provisional': No prompt, quiet notifications only (iOS 12+)
329
+ */
330
+ type PushAuthorizationMode = 'standard' | 'provisional';
315
331
  /**
316
332
  * Base SDK configuration
317
333
  */
@@ -336,6 +352,28 @@ interface SeennConfig {
336
352
  maxReconnectAttempts?: number;
337
353
  /** Enable debug logging (default: false) */
338
354
  debug?: boolean;
355
+ /** iOS push authorization mode (default: 'standard') */
356
+ pushAuthorizationMode?: PushAuthorizationMode;
357
+ }
358
+ /**
359
+ * iOS push authorization status
360
+ * - 'notDetermined': Permission never requested
361
+ * - 'denied': User denied permission
362
+ * - 'authorized': Full push access granted
363
+ * - 'provisional': Quiet notifications only (iOS 12+)
364
+ * - 'ephemeral': App Clips only (iOS 14+)
365
+ */
366
+ type PushAuthorizationStatus = 'notDetermined' | 'denied' | 'authorized' | 'provisional' | 'ephemeral';
367
+ /**
368
+ * Push authorization information
369
+ */
370
+ interface PushAuthorizationInfo {
371
+ /** Current authorization status */
372
+ status: PushAuthorizationStatus;
373
+ /** Whether current authorization is provisional */
374
+ isProvisional: boolean;
375
+ /** Whether user can be prompted to upgrade to full authorization */
376
+ canRequestFullAuthorization: boolean;
339
377
  }
340
378
  /**
341
379
  * Live Activity start parameters
@@ -387,6 +425,8 @@ interface LiveActivityEndParams {
387
425
  errorMessage?: string;
388
426
  /** Dismiss after seconds (default: 300) */
389
427
  dismissAfter?: number;
428
+ /** CTA button to show on completion/failure */
429
+ ctaButton?: LiveActivityCTAButton;
390
430
  }
391
431
  /**
392
432
  * Live Activity result
@@ -410,10 +450,194 @@ interface LiveActivityPushTokenEvent {
410
450
  /** APNs push token */
411
451
  token: string;
412
452
  }
453
+ /**
454
+ * CTA (Call-to-Action) button style
455
+ */
456
+ type LiveActivityCTAButtonStyle = 'primary' | 'secondary' | 'outline';
457
+ /**
458
+ * CTA button configuration for Live Activity completion
459
+ */
460
+ interface LiveActivityCTAButton {
461
+ /** Button text */
462
+ text: string;
463
+ /** Deep link URL to open when tapped */
464
+ deepLink: string;
465
+ /** Button style preset */
466
+ style?: LiveActivityCTAButtonStyle;
467
+ /** Custom background color (hex) */
468
+ backgroundColor?: string;
469
+ /** Custom text color (hex) */
470
+ textColor?: string;
471
+ /** Corner radius (default: 20) */
472
+ cornerRadius?: number;
473
+ }
474
+ /**
475
+ * Gradient point positions
476
+ */
477
+ type GradientPoint = 'top' | 'topLeading' | 'topTrailing' | 'leading' | 'trailing' | 'bottom' | 'bottomLeading' | 'bottomTrailing' | 'center';
478
+ /**
479
+ * Built-in theme presets
480
+ */
481
+ type LiveActivityThemePreset = 'default' | 'gradient-sunset' | 'gradient-ocean' | 'gradient-purple' | 'minimal-dark' | 'minimal-light';
482
+ /**
483
+ * Color configuration for Live Activity
484
+ */
485
+ interface LiveActivityColors {
486
+ /** Background color (hex) */
487
+ background?: string;
488
+ /** Primary text color (hex) */
489
+ primary?: string;
490
+ /** Secondary text color (hex) */
491
+ secondary?: string;
492
+ /** Progress bar fill color (hex) */
493
+ progressBar?: string;
494
+ /** Progress bar track color (hex) */
495
+ progressTrack?: string;
496
+ /** Status color for running state (hex) */
497
+ statusRunning?: string;
498
+ /** Status color for completed state (hex) */
499
+ statusCompleted?: string;
500
+ /** Status color for failed state (hex) */
501
+ statusFailed?: string;
502
+ }
503
+ /**
504
+ * Gradient configuration for Live Activity background
505
+ */
506
+ interface LiveActivityGradient {
507
+ /** Gradient color stops (hex values) */
508
+ colors: string[];
509
+ /** Start point of gradient */
510
+ startPoint?: GradientPoint;
511
+ /** End point of gradient */
512
+ endPoint?: GradientPoint;
513
+ }
514
+ /**
515
+ * Layout configuration for Live Activity
516
+ */
517
+ interface LiveActivityLayout {
518
+ /** Progress bar height in points */
519
+ progressBarHeight?: number;
520
+ /** Corner radius for progress bar */
521
+ progressBarCornerRadius?: number;
522
+ /** Overall corner radius */
523
+ cornerRadius?: number;
524
+ /** Show job type icon */
525
+ showIcon?: boolean;
526
+ /** Show ETA countdown */
527
+ showEta?: boolean;
528
+ /** Show current stage */
529
+ showStage?: boolean;
530
+ /** Show progress percentage text */
531
+ showProgressText?: boolean;
532
+ /** Compact mode for Dynamic Island */
533
+ compactMode?: boolean;
534
+ }
535
+ /**
536
+ * Font weight options
537
+ */
538
+ type FontWeight = 'regular' | 'medium' | 'semibold' | 'bold';
539
+ /**
540
+ * Font configuration
541
+ */
542
+ interface FontConfig {
543
+ /** Font size in points */
544
+ size?: number;
545
+ /** Font weight */
546
+ weight?: FontWeight;
547
+ }
548
+ /**
549
+ * Font configuration for Live Activity text elements
550
+ */
551
+ interface LiveActivityFonts {
552
+ /** Title text font */
553
+ title?: FontConfig;
554
+ /** Progress/percentage text font */
555
+ progress?: FontConfig;
556
+ /** Message text font */
557
+ message?: FontConfig;
558
+ /** Stage text font */
559
+ stage?: FontConfig;
560
+ /** ETA text font */
561
+ eta?: FontConfig;
562
+ }
563
+ /**
564
+ * Job type specific icon and color configuration
565
+ */
566
+ interface JobTypeConfig {
567
+ /** SF Symbol name (iOS) */
568
+ icon?: string;
569
+ /** Icon tint color (hex) */
570
+ color?: string;
571
+ /** Custom display name */
572
+ displayName?: string;
573
+ }
574
+ /**
575
+ * CTA button default styling
576
+ */
577
+ interface LiveActivityCTAStyle {
578
+ /** Background color (hex) */
579
+ backgroundColor?: string;
580
+ /** Text color (hex) */
581
+ textColor?: string;
582
+ /** Corner radius */
583
+ cornerRadius?: number;
584
+ /** Font configuration */
585
+ font?: FontConfig;
586
+ }
587
+ /**
588
+ * CTA button configuration in theme
589
+ */
590
+ interface LiveActivityCTAConfig {
591
+ /** Default CTA button style */
592
+ style?: LiveActivityCTAStyle;
593
+ /** Show CTA on these statuses */
594
+ showOn?: ('completed' | 'failed')[];
595
+ }
596
+ /**
597
+ * Complete theme configuration for Live Activity
598
+ */
599
+ interface LiveActivityThemeConfig {
600
+ /** Use a built-in preset as base */
601
+ preset?: LiveActivityThemePreset;
602
+ /** Custom colors (override preset) */
603
+ colors?: LiveActivityColors;
604
+ /** Gradient background (overrides solid color) */
605
+ gradient?: LiveActivityGradient;
606
+ /** Layout options */
607
+ layout?: LiveActivityLayout;
608
+ /** Font configuration */
609
+ fonts?: LiveActivityFonts;
610
+ /** CTA button configuration */
611
+ cta?: LiveActivityCTAConfig;
612
+ }
613
+ /**
614
+ * Widget extension configuration
615
+ */
616
+ interface WidgetExtensionConfig {
617
+ /** Widget extension name (default: 'SeennWidgetExtension') */
618
+ name?: string;
619
+ /** iOS deployment target (default: '16.1') */
620
+ deploymentTarget?: string;
621
+ /** App Groups identifier (auto-generated if not provided) */
622
+ appGroupId?: string;
623
+ }
624
+ /**
625
+ * Complete Seenn widget configuration file format
626
+ */
627
+ interface SeennWidgetConfig {
628
+ /** Widget extension settings */
629
+ widget?: WidgetExtensionConfig;
630
+ /** Theme configuration */
631
+ theme?: LiveActivityThemeConfig;
632
+ /** Job type specific configurations */
633
+ jobTypes?: Record<string, JobTypeConfig>;
634
+ /** CTA button configuration */
635
+ ctaButton?: LiveActivityCTAConfig;
636
+ }
413
637
  /**
414
638
  * SDK version info
415
639
  */
416
- declare const SDK_VERSION = "0.2.0";
640
+ declare const SDK_VERSION = "0.4.0";
417
641
  /**
418
642
  * Minimum API version required
419
643
  */
@@ -423,4 +647,4 @@ declare const MIN_API_VERSION = "1.0.0";
423
647
  */
424
648
  declare const SSE_PROTOCOL_VERSION = "1.0";
425
649
 
426
- export { type ChildJobSummary, type ChildProgressMode, type ChildrenStats, type CompleteJobParams, type ConnectionMode, type ConnectionState, type CreateJobParams, type EtaStats, type FailJobParams, type InAppMessage, type InAppMessageType, type JobError, type JobResult, type JobStatus, type LiveActivityEndParams, type LiveActivityPushTokenEvent, type LiveActivityResult, type LiveActivityStartParams, type LiveActivityUpdateParams, MIN_API_VERSION, type ParentInfo, type ParentWithChildren, type QueueInfo, SDK_VERSION, type SSEEvent, type SSEEventType, SSE_PROTOCOL_VERSION, type SeennConfig, type SeennJob, type StageInfo, type UpdateJobParams, type WebhookEventType, type WebhookPayload };
650
+ export { type ChildJobSummary, type ChildProgressMode, type ChildrenStats, type CompleteJobParams, type ConnectionMode, type ConnectionState, type CreateJobParams, type EtaStats, type FailJobParams, type FontConfig, type FontWeight, type GradientPoint, type InAppMessage, type InAppMessageType, type JobError, type JobResult, type JobStatus, type JobTypeConfig, type LiveActivityCTAButton, type LiveActivityCTAButtonStyle, type LiveActivityCTAConfig, type LiveActivityCTAStyle, type LiveActivityColors, type LiveActivityEndParams, type LiveActivityFonts, type LiveActivityGradient, type LiveActivityLayout, type LiveActivityPushTokenEvent, type LiveActivityResult, type LiveActivityStartParams, type LiveActivityThemeConfig, type LiveActivityThemePreset, type LiveActivityUpdateParams, MIN_API_VERSION, type ParentInfo, type ParentWithChildren, type PushAuthorizationInfo, type PushAuthorizationMode, type PushAuthorizationStatus, type QueueInfo, SDK_VERSION, type SSEEvent, type SSEEventType, SSE_PROTOCOL_VERSION, type SeennConfig, type SeennJob, type SeennWidgetConfig, type StageInfo, type UpdateJobParams, type WebhookEventType, type WebhookPayload, type WidgetExtensionConfig };
package/dist/index.d.ts CHANGED
@@ -67,6 +67,16 @@ interface SeennJob {
67
67
  startedAt?: string;
68
68
  /** Job completion timestamp (ISO 8601) */
69
69
  completedAt?: string;
70
+ /**
71
+ * CTA button text (optional backend override for Live Activity)
72
+ * If provided, overrides mobile SDK default CTA
73
+ */
74
+ ctaButtonText?: string;
75
+ /**
76
+ * CTA deep link (optional backend override for Live Activity)
77
+ * If provided, overrides mobile SDK default CTA
78
+ */
79
+ ctaDeepLink?: string;
70
80
  }
71
81
  /**
72
82
  * Stage information for multi-step jobs
@@ -312,6 +322,12 @@ interface EtaStats {
312
322
  * Connection mode for real-time updates
313
323
  */
314
324
  type ConnectionMode = 'sse' | 'polling';
325
+ /**
326
+ * iOS push authorization mode
327
+ * - 'standard': Shows permission prompt, full push access
328
+ * - 'provisional': No prompt, quiet notifications only (iOS 12+)
329
+ */
330
+ type PushAuthorizationMode = 'standard' | 'provisional';
315
331
  /**
316
332
  * Base SDK configuration
317
333
  */
@@ -336,6 +352,28 @@ interface SeennConfig {
336
352
  maxReconnectAttempts?: number;
337
353
  /** Enable debug logging (default: false) */
338
354
  debug?: boolean;
355
+ /** iOS push authorization mode (default: 'standard') */
356
+ pushAuthorizationMode?: PushAuthorizationMode;
357
+ }
358
+ /**
359
+ * iOS push authorization status
360
+ * - 'notDetermined': Permission never requested
361
+ * - 'denied': User denied permission
362
+ * - 'authorized': Full push access granted
363
+ * - 'provisional': Quiet notifications only (iOS 12+)
364
+ * - 'ephemeral': App Clips only (iOS 14+)
365
+ */
366
+ type PushAuthorizationStatus = 'notDetermined' | 'denied' | 'authorized' | 'provisional' | 'ephemeral';
367
+ /**
368
+ * Push authorization information
369
+ */
370
+ interface PushAuthorizationInfo {
371
+ /** Current authorization status */
372
+ status: PushAuthorizationStatus;
373
+ /** Whether current authorization is provisional */
374
+ isProvisional: boolean;
375
+ /** Whether user can be prompted to upgrade to full authorization */
376
+ canRequestFullAuthorization: boolean;
339
377
  }
340
378
  /**
341
379
  * Live Activity start parameters
@@ -387,6 +425,8 @@ interface LiveActivityEndParams {
387
425
  errorMessage?: string;
388
426
  /** Dismiss after seconds (default: 300) */
389
427
  dismissAfter?: number;
428
+ /** CTA button to show on completion/failure */
429
+ ctaButton?: LiveActivityCTAButton;
390
430
  }
391
431
  /**
392
432
  * Live Activity result
@@ -410,10 +450,194 @@ interface LiveActivityPushTokenEvent {
410
450
  /** APNs push token */
411
451
  token: string;
412
452
  }
453
+ /**
454
+ * CTA (Call-to-Action) button style
455
+ */
456
+ type LiveActivityCTAButtonStyle = 'primary' | 'secondary' | 'outline';
457
+ /**
458
+ * CTA button configuration for Live Activity completion
459
+ */
460
+ interface LiveActivityCTAButton {
461
+ /** Button text */
462
+ text: string;
463
+ /** Deep link URL to open when tapped */
464
+ deepLink: string;
465
+ /** Button style preset */
466
+ style?: LiveActivityCTAButtonStyle;
467
+ /** Custom background color (hex) */
468
+ backgroundColor?: string;
469
+ /** Custom text color (hex) */
470
+ textColor?: string;
471
+ /** Corner radius (default: 20) */
472
+ cornerRadius?: number;
473
+ }
474
+ /**
475
+ * Gradient point positions
476
+ */
477
+ type GradientPoint = 'top' | 'topLeading' | 'topTrailing' | 'leading' | 'trailing' | 'bottom' | 'bottomLeading' | 'bottomTrailing' | 'center';
478
+ /**
479
+ * Built-in theme presets
480
+ */
481
+ type LiveActivityThemePreset = 'default' | 'gradient-sunset' | 'gradient-ocean' | 'gradient-purple' | 'minimal-dark' | 'minimal-light';
482
+ /**
483
+ * Color configuration for Live Activity
484
+ */
485
+ interface LiveActivityColors {
486
+ /** Background color (hex) */
487
+ background?: string;
488
+ /** Primary text color (hex) */
489
+ primary?: string;
490
+ /** Secondary text color (hex) */
491
+ secondary?: string;
492
+ /** Progress bar fill color (hex) */
493
+ progressBar?: string;
494
+ /** Progress bar track color (hex) */
495
+ progressTrack?: string;
496
+ /** Status color for running state (hex) */
497
+ statusRunning?: string;
498
+ /** Status color for completed state (hex) */
499
+ statusCompleted?: string;
500
+ /** Status color for failed state (hex) */
501
+ statusFailed?: string;
502
+ }
503
+ /**
504
+ * Gradient configuration for Live Activity background
505
+ */
506
+ interface LiveActivityGradient {
507
+ /** Gradient color stops (hex values) */
508
+ colors: string[];
509
+ /** Start point of gradient */
510
+ startPoint?: GradientPoint;
511
+ /** End point of gradient */
512
+ endPoint?: GradientPoint;
513
+ }
514
+ /**
515
+ * Layout configuration for Live Activity
516
+ */
517
+ interface LiveActivityLayout {
518
+ /** Progress bar height in points */
519
+ progressBarHeight?: number;
520
+ /** Corner radius for progress bar */
521
+ progressBarCornerRadius?: number;
522
+ /** Overall corner radius */
523
+ cornerRadius?: number;
524
+ /** Show job type icon */
525
+ showIcon?: boolean;
526
+ /** Show ETA countdown */
527
+ showEta?: boolean;
528
+ /** Show current stage */
529
+ showStage?: boolean;
530
+ /** Show progress percentage text */
531
+ showProgressText?: boolean;
532
+ /** Compact mode for Dynamic Island */
533
+ compactMode?: boolean;
534
+ }
535
+ /**
536
+ * Font weight options
537
+ */
538
+ type FontWeight = 'regular' | 'medium' | 'semibold' | 'bold';
539
+ /**
540
+ * Font configuration
541
+ */
542
+ interface FontConfig {
543
+ /** Font size in points */
544
+ size?: number;
545
+ /** Font weight */
546
+ weight?: FontWeight;
547
+ }
548
+ /**
549
+ * Font configuration for Live Activity text elements
550
+ */
551
+ interface LiveActivityFonts {
552
+ /** Title text font */
553
+ title?: FontConfig;
554
+ /** Progress/percentage text font */
555
+ progress?: FontConfig;
556
+ /** Message text font */
557
+ message?: FontConfig;
558
+ /** Stage text font */
559
+ stage?: FontConfig;
560
+ /** ETA text font */
561
+ eta?: FontConfig;
562
+ }
563
+ /**
564
+ * Job type specific icon and color configuration
565
+ */
566
+ interface JobTypeConfig {
567
+ /** SF Symbol name (iOS) */
568
+ icon?: string;
569
+ /** Icon tint color (hex) */
570
+ color?: string;
571
+ /** Custom display name */
572
+ displayName?: string;
573
+ }
574
+ /**
575
+ * CTA button default styling
576
+ */
577
+ interface LiveActivityCTAStyle {
578
+ /** Background color (hex) */
579
+ backgroundColor?: string;
580
+ /** Text color (hex) */
581
+ textColor?: string;
582
+ /** Corner radius */
583
+ cornerRadius?: number;
584
+ /** Font configuration */
585
+ font?: FontConfig;
586
+ }
587
+ /**
588
+ * CTA button configuration in theme
589
+ */
590
+ interface LiveActivityCTAConfig {
591
+ /** Default CTA button style */
592
+ style?: LiveActivityCTAStyle;
593
+ /** Show CTA on these statuses */
594
+ showOn?: ('completed' | 'failed')[];
595
+ }
596
+ /**
597
+ * Complete theme configuration for Live Activity
598
+ */
599
+ interface LiveActivityThemeConfig {
600
+ /** Use a built-in preset as base */
601
+ preset?: LiveActivityThemePreset;
602
+ /** Custom colors (override preset) */
603
+ colors?: LiveActivityColors;
604
+ /** Gradient background (overrides solid color) */
605
+ gradient?: LiveActivityGradient;
606
+ /** Layout options */
607
+ layout?: LiveActivityLayout;
608
+ /** Font configuration */
609
+ fonts?: LiveActivityFonts;
610
+ /** CTA button configuration */
611
+ cta?: LiveActivityCTAConfig;
612
+ }
613
+ /**
614
+ * Widget extension configuration
615
+ */
616
+ interface WidgetExtensionConfig {
617
+ /** Widget extension name (default: 'SeennWidgetExtension') */
618
+ name?: string;
619
+ /** iOS deployment target (default: '16.1') */
620
+ deploymentTarget?: string;
621
+ /** App Groups identifier (auto-generated if not provided) */
622
+ appGroupId?: string;
623
+ }
624
+ /**
625
+ * Complete Seenn widget configuration file format
626
+ */
627
+ interface SeennWidgetConfig {
628
+ /** Widget extension settings */
629
+ widget?: WidgetExtensionConfig;
630
+ /** Theme configuration */
631
+ theme?: LiveActivityThemeConfig;
632
+ /** Job type specific configurations */
633
+ jobTypes?: Record<string, JobTypeConfig>;
634
+ /** CTA button configuration */
635
+ ctaButton?: LiveActivityCTAConfig;
636
+ }
413
637
  /**
414
638
  * SDK version info
415
639
  */
416
- declare const SDK_VERSION = "0.2.0";
640
+ declare const SDK_VERSION = "0.4.0";
417
641
  /**
418
642
  * Minimum API version required
419
643
  */
@@ -423,4 +647,4 @@ declare const MIN_API_VERSION = "1.0.0";
423
647
  */
424
648
  declare const SSE_PROTOCOL_VERSION = "1.0";
425
649
 
426
- export { type ChildJobSummary, type ChildProgressMode, type ChildrenStats, type CompleteJobParams, type ConnectionMode, type ConnectionState, type CreateJobParams, type EtaStats, type FailJobParams, type InAppMessage, type InAppMessageType, type JobError, type JobResult, type JobStatus, type LiveActivityEndParams, type LiveActivityPushTokenEvent, type LiveActivityResult, type LiveActivityStartParams, type LiveActivityUpdateParams, MIN_API_VERSION, type ParentInfo, type ParentWithChildren, type QueueInfo, SDK_VERSION, type SSEEvent, type SSEEventType, SSE_PROTOCOL_VERSION, type SeennConfig, type SeennJob, type StageInfo, type UpdateJobParams, type WebhookEventType, type WebhookPayload };
650
+ export { type ChildJobSummary, type ChildProgressMode, type ChildrenStats, type CompleteJobParams, type ConnectionMode, type ConnectionState, type CreateJobParams, type EtaStats, type FailJobParams, type FontConfig, type FontWeight, type GradientPoint, type InAppMessage, type InAppMessageType, type JobError, type JobResult, type JobStatus, type JobTypeConfig, type LiveActivityCTAButton, type LiveActivityCTAButtonStyle, type LiveActivityCTAConfig, type LiveActivityCTAStyle, type LiveActivityColors, type LiveActivityEndParams, type LiveActivityFonts, type LiveActivityGradient, type LiveActivityLayout, type LiveActivityPushTokenEvent, type LiveActivityResult, type LiveActivityStartParams, type LiveActivityThemeConfig, type LiveActivityThemePreset, type LiveActivityUpdateParams, MIN_API_VERSION, type ParentInfo, type ParentWithChildren, type PushAuthorizationInfo, type PushAuthorizationMode, type PushAuthorizationStatus, type QueueInfo, SDK_VERSION, type SSEEvent, type SSEEventType, SSE_PROTOCOL_VERSION, type SeennConfig, type SeennJob, type SeennWidgetConfig, type StageInfo, type UpdateJobParams, type WebhookEventType, type WebhookPayload, type WidgetExtensionConfig };
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ __export(index_exports, {
25
25
  SSE_PROTOCOL_VERSION: () => SSE_PROTOCOL_VERSION
26
26
  });
27
27
  module.exports = __toCommonJS(index_exports);
28
- var SDK_VERSION = "0.2.0";
28
+ var SDK_VERSION = "0.4.0";
29
29
  var MIN_API_VERSION = "1.0.0";
30
30
  var SSE_PROTOCOL_VERSION = "1.0";
31
31
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @seenn/types - Shared TypeScript types for Seenn SDKs\n *\n * This package is the single source of truth for all Seenn type definitions.\n * All SDK packages (react-native, node, flutter) should depend on this package.\n *\n * @version 0.1.0\n * @license MIT\n */\n\n// ============================================\n// Core Job Types\n// ============================================\n\n/**\n * Job status values\n */\nexport type JobStatus =\n | 'pending'\n | 'queued'\n | 'running'\n | 'completed'\n | 'failed'\n | 'cancelled';\n\n/**\n * How parent job progress is calculated from children\n */\nexport type ChildProgressMode = 'average' | 'weighted' | 'sequential';\n\n/**\n * Main job object returned by API and SSE\n */\nexport interface SeennJob {\n /** Unique job identifier (ULID format) */\n jobId: string;\n /** User who owns this job */\n userId: string;\n /** Application ID */\n appId: string;\n /** Current job status */\n status: JobStatus;\n /** Human-readable job title */\n title: string;\n /** Job type for categorization */\n jobType: string;\n /** Workflow ID for ETA tracking (default: jobType) */\n workflowId?: string;\n /** Progress percentage (0-100) */\n progress: number;\n /** Current status message */\n message?: string;\n /** Stage information for multi-step jobs */\n stage?: StageInfo;\n /** Estimated completion timestamp (ISO 8601) */\n estimatedCompletionAt?: string;\n /** ETA confidence score (0.0 - 1.0) */\n etaConfidence?: number;\n /** Number of historical jobs used to calculate ETA */\n etaBasedOn?: number;\n /** Queue position info */\n queue?: QueueInfo;\n /** Job result on completion */\n result?: JobResult;\n /** Error details on failure */\n error?: JobError;\n /** Custom metadata */\n metadata?: Record<string, unknown>;\n /** Parent info (if this is a child job) */\n parent?: ParentInfo;\n /** Children stats (if this is a parent job) */\n children?: ChildrenStats;\n /** Progress calculation mode for parent jobs */\n childProgressMode?: ChildProgressMode;\n /** Job creation timestamp (ISO 8601) */\n createdAt: string;\n /** Last update timestamp (ISO 8601) */\n updatedAt: string;\n /** When the job started running (ISO 8601) */\n startedAt?: string;\n /** Job completion timestamp (ISO 8601) */\n completedAt?: string;\n}\n\n// ============================================\n// Stage & Queue Types\n// ============================================\n\n/**\n * Stage information for multi-step jobs\n */\nexport interface StageInfo {\n /** Current stage name */\n name: string;\n /** Current stage index (1-based) */\n current: number;\n /** Total number of stages */\n total: number;\n /** Optional stage description */\n description?: string;\n}\n\n/**\n * Queue position information\n */\nexport interface QueueInfo {\n /** Position in queue (1-based) */\n position: number;\n /** Total items in queue */\n total?: number;\n /** Queue name/identifier */\n queueName?: string;\n}\n\n// ============================================\n// Result & Error Types\n// ============================================\n\n/**\n * Job result on successful completion\n */\nexport interface JobResult {\n /** Result type (e.g., 'video', 'image', 'file') */\n type?: string;\n /** Result URL if applicable */\n url?: string;\n /** Additional result data */\n data?: Record<string, unknown>;\n}\n\n/**\n * Error details on job failure\n */\nexport interface JobError {\n /** Error code for programmatic handling */\n code: string;\n /** Human-readable error message */\n message: string;\n /** Additional error details */\n details?: Record<string, unknown>;\n}\n\n// ============================================\n// Parent-Child Types\n// ============================================\n\n/**\n * Parent info for child jobs\n */\nexport interface ParentInfo {\n /** Parent job ID */\n parentJobId: string;\n /** Child index within parent (0-based) */\n childIndex: number;\n}\n\n/**\n * Children stats for parent jobs\n */\nexport interface ChildrenStats {\n /** Total number of children */\n total: number;\n /** Number of completed children */\n completed: number;\n /** Number of failed children */\n failed: number;\n /** Number of running children */\n running: number;\n /** Number of pending children */\n pending: number;\n}\n\n/**\n * Summary of a child job (used in parent.children array)\n */\nexport interface ChildJobSummary {\n /** Child job ID */\n id: string;\n /** Child index within parent (0-based) */\n childIndex: number;\n /** Child job title */\n title: string;\n /** Child job status */\n status: JobStatus;\n /** Child progress (0-100) */\n progress: number;\n /** Child status message */\n message?: string;\n /** Child result */\n result?: JobResult;\n /** Child error */\n error?: JobError;\n /** Child creation timestamp */\n createdAt: string;\n /** Child last update timestamp */\n updatedAt: string;\n /** Child completion timestamp */\n completedAt?: string;\n}\n\n/**\n * Parent job with all its children\n */\nexport interface ParentWithChildren {\n /** Parent job */\n parent: SeennJob;\n /** List of child jobs */\n children: ChildJobSummary[];\n}\n\n// ============================================\n// SSE Types\n// ============================================\n\n/**\n * Connection state for SSE\n */\nexport type ConnectionState =\n | 'disconnected'\n | 'connecting'\n | 'connected'\n | 'reconnecting';\n\n/**\n * SSE event types\n */\nexport type SSEEventType =\n | 'connected'\n | 'job.sync'\n | 'job.started'\n | 'job.progress'\n | 'job.completed'\n | 'job.failed'\n | 'job.cancelled'\n | 'child.progress'\n | 'parent.updated'\n | 'in_app_message'\n | 'connection.idle'\n | 'heartbeat'\n | 'error';\n\n/**\n * SSE event wrapper\n */\nexport interface SSEEvent {\n /** Event type */\n event: SSEEventType;\n /** Event data */\n data: unknown;\n /** Event ID for replay */\n id?: string;\n}\n\n// ============================================\n// In-App Message Types\n// ============================================\n\n/**\n * In-app message types\n */\nexport type InAppMessageType =\n | 'job_complete_banner'\n | 'job_failed_modal'\n | 'job_toast';\n\n/**\n * In-app message for UI notifications\n */\nexport interface InAppMessage {\n /** Message ID */\n messageId: string;\n /** Message type */\n type: InAppMessageType;\n /** Associated job ID */\n jobId: string;\n /** Message title */\n title: string;\n /** Message body */\n body?: string;\n /** Call-to-action text */\n cta?: string;\n /** Call-to-action URL */\n ctaUrl?: string;\n}\n\n// ============================================\n// API Types\n// ============================================\n\n/**\n * Create job request parameters\n */\nexport interface CreateJobParams {\n /** User ID */\n userId: string;\n /** Job type */\n jobType: string;\n /** Job title */\n title: string;\n /** Workflow ID for ETA tracking (default: jobType) */\n workflowId?: string;\n /** Initial message */\n message?: string;\n /** Custom metadata */\n metadata?: Record<string, unknown>;\n /** Estimated duration in ms (for ETA default) */\n estimatedDuration?: number;\n /** Parent job ID (for child jobs) */\n parentJobId?: string;\n /** Child index (for child jobs) */\n childIndex?: number;\n /** Total children (for parent jobs) */\n totalChildren?: number;\n /** Child progress mode (for parent jobs) */\n childProgressMode?: ChildProgressMode;\n}\n\n/**\n * Update job request parameters\n */\nexport interface UpdateJobParams {\n /** New progress (0-100) */\n progress?: number;\n /** New message */\n message?: string;\n /** New stage info */\n stage?: StageInfo;\n /** Custom metadata to merge */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Complete job request parameters\n */\nexport interface CompleteJobParams {\n /** Job result */\n result?: JobResult;\n /** Final message */\n message?: string;\n}\n\n/**\n * Fail job request parameters\n */\nexport interface FailJobParams {\n /** Error details */\n error: JobError;\n}\n\n// ============================================\n// Webhook Types\n// ============================================\n\n/**\n * Webhook event types\n */\nexport type WebhookEventType =\n | 'job.started'\n | 'job.progress'\n | 'job.completed'\n | 'job.failed'\n | 'job.cancelled';\n\n/**\n * Webhook payload\n */\nexport interface WebhookPayload {\n /** Event type */\n event: WebhookEventType;\n /** Job data */\n job: SeennJob;\n /** Event timestamp (ISO 8601) */\n timestamp: string;\n /** Webhook delivery ID */\n deliveryId: string;\n}\n\n// ============================================\n// ETA Types\n// ============================================\n\n/**\n * ETA statistics for a workflow/jobType\n */\nexport interface EtaStats {\n /** ETA key (workflowId or jobType) */\n etaKey: string;\n /** Number of completed jobs */\n count: number;\n /** Average duration in ms */\n avgDuration: number;\n /** Minimum duration in ms */\n minDuration: number;\n /** Maximum duration in ms */\n maxDuration: number;\n /** Default duration if no history */\n defaultDuration?: number;\n /** Last updated timestamp */\n lastUpdated: string;\n}\n\n// ============================================\n// SDK Configuration Types\n// ============================================\n\n/**\n * Connection mode for real-time updates\n */\nexport type ConnectionMode = 'sse' | 'polling';\n\n/**\n * Base SDK configuration\n */\nexport interface SeennConfig {\n /** API base URL */\n baseUrl: string;\n /** API key (pk_* for client SDKs, sk_* for server SDKs) */\n apiKey?: string;\n /** API base path prefix (default: '/v1'). Self-hosted backends can use custom paths. */\n basePath?: string;\n /** SSE endpoint URL (default: baseUrl + basePath + /sse) */\n sseUrl?: string;\n /** Connection mode: 'sse' (default) or 'polling' (for self-hosted) */\n mode?: ConnectionMode;\n /** Polling interval in ms (default: 5000, only used when mode is 'polling') */\n pollInterval?: number;\n /** Enable auto-reconnect (default: true) */\n reconnect?: boolean;\n /** Reconnect interval in ms (default: 1000) */\n reconnectInterval?: number;\n /** Max reconnect attempts (default: 10) */\n maxReconnectAttempts?: number;\n /** Enable debug logging (default: false) */\n debug?: boolean;\n}\n\n// ============================================\n// Live Activity Types (iOS/Android)\n// ============================================\n\n/**\n * Live Activity start parameters\n */\nexport interface LiveActivityStartParams {\n /** Job ID */\n jobId: string;\n /** Activity title */\n title: string;\n /** Job type for icon selection */\n jobType?: string;\n /** Initial progress (0-100) */\n initialProgress?: number;\n /** Initial message */\n initialMessage?: string;\n}\n\n/**\n * Live Activity update parameters\n */\nexport interface LiveActivityUpdateParams {\n /** Job ID */\n jobId: string;\n /** New progress (0-100) */\n progress?: number;\n /** New status */\n status?: JobStatus;\n /** New message */\n message?: string;\n /** Stage info */\n stage?: StageInfo;\n /** ETA timestamp (Unix ms) */\n estimatedEndTime?: number;\n}\n\n/**\n * Live Activity end parameters\n */\nexport interface LiveActivityEndParams {\n /** Job ID */\n jobId: string;\n /** Final status */\n finalStatus?: JobStatus;\n /** Final progress */\n finalProgress?: number;\n /** Final message */\n message?: string;\n /** Result URL */\n resultUrl?: string;\n /** Error message */\n errorMessage?: string;\n /** Dismiss after seconds (default: 300) */\n dismissAfter?: number;\n}\n\n/**\n * Live Activity result\n */\nexport interface LiveActivityResult {\n /** Success flag */\n success: boolean;\n /** Activity ID (platform-specific) */\n activityId?: string;\n /** Associated job ID */\n jobId?: string;\n /** Error message if failed */\n error?: string;\n}\n\n/**\n * Push token event for Live Activity updates\n */\nexport interface LiveActivityPushTokenEvent {\n /** Job ID */\n jobId: string;\n /** APNs push token */\n token: string;\n}\n\n// ============================================\n// Version & Compatibility\n// ============================================\n\n/**\n * SDK version info\n */\nexport const SDK_VERSION = '0.2.0';\n\n/**\n * Minimum API version required\n */\nexport const MIN_API_VERSION = '1.0.0';\n\n/**\n * SSE protocol version\n */\nexport const SSE_PROTOCOL_VERSION = '1.0';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6gBO,IAAM,cAAc;AAKpB,IAAM,kBAAkB;AAKxB,IAAM,uBAAuB;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @seenn/types - Shared TypeScript types for Seenn SDKs\n *\n * This package is the single source of truth for all Seenn type definitions.\n * All SDK packages (react-native, node, flutter) should depend on this package.\n *\n * @version 0.1.0\n * @license MIT\n */\n\n// ============================================\n// Core Job Types\n// ============================================\n\n/**\n * Job status values\n */\nexport type JobStatus =\n | 'pending'\n | 'queued'\n | 'running'\n | 'completed'\n | 'failed'\n | 'cancelled';\n\n/**\n * How parent job progress is calculated from children\n */\nexport type ChildProgressMode = 'average' | 'weighted' | 'sequential';\n\n/**\n * Main job object returned by API and SSE\n */\nexport interface SeennJob {\n /** Unique job identifier (ULID format) */\n jobId: string;\n /** User who owns this job */\n userId: string;\n /** Application ID */\n appId: string;\n /** Current job status */\n status: JobStatus;\n /** Human-readable job title */\n title: string;\n /** Job type for categorization */\n jobType: string;\n /** Workflow ID for ETA tracking (default: jobType) */\n workflowId?: string;\n /** Progress percentage (0-100) */\n progress: number;\n /** Current status message */\n message?: string;\n /** Stage information for multi-step jobs */\n stage?: StageInfo;\n /** Estimated completion timestamp (ISO 8601) */\n estimatedCompletionAt?: string;\n /** ETA confidence score (0.0 - 1.0) */\n etaConfidence?: number;\n /** Number of historical jobs used to calculate ETA */\n etaBasedOn?: number;\n /** Queue position info */\n queue?: QueueInfo;\n /** Job result on completion */\n result?: JobResult;\n /** Error details on failure */\n error?: JobError;\n /** Custom metadata */\n metadata?: Record<string, unknown>;\n /** Parent info (if this is a child job) */\n parent?: ParentInfo;\n /** Children stats (if this is a parent job) */\n children?: ChildrenStats;\n /** Progress calculation mode for parent jobs */\n childProgressMode?: ChildProgressMode;\n /** Job creation timestamp (ISO 8601) */\n createdAt: string;\n /** Last update timestamp (ISO 8601) */\n updatedAt: string;\n /** When the job started running (ISO 8601) */\n startedAt?: string;\n /** Job completion timestamp (ISO 8601) */\n completedAt?: string;\n /**\n * CTA button text (optional backend override for Live Activity)\n * If provided, overrides mobile SDK default CTA\n */\n ctaButtonText?: string;\n /**\n * CTA deep link (optional backend override for Live Activity)\n * If provided, overrides mobile SDK default CTA\n */\n ctaDeepLink?: string;\n}\n\n// ============================================\n// Stage & Queue Types\n// ============================================\n\n/**\n * Stage information for multi-step jobs\n */\nexport interface StageInfo {\n /** Current stage name */\n name: string;\n /** Current stage index (1-based) */\n current: number;\n /** Total number of stages */\n total: number;\n /** Optional stage description */\n description?: string;\n}\n\n/**\n * Queue position information\n */\nexport interface QueueInfo {\n /** Position in queue (1-based) */\n position: number;\n /** Total items in queue */\n total?: number;\n /** Queue name/identifier */\n queueName?: string;\n}\n\n// ============================================\n// Result & Error Types\n// ============================================\n\n/**\n * Job result on successful completion\n */\nexport interface JobResult {\n /** Result type (e.g., 'video', 'image', 'file') */\n type?: string;\n /** Result URL if applicable */\n url?: string;\n /** Additional result data */\n data?: Record<string, unknown>;\n}\n\n/**\n * Error details on job failure\n */\nexport interface JobError {\n /** Error code for programmatic handling */\n code: string;\n /** Human-readable error message */\n message: string;\n /** Additional error details */\n details?: Record<string, unknown>;\n}\n\n// ============================================\n// Parent-Child Types\n// ============================================\n\n/**\n * Parent info for child jobs\n */\nexport interface ParentInfo {\n /** Parent job ID */\n parentJobId: string;\n /** Child index within parent (0-based) */\n childIndex: number;\n}\n\n/**\n * Children stats for parent jobs\n */\nexport interface ChildrenStats {\n /** Total number of children */\n total: number;\n /** Number of completed children */\n completed: number;\n /** Number of failed children */\n failed: number;\n /** Number of running children */\n running: number;\n /** Number of pending children */\n pending: number;\n}\n\n/**\n * Summary of a child job (used in parent.children array)\n */\nexport interface ChildJobSummary {\n /** Child job ID */\n id: string;\n /** Child index within parent (0-based) */\n childIndex: number;\n /** Child job title */\n title: string;\n /** Child job status */\n status: JobStatus;\n /** Child progress (0-100) */\n progress: number;\n /** Child status message */\n message?: string;\n /** Child result */\n result?: JobResult;\n /** Child error */\n error?: JobError;\n /** Child creation timestamp */\n createdAt: string;\n /** Child last update timestamp */\n updatedAt: string;\n /** Child completion timestamp */\n completedAt?: string;\n}\n\n/**\n * Parent job with all its children\n */\nexport interface ParentWithChildren {\n /** Parent job */\n parent: SeennJob;\n /** List of child jobs */\n children: ChildJobSummary[];\n}\n\n// ============================================\n// SSE Types\n// ============================================\n\n/**\n * Connection state for SSE\n */\nexport type ConnectionState =\n | 'disconnected'\n | 'connecting'\n | 'connected'\n | 'reconnecting';\n\n/**\n * SSE event types\n */\nexport type SSEEventType =\n | 'connected'\n | 'job.sync'\n | 'job.started'\n | 'job.progress'\n | 'job.completed'\n | 'job.failed'\n | 'job.cancelled'\n | 'child.progress'\n | 'parent.updated'\n | 'in_app_message'\n | 'connection.idle'\n | 'heartbeat'\n | 'error';\n\n/**\n * SSE event wrapper\n */\nexport interface SSEEvent {\n /** Event type */\n event: SSEEventType;\n /** Event data */\n data: unknown;\n /** Event ID for replay */\n id?: string;\n}\n\n// ============================================\n// In-App Message Types\n// ============================================\n\n/**\n * In-app message types\n */\nexport type InAppMessageType =\n | 'job_complete_banner'\n | 'job_failed_modal'\n | 'job_toast';\n\n/**\n * In-app message for UI notifications\n */\nexport interface InAppMessage {\n /** Message ID */\n messageId: string;\n /** Message type */\n type: InAppMessageType;\n /** Associated job ID */\n jobId: string;\n /** Message title */\n title: string;\n /** Message body */\n body?: string;\n /** Call-to-action text */\n cta?: string;\n /** Call-to-action URL */\n ctaUrl?: string;\n}\n\n// ============================================\n// API Types\n// ============================================\n\n/**\n * Create job request parameters\n */\nexport interface CreateJobParams {\n /** User ID */\n userId: string;\n /** Job type */\n jobType: string;\n /** Job title */\n title: string;\n /** Workflow ID for ETA tracking (default: jobType) */\n workflowId?: string;\n /** Initial message */\n message?: string;\n /** Custom metadata */\n metadata?: Record<string, unknown>;\n /** Estimated duration in ms (for ETA default) */\n estimatedDuration?: number;\n /** Parent job ID (for child jobs) */\n parentJobId?: string;\n /** Child index (for child jobs) */\n childIndex?: number;\n /** Total children (for parent jobs) */\n totalChildren?: number;\n /** Child progress mode (for parent jobs) */\n childProgressMode?: ChildProgressMode;\n}\n\n/**\n * Update job request parameters\n */\nexport interface UpdateJobParams {\n /** New progress (0-100) */\n progress?: number;\n /** New message */\n message?: string;\n /** New stage info */\n stage?: StageInfo;\n /** Custom metadata to merge */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Complete job request parameters\n */\nexport interface CompleteJobParams {\n /** Job result */\n result?: JobResult;\n /** Final message */\n message?: string;\n}\n\n/**\n * Fail job request parameters\n */\nexport interface FailJobParams {\n /** Error details */\n error: JobError;\n}\n\n// ============================================\n// Webhook Types\n// ============================================\n\n/**\n * Webhook event types\n */\nexport type WebhookEventType =\n | 'job.started'\n | 'job.progress'\n | 'job.completed'\n | 'job.failed'\n | 'job.cancelled';\n\n/**\n * Webhook payload\n */\nexport interface WebhookPayload {\n /** Event type */\n event: WebhookEventType;\n /** Job data */\n job: SeennJob;\n /** Event timestamp (ISO 8601) */\n timestamp: string;\n /** Webhook delivery ID */\n deliveryId: string;\n}\n\n// ============================================\n// ETA Types\n// ============================================\n\n/**\n * ETA statistics for a workflow/jobType\n */\nexport interface EtaStats {\n /** ETA key (workflowId or jobType) */\n etaKey: string;\n /** Number of completed jobs */\n count: number;\n /** Average duration in ms */\n avgDuration: number;\n /** Minimum duration in ms */\n minDuration: number;\n /** Maximum duration in ms */\n maxDuration: number;\n /** Default duration if no history */\n defaultDuration?: number;\n /** Last updated timestamp */\n lastUpdated: string;\n}\n\n// ============================================\n// SDK Configuration Types\n// ============================================\n\n/**\n * Connection mode for real-time updates\n */\nexport type ConnectionMode = 'sse' | 'polling';\n\n/**\n * iOS push authorization mode\n * - 'standard': Shows permission prompt, full push access\n * - 'provisional': No prompt, quiet notifications only (iOS 12+)\n */\nexport type PushAuthorizationMode = 'standard' | 'provisional';\n\n/**\n * Base SDK configuration\n */\nexport interface SeennConfig {\n /** API base URL */\n baseUrl: string;\n /** API key (pk_* for client SDKs, sk_* for server SDKs) */\n apiKey?: string;\n /** API base path prefix (default: '/v1'). Self-hosted backends can use custom paths. */\n basePath?: string;\n /** SSE endpoint URL (default: baseUrl + basePath + /sse) */\n sseUrl?: string;\n /** Connection mode: 'sse' (default) or 'polling' (for self-hosted) */\n mode?: ConnectionMode;\n /** Polling interval in ms (default: 5000, only used when mode is 'polling') */\n pollInterval?: number;\n /** Enable auto-reconnect (default: true) */\n reconnect?: boolean;\n /** Reconnect interval in ms (default: 1000) */\n reconnectInterval?: number;\n /** Max reconnect attempts (default: 10) */\n maxReconnectAttempts?: number;\n /** Enable debug logging (default: false) */\n debug?: boolean;\n /** iOS push authorization mode (default: 'standard') */\n pushAuthorizationMode?: PushAuthorizationMode;\n}\n\n// ============================================\n// Push Authorization Types (iOS)\n// ============================================\n\n/**\n * iOS push authorization status\n * - 'notDetermined': Permission never requested\n * - 'denied': User denied permission\n * - 'authorized': Full push access granted\n * - 'provisional': Quiet notifications only (iOS 12+)\n * - 'ephemeral': App Clips only (iOS 14+)\n */\nexport type PushAuthorizationStatus =\n | 'notDetermined'\n | 'denied'\n | 'authorized'\n | 'provisional'\n | 'ephemeral';\n\n/**\n * Push authorization information\n */\nexport interface PushAuthorizationInfo {\n /** Current authorization status */\n status: PushAuthorizationStatus;\n /** Whether current authorization is provisional */\n isProvisional: boolean;\n /** Whether user can be prompted to upgrade to full authorization */\n canRequestFullAuthorization: boolean;\n}\n\n// ============================================\n// Live Activity Types (iOS/Android)\n// ============================================\n\n/**\n * Live Activity start parameters\n */\nexport interface LiveActivityStartParams {\n /** Job ID */\n jobId: string;\n /** Activity title */\n title: string;\n /** Job type for icon selection */\n jobType?: string;\n /** Initial progress (0-100) */\n initialProgress?: number;\n /** Initial message */\n initialMessage?: string;\n}\n\n/**\n * Live Activity update parameters\n */\nexport interface LiveActivityUpdateParams {\n /** Job ID */\n jobId: string;\n /** New progress (0-100) */\n progress?: number;\n /** New status */\n status?: JobStatus;\n /** New message */\n message?: string;\n /** Stage info */\n stage?: StageInfo;\n /** ETA timestamp (Unix ms) */\n estimatedEndTime?: number;\n}\n\n/**\n * Live Activity end parameters\n */\nexport interface LiveActivityEndParams {\n /** Job ID */\n jobId: string;\n /** Final status */\n finalStatus?: JobStatus;\n /** Final progress */\n finalProgress?: number;\n /** Final message */\n message?: string;\n /** Result URL */\n resultUrl?: string;\n /** Error message */\n errorMessage?: string;\n /** Dismiss after seconds (default: 300) */\n dismissAfter?: number;\n /** CTA button to show on completion/failure */\n ctaButton?: LiveActivityCTAButton;\n}\n\n/**\n * Live Activity result\n */\nexport interface LiveActivityResult {\n /** Success flag */\n success: boolean;\n /** Activity ID (platform-specific) */\n activityId?: string;\n /** Associated job ID */\n jobId?: string;\n /** Error message if failed */\n error?: string;\n}\n\n/**\n * Push token event for Live Activity updates\n */\nexport interface LiveActivityPushTokenEvent {\n /** Job ID */\n jobId: string;\n /** APNs push token */\n token: string;\n}\n\n// ============================================\n// Live Activity CTA Button Types\n// ============================================\n\n/**\n * CTA (Call-to-Action) button style\n */\nexport type LiveActivityCTAButtonStyle = 'primary' | 'secondary' | 'outline';\n\n/**\n * CTA button configuration for Live Activity completion\n */\nexport interface LiveActivityCTAButton {\n /** Button text */\n text: string;\n /** Deep link URL to open when tapped */\n deepLink: string;\n /** Button style preset */\n style?: LiveActivityCTAButtonStyle;\n /** Custom background color (hex) */\n backgroundColor?: string;\n /** Custom text color (hex) */\n textColor?: string;\n /** Corner radius (default: 20) */\n cornerRadius?: number;\n}\n\n// ============================================\n// Live Activity Theme Configuration Types\n// ============================================\n\n/**\n * Gradient point positions\n */\nexport type GradientPoint =\n | 'top'\n | 'topLeading'\n | 'topTrailing'\n | 'leading'\n | 'trailing'\n | 'bottom'\n | 'bottomLeading'\n | 'bottomTrailing'\n | 'center';\n\n/**\n * Built-in theme presets\n */\nexport type LiveActivityThemePreset =\n | 'default'\n | 'gradient-sunset'\n | 'gradient-ocean'\n | 'gradient-purple'\n | 'minimal-dark'\n | 'minimal-light';\n\n/**\n * Color configuration for Live Activity\n */\nexport interface LiveActivityColors {\n /** Background color (hex) */\n background?: string;\n /** Primary text color (hex) */\n primary?: string;\n /** Secondary text color (hex) */\n secondary?: string;\n /** Progress bar fill color (hex) */\n progressBar?: string;\n /** Progress bar track color (hex) */\n progressTrack?: string;\n /** Status color for running state (hex) */\n statusRunning?: string;\n /** Status color for completed state (hex) */\n statusCompleted?: string;\n /** Status color for failed state (hex) */\n statusFailed?: string;\n}\n\n/**\n * Gradient configuration for Live Activity background\n */\nexport interface LiveActivityGradient {\n /** Gradient color stops (hex values) */\n colors: string[];\n /** Start point of gradient */\n startPoint?: GradientPoint;\n /** End point of gradient */\n endPoint?: GradientPoint;\n}\n\n/**\n * Layout configuration for Live Activity\n */\nexport interface LiveActivityLayout {\n /** Progress bar height in points */\n progressBarHeight?: number;\n /** Corner radius for progress bar */\n progressBarCornerRadius?: number;\n /** Overall corner radius */\n cornerRadius?: number;\n /** Show job type icon */\n showIcon?: boolean;\n /** Show ETA countdown */\n showEta?: boolean;\n /** Show current stage */\n showStage?: boolean;\n /** Show progress percentage text */\n showProgressText?: boolean;\n /** Compact mode for Dynamic Island */\n compactMode?: boolean;\n}\n\n/**\n * Font weight options\n */\nexport type FontWeight = 'regular' | 'medium' | 'semibold' | 'bold';\n\n/**\n * Font configuration\n */\nexport interface FontConfig {\n /** Font size in points */\n size?: number;\n /** Font weight */\n weight?: FontWeight;\n}\n\n/**\n * Font configuration for Live Activity text elements\n */\nexport interface LiveActivityFonts {\n /** Title text font */\n title?: FontConfig;\n /** Progress/percentage text font */\n progress?: FontConfig;\n /** Message text font */\n message?: FontConfig;\n /** Stage text font */\n stage?: FontConfig;\n /** ETA text font */\n eta?: FontConfig;\n}\n\n/**\n * Job type specific icon and color configuration\n */\nexport interface JobTypeConfig {\n /** SF Symbol name (iOS) */\n icon?: string;\n /** Icon tint color (hex) */\n color?: string;\n /** Custom display name */\n displayName?: string;\n}\n\n/**\n * CTA button default styling\n */\nexport interface LiveActivityCTAStyle {\n /** Background color (hex) */\n backgroundColor?: string;\n /** Text color (hex) */\n textColor?: string;\n /** Corner radius */\n cornerRadius?: number;\n /** Font configuration */\n font?: FontConfig;\n}\n\n/**\n * CTA button configuration in theme\n */\nexport interface LiveActivityCTAConfig {\n /** Default CTA button style */\n style?: LiveActivityCTAStyle;\n /** Show CTA on these statuses */\n showOn?: ('completed' | 'failed')[];\n}\n\n/**\n * Complete theme configuration for Live Activity\n */\nexport interface LiveActivityThemeConfig {\n /** Use a built-in preset as base */\n preset?: LiveActivityThemePreset;\n /** Custom colors (override preset) */\n colors?: LiveActivityColors;\n /** Gradient background (overrides solid color) */\n gradient?: LiveActivityGradient;\n /** Layout options */\n layout?: LiveActivityLayout;\n /** Font configuration */\n fonts?: LiveActivityFonts;\n /** CTA button configuration */\n cta?: LiveActivityCTAConfig;\n}\n\n/**\n * Widget extension configuration\n */\nexport interface WidgetExtensionConfig {\n /** Widget extension name (default: 'SeennWidgetExtension') */\n name?: string;\n /** iOS deployment target (default: '16.1') */\n deploymentTarget?: string;\n /** App Groups identifier (auto-generated if not provided) */\n appGroupId?: string;\n}\n\n/**\n * Complete Seenn widget configuration file format\n */\nexport interface SeennWidgetConfig {\n /** Widget extension settings */\n widget?: WidgetExtensionConfig;\n /** Theme configuration */\n theme?: LiveActivityThemeConfig;\n /** Job type specific configurations */\n jobTypes?: Record<string, JobTypeConfig>;\n /** CTA button configuration */\n ctaButton?: LiveActivityCTAConfig;\n}\n\n// ============================================\n// Version & Compatibility\n// ============================================\n\n/**\n * SDK version info\n */\nexport const SDK_VERSION = '0.4.0';\n\n/**\n * Minimum API version required\n */\nexport const MIN_API_VERSION = '1.0.0';\n\n/**\n * SSE protocol version\n */\nexport const SSE_PROTOCOL_VERSION = '1.0';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgyBO,IAAM,cAAc;AAKpB,IAAM,kBAAkB;AAKxB,IAAM,uBAAuB;","names":[]}
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/index.ts
2
- var SDK_VERSION = "0.2.0";
2
+ var SDK_VERSION = "0.4.0";
3
3
  var MIN_API_VERSION = "1.0.0";
4
4
  var SSE_PROTOCOL_VERSION = "1.0";
5
5
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @seenn/types - Shared TypeScript types for Seenn SDKs\n *\n * This package is the single source of truth for all Seenn type definitions.\n * All SDK packages (react-native, node, flutter) should depend on this package.\n *\n * @version 0.1.0\n * @license MIT\n */\n\n// ============================================\n// Core Job Types\n// ============================================\n\n/**\n * Job status values\n */\nexport type JobStatus =\n | 'pending'\n | 'queued'\n | 'running'\n | 'completed'\n | 'failed'\n | 'cancelled';\n\n/**\n * How parent job progress is calculated from children\n */\nexport type ChildProgressMode = 'average' | 'weighted' | 'sequential';\n\n/**\n * Main job object returned by API and SSE\n */\nexport interface SeennJob {\n /** Unique job identifier (ULID format) */\n jobId: string;\n /** User who owns this job */\n userId: string;\n /** Application ID */\n appId: string;\n /** Current job status */\n status: JobStatus;\n /** Human-readable job title */\n title: string;\n /** Job type for categorization */\n jobType: string;\n /** Workflow ID for ETA tracking (default: jobType) */\n workflowId?: string;\n /** Progress percentage (0-100) */\n progress: number;\n /** Current status message */\n message?: string;\n /** Stage information for multi-step jobs */\n stage?: StageInfo;\n /** Estimated completion timestamp (ISO 8601) */\n estimatedCompletionAt?: string;\n /** ETA confidence score (0.0 - 1.0) */\n etaConfidence?: number;\n /** Number of historical jobs used to calculate ETA */\n etaBasedOn?: number;\n /** Queue position info */\n queue?: QueueInfo;\n /** Job result on completion */\n result?: JobResult;\n /** Error details on failure */\n error?: JobError;\n /** Custom metadata */\n metadata?: Record<string, unknown>;\n /** Parent info (if this is a child job) */\n parent?: ParentInfo;\n /** Children stats (if this is a parent job) */\n children?: ChildrenStats;\n /** Progress calculation mode for parent jobs */\n childProgressMode?: ChildProgressMode;\n /** Job creation timestamp (ISO 8601) */\n createdAt: string;\n /** Last update timestamp (ISO 8601) */\n updatedAt: string;\n /** When the job started running (ISO 8601) */\n startedAt?: string;\n /** Job completion timestamp (ISO 8601) */\n completedAt?: string;\n}\n\n// ============================================\n// Stage & Queue Types\n// ============================================\n\n/**\n * Stage information for multi-step jobs\n */\nexport interface StageInfo {\n /** Current stage name */\n name: string;\n /** Current stage index (1-based) */\n current: number;\n /** Total number of stages */\n total: number;\n /** Optional stage description */\n description?: string;\n}\n\n/**\n * Queue position information\n */\nexport interface QueueInfo {\n /** Position in queue (1-based) */\n position: number;\n /** Total items in queue */\n total?: number;\n /** Queue name/identifier */\n queueName?: string;\n}\n\n// ============================================\n// Result & Error Types\n// ============================================\n\n/**\n * Job result on successful completion\n */\nexport interface JobResult {\n /** Result type (e.g., 'video', 'image', 'file') */\n type?: string;\n /** Result URL if applicable */\n url?: string;\n /** Additional result data */\n data?: Record<string, unknown>;\n}\n\n/**\n * Error details on job failure\n */\nexport interface JobError {\n /** Error code for programmatic handling */\n code: string;\n /** Human-readable error message */\n message: string;\n /** Additional error details */\n details?: Record<string, unknown>;\n}\n\n// ============================================\n// Parent-Child Types\n// ============================================\n\n/**\n * Parent info for child jobs\n */\nexport interface ParentInfo {\n /** Parent job ID */\n parentJobId: string;\n /** Child index within parent (0-based) */\n childIndex: number;\n}\n\n/**\n * Children stats for parent jobs\n */\nexport interface ChildrenStats {\n /** Total number of children */\n total: number;\n /** Number of completed children */\n completed: number;\n /** Number of failed children */\n failed: number;\n /** Number of running children */\n running: number;\n /** Number of pending children */\n pending: number;\n}\n\n/**\n * Summary of a child job (used in parent.children array)\n */\nexport interface ChildJobSummary {\n /** Child job ID */\n id: string;\n /** Child index within parent (0-based) */\n childIndex: number;\n /** Child job title */\n title: string;\n /** Child job status */\n status: JobStatus;\n /** Child progress (0-100) */\n progress: number;\n /** Child status message */\n message?: string;\n /** Child result */\n result?: JobResult;\n /** Child error */\n error?: JobError;\n /** Child creation timestamp */\n createdAt: string;\n /** Child last update timestamp */\n updatedAt: string;\n /** Child completion timestamp */\n completedAt?: string;\n}\n\n/**\n * Parent job with all its children\n */\nexport interface ParentWithChildren {\n /** Parent job */\n parent: SeennJob;\n /** List of child jobs */\n children: ChildJobSummary[];\n}\n\n// ============================================\n// SSE Types\n// ============================================\n\n/**\n * Connection state for SSE\n */\nexport type ConnectionState =\n | 'disconnected'\n | 'connecting'\n | 'connected'\n | 'reconnecting';\n\n/**\n * SSE event types\n */\nexport type SSEEventType =\n | 'connected'\n | 'job.sync'\n | 'job.started'\n | 'job.progress'\n | 'job.completed'\n | 'job.failed'\n | 'job.cancelled'\n | 'child.progress'\n | 'parent.updated'\n | 'in_app_message'\n | 'connection.idle'\n | 'heartbeat'\n | 'error';\n\n/**\n * SSE event wrapper\n */\nexport interface SSEEvent {\n /** Event type */\n event: SSEEventType;\n /** Event data */\n data: unknown;\n /** Event ID for replay */\n id?: string;\n}\n\n// ============================================\n// In-App Message Types\n// ============================================\n\n/**\n * In-app message types\n */\nexport type InAppMessageType =\n | 'job_complete_banner'\n | 'job_failed_modal'\n | 'job_toast';\n\n/**\n * In-app message for UI notifications\n */\nexport interface InAppMessage {\n /** Message ID */\n messageId: string;\n /** Message type */\n type: InAppMessageType;\n /** Associated job ID */\n jobId: string;\n /** Message title */\n title: string;\n /** Message body */\n body?: string;\n /** Call-to-action text */\n cta?: string;\n /** Call-to-action URL */\n ctaUrl?: string;\n}\n\n// ============================================\n// API Types\n// ============================================\n\n/**\n * Create job request parameters\n */\nexport interface CreateJobParams {\n /** User ID */\n userId: string;\n /** Job type */\n jobType: string;\n /** Job title */\n title: string;\n /** Workflow ID for ETA tracking (default: jobType) */\n workflowId?: string;\n /** Initial message */\n message?: string;\n /** Custom metadata */\n metadata?: Record<string, unknown>;\n /** Estimated duration in ms (for ETA default) */\n estimatedDuration?: number;\n /** Parent job ID (for child jobs) */\n parentJobId?: string;\n /** Child index (for child jobs) */\n childIndex?: number;\n /** Total children (for parent jobs) */\n totalChildren?: number;\n /** Child progress mode (for parent jobs) */\n childProgressMode?: ChildProgressMode;\n}\n\n/**\n * Update job request parameters\n */\nexport interface UpdateJobParams {\n /** New progress (0-100) */\n progress?: number;\n /** New message */\n message?: string;\n /** New stage info */\n stage?: StageInfo;\n /** Custom metadata to merge */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Complete job request parameters\n */\nexport interface CompleteJobParams {\n /** Job result */\n result?: JobResult;\n /** Final message */\n message?: string;\n}\n\n/**\n * Fail job request parameters\n */\nexport interface FailJobParams {\n /** Error details */\n error: JobError;\n}\n\n// ============================================\n// Webhook Types\n// ============================================\n\n/**\n * Webhook event types\n */\nexport type WebhookEventType =\n | 'job.started'\n | 'job.progress'\n | 'job.completed'\n | 'job.failed'\n | 'job.cancelled';\n\n/**\n * Webhook payload\n */\nexport interface WebhookPayload {\n /** Event type */\n event: WebhookEventType;\n /** Job data */\n job: SeennJob;\n /** Event timestamp (ISO 8601) */\n timestamp: string;\n /** Webhook delivery ID */\n deliveryId: string;\n}\n\n// ============================================\n// ETA Types\n// ============================================\n\n/**\n * ETA statistics for a workflow/jobType\n */\nexport interface EtaStats {\n /** ETA key (workflowId or jobType) */\n etaKey: string;\n /** Number of completed jobs */\n count: number;\n /** Average duration in ms */\n avgDuration: number;\n /** Minimum duration in ms */\n minDuration: number;\n /** Maximum duration in ms */\n maxDuration: number;\n /** Default duration if no history */\n defaultDuration?: number;\n /** Last updated timestamp */\n lastUpdated: string;\n}\n\n// ============================================\n// SDK Configuration Types\n// ============================================\n\n/**\n * Connection mode for real-time updates\n */\nexport type ConnectionMode = 'sse' | 'polling';\n\n/**\n * Base SDK configuration\n */\nexport interface SeennConfig {\n /** API base URL */\n baseUrl: string;\n /** API key (pk_* for client SDKs, sk_* for server SDKs) */\n apiKey?: string;\n /** API base path prefix (default: '/v1'). Self-hosted backends can use custom paths. */\n basePath?: string;\n /** SSE endpoint URL (default: baseUrl + basePath + /sse) */\n sseUrl?: string;\n /** Connection mode: 'sse' (default) or 'polling' (for self-hosted) */\n mode?: ConnectionMode;\n /** Polling interval in ms (default: 5000, only used when mode is 'polling') */\n pollInterval?: number;\n /** Enable auto-reconnect (default: true) */\n reconnect?: boolean;\n /** Reconnect interval in ms (default: 1000) */\n reconnectInterval?: number;\n /** Max reconnect attempts (default: 10) */\n maxReconnectAttempts?: number;\n /** Enable debug logging (default: false) */\n debug?: boolean;\n}\n\n// ============================================\n// Live Activity Types (iOS/Android)\n// ============================================\n\n/**\n * Live Activity start parameters\n */\nexport interface LiveActivityStartParams {\n /** Job ID */\n jobId: string;\n /** Activity title */\n title: string;\n /** Job type for icon selection */\n jobType?: string;\n /** Initial progress (0-100) */\n initialProgress?: number;\n /** Initial message */\n initialMessage?: string;\n}\n\n/**\n * Live Activity update parameters\n */\nexport interface LiveActivityUpdateParams {\n /** Job ID */\n jobId: string;\n /** New progress (0-100) */\n progress?: number;\n /** New status */\n status?: JobStatus;\n /** New message */\n message?: string;\n /** Stage info */\n stage?: StageInfo;\n /** ETA timestamp (Unix ms) */\n estimatedEndTime?: number;\n}\n\n/**\n * Live Activity end parameters\n */\nexport interface LiveActivityEndParams {\n /** Job ID */\n jobId: string;\n /** Final status */\n finalStatus?: JobStatus;\n /** Final progress */\n finalProgress?: number;\n /** Final message */\n message?: string;\n /** Result URL */\n resultUrl?: string;\n /** Error message */\n errorMessage?: string;\n /** Dismiss after seconds (default: 300) */\n dismissAfter?: number;\n}\n\n/**\n * Live Activity result\n */\nexport interface LiveActivityResult {\n /** Success flag */\n success: boolean;\n /** Activity ID (platform-specific) */\n activityId?: string;\n /** Associated job ID */\n jobId?: string;\n /** Error message if failed */\n error?: string;\n}\n\n/**\n * Push token event for Live Activity updates\n */\nexport interface LiveActivityPushTokenEvent {\n /** Job ID */\n jobId: string;\n /** APNs push token */\n token: string;\n}\n\n// ============================================\n// Version & Compatibility\n// ============================================\n\n/**\n * SDK version info\n */\nexport const SDK_VERSION = '0.2.0';\n\n/**\n * Minimum API version required\n */\nexport const MIN_API_VERSION = '1.0.0';\n\n/**\n * SSE protocol version\n */\nexport const SSE_PROTOCOL_VERSION = '1.0';\n"],"mappings":";AA6gBO,IAAM,cAAc;AAKpB,IAAM,kBAAkB;AAKxB,IAAM,uBAAuB;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @seenn/types - Shared TypeScript types for Seenn SDKs\n *\n * This package is the single source of truth for all Seenn type definitions.\n * All SDK packages (react-native, node, flutter) should depend on this package.\n *\n * @version 0.1.0\n * @license MIT\n */\n\n// ============================================\n// Core Job Types\n// ============================================\n\n/**\n * Job status values\n */\nexport type JobStatus =\n | 'pending'\n | 'queued'\n | 'running'\n | 'completed'\n | 'failed'\n | 'cancelled';\n\n/**\n * How parent job progress is calculated from children\n */\nexport type ChildProgressMode = 'average' | 'weighted' | 'sequential';\n\n/**\n * Main job object returned by API and SSE\n */\nexport interface SeennJob {\n /** Unique job identifier (ULID format) */\n jobId: string;\n /** User who owns this job */\n userId: string;\n /** Application ID */\n appId: string;\n /** Current job status */\n status: JobStatus;\n /** Human-readable job title */\n title: string;\n /** Job type for categorization */\n jobType: string;\n /** Workflow ID for ETA tracking (default: jobType) */\n workflowId?: string;\n /** Progress percentage (0-100) */\n progress: number;\n /** Current status message */\n message?: string;\n /** Stage information for multi-step jobs */\n stage?: StageInfo;\n /** Estimated completion timestamp (ISO 8601) */\n estimatedCompletionAt?: string;\n /** ETA confidence score (0.0 - 1.0) */\n etaConfidence?: number;\n /** Number of historical jobs used to calculate ETA */\n etaBasedOn?: number;\n /** Queue position info */\n queue?: QueueInfo;\n /** Job result on completion */\n result?: JobResult;\n /** Error details on failure */\n error?: JobError;\n /** Custom metadata */\n metadata?: Record<string, unknown>;\n /** Parent info (if this is a child job) */\n parent?: ParentInfo;\n /** Children stats (if this is a parent job) */\n children?: ChildrenStats;\n /** Progress calculation mode for parent jobs */\n childProgressMode?: ChildProgressMode;\n /** Job creation timestamp (ISO 8601) */\n createdAt: string;\n /** Last update timestamp (ISO 8601) */\n updatedAt: string;\n /** When the job started running (ISO 8601) */\n startedAt?: string;\n /** Job completion timestamp (ISO 8601) */\n completedAt?: string;\n /**\n * CTA button text (optional backend override for Live Activity)\n * If provided, overrides mobile SDK default CTA\n */\n ctaButtonText?: string;\n /**\n * CTA deep link (optional backend override for Live Activity)\n * If provided, overrides mobile SDK default CTA\n */\n ctaDeepLink?: string;\n}\n\n// ============================================\n// Stage & Queue Types\n// ============================================\n\n/**\n * Stage information for multi-step jobs\n */\nexport interface StageInfo {\n /** Current stage name */\n name: string;\n /** Current stage index (1-based) */\n current: number;\n /** Total number of stages */\n total: number;\n /** Optional stage description */\n description?: string;\n}\n\n/**\n * Queue position information\n */\nexport interface QueueInfo {\n /** Position in queue (1-based) */\n position: number;\n /** Total items in queue */\n total?: number;\n /** Queue name/identifier */\n queueName?: string;\n}\n\n// ============================================\n// Result & Error Types\n// ============================================\n\n/**\n * Job result on successful completion\n */\nexport interface JobResult {\n /** Result type (e.g., 'video', 'image', 'file') */\n type?: string;\n /** Result URL if applicable */\n url?: string;\n /** Additional result data */\n data?: Record<string, unknown>;\n}\n\n/**\n * Error details on job failure\n */\nexport interface JobError {\n /** Error code for programmatic handling */\n code: string;\n /** Human-readable error message */\n message: string;\n /** Additional error details */\n details?: Record<string, unknown>;\n}\n\n// ============================================\n// Parent-Child Types\n// ============================================\n\n/**\n * Parent info for child jobs\n */\nexport interface ParentInfo {\n /** Parent job ID */\n parentJobId: string;\n /** Child index within parent (0-based) */\n childIndex: number;\n}\n\n/**\n * Children stats for parent jobs\n */\nexport interface ChildrenStats {\n /** Total number of children */\n total: number;\n /** Number of completed children */\n completed: number;\n /** Number of failed children */\n failed: number;\n /** Number of running children */\n running: number;\n /** Number of pending children */\n pending: number;\n}\n\n/**\n * Summary of a child job (used in parent.children array)\n */\nexport interface ChildJobSummary {\n /** Child job ID */\n id: string;\n /** Child index within parent (0-based) */\n childIndex: number;\n /** Child job title */\n title: string;\n /** Child job status */\n status: JobStatus;\n /** Child progress (0-100) */\n progress: number;\n /** Child status message */\n message?: string;\n /** Child result */\n result?: JobResult;\n /** Child error */\n error?: JobError;\n /** Child creation timestamp */\n createdAt: string;\n /** Child last update timestamp */\n updatedAt: string;\n /** Child completion timestamp */\n completedAt?: string;\n}\n\n/**\n * Parent job with all its children\n */\nexport interface ParentWithChildren {\n /** Parent job */\n parent: SeennJob;\n /** List of child jobs */\n children: ChildJobSummary[];\n}\n\n// ============================================\n// SSE Types\n// ============================================\n\n/**\n * Connection state for SSE\n */\nexport type ConnectionState =\n | 'disconnected'\n | 'connecting'\n | 'connected'\n | 'reconnecting';\n\n/**\n * SSE event types\n */\nexport type SSEEventType =\n | 'connected'\n | 'job.sync'\n | 'job.started'\n | 'job.progress'\n | 'job.completed'\n | 'job.failed'\n | 'job.cancelled'\n | 'child.progress'\n | 'parent.updated'\n | 'in_app_message'\n | 'connection.idle'\n | 'heartbeat'\n | 'error';\n\n/**\n * SSE event wrapper\n */\nexport interface SSEEvent {\n /** Event type */\n event: SSEEventType;\n /** Event data */\n data: unknown;\n /** Event ID for replay */\n id?: string;\n}\n\n// ============================================\n// In-App Message Types\n// ============================================\n\n/**\n * In-app message types\n */\nexport type InAppMessageType =\n | 'job_complete_banner'\n | 'job_failed_modal'\n | 'job_toast';\n\n/**\n * In-app message for UI notifications\n */\nexport interface InAppMessage {\n /** Message ID */\n messageId: string;\n /** Message type */\n type: InAppMessageType;\n /** Associated job ID */\n jobId: string;\n /** Message title */\n title: string;\n /** Message body */\n body?: string;\n /** Call-to-action text */\n cta?: string;\n /** Call-to-action URL */\n ctaUrl?: string;\n}\n\n// ============================================\n// API Types\n// ============================================\n\n/**\n * Create job request parameters\n */\nexport interface CreateJobParams {\n /** User ID */\n userId: string;\n /** Job type */\n jobType: string;\n /** Job title */\n title: string;\n /** Workflow ID for ETA tracking (default: jobType) */\n workflowId?: string;\n /** Initial message */\n message?: string;\n /** Custom metadata */\n metadata?: Record<string, unknown>;\n /** Estimated duration in ms (for ETA default) */\n estimatedDuration?: number;\n /** Parent job ID (for child jobs) */\n parentJobId?: string;\n /** Child index (for child jobs) */\n childIndex?: number;\n /** Total children (for parent jobs) */\n totalChildren?: number;\n /** Child progress mode (for parent jobs) */\n childProgressMode?: ChildProgressMode;\n}\n\n/**\n * Update job request parameters\n */\nexport interface UpdateJobParams {\n /** New progress (0-100) */\n progress?: number;\n /** New message */\n message?: string;\n /** New stage info */\n stage?: StageInfo;\n /** Custom metadata to merge */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Complete job request parameters\n */\nexport interface CompleteJobParams {\n /** Job result */\n result?: JobResult;\n /** Final message */\n message?: string;\n}\n\n/**\n * Fail job request parameters\n */\nexport interface FailJobParams {\n /** Error details */\n error: JobError;\n}\n\n// ============================================\n// Webhook Types\n// ============================================\n\n/**\n * Webhook event types\n */\nexport type WebhookEventType =\n | 'job.started'\n | 'job.progress'\n | 'job.completed'\n | 'job.failed'\n | 'job.cancelled';\n\n/**\n * Webhook payload\n */\nexport interface WebhookPayload {\n /** Event type */\n event: WebhookEventType;\n /** Job data */\n job: SeennJob;\n /** Event timestamp (ISO 8601) */\n timestamp: string;\n /** Webhook delivery ID */\n deliveryId: string;\n}\n\n// ============================================\n// ETA Types\n// ============================================\n\n/**\n * ETA statistics for a workflow/jobType\n */\nexport interface EtaStats {\n /** ETA key (workflowId or jobType) */\n etaKey: string;\n /** Number of completed jobs */\n count: number;\n /** Average duration in ms */\n avgDuration: number;\n /** Minimum duration in ms */\n minDuration: number;\n /** Maximum duration in ms */\n maxDuration: number;\n /** Default duration if no history */\n defaultDuration?: number;\n /** Last updated timestamp */\n lastUpdated: string;\n}\n\n// ============================================\n// SDK Configuration Types\n// ============================================\n\n/**\n * Connection mode for real-time updates\n */\nexport type ConnectionMode = 'sse' | 'polling';\n\n/**\n * iOS push authorization mode\n * - 'standard': Shows permission prompt, full push access\n * - 'provisional': No prompt, quiet notifications only (iOS 12+)\n */\nexport type PushAuthorizationMode = 'standard' | 'provisional';\n\n/**\n * Base SDK configuration\n */\nexport interface SeennConfig {\n /** API base URL */\n baseUrl: string;\n /** API key (pk_* for client SDKs, sk_* for server SDKs) */\n apiKey?: string;\n /** API base path prefix (default: '/v1'). Self-hosted backends can use custom paths. */\n basePath?: string;\n /** SSE endpoint URL (default: baseUrl + basePath + /sse) */\n sseUrl?: string;\n /** Connection mode: 'sse' (default) or 'polling' (for self-hosted) */\n mode?: ConnectionMode;\n /** Polling interval in ms (default: 5000, only used when mode is 'polling') */\n pollInterval?: number;\n /** Enable auto-reconnect (default: true) */\n reconnect?: boolean;\n /** Reconnect interval in ms (default: 1000) */\n reconnectInterval?: number;\n /** Max reconnect attempts (default: 10) */\n maxReconnectAttempts?: number;\n /** Enable debug logging (default: false) */\n debug?: boolean;\n /** iOS push authorization mode (default: 'standard') */\n pushAuthorizationMode?: PushAuthorizationMode;\n}\n\n// ============================================\n// Push Authorization Types (iOS)\n// ============================================\n\n/**\n * iOS push authorization status\n * - 'notDetermined': Permission never requested\n * - 'denied': User denied permission\n * - 'authorized': Full push access granted\n * - 'provisional': Quiet notifications only (iOS 12+)\n * - 'ephemeral': App Clips only (iOS 14+)\n */\nexport type PushAuthorizationStatus =\n | 'notDetermined'\n | 'denied'\n | 'authorized'\n | 'provisional'\n | 'ephemeral';\n\n/**\n * Push authorization information\n */\nexport interface PushAuthorizationInfo {\n /** Current authorization status */\n status: PushAuthorizationStatus;\n /** Whether current authorization is provisional */\n isProvisional: boolean;\n /** Whether user can be prompted to upgrade to full authorization */\n canRequestFullAuthorization: boolean;\n}\n\n// ============================================\n// Live Activity Types (iOS/Android)\n// ============================================\n\n/**\n * Live Activity start parameters\n */\nexport interface LiveActivityStartParams {\n /** Job ID */\n jobId: string;\n /** Activity title */\n title: string;\n /** Job type for icon selection */\n jobType?: string;\n /** Initial progress (0-100) */\n initialProgress?: number;\n /** Initial message */\n initialMessage?: string;\n}\n\n/**\n * Live Activity update parameters\n */\nexport interface LiveActivityUpdateParams {\n /** Job ID */\n jobId: string;\n /** New progress (0-100) */\n progress?: number;\n /** New status */\n status?: JobStatus;\n /** New message */\n message?: string;\n /** Stage info */\n stage?: StageInfo;\n /** ETA timestamp (Unix ms) */\n estimatedEndTime?: number;\n}\n\n/**\n * Live Activity end parameters\n */\nexport interface LiveActivityEndParams {\n /** Job ID */\n jobId: string;\n /** Final status */\n finalStatus?: JobStatus;\n /** Final progress */\n finalProgress?: number;\n /** Final message */\n message?: string;\n /** Result URL */\n resultUrl?: string;\n /** Error message */\n errorMessage?: string;\n /** Dismiss after seconds (default: 300) */\n dismissAfter?: number;\n /** CTA button to show on completion/failure */\n ctaButton?: LiveActivityCTAButton;\n}\n\n/**\n * Live Activity result\n */\nexport interface LiveActivityResult {\n /** Success flag */\n success: boolean;\n /** Activity ID (platform-specific) */\n activityId?: string;\n /** Associated job ID */\n jobId?: string;\n /** Error message if failed */\n error?: string;\n}\n\n/**\n * Push token event for Live Activity updates\n */\nexport interface LiveActivityPushTokenEvent {\n /** Job ID */\n jobId: string;\n /** APNs push token */\n token: string;\n}\n\n// ============================================\n// Live Activity CTA Button Types\n// ============================================\n\n/**\n * CTA (Call-to-Action) button style\n */\nexport type LiveActivityCTAButtonStyle = 'primary' | 'secondary' | 'outline';\n\n/**\n * CTA button configuration for Live Activity completion\n */\nexport interface LiveActivityCTAButton {\n /** Button text */\n text: string;\n /** Deep link URL to open when tapped */\n deepLink: string;\n /** Button style preset */\n style?: LiveActivityCTAButtonStyle;\n /** Custom background color (hex) */\n backgroundColor?: string;\n /** Custom text color (hex) */\n textColor?: string;\n /** Corner radius (default: 20) */\n cornerRadius?: number;\n}\n\n// ============================================\n// Live Activity Theme Configuration Types\n// ============================================\n\n/**\n * Gradient point positions\n */\nexport type GradientPoint =\n | 'top'\n | 'topLeading'\n | 'topTrailing'\n | 'leading'\n | 'trailing'\n | 'bottom'\n | 'bottomLeading'\n | 'bottomTrailing'\n | 'center';\n\n/**\n * Built-in theme presets\n */\nexport type LiveActivityThemePreset =\n | 'default'\n | 'gradient-sunset'\n | 'gradient-ocean'\n | 'gradient-purple'\n | 'minimal-dark'\n | 'minimal-light';\n\n/**\n * Color configuration for Live Activity\n */\nexport interface LiveActivityColors {\n /** Background color (hex) */\n background?: string;\n /** Primary text color (hex) */\n primary?: string;\n /** Secondary text color (hex) */\n secondary?: string;\n /** Progress bar fill color (hex) */\n progressBar?: string;\n /** Progress bar track color (hex) */\n progressTrack?: string;\n /** Status color for running state (hex) */\n statusRunning?: string;\n /** Status color for completed state (hex) */\n statusCompleted?: string;\n /** Status color for failed state (hex) */\n statusFailed?: string;\n}\n\n/**\n * Gradient configuration for Live Activity background\n */\nexport interface LiveActivityGradient {\n /** Gradient color stops (hex values) */\n colors: string[];\n /** Start point of gradient */\n startPoint?: GradientPoint;\n /** End point of gradient */\n endPoint?: GradientPoint;\n}\n\n/**\n * Layout configuration for Live Activity\n */\nexport interface LiveActivityLayout {\n /** Progress bar height in points */\n progressBarHeight?: number;\n /** Corner radius for progress bar */\n progressBarCornerRadius?: number;\n /** Overall corner radius */\n cornerRadius?: number;\n /** Show job type icon */\n showIcon?: boolean;\n /** Show ETA countdown */\n showEta?: boolean;\n /** Show current stage */\n showStage?: boolean;\n /** Show progress percentage text */\n showProgressText?: boolean;\n /** Compact mode for Dynamic Island */\n compactMode?: boolean;\n}\n\n/**\n * Font weight options\n */\nexport type FontWeight = 'regular' | 'medium' | 'semibold' | 'bold';\n\n/**\n * Font configuration\n */\nexport interface FontConfig {\n /** Font size in points */\n size?: number;\n /** Font weight */\n weight?: FontWeight;\n}\n\n/**\n * Font configuration for Live Activity text elements\n */\nexport interface LiveActivityFonts {\n /** Title text font */\n title?: FontConfig;\n /** Progress/percentage text font */\n progress?: FontConfig;\n /** Message text font */\n message?: FontConfig;\n /** Stage text font */\n stage?: FontConfig;\n /** ETA text font */\n eta?: FontConfig;\n}\n\n/**\n * Job type specific icon and color configuration\n */\nexport interface JobTypeConfig {\n /** SF Symbol name (iOS) */\n icon?: string;\n /** Icon tint color (hex) */\n color?: string;\n /** Custom display name */\n displayName?: string;\n}\n\n/**\n * CTA button default styling\n */\nexport interface LiveActivityCTAStyle {\n /** Background color (hex) */\n backgroundColor?: string;\n /** Text color (hex) */\n textColor?: string;\n /** Corner radius */\n cornerRadius?: number;\n /** Font configuration */\n font?: FontConfig;\n}\n\n/**\n * CTA button configuration in theme\n */\nexport interface LiveActivityCTAConfig {\n /** Default CTA button style */\n style?: LiveActivityCTAStyle;\n /** Show CTA on these statuses */\n showOn?: ('completed' | 'failed')[];\n}\n\n/**\n * Complete theme configuration for Live Activity\n */\nexport interface LiveActivityThemeConfig {\n /** Use a built-in preset as base */\n preset?: LiveActivityThemePreset;\n /** Custom colors (override preset) */\n colors?: LiveActivityColors;\n /** Gradient background (overrides solid color) */\n gradient?: LiveActivityGradient;\n /** Layout options */\n layout?: LiveActivityLayout;\n /** Font configuration */\n fonts?: LiveActivityFonts;\n /** CTA button configuration */\n cta?: LiveActivityCTAConfig;\n}\n\n/**\n * Widget extension configuration\n */\nexport interface WidgetExtensionConfig {\n /** Widget extension name (default: 'SeennWidgetExtension') */\n name?: string;\n /** iOS deployment target (default: '16.1') */\n deploymentTarget?: string;\n /** App Groups identifier (auto-generated if not provided) */\n appGroupId?: string;\n}\n\n/**\n * Complete Seenn widget configuration file format\n */\nexport interface SeennWidgetConfig {\n /** Widget extension settings */\n widget?: WidgetExtensionConfig;\n /** Theme configuration */\n theme?: LiveActivityThemeConfig;\n /** Job type specific configurations */\n jobTypes?: Record<string, JobTypeConfig>;\n /** CTA button configuration */\n ctaButton?: LiveActivityCTAConfig;\n}\n\n// ============================================\n// Version & Compatibility\n// ============================================\n\n/**\n * SDK version info\n */\nexport const SDK_VERSION = '0.4.0';\n\n/**\n * Minimum API version required\n */\nexport const MIN_API_VERSION = '1.0.0';\n\n/**\n * SSE protocol version\n */\nexport const SSE_PROTOCOL_VERSION = '1.0';\n"],"mappings":";AAgyBO,IAAM,cAAc;AAKpB,IAAM,kBAAkB;AAKxB,IAAM,uBAAuB;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seenn/types",
3
- "version": "0.2.2",
3
+ "version": "0.4.0",
4
4
  "description": "Shared TypeScript types for Seenn SDKs",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -18,12 +18,6 @@
18
18
  "typescript",
19
19
  "job-tracking"
20
20
  ],
21
- "scripts": {
22
- "build": "tsup",
23
- "dev": "tsup --watch",
24
- "typecheck": "tsc --noEmit",
25
- "prepublishOnly": "pnpm build"
26
- },
27
21
  "devDependencies": {
28
22
  "tsup": "^8.0.1",
29
23
  "typescript": "^5.3.3"
@@ -35,5 +29,10 @@
35
29
  "publishConfig": {
36
30
  "access": "public"
37
31
  },
38
- "sideEffects": false
39
- }
32
+ "sideEffects": false,
33
+ "scripts": {
34
+ "build": "tsup",
35
+ "dev": "tsup --watch",
36
+ "typecheck": "tsc --noEmit"
37
+ }
38
+ }
package/src/index.ts CHANGED
@@ -80,6 +80,16 @@ export interface SeennJob {
80
80
  startedAt?: string;
81
81
  /** Job completion timestamp (ISO 8601) */
82
82
  completedAt?: string;
83
+ /**
84
+ * CTA button text (optional backend override for Live Activity)
85
+ * If provided, overrides mobile SDK default CTA
86
+ */
87
+ ctaButtonText?: string;
88
+ /**
89
+ * CTA deep link (optional backend override for Live Activity)
90
+ * If provided, overrides mobile SDK default CTA
91
+ */
92
+ ctaDeepLink?: string;
83
93
  }
84
94
 
85
95
  // ============================================
@@ -408,6 +418,13 @@ export interface EtaStats {
408
418
  */
409
419
  export type ConnectionMode = 'sse' | 'polling';
410
420
 
421
+ /**
422
+ * iOS push authorization mode
423
+ * - 'standard': Shows permission prompt, full push access
424
+ * - 'provisional': No prompt, quiet notifications only (iOS 12+)
425
+ */
426
+ export type PushAuthorizationMode = 'standard' | 'provisional';
427
+
411
428
  /**
412
429
  * Base SDK configuration
413
430
  */
@@ -432,6 +449,39 @@ export interface SeennConfig {
432
449
  maxReconnectAttempts?: number;
433
450
  /** Enable debug logging (default: false) */
434
451
  debug?: boolean;
452
+ /** iOS push authorization mode (default: 'standard') */
453
+ pushAuthorizationMode?: PushAuthorizationMode;
454
+ }
455
+
456
+ // ============================================
457
+ // Push Authorization Types (iOS)
458
+ // ============================================
459
+
460
+ /**
461
+ * iOS push authorization status
462
+ * - 'notDetermined': Permission never requested
463
+ * - 'denied': User denied permission
464
+ * - 'authorized': Full push access granted
465
+ * - 'provisional': Quiet notifications only (iOS 12+)
466
+ * - 'ephemeral': App Clips only (iOS 14+)
467
+ */
468
+ export type PushAuthorizationStatus =
469
+ | 'notDetermined'
470
+ | 'denied'
471
+ | 'authorized'
472
+ | 'provisional'
473
+ | 'ephemeral';
474
+
475
+ /**
476
+ * Push authorization information
477
+ */
478
+ export interface PushAuthorizationInfo {
479
+ /** Current authorization status */
480
+ status: PushAuthorizationStatus;
481
+ /** Whether current authorization is provisional */
482
+ isProvisional: boolean;
483
+ /** Whether user can be prompted to upgrade to full authorization */
484
+ canRequestFullAuthorization: boolean;
435
485
  }
436
486
 
437
487
  // ============================================
@@ -490,6 +540,8 @@ export interface LiveActivityEndParams {
490
540
  errorMessage?: string;
491
541
  /** Dismiss after seconds (default: 300) */
492
542
  dismissAfter?: number;
543
+ /** CTA button to show on completion/failure */
544
+ ctaButton?: LiveActivityCTAButton;
493
545
  }
494
546
 
495
547
  /**
@@ -516,6 +568,229 @@ export interface LiveActivityPushTokenEvent {
516
568
  token: string;
517
569
  }
518
570
 
571
+ // ============================================
572
+ // Live Activity CTA Button Types
573
+ // ============================================
574
+
575
+ /**
576
+ * CTA (Call-to-Action) button style
577
+ */
578
+ export type LiveActivityCTAButtonStyle = 'primary' | 'secondary' | 'outline';
579
+
580
+ /**
581
+ * CTA button configuration for Live Activity completion
582
+ */
583
+ export interface LiveActivityCTAButton {
584
+ /** Button text */
585
+ text: string;
586
+ /** Deep link URL to open when tapped */
587
+ deepLink: string;
588
+ /** Button style preset */
589
+ style?: LiveActivityCTAButtonStyle;
590
+ /** Custom background color (hex) */
591
+ backgroundColor?: string;
592
+ /** Custom text color (hex) */
593
+ textColor?: string;
594
+ /** Corner radius (default: 20) */
595
+ cornerRadius?: number;
596
+ }
597
+
598
+ // ============================================
599
+ // Live Activity Theme Configuration Types
600
+ // ============================================
601
+
602
+ /**
603
+ * Gradient point positions
604
+ */
605
+ export type GradientPoint =
606
+ | 'top'
607
+ | 'topLeading'
608
+ | 'topTrailing'
609
+ | 'leading'
610
+ | 'trailing'
611
+ | 'bottom'
612
+ | 'bottomLeading'
613
+ | 'bottomTrailing'
614
+ | 'center';
615
+
616
+ /**
617
+ * Built-in theme presets
618
+ */
619
+ export type LiveActivityThemePreset =
620
+ | 'default'
621
+ | 'gradient-sunset'
622
+ | 'gradient-ocean'
623
+ | 'gradient-purple'
624
+ | 'minimal-dark'
625
+ | 'minimal-light';
626
+
627
+ /**
628
+ * Color configuration for Live Activity
629
+ */
630
+ export interface LiveActivityColors {
631
+ /** Background color (hex) */
632
+ background?: string;
633
+ /** Primary text color (hex) */
634
+ primary?: string;
635
+ /** Secondary text color (hex) */
636
+ secondary?: string;
637
+ /** Progress bar fill color (hex) */
638
+ progressBar?: string;
639
+ /** Progress bar track color (hex) */
640
+ progressTrack?: string;
641
+ /** Status color for running state (hex) */
642
+ statusRunning?: string;
643
+ /** Status color for completed state (hex) */
644
+ statusCompleted?: string;
645
+ /** Status color for failed state (hex) */
646
+ statusFailed?: string;
647
+ }
648
+
649
+ /**
650
+ * Gradient configuration for Live Activity background
651
+ */
652
+ export interface LiveActivityGradient {
653
+ /** Gradient color stops (hex values) */
654
+ colors: string[];
655
+ /** Start point of gradient */
656
+ startPoint?: GradientPoint;
657
+ /** End point of gradient */
658
+ endPoint?: GradientPoint;
659
+ }
660
+
661
+ /**
662
+ * Layout configuration for Live Activity
663
+ */
664
+ export interface LiveActivityLayout {
665
+ /** Progress bar height in points */
666
+ progressBarHeight?: number;
667
+ /** Corner radius for progress bar */
668
+ progressBarCornerRadius?: number;
669
+ /** Overall corner radius */
670
+ cornerRadius?: number;
671
+ /** Show job type icon */
672
+ showIcon?: boolean;
673
+ /** Show ETA countdown */
674
+ showEta?: boolean;
675
+ /** Show current stage */
676
+ showStage?: boolean;
677
+ /** Show progress percentage text */
678
+ showProgressText?: boolean;
679
+ /** Compact mode for Dynamic Island */
680
+ compactMode?: boolean;
681
+ }
682
+
683
+ /**
684
+ * Font weight options
685
+ */
686
+ export type FontWeight = 'regular' | 'medium' | 'semibold' | 'bold';
687
+
688
+ /**
689
+ * Font configuration
690
+ */
691
+ export interface FontConfig {
692
+ /** Font size in points */
693
+ size?: number;
694
+ /** Font weight */
695
+ weight?: FontWeight;
696
+ }
697
+
698
+ /**
699
+ * Font configuration for Live Activity text elements
700
+ */
701
+ export interface LiveActivityFonts {
702
+ /** Title text font */
703
+ title?: FontConfig;
704
+ /** Progress/percentage text font */
705
+ progress?: FontConfig;
706
+ /** Message text font */
707
+ message?: FontConfig;
708
+ /** Stage text font */
709
+ stage?: FontConfig;
710
+ /** ETA text font */
711
+ eta?: FontConfig;
712
+ }
713
+
714
+ /**
715
+ * Job type specific icon and color configuration
716
+ */
717
+ export interface JobTypeConfig {
718
+ /** SF Symbol name (iOS) */
719
+ icon?: string;
720
+ /** Icon tint color (hex) */
721
+ color?: string;
722
+ /** Custom display name */
723
+ displayName?: string;
724
+ }
725
+
726
+ /**
727
+ * CTA button default styling
728
+ */
729
+ export interface LiveActivityCTAStyle {
730
+ /** Background color (hex) */
731
+ backgroundColor?: string;
732
+ /** Text color (hex) */
733
+ textColor?: string;
734
+ /** Corner radius */
735
+ cornerRadius?: number;
736
+ /** Font configuration */
737
+ font?: FontConfig;
738
+ }
739
+
740
+ /**
741
+ * CTA button configuration in theme
742
+ */
743
+ export interface LiveActivityCTAConfig {
744
+ /** Default CTA button style */
745
+ style?: LiveActivityCTAStyle;
746
+ /** Show CTA on these statuses */
747
+ showOn?: ('completed' | 'failed')[];
748
+ }
749
+
750
+ /**
751
+ * Complete theme configuration for Live Activity
752
+ */
753
+ export interface LiveActivityThemeConfig {
754
+ /** Use a built-in preset as base */
755
+ preset?: LiveActivityThemePreset;
756
+ /** Custom colors (override preset) */
757
+ colors?: LiveActivityColors;
758
+ /** Gradient background (overrides solid color) */
759
+ gradient?: LiveActivityGradient;
760
+ /** Layout options */
761
+ layout?: LiveActivityLayout;
762
+ /** Font configuration */
763
+ fonts?: LiveActivityFonts;
764
+ /** CTA button configuration */
765
+ cta?: LiveActivityCTAConfig;
766
+ }
767
+
768
+ /**
769
+ * Widget extension configuration
770
+ */
771
+ export interface WidgetExtensionConfig {
772
+ /** Widget extension name (default: 'SeennWidgetExtension') */
773
+ name?: string;
774
+ /** iOS deployment target (default: '16.1') */
775
+ deploymentTarget?: string;
776
+ /** App Groups identifier (auto-generated if not provided) */
777
+ appGroupId?: string;
778
+ }
779
+
780
+ /**
781
+ * Complete Seenn widget configuration file format
782
+ */
783
+ export interface SeennWidgetConfig {
784
+ /** Widget extension settings */
785
+ widget?: WidgetExtensionConfig;
786
+ /** Theme configuration */
787
+ theme?: LiveActivityThemeConfig;
788
+ /** Job type specific configurations */
789
+ jobTypes?: Record<string, JobTypeConfig>;
790
+ /** CTA button configuration */
791
+ ctaButton?: LiveActivityCTAConfig;
792
+ }
793
+
519
794
  // ============================================
520
795
  // Version & Compatibility
521
796
  // ============================================
@@ -523,7 +798,7 @@ export interface LiveActivityPushTokenEvent {
523
798
  /**
524
799
  * SDK version info
525
800
  */
526
- export const SDK_VERSION = '0.2.0';
801
+ export const SDK_VERSION = '0.4.0';
527
802
 
528
803
  /**
529
804
  * Minimum API version required