@lifeready/core 1.1.19 → 1.1.21
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/bundles/lifeready-core.umd.js +5779 -5540
- package/bundles/lifeready-core.umd.js.map +1 -1
- package/bundles/lifeready-core.umd.min.js +1 -1
- package/bundles/lifeready-core.umd.min.js.map +1 -1
- package/esm2015/lib/_common/utils.js +27 -3
- package/esm2015/lib/api/types/lr-graphql.types.js +8 -1
- package/esm2015/lib/auth/auth.config.js +1 -1
- package/esm2015/lib/auth/life-ready-auth.service.js +78 -14
- package/esm2015/lib/file-upload/file-upload.service.js +12 -22
- package/esm2015/lib/idle/idle.service.js +8 -12
- package/esm2015/lib/key/key.service.js +4 -4
- package/esm2015/lib/lbop/lbop.service.js +4 -4
- package/esm2015/lib/life-ready.config.js +8 -12
- package/esm2015/lib/life-ready.module.js +5 -5
- package/esm2015/lib/password/password.service.js +9 -13
- package/esm2015/lib/plan2/plan2.gql.js +73 -0
- package/esm2015/lib/plan2/plan2.service.js +156 -0
- package/esm2015/lib/plan2/plan2.types.js +2 -0
- package/esm2015/lib/profile/profile.service.js +4 -4
- package/esm2015/lib/register/register.service.js +4 -4
- package/esm2015/lib/time/time.service.js +4 -17
- package/esm2015/lib/tp-password-reset/tp-password-reset-user.service.js +4 -4
- package/esm2015/public-api.js +3 -1
- package/fesm2015/lifeready-core.js +4972 -4697
- package/fesm2015/lifeready-core.js.map +1 -1
- package/lib/_common/utils.d.ts +10 -0
- package/lib/api/types/lr-graphql.types.d.ts +77 -1
- package/lib/auth/auth.config.d.ts +2 -2
- package/lib/auth/life-ready-auth.service.d.ts +13 -6
- package/lib/file-upload/file-upload.service.d.ts +4 -4
- package/lib/idle/idle.service.d.ts +2 -2
- package/lib/key/key.service.d.ts +2 -2
- package/lib/lbop/lbop.service.d.ts +2 -2
- package/lib/life-ready.config.d.ts +6 -3
- package/lib/life-ready.module.d.ts +2 -2
- package/lib/password/password.service.d.ts +6 -3
- package/lib/plan2/plan2.gql.d.ts +51 -0
- package/lib/plan2/plan2.service.d.ts +88 -0
- package/lib/plan2/plan2.types.d.ts +11 -0
- package/lib/profile/profile.service.d.ts +2 -2
- package/lib/register/register.service.d.ts +2 -2
- package/lib/time/time.service.d.ts +0 -1
- package/lib/tp-password-reset/tp-password-reset-user.service.d.ts +2 -2
- package/lifeready-core.metadata.json +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
package/lib/_common/utils.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AuthClass } from '@aws-amplify/auth/lib-esm/Auth';
|
|
2
|
+
import { KcConfig } from '../life-ready.config';
|
|
1
3
|
export declare function promiseAllMayAsync(values: any[]): Promise<any> | any;
|
|
2
4
|
export declare function mapValuesMayAsync(obj: Record<string, any>, callback: (value: any, key: string, obj: Record<string, any>) => any | Promise<any>): Promise<any> | any;
|
|
3
5
|
export declare function mapValuesAsync(obj: Record<string, any>, callback?: (value: any, key: string, obj: Record<string, any>) => any | Promise<any>): Promise<any>;
|
|
@@ -7,3 +9,11 @@ export declare function mapValuesAsync(obj: Record<string, any>, callback?: (val
|
|
|
7
9
|
* @param defaultValue The value to return if value is undefined.
|
|
8
10
|
*/
|
|
9
11
|
export declare function undefinedDefault(value: any, defaultValue: any): any;
|
|
12
|
+
export declare function getAccessJwtToken(auth: AuthClass): Promise<string>;
|
|
13
|
+
export declare function httpOptions(auth: AuthClass, config: KcConfig): Promise<{
|
|
14
|
+
withCredentials: boolean;
|
|
15
|
+
headers: {
|
|
16
|
+
'x-kc-dev-user': string;
|
|
17
|
+
authorization: string;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
@@ -59,7 +59,11 @@ export interface UserNode extends Node {
|
|
|
59
59
|
userPlans?: Connection<UserPlanNode>;
|
|
60
60
|
userDelete?: UserDeleteNode;
|
|
61
61
|
features?: FeaturesNode;
|
|
62
|
-
|
|
62
|
+
featureState?: UserFeatureState;
|
|
63
|
+
sessionEncryptionKey?: string;
|
|
64
|
+
plans?: IssuedPlanNode[];
|
|
65
|
+
paymentMethods?: PaymentMethodNode[];
|
|
66
|
+
billingHistory?: BillingField[];
|
|
63
67
|
}
|
|
64
68
|
export interface UserFeatureState extends TimeStamped {
|
|
65
69
|
notificationsLastViewed?: DateTime;
|
|
@@ -615,3 +619,75 @@ export interface LockField {
|
|
|
615
619
|
export interface ServerConfig {
|
|
616
620
|
relayConnectionMaxLimit?: number;
|
|
617
621
|
}
|
|
622
|
+
export interface AvailablePlanField {
|
|
623
|
+
issuerUid?: string;
|
|
624
|
+
planUid?: string;
|
|
625
|
+
name?: string;
|
|
626
|
+
description?: string;
|
|
627
|
+
priceOptions?: PriceOptionField[];
|
|
628
|
+
trial?: TrialPeriodField;
|
|
629
|
+
}
|
|
630
|
+
export interface PriceOptionField {
|
|
631
|
+
priceId?: string;
|
|
632
|
+
name?: string;
|
|
633
|
+
description?: string;
|
|
634
|
+
amount?: number;
|
|
635
|
+
currency?: string;
|
|
636
|
+
intervalUnit?: string;
|
|
637
|
+
intervalCount?: number;
|
|
638
|
+
}
|
|
639
|
+
export interface TrialPeriodField {
|
|
640
|
+
years?: number;
|
|
641
|
+
months?: number;
|
|
642
|
+
weeks?: number;
|
|
643
|
+
days?: number;
|
|
644
|
+
}
|
|
645
|
+
export interface PaymentCaptureField {
|
|
646
|
+
stripeIntentId?: string;
|
|
647
|
+
stripeClientSecret?: string;
|
|
648
|
+
}
|
|
649
|
+
export interface PaymentMethodNode extends Node, TimeStamped {
|
|
650
|
+
card?: PaymentCardField;
|
|
651
|
+
invoice?: PaymentInvoiceField;
|
|
652
|
+
isDefault?: boolean;
|
|
653
|
+
}
|
|
654
|
+
export interface PaymentCardField {
|
|
655
|
+
brand?: string;
|
|
656
|
+
lastFourDigits?: string;
|
|
657
|
+
expiryYear?: number;
|
|
658
|
+
expiryMonth?: number;
|
|
659
|
+
}
|
|
660
|
+
export interface PaymentInvoiceField {
|
|
661
|
+
email?: string;
|
|
662
|
+
}
|
|
663
|
+
export interface PromotionalCodeField {
|
|
664
|
+
amountOff?: number;
|
|
665
|
+
currency?: string;
|
|
666
|
+
percentOff?: number;
|
|
667
|
+
name?: string;
|
|
668
|
+
}
|
|
669
|
+
export interface IssuedPlanNode extends Node, TimeStamped {
|
|
670
|
+
name: string;
|
|
671
|
+
description: string;
|
|
672
|
+
currentStates: IssuedPlanStateNode[];
|
|
673
|
+
currentPriceOption: PriceOptionField;
|
|
674
|
+
alternativePriceOptions: PriceOptionField[];
|
|
675
|
+
}
|
|
676
|
+
export interface IssuedPlanStateNode extends Node, TimeStamped {
|
|
677
|
+
periodStart?: DateTime;
|
|
678
|
+
periodEnd?: DateTime;
|
|
679
|
+
state?: PlanStateField;
|
|
680
|
+
}
|
|
681
|
+
export declare enum PlanStateField {
|
|
682
|
+
TRIALLING = "TRIALLING",
|
|
683
|
+
ACTIVE = "ACTIVE",
|
|
684
|
+
CANCELLED = "CANCELLED",
|
|
685
|
+
EXPIRED = "EXPIRED"
|
|
686
|
+
}
|
|
687
|
+
export interface BillingField {
|
|
688
|
+
invoiceNumber?: string;
|
|
689
|
+
total?: number;
|
|
690
|
+
currency?: string;
|
|
691
|
+
documentUrl?: string;
|
|
692
|
+
status?: string;
|
|
693
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuthClass } from '@aws-amplify/auth/lib-esm/Auth';
|
|
2
|
-
import {
|
|
2
|
+
import { KcConfig } from '../life-ready.config';
|
|
3
3
|
export declare function handleCognitoCallback<T>(method: (callback: (err?: Error, result?: T) => void) => void): Promise<T>;
|
|
4
4
|
export declare const awsFetch: (authUrl: string) => (url: any, options: any) => Promise<Response>;
|
|
5
|
-
export declare const configureAmplifyAuth: ({ authUrl: authUrl, userPoolId, userPoolWebClientId }:
|
|
5
|
+
export declare const configureAmplifyAuth: ({ authUrl: authUrl, userPoolId, userPoolWebClientId }: KcConfig, auth: AuthClass) => () => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
1
2
|
import { AuthClass } from '@aws-amplify/auth/lib-esm/Auth';
|
|
2
3
|
import { ReplaySubject } from 'rxjs';
|
|
3
4
|
import { LrGraphQLService } from '../api/lr-graphql';
|
|
@@ -7,7 +8,7 @@ import { IdleService } from '../idle/idle.service';
|
|
|
7
8
|
import { KeyFactoryService } from '../key/key-factory.service';
|
|
8
9
|
import { KeyGraphService } from '../key/key-graph.service';
|
|
9
10
|
import { KeyService } from '../key/key.service';
|
|
10
|
-
import {
|
|
11
|
+
import { KcConfig } from '../life-ready.config';
|
|
11
12
|
import { PasswordService } from '../password/password.service';
|
|
12
13
|
import { PersistService } from '../persist/persist.service';
|
|
13
14
|
import { ProfileService } from '../profile/profile.service';
|
|
@@ -18,7 +19,6 @@ export interface LoginOptions {
|
|
|
18
19
|
tpPasswordResetAutoComplete?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export declare type LogoutListener = () => void | Promise<void>;
|
|
21
|
-
export declare function getAccessJwtToken(auth: AuthClass): Promise<string>;
|
|
22
22
|
export declare class LifeReadyAuthService {
|
|
23
23
|
private config;
|
|
24
24
|
private auth;
|
|
@@ -33,20 +33,27 @@ export declare class LifeReadyAuthService {
|
|
|
33
33
|
private persistService;
|
|
34
34
|
private encryptionService;
|
|
35
35
|
private assemblyController;
|
|
36
|
+
private http;
|
|
36
37
|
private hubSubject;
|
|
37
38
|
private currentUser;
|
|
38
39
|
private currentResetUser;
|
|
39
40
|
private logoutListeners;
|
|
40
|
-
constructor(config:
|
|
41
|
+
constructor(config: KcConfig, auth: AuthClass, keyFactory: KeyFactoryService, keyService: KeyService, profileService: ProfileService, keyGraphService: KeyGraphService, passwordService: PasswordService, idleService: IdleService, lrGraphQL: LrGraphQLService, tpPasswordResetProcessorService: TpPasswordResetProcessorService, persistService: PersistService, encryptionService: EncryptionService, assemblyController: TpPasswordResetAssemblyController, http: HttpClient);
|
|
41
42
|
initialise(): Promise<void>;
|
|
43
|
+
debugLogin(username: string, password: CryptoKey): Promise<CurrentUser>;
|
|
44
|
+
/**
|
|
45
|
+
* Login using the server side session method.
|
|
46
|
+
*/
|
|
47
|
+
private debugLoginUsingSession;
|
|
48
|
+
private debugLoadUser;
|
|
42
49
|
getAccessJwtToken(): Promise<string>;
|
|
43
50
|
importPassword(plainPassword: string): Promise<CryptoKey>;
|
|
44
51
|
addLogoutListener(callback: LogoutListener): void;
|
|
45
52
|
removeLogoutListener(callback: LogoutListener): void;
|
|
46
53
|
private loginIdpImpl;
|
|
47
54
|
private loginIdp;
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
private handleSessionEncryptionKey;
|
|
56
|
+
private handlePostAuth;
|
|
50
57
|
login(emailOrPhone: string, password: CryptoKey, { tpPasswordResetAutoComplete }?: LoginOptions): Promise<LoginResult>;
|
|
51
58
|
loginImpl(emailOrPhone: string, password: CryptoKey): Promise<LoginResult>;
|
|
52
59
|
verifyLogin(challenge: CognitoChallengeUser, password: CryptoKey, rememberMe: boolean, code: string): Promise<CurrentUser>;
|
|
@@ -59,7 +66,7 @@ export declare class LifeReadyAuthService {
|
|
|
59
66
|
watchAuth(): ReplaySubject<any>;
|
|
60
67
|
logout(): Promise<void>;
|
|
61
68
|
private getUserAttribute;
|
|
62
|
-
loadResetUser
|
|
69
|
+
private loadResetUser;
|
|
63
70
|
refreshAccessToken(): Promise<unknown>;
|
|
64
71
|
completeRequest(newPassword: CryptoKey): Promise<void>;
|
|
65
72
|
private recoverAssemblyKey;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { AuthClass } from '@aws-amplify/auth/lib-esm/Auth';
|
|
2
3
|
import { JSONObject } from '../api/types';
|
|
3
|
-
import {
|
|
4
|
-
import { LifeReadyConfig } from '../life-ready.config';
|
|
4
|
+
import { KcConfig } from '../life-ready.config';
|
|
5
5
|
import { UploadEncryptedFileOptions } from './file-upload.types';
|
|
6
6
|
export declare class FileUploadService {
|
|
7
7
|
private config;
|
|
8
8
|
private http;
|
|
9
|
-
private
|
|
10
|
-
constructor(config:
|
|
9
|
+
private auth;
|
|
10
|
+
constructor(config: KcConfig, http: HttpClient, auth: AuthClass);
|
|
11
11
|
downloadEncryptedFile(fileStateNodeId: string): Promise<JSONObject>;
|
|
12
12
|
downloadEncryptedFile2(fileStateNodeId: string): Promise<string>;
|
|
13
13
|
loadFile(file: File): Promise<ArrayBuffer>;
|
|
@@ -4,7 +4,7 @@ import { Idle } from '@ng-idle/core';
|
|
|
4
4
|
import { Keepalive } from '@ng-idle/keepalive';
|
|
5
5
|
import { KeyService } from '../key/key.service';
|
|
6
6
|
import { Key } from '../key/key.types';
|
|
7
|
-
import {
|
|
7
|
+
import { KcConfig } from '../life-ready.config';
|
|
8
8
|
import { KeepaliveResult } from './idle.types';
|
|
9
9
|
export interface IdleServiceInit {
|
|
10
10
|
onTimeout?: (() => void) | (() => Promise<void>) | null;
|
|
@@ -25,7 +25,7 @@ export declare class IdleService {
|
|
|
25
25
|
private initCalled;
|
|
26
26
|
private onTimeout;
|
|
27
27
|
private onKeepalive;
|
|
28
|
-
constructor(config:
|
|
28
|
+
constructor(config: KcConfig, http: HttpClient, idle: Idle, keepalive: Keepalive, keyService: KeyService, auth: AuthClass);
|
|
29
29
|
private assertInit;
|
|
30
30
|
init(params?: IdleServiceInit): Promise<void>;
|
|
31
31
|
keepalivePost(): Promise<{
|
package/lib/key/key.service.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KcConfig } from '../life-ready.config';
|
|
2
2
|
import { PersistService } from '../persist/persist.service';
|
|
3
3
|
import { Key, PassKey } from './key.types';
|
|
4
4
|
export declare class UserKeys {
|
|
@@ -20,7 +20,7 @@ export declare class KeyService {
|
|
|
20
20
|
readonly DEFAULT_PASS_IDP_PBKDF_ITER = 100000;
|
|
21
21
|
readonly DEFAULT_PASS_KEY_PBKDF_ITER = 100000;
|
|
22
22
|
readonly DEFAULT_LBOP_KEY_PBKDF_ITER = 100000;
|
|
23
|
-
constructor(config:
|
|
23
|
+
constructor(config: KcConfig, persistService: PersistService);
|
|
24
24
|
resetKeys(): void;
|
|
25
25
|
purgeKeys(): void;
|
|
26
26
|
populateKeys(keys: UserKeys): void;
|
|
@@ -8,7 +8,7 @@ import { KeyFactoryService as KFS } from '../key/key-factory.service';
|
|
|
8
8
|
import { KeyGraphService } from '../key/key-graph.service';
|
|
9
9
|
import { KeyService } from '../key/key.service';
|
|
10
10
|
import { PassKeyParams } from '../key/key.types';
|
|
11
|
-
import {
|
|
11
|
+
import { KcConfig } from '../life-ready.config';
|
|
12
12
|
import { PasswordService } from '../password/password.service';
|
|
13
13
|
export interface SetPasswordParams {
|
|
14
14
|
lbopId: string;
|
|
@@ -84,7 +84,7 @@ export declare class LbopService {
|
|
|
84
84
|
private passwordService;
|
|
85
85
|
private readonly CLIENT_NONCE_LENGTH;
|
|
86
86
|
private readonly LBOP_WORDS;
|
|
87
|
-
constructor(config:
|
|
87
|
+
constructor(config: KcConfig, http: HttpClient, lrApollo: LrApolloService, auth: AuthClass, authService: LifeReadyAuthService, keyFactory: KFS, keyService: KeyService, encryptionService: EncryptionService, keyGraph: KeyGraphService, passwordService: PasswordService);
|
|
88
88
|
private getPartial;
|
|
89
89
|
remove(id: string): Promise<string>;
|
|
90
90
|
update({ id, name }: UpdateLbopParams): Promise<Lbop>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
2
|
import { ApolloClientOptions } from '@apollo/client/core';
|
|
3
3
|
import { AuthClass } from '@aws-amplify/auth/lib-esm/Auth';
|
|
4
|
-
export declare const
|
|
5
|
-
export interface
|
|
4
|
+
export declare const KC_CONFIG: InjectionToken<KcConfig>;
|
|
5
|
+
export interface KcConfig {
|
|
6
6
|
authUrl: string;
|
|
7
7
|
apiUrl: string;
|
|
8
8
|
apolloUrl: string;
|
|
@@ -10,5 +10,8 @@ export interface LifeReadyConfig {
|
|
|
10
10
|
userPoolWebClientId: string;
|
|
11
11
|
apolloConfig?: ApolloClientOptions<any>;
|
|
12
12
|
disableSessionEncryptionKey?: boolean;
|
|
13
|
+
debug?: {
|
|
14
|
+
username?: string;
|
|
15
|
+
};
|
|
13
16
|
}
|
|
14
|
-
export declare const configureApollo: (config:
|
|
17
|
+
export declare const configureApollo: (config: KcConfig, auth: AuthClass) => ApolloClientOptions<any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { KcConfig } from './life-ready.config';
|
|
3
3
|
export declare class LifeReadyModule {
|
|
4
|
-
static forRoot(config:
|
|
4
|
+
static forRoot(config: KcConfig): ModuleWithProviders<LifeReadyModule>;
|
|
5
5
|
}
|
|
@@ -6,7 +6,7 @@ import { PassKeyBundle } from '../auth/auth.types';
|
|
|
6
6
|
import { EncryptionService } from '../encryption/encryption.service';
|
|
7
7
|
import { KeyFactoryService as KFS } from '../key/key-factory.service';
|
|
8
8
|
import { KeyGraphService } from '../key/key-graph.service';
|
|
9
|
-
import {
|
|
9
|
+
import { KcConfig } from '../life-ready.config';
|
|
10
10
|
import { ProfileService } from '../profile/profile.service';
|
|
11
11
|
import { WebCryptoService } from '../web-crypto/web-crypto.service';
|
|
12
12
|
import { LrApolloService } from './../api/lr-apollo.service';
|
|
@@ -31,7 +31,7 @@ export declare class PasswordService {
|
|
|
31
31
|
private keyGraph;
|
|
32
32
|
private webCryptoService;
|
|
33
33
|
private readonly CLIENT_NONCE_LENGTH;
|
|
34
|
-
constructor(config:
|
|
34
|
+
constructor(config: KcConfig, http: HttpClient, apollo: LrApolloService, auth: AuthClass, profileService: ProfileService, keyFactory: KFS, encryptionService: EncryptionService, keyGraph: KeyGraphService, webCryptoService: WebCryptoService);
|
|
35
35
|
checkPassword(plainPassword: string): Promise<PasswordCheck>;
|
|
36
36
|
getExposureCount(plainPassword: string): Promise<number>;
|
|
37
37
|
getPassIdpString(passIdp: JWK.Key): any;
|
|
@@ -64,7 +64,10 @@ export declare class PasswordService {
|
|
|
64
64
|
*/
|
|
65
65
|
isLoginRequired(): Promise<boolean>;
|
|
66
66
|
changePassword(password: CryptoKey, newPassword: CryptoKey): Promise<void>;
|
|
67
|
-
changePasswordComplete(
|
|
67
|
+
changePasswordComplete(options: {
|
|
68
|
+
useNewPassword: boolean;
|
|
69
|
+
token?: string;
|
|
70
|
+
}): Promise<Object>;
|
|
68
71
|
private getVerifierPrK;
|
|
69
72
|
private verifyPassword;
|
|
70
73
|
private changePasswordMutation;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ID, IssuedPlanNode, PaymentCaptureField, PaymentCardField, PaymentMethodNode } from '../api/types';
|
|
2
|
+
export interface InitiateStripePaymentMethodCaptureMutationResult {
|
|
3
|
+
initiateStripePaymentMethodCapture: {
|
|
4
|
+
paymentCapture: Required<PaymentCaptureField>;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export declare const InitiateStripePaymentMethodCaptureMutation: import("../_common/ast").TypedDocumentNode<InitiateStripePaymentMethodCaptureMutationResult>;
|
|
8
|
+
export interface CompleteStripePaymentMethodCaptureMutationResult {
|
|
9
|
+
completeStripePaymentMethodCapture: {
|
|
10
|
+
paymentMethod: Required<Omit<PaymentMethodNode, 'invoice'>> & {
|
|
11
|
+
card: Required<PaymentCardField>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare const CompleteStripePaymentMethodCaptureMutation: import("../_common/ast").TypedDocumentNode<CompleteStripePaymentMethodCaptureMutationResult>;
|
|
16
|
+
export interface RemovePaymentMethodMutationResult {
|
|
17
|
+
removePaymentMethod: {
|
|
18
|
+
id: ID;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare const RemovePaymentMethodMutation: import("../_common/ast").TypedDocumentNode<RemovePaymentMethodMutationResult>;
|
|
22
|
+
export interface SetDefaultPaymentMethodMutationResult {
|
|
23
|
+
setDefaultPaymentMethod: {
|
|
24
|
+
paymentMethod: {
|
|
25
|
+
id: ID;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export declare const SetDefaultPaymentMethodMutation: import("../_common/ast").TypedDocumentNode<SetDefaultPaymentMethodMutationResult>;
|
|
30
|
+
export interface RemoveDefaultPaymentMethodMutationResult {
|
|
31
|
+
removeDefaultPaymentMethod: {
|
|
32
|
+
paymentMethod: {
|
|
33
|
+
id: ID;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export declare const RemoveDefaultPaymentMethodMutation: import("../_common/ast").TypedDocumentNode<RemoveDefaultPaymentMethodMutationResult>;
|
|
38
|
+
export interface IssuePlanMutationResult {
|
|
39
|
+
issuePlan: {
|
|
40
|
+
plan: {
|
|
41
|
+
id: ID;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export declare const IssuePlanMutation: import("../_common/ast").TypedDocumentNode<IssuePlanMutationResult>;
|
|
46
|
+
export interface CancelPlanMutationResult {
|
|
47
|
+
cancelPlan: {
|
|
48
|
+
plan: Pick<IssuedPlanNode, 'id'>;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export declare const CancelPlanMutation: import("../_common/ast").TypedDocumentNode<CancelPlanMutationResult>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Injector, NgZone } from '@angular/core';
|
|
2
|
+
import { LrMutation, LrService } from '../api/lr-graphql';
|
|
3
|
+
import { LrRelayIdInput } from '../api/types';
|
|
4
|
+
import { CancelPlanOptions, IssuePlanOptions } from './plan2.types';
|
|
5
|
+
export declare class Plan2Service extends LrService {
|
|
6
|
+
private ngZone;
|
|
7
|
+
private injector;
|
|
8
|
+
constructor(ngZone: NgZone, injector: Injector);
|
|
9
|
+
initiateStripePaymentMethodCapture(): Promise<import("./plan2.gql").InitiateStripePaymentMethodCaptureMutationResult>;
|
|
10
|
+
/**
|
|
11
|
+
* Starts a stripe payment capture intent. On intent can only add one card.
|
|
12
|
+
* @returns Promise that resolves to a mutation
|
|
13
|
+
*/
|
|
14
|
+
initiateStripePaymentMethodCaptureMutation(): LrMutation<import("./plan2.gql").InitiateStripePaymentMethodCaptureMutationResult, {
|
|
15
|
+
input: {};
|
|
16
|
+
}>;
|
|
17
|
+
completeStripePaymentMethodCapture(stripeIntentId: string): Promise<import("./plan2.gql").CompleteStripePaymentMethodCaptureMutationResult>;
|
|
18
|
+
/**
|
|
19
|
+
* Completes the payment capture intent. Call this after calling stripe.confirmCardSetup.
|
|
20
|
+
*
|
|
21
|
+
* The return result of this mutation can be used to update the UI. Because this is a mutation
|
|
22
|
+
* we always get the most up to date data from the BD.
|
|
23
|
+
*
|
|
24
|
+
* @returns Promise that resolves to a mutation with the just created PaymentMethodNode
|
|
25
|
+
*/
|
|
26
|
+
completeStripePaymentMethodCaptureMutation(stripeIntentId: string): LrMutation<import("./plan2.gql").CompleteStripePaymentMethodCaptureMutationResult, {
|
|
27
|
+
input: {
|
|
28
|
+
stripeIntentId: string;
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
setDefaultPaymentMethod(paymentMethodId: LrRelayIdInput): Promise<import("./plan2.gql").SetDefaultPaymentMethodMutationResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Mutation that sets the default payment method for the current user.
|
|
34
|
+
*
|
|
35
|
+
* @param paymentMethodId The id from PaymentMethodNode
|
|
36
|
+
* @returns Promise that resolves to a mutation
|
|
37
|
+
*/
|
|
38
|
+
setDefaultPaymentMethodMutation(paymentMethodId: LrRelayIdInput): LrMutation<import("./plan2.gql").SetDefaultPaymentMethodMutationResult, {
|
|
39
|
+
input: {
|
|
40
|
+
paymentMethodId: string;
|
|
41
|
+
};
|
|
42
|
+
}>;
|
|
43
|
+
removeDefaultPaymentMethod(): Promise<import("./plan2.gql").RemoveDefaultPaymentMethodMutationResult>;
|
|
44
|
+
/**
|
|
45
|
+
* Mutation that removes a the default payment method
|
|
46
|
+
*
|
|
47
|
+
* @returns Promise that resolves to a mutation
|
|
48
|
+
*/
|
|
49
|
+
removeDefaultPaymentMethodMutation(): LrMutation<import("./plan2.gql").RemoveDefaultPaymentMethodMutationResult, {
|
|
50
|
+
input: {};
|
|
51
|
+
}>;
|
|
52
|
+
issuePlan(options: IssuePlanOptions): Promise<import("./plan2.gql").IssuePlanMutationResult>;
|
|
53
|
+
/**
|
|
54
|
+
* Mutation that issues a new plan for the current user.
|
|
55
|
+
*
|
|
56
|
+
* @param options.issuerUid The same issuerUid that is in the AvailablePlanField returned by queries such as availablePublicPlans
|
|
57
|
+
* @param options.planUid The same planUid that is in the AvailablePlanField returned by queries such as availablePublicPlans
|
|
58
|
+
* @param options.priceId The priceId from PriceOptionField, which is nested in side AvailablePlanField
|
|
59
|
+
* @param options.promotionalCode promotion code where applicable
|
|
60
|
+
* @returns Promise that resolves to a mutation
|
|
61
|
+
*/
|
|
62
|
+
issuePlanMutation(options: IssuePlanOptions): LrMutation<import("./plan2.gql").IssuePlanMutationResult, {
|
|
63
|
+
input: IssuePlanOptions;
|
|
64
|
+
}>;
|
|
65
|
+
removePaymentMethod(paymentMethodId: string): Promise<import("./plan2.gql").RemovePaymentMethodMutationResult>;
|
|
66
|
+
/**
|
|
67
|
+
* Mutation that removes a payment method for the current user
|
|
68
|
+
*
|
|
69
|
+
* @param paymentMethodId The id from PaymentMethodNode
|
|
70
|
+
* @returns Promise that resolves to a mutation
|
|
71
|
+
*/
|
|
72
|
+
removePaymentMethodMutation(paymentMethodId: LrRelayIdInput): LrMutation<import("./plan2.gql").RemovePaymentMethodMutationResult, {
|
|
73
|
+
input: {
|
|
74
|
+
paymentMethodId: string;
|
|
75
|
+
};
|
|
76
|
+
}>;
|
|
77
|
+
cancelPlan(options: CancelPlanOptions): Promise<import("./plan2.gql").CancelPlanMutationResult>;
|
|
78
|
+
/**
|
|
79
|
+
* Mutation that removes a payment method for the current user
|
|
80
|
+
*
|
|
81
|
+
* @param options.planId The id from IssuedPlanNode
|
|
82
|
+
* @param options.immediate If true, cancel plan effective immediately. Default false.
|
|
83
|
+
* @returns Promise that resolves to a mutation
|
|
84
|
+
*/
|
|
85
|
+
cancelPlanMutation(options: CancelPlanOptions): LrMutation<import("./plan2.gql").CancelPlanMutationResult, {
|
|
86
|
+
input: CancelPlanOptions;
|
|
87
|
+
}>;
|
|
88
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LrRelayIdInput } from '../api/types';
|
|
2
|
+
export interface IssuePlanOptions {
|
|
3
|
+
issuerUid: string;
|
|
4
|
+
planUid: string;
|
|
5
|
+
priceId: string;
|
|
6
|
+
promotionalCode?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CancelPlanOptions {
|
|
9
|
+
planId: LrRelayIdInput;
|
|
10
|
+
immediate?: boolean;
|
|
11
|
+
}
|
|
@@ -5,7 +5,7 @@ import { EncryptionService } from '../encryption/encryption.service';
|
|
|
5
5
|
import { KeyGraphService } from '../key/key-graph.service';
|
|
6
6
|
import { KeyMetaService } from '../key/key-meta.service';
|
|
7
7
|
import { KeyService } from '../key/key.service';
|
|
8
|
-
import {
|
|
8
|
+
import { KcConfig } from '../life-ready.config';
|
|
9
9
|
import { UserPlan } from '../plan/plan.types';
|
|
10
10
|
import { ApiContactCard, ApiCurrentUser, MainContactCard, MainContactCardFields, PassIdpApiResult } from './profile.types';
|
|
11
11
|
export declare class ProfileService {
|
|
@@ -16,7 +16,7 @@ export declare class ProfileService {
|
|
|
16
16
|
private keyMetaService;
|
|
17
17
|
private keyGraph;
|
|
18
18
|
private encryptionService;
|
|
19
|
-
constructor(config:
|
|
19
|
+
constructor(config: KcConfig, http: HttpClient, lrApollo: LrApolloService, keyService: KeyService, keyMetaService: KeyMetaService, keyGraph: KeyGraphService, encryptionService: EncryptionService);
|
|
20
20
|
getPassIdpParams(emailOrPhone: string): Promise<PassIdpApiResult>;
|
|
21
21
|
getCurrentUser(): Promise<{
|
|
22
22
|
currentUser: ApiCurrentUser;
|
|
@@ -3,7 +3,7 @@ import { AuthClass } from '@aws-amplify/auth/lib-esm/Auth';
|
|
|
3
3
|
import { RegisterResult } from '../auth/auth.types';
|
|
4
4
|
import { EncryptionService } from '../encryption/encryption.service';
|
|
5
5
|
import { KeyFactoryService } from '../key/key-factory.service';
|
|
6
|
-
import {
|
|
6
|
+
import { KcConfig } from '../life-ready.config';
|
|
7
7
|
import { PasswordService } from '../password/password.service';
|
|
8
8
|
export declare class RegisterService {
|
|
9
9
|
private config;
|
|
@@ -12,7 +12,7 @@ export declare class RegisterService {
|
|
|
12
12
|
private keyFactory;
|
|
13
13
|
private encryptionService;
|
|
14
14
|
private passwordService;
|
|
15
|
-
constructor(config:
|
|
15
|
+
constructor(config: KcConfig, auth: AuthClass, http: HttpClient, keyFactory: KeyFactoryService, encryptionService: EncryptionService, passwordService: PasswordService);
|
|
16
16
|
/**
|
|
17
17
|
* Request a verification code to be sent out to an email.
|
|
18
18
|
* @return Info needed to be submitted along with the verification code
|
|
@@ -5,7 +5,7 @@ import { ISignUpResult } from 'amazon-cognito-identity-js';
|
|
|
5
5
|
import { LrService } from '../api/lr-graphql';
|
|
6
6
|
import { EncryptionService } from '../encryption/encryption.service';
|
|
7
7
|
import { KeyFactoryService } from '../key/key-factory.service';
|
|
8
|
-
import {
|
|
8
|
+
import { KcConfig } from '../life-ready.config';
|
|
9
9
|
import { PasswordService } from '../password/password.service';
|
|
10
10
|
import { RequestResetResult } from './tp-password-reset.types';
|
|
11
11
|
export declare class TpPasswordResetUserService extends LrService {
|
|
@@ -17,7 +17,7 @@ export declare class TpPasswordResetUserService extends LrService {
|
|
|
17
17
|
private passwordService;
|
|
18
18
|
private http;
|
|
19
19
|
private auth;
|
|
20
|
-
constructor(ngZone: NgZone, injector: Injector, config:
|
|
20
|
+
constructor(ngZone: NgZone, injector: Injector, config: KcConfig, keyFactory: KeyFactoryService, encryptionService: EncryptionService, passwordService: PasswordService, http: HttpClient, auth: AuthClass);
|
|
21
21
|
verifyEmailContact(email: any): Promise<{
|
|
22
22
|
claimId: string;
|
|
23
23
|
}>;
|