@stigg/js-client-sdk 3.40.0 → 3.42.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/SubscriptionsApi.d.ts +6 -1
- package/dist/client.d.ts +3 -1
- package/dist/index.js +55 -3
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +17 -1
- package/dist/offlineClient.d.ts +2 -1
- package/dist/src/api/SubscriptionsApi.d.ts +6 -1
- package/dist/src/client.d.ts +3 -1
- package/dist/src/models.d.ts +17 -1
- package/dist/src/offlineClient.d.ts +2 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetCheckoutStateQuery, ApplySubscriptionMutation } from '@stigg/api-client-js/src/generated/sdk';
|
|
1
|
+
import { GetCheckoutStateQuery, ApplySubscriptionMutation, GetSubscriptionsQuery, SubscriptionStatus } from '@stigg/api-client-js/src/generated/sdk';
|
|
2
2
|
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
3
3
|
import { ApplySubscription, GetCheckoutState } from '../models';
|
|
4
4
|
export declare type ApplySubscriptionParams = ApplySubscription & {
|
|
@@ -11,6 +11,11 @@ declare class SubscriptionsApi {
|
|
|
11
11
|
private readonly client;
|
|
12
12
|
constructor(client: ApolloClient<NormalizedCacheObject>);
|
|
13
13
|
applySubscription({ customerId, payingCustomerId, planId, paymentMethodId, addons, billableFeatures, billingInformation, billingCountryCode, billingId, billingPeriod, metadata, promotionCode, resourceId, skipTrial, startDate, unitQuantity, scheduleStrategy, }: ApplySubscriptionParams): Promise<import("@apollo/client/core").FetchResult<ApplySubscriptionMutation, Record<string, any>, Record<string, any>>>;
|
|
14
|
+
getSubscriptions(customerId?: string, resourceId?: string | string[], status?: SubscriptionStatus | SubscriptionStatus[], productId?: string | string[], pagination?: {
|
|
15
|
+
limit?: number;
|
|
16
|
+
startingAfter?: string;
|
|
17
|
+
endingBefore?: string;
|
|
18
|
+
}): Promise<import("@apollo/client/core").ApolloQueryResult<GetSubscriptionsQuery>>;
|
|
14
19
|
checkoutState({ customerId, resourceId, planId, billingCountryCode }: GetCheckoutStateParams): Promise<import("@apollo/client/core").ApolloQueryResult<GetCheckoutStateQuery>>;
|
|
15
20
|
private mapBillingInformation;
|
|
16
21
|
}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { 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 } 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 } from './models';
|
|
4
4
|
import { EventNames, Events } from './services/eventEmitter';
|
|
5
5
|
import { LoggerService } from './services/loggerService';
|
|
6
6
|
export interface StiggClient {
|
|
@@ -19,6 +19,7 @@ export interface StiggClient {
|
|
|
19
19
|
getCustomer: () => Promise<Customer>;
|
|
20
20
|
getCheckoutState: (params: GetCheckoutState) => Promise<GetCheckoutStateResults>;
|
|
21
21
|
applySubscription: (params: ApplySubscription) => Promise<ApplySubscriptionResults>;
|
|
22
|
+
getSubscriptions(params: GetSubscriptionsParams): Promise<GetSubscriptionsResult>;
|
|
22
23
|
getActiveSubscriptions: (params?: GetActiveSubscriptions) => Promise<Subscription[]>;
|
|
23
24
|
getActiveSubscriptionsList(params?: GetActiveSubscriptions): Promise<SlimSubscriptionFragmentV2Fragment[]>;
|
|
24
25
|
getSubscription(params: GetSubscription): Promise<Subscription>;
|
|
@@ -217,6 +218,7 @@ export declare class Stigg implements StiggClient {
|
|
|
217
218
|
* @param refreshOnComplete should refresh entitlements if subscription was found
|
|
218
219
|
*/
|
|
219
220
|
waitForCheckoutCompleted({ timeoutMs, refreshOnComplete, }?: WaitForCheckoutCompleted): Promise<Subscription | null>;
|
|
221
|
+
getSubscriptions(params?: GetSubscriptionsParams): Promise<GetSubscriptionsResult>;
|
|
220
222
|
getActiveSubscriptions({ resourceId }?: GetActiveSubscriptions): Promise<Subscription[]>;
|
|
221
223
|
/**
|
|
222
224
|
* @description Get customer's active subscriptions, for extended subscription data use {@link getSubscription}
|