@stigg/js-client-sdk 0.37.0 → 0.38.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 +12 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +4 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Customer, Entitlement,
|
|
1
|
+
import { BooleanEntitlement, Coupon, Customer, Entitlement, GetBooleanEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetPaywall, MeteredEntitlement, NumericEntitlement, Plan, Subscription, WaitForCheckoutCompleted } from './models';
|
|
2
2
|
import { ClientConfiguration } from './configuration';
|
|
3
3
|
export interface StiggClient {
|
|
4
4
|
getBooleanEntitlement: (params: GetBooleanEntitlement) => BooleanEntitlement;
|
|
@@ -9,6 +9,7 @@ export interface StiggClient {
|
|
|
9
9
|
getCustomer: () => Promise<Customer>;
|
|
10
10
|
getEntitlements: () => Promise<Entitlement[]>;
|
|
11
11
|
refresh: () => Promise<void>;
|
|
12
|
+
waitForCheckoutCompleted(params?: WaitForCheckoutCompleted): Promise<Subscription | null>;
|
|
12
13
|
}
|
|
13
14
|
export declare class Stigg implements StiggClient {
|
|
14
15
|
private readonly apiGateway;
|
|
@@ -78,5 +79,15 @@ export declare class Stigg implements StiggClient {
|
|
|
78
79
|
* @returns {Promise<Entitlement[]>}
|
|
79
80
|
*/
|
|
80
81
|
getEntitlements(): Promise<Entitlement[]>;
|
|
82
|
+
/**
|
|
83
|
+
* Waits for a subscription to be activated after a completed checkout.
|
|
84
|
+
* This method should be called on page load after the customer is redirected to the success URL.
|
|
85
|
+
* Returns the new subscription.
|
|
86
|
+
*
|
|
87
|
+
* @returns {Promise<Subscription | null>}
|
|
88
|
+
* @param timeoutMs
|
|
89
|
+
* @param refreshOnComplete should refresh entitlements if subscription was found
|
|
90
|
+
*/
|
|
91
|
+
waitForCheckoutCompleted({ timeoutMs, refreshOnComplete, }?: WaitForCheckoutCompleted): Promise<Subscription | null>;
|
|
81
92
|
private withErrorHandling;
|
|
82
93
|
}
|