azirid-react 0.11.0 → 0.11.2

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.cts CHANGED
@@ -661,6 +661,24 @@ interface CreateTenantData {
661
661
  name: string;
662
662
  description?: string;
663
663
  }
664
+ interface Branch {
665
+ id: string;
666
+ name: string;
667
+ slug: string | null;
668
+ address: string | null;
669
+ phone: string | null;
670
+ email: string | null;
671
+ enabled: boolean;
672
+ }
673
+ interface PaymentMethod {
674
+ id: string;
675
+ provider: string;
676
+ label: string;
677
+ bankDetails?: Record<string, unknown> | null;
678
+ transferInstructions?: string | null;
679
+ isDefault: boolean;
680
+ branchId?: string | null;
681
+ }
664
682
 
665
683
  declare const LoginForm: react.ForwardRefExoticComponent<LoginFormProps & react.RefAttributes<HTMLFormElement>>;
666
684
 
@@ -724,6 +742,8 @@ declare namespace CheckoutButton {
724
742
  interface PayButtonProps {
725
743
  planId?: string;
726
744
  intentId?: string;
745
+ branchId?: string;
746
+ merchantAccountId?: string;
727
747
  successUrl: string;
728
748
  cancelUrl: string;
729
749
  className?: string;
@@ -735,7 +755,7 @@ interface PayButtonProps {
735
755
  onProviderSelect?: (provider: PaymentProviderType) => void;
736
756
  onProofSubmitted?: (proof: TransferProof) => void;
737
757
  }
738
- declare function PayButton({ planId, intentId, successUrl, cancelUrl, className, style, children, disabled, onSuccess, onError, onProviderSelect, onProofSubmitted, }: PayButtonProps): react_jsx_runtime.JSX.Element;
758
+ declare function PayButton({ planId, intentId, branchId, merchantAccountId, successUrl, cancelUrl, className, style, children, disabled, onSuccess, onError, onProviderSelect, onProofSubmitted, }: PayButtonProps): react_jsx_runtime.JSX.Element;
739
759
 
740
760
  interface PayphoneCallbackProps {
741
761
  onSuccess?: (data: {
@@ -822,6 +842,8 @@ declare const SUFFIXES: {
822
842
  readonly referralMe: "referrals/me";
823
843
  readonly referralStats: "referrals/stats";
824
844
  readonly userTenants: "tenants";
845
+ readonly branches: "branches";
846
+ readonly paymentMethods: "payment-methods";
825
847
  };
826
848
  /** Base paths for each mode */
827
849
  declare const BASE_PATHS: {
@@ -1421,6 +1443,8 @@ declare function useSubscription(): _tanstack_react_query.UseQueryResult<UserSub
1421
1443
  interface CheckoutParams {
1422
1444
  planId?: string;
1423
1445
  intentId?: string;
1446
+ branchId?: string;
1447
+ merchantAccountId?: string;
1424
1448
  successUrl: string;
1425
1449
  cancelUrl: string;
1426
1450
  provider?: PaymentProviderType;
@@ -1632,6 +1656,8 @@ type PayButtonStatus = 'idle' | 'loading_providers' | 'ready' | 'processing' | '
1632
1656
  interface UsePayButtonOptions {
1633
1657
  intentId?: string;
1634
1658
  planId?: string;
1659
+ branchId?: string;
1660
+ merchantAccountId?: string;
1635
1661
  onSuccess?: (data: CheckoutResponse) => void;
1636
1662
  onError?: (error: Error) => void;
1637
1663
  }
@@ -1647,7 +1673,7 @@ interface UsePayButtonReturn {
1647
1673
  isPending: boolean;
1648
1674
  error: Error | null;
1649
1675
  }
1650
- declare function usePayButton({ intentId, planId, onSuccess, onError, }: UsePayButtonOptions): UsePayButtonReturn;
1676
+ declare function usePayButton({ intentId, planId, branchId, merchantAccountId, onSuccess, onError, }: UsePayButtonOptions): UsePayButtonReturn;
1651
1677
 
1652
1678
  type TransferPaymentStatus = 'idle' | 'loading' | 'ready' | 'uploading' | 'submitting' | 'submitted' | 'error';
1653
1679
  interface SubmitProofData {
@@ -1678,6 +1704,10 @@ interface UseTransferPaymentReturn {
1678
1704
  }
1679
1705
  declare function useTransferPayment({ intentId, onSuccess, onProofSubmitted, onError, }: UseTransferPaymentOptions): UseTransferPaymentReturn;
1680
1706
 
1707
+ declare function useBranches(): _tanstack_react_query.UseQueryResult<Branch[], Error>;
1708
+
1709
+ declare function usePaymentMethods(branchId?: string): _tanstack_react_query.UseQueryResult<PaymentMethod[], Error>;
1710
+
1681
1711
  declare function useTenants(): _tanstack_react_query.UseQueryResult<TenantWithRole[], Error>;
1682
1712
  declare function useTenantMembers(tenantId: string): _tanstack_react_query.UseQueryResult<TenantMemberInfo[], Error>;
1683
1713
  declare function useSwitchTenant(): {
@@ -2007,4 +2037,4 @@ interface SessionSyncOptions {
2007
2037
 
2008
2038
  declare const SDK_VERSION: string;
2009
2039
 
2010
- export { type AccessClient, type AccessClientConfig, type AccessMessages, type ApiError, type AppBranding, AuthForm, type AuthFormProps, type AuthPaths, type AuthState, type AuthSuccessResponse, type AuthUser, type AuthView, type AvailableProvider, type AziridContextValue, AziridProvider, type AziridProviderProps, BASE_PATHS, type BillingInvoice, type BillingPlan, type BootstrapResponse, type ChangePasswordData, type ChangePasswordInput, CheckoutButton, type CheckoutButtonProps, type CheckoutParams, type CheckoutResponse, type CreateTenantData, type FieldError, ForgotPasswordForm, type ForgotPasswordFormProps, type ForgotPasswordInput, InvoiceList, type InvoiceListProps, type LoginData, LoginForm, type LoginFormProps, type LoginInput, type MagicLinkRequestData, type MagicLinkRequestInput, type MagicLinkVerifyData, type MagicLinkVerifyInput, type MutationHookConfig, PATHS, type PasskeyItem, type PasskeyLoginData, type PasskeyLoginStartData, type PasskeyLoginStartResponse, type PasskeyLoginVerifyData, type PasskeyRegisterStartData, type PasskeyRegisterStartInput, type PasskeyRegisterStartResponse, type PasskeyRegisterVerifyData, type PasswordResetConfirmData, type PasswordResetRequestData, PayButton, type PayButtonProps, type PayButtonStatus, type PaymentIntent, type PaymentProviderType, PayphoneCallback, type PayphoneCallbackProps, type PayphoneCheckoutStatus, type PayphoneConfirmParams, type PayphoneConfirmResult, type PayphoneModalProps, type PayphoneWidgetConfig, PayphoneWidgetRenderer, type PricingCardProps, type PricingFeatureListProps, PricingTable, type PricingTableProps, type ProviderModalProps, ReferralCard, type ReferralCardProps, type ReferralInfo, type ReferralItem, ReferralStats, type ReferralStatsData, type ReferralStatsProps, type RegisterPasskeyData, type ResetPasswordConfirmInput, ResetPasswordForm, type ResetPasswordFormProps, SDK_VERSION, type SessionSyncOptions, type SignupData, SignupForm, type SignupFormProps, type SignupInput, type SimpleMutationOptions, type SocialLoginData, type SocialLoginInput, type SubmitProofData, type SubmitTransferProofData, SubscriptionBadge, type SubscriptionBadgeProps, type SupportedLocale, type TenantMemberInfo, type TenantWithRole, type TransferModalProps, type TransferPaymentStatus, type TransferProof, type UploadTransferProofRequest, type UploadTransferProofResponse, type UseBootstrapOptions, type UseBootstrapReturn, type UseChangePasswordOptions, type UseChangePasswordReturn, type UseCheckoutOptions, type UseFormReturn, type UseLoginOptions, type UseLoginReturn, type UseLogoutOptions, type UseLogoutReturn, type UseMagicLinkOptions, type UseMagicLinkReturn, type UsePasskeysOptions, type UsePasskeysReturn, type UsePasswordResetOptions, type UsePasswordResetReturn, type UsePayButtonOptions, type UsePayButtonReturn, type UsePayphoneCheckoutOptions, type UsePayphoneCheckoutReturn, type UsePayphoneConfirmOptions, type UseRefreshOptions, type UseRefreshReturn, type UseSessionOptions, type UseSessionReturn, type UseSignupOptions, type UseSignupReturn, type UseSocialLoginOptions, type UseSocialLoginReturn, type UseTransferPaymentOptions, type UseTransferPaymentReturn, type UserSubscription, buildPaths, changePasswordSchema, cn, createAccessClient, createForgotPasswordSchema, createLoginSchema, createMutationHook, createResetPasswordConfirmSchema, createSignupSchema, en, es, forgotPasswordSchema, isAuthError, loginSchema, magicLinkRequestSchema, magicLinkVerifySchema, passkeyRegisterStartSchema, removeStyles, resetPasswordConfirmSchema, resolveMessages, signupSchema, socialLoginSchema, useAccessClient, useAzirid, useBootstrap, useBranding, useChangePassword, useCheckout, useFormState, useInvoices, useLogin, useLogout, useMagicLink, useMessages, usePasskeys, usePasswordReset, usePasswordToggle, usePayButton, usePaymentProviders, usePayphoneCheckout, usePayphoneConfirm, usePlans, useReferral, useReferralStats, useRefresh, useSession, useSignup, useSocialLogin, useSubmitTransferProof, useSubscription, useSwitchTenant, useTenantMembers, useTenants, useTransferPayment, useTransferProofs, useUploadTransferProof };
2040
+ export { type AccessClient, type AccessClientConfig, type AccessMessages, type ApiError, type AppBranding, AuthForm, type AuthFormProps, type AuthPaths, type AuthState, type AuthSuccessResponse, type AuthUser, type AuthView, type AvailableProvider, type AziridContextValue, AziridProvider, type AziridProviderProps, BASE_PATHS, type BillingInvoice, type BillingPlan, type BootstrapResponse, type Branch, type ChangePasswordData, type ChangePasswordInput, CheckoutButton, type CheckoutButtonProps, type CheckoutParams, type CheckoutResponse, type CreateTenantData, type FieldError, ForgotPasswordForm, type ForgotPasswordFormProps, type ForgotPasswordInput, InvoiceList, type InvoiceListProps, type LoginData, LoginForm, type LoginFormProps, type LoginInput, type MagicLinkRequestData, type MagicLinkRequestInput, type MagicLinkVerifyData, type MagicLinkVerifyInput, type MutationHookConfig, PATHS, type PasskeyItem, type PasskeyLoginData, type PasskeyLoginStartData, type PasskeyLoginStartResponse, type PasskeyLoginVerifyData, type PasskeyRegisterStartData, type PasskeyRegisterStartInput, type PasskeyRegisterStartResponse, type PasskeyRegisterVerifyData, type PasswordResetConfirmData, type PasswordResetRequestData, PayButton, type PayButtonProps, type PayButtonStatus, type PaymentIntent, type PaymentMethod, type PaymentProviderType, PayphoneCallback, type PayphoneCallbackProps, type PayphoneCheckoutStatus, type PayphoneConfirmParams, type PayphoneConfirmResult, type PayphoneModalProps, type PayphoneWidgetConfig, PayphoneWidgetRenderer, type PricingCardProps, type PricingFeatureListProps, PricingTable, type PricingTableProps, type ProviderModalProps, ReferralCard, type ReferralCardProps, type ReferralInfo, type ReferralItem, ReferralStats, type ReferralStatsData, type ReferralStatsProps, type RegisterPasskeyData, type ResetPasswordConfirmInput, ResetPasswordForm, type ResetPasswordFormProps, SDK_VERSION, type SessionSyncOptions, type SignupData, SignupForm, type SignupFormProps, type SignupInput, type SimpleMutationOptions, type SocialLoginData, type SocialLoginInput, type SubmitProofData, type SubmitTransferProofData, SubscriptionBadge, type SubscriptionBadgeProps, type SupportedLocale, type TenantMemberInfo, type TenantWithRole, type TransferModalProps, type TransferPaymentStatus, type TransferProof, type UploadTransferProofRequest, type UploadTransferProofResponse, type UseBootstrapOptions, type UseBootstrapReturn, type UseChangePasswordOptions, type UseChangePasswordReturn, type UseCheckoutOptions, type UseFormReturn, type UseLoginOptions, type UseLoginReturn, type UseLogoutOptions, type UseLogoutReturn, type UseMagicLinkOptions, type UseMagicLinkReturn, type UsePasskeysOptions, type UsePasskeysReturn, type UsePasswordResetOptions, type UsePasswordResetReturn, type UsePayButtonOptions, type UsePayButtonReturn, type UsePayphoneCheckoutOptions, type UsePayphoneCheckoutReturn, type UsePayphoneConfirmOptions, type UseRefreshOptions, type UseRefreshReturn, type UseSessionOptions, type UseSessionReturn, type UseSignupOptions, type UseSignupReturn, type UseSocialLoginOptions, type UseSocialLoginReturn, type UseTransferPaymentOptions, type UseTransferPaymentReturn, type UserSubscription, buildPaths, changePasswordSchema, cn, createAccessClient, createForgotPasswordSchema, createLoginSchema, createMutationHook, createResetPasswordConfirmSchema, createSignupSchema, en, es, forgotPasswordSchema, isAuthError, loginSchema, magicLinkRequestSchema, magicLinkVerifySchema, passkeyRegisterStartSchema, removeStyles, resetPasswordConfirmSchema, resolveMessages, signupSchema, socialLoginSchema, useAccessClient, useAzirid, useBootstrap, useBranches, useBranding, useChangePassword, useCheckout, useFormState, useInvoices, useLogin, useLogout, useMagicLink, useMessages, usePasskeys, usePasswordReset, usePasswordToggle, usePayButton, usePaymentMethods, usePaymentProviders, usePayphoneCheckout, usePayphoneConfirm, usePlans, useReferral, useReferralStats, useRefresh, useSession, useSignup, useSocialLogin, useSubmitTransferProof, useSubscription, useSwitchTenant, useTenantMembers, useTenants, useTransferPayment, useTransferProofs, useUploadTransferProof };
package/dist/index.d.ts CHANGED
@@ -661,6 +661,24 @@ interface CreateTenantData {
661
661
  name: string;
662
662
  description?: string;
663
663
  }
664
+ interface Branch {
665
+ id: string;
666
+ name: string;
667
+ slug: string | null;
668
+ address: string | null;
669
+ phone: string | null;
670
+ email: string | null;
671
+ enabled: boolean;
672
+ }
673
+ interface PaymentMethod {
674
+ id: string;
675
+ provider: string;
676
+ label: string;
677
+ bankDetails?: Record<string, unknown> | null;
678
+ transferInstructions?: string | null;
679
+ isDefault: boolean;
680
+ branchId?: string | null;
681
+ }
664
682
 
665
683
  declare const LoginForm: react.ForwardRefExoticComponent<LoginFormProps & react.RefAttributes<HTMLFormElement>>;
666
684
 
@@ -724,6 +742,8 @@ declare namespace CheckoutButton {
724
742
  interface PayButtonProps {
725
743
  planId?: string;
726
744
  intentId?: string;
745
+ branchId?: string;
746
+ merchantAccountId?: string;
727
747
  successUrl: string;
728
748
  cancelUrl: string;
729
749
  className?: string;
@@ -735,7 +755,7 @@ interface PayButtonProps {
735
755
  onProviderSelect?: (provider: PaymentProviderType) => void;
736
756
  onProofSubmitted?: (proof: TransferProof) => void;
737
757
  }
738
- declare function PayButton({ planId, intentId, successUrl, cancelUrl, className, style, children, disabled, onSuccess, onError, onProviderSelect, onProofSubmitted, }: PayButtonProps): react_jsx_runtime.JSX.Element;
758
+ declare function PayButton({ planId, intentId, branchId, merchantAccountId, successUrl, cancelUrl, className, style, children, disabled, onSuccess, onError, onProviderSelect, onProofSubmitted, }: PayButtonProps): react_jsx_runtime.JSX.Element;
739
759
 
740
760
  interface PayphoneCallbackProps {
741
761
  onSuccess?: (data: {
@@ -822,6 +842,8 @@ declare const SUFFIXES: {
822
842
  readonly referralMe: "referrals/me";
823
843
  readonly referralStats: "referrals/stats";
824
844
  readonly userTenants: "tenants";
845
+ readonly branches: "branches";
846
+ readonly paymentMethods: "payment-methods";
825
847
  };
826
848
  /** Base paths for each mode */
827
849
  declare const BASE_PATHS: {
@@ -1421,6 +1443,8 @@ declare function useSubscription(): _tanstack_react_query.UseQueryResult<UserSub
1421
1443
  interface CheckoutParams {
1422
1444
  planId?: string;
1423
1445
  intentId?: string;
1446
+ branchId?: string;
1447
+ merchantAccountId?: string;
1424
1448
  successUrl: string;
1425
1449
  cancelUrl: string;
1426
1450
  provider?: PaymentProviderType;
@@ -1632,6 +1656,8 @@ type PayButtonStatus = 'idle' | 'loading_providers' | 'ready' | 'processing' | '
1632
1656
  interface UsePayButtonOptions {
1633
1657
  intentId?: string;
1634
1658
  planId?: string;
1659
+ branchId?: string;
1660
+ merchantAccountId?: string;
1635
1661
  onSuccess?: (data: CheckoutResponse) => void;
1636
1662
  onError?: (error: Error) => void;
1637
1663
  }
@@ -1647,7 +1673,7 @@ interface UsePayButtonReturn {
1647
1673
  isPending: boolean;
1648
1674
  error: Error | null;
1649
1675
  }
1650
- declare function usePayButton({ intentId, planId, onSuccess, onError, }: UsePayButtonOptions): UsePayButtonReturn;
1676
+ declare function usePayButton({ intentId, planId, branchId, merchantAccountId, onSuccess, onError, }: UsePayButtonOptions): UsePayButtonReturn;
1651
1677
 
1652
1678
  type TransferPaymentStatus = 'idle' | 'loading' | 'ready' | 'uploading' | 'submitting' | 'submitted' | 'error';
1653
1679
  interface SubmitProofData {
@@ -1678,6 +1704,10 @@ interface UseTransferPaymentReturn {
1678
1704
  }
1679
1705
  declare function useTransferPayment({ intentId, onSuccess, onProofSubmitted, onError, }: UseTransferPaymentOptions): UseTransferPaymentReturn;
1680
1706
 
1707
+ declare function useBranches(): _tanstack_react_query.UseQueryResult<Branch[], Error>;
1708
+
1709
+ declare function usePaymentMethods(branchId?: string): _tanstack_react_query.UseQueryResult<PaymentMethod[], Error>;
1710
+
1681
1711
  declare function useTenants(): _tanstack_react_query.UseQueryResult<TenantWithRole[], Error>;
1682
1712
  declare function useTenantMembers(tenantId: string): _tanstack_react_query.UseQueryResult<TenantMemberInfo[], Error>;
1683
1713
  declare function useSwitchTenant(): {
@@ -2007,4 +2037,4 @@ interface SessionSyncOptions {
2007
2037
 
2008
2038
  declare const SDK_VERSION: string;
2009
2039
 
2010
- export { type AccessClient, type AccessClientConfig, type AccessMessages, type ApiError, type AppBranding, AuthForm, type AuthFormProps, type AuthPaths, type AuthState, type AuthSuccessResponse, type AuthUser, type AuthView, type AvailableProvider, type AziridContextValue, AziridProvider, type AziridProviderProps, BASE_PATHS, type BillingInvoice, type BillingPlan, type BootstrapResponse, type ChangePasswordData, type ChangePasswordInput, CheckoutButton, type CheckoutButtonProps, type CheckoutParams, type CheckoutResponse, type CreateTenantData, type FieldError, ForgotPasswordForm, type ForgotPasswordFormProps, type ForgotPasswordInput, InvoiceList, type InvoiceListProps, type LoginData, LoginForm, type LoginFormProps, type LoginInput, type MagicLinkRequestData, type MagicLinkRequestInput, type MagicLinkVerifyData, type MagicLinkVerifyInput, type MutationHookConfig, PATHS, type PasskeyItem, type PasskeyLoginData, type PasskeyLoginStartData, type PasskeyLoginStartResponse, type PasskeyLoginVerifyData, type PasskeyRegisterStartData, type PasskeyRegisterStartInput, type PasskeyRegisterStartResponse, type PasskeyRegisterVerifyData, type PasswordResetConfirmData, type PasswordResetRequestData, PayButton, type PayButtonProps, type PayButtonStatus, type PaymentIntent, type PaymentProviderType, PayphoneCallback, type PayphoneCallbackProps, type PayphoneCheckoutStatus, type PayphoneConfirmParams, type PayphoneConfirmResult, type PayphoneModalProps, type PayphoneWidgetConfig, PayphoneWidgetRenderer, type PricingCardProps, type PricingFeatureListProps, PricingTable, type PricingTableProps, type ProviderModalProps, ReferralCard, type ReferralCardProps, type ReferralInfo, type ReferralItem, ReferralStats, type ReferralStatsData, type ReferralStatsProps, type RegisterPasskeyData, type ResetPasswordConfirmInput, ResetPasswordForm, type ResetPasswordFormProps, SDK_VERSION, type SessionSyncOptions, type SignupData, SignupForm, type SignupFormProps, type SignupInput, type SimpleMutationOptions, type SocialLoginData, type SocialLoginInput, type SubmitProofData, type SubmitTransferProofData, SubscriptionBadge, type SubscriptionBadgeProps, type SupportedLocale, type TenantMemberInfo, type TenantWithRole, type TransferModalProps, type TransferPaymentStatus, type TransferProof, type UploadTransferProofRequest, type UploadTransferProofResponse, type UseBootstrapOptions, type UseBootstrapReturn, type UseChangePasswordOptions, type UseChangePasswordReturn, type UseCheckoutOptions, type UseFormReturn, type UseLoginOptions, type UseLoginReturn, type UseLogoutOptions, type UseLogoutReturn, type UseMagicLinkOptions, type UseMagicLinkReturn, type UsePasskeysOptions, type UsePasskeysReturn, type UsePasswordResetOptions, type UsePasswordResetReturn, type UsePayButtonOptions, type UsePayButtonReturn, type UsePayphoneCheckoutOptions, type UsePayphoneCheckoutReturn, type UsePayphoneConfirmOptions, type UseRefreshOptions, type UseRefreshReturn, type UseSessionOptions, type UseSessionReturn, type UseSignupOptions, type UseSignupReturn, type UseSocialLoginOptions, type UseSocialLoginReturn, type UseTransferPaymentOptions, type UseTransferPaymentReturn, type UserSubscription, buildPaths, changePasswordSchema, cn, createAccessClient, createForgotPasswordSchema, createLoginSchema, createMutationHook, createResetPasswordConfirmSchema, createSignupSchema, en, es, forgotPasswordSchema, isAuthError, loginSchema, magicLinkRequestSchema, magicLinkVerifySchema, passkeyRegisterStartSchema, removeStyles, resetPasswordConfirmSchema, resolveMessages, signupSchema, socialLoginSchema, useAccessClient, useAzirid, useBootstrap, useBranding, useChangePassword, useCheckout, useFormState, useInvoices, useLogin, useLogout, useMagicLink, useMessages, usePasskeys, usePasswordReset, usePasswordToggle, usePayButton, usePaymentProviders, usePayphoneCheckout, usePayphoneConfirm, usePlans, useReferral, useReferralStats, useRefresh, useSession, useSignup, useSocialLogin, useSubmitTransferProof, useSubscription, useSwitchTenant, useTenantMembers, useTenants, useTransferPayment, useTransferProofs, useUploadTransferProof };
2040
+ export { type AccessClient, type AccessClientConfig, type AccessMessages, type ApiError, type AppBranding, AuthForm, type AuthFormProps, type AuthPaths, type AuthState, type AuthSuccessResponse, type AuthUser, type AuthView, type AvailableProvider, type AziridContextValue, AziridProvider, type AziridProviderProps, BASE_PATHS, type BillingInvoice, type BillingPlan, type BootstrapResponse, type Branch, type ChangePasswordData, type ChangePasswordInput, CheckoutButton, type CheckoutButtonProps, type CheckoutParams, type CheckoutResponse, type CreateTenantData, type FieldError, ForgotPasswordForm, type ForgotPasswordFormProps, type ForgotPasswordInput, InvoiceList, type InvoiceListProps, type LoginData, LoginForm, type LoginFormProps, type LoginInput, type MagicLinkRequestData, type MagicLinkRequestInput, type MagicLinkVerifyData, type MagicLinkVerifyInput, type MutationHookConfig, PATHS, type PasskeyItem, type PasskeyLoginData, type PasskeyLoginStartData, type PasskeyLoginStartResponse, type PasskeyLoginVerifyData, type PasskeyRegisterStartData, type PasskeyRegisterStartInput, type PasskeyRegisterStartResponse, type PasskeyRegisterVerifyData, type PasswordResetConfirmData, type PasswordResetRequestData, PayButton, type PayButtonProps, type PayButtonStatus, type PaymentIntent, type PaymentMethod, type PaymentProviderType, PayphoneCallback, type PayphoneCallbackProps, type PayphoneCheckoutStatus, type PayphoneConfirmParams, type PayphoneConfirmResult, type PayphoneModalProps, type PayphoneWidgetConfig, PayphoneWidgetRenderer, type PricingCardProps, type PricingFeatureListProps, PricingTable, type PricingTableProps, type ProviderModalProps, ReferralCard, type ReferralCardProps, type ReferralInfo, type ReferralItem, ReferralStats, type ReferralStatsData, type ReferralStatsProps, type RegisterPasskeyData, type ResetPasswordConfirmInput, ResetPasswordForm, type ResetPasswordFormProps, SDK_VERSION, type SessionSyncOptions, type SignupData, SignupForm, type SignupFormProps, type SignupInput, type SimpleMutationOptions, type SocialLoginData, type SocialLoginInput, type SubmitProofData, type SubmitTransferProofData, SubscriptionBadge, type SubscriptionBadgeProps, type SupportedLocale, type TenantMemberInfo, type TenantWithRole, type TransferModalProps, type TransferPaymentStatus, type TransferProof, type UploadTransferProofRequest, type UploadTransferProofResponse, type UseBootstrapOptions, type UseBootstrapReturn, type UseChangePasswordOptions, type UseChangePasswordReturn, type UseCheckoutOptions, type UseFormReturn, type UseLoginOptions, type UseLoginReturn, type UseLogoutOptions, type UseLogoutReturn, type UseMagicLinkOptions, type UseMagicLinkReturn, type UsePasskeysOptions, type UsePasskeysReturn, type UsePasswordResetOptions, type UsePasswordResetReturn, type UsePayButtonOptions, type UsePayButtonReturn, type UsePayphoneCheckoutOptions, type UsePayphoneCheckoutReturn, type UsePayphoneConfirmOptions, type UseRefreshOptions, type UseRefreshReturn, type UseSessionOptions, type UseSessionReturn, type UseSignupOptions, type UseSignupReturn, type UseSocialLoginOptions, type UseSocialLoginReturn, type UseTransferPaymentOptions, type UseTransferPaymentReturn, type UserSubscription, buildPaths, changePasswordSchema, cn, createAccessClient, createForgotPasswordSchema, createLoginSchema, createMutationHook, createResetPasswordConfirmSchema, createSignupSchema, en, es, forgotPasswordSchema, isAuthError, loginSchema, magicLinkRequestSchema, magicLinkVerifySchema, passkeyRegisterStartSchema, removeStyles, resetPasswordConfirmSchema, resolveMessages, signupSchema, socialLoginSchema, useAccessClient, useAzirid, useBootstrap, useBranches, useBranding, useChangePassword, useCheckout, useFormState, useInvoices, useLogin, useLogout, useMagicLink, useMessages, usePasskeys, usePasswordReset, usePasswordToggle, usePayButton, usePaymentMethods, usePaymentProviders, usePayphoneCheckout, usePayphoneConfirm, usePlans, useReferral, useReferralStats, useRefresh, useSession, useSignup, useSocialLogin, useSubmitTransferProof, useSubscription, useSwitchTenant, useTenantMembers, useTenants, useTransferPayment, useTransferProofs, useUploadTransferProof };
package/dist/index.js CHANGED
@@ -125,7 +125,9 @@ var SUFFIXES = {
125
125
  passwordResetConfirm: "password/reset/confirm",
126
126
  referralMe: "referrals/me",
127
127
  referralStats: "referrals/stats",
128
- userTenants: "tenants"
128
+ userTenants: "tenants",
129
+ branches: "branches",
130
+ paymentMethods: "payment-methods"
129
131
  };
130
132
  var BASE_PATHS = {
131
133
  /** Proxy mode (Next.js): requests go to the same origin via route handler */
@@ -909,7 +911,7 @@ function AziridProviderInner({
909
911
  user,
910
912
  accessToken,
911
913
  isAuthenticated: user !== null,
912
- isLoading: loginMutation.isPending || signupMutation.isPending,
914
+ isLoading: isBootstrapping || loginMutation.isPending || signupMutation.isPending,
913
915
  error,
914
916
  login,
915
917
  signup,
@@ -3010,6 +3012,8 @@ var PP_CONTAINER_ID = "pp-paybtn-azirid";
3010
3012
  function usePayButton({
3011
3013
  intentId,
3012
3014
  planId,
3015
+ branchId,
3016
+ merchantAccountId,
3013
3017
  onSuccess,
3014
3018
  onError
3015
3019
  }) {
@@ -3074,12 +3078,14 @@ function usePayButton({
3074
3078
  doCheckout({
3075
3079
  intentId,
3076
3080
  planId,
3081
+ branchId,
3082
+ merchantAccountId,
3077
3083
  provider,
3078
3084
  successUrl: currentUrl,
3079
3085
  cancelUrl: currentUrl
3080
3086
  });
3081
3087
  },
3082
- [doCheckout, intentId, planId]
3088
+ [doCheckout, intentId, planId, branchId, merchantAccountId]
3083
3089
  );
3084
3090
  const { mutate: confirmPayphone } = usePayphoneConfirm({
3085
3091
  onSuccess: (data) => {
@@ -3782,6 +3788,8 @@ function TransferModal2({ data, onClose, onProofSubmitted, labels }) {
3782
3788
  function PayButton({
3783
3789
  planId,
3784
3790
  intentId,
3791
+ branchId,
3792
+ merchantAccountId,
3785
3793
  successUrl,
3786
3794
  cancelUrl,
3787
3795
  className,
@@ -3807,6 +3815,8 @@ function PayButton({
3807
3815
  } = usePayButton({
3808
3816
  intentId,
3809
3817
  planId,
3818
+ branchId,
3819
+ merchantAccountId,
3810
3820
  onSuccess: (data) => {
3811
3821
  if (data.provider === "MANUAL_TRANSFER") {
3812
3822
  setShowTransferModal(true);
@@ -4187,11 +4197,13 @@ function useLogout(options) {
4187
4197
  }
4188
4198
  function useSession(options) {
4189
4199
  const client = useAccessClient();
4200
+ const { isBootstrapping } = useAzirid();
4190
4201
  const query = useQuery({
4191
4202
  queryKey: ["azirid-access", "session"],
4192
4203
  queryFn: () => client.get(client.paths.me),
4193
4204
  retry: false,
4194
- enabled: options?.enabled ?? true,
4205
+ // Wait for bootstrap to complete before fetching /me
4206
+ enabled: (options?.enabled ?? true) && !isBootstrapping,
4195
4207
  refetchInterval: options?.refetchInterval,
4196
4208
  refetchOnWindowFocus: options?.refetchOnWindowFocus ?? false
4197
4209
  });
@@ -4625,6 +4637,21 @@ function useTransferPayment({
4625
4637
  error: currentError
4626
4638
  };
4627
4639
  }
4640
+ function useBranches() {
4641
+ const client = useAccessClient();
4642
+ return useQuery({
4643
+ queryKey: ["azirid-access", "branches"],
4644
+ queryFn: () => client.get(client.paths.branches)
4645
+ });
4646
+ }
4647
+ function usePaymentMethods(branchId) {
4648
+ const client = useAccessClient();
4649
+ const path = branchId ? `${client.paths.paymentMethods}?branchId=${encodeURIComponent(branchId)}` : client.paths.paymentMethods;
4650
+ return useQuery({
4651
+ queryKey: ["azirid-access", "payment-methods", branchId ?? null],
4652
+ queryFn: () => client.get(path)
4653
+ });
4654
+ }
4628
4655
  function useTenants() {
4629
4656
  const client = useAccessClient();
4630
4657
  return useQuery({
@@ -4717,8 +4744,8 @@ function usePasswordToggle() {
4717
4744
  }
4718
4745
 
4719
4746
  // src/index.ts
4720
- var SDK_VERSION = "0.11.0";
4747
+ var SDK_VERSION = "0.11.2";
4721
4748
 
4722
- export { AuthForm, AziridProvider, BASE_PATHS, CheckoutButton, ForgotPasswordForm, InvoiceList, LoginForm, PATHS, PayButton, PayphoneCallback, PayphoneWidgetRenderer, PricingTable, ReferralCard, ReferralStats, ResetPasswordForm, SDK_VERSION, SignupForm, SubscriptionBadge, buildPaths, changePasswordSchema, cn, createAccessClient, createForgotPasswordSchema, createLoginSchema, createMutationHook, createResetPasswordConfirmSchema, createSignupSchema, en, es, forgotPasswordSchema, isAuthError, loginSchema, magicLinkRequestSchema, magicLinkVerifySchema, passkeyRegisterStartSchema, removeStyles, resetPasswordConfirmSchema, resolveMessages, signupSchema, socialLoginSchema, useAccessClient, useAzirid, useBootstrap, useBranding, useChangePassword, useCheckout, useFormState, useInvoices, useLogin, useLogout, useMagicLink, useMessages, usePasskeys, usePasswordReset, usePasswordToggle, usePayButton, usePaymentProviders, usePayphoneCheckout, usePayphoneConfirm, usePlans, useReferral, useReferralStats, useRefresh, useSession, useSignup, useSocialLogin, useSubmitTransferProof, useSubscription, useSwitchTenant, useTenantMembers, useTenants, useTransferPayment, useTransferProofs, useUploadTransferProof };
4749
+ export { AuthForm, AziridProvider, BASE_PATHS, CheckoutButton, ForgotPasswordForm, InvoiceList, LoginForm, PATHS, PayButton, PayphoneCallback, PayphoneWidgetRenderer, PricingTable, ReferralCard, ReferralStats, ResetPasswordForm, SDK_VERSION, SignupForm, SubscriptionBadge, buildPaths, changePasswordSchema, cn, createAccessClient, createForgotPasswordSchema, createLoginSchema, createMutationHook, createResetPasswordConfirmSchema, createSignupSchema, en, es, forgotPasswordSchema, isAuthError, loginSchema, magicLinkRequestSchema, magicLinkVerifySchema, passkeyRegisterStartSchema, removeStyles, resetPasswordConfirmSchema, resolveMessages, signupSchema, socialLoginSchema, useAccessClient, useAzirid, useBootstrap, useBranches, useBranding, useChangePassword, useCheckout, useFormState, useInvoices, useLogin, useLogout, useMagicLink, useMessages, usePasskeys, usePasswordReset, usePasswordToggle, usePayButton, usePaymentMethods, usePaymentProviders, usePayphoneCheckout, usePayphoneConfirm, usePlans, useReferral, useReferralStats, useRefresh, useSession, useSignup, useSocialLogin, useSubmitTransferProof, useSubscription, useSwitchTenant, useTenantMembers, useTenants, useTransferPayment, useTransferProofs, useUploadTransferProof };
4723
4750
  //# sourceMappingURL=index.js.map
4724
4751
  //# sourceMappingURL=index.js.map