@insure-os/client 0.0.25 → 0.0.26

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, Product, CalculationResponse, PaymentInitiationRequest, PaymentGateway, CreatePaymentLinkRequest, CreatePaymentLinkResponse, PaymentLink, FormDefinition, FormData, FormField, FormPage, PaymentOption, CalculationExcessOption } from '@insure-os/types';
1
+ import { QuoteIntentResponse, Product, ClientSettings, CalculationResponse, PaymentInitiationRequest, PaymentGateway, CreateQuotePaymentLinkRequest, 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
 
@@ -33,6 +33,7 @@ declare class EnhancedHttpClient {
33
33
  theme?: {
34
34
  css_url: string;
35
35
  };
36
+ client_settings?: ClientSettings | null;
36
37
  };
37
38
  }>;
38
39
  createQuoteIntent(body: any): Promise<QuoteIntentResponse>;
@@ -44,7 +45,16 @@ declare class EnhancedHttpClient {
44
45
  }>;
45
46
  initiatePayment(request: PaymentInitiationRequest, gateway: PaymentGateway | string): Promise<any>;
46
47
  getPaymentStatus(transactionId: string, gateway: PaymentGateway): Promise<any>;
47
- createPaymentLink(request: CreatePaymentLinkRequest): Promise<CreatePaymentLinkResponse>;
48
+ /**
49
+ * Create a payment link for a quote intent (email me later flow)
50
+ * POST /quote-intents/:id/payment-link
51
+ */
52
+ createQuotePaymentLink(quoteIntentId: string, request: CreateQuotePaymentLinkRequest): Promise<{
53
+ id: string;
54
+ payment_link_id: string;
55
+ payment_link: string;
56
+ expires_at: string;
57
+ }>;
48
58
  getPaymentLinkDetails(signedUrl: string): Promise<PaymentLink>;
49
59
  /**
50
60
  * Get payment link details by UUID
@@ -63,6 +73,15 @@ declare class EnhancedHttpClient {
63
73
  status: string;
64
74
  message: string;
65
75
  }>;
76
+ /**
77
+ * Validate cover start date for a payment link
78
+ * Checks if the product version for the selected date matches the quote's product version
79
+ */
80
+ validateCoverStartDate(paymentLinkId: string, coverStartDate: string): Promise<{
81
+ valid: boolean;
82
+ quote_page_url?: string | null;
83
+ message?: string;
84
+ }>;
66
85
  private executeWithRetry;
67
86
  private handleApiError;
68
87
  /**
@@ -641,12 +660,13 @@ type QuoteMountConfig = BaseMountConfig & {
641
660
  /** Existing quote intent url for loading (omit for new quote intents) */
642
661
  quoteIntentUrl?: string;
643
662
  /**
644
- * Product codes to show (required for 'quote' mode)
663
+ * Product codes to show (optional for 'quote' mode)
664
+ * - Omitted/undefined: uses organisation's client_settings to filter/order products
645
665
  * - Single product: ['MARINER_JETSKI'] - skips product selection
646
666
  * - Multiple products: ['MARINER_JETSKI', 'MARINER_YACHT'] - shows product selection
647
- * - All products: ['*'] - shows all org products
667
+ * - All products: ['*'] - shows all org products, ignores client_settings
648
668
  */
649
- products: string[];
669
+ products?: string[];
650
670
  };
651
671
  type PaymentLinkMountConfig = BaseMountConfig & {
652
672
  mode: 'payment';