@stigg/js-client-sdk 3.85.1 → 3.86.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/EdgeApiClient.d.ts +1 -1
- package/dist/api/MockPaywallApi.d.ts +1 -1
- package/dist/api/PaywallApi.d.ts +1 -1
- package/dist/api/SubscriptionsApi.d.ts +2 -2
- package/dist/api/initApolloClient.d.ts +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +101 -101
- package/dist/services/eventEmitter.d.ts +1 -1
- package/dist/utils/dateUtils.d.ts +1 -1
- package/dist/utils/fetch.d.ts +1 -2
- package/dist/utils/isMetered.d.ts +1 -1
- package/dist/utils/mapGetEntitlementsFallback.d.ts +5 -5
- package/dist/utils/withErrorHandling.d.ts +2 -2
- package/package.json +15 -16
- package/dist/src/api/ApiGateway.d.ts +0 -28
- package/dist/src/api/AutomaticRechargeApi.d.ts +0 -23
- package/dist/src/api/CheckoutApi.d.ts +0 -8
- package/dist/src/api/CouponsApi.d.ts +0 -8
- package/dist/src/api/CreditsApi.d.ts +0 -11
- package/dist/src/api/CustomersApi.d.ts +0 -16
- package/dist/src/api/EdgeApiClient.d.ts +0 -21
- package/dist/src/api/EntitlementsApi.d.ts +0 -10
- package/dist/src/api/MockPaywallApi.d.ts +0 -10
- package/dist/src/api/PaywallApi.d.ts +0 -18
- package/dist/src/api/SdkConfigurationApi.d.ts +0 -10
- package/dist/src/api/SubscriptionEstimationsApi.d.ts +0 -12
- package/dist/src/api/SubscriptionsApi.d.ts +0 -22
- package/dist/src/api/UsageHistoryApi.d.ts +0 -7
- package/dist/src/api/initApolloClient.d.ts +0 -11
- package/dist/src/client.d.ts +0 -312
- package/dist/src/clients.d.ts +0 -2
- package/dist/src/configuration.d.ts +0 -28
- package/dist/src/index.d.ts +0 -6
- package/dist/src/models.d.ts +0 -670
- package/dist/src/offlineClient.d.ts +0 -46
- package/dist/src/services/cacheService.d.ts +0 -14
- package/dist/src/services/cachedEntitlement.d.ts +0 -45
- package/dist/src/services/entitlementDecisionService.d.ts +0 -10
- package/dist/src/services/entitlementsService.d.ts +0 -34
- package/dist/src/services/eventEmitter.d.ts +0 -11
- package/dist/src/services/inMemoryCacheService.d.ts +0 -22
- package/dist/src/services/initializationStateTracker.d.ts +0 -16
- package/dist/src/services/loggerService.d.ts +0 -23
- package/dist/src/services/sentryService.d.ts +0 -3
- package/dist/src/utils/ModelMapper.d.ts +0 -58
- package/dist/src/utils/calculateUsagePeriod.d.ts +0 -5
- package/dist/src/utils/dateUtils.d.ts +0 -1
- package/dist/src/utils/fetch.d.ts +0 -3
- package/dist/src/utils/isMetered.d.ts +0 -7
- package/dist/src/utils/mapGetEntitlementsFallback.d.ts +0 -35
- package/dist/src/utils/withErrorHandling.d.ts +0 -23
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Stigg, StiggClient } from './clients';
|
|
2
|
-
import { ApplySubscriptionResults, AutomaticRechargeConfiguration, BooleanEntitlement, Coupon, CreditEntitlement, CreditsBalanceSummaryFragment, CreditUsageFragment, Customer, CustomerPortal, Entitlement, EntitlementsState, EnumEntitlement, GetAutomaticRechargeConfigurationInput, GetBooleanEntitlement, GetCheckoutStateResults, GetCreditEntitlement, GetCreditGrantsResult, GetCreditLedgerResult, GetEnumEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetSubscriptionsResult, MeteredEntitlement, NumericEntitlement, PaymentSessionFragment, Paywall, SaveAutomaticRechargeConfigurationInput, SlimSubscriptionFragmentV2Fragment, Subscription, SubscriptionInvoicePreviewFragment, SubscriptionPreview, SubscriptionPreviewV2, UsageHistoryPoint, UsageHistoryV2Fragment } from './models';
|
|
3
|
-
export declare class OfflineStigg extends Stigg {
|
|
4
|
-
getBooleanEntitlement({ featureId, options }: GetBooleanEntitlement): BooleanEntitlement;
|
|
5
|
-
getMeteredEntitlement({ featureId, options }: GetMeteredEntitlement): MeteredEntitlement;
|
|
6
|
-
getNumericEntitlement({ featureId, options }: GetNumericEntitlement): NumericEntitlement;
|
|
7
|
-
getEnumEntitlement({ featureId, options }: GetEnumEntitlement): EnumEntitlement;
|
|
8
|
-
getCreditEntitlement({ currencyId, options }: GetCreditEntitlement): CreditEntitlement;
|
|
9
|
-
getEntitlements(): Promise<Entitlement[]>;
|
|
10
|
-
getEntitlementsState(): Promise<EntitlementsState>;
|
|
11
|
-
addListener(): void;
|
|
12
|
-
clearCustomer(): void;
|
|
13
|
-
clearResource(): void;
|
|
14
|
-
getActiveSubscriptionsList(): Promise<SlimSubscriptionFragmentV2Fragment[]>;
|
|
15
|
-
getCoupons(): Promise<Coupon[]>;
|
|
16
|
-
getSubscription(): Promise<Subscription>;
|
|
17
|
-
get isCustomerLoaded(): boolean;
|
|
18
|
-
get isResourceLoaded(): boolean;
|
|
19
|
-
removeListener(): void;
|
|
20
|
-
waitForInitialization(): Promise<StiggClient>;
|
|
21
|
-
setResource(): Promise<void>;
|
|
22
|
-
getCheckoutState(): Promise<GetCheckoutStateResults>;
|
|
23
|
-
applySubscription(): Promise<ApplySubscriptionResults>;
|
|
24
|
-
estimateSubscription(): Promise<SubscriptionPreview>;
|
|
25
|
-
previewNextInvoice(): Promise<SubscriptionInvoicePreviewFragment>;
|
|
26
|
-
previewSubscription(): Promise<SubscriptionPreviewV2>;
|
|
27
|
-
estimateSubscriptionUpdate(): Promise<SubscriptionPreview>;
|
|
28
|
-
waitForCheckoutCompleted(): Promise<Subscription | null>;
|
|
29
|
-
refresh(): Promise<void>;
|
|
30
|
-
fetchUsageHistory(): Promise<UsageHistoryPoint[] | undefined>;
|
|
31
|
-
getUsageHistoryV2(): Promise<UsageHistoryV2Fragment>;
|
|
32
|
-
setCustomerId(): Promise<void>;
|
|
33
|
-
getPaywall(): Promise<Paywall>;
|
|
34
|
-
getCustomerPortal(): Promise<CustomerPortal>;
|
|
35
|
-
getActiveSubscriptions(): Promise<Subscription[]>;
|
|
36
|
-
getSubscriptions(): Promise<GetSubscriptionsResult>;
|
|
37
|
-
getCustomer(): Promise<Customer>;
|
|
38
|
-
getCreditBalance(): Promise<CreditsBalanceSummaryFragment>;
|
|
39
|
-
getCreditGrants(): Promise<GetCreditGrantsResult>;
|
|
40
|
-
getCreditLedger(): Promise<GetCreditLedgerResult>;
|
|
41
|
-
getCreditUsage(): Promise<CreditUsageFragment>;
|
|
42
|
-
createPaymentSession(): Promise<PaymentSessionFragment>;
|
|
43
|
-
getShowWatermark(): boolean;
|
|
44
|
-
getAutomaticRechargeConfiguration(input: GetAutomaticRechargeConfigurationInput): Promise<AutomaticRechargeConfiguration>;
|
|
45
|
-
saveAutomaticRechargeConfiguration(input: SaveAutomaticRechargeConfigurationInput): Promise<AutomaticRechargeConfiguration>;
|
|
46
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import CachedEntitlement, { CachedCreditEntitlement, CachedEntitlementsState } from './cachedEntitlement';
|
|
2
|
-
export interface CacheService {
|
|
3
|
-
isLoaded(): boolean;
|
|
4
|
-
getLastUpdate(): Date | null;
|
|
5
|
-
updateLastChecked(): void;
|
|
6
|
-
isOutdated(): boolean;
|
|
7
|
-
setEntitlements(entitlementsState: CachedEntitlementsState, lastUpdate: Date): void;
|
|
8
|
-
getEntitlement(featureId: string): CachedEntitlement | null;
|
|
9
|
-
getEntitlements(): CachedEntitlementsState;
|
|
10
|
-
validateFeature(featureId: string): boolean;
|
|
11
|
-
setFeatures(features: string[]): void;
|
|
12
|
-
getCreditEntitlement(currencyId: string): CachedCreditEntitlement | null;
|
|
13
|
-
setCreditEntitlements(creditEntitlements: Map<string, CachedCreditEntitlement>): void;
|
|
14
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { EntitlementFeature, EntitlementResetPeriod } from '../models';
|
|
2
|
-
import { AccessDeniedReason, EntitlementsStateAccessDeniedReason, ResetPeriodConfigurationFragment } from '@stigg/api-client-js/src/generated/sdk';
|
|
3
|
-
export interface CalculatedEntitlement {
|
|
4
|
-
usageLimit?: number | null;
|
|
5
|
-
hasUnlimitedUsage: boolean;
|
|
6
|
-
hasSoftLimit: boolean;
|
|
7
|
-
feature?: EntitlementFeature;
|
|
8
|
-
accessDeniedReason?: AccessDeniedReason;
|
|
9
|
-
enumValues?: string[];
|
|
10
|
-
}
|
|
11
|
-
export interface EntitlementUsage {
|
|
12
|
-
currentUsage: number;
|
|
13
|
-
usagePeriodAnchor?: Date;
|
|
14
|
-
usagePeriodStart?: Date;
|
|
15
|
-
usagePeriodEnd?: Date;
|
|
16
|
-
resetPeriod?: EntitlementResetPeriod | null;
|
|
17
|
-
resetPeriodConfiguration?: ResetPeriodConfigurationFragment | null;
|
|
18
|
-
}
|
|
19
|
-
export declare class CachedEntitlementsState {
|
|
20
|
-
readonly entitlements: Map<string, CachedEntitlement>;
|
|
21
|
-
readonly accessDeniedReason: EntitlementsStateAccessDeniedReason | null;
|
|
22
|
-
constructor(entitlements: Map<string, CachedEntitlement>, accessDeniedReason: EntitlementsStateAccessDeniedReason | null);
|
|
23
|
-
}
|
|
24
|
-
export default class CachedEntitlement {
|
|
25
|
-
readonly calculatedEntitlement: CalculatedEntitlement;
|
|
26
|
-
readonly featureUsage: EntitlementUsage;
|
|
27
|
-
constructor(calculatedEntitlement: CalculatedEntitlement, featureUsage: EntitlementUsage);
|
|
28
|
-
}
|
|
29
|
-
export interface CachedCreditEntitlementData {
|
|
30
|
-
currencyId: string;
|
|
31
|
-
isGranted: boolean;
|
|
32
|
-
accessDeniedReason?: AccessDeniedReason;
|
|
33
|
-
usageLimit: number;
|
|
34
|
-
currentUsage: number;
|
|
35
|
-
usagePeriodEnd?: Date;
|
|
36
|
-
}
|
|
37
|
-
export declare class CachedCreditEntitlement {
|
|
38
|
-
readonly currencyId: string;
|
|
39
|
-
readonly isGranted: boolean;
|
|
40
|
-
readonly accessDeniedReason?: AccessDeniedReason;
|
|
41
|
-
readonly usageLimit: number;
|
|
42
|
-
readonly currentUsage: number;
|
|
43
|
-
readonly usagePeriodEnd?: Date;
|
|
44
|
-
constructor(data: CachedCreditEntitlementData);
|
|
45
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import CachedEntitlement, { CachedCreditEntitlement } from './cachedEntitlement';
|
|
2
|
-
import { AccessDeniedReason } from '../models';
|
|
3
|
-
export declare class EntitlementDecisionService {
|
|
4
|
-
static decideCreditEntitlementPolicy(creditEntitlement?: CachedCreditEntitlement | null): Decision;
|
|
5
|
-
static decideEntitlementPolicy(entitlement?: CachedEntitlement | null, requestUsage?: number, requestedValues?: string[]): Decision;
|
|
6
|
-
}
|
|
7
|
-
export interface Decision {
|
|
8
|
-
readonly hasAccess: boolean;
|
|
9
|
-
readonly accessDeniedReason?: AccessDeniedReason;
|
|
10
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
2
|
-
import { EntitlementsStateAccessDeniedReason, EntitlementUnionFragment } from '@stigg/api-client-js/src/generated/sdk';
|
|
3
|
-
import { BooleanEntitlement, BooleanEntitlementOptions, CreditEntitlement, EntitlementsState, EnumEntitlement, EnumEntitlementOptions, MeteredEntitlement, MeteredEntitlementOptions, NumericEntitlement, NumericEntitlementOptions } from '../models';
|
|
4
|
-
import CachedEntitlement from './cachedEntitlement';
|
|
5
|
-
import { CacheService } from './cacheService';
|
|
6
|
-
import { LoggerService } from './loggerService';
|
|
7
|
-
import { EdgeApiClient } from '../api/EdgeApiClient';
|
|
8
|
-
export declare class EntitlementsService {
|
|
9
|
-
private readonly customerId;
|
|
10
|
-
private readonly resourceId;
|
|
11
|
-
private readonly cacheService;
|
|
12
|
-
private loggerService;
|
|
13
|
-
private onEntitlementsUpdated;
|
|
14
|
-
private readonly entitlementsApi;
|
|
15
|
-
private readonly modelMapper;
|
|
16
|
-
private loadingEntitlements;
|
|
17
|
-
constructor(customerId: string, resourceId: string | undefined, cacheService: CacheService, client: ApolloClient<NormalizedCacheObject>, edgeApiClient: EdgeApiClient | null, loggerService: LoggerService, onEntitlementsUpdated: (cachedEntitlements: Map<string, CachedEntitlement>) => void);
|
|
18
|
-
refresh(): Promise<void>;
|
|
19
|
-
get isInitialized(): boolean;
|
|
20
|
-
getBooleanEntitlement(featureId: string, fallbackEntitlement: BooleanEntitlement, _options?: BooleanEntitlementOptions): BooleanEntitlement;
|
|
21
|
-
getNumericEntitlement(featureId: string, fallbackEntitlement: NumericEntitlement, _options?: NumericEntitlementOptions): NumericEntitlement;
|
|
22
|
-
getMeteredEntitlement(featureId: string, fallbackEntitlement: MeteredEntitlement, options?: MeteredEntitlementOptions): MeteredEntitlement;
|
|
23
|
-
private handleUsagePeriodOver;
|
|
24
|
-
getEnumEntitlement(featureId: string, fallbackEntitlement: EnumEntitlement, options?: EnumEntitlementOptions): EnumEntitlement;
|
|
25
|
-
getCreditEntitlement(currencyId: string, fallbackEntitlement: CreditEntitlement): CreditEntitlement;
|
|
26
|
-
loadEntitlements(skipEdge?: boolean): Promise<void>;
|
|
27
|
-
private loadEntitlementsFromRemote;
|
|
28
|
-
protected storeFetchedEntitlementsInCache(entitlements: EntitlementUnionFragment[], accessDeniedReason: EntitlementsStateAccessDeniedReason | null): void;
|
|
29
|
-
private getLastEntitlementsUpdate;
|
|
30
|
-
private getEntitlement;
|
|
31
|
-
getEntitlementsState(): Promise<EntitlementsState>;
|
|
32
|
-
private renewOutdatedCache;
|
|
33
|
-
renewOutdatedCacheInBackground(): void;
|
|
34
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
-
import CachedEntitlement from './cachedEntitlement';
|
|
3
|
-
export interface Events {
|
|
4
|
-
initializeSuccessfully: () => void;
|
|
5
|
-
initializeFailed: (err: any) => void;
|
|
6
|
-
entitlementsUpdated: (data: Map<string, CachedEntitlement>) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare type EventNames = keyof Events;
|
|
9
|
-
export declare class TypedEventEmitter extends TypedEmitter<Events> {
|
|
10
|
-
constructor();
|
|
11
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CacheService } from './cacheService';
|
|
2
|
-
import CachedEntitlement, { CachedCreditEntitlement, CachedEntitlementsState } from './cachedEntitlement';
|
|
3
|
-
export declare class InMemoryCacheService implements CacheService {
|
|
4
|
-
private readonly ttlMs;
|
|
5
|
-
private entitlementsState;
|
|
6
|
-
private creditEntitlements;
|
|
7
|
-
private lastUpdate;
|
|
8
|
-
private lastChecked;
|
|
9
|
-
private features;
|
|
10
|
-
constructor(ttlMs?: number);
|
|
11
|
-
getEntitlement(featureId: string): CachedEntitlement | null;
|
|
12
|
-
validateFeature(featureId: string): boolean;
|
|
13
|
-
setFeatures: (features: string[]) => Set<string>;
|
|
14
|
-
updateLastChecked(): void;
|
|
15
|
-
setEntitlements(entitlementsState: CachedEntitlementsState, lastUpdate: Date): void;
|
|
16
|
-
getEntitlements(): CachedEntitlementsState;
|
|
17
|
-
getLastUpdate(): Date | null;
|
|
18
|
-
isLoaded(): boolean;
|
|
19
|
-
isOutdated(): boolean;
|
|
20
|
-
getCreditEntitlement(currencyId: string): CachedCreditEntitlement | null;
|
|
21
|
-
setCreditEntitlements(creditEntitlements: Map<string, CachedCreditEntitlement>): void;
|
|
22
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TypedEventEmitter } from './eventEmitter';
|
|
2
|
-
export declare enum InitializationState {
|
|
3
|
-
IN_PROGRESS = "IN_PROGRESS",
|
|
4
|
-
SUCCESS = "READY",
|
|
5
|
-
FAILED = "FAILED"
|
|
6
|
-
}
|
|
7
|
-
export declare class InitializationStateTracker {
|
|
8
|
-
private readonly eventEmitter;
|
|
9
|
-
initializationPromise: Promise<void> | null;
|
|
10
|
-
initializationStatus: InitializationState;
|
|
11
|
-
initFailureError: Error | null;
|
|
12
|
-
constructor(eventEmitter: TypedEventEmitter);
|
|
13
|
-
getInitializationPromise(): Promise<void>;
|
|
14
|
-
signalSuccessInit(): void;
|
|
15
|
-
signalFailedInit(err: any): void;
|
|
16
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface Logger {
|
|
2
|
-
log: (message: string, object?: Record<string, string>) => void;
|
|
3
|
-
debug: (message: string, object?: Record<string, string>) => void;
|
|
4
|
-
error: (message: string, error?: Record<string, string>) => void;
|
|
5
|
-
}
|
|
6
|
-
export interface LogConfiguration {
|
|
7
|
-
logger: Logger;
|
|
8
|
-
logLevel: LogLevel;
|
|
9
|
-
}
|
|
10
|
-
export declare enum LogLevel {
|
|
11
|
-
ALL = "ALL",
|
|
12
|
-
NONE = "NONE",
|
|
13
|
-
LOG = "LOG",
|
|
14
|
-
ERROR = "ERROR"
|
|
15
|
-
}
|
|
16
|
-
export declare class LoggerService implements Logger {
|
|
17
|
-
private readonly logger;
|
|
18
|
-
private readonly logLevel;
|
|
19
|
-
constructor(logger: Logger, logLevel: LogLevel);
|
|
20
|
-
error(message: string, error?: Record<string, string>): void;
|
|
21
|
-
log(message: string, object?: Record<string, string>): void;
|
|
22
|
-
debug(message: string, object?: Record<string, string> | undefined): void;
|
|
23
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { ApplySubscriptionMutation, CustomerFragment, CustomerPortalFragment, CustomerResourceFragment, CheckoutStateFragment, GetCouponsQuery, GetMockPaywallQuery, GetPaywallQuery, SubscriptionFragment, SubscriptionPreviewFragment, UsageHistoryFragment, SubscriptionPreviewV2Fragment, SubscriptionPreviewInvoiceFragment, ImmediateSubscriptionPreviewInvoiceFragment, SlimCustomerFragment, CreditEntitlementFragment, EntitlementUnionFragment, FeatureEntitlementFragment } from '@stigg/api-client-js/src/generated/sdk';
|
|
2
|
-
import { BooleanEntitlement, ApplySubscriptionResults, Coupon, Customer, CustomerPortal, CustomerResource, GetCheckoutStateResults, EnumEntitlement, MeteredEntitlement, Money, NumericEntitlement, Paywall, Plan, Subscription, SubscriptionPreview, SubscriptionPreviewDiscount, UsageHistoryPoint, SubscriptionPreviewV2, SubscriptionPreviewInvoice, SlimCustomer, SubscriptionPreviewCredits, CreditEntitlement } from '../models';
|
|
3
|
-
import CachedEntitlement, { CachedCreditEntitlement } from '../services/cachedEntitlement';
|
|
4
|
-
import { Decision } from '../services/entitlementDecisionService';
|
|
5
|
-
export declare class ModelMapper {
|
|
6
|
-
mapBooleanEntitlement(entitlement: CachedEntitlement, decision: Decision): BooleanEntitlement;
|
|
7
|
-
mapNumericEntitlement(entitlement: CachedEntitlement, decision: Decision): NumericEntitlement;
|
|
8
|
-
mapMeteredEntitlement(entitlement: CachedEntitlement, decision: Decision, requestedUsage?: number): MeteredEntitlement;
|
|
9
|
-
mapEnumEntitlement(entitlement: CachedEntitlement, decision: Decision, requestedValues?: string[]): EnumEntitlement;
|
|
10
|
-
mapEntitlement(entitlement: CachedEntitlement, decision: Decision, requestedUsage?: number): BooleanEntitlement;
|
|
11
|
-
mapCachedEntitlement(entitlement: FeatureEntitlementFragment): CachedEntitlement;
|
|
12
|
-
mapPlans(resultData: GetPaywallQuery): Plan[];
|
|
13
|
-
mapPaywall(resultData: GetPaywallQuery): Paywall;
|
|
14
|
-
mapMockPlans(resultData: GetMockPaywallQuery): Paywall;
|
|
15
|
-
mapCoupons(resultData: GetCouponsQuery): Coupon[];
|
|
16
|
-
mapResource(resource: CustomerResourceFragment): CustomerResource;
|
|
17
|
-
mapCustomerPortal(customerPortal: CustomerPortalFragment): CustomerPortal;
|
|
18
|
-
mapCheckoutState(checkoutState: CheckoutStateFragment): GetCheckoutStateResults;
|
|
19
|
-
mapApplySubscriptionResults: (graphApplySubscriptionResults: ApplySubscriptionMutation) => ApplySubscriptionResults;
|
|
20
|
-
mapCustomer(customer: CustomerFragment, subscriptions: SubscriptionFragment[]): Customer;
|
|
21
|
-
private mapPaymentDetails;
|
|
22
|
-
private mapPriceWithTotalPrice;
|
|
23
|
-
private mapPrice;
|
|
24
|
-
private mapPlan;
|
|
25
|
-
private mapCompatibleAddons;
|
|
26
|
-
private mapDefaultTrialConfig;
|
|
27
|
-
private mapPackageEntitlement;
|
|
28
|
-
private mapPromotionalEntitlement;
|
|
29
|
-
mapSlimCustomer: (customer: SlimCustomerFragment) => SlimCustomer;
|
|
30
|
-
mapSubscription(subscription: SubscriptionFragment): Subscription;
|
|
31
|
-
private mapLatestInvoice;
|
|
32
|
-
private mapDate;
|
|
33
|
-
private mapAddon;
|
|
34
|
-
mapTaxFields(fragment: SubscriptionPreviewFragment | SubscriptionPreviewFragment['subscription'] | SubscriptionPreviewInvoiceFragment | ImmediateSubscriptionPreviewInvoiceFragment): Pick<SubscriptionPreview, 'tax' | 'taxDetails'>;
|
|
35
|
-
mapSubscriptionPreview(fragment: SubscriptionPreviewFragment): SubscriptionPreview;
|
|
36
|
-
mapCredits(fragment: NonNullable<SubscriptionPreviewFragment['credits']>): SubscriptionPreviewCredits;
|
|
37
|
-
mapSubscriptionPreviewV2(fragment: SubscriptionPreviewV2Fragment): SubscriptionPreviewV2;
|
|
38
|
-
mapSubscriptionPreviewInvoice(fragment: SubscriptionPreviewInvoiceFragment | ImmediateSubscriptionPreviewInvoiceFragment): SubscriptionPreviewInvoice;
|
|
39
|
-
mapDiscount(discount: NonNullable<SubscriptionPreviewFragment['discount']>): SubscriptionPreviewDiscount;
|
|
40
|
-
mapMoney(fragment: {
|
|
41
|
-
amount: number;
|
|
42
|
-
currency: string;
|
|
43
|
-
}): Money;
|
|
44
|
-
private mapCoupon;
|
|
45
|
-
mapSubscriptions(activeSubscriptions: Array<{
|
|
46
|
-
__typename?: 'CustomerSubscription';
|
|
47
|
-
} & SubscriptionFragment>): Subscription[];
|
|
48
|
-
mapUsageHistory(usageHistory: UsageHistoryFragment): UsageHistoryPoint[];
|
|
49
|
-
private getPriceCurrency;
|
|
50
|
-
private mapCompatiblePackageGroups;
|
|
51
|
-
private mapDependencyAddon;
|
|
52
|
-
mapCachedCreditEntitlement(creditEntitlement: CreditEntitlementFragment): CachedCreditEntitlement;
|
|
53
|
-
mapCachedEntitlements(entitlements: EntitlementUnionFragment[]): {
|
|
54
|
-
featureEntitlements: Map<string, CachedEntitlement>;
|
|
55
|
-
creditEntitlements: Map<string, CachedCreditEntitlement>;
|
|
56
|
-
};
|
|
57
|
-
mapCreditEntitlement(cachedCreditEntitlement: CachedCreditEntitlement, decision: Decision): CreditEntitlement;
|
|
58
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const mapDate: (date?: string | number | null | undefined) => Date | undefined;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { AccessDeniedReason, EntitlementsFallback } from '../models';
|
|
2
|
-
export declare function mapGetEntitlementsFallback(entitlementsFallback?: EntitlementsFallback): ({
|
|
3
|
-
hasAccess: boolean;
|
|
4
|
-
isFallback: boolean;
|
|
5
|
-
accessDeniedReason: AccessDeniedReason;
|
|
6
|
-
feature: {
|
|
7
|
-
id: string;
|
|
8
|
-
};
|
|
9
|
-
} | {
|
|
10
|
-
hasAccess: boolean;
|
|
11
|
-
value?: number | undefined;
|
|
12
|
-
isUnlimited?: boolean | undefined;
|
|
13
|
-
isFallback: boolean;
|
|
14
|
-
accessDeniedReason: AccessDeniedReason;
|
|
15
|
-
feature: {
|
|
16
|
-
id: string;
|
|
17
|
-
};
|
|
18
|
-
} | {
|
|
19
|
-
hasAccess: boolean;
|
|
20
|
-
usageLimit?: number | undefined;
|
|
21
|
-
isUnlimited?: boolean | undefined;
|
|
22
|
-
isFallback: boolean;
|
|
23
|
-
accessDeniedReason: AccessDeniedReason;
|
|
24
|
-
feature: {
|
|
25
|
-
id: string;
|
|
26
|
-
};
|
|
27
|
-
} | {
|
|
28
|
-
hasAccess: boolean;
|
|
29
|
-
enumValues?: string[] | undefined;
|
|
30
|
-
isFallback: boolean;
|
|
31
|
-
accessDeniedReason: AccessDeniedReason;
|
|
32
|
-
feature: {
|
|
33
|
-
id: string;
|
|
34
|
-
};
|
|
35
|
-
})[];
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ClientConfiguration } from '../configuration';
|
|
2
|
-
import { LoggerService } from '../services/loggerService';
|
|
3
|
-
declare type WithErrorHandlingProps = {
|
|
4
|
-
loggerService: LoggerService;
|
|
5
|
-
sdkConfiguration?: Required<ClientConfiguration>;
|
|
6
|
-
errorMessage?: (err: any) => string;
|
|
7
|
-
errorReportMetadata?: object;
|
|
8
|
-
rethrowError: boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare function withErrorHandlingAsync<T>(func: () => Promise<T>, params: WithErrorHandlingProps & {
|
|
11
|
-
rethrowError: true;
|
|
12
|
-
}): Promise<T>;
|
|
13
|
-
export declare function withErrorHandlingAsync<T>(func: () => Promise<T>, params: WithErrorHandlingProps & {
|
|
14
|
-
rethrowError: false;
|
|
15
|
-
}): Promise<T | undefined>;
|
|
16
|
-
declare type NotPromise<T> = T extends Promise<unknown> ? never : T;
|
|
17
|
-
export declare function withErrorHandling<T>(func: () => NotPromise<T>, params: WithErrorHandlingProps & {
|
|
18
|
-
rethrowError: true;
|
|
19
|
-
}): T;
|
|
20
|
-
export declare function withErrorHandling<T>(func: () => NotPromise<T>, params: WithErrorHandlingProps & {
|
|
21
|
-
rethrowError: false;
|
|
22
|
-
}): T | undefined;
|
|
23
|
-
export {};
|