@stigg/js-client-sdk 3.59.1 → 3.60.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/ApiGateway.d.ts +2 -0
- package/dist/api/CheckoutApi.d.ts +8 -0
- package/dist/client.d.ts +9 -2
- package/dist/index.js +34 -4
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +5 -3
- package/dist/offlineClient.d.ts +2 -1
- package/dist/src/api/ApiGateway.d.ts +2 -0
- package/dist/src/api/CheckoutApi.d.ts +8 -0
- package/dist/src/client.d.ts +9 -2
- package/dist/src/models.d.ts +5 -3
- 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, CreditBalanceSummaryInput } 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 } 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;
|
|
@@ -370,11 +370,13 @@ export declare type CustomerPortal = {
|
|
|
370
370
|
export declare type CheckoutStatePlan = Plan & Pick<PlanFragment, 'prices'>;
|
|
371
371
|
export declare type CheckoutBillingIntegration = {
|
|
372
372
|
billingIdentifier: BillingVendorIdentifier;
|
|
373
|
+
billingCredentials: StripeCheckoutCredentialsFragment | ZuoraCheckoutCredentialsFragment;
|
|
373
374
|
credentials: {
|
|
374
|
-
accountId
|
|
375
|
-
publicKey
|
|
375
|
+
accountId?: string | null;
|
|
376
|
+
publicKey?: string | null;
|
|
376
377
|
};
|
|
377
378
|
};
|
|
379
|
+
export declare type CreatePaymentSessionInput = Omit<PaymentSessionInput, 'customerId'>;
|
|
378
380
|
export declare type TypographyConfiguration = Omit<TypographyConfigurationFragment, '__typename'>;
|
|
379
381
|
export declare type CheckoutConfiguration = Omit<CheckoutConfigurationFragment, '__typename'>;
|
|
380
382
|
export declare type GetCheckoutStateResults = {
|
package/dist/offlineClient.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Stigg, StiggClient } from './clients';
|
|
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';
|
|
2
|
+
import { ApplySubscriptionResults, BooleanEntitlement, Coupon, CreditGrantFragment, CreditsBalanceSummaryFragment, Customer, CustomerPortal, Entitlement, EnumEntitlement, GetBooleanEntitlement, GetCheckoutStateResults, 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;
|
|
@@ -36,4 +36,5 @@ export declare class OfflineStigg extends Stigg {
|
|
|
36
36
|
getCustomer(): Promise<Customer>;
|
|
37
37
|
getCreditBalance(): Promise<CreditsBalanceSummaryFragment>;
|
|
38
38
|
getCreditGrants(): Promise<CreditGrantFragment[]>;
|
|
39
|
+
createPaymentSession(): Promise<PaymentSessionFragment>;
|
|
39
40
|
}
|
|
@@ -9,6 +9,7 @@ import MockPaywallApi from './MockPaywallApi';
|
|
|
9
9
|
import { EdgeApiClient } from './EdgeApiClient';
|
|
10
10
|
import { UsageHistoryApi } from './UsageHistoryApi';
|
|
11
11
|
import CreditsApi from './CreditsApi';
|
|
12
|
+
import CheckoutApi from './CheckoutApi';
|
|
12
13
|
declare class ApiGateway {
|
|
13
14
|
sdkConfiguration: SdkConfigurationApi;
|
|
14
15
|
paywall: PaywallApi;
|
|
@@ -19,6 +20,7 @@ declare class ApiGateway {
|
|
|
19
20
|
subscriptionEstimations: SubscriptionEstimationsApi;
|
|
20
21
|
usageHistoryApi: UsageHistoryApi;
|
|
21
22
|
credits: CreditsApi;
|
|
23
|
+
checkout: CheckoutApi;
|
|
22
24
|
constructor(client: ApolloClient<NormalizedCacheObject>, edgeApiClient: EdgeApiClient | null);
|
|
23
25
|
}
|
|
24
26
|
export default ApiGateway;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
2
|
+
import { CreatePaymentSessionMutation, PaymentSessionInput } from '@stigg/api-client-js/src/generated/sdk';
|
|
3
|
+
declare class CheckoutApi {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: ApolloClient<NormalizedCacheObject>);
|
|
6
|
+
createPaymentSession(input: PaymentSessionInput): Promise<import("@apollo/client/core").FetchResult<CreatePaymentSessionMutation, Record<string, any>, Record<string, any>>>;
|
|
7
|
+
}
|
|
8
|
+
export default CheckoutApi;
|
package/dist/src/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CreditGrantFragment, CreditsBalanceSummaryFragment, GetCreditGrantsInput, SlimSubscriptionFragmentV2Fragment, SubscriptionInvoicePreviewFragment, UsageHistoryV2Fragment, UsageHistoryV2Input } from '@stigg/api-client-js/src/generated/sdk';
|
|
1
|
+
import { CreditGrantFragment, CreditsBalanceSummaryFragment, GetCreditGrantsInput, 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, GetCreditBalanceInput } 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 } from './models';
|
|
4
4
|
import { EventNames, Events } from './services/eventEmitter';
|
|
5
5
|
import { LoggerService } from './services/loggerService';
|
|
6
6
|
export interface StiggClient {
|
|
@@ -39,6 +39,7 @@ export interface StiggClient {
|
|
|
39
39
|
getUsageHistoryV2(input: UsageHistoryV2Input): Promise<UsageHistoryV2Fragment>;
|
|
40
40
|
getCreditBalance(input?: GetCreditBalanceInput): Promise<CreditsBalanceSummaryFragment>;
|
|
41
41
|
getCreditGrants(input: GetCreditGrantsInput): Promise<CreditGrantFragment[]>;
|
|
42
|
+
createPaymentSession(input: CreatePaymentSessionInput): Promise<PaymentSessionFragment>;
|
|
42
43
|
}
|
|
43
44
|
export declare class Stigg implements StiggClient {
|
|
44
45
|
private readonly apiGateway;
|
|
@@ -255,4 +256,10 @@ export declare class Stigg implements StiggClient {
|
|
|
255
256
|
* @param input - the input for the credit grants
|
|
256
257
|
*/
|
|
257
258
|
getCreditGrants(input: GetCreditGrantsInput): Promise<CreditGrantFragment[]>;
|
|
259
|
+
/**
|
|
260
|
+
* Create payment session
|
|
261
|
+
* @return {Promise<PaymentSessionFragment>} the payment session data
|
|
262
|
+
* @param input - the input for the payment session
|
|
263
|
+
*/
|
|
264
|
+
createPaymentSession(input: CreatePaymentSessionInput): Promise<PaymentSessionFragment>;
|
|
258
265
|
}
|
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, CreditBalanceSummaryInput } 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 } 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;
|
|
@@ -370,11 +370,13 @@ export declare type CustomerPortal = {
|
|
|
370
370
|
export declare type CheckoutStatePlan = Plan & Pick<PlanFragment, 'prices'>;
|
|
371
371
|
export declare type CheckoutBillingIntegration = {
|
|
372
372
|
billingIdentifier: BillingVendorIdentifier;
|
|
373
|
+
billingCredentials: StripeCheckoutCredentialsFragment | ZuoraCheckoutCredentialsFragment;
|
|
373
374
|
credentials: {
|
|
374
|
-
accountId
|
|
375
|
-
publicKey
|
|
375
|
+
accountId?: string | null;
|
|
376
|
+
publicKey?: string | null;
|
|
376
377
|
};
|
|
377
378
|
};
|
|
379
|
+
export declare type CreatePaymentSessionInput = Omit<PaymentSessionInput, 'customerId'>;
|
|
378
380
|
export declare type TypographyConfiguration = Omit<TypographyConfigurationFragment, '__typename'>;
|
|
379
381
|
export declare type CheckoutConfiguration = Omit<CheckoutConfigurationFragment, '__typename'>;
|
|
380
382
|
export declare type GetCheckoutStateResults = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Stigg, StiggClient } from './clients';
|
|
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';
|
|
2
|
+
import { ApplySubscriptionResults, BooleanEntitlement, Coupon, CreditGrantFragment, CreditsBalanceSummaryFragment, Customer, CustomerPortal, Entitlement, EnumEntitlement, GetBooleanEntitlement, GetCheckoutStateResults, 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;
|
|
@@ -36,4 +36,5 @@ export declare class OfflineStigg extends Stigg {
|
|
|
36
36
|
getCustomer(): Promise<Customer>;
|
|
37
37
|
getCreditBalance(): Promise<CreditsBalanceSummaryFragment>;
|
|
38
38
|
getCreditGrants(): Promise<CreditGrantFragment[]>;
|
|
39
|
+
createPaymentSession(): Promise<PaymentSessionFragment>;
|
|
39
40
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigg/js-client-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.60.1",
|
|
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.68.0",
|
|
32
32
|
"cross-fetch": "^3.1.6",
|
|
33
33
|
"dayjs": "^1.11.13",
|
|
34
34
|
"fetch-retry": "^5.0.6",
|