@insure-os/client 0.0.5 → 0.0.7

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, FormDefinition, FormData, FormField, FormPage, PaymentOption, CalculationExcessOption } from '@insure-os/types';
1
+ import { QuoteIntentResponse, 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
 
@@ -30,6 +30,8 @@ declare class EnhancedHttpClient {
30
30
  calculateQuoteIntent(url: string): Promise<CalculationResponse>;
31
31
  initiatePayment(request: PaymentInitiationRequest, gateway: PaymentGateway): Promise<any>;
32
32
  getPaymentStatus(transactionId: string, gateway: PaymentGateway): Promise<any>;
33
+ createPaymentLink(request: CreatePaymentLinkRequest): Promise<CreatePaymentLinkResponse>;
34
+ getPaymentLinkDetails(signedUrl: string): Promise<PaymentLink>;
33
35
  private executeWithRetry;
34
36
  private handleApiError;
35
37
  /**
@@ -601,11 +603,7 @@ type ClientConfig = {
601
603
  /** HTTP client configuration */
602
604
  httpConfig?: Partial<HttpClientConfig>;
603
605
  };
604
- type MountConfig = ClientConfig & {
605
- /** Existing quote intent url for loading (omit for new quote intents) */
606
- quoteIntentUrl?: string;
607
- /** Version strategy configuration */
608
- product: VersionStrategyConfig;
606
+ type BaseMountConfig = ClientConfig & {
609
607
  /** Storage type preference */
610
608
  storageType?: "localStorage" | "sessionStorage";
611
609
  /** Polyfill configuration */
@@ -623,6 +621,21 @@ type MountConfig = ClientConfig & {
623
621
  /** Enable performance monitoring (default: false) */
624
622
  enablePerformanceMonitoring?: boolean;
625
623
  };
624
+ type QuoteMountConfig = BaseMountConfig & {
625
+ mode?: 'quote' | undefined;
626
+ /** Existing quote intent url for loading (omit for new quote intents) */
627
+ quoteIntentUrl?: string;
628
+ /** Version strategy configuration (required for 'quote' mode) */
629
+ product: VersionStrategyConfig;
630
+ };
631
+ type PaymentLinkMountConfig = BaseMountConfig & {
632
+ mode: 'payment';
633
+ /** Payment link ID (required when mode is 'payment') */
634
+ paymentLinkId: string;
635
+ /** Signed URL for payment link (required when mode is 'payment') */
636
+ signedUrl: string;
637
+ };
638
+ type MountConfig = QuoteMountConfig | PaymentLinkMountConfig;
626
639
  type QuoteIntentState = {
627
640
  id: string;
628
641
  created_at: number;
@@ -632,6 +645,7 @@ type QuoteIntentState = {
632
645
  url: string;
633
646
  calculate_url: string;
634
647
  status: string;
648
+ reference?: string | null;
635
649
  product_id?: string;
636
650
  form_definition?: FormDefinition;
637
651
  form_data?: FormData;