@stigg/js-client-sdk 3.33.0 → 3.34.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.
@@ -7,6 +7,7 @@ import SubscriptionsApi from './SubscriptionsApi';
7
7
  import SubscriptionEstimationsApi from './SubscriptionEstimationsApi';
8
8
  import MockPaywallApi from './MockPaywallApi';
9
9
  import { EdgeApiClient } from './EdgeApiClient';
10
+ import { UsageHistoryApi } from './UsageHistoryApi';
10
11
  declare class ApiGateway {
11
12
  sdkConfiguration: SdkConfigurationApi;
12
13
  paywall: PaywallApi;
@@ -15,6 +16,7 @@ declare class ApiGateway {
15
16
  customers: CustomersApi;
16
17
  coupons: CouponsApi;
17
18
  subscriptionEstimations: SubscriptionEstimationsApi;
19
+ usageHistoryApi: UsageHistoryApi;
18
20
  constructor(client: ApolloClient<NormalizedCacheObject>, edgeApiClient: EdgeApiClient | null);
19
21
  }
20
22
  export default ApiGateway;
@@ -0,0 +1,7 @@
1
+ import { UsageHistoryV2Input, GetUsageHistoryV2Query } from '@stigg/api-client-js/src/generated/sdk';
2
+ import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
3
+ export declare class UsageHistoryApi {
4
+ private readonly client;
5
+ constructor(client: ApolloClient<NormalizedCacheObject>);
6
+ getUsageHistoryV2(input: UsageHistoryV2Input): Promise<import("@apollo/client/core").ApolloQueryResult<GetUsageHistoryV2Query>>;
7
+ }
@@ -1,4 +1,4 @@
1
- import { SlimSubscriptionFragmentV2Fragment } from '@stigg/api-client-js/src/generated/sdk';
1
+ import { SlimSubscriptionFragmentV2Fragment, UsageHistoryV2Fragment, UsageHistoryV2Input } from '@stigg/api-client-js/src/generated/sdk';
2
2
  import { ClientConfiguration } from './configuration';
3
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 } from './models';
4
4
  import { EventNames, Events } from './services/eventEmitter';
@@ -32,6 +32,7 @@ export interface StiggClient {
32
32
  estimateSubscription(estimateSubscription: EstimateSubscription): Promise<SubscriptionPreview>;
33
33
  estimateSubscriptionUpdate(estimateSubscriptionUpdate: EstimateSubscriptionUpdate): Promise<SubscriptionPreview>;
34
34
  previewSubscription(previewSubscription: PreviewSubscription): Promise<SubscriptionPreviewV2>;
35
+ getUsageHistoryV2(input: UsageHistoryV2Input): Promise<UsageHistoryV2Fragment>;
35
36
  }
36
37
  export declare class Stigg implements StiggClient {
37
38
  private readonly apiGateway;
@@ -194,6 +195,10 @@ export declare class Stigg implements StiggClient {
194
195
  * @param {PreviewSubscription} previewSubscription
195
196
  */
196
197
  previewSubscription(previewSubscription: PreviewSubscription): Promise<SubscriptionPreviewV2>;
198
+ /**
199
+ * Get customer usage history of a feature.
200
+ */
201
+ getUsageHistoryV2(input: UsageHistoryV2Input): Promise<UsageHistoryV2Fragment>;
197
202
  /**
198
203
  * Waits for a subscription to be activated after a completed checkout.
199
204
  * This method should be called on page load after the customer is redirected to the success URL.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stigg/js-client-sdk",
3
- "version": "3.33.0",
3
+ "version": "3.34.0",
4
4
  "description": "Stigg client-side SDK for Browser",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@apollo/client": "^3.4.17",
30
30
  "@sentry/browser": "^7.11.1",
31
- "@stigg/api-client-js": "2.217.0",
31
+ "@stigg/api-client-js": "2.235.0",
32
32
  "cross-fetch": "^3.1.6",
33
33
  "dayjs": "^1.11.13",
34
34
  "fetch-retry": "^5.0.6",