@stigg/js-client-sdk 3.69.0 → 3.71.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.
@@ -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;
package/dist/client.d.ts CHANGED
@@ -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
  }