@lifeready/core 5.0.1 → 5.0.2
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 +324 -302
- 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/ast.js +4 -4
- package/esm2015/lib/_common/exceptions.js +129 -103
- package/esm2015/lib/_common/run-outside-angular.js +3 -3
- package/esm2015/lib/_common/storage.js +3 -3
- package/esm2015/lib/_common/types.js +1 -1
- package/esm2015/lib/_common/utils.js +1 -12
- package/esm2015/lib/api/lr-graphql/lr-graphql.service.js +4 -4
- package/esm2015/lib/api/lr-graphql/lr-merged-mutation.js +4 -4
- package/esm2015/lib/api/lr-graphql/lr-mutation-base.js +3 -3
- package/esm2015/lib/api/query-processor/common-processors.service.js +3 -3
- package/esm2015/lib/api/query-processor/query-processor.service.js +4 -4
- package/esm2015/lib/api/query-processor/tp-password-reset-processor.service.js +3 -3
- package/esm2015/lib/auth/auth.types.js +1 -8
- package/esm2015/lib/auth/life-ready-auth.service.js +7 -9
- package/esm2015/lib/category/category.service.js +3 -3
- package/esm2015/lib/encryption/encryption.service.js +4 -7
- package/esm2015/lib/file-upload/file-upload.service.js +2 -3
- package/esm2015/lib/idle/idle.service.js +6 -7
- package/esm2015/lib/item2/item2.service.js +3 -3
- package/esm2015/lib/key/key-factory.service.js +8 -8
- package/esm2015/lib/key/key-graph.service.js +7 -9
- package/esm2015/lib/key/key.service.js +5 -5
- package/esm2015/lib/key/key.types.js +1 -1
- package/esm2015/lib/key-exchange/key-exchange.service.js +3 -3
- package/esm2015/lib/key-exchange/key-exchange2.service.js +3 -3
- package/esm2015/lib/lbop/lbop.service.js +13 -10
- package/esm2015/lib/life-ready.config.js +15 -4
- package/esm2015/lib/password/password.service.js +4 -5
- package/esm2015/lib/persist/persist.service.js +3 -3
- package/esm2015/lib/plan/plan.service.js +3 -3
- package/esm2015/lib/profile/profile.types.js +8 -1
- package/esm2015/lib/scenario/scenario.service.js +4 -4
- package/esm2015/lib/time/time.service.js +3 -6
- package/esm2015/lib/tp-assembly/tp-assembly.js +7 -7
- package/esm2015/lib/tp-password-reset/tp-password-reset-request.service.js +3 -3
- package/esm2015/lib/trusted-party/trusted-party2.service.js +4 -4
- package/esm2015/lib/two-factor/two-factor.service.js +3 -3
- package/fesm2015/lifeready-core.js +214 -195
- package/fesm2015/lifeready-core.js.map +1 -1
- package/lib/_common/exceptions.d.ts +54 -38
- package/lib/_common/types.d.ts +0 -4
- package/lib/_common/utils.d.ts +0 -8
- package/lib/auth/auth.types.d.ts +1 -9
- package/lib/key/key.types.d.ts +4 -1
- package/lib/lbop/lbop.service.d.ts +4 -0
- package/lib/life-ready.config.d.ts +7 -0
- package/lib/profile/profile.types.d.ts +8 -1
- package/lifeready-core.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { GraphQLError } from 'graphql';
|
|
2
2
|
export declare function handleApolloError(errors: ReadonlyArray<GraphQLError>): void;
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class KcError {
|
|
4
|
+
/**
|
|
5
|
+
* The _tag prevents being able to return an object when a class is required:
|
|
6
|
+
* ref: https://medium.com/decathlondevelopers/whats-the-problem-with-typescript-s-classes-2e60aaad3f6
|
|
7
|
+
* Example:
|
|
8
|
+
* // This works because KcError is being treated as a type.
|
|
9
|
+
* function test(): KcError {
|
|
10
|
+
* return {message: "123"};
|
|
11
|
+
* }
|
|
12
|
+
* With the private _tag property, the above will cause a compiler error because _tag property is missing
|
|
13
|
+
* from the returned object.
|
|
14
|
+
*
|
|
15
|
+
* The _type property also provides a type indicator when serialising the class to POJO.
|
|
16
|
+
*/
|
|
17
|
+
private _type;
|
|
4
18
|
code?: string;
|
|
5
19
|
source?: string;
|
|
6
20
|
message: string;
|
|
@@ -11,13 +25,19 @@ export declare class LrError {
|
|
|
11
25
|
}[];
|
|
12
26
|
path: string[];
|
|
13
27
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
constructor(options: Partial<KcError>);
|
|
29
|
+
}
|
|
30
|
+
export declare class KcException {
|
|
31
|
+
private _type;
|
|
32
|
+
errors: KcError[];
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param errors Each argument is a KcError.
|
|
36
|
+
*/
|
|
37
|
+
constructor(...errors: KcError[]);
|
|
18
38
|
toString(): string[];
|
|
19
39
|
}
|
|
20
|
-
export declare enum
|
|
40
|
+
export declare enum KcErrorCode {
|
|
21
41
|
ARCHIVED_RESOURCE = "ARCHIVED_RESOURCE",
|
|
22
42
|
BAD_ARGUMENT = "BAD_ARGUMENT",
|
|
23
43
|
BAD_SIGNATURE = "BAD_SIGNATURE",
|
|
@@ -47,63 +67,59 @@ export declare enum LrApiErrorCode {
|
|
|
47
67
|
UNAUTHENTICATED_USER = "UNAUTHENTICATED_USER",
|
|
48
68
|
USER_NOT_FOUND = "USER_NOT_FOUND",
|
|
49
69
|
VERSION_MISMATCH = "VERSION_MISMATCH",
|
|
50
|
-
WRONG_PERMISSIONS = "WRONG_PERMISSIONS"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
CodeMismatch = "LrCodeMismatchException",
|
|
63
|
-
ConcurrentAccess = "LrConcurrentAccessException",
|
|
64
|
-
BadRequest = "LrBadRequestException",
|
|
65
|
-
Encryption = "LrEncryptionGoBad",
|
|
66
|
-
Locked = "LrLockedException"
|
|
67
|
-
}
|
|
68
|
-
export declare class LrBadArgumentException extends LrException {
|
|
70
|
+
WRONG_PERMISSIONS = "WRONG_PERMISSIONS",
|
|
71
|
+
AUTH = "AUTH",
|
|
72
|
+
BAD_LOGIC = "BAD_LOGIC",
|
|
73
|
+
BAD_REQUEST = "BAD_REQUEST",
|
|
74
|
+
BAD_TIME_SYNC = "BAD_TIME_SYNC",
|
|
75
|
+
CODE_MISMATCH = "CODE_MISMATCH",
|
|
76
|
+
ENCRYPTION = "ENCRYPTION",
|
|
77
|
+
NOT_FOUND = "NOT_FOUND",
|
|
78
|
+
SUSPICIOUS_OPERATION = "SUSPICIOUS_OPERATION",
|
|
79
|
+
UNSUPPORTED = "UNSUPPORTED"
|
|
80
|
+
}
|
|
81
|
+
export declare class KcAuthException extends KcException {
|
|
69
82
|
constructor(message: any);
|
|
70
83
|
}
|
|
71
|
-
export declare class
|
|
84
|
+
export declare class KcBadArgumentException extends KcException {
|
|
85
|
+
constructor(message: string);
|
|
86
|
+
}
|
|
87
|
+
export declare class KcBadLogicException extends KcException {
|
|
72
88
|
constructor(message: any);
|
|
73
89
|
}
|
|
74
|
-
export declare class
|
|
90
|
+
export declare class KcBadRequestException extends KcException {
|
|
75
91
|
constructor(message: any);
|
|
76
92
|
}
|
|
77
|
-
export declare class
|
|
93
|
+
export declare class KcBadSignatureException extends KcException {
|
|
78
94
|
constructor(message: any);
|
|
79
95
|
}
|
|
80
|
-
export declare class
|
|
96
|
+
export declare class KcBadStateException extends KcException {
|
|
81
97
|
constructor(message: any);
|
|
82
98
|
}
|
|
83
|
-
export declare class
|
|
99
|
+
export declare class KcBadTimeSyncException extends KcException {
|
|
84
100
|
constructor(message: any);
|
|
85
101
|
}
|
|
86
|
-
export declare class
|
|
102
|
+
export declare class KcCodeMismatchException extends KcException {
|
|
87
103
|
constructor(message: any);
|
|
88
104
|
}
|
|
89
|
-
export declare class
|
|
105
|
+
export declare class KcConcurrentAccessException extends KcException {
|
|
90
106
|
constructor(message: any);
|
|
91
107
|
}
|
|
92
|
-
export declare class
|
|
108
|
+
export declare class KcEncryptionException extends KcException {
|
|
93
109
|
constructor(message: any);
|
|
94
110
|
}
|
|
95
|
-
export declare class
|
|
111
|
+
export declare class KcInternalErrorException extends KcException {
|
|
96
112
|
constructor(message: any);
|
|
97
113
|
}
|
|
98
|
-
export declare class
|
|
114
|
+
export declare class KcLockedException extends KcException {
|
|
99
115
|
constructor(message: any);
|
|
100
116
|
}
|
|
101
|
-
export declare class
|
|
117
|
+
export declare class KcNotFoundException extends KcException {
|
|
102
118
|
constructor(message: any);
|
|
103
119
|
}
|
|
104
|
-
export declare class
|
|
120
|
+
export declare class KcSuspiciousOperationException extends KcException {
|
|
105
121
|
constructor(message: any);
|
|
106
122
|
}
|
|
107
|
-
export declare class
|
|
123
|
+
export declare class KcUnsupportedException extends KcException {
|
|
108
124
|
constructor(message: any);
|
|
109
125
|
}
|
package/lib/_common/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { HasKeyGraph } from '../key/key.types';
|
|
2
1
|
export declare type SomePartial<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
3
2
|
export declare type SomeRequired<T, K extends keyof T> = Pick<Required<T>, K> & Omit<T, K>;
|
|
4
3
|
export interface Edge<T> {
|
|
@@ -7,7 +6,4 @@ export interface Edge<T> {
|
|
|
7
6
|
export interface HasEdges<T> {
|
|
8
7
|
edges: Edge<T>[];
|
|
9
8
|
}
|
|
10
|
-
export interface HasKeyGraphEdges<T> extends HasKeyGraph {
|
|
11
|
-
list: HasEdges<T>;
|
|
12
|
-
}
|
|
13
9
|
export declare type MayAsync<T> = T | Promise<T>;
|
package/lib/_common/utils.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AuthClass } from '@aws-amplify/auth/lib-esm/Auth';
|
|
2
|
-
import { KcConfig } from '../life-ready.config';
|
|
3
2
|
export declare function promiseAllMayAsync(values: any[]): Promise<any> | any;
|
|
4
3
|
export declare function mapValuesMayAsync(obj: Record<string, any>, callback: (value: any, key: string, obj: Record<string, any>) => any | Promise<any>): Promise<any> | any;
|
|
5
4
|
export declare function mapValuesAsync(obj: Record<string, any>, callback?: (value: any, key: string, obj: Record<string, any>) => any | Promise<any>): Promise<any>;
|
|
@@ -10,10 +9,3 @@ export declare function mapValuesAsync(obj: Record<string, any>, callback?: (val
|
|
|
10
9
|
*/
|
|
11
10
|
export declare function undefinedDefault(value: any, defaultValue: any): any;
|
|
12
11
|
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
|
-
}>;
|
package/lib/auth/auth.types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { JWK } from 'node-jose';
|
|
|
3
3
|
import { JSONObject, TpPasswordResetUserNode, UserDeleteNode } from '../api/types';
|
|
4
4
|
import { PassIdpParams, PassKeyParams } from '../key/key.types';
|
|
5
5
|
import { UserPlan } from '../plan/plan.types';
|
|
6
|
-
import { CurrentUserKey, MainContactCard } from '../profile/profile.types';
|
|
6
|
+
import { CurrentUserKey, Features, MainContactCard } from '../profile/profile.types';
|
|
7
7
|
export interface PassKeyBundle {
|
|
8
8
|
passKeyParams: PassKeyParams;
|
|
9
9
|
passKey: JWK.Key;
|
|
@@ -18,14 +18,6 @@ export declare class CognitoChallengeUser extends CognitoUser {
|
|
|
18
18
|
challengeParam: JSONObject;
|
|
19
19
|
isTpPasswordResetUser: boolean;
|
|
20
20
|
}
|
|
21
|
-
export declare enum FeatureAction {
|
|
22
|
-
ACCESS = "access"
|
|
23
|
-
}
|
|
24
|
-
export declare class Features {
|
|
25
|
-
myVault: FeatureAction[];
|
|
26
|
-
tpVault: FeatureAction[];
|
|
27
|
-
shareVault: FeatureAction[];
|
|
28
|
-
}
|
|
29
21
|
export declare class CurrentUser {
|
|
30
22
|
id: string;
|
|
31
23
|
sub: string;
|
package/lib/key/key.types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JWK } from 'node-jose';
|
|
2
2
|
import { JSONObject, PassKeyNode } from '../api/types';
|
|
3
|
-
import { SomeRequired } from '../_common/types';
|
|
3
|
+
import { HasEdges, SomeRequired } from '../_common/types';
|
|
4
4
|
export interface Key {
|
|
5
5
|
id: string;
|
|
6
6
|
pbk?: string;
|
|
@@ -77,3 +77,6 @@ export interface DerivePassKeyParams extends PassKeyParams {
|
|
|
77
77
|
export interface DeriveLbopKeyParams extends PassKeyParams {
|
|
78
78
|
password: CryptoKey;
|
|
79
79
|
}
|
|
80
|
+
export interface HasKeyGraphEdges<T> extends HasKeyGraph {
|
|
81
|
+
list: HasEdges<T>;
|
|
82
|
+
}
|
|
@@ -10,6 +10,10 @@ import { KeyService } from '../key/key.service';
|
|
|
10
10
|
import { PassKeyParams } from '../key/key.types';
|
|
11
11
|
import { KcConfig } from '../life-ready.config';
|
|
12
12
|
import { PasswordService } from '../password/password.service';
|
|
13
|
+
export declare const ERROR_SOURCE = "LBOP";
|
|
14
|
+
export declare enum KcLbopErrorCode {
|
|
15
|
+
INVALID_PASSPHRASE = "INVALID_PASSPHRASE"
|
|
16
|
+
}
|
|
13
17
|
export interface SetPasswordParams {
|
|
14
18
|
lbopId: string;
|
|
15
19
|
newPassword: CryptoKey;
|
|
@@ -2,6 +2,13 @@ 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
4
|
export declare const KC_CONFIG: InjectionToken<KcConfig>;
|
|
5
|
+
export declare function httpOptions(auth: AuthClass, config: KcConfig): Promise<{
|
|
6
|
+
withCredentials: boolean;
|
|
7
|
+
headers: {
|
|
8
|
+
'x-kc-dev-user': string;
|
|
9
|
+
authorization: string;
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
5
12
|
export interface KcConfig {
|
|
6
13
|
authUrl: string;
|
|
7
14
|
apiUrl: string;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { UserDeleteNode } from '../api/types';
|
|
2
|
-
import { Features } from '../auth/auth.types';
|
|
3
2
|
import { PassIdpParams, PassKey } from '../key/key.types';
|
|
3
|
+
export declare enum FeatureAction {
|
|
4
|
+
ACCESS = "access"
|
|
5
|
+
}
|
|
6
|
+
export declare class Features {
|
|
7
|
+
myVault: FeatureAction[];
|
|
8
|
+
tpVault: FeatureAction[];
|
|
9
|
+
shareVault: FeatureAction[];
|
|
10
|
+
}
|
|
4
11
|
export declare class CurrentUserKey {
|
|
5
12
|
passKey?: PassKey;
|
|
6
13
|
masterKey?: {
|