@stigg/react-sdk 7.14.0 → 7.16.0
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.mts +158 -3
- package/dist/index.d.ts +158 -3
- package/dist/stigg-sdk.cjs.js +658 -416
- package/dist/stigg-sdk.esm.js +658 -416
- package/package.json +4 -2
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _stigg_js_client_sdk from '@stigg/js-client-sdk';
|
|
|
2
2
|
import { Plan, Customer, Subscription, BillingPeriod, BillableFeature, CustomerPortalSubscriptionScheduledUpdateDataFragment, PaywallCurrency, PaywallCalculatedPricePoint, PriceTierFragment, Price, CustomerPortalSubscription, CustomerPortalEntitlement, EntitlementsFallback, SubscriptionAddon, Addon, BillingAddress, SubscriptionBillingInfo, GetCheckoutState, GetCheckoutStateResults, ApplySubscription, ApplySubscriptionResults, CheckoutStatePlan, PreviewSubscription, SubscriptionPreviewV2, SubscriptionPreviewDiscount, SubscriptionPreviewTaxDetails, GetBooleanEntitlement, BooleanEntitlement, GetNumericEntitlement, NumericEntitlement, GetMeteredEntitlement, MeteredEntitlement, GetEnumEntitlement, EnumEntitlement, GetActiveSubscriptions, GetPaywall, GetCustomerPortal, CreditUsageTimeRange, GetCreditUsageInput, CursorPaging, CreditGrantFragment, PageInfoFragment } from '@stigg/js-client-sdk';
|
|
3
3
|
export * from '@stigg/js-client-sdk';
|
|
4
4
|
import { FeatureFragment, BillingPeriod as BillingPeriod$1, BillableFeatureInput } from '@stigg/api-client-js/src/generated/sdk';
|
|
5
|
-
import react, { PropsWithChildren, ReactNode } from 'react';
|
|
5
|
+
import react, { PropsWithChildren, ChangeEvent, ReactNode } from 'react';
|
|
6
6
|
import { ChipProps } from '@mui/material';
|
|
7
7
|
|
|
8
8
|
type DeepPartial<T> = T extends object ? {
|
|
@@ -348,6 +348,7 @@ type PaymentStepState = {
|
|
|
348
348
|
errorMessage?: string;
|
|
349
349
|
billingAddress?: BillingAddress;
|
|
350
350
|
taxPercentage?: number;
|
|
351
|
+
taxId?: TaxId;
|
|
351
352
|
};
|
|
352
353
|
|
|
353
354
|
type PlanStepState = {
|
|
@@ -371,7 +372,12 @@ type BillingInformation = {
|
|
|
371
372
|
};
|
|
372
373
|
type TaxDetailsInput = {
|
|
373
374
|
taxPercentage?: SubscriptionBillingInfo['taxPercentage'];
|
|
375
|
+
taxId?: TaxId;
|
|
374
376
|
};
|
|
377
|
+
interface TaxId {
|
|
378
|
+
type: string;
|
|
379
|
+
value: string;
|
|
380
|
+
}
|
|
375
381
|
type MockCheckoutPreviewCallback = (params: PreviewSubscription) => SubscriptionPreviewV2;
|
|
376
382
|
type MockCheckoutStateCallback = (params: GetCheckoutState) => GetCheckoutStateResults;
|
|
377
383
|
type CheckoutMockProps = {
|
|
@@ -565,6 +571,7 @@ type CheckoutContainerProps = {
|
|
|
565
571
|
disablePromotionCode?: boolean;
|
|
566
572
|
disableSuccessAnimation?: boolean;
|
|
567
573
|
collectPhoneNumber?: boolean;
|
|
574
|
+
collectTaxId?: boolean;
|
|
568
575
|
onMockCheckoutPreview?: MockCheckoutPreviewCallback;
|
|
569
576
|
};
|
|
570
577
|
|
|
@@ -724,7 +731,7 @@ type CreditUtilizationLocalization = {
|
|
|
724
731
|
};
|
|
725
732
|
declare function CreditUtilization({ currencyId, localization, decimalPlaces, showUnits, showSymbol, }: CreditUtilizationProps): JSX.Element;
|
|
726
733
|
|
|
727
|
-
type CreditGrant = Pick<CreditGrantFragment, 'grantId' | 'amount' | 'comment' | 'currencyId' | 'effectiveAt' | 'expireAt' | 'grantType' | 'consumedAmount' | 'createdAt' | 'updatedAt'>;
|
|
734
|
+
type CreditGrant = Pick<CreditGrantFragment, 'grantId' | 'amount' | 'comment' | 'currencyId' | 'effectiveAt' | 'expireAt' | 'grantType' | 'consumedAmount' | 'createdAt' | 'updatedAt' | 'automaticRechargeConfigurationId'>;
|
|
728
735
|
declare enum CreditGrantStatus {
|
|
729
736
|
SCHEDULED = "SCHEDULED",
|
|
730
737
|
AVAILABLE = "AVAILABLE",
|
|
@@ -761,6 +768,154 @@ declare function useCreditGrants(params: GetCreditGrantsParams): {
|
|
|
761
768
|
totalCount?: number;
|
|
762
769
|
};
|
|
763
770
|
|
|
771
|
+
interface AutoRechargeStatusLocalization {
|
|
772
|
+
title?: string;
|
|
773
|
+
activeLabel?: string;
|
|
774
|
+
manageButton?: string;
|
|
775
|
+
descriptionTemplate?: string;
|
|
776
|
+
emptyStateMessage?: string;
|
|
777
|
+
spendTemplate?: string;
|
|
778
|
+
unlimitedSpendLimit?: string;
|
|
779
|
+
}
|
|
780
|
+
interface AutoRechargeStatusContentProps {
|
|
781
|
+
customerId: string;
|
|
782
|
+
currencyId: string;
|
|
783
|
+
currencyUnit?: string;
|
|
784
|
+
billingCurrency?: string;
|
|
785
|
+
onManageClick?: () => void;
|
|
786
|
+
className?: string;
|
|
787
|
+
localization?: AutoRechargeStatusLocalization;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
type AutoRechargeStatusProps = AutoRechargeStatusContentProps;
|
|
791
|
+
|
|
792
|
+
declare function AutoRechargeStatus(props: AutoRechargeStatusProps): JSX.Element;
|
|
793
|
+
|
|
794
|
+
interface AutomaticRechargeConfiguration {
|
|
795
|
+
id: string;
|
|
796
|
+
enabled: boolean;
|
|
797
|
+
thresholdAmount: number;
|
|
798
|
+
targetBalance: number;
|
|
799
|
+
maxSpendLimit?: number;
|
|
800
|
+
currencyId: string;
|
|
801
|
+
customerId: string;
|
|
802
|
+
currentMonthlySpend?: number;
|
|
803
|
+
}
|
|
804
|
+
interface UpdateAutomaticRechargeConfigParams {
|
|
805
|
+
customerId: string;
|
|
806
|
+
currencyId: string;
|
|
807
|
+
enabled: boolean;
|
|
808
|
+
thresholdAmount?: number;
|
|
809
|
+
targetBalance?: number;
|
|
810
|
+
maxSpendLimit?: number;
|
|
811
|
+
}
|
|
812
|
+
interface AutomaticRechargeConfigLocalization {
|
|
813
|
+
title?: string;
|
|
814
|
+
enableLabel?: string;
|
|
815
|
+
enableDescription?: string;
|
|
816
|
+
thresholdFieldPrefix?: string;
|
|
817
|
+
thresholdFieldSuffix?: string;
|
|
818
|
+
thresholdTooltip?: string;
|
|
819
|
+
thresholdFieldPlaceholder?: string;
|
|
820
|
+
thresholdFieldHint?: string;
|
|
821
|
+
thresholdRequired?: string;
|
|
822
|
+
thresholdMin?: string;
|
|
823
|
+
thresholdMax?: string;
|
|
824
|
+
targetFieldPrefix?: string;
|
|
825
|
+
targetFieldSuffix?: string;
|
|
826
|
+
targetBalanceTooltip?: string;
|
|
827
|
+
targetFieldPlaceholder?: string;
|
|
828
|
+
targetFieldHint?: string;
|
|
829
|
+
targetRequired?: string;
|
|
830
|
+
targetMin?: string;
|
|
831
|
+
targetMax?: string;
|
|
832
|
+
spendLimitFieldPrefix?: string;
|
|
833
|
+
spendLimitFieldSuffix?: string;
|
|
834
|
+
spendLimitFieldPlaceholder?: string;
|
|
835
|
+
spendLimitHelpText?: string;
|
|
836
|
+
spendLimitPeriod?: string;
|
|
837
|
+
spendLimitPositive?: string;
|
|
838
|
+
spendLimitMin?: string;
|
|
839
|
+
spendLimitMax?: string;
|
|
840
|
+
immediateRechargeWarning?: string;
|
|
841
|
+
spendLimitTooLowWarning?: string;
|
|
842
|
+
cancelButton?: string;
|
|
843
|
+
saveButton?: string;
|
|
844
|
+
editButton?: string;
|
|
845
|
+
loadingState?: string;
|
|
846
|
+
errorState?: string;
|
|
847
|
+
emptyState?: string;
|
|
848
|
+
}
|
|
849
|
+
interface AutomaticRechargeFormData {
|
|
850
|
+
enabled: boolean;
|
|
851
|
+
thresholdAmount: string;
|
|
852
|
+
targetBalance: string;
|
|
853
|
+
maxSpendLimit: string;
|
|
854
|
+
}
|
|
855
|
+
interface AutomaticRechargeFormErrors {
|
|
856
|
+
thresholdAmount?: string;
|
|
857
|
+
targetBalance?: string;
|
|
858
|
+
maxSpendLimit?: string;
|
|
859
|
+
}
|
|
860
|
+
interface AutomaticRechargeConfigFormProps {
|
|
861
|
+
customerId: string;
|
|
862
|
+
currencyId: string;
|
|
863
|
+
currencyUnit?: string;
|
|
864
|
+
poolSize?: number;
|
|
865
|
+
currentBalance?: number;
|
|
866
|
+
currentMonthlySpend?: number;
|
|
867
|
+
initialData?: AutomaticRechargeConfiguration;
|
|
868
|
+
readOnly?: boolean;
|
|
869
|
+
onSave?: (data: UpdateAutomaticRechargeConfigParams) => void;
|
|
870
|
+
onCancel?: () => void;
|
|
871
|
+
localization?: AutomaticRechargeConfigLocalization;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
interface AutomaticRechargeConfigProps {
|
|
875
|
+
customerId: string;
|
|
876
|
+
currencyId: string;
|
|
877
|
+
currencyUnit?: string;
|
|
878
|
+
poolSize?: number;
|
|
879
|
+
readOnly?: boolean;
|
|
880
|
+
localization?: AutomaticRechargeConfigLocalization;
|
|
881
|
+
onSave?: (data: UpdateAutomaticRechargeConfigParams) => void;
|
|
882
|
+
onCancel?: () => void;
|
|
883
|
+
}
|
|
884
|
+
declare function AutomaticRechargeConfig({ customerId, currencyId, currencyUnit, poolSize, readOnly, localization, onSave, onCancel, }: AutomaticRechargeConfigProps): JSX.Element;
|
|
885
|
+
|
|
886
|
+
declare function AutomaticRechargeConfigForm({ customerId, currencyId, initialData, currencyUnit, poolSize, currentBalance, currentMonthlySpend, readOnly, localization, onSave, onCancel, }: AutomaticRechargeConfigFormProps): JSX.Element;
|
|
887
|
+
|
|
888
|
+
interface UseAutomaticRechargeFormProps {
|
|
889
|
+
initialData?: AutomaticRechargeConfiguration;
|
|
890
|
+
poolSize?: number;
|
|
891
|
+
localization: Required<AutomaticRechargeConfigLocalization>;
|
|
892
|
+
}
|
|
893
|
+
declare function useAutomaticRechargeForm({ initialData, poolSize, localization }: UseAutomaticRechargeFormProps): {
|
|
894
|
+
formData: AutomaticRechargeFormData;
|
|
895
|
+
errors: AutomaticRechargeFormErrors;
|
|
896
|
+
touched: {
|
|
897
|
+
[key: string]: boolean;
|
|
898
|
+
};
|
|
899
|
+
handleEnabledChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
900
|
+
handleFieldChange: (field: keyof AutomaticRechargeFormData) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
901
|
+
handleFieldBlur: (field: keyof AutomaticRechargeFormData) => () => void;
|
|
902
|
+
getFieldError: (field: keyof AutomaticRechargeFormErrors) => string | undefined;
|
|
903
|
+
validate: () => boolean;
|
|
904
|
+
getFormValues: () => {
|
|
905
|
+
enabled: boolean;
|
|
906
|
+
thresholdAmount: number | undefined;
|
|
907
|
+
targetBalance: number | undefined;
|
|
908
|
+
maxSpendLimit: number | undefined;
|
|
909
|
+
};
|
|
910
|
+
};
|
|
911
|
+
|
|
912
|
+
interface ValidationRules {
|
|
913
|
+
poolSize?: number;
|
|
914
|
+
minSpendLimit?: number;
|
|
915
|
+
maxSpendLimit?: number;
|
|
916
|
+
}
|
|
917
|
+
declare function validateAutomaticRechargeForm(data: AutomaticRechargeFormData, rules: ValidationRules | undefined, localization: Pick<AutomaticRechargeConfigLocalization, 'thresholdRequired' | 'thresholdMin' | 'thresholdMax' | 'targetRequired' | 'targetMin' | 'targetMax' | 'spendLimitPositive' | 'spendLimitMin' | 'spendLimitMax'>): AutomaticRechargeFormErrors;
|
|
918
|
+
|
|
764
919
|
type TableAlignment = 'left' | 'center' | 'right';
|
|
765
920
|
type PixelWidth = `${number}px`;
|
|
766
921
|
interface HeadCell<T> {
|
|
@@ -833,4 +988,4 @@ declare function StatusChip({ variant, label, className, size, ...props }: Statu
|
|
|
833
988
|
|
|
834
989
|
declare const mapCreditGrantStatusToVariant: (status: CreditGrantStatus) => StatusChipVariant;
|
|
835
990
|
|
|
836
|
-
export { AddonsList, type BillingInformation, BooleanEntitlementGuard, Checkout, type CheckoutContainerProps, type CheckoutLocalization, type CheckoutMockProps, type CheckoutProps, type CheckoutProviderProps, type CheckoutResult, type CheckoutState, CheckoutStepKey, type CheckoutTheme, CreditBalance, type CreditBalanceProps, CreditGrants, type CreditGrantsLocalization, type CreditGrantsProps, CreditUsageChart, CreditUtilization, type CreditUtilizationLocalization, type CreditUtilizationProps, type CurrentPlanParams, type CurrentSubscriptionOverride, type CurrentSubscriptionOverrideFn, CustomerPortal, CustomerPortalIntentionType, type CustomerPortalLocalization, type CustomerPortalProps, CustomerPortalProvider, type CustomerPortalSection, type CustomerPortalTheme, CustomerUsageData, type CustomerUsageDataProps, EmptyState, EnumEntitlementGuard, ErrorState, type FontVariant, GenericTable, type GenericTableProps, type GetCreditBalanceParams, type GetCreditGrantsParams, type HeadCell, type HorizontalAlignment, InvoicesSection, MeteredEntitlementGuard, type MockCheckoutPreviewCallback, type MockCheckoutStateCallback, NumericEntitlementGuard, type OnAddonChangeCallback, type OnBeforeStepChangeCallback, type OnBillableFeatureChangeCallback, type OnBuyMoreCallbackFn, type OnCheckoutCompletedParams, type OnCheckoutParams, type OnManageSubscriptionFn, type OnPlanSelectedCallbackFn, PaymentDetailsSection, PaywallContainer as Paywall, type PaywallData, type PaywallLocalization, type PaywallPlan, type PaywallContainerProps as PaywallProps, type PixelWidth, type PlanPriceText, Promotions, ProvisionStatus, type SelectDefaultTierIndexFn, type ShouldHidePlanFn, StatusChip, type StatusChipColors, type StatusChipVariant, StiggContext, type StiggContextValue, StiggProvider, type StiggProviderProps, type StiggTheme, SubscribeIntentionType, SubscriptionsOverview, type SubscriptionsOverviewProps, type TableAlignment, type TaxDetailsInput, type TextAlignment, type CustomizedTheme as Theme, formatDateOnly, formatDateTime, mapCreditGrantStatusToVariant, useActiveSubscriptions, useBooleanEntitlement, useCreditBalance, useCreditGrants, useCreditUsage, useCustomerPortal, useEnumEntitlement, useMeteredEntitlement, useNumericEntitlement, usePaywall, useStiggContext, useWaitForCheckoutCompleted };
|
|
991
|
+
export { AddonsList, AutoRechargeStatus, type AutoRechargeStatusLocalization, type AutoRechargeStatusProps, AutomaticRechargeConfig, AutomaticRechargeConfigForm, type AutomaticRechargeConfigFormProps, type AutomaticRechargeConfigLocalization, type AutomaticRechargeConfigProps, type AutomaticRechargeConfiguration, type AutomaticRechargeFormData, type AutomaticRechargeFormErrors, type BillingInformation, BooleanEntitlementGuard, Checkout, type CheckoutContainerProps, type CheckoutLocalization, type CheckoutMockProps, type CheckoutProps, type CheckoutProviderProps, type CheckoutResult, type CheckoutState, CheckoutStepKey, type CheckoutTheme, CreditBalance, type CreditBalanceProps, CreditGrants, type CreditGrantsLocalization, type CreditGrantsProps, CreditUsageChart, CreditUtilization, type CreditUtilizationLocalization, type CreditUtilizationProps, type CurrentPlanParams, type CurrentSubscriptionOverride, type CurrentSubscriptionOverrideFn, CustomerPortal, CustomerPortalIntentionType, type CustomerPortalLocalization, type CustomerPortalProps, CustomerPortalProvider, type CustomerPortalSection, type CustomerPortalTheme, CustomerUsageData, type CustomerUsageDataProps, EmptyState, EnumEntitlementGuard, ErrorState, type FontVariant, GenericTable, type GenericTableProps, type GetCreditBalanceParams, type GetCreditGrantsParams, type HeadCell, type HorizontalAlignment, InvoicesSection, MeteredEntitlementGuard, type MockCheckoutPreviewCallback, type MockCheckoutStateCallback, NumericEntitlementGuard, type OnAddonChangeCallback, type OnBeforeStepChangeCallback, type OnBillableFeatureChangeCallback, type OnBuyMoreCallbackFn, type OnCheckoutCompletedParams, type OnCheckoutParams, type OnManageSubscriptionFn, type OnPlanSelectedCallbackFn, PaymentDetailsSection, PaywallContainer as Paywall, type PaywallData, type PaywallLocalization, type PaywallPlan, type PaywallContainerProps as PaywallProps, type PixelWidth, type PlanPriceText, Promotions, ProvisionStatus, type SelectDefaultTierIndexFn, type ShouldHidePlanFn, StatusChip, type StatusChipColors, type StatusChipVariant, StiggContext, type StiggContextValue, StiggProvider, type StiggProviderProps, type StiggTheme, SubscribeIntentionType, SubscriptionsOverview, type SubscriptionsOverviewProps, type TableAlignment, type TaxDetailsInput, type TextAlignment, type CustomizedTheme as Theme, type UpdateAutomaticRechargeConfigParams, formatDateOnly, formatDateTime, mapCreditGrantStatusToVariant, useActiveSubscriptions, useAutomaticRechargeForm, useBooleanEntitlement, useCreditBalance, useCreditGrants, useCreditUsage, useCustomerPortal, useEnumEntitlement, useMeteredEntitlement, useNumericEntitlement, usePaywall, useStiggContext, useWaitForCheckoutCompleted, validateAutomaticRechargeForm };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _stigg_js_client_sdk from '@stigg/js-client-sdk';
|
|
|
2
2
|
import { Plan, Customer, Subscription, BillingPeriod, BillableFeature, CustomerPortalSubscriptionScheduledUpdateDataFragment, PaywallCurrency, PaywallCalculatedPricePoint, PriceTierFragment, Price, CustomerPortalSubscription, CustomerPortalEntitlement, EntitlementsFallback, SubscriptionAddon, Addon, BillingAddress, SubscriptionBillingInfo, GetCheckoutState, GetCheckoutStateResults, ApplySubscription, ApplySubscriptionResults, CheckoutStatePlan, PreviewSubscription, SubscriptionPreviewV2, SubscriptionPreviewDiscount, SubscriptionPreviewTaxDetails, GetBooleanEntitlement, BooleanEntitlement, GetNumericEntitlement, NumericEntitlement, GetMeteredEntitlement, MeteredEntitlement, GetEnumEntitlement, EnumEntitlement, GetActiveSubscriptions, GetPaywall, GetCustomerPortal, CreditUsageTimeRange, GetCreditUsageInput, CursorPaging, CreditGrantFragment, PageInfoFragment } from '@stigg/js-client-sdk';
|
|
3
3
|
export * from '@stigg/js-client-sdk';
|
|
4
4
|
import { FeatureFragment, BillingPeriod as BillingPeriod$1, BillableFeatureInput } from '@stigg/api-client-js/src/generated/sdk';
|
|
5
|
-
import react, { PropsWithChildren, ReactNode } from 'react';
|
|
5
|
+
import react, { PropsWithChildren, ChangeEvent, ReactNode } from 'react';
|
|
6
6
|
import { ChipProps } from '@mui/material';
|
|
7
7
|
|
|
8
8
|
type DeepPartial<T> = T extends object ? {
|
|
@@ -348,6 +348,7 @@ type PaymentStepState = {
|
|
|
348
348
|
errorMessage?: string;
|
|
349
349
|
billingAddress?: BillingAddress;
|
|
350
350
|
taxPercentage?: number;
|
|
351
|
+
taxId?: TaxId;
|
|
351
352
|
};
|
|
352
353
|
|
|
353
354
|
type PlanStepState = {
|
|
@@ -371,7 +372,12 @@ type BillingInformation = {
|
|
|
371
372
|
};
|
|
372
373
|
type TaxDetailsInput = {
|
|
373
374
|
taxPercentage?: SubscriptionBillingInfo['taxPercentage'];
|
|
375
|
+
taxId?: TaxId;
|
|
374
376
|
};
|
|
377
|
+
interface TaxId {
|
|
378
|
+
type: string;
|
|
379
|
+
value: string;
|
|
380
|
+
}
|
|
375
381
|
type MockCheckoutPreviewCallback = (params: PreviewSubscription) => SubscriptionPreviewV2;
|
|
376
382
|
type MockCheckoutStateCallback = (params: GetCheckoutState) => GetCheckoutStateResults;
|
|
377
383
|
type CheckoutMockProps = {
|
|
@@ -565,6 +571,7 @@ type CheckoutContainerProps = {
|
|
|
565
571
|
disablePromotionCode?: boolean;
|
|
566
572
|
disableSuccessAnimation?: boolean;
|
|
567
573
|
collectPhoneNumber?: boolean;
|
|
574
|
+
collectTaxId?: boolean;
|
|
568
575
|
onMockCheckoutPreview?: MockCheckoutPreviewCallback;
|
|
569
576
|
};
|
|
570
577
|
|
|
@@ -724,7 +731,7 @@ type CreditUtilizationLocalization = {
|
|
|
724
731
|
};
|
|
725
732
|
declare function CreditUtilization({ currencyId, localization, decimalPlaces, showUnits, showSymbol, }: CreditUtilizationProps): JSX.Element;
|
|
726
733
|
|
|
727
|
-
type CreditGrant = Pick<CreditGrantFragment, 'grantId' | 'amount' | 'comment' | 'currencyId' | 'effectiveAt' | 'expireAt' | 'grantType' | 'consumedAmount' | 'createdAt' | 'updatedAt'>;
|
|
734
|
+
type CreditGrant = Pick<CreditGrantFragment, 'grantId' | 'amount' | 'comment' | 'currencyId' | 'effectiveAt' | 'expireAt' | 'grantType' | 'consumedAmount' | 'createdAt' | 'updatedAt' | 'automaticRechargeConfigurationId'>;
|
|
728
735
|
declare enum CreditGrantStatus {
|
|
729
736
|
SCHEDULED = "SCHEDULED",
|
|
730
737
|
AVAILABLE = "AVAILABLE",
|
|
@@ -761,6 +768,154 @@ declare function useCreditGrants(params: GetCreditGrantsParams): {
|
|
|
761
768
|
totalCount?: number;
|
|
762
769
|
};
|
|
763
770
|
|
|
771
|
+
interface AutoRechargeStatusLocalization {
|
|
772
|
+
title?: string;
|
|
773
|
+
activeLabel?: string;
|
|
774
|
+
manageButton?: string;
|
|
775
|
+
descriptionTemplate?: string;
|
|
776
|
+
emptyStateMessage?: string;
|
|
777
|
+
spendTemplate?: string;
|
|
778
|
+
unlimitedSpendLimit?: string;
|
|
779
|
+
}
|
|
780
|
+
interface AutoRechargeStatusContentProps {
|
|
781
|
+
customerId: string;
|
|
782
|
+
currencyId: string;
|
|
783
|
+
currencyUnit?: string;
|
|
784
|
+
billingCurrency?: string;
|
|
785
|
+
onManageClick?: () => void;
|
|
786
|
+
className?: string;
|
|
787
|
+
localization?: AutoRechargeStatusLocalization;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
type AutoRechargeStatusProps = AutoRechargeStatusContentProps;
|
|
791
|
+
|
|
792
|
+
declare function AutoRechargeStatus(props: AutoRechargeStatusProps): JSX.Element;
|
|
793
|
+
|
|
794
|
+
interface AutomaticRechargeConfiguration {
|
|
795
|
+
id: string;
|
|
796
|
+
enabled: boolean;
|
|
797
|
+
thresholdAmount: number;
|
|
798
|
+
targetBalance: number;
|
|
799
|
+
maxSpendLimit?: number;
|
|
800
|
+
currencyId: string;
|
|
801
|
+
customerId: string;
|
|
802
|
+
currentMonthlySpend?: number;
|
|
803
|
+
}
|
|
804
|
+
interface UpdateAutomaticRechargeConfigParams {
|
|
805
|
+
customerId: string;
|
|
806
|
+
currencyId: string;
|
|
807
|
+
enabled: boolean;
|
|
808
|
+
thresholdAmount?: number;
|
|
809
|
+
targetBalance?: number;
|
|
810
|
+
maxSpendLimit?: number;
|
|
811
|
+
}
|
|
812
|
+
interface AutomaticRechargeConfigLocalization {
|
|
813
|
+
title?: string;
|
|
814
|
+
enableLabel?: string;
|
|
815
|
+
enableDescription?: string;
|
|
816
|
+
thresholdFieldPrefix?: string;
|
|
817
|
+
thresholdFieldSuffix?: string;
|
|
818
|
+
thresholdTooltip?: string;
|
|
819
|
+
thresholdFieldPlaceholder?: string;
|
|
820
|
+
thresholdFieldHint?: string;
|
|
821
|
+
thresholdRequired?: string;
|
|
822
|
+
thresholdMin?: string;
|
|
823
|
+
thresholdMax?: string;
|
|
824
|
+
targetFieldPrefix?: string;
|
|
825
|
+
targetFieldSuffix?: string;
|
|
826
|
+
targetBalanceTooltip?: string;
|
|
827
|
+
targetFieldPlaceholder?: string;
|
|
828
|
+
targetFieldHint?: string;
|
|
829
|
+
targetRequired?: string;
|
|
830
|
+
targetMin?: string;
|
|
831
|
+
targetMax?: string;
|
|
832
|
+
spendLimitFieldPrefix?: string;
|
|
833
|
+
spendLimitFieldSuffix?: string;
|
|
834
|
+
spendLimitFieldPlaceholder?: string;
|
|
835
|
+
spendLimitHelpText?: string;
|
|
836
|
+
spendLimitPeriod?: string;
|
|
837
|
+
spendLimitPositive?: string;
|
|
838
|
+
spendLimitMin?: string;
|
|
839
|
+
spendLimitMax?: string;
|
|
840
|
+
immediateRechargeWarning?: string;
|
|
841
|
+
spendLimitTooLowWarning?: string;
|
|
842
|
+
cancelButton?: string;
|
|
843
|
+
saveButton?: string;
|
|
844
|
+
editButton?: string;
|
|
845
|
+
loadingState?: string;
|
|
846
|
+
errorState?: string;
|
|
847
|
+
emptyState?: string;
|
|
848
|
+
}
|
|
849
|
+
interface AutomaticRechargeFormData {
|
|
850
|
+
enabled: boolean;
|
|
851
|
+
thresholdAmount: string;
|
|
852
|
+
targetBalance: string;
|
|
853
|
+
maxSpendLimit: string;
|
|
854
|
+
}
|
|
855
|
+
interface AutomaticRechargeFormErrors {
|
|
856
|
+
thresholdAmount?: string;
|
|
857
|
+
targetBalance?: string;
|
|
858
|
+
maxSpendLimit?: string;
|
|
859
|
+
}
|
|
860
|
+
interface AutomaticRechargeConfigFormProps {
|
|
861
|
+
customerId: string;
|
|
862
|
+
currencyId: string;
|
|
863
|
+
currencyUnit?: string;
|
|
864
|
+
poolSize?: number;
|
|
865
|
+
currentBalance?: number;
|
|
866
|
+
currentMonthlySpend?: number;
|
|
867
|
+
initialData?: AutomaticRechargeConfiguration;
|
|
868
|
+
readOnly?: boolean;
|
|
869
|
+
onSave?: (data: UpdateAutomaticRechargeConfigParams) => void;
|
|
870
|
+
onCancel?: () => void;
|
|
871
|
+
localization?: AutomaticRechargeConfigLocalization;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
interface AutomaticRechargeConfigProps {
|
|
875
|
+
customerId: string;
|
|
876
|
+
currencyId: string;
|
|
877
|
+
currencyUnit?: string;
|
|
878
|
+
poolSize?: number;
|
|
879
|
+
readOnly?: boolean;
|
|
880
|
+
localization?: AutomaticRechargeConfigLocalization;
|
|
881
|
+
onSave?: (data: UpdateAutomaticRechargeConfigParams) => void;
|
|
882
|
+
onCancel?: () => void;
|
|
883
|
+
}
|
|
884
|
+
declare function AutomaticRechargeConfig({ customerId, currencyId, currencyUnit, poolSize, readOnly, localization, onSave, onCancel, }: AutomaticRechargeConfigProps): JSX.Element;
|
|
885
|
+
|
|
886
|
+
declare function AutomaticRechargeConfigForm({ customerId, currencyId, initialData, currencyUnit, poolSize, currentBalance, currentMonthlySpend, readOnly, localization, onSave, onCancel, }: AutomaticRechargeConfigFormProps): JSX.Element;
|
|
887
|
+
|
|
888
|
+
interface UseAutomaticRechargeFormProps {
|
|
889
|
+
initialData?: AutomaticRechargeConfiguration;
|
|
890
|
+
poolSize?: number;
|
|
891
|
+
localization: Required<AutomaticRechargeConfigLocalization>;
|
|
892
|
+
}
|
|
893
|
+
declare function useAutomaticRechargeForm({ initialData, poolSize, localization }: UseAutomaticRechargeFormProps): {
|
|
894
|
+
formData: AutomaticRechargeFormData;
|
|
895
|
+
errors: AutomaticRechargeFormErrors;
|
|
896
|
+
touched: {
|
|
897
|
+
[key: string]: boolean;
|
|
898
|
+
};
|
|
899
|
+
handleEnabledChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
900
|
+
handleFieldChange: (field: keyof AutomaticRechargeFormData) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
901
|
+
handleFieldBlur: (field: keyof AutomaticRechargeFormData) => () => void;
|
|
902
|
+
getFieldError: (field: keyof AutomaticRechargeFormErrors) => string | undefined;
|
|
903
|
+
validate: () => boolean;
|
|
904
|
+
getFormValues: () => {
|
|
905
|
+
enabled: boolean;
|
|
906
|
+
thresholdAmount: number | undefined;
|
|
907
|
+
targetBalance: number | undefined;
|
|
908
|
+
maxSpendLimit: number | undefined;
|
|
909
|
+
};
|
|
910
|
+
};
|
|
911
|
+
|
|
912
|
+
interface ValidationRules {
|
|
913
|
+
poolSize?: number;
|
|
914
|
+
minSpendLimit?: number;
|
|
915
|
+
maxSpendLimit?: number;
|
|
916
|
+
}
|
|
917
|
+
declare function validateAutomaticRechargeForm(data: AutomaticRechargeFormData, rules: ValidationRules | undefined, localization: Pick<AutomaticRechargeConfigLocalization, 'thresholdRequired' | 'thresholdMin' | 'thresholdMax' | 'targetRequired' | 'targetMin' | 'targetMax' | 'spendLimitPositive' | 'spendLimitMin' | 'spendLimitMax'>): AutomaticRechargeFormErrors;
|
|
918
|
+
|
|
764
919
|
type TableAlignment = 'left' | 'center' | 'right';
|
|
765
920
|
type PixelWidth = `${number}px`;
|
|
766
921
|
interface HeadCell<T> {
|
|
@@ -833,4 +988,4 @@ declare function StatusChip({ variant, label, className, size, ...props }: Statu
|
|
|
833
988
|
|
|
834
989
|
declare const mapCreditGrantStatusToVariant: (status: CreditGrantStatus) => StatusChipVariant;
|
|
835
990
|
|
|
836
|
-
export { AddonsList, type BillingInformation, BooleanEntitlementGuard, Checkout, type CheckoutContainerProps, type CheckoutLocalization, type CheckoutMockProps, type CheckoutProps, type CheckoutProviderProps, type CheckoutResult, type CheckoutState, CheckoutStepKey, type CheckoutTheme, CreditBalance, type CreditBalanceProps, CreditGrants, type CreditGrantsLocalization, type CreditGrantsProps, CreditUsageChart, CreditUtilization, type CreditUtilizationLocalization, type CreditUtilizationProps, type CurrentPlanParams, type CurrentSubscriptionOverride, type CurrentSubscriptionOverrideFn, CustomerPortal, CustomerPortalIntentionType, type CustomerPortalLocalization, type CustomerPortalProps, CustomerPortalProvider, type CustomerPortalSection, type CustomerPortalTheme, CustomerUsageData, type CustomerUsageDataProps, EmptyState, EnumEntitlementGuard, ErrorState, type FontVariant, GenericTable, type GenericTableProps, type GetCreditBalanceParams, type GetCreditGrantsParams, type HeadCell, type HorizontalAlignment, InvoicesSection, MeteredEntitlementGuard, type MockCheckoutPreviewCallback, type MockCheckoutStateCallback, NumericEntitlementGuard, type OnAddonChangeCallback, type OnBeforeStepChangeCallback, type OnBillableFeatureChangeCallback, type OnBuyMoreCallbackFn, type OnCheckoutCompletedParams, type OnCheckoutParams, type OnManageSubscriptionFn, type OnPlanSelectedCallbackFn, PaymentDetailsSection, PaywallContainer as Paywall, type PaywallData, type PaywallLocalization, type PaywallPlan, type PaywallContainerProps as PaywallProps, type PixelWidth, type PlanPriceText, Promotions, ProvisionStatus, type SelectDefaultTierIndexFn, type ShouldHidePlanFn, StatusChip, type StatusChipColors, type StatusChipVariant, StiggContext, type StiggContextValue, StiggProvider, type StiggProviderProps, type StiggTheme, SubscribeIntentionType, SubscriptionsOverview, type SubscriptionsOverviewProps, type TableAlignment, type TaxDetailsInput, type TextAlignment, type CustomizedTheme as Theme, formatDateOnly, formatDateTime, mapCreditGrantStatusToVariant, useActiveSubscriptions, useBooleanEntitlement, useCreditBalance, useCreditGrants, useCreditUsage, useCustomerPortal, useEnumEntitlement, useMeteredEntitlement, useNumericEntitlement, usePaywall, useStiggContext, useWaitForCheckoutCompleted };
|
|
991
|
+
export { AddonsList, AutoRechargeStatus, type AutoRechargeStatusLocalization, type AutoRechargeStatusProps, AutomaticRechargeConfig, AutomaticRechargeConfigForm, type AutomaticRechargeConfigFormProps, type AutomaticRechargeConfigLocalization, type AutomaticRechargeConfigProps, type AutomaticRechargeConfiguration, type AutomaticRechargeFormData, type AutomaticRechargeFormErrors, type BillingInformation, BooleanEntitlementGuard, Checkout, type CheckoutContainerProps, type CheckoutLocalization, type CheckoutMockProps, type CheckoutProps, type CheckoutProviderProps, type CheckoutResult, type CheckoutState, CheckoutStepKey, type CheckoutTheme, CreditBalance, type CreditBalanceProps, CreditGrants, type CreditGrantsLocalization, type CreditGrantsProps, CreditUsageChart, CreditUtilization, type CreditUtilizationLocalization, type CreditUtilizationProps, type CurrentPlanParams, type CurrentSubscriptionOverride, type CurrentSubscriptionOverrideFn, CustomerPortal, CustomerPortalIntentionType, type CustomerPortalLocalization, type CustomerPortalProps, CustomerPortalProvider, type CustomerPortalSection, type CustomerPortalTheme, CustomerUsageData, type CustomerUsageDataProps, EmptyState, EnumEntitlementGuard, ErrorState, type FontVariant, GenericTable, type GenericTableProps, type GetCreditBalanceParams, type GetCreditGrantsParams, type HeadCell, type HorizontalAlignment, InvoicesSection, MeteredEntitlementGuard, type MockCheckoutPreviewCallback, type MockCheckoutStateCallback, NumericEntitlementGuard, type OnAddonChangeCallback, type OnBeforeStepChangeCallback, type OnBillableFeatureChangeCallback, type OnBuyMoreCallbackFn, type OnCheckoutCompletedParams, type OnCheckoutParams, type OnManageSubscriptionFn, type OnPlanSelectedCallbackFn, PaymentDetailsSection, PaywallContainer as Paywall, type PaywallData, type PaywallLocalization, type PaywallPlan, type PaywallContainerProps as PaywallProps, type PixelWidth, type PlanPriceText, Promotions, ProvisionStatus, type SelectDefaultTierIndexFn, type ShouldHidePlanFn, StatusChip, type StatusChipColors, type StatusChipVariant, StiggContext, type StiggContextValue, StiggProvider, type StiggProviderProps, type StiggTheme, SubscribeIntentionType, SubscriptionsOverview, type SubscriptionsOverviewProps, type TableAlignment, type TaxDetailsInput, type TextAlignment, type CustomizedTheme as Theme, type UpdateAutomaticRechargeConfigParams, formatDateOnly, formatDateTime, mapCreditGrantStatusToVariant, useActiveSubscriptions, useAutomaticRechargeForm, useBooleanEntitlement, useCreditBalance, useCreditGrants, useCreditUsage, useCustomerPortal, useEnumEntitlement, useMeteredEntitlement, useNumericEntitlement, usePaywall, useStiggContext, useWaitForCheckoutCompleted, validateAutomaticRechargeForm };
|