@stigg/js-client-sdk 3.54.0 → 3.56.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/api/ApiGateway.d.ts +2 -0
- package/dist/api/CreditsApi.d.ts +9 -0
- package/dist/client.d.ts +15 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/offlineClient.d.ts +3 -1
- package/dist/src/api/ApiGateway.d.ts +2 -0
- package/dist/src/api/CreditsApi.d.ts +9 -0
- package/dist/src/client.d.ts +15 -1
- package/dist/src/offlineClient.d.ts +3 -1
- package/package.json +2 -2
package/dist/offlineClient.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Stigg, StiggClient } from './clients';
|
|
2
|
-
import { ApplySubscriptionResults, BooleanEntitlement, Coupon, Customer, CustomerPortal, Entitlement, EnumEntitlement, GetBooleanEntitlement, GetCheckoutStateResults, GetEnumEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetSubscriptionsResult, MeteredEntitlement, NumericEntitlement, Paywall, SlimSubscriptionFragmentV2Fragment, Subscription, SubscriptionInvoicePreviewFragment, SubscriptionPreview, SubscriptionPreviewV2, UsageHistoryPoint, UsageHistoryV2Fragment } from './models';
|
|
2
|
+
import { ApplySubscriptionResults, BooleanEntitlement, Coupon, CreditGrantFragment, CreditsBalanceSummaryFragment, Customer, CustomerPortal, Entitlement, EnumEntitlement, GetBooleanEntitlement, GetCheckoutStateResults, GetEnumEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetSubscriptionsResult, MeteredEntitlement, NumericEntitlement, Paywall, 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;
|
|
@@ -34,4 +34,6 @@ export declare class OfflineStigg extends Stigg {
|
|
|
34
34
|
getActiveSubscriptions(): Promise<Subscription[]>;
|
|
35
35
|
getSubscriptions(): Promise<GetSubscriptionsResult>;
|
|
36
36
|
getCustomer(): Promise<Customer>;
|
|
37
|
+
getCreditBalance(): Promise<CreditsBalanceSummaryFragment>;
|
|
38
|
+
getCreditGrants(): Promise<CreditGrantFragment[]>;
|
|
37
39
|
}
|
|
@@ -8,6 +8,7 @@ import SubscriptionEstimationsApi from './SubscriptionEstimationsApi';
|
|
|
8
8
|
import MockPaywallApi from './MockPaywallApi';
|
|
9
9
|
import { EdgeApiClient } from './EdgeApiClient';
|
|
10
10
|
import { UsageHistoryApi } from './UsageHistoryApi';
|
|
11
|
+
import CreditsApi from './CreditsApi';
|
|
11
12
|
declare class ApiGateway {
|
|
12
13
|
sdkConfiguration: SdkConfigurationApi;
|
|
13
14
|
paywall: PaywallApi;
|
|
@@ -17,6 +18,7 @@ declare class ApiGateway {
|
|
|
17
18
|
coupons: CouponsApi;
|
|
18
19
|
subscriptionEstimations: SubscriptionEstimationsApi;
|
|
19
20
|
usageHistoryApi: UsageHistoryApi;
|
|
21
|
+
credits: CreditsApi;
|
|
20
22
|
constructor(client: ApolloClient<NormalizedCacheObject>, edgeApiClient: EdgeApiClient | null);
|
|
21
23
|
}
|
|
22
24
|
export default ApiGateway;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
2
|
+
import { CreditBalanceSummaryInput, GetCreditBalanceQuery, GetCreditGrantsInput, GetCreditGrantsQuery } from '@stigg/api-client-js/src/generated/sdk';
|
|
3
|
+
declare class CreditsApi {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: ApolloClient<NormalizedCacheObject>);
|
|
6
|
+
getCreditBalance(input: CreditBalanceSummaryInput): Promise<import("@apollo/client/core").ApolloQueryResult<GetCreditBalanceQuery>>;
|
|
7
|
+
getCreditGrants(input: GetCreditGrantsInput): Promise<import("@apollo/client/core").ApolloQueryResult<GetCreditGrantsQuery>>;
|
|
8
|
+
}
|
|
9
|
+
export default CreditsApi;
|
package/dist/src/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SlimSubscriptionFragmentV2Fragment, SubscriptionInvoicePreviewFragment, UsageHistoryV2Fragment, UsageHistoryV2Input } from '@stigg/api-client-js/src/generated/sdk';
|
|
1
|
+
import { CreditBalanceSummaryInput, CreditGrantFragment, CreditsBalanceSummaryFragment, GetCreditGrantsInput, SlimSubscriptionFragmentV2Fragment, SubscriptionInvoicePreviewFragment, 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, PreviewNextInvoice, GetSubscriptionsParams, GetSubscriptionsResult, EnumEntitlement, GetEnumEntitlement } from './models';
|
|
4
4
|
import { EventNames, Events } from './services/eventEmitter';
|
|
@@ -37,6 +37,8 @@ export interface StiggClient {
|
|
|
37
37
|
previewNextInvoice(previewNextInvoice: PreviewNextInvoice): Promise<SubscriptionInvoicePreviewFragment>;
|
|
38
38
|
previewSubscription(previewSubscription: PreviewSubscription): Promise<SubscriptionPreviewV2>;
|
|
39
39
|
getUsageHistoryV2(input: UsageHistoryV2Input): Promise<UsageHistoryV2Fragment>;
|
|
40
|
+
getCreditBalance(input: CreditBalanceSummaryInput): Promise<CreditsBalanceSummaryFragment>;
|
|
41
|
+
getCreditGrants(input: GetCreditGrantsInput): Promise<CreditGrantFragment[]>;
|
|
40
42
|
}
|
|
41
43
|
export declare class Stigg implements StiggClient {
|
|
42
44
|
private readonly apiGateway;
|
|
@@ -241,4 +243,16 @@ export declare class Stigg implements StiggClient {
|
|
|
241
243
|
* @param subscriptionId - subscription id
|
|
242
244
|
*/
|
|
243
245
|
getSubscription({ subscriptionId }: GetSubscription): Promise<Subscription>;
|
|
246
|
+
/**
|
|
247
|
+
* Get credit balance
|
|
248
|
+
* @return {Promise<CreditsBalanceSummaryFragment>} the credit balance data
|
|
249
|
+
* @param input - the input for the credit balance
|
|
250
|
+
*/
|
|
251
|
+
getCreditBalance(input: CreditBalanceSummaryInput): Promise<CreditsBalanceSummaryFragment>;
|
|
252
|
+
/**
|
|
253
|
+
* Get credit grants
|
|
254
|
+
* @return {Promise<CreditGrantFragment[]>} the credit grants data
|
|
255
|
+
* @param input - the input for the credit grants
|
|
256
|
+
*/
|
|
257
|
+
getCreditGrants(input: GetCreditGrantsInput): Promise<CreditGrantFragment[]>;
|
|
244
258
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Stigg, StiggClient } from './clients';
|
|
2
|
-
import { ApplySubscriptionResults, BooleanEntitlement, Coupon, Customer, CustomerPortal, Entitlement, EnumEntitlement, GetBooleanEntitlement, GetCheckoutStateResults, GetEnumEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetSubscriptionsResult, MeteredEntitlement, NumericEntitlement, Paywall, SlimSubscriptionFragmentV2Fragment, Subscription, SubscriptionInvoicePreviewFragment, SubscriptionPreview, SubscriptionPreviewV2, UsageHistoryPoint, UsageHistoryV2Fragment } from './models';
|
|
2
|
+
import { ApplySubscriptionResults, BooleanEntitlement, Coupon, CreditGrantFragment, CreditsBalanceSummaryFragment, Customer, CustomerPortal, Entitlement, EnumEntitlement, GetBooleanEntitlement, GetCheckoutStateResults, GetEnumEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetSubscriptionsResult, MeteredEntitlement, NumericEntitlement, Paywall, 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;
|
|
@@ -34,4 +34,6 @@ export declare class OfflineStigg extends Stigg {
|
|
|
34
34
|
getActiveSubscriptions(): Promise<Subscription[]>;
|
|
35
35
|
getSubscriptions(): Promise<GetSubscriptionsResult>;
|
|
36
36
|
getCustomer(): Promise<Customer>;
|
|
37
|
+
getCreditBalance(): Promise<CreditsBalanceSummaryFragment>;
|
|
38
|
+
getCreditGrants(): Promise<CreditGrantFragment[]>;
|
|
37
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigg/js-client-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.56.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": "3.
|
|
31
|
+
"@stigg/api-client-js": "3.59.2",
|
|
32
32
|
"cross-fetch": "^3.1.6",
|
|
33
33
|
"dayjs": "^1.11.13",
|
|
34
34
|
"fetch-retry": "^5.0.6",
|