@stigg/js-client-sdk 0.24.0 → 0.26.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/EntitlementsApi.d.ts +2 -1
- package/dist/api/generated/types.d.ts +28 -2
- package/dist/api/initApolloClient.d.ts +1 -0
- package/dist/client.d.ts +1 -0
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/services/entitlementCheckReportingService.d.ts +10 -0
- package/dist/services/entitlementsService.d.ts +6 -4
- package/dist/services/loggerService.d.ts +2 -0
- package/dist/utils/ModelMapper.d.ts +9 -2
- package/package.json +1 -1
- package/dist/index.js.LICENSE.txt +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
2
|
-
import { GetEntitlementsQuery } from './generated/types';
|
|
2
|
+
import { GetEntitlementsQuery, EntitlementCheckResult } from './generated/types';
|
|
3
3
|
declare class EntitlementsApi {
|
|
4
4
|
private readonly client;
|
|
5
5
|
constructor(client: ApolloClient<NormalizedCacheObject>);
|
|
@@ -7,5 +7,6 @@ declare class EntitlementsApi {
|
|
|
7
7
|
pollEntitlements(customerId: string, interval: number): import("@apollo/client/core").ObservableQuery<GetEntitlementsQuery, import("./generated/types").Exact<{
|
|
8
8
|
query: import("./generated/types").FetchEntitlementsQuery;
|
|
9
9
|
}>>;
|
|
10
|
+
reportEntitlementRequested(featureId: string, customerId: string, entitlementCheckResult: EntitlementCheckResult, requestedUsage?: number): Promise<void>;
|
|
10
11
|
}
|
|
11
12
|
export default EntitlementsApi;
|
|
@@ -431,6 +431,25 @@ export declare type DiscardPackageDraftInput = {
|
|
|
431
431
|
environmentId: Scalars['String'];
|
|
432
432
|
refId: Scalars['String'];
|
|
433
433
|
};
|
|
434
|
+
export declare type EntitlementCheckRequested = {
|
|
435
|
+
customerId: Scalars['String'];
|
|
436
|
+
entitlementCheckResult: EntitlementCheckResult;
|
|
437
|
+
environmentId?: InputMaybe<Scalars['String']>;
|
|
438
|
+
featureId: Scalars['String'];
|
|
439
|
+
requestedUsage?: InputMaybe<Scalars['Float']>;
|
|
440
|
+
};
|
|
441
|
+
export declare type EntitlementCheckResult = {
|
|
442
|
+
accessDeniedReason?: InputMaybe<AccessDeniedReason>;
|
|
443
|
+
currentUsage?: InputMaybe<Scalars['Float']>;
|
|
444
|
+
hasAccess: Scalars['Boolean'];
|
|
445
|
+
hasUnlimitedUsage?: InputMaybe<Scalars['Boolean']>;
|
|
446
|
+
monthlyResetPeriodConfiguration?: InputMaybe<MonthlyResetPeriodConfigInput>;
|
|
447
|
+
nextResetDate?: InputMaybe<Scalars['DateTime']>;
|
|
448
|
+
requestedUsage?: InputMaybe<Scalars['Float']>;
|
|
449
|
+
resetPeriod?: InputMaybe<EntitlementResetPeriod>;
|
|
450
|
+
usageLimit?: InputMaybe<Scalars['Float']>;
|
|
451
|
+
weeklyResetPeriodConfiguration?: InputMaybe<WeeklyResetPeriodConfigInput>;
|
|
452
|
+
};
|
|
434
453
|
export declare type EntitlementOptions = {
|
|
435
454
|
requestedUsage?: InputMaybe<Scalars['Float']>;
|
|
436
455
|
shouldTrack?: InputMaybe<Scalars['Boolean']>;
|
|
@@ -1663,7 +1682,7 @@ export declare type GetCustomerByRefIdQuery = {
|
|
|
1663
1682
|
};
|
|
1664
1683
|
};
|
|
1665
1684
|
export declare type EntitlementFragment = {
|
|
1666
|
-
__typename?: '
|
|
1685
|
+
__typename?: 'Entitlement';
|
|
1667
1686
|
isGranted: boolean;
|
|
1668
1687
|
accessDeniedReason?: AccessDeniedReason | null | undefined;
|
|
1669
1688
|
customerId?: string | null | undefined;
|
|
@@ -1713,9 +1732,16 @@ export declare type GetEntitlementsQueryVariables = Exact<{
|
|
|
1713
1732
|
export declare type GetEntitlementsQuery = {
|
|
1714
1733
|
__typename?: 'Query';
|
|
1715
1734
|
entitlements: Array<{
|
|
1716
|
-
__typename?: '
|
|
1735
|
+
__typename?: 'Entitlement';
|
|
1717
1736
|
} & EntitlementFragment>;
|
|
1718
1737
|
};
|
|
1738
|
+
export declare type ReportEntitlementCheckRequestedMutationVariables = Exact<{
|
|
1739
|
+
entitlementCheckRequested: EntitlementCheckRequested;
|
|
1740
|
+
}>;
|
|
1741
|
+
export declare type ReportEntitlementCheckRequestedMutation = {
|
|
1742
|
+
__typename?: 'Mutation';
|
|
1743
|
+
reportEntitlementCheckRequested: boolean;
|
|
1744
|
+
};
|
|
1719
1745
|
export declare type PackageEntitlementFragment = {
|
|
1720
1746
|
__typename?: 'PackageEntitlement';
|
|
1721
1747
|
usageLimit?: number | null | undefined;
|
|
@@ -4,4 +4,5 @@ declare type ApolloClientConfiguration = {
|
|
|
4
4
|
baseUri: string;
|
|
5
5
|
};
|
|
6
6
|
declare const initApolloClient: ({ apiKey, baseUri }: Partial<ApolloClientConfiguration>) => ApolloClient<import("@apollo/client/core").NormalizedCacheObject>;
|
|
7
|
+
export declare const initBatchedApolloClient: ({ apiKey, baseUri }: ApolloClientConfiguration) => ApolloClient<import("@apollo/client/core").NormalizedCacheObject>;
|
|
7
8
|
export default initApolloClient;
|
package/dist/client.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface StiggClient {
|
|
|
13
13
|
export declare class Stigg implements StiggClient {
|
|
14
14
|
private readonly apiGateway;
|
|
15
15
|
private readonly graphClient;
|
|
16
|
+
private readonly batchedGraphClient;
|
|
16
17
|
private readonly configuration;
|
|
17
18
|
private readonly loggerService;
|
|
18
19
|
private entitlementsService;
|