@insure-os/client 0.0.16 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { QuoteIntentResponse, CalculationResponse, PaymentInitiationRequest, PaymentGateway, CreatePaymentLinkRequest, CreatePaymentLinkResponse, PaymentLink, FormDefinition, FormData, FormField, FormPage, PaymentOption, CalculationExcessOption } from '@insure-os/types';
1
+ import { QuoteIntentResponse, Product, CalculationResponse, PaymentInitiationRequest, PaymentGateway, CreatePaymentLinkRequest, CreatePaymentLinkResponse, PaymentLink, FormDefinition, FormData, FormField, FormPage, PaymentOption, CalculationExcessOption } from '@insure-os/types';
2
2
  export { FieldValidation, FormData, FormDefinition, FormError, FormErrorType, FormField, FormPage, FormSettings, PageValidation, SelectOption } from '@insure-os/types';
3
3
  import * as Sentry from '@sentry/browser';
4
4
 
@@ -24,6 +24,17 @@ declare class EnhancedHttpClient {
24
24
  getBaseUrl(): string;
25
25
  private makeRequest;
26
26
  getQuoteIntent(url: string): Promise<QuoteIntentResponse>;
27
+ fetchAvailableProducts(productCodes?: string[]): Promise<{
28
+ products: Product[];
29
+ organisation: {
30
+ id: string;
31
+ name: string;
32
+ slug: string;
33
+ theme?: {
34
+ css_url: string;
35
+ };
36
+ };
37
+ }>;
27
38
  createQuoteIntent(body: any): Promise<QuoteIntentResponse>;
28
39
  updateQuoteIntent(url: string, data: any): Promise<QuoteIntentResponse>;
29
40
  deleteQuoteIntent(url: string): Promise<void>;
@@ -579,22 +590,6 @@ declare class ErrorHandlingStrategy {
579
590
  getUserFriendlyMessage(error: InsureOSError): string;
580
591
  }
581
592
 
582
- type FixedVersionStrategyConfig = {
583
- versionStrategy?: "fixed";
584
- code: string;
585
- };
586
- type LatestVersionStrategyConfig = {
587
- versionStrategy?: "latest";
588
- code: string;
589
- };
590
- type VersionStrategyConfig = FixedVersionStrategyConfig | LatestVersionStrategyConfig;
591
- /** Version strategies for InsureOS products */
592
- declare enum VersionStrategy {
593
- /** Gets the product based on an exact versioned code */
594
- FIXED = "fixed",
595
- /** Gets the latest active version of the product */
596
- LATEST = "latest"
597
- }
598
593
  /**
599
594
  * Enhanced configuration for mounting InsureOS quote functionality
600
595
  */
@@ -628,8 +623,13 @@ type QuoteMountConfig = BaseMountConfig & {
628
623
  mode?: 'quote' | undefined;
629
624
  /** Existing quote intent url for loading (omit for new quote intents) */
630
625
  quoteIntentUrl?: string;
631
- /** Version strategy configuration (required for 'quote' mode) */
632
- product: VersionStrategyConfig;
626
+ /**
627
+ * Product codes to show (required for 'quote' mode)
628
+ * - Single product: ['MARINER_JETSKI'] - skips product selection
629
+ * - Multiple products: ['MARINER_JETSKI', 'MARINER_YACHT'] - shows product selection
630
+ * - All products: ['*'] - shows all org products
631
+ */
632
+ products: string[];
633
633
  };
634
634
  type PaymentLinkMountConfig = BaseMountConfig & {
635
635
  mode: 'payment';
@@ -1121,5 +1121,5 @@ declare function trackPaymentCompleted(quoteIntent: QuoteIntentState, transactio
1121
1121
  */
1122
1122
  declare function trackPaymentFailed(quoteIntent: QuoteIntentState, transactionId?: string, paymentAmount?: number, paymentGateway?: string, paymentStatus?: string, failureReason?: string): void;
1123
1123
 
1124
- export { DataLayerManager, EnhancedHttpClient, ErrorHandlingStrategy, ErrorType, FormStateManager, InsureOS, InsureOSClient, InsureOSError, LocalStateManager, LocalStorageAdapter, MemoryStorageAdapter, PerformanceMonitor, PolyfillManager, RetryStrategy, SessionStorageAdapter, ThemeLoader, VersionStrategy, addBreadcrumb, captureException, captureMessage, createAppError, getAnalytics, getSupportMessage, groupErrorsByField, initializeAnalytics, initializeSentry, isSentryInitialized, parseServerValidationErrors, setTag, setUser, shouldShowErrorPage, shouldShowMaintenancePage, trackFormProgress, trackPaymentCompleted, trackPaymentFailed, trackPaymentInitiated, trackQuoteAtCheckout, trackQuoteCalculated, trackQuoteReferred, trackQuoteStarted, validateField, validatePage };
1125
- export type { AnalyticsConfig, AnalyticsEvent, ApiCallMetrics, AppError, AppErrorSeverity, AppErrorType, BaseAnalyticsEvent, DataLayer, FormStateManagerConfig, HttpClientConfig, MemoryInfo, MountConfig, ParsedTheme, PaymentCompletedEvent, PaymentFailedEvent, PaymentInitiatedEvent, PerformanceMetrics, PolyfillConfig, QuoteAtCheckoutEvent, QuoteCalculatedEvent, QuoteFormProgressEvent, QuoteIntentState, QuoteReferredEvent, QuoteStartedEvent, RetryConfig, SentryConfig, ServerErrorResponse, ServerValidationResponse, StorageAdapter, ThemeConfig, ValidationError, ValidationResult, VersionStrategyConfig };
1124
+ export { DataLayerManager, EnhancedHttpClient, ErrorHandlingStrategy, ErrorType, FormStateManager, InsureOS, InsureOSClient, InsureOSError, LocalStateManager, LocalStorageAdapter, MemoryStorageAdapter, PerformanceMonitor, PolyfillManager, RetryStrategy, SessionStorageAdapter, ThemeLoader, addBreadcrumb, captureException, captureMessage, createAppError, getAnalytics, getSupportMessage, groupErrorsByField, initializeAnalytics, initializeSentry, isSentryInitialized, parseServerValidationErrors, setTag, setUser, shouldShowErrorPage, shouldShowMaintenancePage, trackFormProgress, trackPaymentCompleted, trackPaymentFailed, trackPaymentInitiated, trackQuoteAtCheckout, trackQuoteCalculated, trackQuoteReferred, trackQuoteStarted, validateField, validatePage };
1125
+ export type { AnalyticsConfig, AnalyticsEvent, ApiCallMetrics, AppError, AppErrorSeverity, AppErrorType, BaseAnalyticsEvent, DataLayer, FormStateManagerConfig, HttpClientConfig, MemoryInfo, MountConfig, ParsedTheme, PaymentCompletedEvent, PaymentFailedEvent, PaymentInitiatedEvent, PerformanceMetrics, PolyfillConfig, QuoteAtCheckoutEvent, QuoteCalculatedEvent, QuoteFormProgressEvent, QuoteIntentState, QuoteReferredEvent, QuoteStartedEvent, RetryConfig, SentryConfig, ServerErrorResponse, ServerValidationResponse, StorageAdapter, ThemeConfig, ValidationError, ValidationResult };