@stigg/js-client-sdk 3.69.0 → 3.70.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/models.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BillingModel, BillingPeriod, Currency, PricingType, PromotionalEntitlementStatus, SubscriptionStatus, SubscriptionQueryFragment, TrialPeriodUnits, ExperimentGroupType, CustomerPortalEntitlementFragment, CustomerPortalPromotionalEntitlementFragment, CustomerPortalSubscriptionFragment, CustomerPortalSubscriptionAddonFragment, CustomerPortalBillingInformationFragment, PaywallConfigurationFragment, CustomerPortalConfigurationFragment, WidgetType, CustomerPortalSubscriptionScheduledUpdateDataFragment, DiscountType, DiscountDurationType, PackageEntitlementFragment, PageInfoFragment, PaywallCurrencyFragment, FeatureType, MeterType, EntitlementResetPeriod, AccessDeniedReason, PaywallCalculatedPricePointsFragment, SubscriptionInvoiceFragment, PaymentCollection, PlanFragment, BillingVendorIdentifier, TiersMode, SubscriptionFutureUpdateDataFragment, PriceTierFragment, TotalPriceFragment, CheckoutConfigurationFragment, TypographyConfigurationFragment, BillingAddress, ScheduleStrategy, PaymentCollectionMethod, BudgetConfigurationInput, SubscriptionProrationBehavior, PaymentSessionInput, CreditBalanceSummaryInput, StripeCheckoutCredentialsFragment, ZuoraCheckoutCredentialsFragment, GetCreditGrantsInput as GetCreditGrantsInputGenerated, CreditLedgerInput, CreditUsageInput, CreditGrantFragment, EntitlementsStateAccessDeniedReason } from '@stigg/api-client-js/src/generated/sdk';
1
+ import { BillingModel, BillingPeriod, Currency, PricingType, PromotionalEntitlementStatus, SubscriptionStatus, SubscriptionQueryFragment, TrialPeriodUnits, ExperimentGroupType, CustomerPortalEntitlementFragment, CustomerPortalPromotionalEntitlementFragment, CustomerPortalSubscriptionFragment, CustomerPortalSubscriptionAddonFragment, CustomerPortalBillingInformationFragment, PaywallConfigurationFragment, CustomerPortalConfigurationFragment, WidgetType, CustomerPortalSubscriptionScheduledUpdateDataFragment, DiscountType, DiscountDurationType, PackageEntitlementFragment, PageInfoFragment, PaywallCurrencyFragment, FeatureType, MeterType, EntitlementResetPeriod, AccessDeniedReason, PaywallCalculatedPricePointsFragment, SubscriptionInvoiceFragment, PaymentCollection, PlanFragment, BillingVendorIdentifier, TiersMode, SubscriptionFutureUpdateDataFragment, PriceTierFragment, TotalPriceFragment, CheckoutConfigurationFragment, TypographyConfigurationFragment, BillingAddress, ScheduleStrategy, PaymentCollectionMethod, BudgetConfigurationInput, SubscriptionProrationBehavior, PaymentSessionInput, CreditBalanceSummaryInput, StripeCheckoutCredentialsFragment, ZuoraCheckoutCredentialsFragment, GetCreditGrantsInput as GetCreditGrantsInputGenerated, CreditLedgerInput, CreditUsageInput, CreditGrantFragment, EntitlementsStateAccessDeniedReason, AutoRechargeSettingsFragment, GetAutoRechargeSettingsInput, SaveAutoRechargeSettingsInput } from '@stigg/api-client-js/src/generated/sdk';
2
2
  export * from '@stigg/api-client-js/src/generated/sdk';
