@stigg/js-client-sdk 3.64.1 → 3.65.1
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/CreditsApi.d.ts +2 -1
- package/dist/client.d.ts +4 -2
- package/dist/index.esm.js +21 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +5 -1
- package/dist/offlineClient.d.ts +2 -1
- package/dist/src/api/CreditsApi.d.ts +2 -1
- package/dist/src/client.d.ts +4 -2
- package/dist/src/models.d.ts +5 -1
- package/dist/src/offlineClient.d.ts +2 -1
- package/package.json +2 -2
package/dist/models.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BillingModel, BillingPeriod, Currency, PricingType, PromotionalEntitlementStatus, SubscriptionStatus, SubscriptionQueryFragment, TrialPeriodUnits, ExperimentGroupType, CustomerPortalEntitlementFragment, CustomerPortalPromotionalEntitlementFragment, CustomerPortalSubscriptionFragment, CustomerPortalSubscriptionAddonFragment, CustomerPortalBillingInformationFragment, PaywallConfigurationFragment, CustomerPortalConfigurationFragment, WidgetType, CustomerPortalSubscriptionScheduledUpdateDataFragment, DiscountType, DiscountDurationType, PackageEntitlementFragment, PageInfoFragment, PaywallCurrencyFragment, FeatureType, MeterType, EntitlementResetPeriod, AccessDeniedReason, PaywallCalculatedPricePointsFragment, SubscriptionInvoiceFragment, PaymentCollection, PlanFragment, BillingVendorIdentifier, TiersMode, SubscriptionFutureUpdateDataFragment, PriceTierFragment, TotalPriceFragment, CheckoutConfigurationFragment, TypographyConfigurationFragment, BillingAddress, ScheduleStrategy, PaymentCollectionMethod, BudgetConfigurationInput, SubscriptionProrationBehavior, PaymentSessionInput, CreditBalanceSummaryInput, StripeCheckoutCredentialsFragment, ZuoraCheckoutCredentialsFragment, GetCreditGrantsInput as GetCreditGrantsInputGenerated, CreditLedgerInput, CreditGrantFragment } from '@stigg/api-client-js/src/generated/sdk';
|
|
1
|
+
import { BillingModel, BillingPeriod, Currency, PricingType, PromotionalEntitlementStatus, SubscriptionStatus, SubscriptionQueryFragment, TrialPeriodUnits, ExperimentGroupType, CustomerPortalEntitlementFragment, CustomerPortalPromotionalEntitlementFragment, CustomerPortalSubscriptionFragment, CustomerPortalSubscriptionAddonFragment, CustomerPortalBillingInformationFragment, PaywallConfigurationFragment, CustomerPortalConfigurationFragment, WidgetType, CustomerPortalSubscriptionScheduledUpdateDataFragment, DiscountType, DiscountDurationType, PackageEntitlementFragment, PageInfoFragment, PaywallCurrencyFragment, FeatureType, MeterType, EntitlementResetPeriod, AccessDeniedReason, PaywallCalculatedPricePointsFragment, SubscriptionInvoiceFragment, PaymentCollection, PlanFragment, BillingVendorIdentifier, TiersMode, SubscriptionFutureUpdateDataFragment, PriceTierFragment, TotalPriceFragment, CheckoutConfigurationFragment, TypographyConfigurationFragment, BillingAddress, ScheduleStrategy, PaymentCollectionMethod, BudgetConfigurationInput, SubscriptionProrationBehavior, PaymentSessionInput, CreditBalanceSummaryInput, StripeCheckoutCredentialsFragment, ZuoraCheckoutCredentialsFragment, GetCreditGrantsInput as GetCreditGrantsInputGenerated, CreditLedgerInput, CreditUsageInput, CreditGrantFragment } from '@stigg/api-client-js/src/generated/sdk';
|
|
2
2
|
export * from '@stigg/api-client-js/src/generated/sdk';
|
|
3
3
|
interface Metadata {
|
|
4
4
|
[key: string]: string;
|
|
@@ -87,6 +87,9 @@ export declare type Price = {
|
|
|
87
87
|
billingId?: string | null;
|
|
88
88
|
amount?: number | null;
|
|
89
89
|
currency: Currency;
|
|
90
|
+
creditRate?: {
|
|
91
|
+
amount: number;
|
|
92
|
+
} | null;
|
|
90
93
|
tiers?: PriceTierFragment[] | null | undefined;
|
|
91
94
|
tiersMode: TiersMode | null | undefined;
|
|
92
95
|
isTieredPrice: boolean;
|
|
@@ -597,6 +600,7 @@ export declare type BillableFeature = {
|
|
|
597
600
|
featureId: string;
|
|
598
601
|
quantity: number;
|
|
599
602
|
};
|
|
603
|
+
export declare type GetCreditUsageInput = Omit<CreditUsageInput, 'customerId' | 'resourceId'>;
|
|
600
604
|
export declare type GetCreditBalanceInput = Omit<CreditBalanceSummaryInput, 'customerId' | 'resourceId'>;
|
|
601
605
|
export declare type GetCreditGrantsInput = Omit<GetCreditGrantsInputGenerated, 'customerId' | 'resourceId'>;
|
|
602
606
|
export declare type GetCreditLedgerInput = Omit<CreditLedgerInput, 'customerId' | 'resourceId'>;
|
package/dist/offlineClient.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Stigg, StiggClient } from './clients';
|
|
2
|
-
import { ApplySubscriptionResults, BooleanEntitlement, Coupon, CreditLedgerFragment, CreditsBalanceSummaryFragment, Customer, CustomerPortal, Entitlement, EnumEntitlement, GetBooleanEntitlement, GetCheckoutStateResults, GetCreditGrantsResult, GetEnumEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetSubscriptionsResult, MeteredEntitlement, NumericEntitlement, PaymentSessionFragment, Paywall, SlimSubscriptionFragmentV2Fragment, Subscription, SubscriptionInvoicePreviewFragment, SubscriptionPreview, SubscriptionPreviewV2, UsageHistoryPoint, UsageHistoryV2Fragment } from './models';
|
|
2
|
+
import { ApplySubscriptionResults, BooleanEntitlement, Coupon, CreditLedgerFragment, CreditsBalanceSummaryFragment, CreditUsageFragment, Customer, CustomerPortal, Entitlement, EnumEntitlement, GetBooleanEntitlement, GetCheckoutStateResults, GetCreditGrantsResult, GetEnumEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetSubscriptionsResult, MeteredEntitlement, NumericEntitlement, PaymentSessionFragment, 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;
|
|
@@ -37,5 +37,6 @@ export declare class OfflineStigg extends Stigg {
|
|
|
37
37
|
getCreditBalance(): Promise<CreditsBalanceSummaryFragment>;
|
|
38
38
|
getCreditGrants(): Promise<GetCreditGrantsResult>;
|
|
39
39
|
getCreditLedger(): Promise<CreditLedgerFragment[]>;
|
|
40
|
+
getCreditUsage(): Promise<CreditUsageFragment>;
|
|
40
41
|
createPaymentSession(): Promise<PaymentSessionFragment>;
|
|
41
42
|
}
|
|
@@ -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/src/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { 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, GetCreditGrantsResult } 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 {
|
|
@@ -40,6 +40,7 @@ export interface StiggClient {
|
|
|
40
40
|
getCreditBalance(input?: GetCreditBalanceInput): Promise<CreditsBalanceSummaryFragment>;
|
|
41
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
|
package/dist/src/models.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BillingModel, BillingPeriod, Currency, PricingType, PromotionalEntitlementStatus, SubscriptionStatus, SubscriptionQueryFragment, TrialPeriodUnits, ExperimentGroupType, CustomerPortalEntitlementFragment, CustomerPortalPromotionalEntitlementFragment, CustomerPortalSubscriptionFragment, CustomerPortalSubscriptionAddonFragment, CustomerPortalBillingInformationFragment, PaywallConfigurationFragment, CustomerPortalConfigurationFragment, WidgetType, CustomerPortalSubscriptionScheduledUpdateDataFragment, DiscountType, DiscountDurationType, PackageEntitlementFragment, PageInfoFragment, PaywallCurrencyFragment, FeatureType, MeterType, EntitlementResetPeriod, AccessDeniedReason, PaywallCalculatedPricePointsFragment, SubscriptionInvoiceFragment, PaymentCollection, PlanFragment, BillingVendorIdentifier, TiersMode, SubscriptionFutureUpdateDataFragment, PriceTierFragment, TotalPriceFragment, CheckoutConfigurationFragment, TypographyConfigurationFragment, BillingAddress, ScheduleStrategy, PaymentCollectionMethod, BudgetConfigurationInput, SubscriptionProrationBehavior, PaymentSessionInput, CreditBalanceSummaryInput, StripeCheckoutCredentialsFragment, ZuoraCheckoutCredentialsFragment, GetCreditGrantsInput as GetCreditGrantsInputGenerated, CreditLedgerInput, CreditGrantFragment } from '@stigg/api-client-js/src/generated/sdk';
|
|
1
|
+
import { BillingModel, BillingPeriod, Currency, PricingType, PromotionalEntitlementStatus, SubscriptionStatus, SubscriptionQueryFragment, TrialPeriodUnits, ExperimentGroupType, CustomerPortalEntitlementFragment, CustomerPortalPromotionalEntitlementFragment, CustomerPortalSubscriptionFragment, CustomerPortalSubscriptionAddonFragment, CustomerPortalBillingInformationFragment, PaywallConfigurationFragment, CustomerPortalConfigurationFragment, WidgetType, CustomerPortalSubscriptionScheduledUpdateDataFragment, DiscountType, DiscountDurationType, PackageEntitlementFragment, PageInfoFragment, PaywallCurrencyFragment, FeatureType, MeterType, EntitlementResetPeriod, AccessDeniedReason, PaywallCalculatedPricePointsFragment, SubscriptionInvoiceFragment, PaymentCollection, PlanFragment, BillingVendorIdentifier, TiersMode, SubscriptionFutureUpdateDataFragment, PriceTierFragment, TotalPriceFragment, CheckoutConfigurationFragment, TypographyConfigurationFragment, BillingAddress, ScheduleStrategy, PaymentCollectionMethod, BudgetConfigurationInput, SubscriptionProrationBehavior, PaymentSessionInput, CreditBalanceSummaryInput, StripeCheckoutCredentialsFragment, ZuoraCheckoutCredentialsFragment, GetCreditGrantsInput as GetCreditGrantsInputGenerated, CreditLedgerInput, CreditUsageInput, CreditGrantFragment } from '@stigg/api-client-js/src/generated/sdk';
|
|
2
2
|
export * from '@stigg/api-client-js/src/generated/sdk';
|
|
3
3
|
interface Metadata {
|
|
4
4
|
[key: string]: string;
|
|
@@ -87,6 +87,9 @@ export declare type Price = {
|
|
|
87
87
|
billingId?: string | null;
|
|
88
88
|
amount?: number | null;
|
|
89
89
|
currency: Currency;
|
|
90
|
+
creditRate?: {
|
|
91
|
+
amount: number;
|
|
92
|
+
} | null;
|
|
90
93
|
tiers?: PriceTierFragment[] | null | undefined;
|
|
91
94
|
tiersMode: TiersMode | null | undefined;
|
|
92
95
|
isTieredPrice: boolean;
|
|
@@ -597,6 +600,7 @@ export declare type BillableFeature = {
|
|
|
597
600
|
featureId: string;
|
|
598
601
|
quantity: number;
|
|
599
602
|
};
|
|
603
|
+
export declare type GetCreditUsageInput = Omit<CreditUsageInput, 'customerId' | 'resourceId'>;
|
|
600
604
|
export declare type GetCreditBalanceInput = Omit<CreditBalanceSummaryInput, 'customerId' | 'resourceId'>;
|
|
601
605
|
export declare type GetCreditGrantsInput = Omit<GetCreditGrantsInputGenerated, 'customerId' | 'resourceId'>;
|
|
602
606
|
export declare type GetCreditLedgerInput = Omit<CreditLedgerInput, 'customerId' | 'resourceId'>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Stigg, StiggClient } from './clients';
|
|
2
|
-
import { ApplySubscriptionResults, BooleanEntitlement, Coupon, CreditLedgerFragment, CreditsBalanceSummaryFragment, Customer, CustomerPortal, Entitlement, EnumEntitlement, GetBooleanEntitlement, GetCheckoutStateResults, GetCreditGrantsResult, GetEnumEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetSubscriptionsResult, MeteredEntitlement, NumericEntitlement, PaymentSessionFragment, Paywall, SlimSubscriptionFragmentV2Fragment, Subscription, SubscriptionInvoicePreviewFragment, SubscriptionPreview, SubscriptionPreviewV2, UsageHistoryPoint, UsageHistoryV2Fragment } from './models';
|
|
2
|
+
import { ApplySubscriptionResults, BooleanEntitlement, Coupon, CreditLedgerFragment, CreditsBalanceSummaryFragment, CreditUsageFragment, Customer, CustomerPortal, Entitlement, EnumEntitlement, GetBooleanEntitlement, GetCheckoutStateResults, GetCreditGrantsResult, GetEnumEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetSubscriptionsResult, MeteredEntitlement, NumericEntitlement, PaymentSessionFragment, 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;
|
|
@@ -37,5 +37,6 @@ export declare class OfflineStigg extends Stigg {
|
|
|
37
37
|
getCreditBalance(): Promise<CreditsBalanceSummaryFragment>;
|
|
38
38
|
getCreditGrants(): Promise<GetCreditGrantsResult>;
|
|
39
39
|
getCreditLedger(): Promise<CreditLedgerFragment[]>;
|
|
40
|
+
getCreditUsage(): Promise<CreditUsageFragment>;
|
|
40
41
|
createPaymentSession(): Promise<PaymentSessionFragment>;
|
|
41
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigg/js-client-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.65.1",
|
|
4
4
|
"description": "Stigg client-side SDK for Browser",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@apollo/client": "^3.4.17",
|
|
38
38
|
"@sentry/browser": "^7.11.1",
|
|
39
|
-
"@stigg/api-client-js": "3.
|
|
39
|
+
"@stigg/api-client-js": "3.96.0",
|
|
40
40
|
"cross-fetch": "^3.1.6",
|
|
41
41
|
"dayjs": "^1.11.13",
|
|
42
42
|
"fetch-retry": "^5.0.6",
|