@insure-os/client 0.0.25 → 0.0.27

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,24 @@ 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
+ }>;
85
+ /**
86
+ * Validate a promo code for a quote intent
87
+ * Checks if the promo code is valid and applicable to the product
88
+ */
89
+ validatePromoCode(quoteIntentId: string, code: string): Promise<{
90
+ valid: boolean;
91
+ name?: string;
92
+ message: string;
93
+ }>;
66
94
  private executeWithRetry;
67
95
  private handleApiError;
68
96
  /**
@@ -641,12 +669,13 @@ type QuoteMountConfig = BaseMountConfig & {
641
669
  /** Existing quote intent url for loading (omit for new quote intents) */
642
670
  quoteIntentUrl?: string;
643
671
  /**
644
- * Product codes to show (required for 'quote' mode)
672
+ * Product codes to show (optional for 'quote' mode)
673
+ * - Omitted/undefined: uses organisation's client_settings to filter/order products
645
674
  * - Single product: ['MARINER_JETSKI'] - skips product selection
646
675
  * - Multiple products: ['MARINER_JETSKI', 'MARINER_YACHT'] - shows product selection
647
- * - All products: ['*'] - shows all org products
676
+ * - All products: ['*'] - shows all org products, ignores client_settings
648
677
  */
649
- products: string[];
678
+ products?: string[];
650
679
  };
651
680
  type PaymentLinkMountConfig = BaseMountConfig & {
652
681
  mode: 'payment';