@stigg/js-client-sdk 3.81.0 → 3.83.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/client.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { 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, GetCreditLedgerResult, AutomaticRechargeConfiguration, GetAutomaticRechargeConfigurationInput, SaveAutomaticRechargeConfigurationInput, EntitlementsState } from './models';
3
+ import { ApplySubscription, ApplySubscriptionResults, BooleanEntitlement, Coupon, CreditEntitlement, Customer, CustomerPortal, Entitlement, EstimateSubscription, EstimateSubscriptionUpdate, FetchUsageHistory, GetActiveSubscriptions, GetBooleanEntitlement, GetCheckoutStateResults, GetCheckoutState, GetCreditEntitlement, 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, GetCreditLedgerResult, 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 {
@@ -12,6 +12,7 @@ export interface StiggClient {
12
12
  getNumericEntitlement: (params: GetNumericEntitlement) => NumericEntitlement;
13
13
  getMeteredEntitlement: (params: GetMeteredEntitlement) => MeteredEntitlement;
14
14
  getEnumEntitlement: (params: GetEnumEntitlement) => EnumEntitlement;
15
+ getCreditEntitlement: (params: GetCreditEntitlement) => CreditEntitlement;
15
16
  fetchUsageHistory: (params: FetchUsageHistory) => Promise<UsageHistoryPoint[] | undefined>;
16
17
  setCustomerId: (customerId: string, customerToken?: string | null, resourceId?: string | null) => Promise<void>;
17
18
  clearCustomer: () => void;
@@ -154,6 +155,15 @@ export declare class Stigg implements StiggClient {
154
155
  * @return {EnumEntitlement} enum entitlement
155
156
  */
156
157
  getEnumEntitlement({ featureId, options, resourceId }: GetEnumEntitlement): EnumEntitlement;
158
+ /**
159
+ * Get credit entitlement for a customer by currency ID
160
+ *
161
+ * @param {string} currencyId
162
+ * @param {string} resourceId
163
+ * @param {CreditEntitlementOptions} options
164
+ * @return {CreditEntitlement} credit entitlement
165
+ */
166
+ getCreditEntitlement({ currencyId, options, resourceId }: GetCreditEntitlement): CreditEntitlement;
157
167
  /**
158
168
  * Get paywall data for rendering the paywall
159
169
  * @deprecated *Optional* `productId` is now deprecated and will be changed to a *required* field soon.