@stigg/js-client-sdk 3.17.1 → 3.19.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/client.d.ts +8 -1
- package/dist/index.js +58 -2
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +5 -1
- package/dist/src/api/CustomersApi.d.ts +2 -1
- package/dist/src/client.d.ts +8 -1
- package/dist/src/models.d.ts +5 -1
- package/dist/src/utils/ModelMapper.d.ts +1 -1
- package/dist/utils/ModelMapper.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
2
|
-
import { GetCustomerPortalByRefIdQuery, GetCustomerByIdQuery, GetActiveSubscriptionsQuery, GetUsageHistoryQuery } from '@stigg/api-client-js/src/generated/sdk';
|
|
2
|
+
import { GetCustomerPortalByRefIdQuery, GetCustomerByIdQuery, GetActiveSubscriptionsQuery, GetSubscriptionQuery, GetUsageHistoryQuery } from '@stigg/api-client-js/src/generated/sdk';
|
|
3
3
|
import { FetchUsageHistory } from '../models';
|
|
4
4
|
declare class CustomersApi {
|
|
5
5
|
private readonly client;
|
|
6
6
|
constructor(client: ApolloClient<NormalizedCacheObject>);
|
|
7
7
|
getCustomer(customerId: string): Promise<import("@apollo/client/core").ApolloQueryResult<GetCustomerByIdQuery>>;
|
|
8
8
|
getActiveSubscriptions(customerId: string, resourceId?: string | string[]): Promise<import("@apollo/client/core").ApolloQueryResult<GetActiveSubscriptionsQuery>>;
|
|
9
|
+
getSubscription(subscriptionId: string): Promise<import("@apollo/client/core").ApolloQueryResult<GetSubscriptionQuery>>;
|
|
9
10
|
getCustomerPortal(customerId: string, resourceId: string | undefined, productId: string | undefined): Promise<import("@apollo/client/core").ApolloQueryResult<GetCustomerPortalByRefIdQuery>>;
|
|
10
11
|
fetchUsageHistory({ customerId, resourceId, endDate, startDate, featureId }: FetchUsageHistory): Promise<import("@apollo/client/core").ApolloQueryResult<GetUsageHistoryQuery>>;
|
|
11
12
|
}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClientConfiguration } from './configuration';
|
|
2
|
-
import { BooleanEntitlement, Coupon, Customer, CustomerPortal, Entitlement, EstimateSubscription, EstimateSubscriptionUpdate, FetchUsageHistory, GetActiveSubscriptions, GetBooleanEntitlement, GetCheckoutStateResults, GetCheckoutState, GetCustomerPortal, GetMeteredEntitlement, GetNumericEntitlement, GetPaywall, MeteredEntitlement, NumericEntitlement, Paywall, Subscription, SubscriptionPreview, UsageHistoryPoint, WaitForCheckoutCompleted
|
|
2
|
+
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 } from './models';
|
|
3
3
|
import { EventNames, Events } from './services/eventEmitter';
|
|
4
4
|
export interface StiggClient {
|
|
5
5
|
isCustomerLoaded: boolean;
|
|
@@ -18,6 +18,7 @@ export interface StiggClient {
|
|
|
18
18
|
getCheckoutState: (params: GetCheckoutState) => Promise<GetCheckoutStateResults>;
|
|
19
19
|
applySubscription: (params: ApplySubscription) => Promise<ApplySubscriptionResults>;
|
|
20
20
|
getActiveSubscriptions: (params?: GetActiveSubscriptions) => Promise<Subscription[]>;
|
|
21
|
+
getSubscription(params: GetSubscription): Promise<Subscription>;
|
|
21
22
|
getCoupons(): Promise<Coupon[]>;
|
|
22
23
|
getEntitlements: (resourceId?: string) => Promise<Entitlement[]>;
|
|
23
24
|
refresh: () => Promise<void>;
|
|
@@ -202,4 +203,10 @@ export declare class Stigg implements StiggClient {
|
|
|
202
203
|
*/
|
|
203
204
|
waitForCheckoutCompleted({ timeoutMs, refreshOnComplete, }?: WaitForCheckoutCompleted): Promise<Subscription | null>;
|
|
204
205
|
getActiveSubscriptions({ resourceId }?: GetActiveSubscriptions): Promise<Subscription[]>;
|
|
206
|
+
/**
|
|
207
|
+
* Get subscription
|
|
208
|
+
* @return {Promise<Subscription>} the subscription data
|
|
209
|
+
* @param subscriptionId - subscription id
|
|
210
|
+
*/
|
|
211
|
+
getSubscription({ subscriptionId }: GetSubscription): Promise<Subscription>;
|
|
205
212
|
}
|