3
3
  interface Metadata {
4
4
  [key: string]: string;
@@ -610,6 +610,9 @@ export declare type GetCreditUsageInput = Omit<CreditUsageInput, 'customerId' |
610
610
  export declare type GetCreditBalanceInput = Omit<CreditBalanceSummaryInput, 'customerId' | 'resourceId'>;
611
611
  export declare type GetCreditGrantsInput = Omit<GetCreditGrantsInputGenerated, 'customerId' | 'resourceId'>;
612
612
  export declare type GetCreditLedgerInput = Omit<CreditLedgerInput, 'customerId' | 'resourceId'>;
613
+ export declare type AutomaticRechargeConfiguration = AutoRechargeSettingsFragment;
614
+ export declare type GetAutomaticRechargeConfigurationInput = GetAutoRechargeSettingsInput;
615
+ export declare type SaveAutomaticRechargeConfigurationInput = SaveAutoRechargeSettingsInput;
613
616
  /** @hidden */
614
617
  export declare class CustomerModel implements Customer {
615
618
  id: string;
@@ -1,5 +1,5 @@
1
1
  import { Stigg, StiggClient } from './clients';
2
- import { ApplySubscriptionResults, BooleanEntitlement, Coupon, CreditLedgerFragment, CreditsBalanceSummaryFragment, CreditUsageFragment, Customer, CustomerPortal, Entitlement, EntitlementsState, EnumEntitlement, GetBooleanEntitlement, GetCheckoutStateResults, GetCreditGrantsResult, GetEnumEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetSubscriptionsResult, MeteredEntitlement, NumericEntitlement, PaymentSessionFragment, Paywall, SlimSubscriptionFragmentV2Fragment, Subscription, SubscriptionInvoicePreviewFragment, SubscriptionPreview, SubscriptionPreviewV2, UsageHistoryPoint, UsageHistoryV2Fragment } from './models';
2
+ import { ApplySubscriptionResults, AutomaticRechargeConfiguration, BooleanEntitlement, Coupon, CreditLedgerFragment, CreditsBalanceSummaryFragment, CreditUsageFragment, Customer, CustomerPortal, Entitlement, EntitlementsState, EnumEntitlement, GetAutomaticRechargeConfigurationInput, GetBooleanEntitlement, GetCheckoutStateResults, GetCreditGrantsResult, GetEnumEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetSubscriptionsResult, MeteredEntitlement, NumericEntitlement, PaymentSessionFragment, Paywall, SaveAutomaticRechargeConfigurationInput, SlimSubscriptionFragmentV2Fragment, Subscription, SubscriptionInvoicePreviewFragment, SubscriptionPreview, SubscriptionPreviewV2, UsageHistoryPoint, UsageHistoryV2Fragment } from './models';
3
3
  export declare class OfflineStigg extends Stigg {
4
4
  getBooleanEntitlement({ featureId, options }: GetBooleanEntitlement): BooleanEntitlement;
5
5
  getMeteredEntitlement({ featureId, options }: GetMeteredEntitlement): MeteredEntitlement;
@@ -40,4 +40,6 @@ export declare class OfflineStigg extends Stigg {
40
40
  getCreditUsage(): Promise<CreditUsageFragment>;
41
41
  createPaymentSession(): Promise<PaymentSessionFragment>;
42
42
  getShowWatermark(): boolean;
43
+ getAutomaticRechargeConfiguration(input: GetAutomaticRechargeConfigurationInput): Promise<AutomaticRechargeConfiguration>;
44
+ saveAutomaticRechargeConfiguration(input: SaveAutomaticRechargeConfigurationInput): Promise<AutomaticRechargeConfiguration>;
43
45
  }
@@ -10,6 +10,7 @@ import { EdgeApiClient } from './EdgeApiClient';
10
10
  import { UsageHistoryApi } from './UsageHistoryApi';
11
11
  import CreditsApi from './CreditsApi';
12
12
  import CheckoutApi from './CheckoutApi';
13
+ import AutomaticRechargeApi from './AutomaticRechargeApi';
13
14
  declare class ApiGateway {
14
15
  sdkConfiguration: SdkConfigurationApi;
15
16
  paywall: PaywallApi;
@@ -21,6 +22,7 @@ declare class ApiGateway {
21
22
  usageHistoryApi: UsageHistoryApi;
22
23
  credits: CreditsApi;
23
24
  checkout: CheckoutApi;
25
+ automaticRecharge: AutomaticRechargeApi;
24
26
  constructor(client: ApolloClient<NormalizedCacheObject>, edgeApiClient: EdgeApiClient | null);
25
27
  }
26
28
  export default ApiGateway;
@@ -0,0 +1,23 @@
1
+ import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
2
+ import { GetAutomaticRechargeConfigurationQuery, SaveAutomaticRechargeConfigurationMutation, GetAutoRechargeSettingsInput, SaveAutoRechargeSettingsInput } from '@stigg/api-client-js/src/generated/sdk';
3
+ /**
4
+ * API class for managing automatic recharge configurations.
5
+ * Handles GraphQL queries and mutations for automatic recharge settings.
6
+ */
7
+ declare class AutomaticRechargeApi {
8
+ private readonly client;
9
+ constructor(client: ApolloClient<NormalizedCacheObject>);
10
+ /**
11
+ * Retrieves the automatic recharge configuration for a customer and currency.
12
+ * @param input - Configuration input containing customerId, currencyId, and environmentId
13
+ * @returns Promise with the GraphQL query result containing automatic recharge settings
14
+ */
15
+ getConfiguration(input: GetAutoRechargeSettingsInput): Promise<import("@apollo/client/core").ApolloQueryResult<GetAutomaticRechargeConfigurationQuery>>;
16
+ /**
17
+ * Saves (creates or updates) the automatic recharge configuration for a customer and currency.
18
+ * @param input - Configuration input containing all automatic recharge settings
19
+ * @returns Promise with the GraphQL mutation result containing saved automatic recharge settings
20
+ */
21
+ saveConfiguration(input: SaveAutoRechargeSettingsInput): Promise<import("@apollo/client/core").FetchResult<SaveAutomaticRechargeConfigurationMutation, Record<string, any>, Record<string, any>>>;
22
+ }
23
+ export default AutomaticRechargeApi;
@@ -1,6 +1,6 @@
1
1
  import { CreditLedgerFragment, CreditsBalanceSummaryFragment, CreditUsageFragment, PaymentSessionFragment, SlimSubscriptionFragmentV2Fragment, SubscriptionInvoicePreviewFragment, UsageHistoryV2Fragment, UsageHistoryV2Input } from '@stigg/api-client-js/src/generated/sdk';
2
2
  import { ClientConfiguration } from './configuration';
3
- import { ApplySubscription, ApplySubscriptionResults, BooleanEntitlement, Coupon, Customer, CustomerPortal, Entitlement, EstimateSubscription, EstimateSubscriptionUpdate, FetchUsageHistory, GetActiveSubscriptions, GetBooleanEntitlement, GetCheckoutStateResults, GetCheckoutState, GetCustomerPortal, GetMeteredEntitlement, GetNumericEntitlement, GetPaywall, GetSubscription, MeteredEntitlement, NumericEntitlement, Paywall, PreviewSubscription, Subscription, SubscriptionPreview, SubscriptionPreviewV2, UsageHistoryPoint, WaitForCheckoutCompleted, PreviewNextInvoice, GetSubscriptionsParams, GetSubscriptionsResult, EnumEntitlement, GetEnumEntitlement, CreatePaymentSessionInput, GetCreditBalanceInput, GetCreditGrantsInput, GetCreditLedgerInput, GetCreditUsageInput, GetCreditGrantsResult, EntitlementsState } from './models';
3
+ import { ApplySubscription, ApplySubscriptionResults, BooleanEntitlement, Coupon, Customer, CustomerPortal, Entitlement, EstimateSubscription, EstimateSubscriptionUpdate, FetchUsageHistory, GetActiveSubscriptions, GetBooleanEntitlement, GetCheckoutStateResults, GetCheckoutState, GetCustomerPortal, GetMeteredEntitlement, GetNumericEntitlement, GetPaywall, GetSubscription, MeteredEntitlement, NumericEntitlement, Paywall, PreviewSubscription, Subscription, SubscriptionPreview, SubscriptionPreviewV2, UsageHistoryPoint, WaitForCheckoutCompleted, PreviewNextInvoice, GetSubscriptionsParams, GetSubscriptionsResult, EnumEntitlement, GetEnumEntitlement, CreatePaymentSessionInput, GetCreditBalanceInput, GetCreditGrantsInput, GetCreditLedgerInput, GetCreditUsageInput, GetCreditGrantsResult, AutomaticRechargeConfiguration, GetAutomaticRechargeConfigurationInput, SaveAutomaticRechargeConfigurationInput, EntitlementsState } from './models';
4
4
  import { EventNames, Events } from './services/eventEmitter';
5
5
  import { LoggerService } from './services/loggerService';
6
6
  export interface StiggClient {
@@ -47,6 +47,8 @@ export interface StiggClient {
47
47
  getCreditLedger(input?: GetCreditLedgerInput): Promise<CreditLedgerFragment[]>;
48
48
  getCreditUsage(input: GetCreditUsageInput): Promise<CreditUsageFragment>;
49
49
  createPaymentSession(input: CreatePaymentSessionInput): Promise<PaymentSessionFragment>;
50
+ getAutomaticRechargeConfiguration(input: GetAutomaticRechargeConfigurationInput): Promise<AutomaticRechargeConfiguration>;
51
+ saveAutomaticRechargeConfiguration(input: SaveAutomaticRechargeConfigurationInput): Promise<AutomaticRechargeConfiguration>;
50
52
  getShowWatermark(): boolean;
51
53
  }
52
54
  export declare class Stigg implements StiggClient {
@@ -285,4 +287,16 @@ export declare class Stigg implements StiggClient {
285
287
  * @param input - the input for the payment session
286
288
  */
287
289
  createPaymentSession(input: CreatePaymentSessionInput): Promise<PaymentSessionFragment>;
290
+ /**
291
+ * Get automatic recharge configuration
292
+ * @return {Promise<AutomaticRechargeConfiguration>} the automatic recharge configuration
293
+ * @param input - the input for getting automatic recharge configuration
294
+ */
295
+ getAutomaticRechargeConfiguration(input: GetAutomaticRechargeConfigurationInput): Promise<AutomaticRechargeConfiguration>;
296
+ /**
297
+ * Save automatic recharge configuration
298
+ * @return {Promise<AutomaticRechargeConfiguration>} the saved automatic recharge configuration
299
+ * @param input - the input for saving automatic recharge configuration
300
+ */
301
+ saveAutomaticRechargeConfiguration(input: SaveAutomaticRechargeConfigurationInput): Promise<AutomaticRechargeConfiguration>;
288
302
  }
@@ -1,4 +1,4 @@
1
- import { BillingModel, BillingPeriod, Currency, PricingType, PromotionalEntitlementStatus, SubscriptionStatus, SubscriptionQueryFragment, TrialPeriodUnits, ExperimentGroupType, CustomerPortalEntitlementFragment, CustomerPortalPromotionalEntitlementFragment, CustomerPortalSubscriptionFragment, CustomerPortalSubscriptionAddonFragment, CustomerPortalBillingInformationFragment, PaywallConfigurationFragment, CustomerPortalConfigurationFragment, WidgetType, CustomerPortalSubscriptionScheduledUpdateDataFragment, DiscountType, DiscountDurationType, PackageEntitlementFragment, PageInfoFragment, PaywallCurrencyFragment, FeatureType, MeterType, EntitlementResetPeriod, AccessDeniedReason, PaywallCalculatedPricePointsFragment, SubscriptionInvoiceFragment, PaymentCollection, PlanFragment, BillingVendorIdentifier, TiersMode, SubscriptionFutureUpdateDataFragment, PriceTierFragment, TotalPriceFragment, CheckoutConfigurationFragment, TypographyConfigurationFragment, BillingAddress, ScheduleStrategy, PaymentCollectionMethod, BudgetConfigurationInput, SubscriptionProrationBehavior, PaymentSessionInput, CreditBalanceSummaryInput, StripeCheckoutCredentialsFragment, ZuoraCheckoutCredentialsFragment, GetCreditGrantsInput as GetCreditGrantsInputGenerated, CreditLedgerInput, CreditUsageInput, CreditGrantFragment, EntitlementsStateAccessDeniedReason } from '@stigg/api-client-js/src/generated/sdk';
1
+ import { BillingModel, BillingPeriod, Currency, PricingType, PromotionalEntitlementStatus, SubscriptionStatus, SubscriptionQueryFragment, TrialPeriodUnits, ExperimentGroupType, CustomerPortalEntitlementFragment, CustomerPortalPromotionalEntitlementFragment, CustomerPortalSubscriptionFragment, CustomerPortalSubscriptionAddonFragment, CustomerPortalBillingInformationFragment, PaywallConfigurationFragment, CustomerPortalConfigurationFragment, WidgetType, CustomerPortalSubscriptionScheduledUpdateDataFragment, DiscountType, DiscountDurationType, PackageEntitlementFragment, PageInfoFragment, PaywallCurrencyFragment, FeatureType, MeterType, EntitlementResetPeriod, AccessDeniedReason, PaywallCalculatedPricePointsFragment, SubscriptionInvoiceFragment, PaymentCollection, PlanFragment, BillingVendorIdentifier, TiersMode, SubscriptionFutureUpdateDataFragment, PriceTierFragment, TotalPriceFragment, CheckoutConfigurationFragment, TypographyConfigurationFragment, BillingAddress, ScheduleStrategy, PaymentCollectionMethod, BudgetConfigurationInput, SubscriptionProrationBehavior, PaymentSessionInput, CreditBalanceSummaryInput, StripeCheckoutCredentialsFragment, ZuoraCheckoutCredentialsFragment, GetCreditGrantsInput as GetCreditGrantsInputGenerated, CreditLedgerInput, CreditUsageInput, CreditGrantFragment, EntitlementsStateAccessDeniedReason, AutoRechargeSettingsFragment, GetAutoRechargeSettingsInput, SaveAutoRechargeSettingsInput } from '@stigg/api-client-js/src/generated/sdk';
2
2
  export * from '@stigg/api-client-js/src/generated/sdk';
3
3
  interface Metadata {
4
4
  [key: string]: string;
@@ -610,6 +610,9 @@ export declare type GetCreditUsageInput = Omit<CreditUsageInput, 'customerId' |
610
610
  export declare type GetCreditBalanceInput = Omit<CreditBalanceSummaryInput, 'customerId' | 'resourceId'>;
611
611
  export declare type GetCreditGrantsInput = Omit<GetCreditGrantsInputGenerated, 'customerId' | 'resourceId'>;
612
612
  export declare type GetCreditLedgerInput = Omit<CreditLedgerInput, 'customerId' | 'resourceId'>;
613
+ export declare type AutomaticRechargeConfiguration = AutoRechargeSettingsFragment;
614
+ export declare type GetAutomaticRechargeConfigurationInput = GetAutoRechargeSettingsInput;
615
+ export declare type SaveAutomaticRechargeConfigurationInput = SaveAutoRechargeSettingsInput;
613
616
  /** @hidden */
614
617
  export declare class CustomerModel implements Customer {
615
618
  id: string;
@@ -1,5 +1,5 @@
1
1
  import { Stigg, StiggClient } from './clients';
2
- import { ApplySubscriptionResults, BooleanEntitlement, Coupon, CreditLedgerFragment, CreditsBalanceSummaryFragment, CreditUsageFragment, Customer, CustomerPortal, Entitlement, EntitlementsState, EnumEntitlement, GetBooleanEntitlement, GetCheckoutStateResults, GetCreditGrantsResult, GetEnumEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetSubscriptionsResult, MeteredEntitlement, NumericEntitlement, PaymentSessionFragment, Paywall, SlimSubscriptionFragmentV2Fragment, Subscription, SubscriptionInvoicePreviewFragment, SubscriptionPreview, SubscriptionPreviewV2, UsageHistoryPoint, UsageHistoryV2Fragment } from './models';
2
+ import { ApplySubscriptionResults, AutomaticRechargeConfiguration, BooleanEntitlement, Coupon, CreditLedgerFragment, CreditsBalanceSummaryFragment, CreditUsageFragment, Customer, CustomerPortal, Entitlement, EntitlementsState, EnumEntitlement, GetAutomaticRechargeConfigurationInput, GetBooleanEntitlement, GetCheckoutStateResults, GetCreditGrantsResult, GetEnumEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetSubscriptionsResult, MeteredEntitlement, NumericEntitlement, PaymentSessionFragment, Paywall, SaveAutomaticRechargeConfigurationInput, SlimSubscriptionFragmentV2Fragment, Subscription, SubscriptionInvoicePreviewFragment, SubscriptionPreview, SubscriptionPreviewV2, UsageHistoryPoint, UsageHistoryV2Fragment } from './models';
3
3
  export declare class OfflineStigg extends Stigg {
4
4
  getBooleanEntitlement({ featureId, options }: GetBooleanEntitlement): BooleanEntitlement;
5
5
  getMeteredEntitlement({ featureId, options }: GetMeteredEntitlement): MeteredEntitlement;
@@ -40,4 +40,6 @@ export declare class OfflineStigg extends Stigg {
40
40
  getCreditUsage(): Promise<CreditUsageFragment>;
41
41
  createPaymentSession(): Promise<PaymentSessionFragment>;
42
42
  getShowWatermark(): boolean;
43
+ getAutomaticRechargeConfiguration(input: GetAutomaticRechargeConfigurationInput): Promise<AutomaticRechargeConfiguration>;
44
+ saveAutomaticRechargeConfiguration(input: SaveAutomaticRechargeConfigurationInput): Promise<AutomaticRechargeConfiguration>;
43
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stigg/js-client-sdk",
3
- "version": "3.69.0",
3
+ "version": "3.70.0",
4
4
  "description": "Stigg client-side SDK for Browser",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "@apollo/client": "^3.4.17",
39
39
  "@sentry/browser": "^7.11.1",
40
- "@stigg/api-client-js": "5.18.0",
40
+ "@stigg/api-client-js": "5.56.0",
41
41
  "cross-fetch": "^3.1.6",
42
42
  "dayjs": "^1.11.13",
43
43
  "fetch-retry": "^5.0.6",