@stigg/js-client-sdk 0.48.0 → 0.49.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/CustomersApi.d.ts +2 -1
- package/dist/api/EntitlementsApi.d.ts +2 -0
- package/dist/api/generated/types.d.ts +145 -25
- package/dist/client.d.ts +8 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +15 -1
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
2
|
-
import { GetCustomerByRefIdQuery } from './generated/types';
|
|
2
|
+
import { GetCustomerByRefIdQuery, GetCustomerPortalByRefIdQuery } from './generated/types';
|
|
3
3
|
declare class CustomersApi {
|
|
4
4
|
private readonly client;
|
|
5
5
|
constructor(client: ApolloClient<NormalizedCacheObject>);
|
|
6
6
|
getCustomer(customerId: string): Promise<import("@apollo/client/core").ApolloQueryResult<GetCustomerByRefIdQuery>>;
|
|
7
|
+
getCustomerPortal(customerId: string): Promise<import("@apollo/client/core").ApolloQueryResult<GetCustomerPortalByRefIdQuery>>;
|
|
7
8
|
}
|
|
8
9
|
export default CustomersApi;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
2
2
|
import { GetEntitlementsQuery, EntitlementCheckResult } from './generated/types';
|
|
3
|
+
export declare const RESET_PERIOD_CONFIGURATION_FRAGMENT: import("graphql/language/ast").DocumentNode;
|
|
4
|
+
export declare const FEATURE_FRAGMENT: import("graphql/language/ast").DocumentNode;
|
|
3
5
|
declare class EntitlementsApi {
|
|
4
6
|
private readonly client;
|
|
5
7
|
constructor(client: ApolloClient<NormalizedCacheObject>);
|
|
@@ -448,6 +448,9 @@ export declare type CustomerInput = {
|
|
|
448
448
|
refId?: InputMaybe<Scalars['String']>;
|
|
449
449
|
shouldSyncFree?: InputMaybe<Scalars['Boolean']>;
|
|
450
450
|
};
|
|
451
|
+
export declare type CustomerPortalInput = {
|
|
452
|
+
customerId: Scalars['String'];
|
|
453
|
+
};
|
|
451
454
|
export declare type CustomerSort = {
|
|
452
455
|
direction: SortDirection;
|
|
453
456
|
field: CustomerSortFields;
|
|
@@ -2573,6 +2576,114 @@ export declare type CustomerFragment = {
|
|
|
2573
2576
|
__typename?: 'CustomerSubscription';
|
|
2574
2577
|
} & SubscriptionFragment> | null | undefined;
|
|
2575
2578
|
};
|
|
2579
|
+
export declare type CustomerPortalEntitlementFragment = {
|
|
2580
|
+
__typename?: 'Entitlement';
|
|
2581
|
+
isGranted: boolean;
|
|
2582
|
+
usageLimit?: number | null | undefined;
|
|
2583
|
+
currentUsage?: number | null | undefined;
|
|
2584
|
+
hasUnlimitedUsage: boolean;
|
|
2585
|
+
nextResetDate?: any | null | undefined;
|
|
2586
|
+
resetPeriod?: EntitlementResetPeriod | null | undefined;
|
|
2587
|
+
resetPeriodConfiguration?: ({
|
|
2588
|
+
__typename?: 'MonthlyResetPeriodConfig';
|
|
2589
|
+
} & ResetPeriodConfigurationFragment_MonthlyResetPeriodConfig_) | ({
|
|
2590
|
+
__typename?: 'WeeklyResetPeriodConfig';
|
|
2591
|
+
} & ResetPeriodConfigurationFragment_WeeklyResetPeriodConfig_) | null | undefined;
|
|
2592
|
+
feature?: ({
|
|
2593
|
+
__typename?: 'EntitlementFeature';
|
|
2594
|
+
} & FeatureFragment) | null | undefined;
|
|
2595
|
+
};
|
|
2596
|
+
export declare type CustomerPortalPromotionalEntitlementFragment = {
|
|
2597
|
+
__typename?: 'CustomerPortalPromotionalEntitlement';
|
|
2598
|
+
displayName: string;
|
|
2599
|
+
hasUnlimitedUsage?: boolean | null | undefined;
|
|
2600
|
+
usageLimit?: number | null | undefined;
|
|
2601
|
+
period: PromotionalEntitlementPeriod;
|
|
2602
|
+
startDate: any;
|
|
2603
|
+
endDate?: any | null | undefined;
|
|
2604
|
+
};
|
|
2605
|
+
export declare type CustomerPortalSubscriptionAddonFragment = {
|
|
2606
|
+
__typename?: 'CustomerPortalAddon';
|
|
2607
|
+
addonId: string;
|
|
2608
|
+
description?: string | null | undefined;
|
|
2609
|
+
displayName: string;
|
|
2610
|
+
quantity: number;
|
|
2611
|
+
};
|
|
2612
|
+
export declare type CustomerPortalBillingInformationFragment = {
|
|
2613
|
+
__typename?: 'CustomerPortalBillingInformation';
|
|
2614
|
+
email?: string | null | undefined;
|
|
2615
|
+
name?: string | null | undefined;
|
|
2616
|
+
defaultPaymentMethodLast4Digits?: string | null | undefined;
|
|
2617
|
+
defaultPaymentMethodId?: string | null | undefined;
|
|
2618
|
+
defaultPaymentExpirationMonth?: number | null | undefined;
|
|
2619
|
+
defaultPaymentExpirationYear?: number | null | undefined;
|
|
2620
|
+
};
|
|
2621
|
+
export declare type CustomerPortalSubscriptionFragment = {
|
|
2622
|
+
__typename?: 'CustomerPortalSubscription';
|
|
2623
|
+
subscriptionId: string;
|
|
2624
|
+
planName: string;
|
|
2625
|
+
status: SubscriptionStatus;
|
|
2626
|
+
trialRemainingDays?: number | null | undefined;
|
|
2627
|
+
pricing: {
|
|
2628
|
+
__typename?: 'CustomerPortalSubscriptionPricing';
|
|
2629
|
+
unitQuantity?: number | null | undefined;
|
|
2630
|
+
billingPeriod?: BillingPeriod | null | undefined;
|
|
2631
|
+
billingModel?: BillingModel | null | undefined;
|
|
2632
|
+
pricingType: PricingType;
|
|
2633
|
+
usageBasedEstimatedBill?: number | null | undefined;
|
|
2634
|
+
price?: {
|
|
2635
|
+
__typename?: 'Money';
|
|
2636
|
+
amount: number;
|
|
2637
|
+
} | null | undefined;
|
|
2638
|
+
feature?: {
|
|
2639
|
+
__typename?: 'CustomerPortalPricingFeature';
|
|
2640
|
+
featureUnits?: string | null | undefined;
|
|
2641
|
+
featureUnitsPlural?: string | null | undefined;
|
|
2642
|
+
displayName: string;
|
|
2643
|
+
} | null | undefined;
|
|
2644
|
+
};
|
|
2645
|
+
billingPeriodRange?: {
|
|
2646
|
+
__typename?: 'DateRange';
|
|
2647
|
+
start?: any | null | undefined;
|
|
2648
|
+
end?: any | null | undefined;
|
|
2649
|
+
} | null | undefined;
|
|
2650
|
+
totalPrice?: {
|
|
2651
|
+
__typename?: 'CustomerSubscriptionTotalPrice';
|
|
2652
|
+
subTotal: {
|
|
2653
|
+
__typename?: 'Money';
|
|
2654
|
+
amount: number;
|
|
2655
|
+
};
|
|
2656
|
+
total: {
|
|
2657
|
+
__typename?: 'Money';
|
|
2658
|
+
amount: number;
|
|
2659
|
+
};
|
|
2660
|
+
addonsTotal: {
|
|
2661
|
+
__typename?: 'Money';
|
|
2662
|
+
amount: number;
|
|
2663
|
+
};
|
|
2664
|
+
} | null | undefined;
|
|
2665
|
+
addons: Array<{
|
|
2666
|
+
__typename?: 'CustomerPortalAddon';
|
|
2667
|
+
} & CustomerPortalSubscriptionAddonFragment>;
|
|
2668
|
+
};
|
|
2669
|
+
export declare type CustomerPortalFragment = {
|
|
2670
|
+
__typename?: 'CustomerPortal';
|
|
2671
|
+
showWatermark: boolean;
|
|
2672
|
+
billingPortalUrl?: string | null | undefined;
|
|
2673
|
+
canUpgradeSubscription: boolean;
|
|
2674
|
+
subscriptions: Array<{
|
|
2675
|
+
__typename?: 'CustomerPortalSubscription';
|
|
2676
|
+
} & CustomerPortalSubscriptionFragment>;
|
|
2677
|
+
entitlements: Array<{
|
|
2678
|
+
__typename?: 'Entitlement';
|
|
2679
|
+
} & CustomerPortalEntitlementFragment>;
|
|
2680
|
+
promotionalEntitlements: Array<{
|
|
2681
|
+
__typename?: 'CustomerPortalPromotionalEntitlement';
|
|
2682
|
+
} & CustomerPortalPromotionalEntitlementFragment>;
|
|
2683
|
+
billingInformation: {
|
|
2684
|
+
__typename?: 'CustomerPortalBillingInformation';
|
|
2685
|
+
} & CustomerPortalBillingInformationFragment;
|
|
2686
|
+
};
|
|
2576
2687
|
export declare type GetCustomerByRefIdQueryVariables = Exact<{
|
|
2577
2688
|
filter?: Maybe<CustomerFilter>;
|
|
2578
2689
|
}>;
|
|
@@ -2588,6 +2699,40 @@ export declare type GetCustomerByRefIdQuery = {
|
|
|
2588
2699
|
}>;
|
|
2589
2700
|
};
|
|
2590
2701
|
};
|
|
2702
|
+
export declare type GetCustomerPortalByRefIdQueryVariables = Exact<{
|
|
2703
|
+
input: CustomerPortalInput;
|
|
2704
|
+
}>;
|
|
2705
|
+
export declare type GetCustomerPortalByRefIdQuery = {
|
|
2706
|
+
__typename?: 'Query';
|
|
2707
|
+
customerPortal: {
|
|
2708
|
+
__typename?: 'CustomerPortal';
|
|
2709
|
+
} & CustomerPortalFragment;
|
|
2710
|
+
};
|
|
2711
|
+
declare type ResetPeriodConfigurationFragment_MonthlyResetPeriodConfig_ = {
|
|
2712
|
+
__typename: 'MonthlyResetPeriodConfig';
|
|
2713
|
+
} & MonthlyResetPeriodConfigFragment;
|
|
2714
|
+
declare type ResetPeriodConfigurationFragment_WeeklyResetPeriodConfig_ = {
|
|
2715
|
+
__typename: 'WeeklyResetPeriodConfig';
|
|
2716
|
+
} & WeeklyResetPeriodConfigFragment;
|
|
2717
|
+
export declare type ResetPeriodConfigurationFragment = ResetPeriodConfigurationFragment_MonthlyResetPeriodConfig_ | ResetPeriodConfigurationFragment_WeeklyResetPeriodConfig_;
|
|
2718
|
+
export declare type MonthlyResetPeriodConfigFragment = {
|
|
2719
|
+
__typename?: 'MonthlyResetPeriodConfig';
|
|
2720
|
+
monthlyAccordingTo?: MonthlyAccordingTo | null | undefined;
|
|
2721
|
+
};
|
|
2722
|
+
export declare type WeeklyResetPeriodConfigFragment = {
|
|
2723
|
+
__typename?: 'WeeklyResetPeriodConfig';
|
|
2724
|
+
weeklyAccordingTo?: WeeklyAccordingTo | null | undefined;
|
|
2725
|
+
};
|
|
2726
|
+
export declare type FeatureFragment = {
|
|
2727
|
+
__typename?: 'EntitlementFeature';
|
|
2728
|
+
featureType: FeatureType;
|
|
2729
|
+
meterType?: MeterType | null | undefined;
|
|
2730
|
+
featureUnits?: string | null | undefined;
|
|
2731
|
+
featureUnitsPlural?: string | null | undefined;
|
|
2732
|
+
description?: string | null | undefined;
|
|
2733
|
+
displayName: string;
|
|
2734
|
+
refId: string;
|
|
2735
|
+
};
|
|
2591
2736
|
export declare type EntitlementFragment = {
|
|
2592
2737
|
__typename?: 'Entitlement';
|
|
2593
2738
|
isGranted: boolean;
|
|
@@ -2608,31 +2753,6 @@ export declare type EntitlementFragment = {
|
|
|
2608
2753
|
__typename?: 'EntitlementFeature';
|
|
2609
2754
|
} & FeatureFragment) | null | undefined;
|
|
2610
2755
|
};
|
|
2611
|
-
declare type ResetPeriodConfigurationFragment_MonthlyResetPeriodConfig_ = {
|
|
2612
|
-
__typename: 'MonthlyResetPeriodConfig';
|
|
2613
|
-
} & MonthlyResetPeriodConfigFragment;
|
|
2614
|
-
declare type ResetPeriodConfigurationFragment_WeeklyResetPeriodConfig_ = {
|
|
2615
|
-
__typename: 'WeeklyResetPeriodConfig';
|
|
2616
|
-
} & WeeklyResetPeriodConfigFragment;
|
|
2617
|
-
export declare type ResetPeriodConfigurationFragment = ResetPeriodConfigurationFragment_MonthlyResetPeriodConfig_ | ResetPeriodConfigurationFragment_WeeklyResetPeriodConfig_;
|
|
2618
|
-
export declare type FeatureFragment = {
|
|
2619
|
-
__typename?: 'EntitlementFeature';
|
|
2620
|
-
featureType: FeatureType;
|
|
2621
|
-
meterType?: MeterType | null | undefined;
|
|
2622
|
-
featureUnits?: string | null | undefined;
|
|
2623
|
-
featureUnitsPlural?: string | null | undefined;
|
|
2624
|
-
description?: string | null | undefined;
|
|
2625
|
-
displayName: string;
|
|
2626
|
-
refId: string;
|
|
2627
|
-
};
|
|
2628
|
-
export declare type MonthlyResetPeriodConfigFragment = {
|
|
2629
|
-
__typename?: 'MonthlyResetPeriodConfig';
|
|
2630
|
-
monthlyAccordingTo?: MonthlyAccordingTo | null | undefined;
|
|
2631
|
-
};
|
|
2632
|
-
export declare type WeeklyResetPeriodConfigFragment = {
|
|
2633
|
-
__typename?: 'WeeklyResetPeriodConfig';
|
|
2634
|
-
weeklyAccordingTo?: WeeklyAccordingTo | null | undefined;
|
|
2635
|
-
};
|
|
2636
2756
|
export declare type GetEntitlementsQueryVariables = Exact<{
|
|
2637
2757
|
query: FetchEntitlementsQuery;
|
|
2638
2758
|
}>;
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BooleanEntitlement, Coupon, Customer, Entitlement, GetBooleanEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetPaywall, MeteredEntitlement, NumericEntitlement, Plan, Subscription, WaitForCheckoutCompleted } from './models';
|
|
1
|
+
import { BooleanEntitlement, Coupon, Customer, Entitlement, GetBooleanEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetPaywall, MeteredEntitlement, NumericEntitlement, Plan, Subscription, WaitForCheckoutCompleted, CustomerPortal } from './models';
|
|
2
2
|
import { ClientConfiguration } from './configuration';
|
|
3
3
|
import { EventNames, Events } from './services/eventEmitter';
|
|
4
4
|
export interface StiggClient {
|
|
@@ -17,6 +17,7 @@ export interface StiggClient {
|
|
|
17
17
|
waitForInitialization(): Promise<StiggClient>;
|
|
18
18
|
addListener: <K extends EventNames>(eventName: K, callback: Events[K]) => void;
|
|
19
19
|
removeListener: <K extends EventNames>(eventName: K, callback: Events[K]) => void;
|
|
20
|
+
getCustomerPortal(): Promise<CustomerPortal>;
|
|
20
21
|
}
|
|
21
22
|
export declare class Stigg implements StiggClient {
|
|
22
23
|
private readonly apiGateway;
|
|
@@ -110,6 +111,12 @@ export declare class Stigg implements StiggClient {
|
|
|
110
111
|
* @returns {Promise<Customer>}
|
|
111
112
|
*/
|
|
112
113
|
getCustomer(): Promise<Customer>;
|
|
114
|
+
/**
|
|
115
|
+
* Get a customer portal
|
|
116
|
+
*
|
|
117
|
+
* @returns {Promise<CustomerPortal>}
|
|
118
|
+
*/
|
|
119
|
+
getCustomerPortal(): Promise<CustomerPortal>;
|
|
113
120
|
/**
|
|
114
121
|
* Get a list of entitlements
|
|
115
122
|
*
|