@stigg/js-client-sdk 3.105.1 → 4.0.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/client.d.ts +13 -4
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +8 -147
- package/dist/offlineClient.d.ts +3 -2
- package/dist/services/entitlementsService.d.ts +8 -8
- package/dist/services/eventEmitter.d.ts +2 -2
- package/dist/services/inMemoryCacheService.d.ts +7 -14
- package/dist/services/loggerService.d.ts +6 -7
- package/dist/utils/ModelMapper.d.ts +2 -16
- package/package.json +3 -1
- package/dist/services/cacheService.d.ts +0 -14
- package/dist/services/cachedEntitlement.d.ts +0 -45
- package/dist/services/entitlementDecisionService.d.ts +0 -10
- package/dist/utils/calculateUsagePeriod.d.ts +0 -5
- package/dist/utils/dateUtils.d.ts +0 -1
- package/dist/utils/isMetered.d.ts +0 -7
- package/dist/utils/mapGetEntitlementsFallback.d.ts +0 -35
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CreditsBalanceSummaryFragment, CreditUsageFragment, PaymentSessionFragment, SlimSubscriptionFragmentV2Fragment, SubscriptionInvoicePreviewFragment, UsageHistoryV2Fragment, UsageHistoryV2Input } from '@stigg/api-client-js';
|
|
2
2
|
import { ClientConfiguration } from './configuration';
|
|
3
|
-
import { ApplySubscription, ApplySubscriptionResults, BooleanEntitlement, Coupon, CreditEntitlement, Customer, CustomerPortal, Entitlement, EstimateSubscription, EstimateSubscriptionUpdate, FetchUsageHistory, GetActiveSubscriptions, GetBooleanEntitlement, GetCheckoutStateResults, GetCheckoutState, GetCreditEntitlement, 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, GetCreditLedgerResult, AutomaticRechargeConfiguration, GetAutomaticRechargeConfigurationInput, SaveAutomaticRechargeConfigurationInput,
|
|
3
|
+
import { ApplySubscription, ApplySubscriptionResults, BooleanEntitlement, Coupon, CreditEntitlement, Customer, CustomerPortal, Entitlement, EstimateSubscription, EstimateSubscriptionUpdate, FetchUsageHistory, GetActiveSubscriptions, GetBooleanEntitlement, GetCheckoutStateResults, GetCheckoutState, GetCreditEntitlement, 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, GetCreditLedgerResult, AutomaticRechargeConfiguration, GetAutomaticRechargeConfigurationInput, SaveAutomaticRechargeConfigurationInput, CustomerEntitlementsResult, CustomerEntitlementsResultV2 } from './models';
|
|
4
4
|
import { EventNames, Events } from './services/eventEmitter';
|
|
5
5
|
import { InitializationStateTracker } from './services/initializationStateTracker';
|
|
6
6
|
import { LoggerService } from './services/loggerService';
|
|
@@ -32,7 +32,9 @@ export interface StiggClient {
|
|
|
32
32
|
* @deprecated Use {@link getEntitlementsState} instead
|
|
33
33
|
*/
|
|
34
34
|
getEntitlements: (resourceId?: string) => Promise<Entitlement[]>;
|
|
35
|
-
|
|
35
|
+
/** @deprecated Use {@link getEntitlementsStateV2} for a unified API */
|
|
36
|
+
getEntitlementsState: (resourceId?: string) => Promise<CustomerEntitlementsResult>;
|
|
37
|
+
getEntitlementsStateV2: (resourceId?: string) => Promise<CustomerEntitlementsResultV2>;
|
|
36
38
|
refresh: () => Promise<void>;
|
|
37
39
|
waitForCheckoutCompleted(params?: WaitForCheckoutCompleted): Promise<Subscription | null>;
|
|
38
40
|
waitForInitialization(): Promise<StiggClient>;
|
|
@@ -63,6 +65,7 @@ export declare class Stigg implements StiggClient {
|
|
|
63
65
|
private globalEntitlementsService;
|
|
64
66
|
private resourceEntitlementsService;
|
|
65
67
|
private readonly modelMapper;
|
|
68
|
+
private readonly cacheMapper;
|
|
66
69
|
private readonly eventEmitter;
|
|
67
70
|
protected readonly initializationStateTracker: InitializationStateTracker;
|
|
68
71
|
private showWatermark;
|
|
@@ -219,10 +222,16 @@ export declare class Stigg implements StiggClient {
|
|
|
219
222
|
getEntitlements(resourceId?: string): Promise<Entitlement[]>;
|
|
220
223
|
/**
|
|
221
224
|
* Get a list of entitlements alongside an access denied reason if applicable.
|
|
225
|
+
* @deprecated Use {@link getEntitlementsStateV2} for a unified API
|
|
226
|
+
* @returns {Promise<CustomerEntitlementsResult>}
|
|
227
|
+
*/
|
|
228
|
+
getEntitlementsState(resourceId?: string): Promise<CustomerEntitlementsResult>;
|
|
229
|
+
/**
|
|
230
|
+
* Get a list of entitlements (feature + credit) alongside an access denied reason if applicable.
|
|
222
231
|
*
|
|
223
|
-
* @returns {Promise<
|
|
232
|
+
* @returns {Promise<CustomerEntitlementsResultV2>}
|
|
224
233
|
*/
|
|
225
|
-
|
|
234
|
+
getEntitlementsStateV2(resourceId?: string): Promise<CustomerEntitlementsResultV2>;
|
|
226
235
|
/**
|
|
227
236
|
* Estimate subscription
|
|
228
237
|
* @return {Promise<SubscriptionPreview>} Preview of the subscription.
|