@insure-os/client 0.0.21 → 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>;
@@ -42,10 +43,45 @@ declare class EnhancedHttpClient {
42
43
  deleteCalculations(deleteCalculationsUrl: string): Promise<{
43
44
  message: string;
44
45
  }>;
45
- initiatePayment(request: PaymentInitiationRequest, gateway: PaymentGateway): Promise<any>;
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>;
59
+ /**
60
+ * Get payment link details by UUID
61
+ * Requires organisation ID header for tenant context
62
+ */
63
+ getPaymentLinkById(paymentLinkId: string): Promise<PaymentLink>;
64
+ /**
65
+ * Initiate payment for a fixed-amount payment link
66
+ * Returns a gateway URL to redirect the user to
67
+ */
68
+ initiateFixedPayment(paymentLinkId: string, gatewayCode: string, clientName?: string): Promise<{
69
+ success: boolean;
70
+ payment_link_id: string;
71
+ transaction_id?: string;
72
+ gateway_acceptance_url?: string;
73
+ status: string;
74
+ message: string;
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
+ }>;
49
85
  private executeWithRetry;
50
86
  private handleApiError;
51
87
  /**
@@ -624,19 +660,20 @@ type QuoteMountConfig = BaseMountConfig & {
624
660
  /** Existing quote intent url for loading (omit for new quote intents) */
625
661
  quoteIntentUrl?: string;
626
662
  /**
627
- * 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
628
665
  * - Single product: ['MARINER_JETSKI'] - skips product selection
629
666
  * - Multiple products: ['MARINER_JETSKI', 'MARINER_YACHT'] - shows product selection
630
- * - All products: ['*'] - shows all org products
667
+ * - All products: ['*'] - shows all org products, ignores client_settings
631
668
  */
632
- products: string[];
669
+ products?: string[];
633
670
  };
634
671
  type PaymentLinkMountConfig = BaseMountConfig & {
635
672
  mode: 'payment';
636
673
  /** Payment link ID (required when mode is 'payment') */
637
674
  paymentLinkId: string;
638
- /** Signed URL for payment link (required when mode is 'payment') */
639
- signedUrl: string;
675
+ /** Optional signed URL - if not provided, UUID-based public access is used */
676
+ signedUrl?: string;
640
677
  };
641
678
  type MountConfig = QuoteMountConfig | PaymentLinkMountConfig;
642
679
  type QuoteIntentState = {
@@ -660,6 +697,7 @@ type QuoteIntentState = {
660
697
  deleted_at: string | null;
661
698
  name: string;
662
699
  slug: string;
700
+ timezone?: string;
663
701
  admin_email?: string | null;
664
702
  phone?: string | null;
665
703
  theme: {