@stigg/js-client-sdk 3.64.0 → 3.65.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.
@@ -1,10 +1,11 @@
1
1
  import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
2
- import { CreditBalanceSummaryInput, CreditLedgerInput, GetCreditBalanceQuery, GetCreditGrantsInput, GetCreditGrantsQuery, GetCreditLedgerQuery } from '@stigg/api-client-js/src/generated/sdk';
2
+ import { CreditBalanceSummaryInput, CreditLedgerInput, GetCreditBalanceQuery, GetCreditGrantsInput, GetCreditGrantsQuery, GetCreditUsageQuery, CreditUsageInput, GetCreditLedgerQuery } from '@stigg/api-client-js/src/generated/sdk';
3
3
  declare class CreditsApi {
4
4
  private readonly client;
5
5
  constructor(client: ApolloClient<NormalizedCacheObject>);
6
6
  getCreditBalance(input: CreditBalanceSummaryInput): Promise<import("@apollo/client/core").ApolloQueryResult<GetCreditBalanceQuery>>;
7
7
  getCreditGrants(input: GetCreditGrantsInput): Promise<import("@apollo/client/core").ApolloQueryResult<GetCreditGrantsQuery>>;
8
8
  getCreditLedger(input: CreditLedgerInput): Promise<import("@apollo/client/core").ApolloQueryResult<GetCreditLedgerQuery>>;
9
+ getCreditUsage(input: CreditUsageInput): Promise<import("@apollo/client/core").ApolloQueryResult<GetCreditUsageQuery>>;
9
10
  }
10
11
  export default CreditsApi;
package/dist/client.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { CreditGrantFragment, CreditLedgerFragment, CreditsBalanceSummaryFragment, PaymentSessionFragment, SlimSubscriptionFragmentV2Fragment, SubscriptionInvoicePreviewFragment, UsageHistoryV2Fragment, UsageHistoryV2Input } from '@stigg/api-client-js/src/generated/sdk';
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 } 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 } from './models';
4
4
  import { EventNames, Events } from './services/eventEmitter';
5
5
  import { LoggerService } from './services/loggerService';
6
6
  export interface StiggClient {
@@ -38,8 +38,9 @@ export interface StiggClient {
38
38
  previewSubscription(previewSubscription: PreviewSubscription): Promise<SubscriptionPreviewV2>;
39
39
  getUsageHistoryV2(input: UsageHistoryV2Input): Promise<UsageHistoryV2Fragment>;
40
40
  getCreditBalance(input?: GetCreditBalanceInput): Promise<CreditsBalanceSummaryFragment>;
41
- getCreditGrants(input: GetCreditGrantsInput): Promise<CreditGrantFragment[]>;
41
+ getCreditGrants(input: GetCreditGrantsInput): Promise<GetCreditGrantsResult>;
42
42
  getCreditLedger(input?: GetCreditLedgerInput): Promise<CreditLedgerFragment[]>;
43
+ getCreditUsage(input: GetCreditUsageInput): Promise<CreditUsageFragment>;
43
44
  createPaymentSession(input: CreatePaymentSessionInput): Promise<PaymentSessionFragment>;
44
45
  }
45
46
  export declare class Stigg implements StiggClient {
@@ -245,6 +246,7 @@ export declare class Stigg implements StiggClient {
245
246
  * @param subscriptionId - subscription id
246
247
  */
247
248
  getSubscription({ subscriptionId }: GetSubscription): Promise<Subscription>;
249
+ getCreditUsage(input: GetCreditUsageInput): Promise<CreditUsageFragment>;
248
250
  /**
249
251
  * Get credit balance
250
252
  * @return {Promise<CreditsBalanceSummaryFragment>} the credit balance data
@@ -253,10 +255,10 @@ export declare class Stigg implements StiggClient {
253
255
  getCreditBalance(input?: GetCreditBalanceInput): Promise<CreditsBalanceSummaryFragment>;
254
256
  /**
255
257
  * Get credit grants
256
- * @return {Promise<CreditGrantFragment[]>} the credit grants data
258
+ * @return {Promise<GetCreditGrantsResult>} paginated result of the credit grants data
257
259
  * @param input - the input for the credit grants
258
260
  */
259
- getCreditGrants(input: GetCreditGrantsInput): Promise<CreditGrantFragment[]>;
261
+ getCreditGrants(input: GetCreditGrantsInput): Promise<GetCreditGrantsResult>;
260
262
  /**
261
263
  * Get credit ledger
262
264
  * @return {Promise<CreditLedgerFragment[]>} the credit ledger data