@lifeready/core 6.0.5 → 6.1.1

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.
Files changed (97) hide show
  1. package/bundles/lifeready-core.umd.js +3474 -7307
  2. package/bundles/lifeready-core.umd.js.map +1 -1
  3. package/bundles/lifeready-core.umd.min.js +1 -1
  4. package/bundles/lifeready-core.umd.min.js.map +1 -1
  5. package/esm2015/lib/auth2/auth.config.js +57 -0
  6. package/esm2015/lib/auth2/auth2.gql.private.js +8 -1
  7. package/esm2015/lib/auth2/auth2.service.js +3 -4
  8. package/esm2015/lib/auth2/auth2.types.js +1 -1
  9. package/esm2015/lib/file-upload/file-upload.service.js +4 -4
  10. package/esm2015/lib/idle/idle.service.js +1 -2
  11. package/esm2015/lib/item2/item2.service.js +15 -45
  12. package/esm2015/lib/key/key-meta.service.js +16 -8
  13. package/esm2015/lib/key-exchange/key-exchange2.service.js +6 -25
  14. package/esm2015/lib/life-ready.module.js +2 -9
  15. package/esm2015/lib/password/password.service.js +1 -1
  16. package/esm2015/lib/profile/profile-details.service.js +120 -75
  17. package/esm2015/lib/profile/profile.gql.js +134 -1
  18. package/esm2015/lib/profile/profile.service.js +8 -5
  19. package/esm2015/lib/profile/profile.types.js +14 -3
  20. package/esm2015/lib/shared-contact-card/shared-contact-card.service.js +2 -2
  21. package/esm2015/lib/tp-password-reset/tp-password-reset.types.js +1 -1
  22. package/esm2015/lib/trusted-party/trusted-party2.service.js +3 -7
  23. package/esm2015/lifeready-core.js +7 -9
  24. package/esm2015/public-api.js +2 -20
  25. package/fesm2015/lifeready-core.js +3206 -6520
  26. package/fesm2015/lifeready-core.js.map +1 -1
  27. package/lib/auth2/auth2.gql.private.d.ts +15 -2
  28. package/lib/auth2/auth2.service.d.ts +1 -1
  29. package/lib/auth2/auth2.types.d.ts +19 -2
  30. package/lib/file-upload/file-upload.service.d.ts +2 -2
  31. package/lib/item2/item2.service.d.ts +11 -74
  32. package/lib/key/key-meta.service.d.ts +8 -1
  33. package/lib/key-exchange/key-exchange2.service.d.ts +5 -66
  34. package/lib/password/password.service.d.ts +1 -1
  35. package/lib/profile/profile-details.service.d.ts +10 -11
  36. package/lib/profile/profile.gql.d.ts +12 -0
  37. package/lib/profile/profile.service.d.ts +1 -3
  38. package/lib/profile/profile.types.d.ts +31 -4
  39. package/lib/shared-contact-card/shared-contact-card.service.d.ts +1 -2
  40. package/lib/tp-password-reset/tp-password-reset.types.d.ts +3 -3
  41. package/lib/trusted-party/trusted-party2.service.d.ts +2 -7
  42. package/lifeready-core.d.ts +6 -8
  43. package/lifeready-core.metadata.json +1 -1
  44. package/package.json +1 -1
  45. package/public-api.d.ts +1 -19
  46. package/esm2015/lib/auth/auth.config.js +0 -57
  47. package/esm2015/lib/auth/auth.gql.js +0 -16
  48. package/esm2015/lib/auth/auth.types.js +0 -18
  49. package/esm2015/lib/auth/life-ready-auth.service.js +0 -568
  50. package/esm2015/lib/category/category-meta.service.js +0 -99
  51. package/esm2015/lib/category/category.gql.js +0 -385
  52. package/esm2015/lib/category/category.service.js +0 -361
  53. package/esm2015/lib/category/category.types.js +0 -29
  54. package/esm2015/lib/key-exchange/key-exchange.gql.js +0 -188
  55. package/esm2015/lib/key-exchange/key-exchange.service.js +0 -436
  56. package/esm2015/lib/key-exchange/key-exchange.types.js +0 -7
  57. package/esm2015/lib/message/message.gql.js +0 -32
  58. package/esm2015/lib/message/message.service.js +0 -118
  59. package/esm2015/lib/message/message.types.js +0 -2
  60. package/esm2015/lib/plan/plan.gql.js +0 -123
  61. package/esm2015/lib/plan/plan.service.js +0 -150
  62. package/esm2015/lib/plan/plan.types.js +0 -11
  63. package/esm2015/lib/record/record-attachment.service.js +0 -102
  64. package/esm2015/lib/record/record.gql.js +0 -182
  65. package/esm2015/lib/record/record.service.js +0 -194
  66. package/esm2015/lib/record/record.types.js +0 -15
  67. package/esm2015/lib/record-type/record-type.service.js +0 -75
  68. package/esm2015/lib/record-type/record-type.types.js +0 -28
  69. package/esm2015/lib/trusted-party/trusted-party.gql.js +0 -148
  70. package/esm2015/lib/trusted-party/trusted-party.service.js +0 -308
  71. package/esm2015/lib/trusted-party/trusted-party.types.js +0 -41
  72. package/lib/auth/auth.gql.d.ts +0 -12
  73. package/lib/auth/auth.types.d.ts +0 -52
  74. package/lib/auth/life-ready-auth.service.d.ts +0 -73
  75. package/lib/category/category-meta.service.d.ts +0 -23
  76. package/lib/category/category.gql.d.ts +0 -44
  77. package/lib/category/category.service.d.ts +0 -66
  78. package/lib/category/category.types.d.ts +0 -75
  79. package/lib/key-exchange/key-exchange.gql.d.ts +0 -9
  80. package/lib/key-exchange/key-exchange.service.d.ts +0 -37
  81. package/lib/key-exchange/key-exchange.types.d.ts +0 -188
  82. package/lib/message/message.gql.d.ts +0 -13
  83. package/lib/message/message.service.d.ts +0 -36
  84. package/lib/message/message.types.d.ts +0 -12
  85. package/lib/plan/plan.gql.d.ts +0 -11
  86. package/lib/plan/plan.service.d.ts +0 -34
  87. package/lib/plan/plan.types.d.ts +0 -32
  88. package/lib/record/record-attachment.service.d.ts +0 -16
  89. package/lib/record/record.gql.d.ts +0 -14
  90. package/lib/record/record.service.d.ts +0 -25
  91. package/lib/record/record.types.d.ts +0 -56
  92. package/lib/record-type/record-type.service.d.ts +0 -11
  93. package/lib/record-type/record-type.types.d.ts +0 -50
  94. package/lib/trusted-party/trusted-party.gql.d.ts +0 -9
  95. package/lib/trusted-party/trusted-party.service.d.ts +0 -43
  96. package/lib/trusted-party/trusted-party.types.d.ts +0 -101
  97. /package/lib/{auth → auth2}/auth.config.d.ts +0 -0
@@ -1,73 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { AuthClass } from '@aws-amplify/auth/lib-esm/Auth';
3
- import { ReplaySubject } from 'rxjs';
4
- import { LrGraphQLService } from '../api/lr-graphql';
5
- import { TpPasswordResetProcessorService } from '../api/query-processor/tp-password-reset-processor.service';
6
- import { EncryptionService } from '../encryption/encryption.service';
7
- import { IdleService } from '../idle/idle.service';
8
- import { KeyFactoryService } from '../key/key-factory.service';
9
- import { KeyGraphService } from '../key/key-graph.service';
10
- import { KeyService } from '../key/key.service';
11
- import { KcConfig } from '../life-ready.config';
12
- import { PasswordService } from '../password/password.service';
13
- import { PersistService } from '../persist/persist.service';
14
- import { ProfileService } from '../profile/profile.service';
15
- import { TpPasswordResetAssemblyController } from '../tp-password-reset/tp-password-reset.controller';
16
- import { CognitoChallengeUser, CurrentUser, LoginResult, TpPasswordResetUser } from './auth.types';
17
- export declare const initialiseAuth: (authService: LifeReadyAuthService) => () => Promise<void>;
18
- export interface LoginOptions {
19
- tpPasswordResetAutoComplete?: boolean;
20
- }
21
- export declare type LogoutListener = () => void | Promise<void>;
22
- export declare class LifeReadyAuthService {
23
- private config;
24
- private auth;
25
- private keyFactory;
26
- private keyService;
27
- private profileService;
28
- private keyGraphService;
29
- private passwordService;
30
- private idleService;
31
- private lrGraphQL;
32
- private tpPasswordResetProcessorService;
33
- private persistService;
34
- private encryptionService;
35
- private assemblyController;
36
- private http;
37
- private hubSubject;
38
- private currentUser;
39
- private currentResetUser;
40
- private logoutListeners;
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);
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;
49
- getAccessJwtToken(): Promise<string>;
50
- importPassword(plainPassword: string): Promise<CryptoKey>;
51
- addLogoutListener(callback: LogoutListener): void;
52
- removeLogoutListener(callback: LogoutListener): void;
53
- private loginIdpImpl;
54
- private loginIdp;
55
- private handleSessionEncryptionKey;
56
- private handlePostAuth;
57
- login(emailOrPhone: string, password: CryptoKey, { tpPasswordResetAutoComplete }?: LoginOptions): Promise<LoginResult>;
58
- loginImpl(emailOrPhone: string, password: CryptoKey): Promise<LoginResult>;
59
- verifyLogin(challenge: CognitoChallengeUser, password: CryptoKey, rememberMe: boolean, code: string): Promise<CurrentUser>;
60
- handlePasswordRecovery(user: CognitoChallengeUser): Promise<void>;
61
- getUserOrResetUser(reload?: boolean): Promise<CurrentUser | TpPasswordResetUser>;
62
- getResetUser(reload?: boolean): Promise<TpPasswordResetUser>;
63
- getUser(reload?: boolean): Promise<CurrentUser>;
64
- private mapTPVaultAccess;
65
- private loadUser;
66
- watchAuth(): ReplaySubject<any>;
67
- logout(): Promise<void>;
68
- private getUserAttribute;
69
- private loadResetUser;
70
- refreshAccessToken(): Promise<unknown>;
71
- completeRequest(newPassword: CryptoKey): Promise<void>;
72
- private recoverAssemblyKey;
73
- }
@@ -1,23 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { CategoryService } from './category.service';
3
- import { AccessLevel, CurrentCategory, DefaultCategory } from './category.types';
4
- export declare class LoadedCategoryTree {
5
- categories: CurrentCategory[];
6
- missingCategories: string[][];
7
- }
8
- export declare class CategoryMetaService {
9
- private http;
10
- private categoryService;
11
- private categories;
12
- constructor(http: HttpClient, categoryService: CategoryService);
13
- getCoreCategories(): Promise<DefaultCategory[]>;
14
- loadCategories(categoryTrees: string[][], selectedCategoryId?: string, trustedPartyId?: string): Promise<LoadedCategoryTree>;
15
- loadCategoriesForRole(categories: {
16
- category: string[];
17
- accessLevel: AccessLevel;
18
- }[]): Promise<{
19
- category: CurrentCategory;
20
- accessLevel: AccessLevel;
21
- }[]>;
22
- private loadCategory;
23
- }
@@ -1,44 +0,0 @@
1
- import { HasKeyGraph } from '../key/key.types';
2
- import { HasEdges } from '../_common/types';
3
- export declare const DEFAULT_BREADCRUMB_DEPTH = 5;
4
- export declare const DEFAULT_DESCENDANTS_DEPTH = 5;
5
- export declare enum DirectoryType {
6
- Vault = "vault",
7
- Category = "category",
8
- Record = "record"
9
- }
10
- export declare const DefaultVaultFilter: string;
11
- export declare const CategoryFilter: string;
12
- export declare const RecordFilter: string;
13
- export declare const CategoryFields: string;
14
- export declare const VaultFields = "\n id\n keyId\n plainMeta\n cipherMeta\n";
15
- export declare const GetRootDirectoryIdsQuery: import("graphql").DocumentNode;
16
- export declare const GetCategoriesQuery: import("graphql").DocumentNode;
17
- export declare const GetVaultsQuery: import("graphql").DocumentNode;
18
- export interface GetTrustedPartyCategoriesQueryType extends HasKeyGraph {
19
- tp: {
20
- theirItems: {
21
- list: HasEdges<any>;
22
- records: HasEdges<any>;
23
- };
24
- };
25
- }
26
- export declare const GetTrustedPartyCategoriesQuery: import("graphql").DocumentNode;
27
- export interface GetMySharedCategoriesQueryType extends HasKeyGraph {
28
- tp: {
29
- myItems: {
30
- list: HasEdges<any>;
31
- records: HasEdges<any>;
32
- };
33
- };
34
- }
35
- export declare const GetMySharedCategoriesQuery: import("graphql").DocumentNode;
36
- export declare const parentCategoriesField: (depth?: number) => any;
37
- export declare const GetCategoryQuery: (depth?: number) => import("graphql").DocumentNode;
38
- export declare const GetCategoryKeyIdQuery: import("graphql").DocumentNode;
39
- export declare const CreateCategoryMutation: import("graphql").DocumentNode;
40
- export declare const CreateVaultMutation: import("graphql").DocumentNode;
41
- export declare const UpdateCategoryMutation: import("graphql").DocumentNode;
42
- export declare const DeleteCategoryMutation: import("graphql").DocumentNode;
43
- export declare const ArchiveDirectoryMutation: import("graphql").DocumentNode;
44
- export declare const UnarchiveDirectoryMutation: import("graphql").DocumentNode;
@@ -1,66 +0,0 @@
1
- import { LrApolloService } from '../api/lr-apollo.service';
2
- import { KeyGraphService } from '../key/key-graph.service';
3
- import { KeyMetaService } from '../key/key-meta.service';
4
- import { Category, NewCategory, UpdatedCategory, Vault, VaultCategory, VaultRecord } from './category.types';
5
- export declare class CategoryService {
6
- private lrApollo;
7
- private keyMetaService;
8
- private keyGraph;
9
- constructor(lrApollo: LrApolloService, keyMetaService: KeyMetaService, keyGraph: KeyGraphService);
10
- getRootDirectoryIds(input?: {
11
- archived: boolean;
12
- }): Promise<string[]>;
13
- getDefaultVault(): Promise<Vault>;
14
- getCategories(input?: {
15
- archived?: boolean;
16
- vaultDirectoryId?: string;
17
- }): Promise<Category[]>;
18
- getTrustedPartyCategories(trustedPartyId: string): Promise<{
19
- categories: Category[];
20
- records?: VaultRecord[];
21
- }>;
22
- getMySharedCategories(trustedPartyId: string): Promise<{
23
- categories: Category[];
24
- records?: VaultRecord[];
25
- }>;
26
- getCategory(categoryId: string): Promise<VaultCategory>;
27
- private mapVaults;
28
- private mapCategories;
29
- private mapRecords;
30
- createDefaultVault(): Promise<string>;
31
- createCategory(newCategory: NewCategory): Promise<string>;
32
- updateCategory(categoryId: string, keyId: string, updatedCategory: UpdatedCategory): Promise<void>;
33
- setCategoryVisibility(categoryId: string, hide: boolean): Promise<void>;
34
- deleteCategory(categoryId: string): Promise<void>;
35
- archiveCategory(categoryId: string, recursive: boolean): Promise<void>;
36
- unarchiveCategory(categoryId: string, recursive: boolean): Promise<void>;
37
- archiveDirectory(directoryId: string, recursive: boolean): Promise<void>;
38
- unarchiveDirectory(directoryId: string, recursive: boolean): Promise<void>;
39
- mapVault(node: {
40
- id: any;
41
- keyId: any;
42
- plainMeta: any;
43
- cipherMeta: any;
44
- }): Promise<Vault>;
45
- mapParentCategories(category: {
46
- parentCategories: any;
47
- }): Promise<Category[]>;
48
- mapCategory(node: {
49
- id: any;
50
- keyId: any;
51
- plainMeta: any;
52
- cipherMeta: any;
53
- descendantDirectories: any;
54
- archived: any;
55
- }): Promise<Category>;
56
- mapRecord(node: {
57
- id: any;
58
- keyId: any;
59
- plainMeta: any;
60
- cipherMeta: any;
61
- created: any;
62
- modified: any;
63
- content: any;
64
- archived: any;
65
- }): Promise<VaultRecord>;
66
- }
@@ -1,75 +0,0 @@
1
- export declare enum AccessLevel {
2
- Owner = "OWNER",
3
- Admin = "ADMIN",
4
- Writer = "WRITER",
5
- Reader = "READER",
6
- Deny = "DENY"
7
- }
8
- export declare class SharedAccess {
9
- trustedPartyId: string;
10
- accessLevel: AccessLevel;
11
- isInherited: boolean;
12
- inheritedFrom?: string;
13
- }
14
- export declare class DefaultCategory {
15
- code: string;
16
- name: string;
17
- allowRecords: boolean;
18
- allowCustomCategories: boolean;
19
- archived: boolean;
20
- subCategories?: DefaultCategory[];
21
- }
22
- export declare class VaultRecordType {
23
- id: string;
24
- name: string;
25
- }
26
- export declare class VaultRecord {
27
- id: string;
28
- keyId: string;
29
- name: string;
30
- recordType: VaultRecordType;
31
- createdOn: string | Date;
32
- lastModified: string | Date;
33
- isArchived: boolean;
34
- }
35
- export declare class Category {
36
- id: string;
37
- keyId: string;
38
- code?: string;
39
- name: string;
40
- isHidden: boolean;
41
- isCustom: boolean;
42
- isEmpty: boolean;
43
- isArchived: boolean;
44
- allRecordsCount: number;
45
- allowRecords: boolean;
46
- allowCustomCategories: boolean;
47
- }
48
- export declare class CurrentCategory extends Category {
49
- parents: Category[];
50
- }
51
- export declare class VaultCategory {
52
- category?: CurrentCategory;
53
- subCategories?: Category[];
54
- records?: VaultRecord[];
55
- }
56
- export declare class NewCategory {
57
- name: string;
58
- code?: string;
59
- isCustom: boolean;
60
- allowRecords: boolean;
61
- allowCustomCategories: boolean;
62
- categoryIds?: string[];
63
- }
64
- export declare class UpdatedCategory {
65
- name: string;
66
- code?: string;
67
- isCustom: boolean;
68
- allowRecords: boolean;
69
- allowCustomCategories: boolean;
70
- }
71
- export declare class Vault {
72
- id: string;
73
- keyId: string;
74
- name?: string;
75
- }
@@ -1,9 +0,0 @@
1
- export declare const KeyExchangeFields = "\n id\n token\n state\n mode\n isInitiator\n initiator {\n id\n username\n }\n responder {\n id\n username\n }\n created\n modified\n tokenExpiryTime\n isExpired\n initiatorRootKeyCipher\n initiatorActionRequired\n responderActionRequired\n responderEmailAddress\n otk {\n state\n otKeyParams\n otKeyCipher\n sharedKey {\n id\n }\n mkSharedKey {\n id\n }\n initiatorSigPxk {\n id\n }\n responderSigPxk {\n id\n }\n initiatorOneTimePbkCipher\n responderPbkCipher\n}";
2
- export declare const UserSharedKeyFields = "\n userSigPrk {\n id\n }\n otherSigPbk {\n id\n }\n sharedKey {\n id\n }\n mkSharedKey {\n id\n }\n mkPxk {\n id\n pbk\n }\n mkReshareRequestCipher\n mkReshareResponseCipher\n mkReshareRequestSent\n mkReshareResponseSent\n";
3
- export declare const CurrentUserSharedKeyQuery: import("graphql").DocumentNode;
4
- export declare const KeyExchangesQuery: import("graphql").DocumentNode;
5
- export declare const KeyExchangeQuery: import("graphql").DocumentNode;
6
- export declare const KeyExchangeTokenQuery: import("graphql").DocumentNode;
7
- export declare const InitiateOtkMutation: import("graphql").DocumentNode;
8
- export declare const RespondOtkMutation: import("graphql").DocumentNode;
9
- export declare const CompleteOtkMutation: import("graphql").DocumentNode;
@@ -1,37 +0,0 @@
1
- import { LrApolloService } from '../api/lr-apollo.service';
2
- import { Auth2Service } from '../auth2/auth2.service';
3
- import { EncryptionService } from '../encryption/encryption.service';
4
- import { KeyFactoryService as KFS } from '../key/key-factory.service';
5
- import { KeyService } from '../key/key.service';
6
- import { CompleteOtk, DecryptedKeyExchange, GetKeyExchangeListOptions, GetKeyExchangeOptions, InitiateOtkInput, KeyExchange, RespondOtk, RespondOtkInput, UserSharedKey } from './key-exchange.types';
7
- export declare class KeyExchangeService {
8
- private keyFactory;
9
- private keyService;
10
- private lrApollo;
11
- private encryptionService;
12
- private auth2Service;
13
- private readonly CLIENT_NONCE_LENGTH;
14
- constructor(keyFactory: KFS, keyService: KeyService, lrApollo: LrApolloService, encryptionService: EncryptionService, auth2Service: Auth2Service);
15
- getKeyExchangeList(input?: GetKeyExchangeListOptions): Promise<any>;
16
- /**
17
- * @param id If the current user can responder the key exchange if they are either the initiator or the receiver.
18
- * @param token If not signed in, or not the initiator or responder, 'token' must be given.
19
- * @param otKeyK Is the raw one-time key (string). If the responder is explicitly specified at time of initiation, then
20
- * it's possible to have the otKey wrapped by the public key of the responder. In which case, the otKeyK is not needed.
21
- */
22
- getKeyExchange(id: string, { otKeyK, token }?: GetKeyExchangeOptions): Promise<DecryptedKeyExchange>;
23
- private decryptResponseCipher;
24
- decryptKeyExchange(keyExchange: KeyExchange, otKeyK?: string): Promise<DecryptedKeyExchange>;
25
- private decryptOtk;
26
- private getOtKey;
27
- initiateOtk({ message, email, contactCard, upgrade, }: InitiateOtkInput): Promise<{
28
- keyExchange: KeyExchange;
29
- otKeyK: string;
30
- }>;
31
- respondOtk({ id, token, decryptedOtk, message, initiatorContactCard, responderContactCard: sentContactCard, }: RespondOtkInput): Promise<RespondOtk>;
32
- completeOtk(keyExchangeId: string, initiatorRootKeyCipher: string, initiatorOneTimePbkCipher: string, responderContactCard?: string): Promise<CompleteOtk>;
33
- currentUserSharedKey(input: {
34
- username?: string;
35
- userId?: string;
36
- }): Promise<UserSharedKey>;
37
- }
@@ -1,188 +0,0 @@
1
- import { JWK } from 'node-jose';
2
- import { JSONObject, KeyExchangeMode, KeyExchangeState } from '../api/types';
3
- import { AccessLevel } from '../category/category.types';
4
- import { Key } from '../key/key.types';
5
- import { ContactCardName, TrustedPartyDetails } from '../profile/profile.types';
6
- export interface PlainInitiatorRootKeyCipher {
7
- nonce: string;
8
- oneTimePrk: object;
9
- otKey: object;
10
- initiatorContactCard?: {
11
- plainOwnerCipherDataJson: JSONObject;
12
- plainSharedCipherDataJson: JSONObject;
13
- };
14
- initiator: {
15
- message?: KeyExchangeMessage;
16
- contactCard?: {
17
- plainSharedCipherDataJson: TrustedPartyDetails;
18
- };
19
- };
20
- }
21
- export interface SharedContactCardInput {
22
- plainCipherDataJson?: JSONObject;
23
- plainSharedCipherDataJson?: JSONObject;
24
- sharedCipherKey?: object;
25
- }
26
- export interface PreparedPermissions {
27
- categories?: {
28
- categoryId: string;
29
- accessLevel: AccessLevel;
30
- }[];
31
- records?: {
32
- recordId: string;
33
- accessLevel: AccessLevel;
34
- }[];
35
- }
36
- export interface KeyExchangeMessage {
37
- name?: string;
38
- email?: string;
39
- message?: string;
40
- permissions?: PreparedPermissions;
41
- }
42
- export interface PlainOtKeyCipher {
43
- nonce: string;
44
- initiator: {
45
- oneTimePbk: object;
46
- pbk: object;
47
- sigPbk: object;
48
- profile?: {
49
- username?: string;
50
- };
51
- message?: KeyExchangeMessage;
52
- contactCard?: {
53
- plainSharedCipherDataJson: TrustedPartyDetails;
54
- };
55
- };
56
- }
57
- export interface DecryptedOtk {
58
- plainOtKeyCipher: PlainOtKeyCipher;
59
- otKey: JWK.Key;
60
- }
61
- export interface PlainInitiatorOneTimePbkCipher {
62
- nonce: string;
63
- sharedKey: object;
64
- mkSharedKey: object;
65
- responder: {
66
- pbk: object;
67
- sigPbk: object;
68
- profile?: {
69
- username?: string;
70
- };
71
- message?: KeyExchangeMessage;
72
- contactCard?: {
73
- plainSharedCipherDataJson: TrustedPartyDetails;
74
- sharedCipherKey: object;
75
- };
76
- };
77
- }
78
- export declare enum OtkState {
79
- OTK_INITIATED = "OTK_INITIATED",
80
- OTK_ACCEPTED = "OTK_ACCEPTED",
81
- OTK_COMPLETED = "OTK_COMPLETED"
82
- }
83
- export interface KeyExchangeContactCardInput {
84
- ownerPlainData?: {
85
- name: ContactCardName;
86
- };
87
- plainOwnerCipherDataJson: JSONObject;
88
- plainSharedCipherDataJson: TrustedPartyDetails;
89
- }
90
- export interface InitiateOtkInput {
91
- email?: string;
92
- message?: KeyExchangeMessage;
93
- contactCard?: KeyExchangeContactCardInput;
94
- upgrade?: boolean;
95
- }
96
- export interface RespondOtkInput {
97
- id: string;
98
- token: string;
99
- decryptedOtk: DecryptedOtk;
100
- message?: KeyExchangeMessage;
101
- initiatorContactCard?: {
102
- plainReceiverCipherDataJson: JSONObject;
103
- };
104
- responderContactCard?: KeyExchangeContactCardInput;
105
- }
106
- export interface Otk {
107
- id: string;
108
- state: OtkState;
109
- otKeyParams: string;
110
- otKeyCipher: string;
111
- sharedKey: Key;
112
- mkSharedKey: Key;
113
- initiatorSigPxk: Key;
114
- responderSigPxk: Key;
115
- initiatorOneTimePbkCipher: string;
116
- responderPbkCipher?: string;
117
- }
118
- export interface KeyExchange {
119
- id: string;
120
- state: KeyExchangeState;
121
- mode: KeyExchangeMode;
122
- created: string;
123
- modified: string;
124
- isInitiator: boolean;
125
- initiator: {
126
- id: string;
127
- username: string;
128
- };
129
- responder: {
130
- id: string;
131
- username: string;
132
- };
133
- initiatorActionRequired?: boolean;
134
- responderActionRequired?: boolean;
135
- responderEmailAddress?: string;
136
- token?: string;
137
- tokenExpiryTime?: string;
138
- isExpired?: boolean;
139
- otk?: Otk;
140
- initiatorRootKeyCipher: string;
141
- }
142
- export interface DecryptedKeyExchange extends KeyExchange {
143
- decryptedOtk?: DecryptedOtk;
144
- message?: KeyExchangeMessage;
145
- contactCard?: TrustedPartyDetails;
146
- myMessage?: KeyExchangeMessage;
147
- myContactCard?: TrustedPartyDetails;
148
- }
149
- export interface GetKeyExchangeOptions {
150
- otKeyK?: string;
151
- token?: string;
152
- }
153
- export interface RespondOtk {
154
- keyExchange: KeyExchange;
155
- userSharedKey: UserSharedKey;
156
- tp: {
157
- id: string;
158
- };
159
- }
160
- export interface CompleteOtk {
161
- keyExchange: KeyExchange;
162
- userSharedKey: UserSharedKey;
163
- tp: {
164
- id: string;
165
- };
166
- }
167
- export interface UserSharedKey {
168
- userSigPrk: Key;
169
- sharedKey: Key;
170
- mkSharedKey?: Key;
171
- mkPxk?: Key;
172
- mkReshareRequestCipher?: string;
173
- mkReshareResponseCipher?: string;
174
- mkReshareRequestSent?: boolean;
175
- mkReshareResponseSent?: boolean;
176
- }
177
- export interface GetKeyExchangeListOptions {
178
- orderBy?: 'created' | '-created' | 'modified' | '-modified' | 'expiry_time' | '-expiry_time';
179
- isExpired?: boolean;
180
- initiatorActionRequired?: boolean;
181
- responderActionRequired?: boolean;
182
- initiator?: string;
183
- responder?: string;
184
- state?: 'IN_PROGRESS' | 'COMPLETED' | 'DECLINED' | 'CANCELLED';
185
- }
186
- export interface PlainResponderPbkCipher {
187
- otKey: object;
188
- }
@@ -1,13 +0,0 @@
1
- import { ID, MessageNode } from '../api/types';
2
- export interface SendMessageMutationResult {
3
- sendMessage: {
4
- message: {
5
- id: ID;
6
- };
7
- };
8
- }
9
- export declare const SendMessageMutation: import("../_common/ast").TypedDocumentNode<SendMessageMutationResult>;
10
- export interface MessageQueryResult {
11
- message: MessageNode;
12
- }
13
- export declare const MessageQuery: import("../_common/ast").TypedDocumentNode<MessageQueryResult>;
@@ -1,36 +0,0 @@
1
- import { Injector, NgZone } from '@angular/core';
2
- import { JWK } from 'node-jose';
3
- import { LrMutation, LrService } from '../api/lr-graphql';
4
- import { MessageNode } from '../api/types';
5
- import { EncryptionService } from '../encryption/encryption.service';
6
- import { KeyExchangeService } from '../key-exchange/key-exchange.service';
7
- import { KeyGraphService } from '../key/key-graph.service';
8
- import { SendMessageInput } from './message.types';
9
- export declare class MessageService extends LrService {
10
- private ngZone;
11
- private injector;
12
- private keyGraph;
13
- private encryptionService;
14
- private keyExchangeService;
15
- private readonly encrypt;
16
- private readonly decrypt;
17
- private readonly sign;
18
- private readonly verify;
19
- constructor(ngZone: NgZone, injector: Injector, keyGraph: KeyGraphService, encryptionService: EncryptionService, keyExchangeService: KeyExchangeService);
20
- sendMessage(input: SendMessageInput): Promise<import("./message.gql").SendMessageMutationResult>;
21
- sendMessageMutation({ username, userId, plainMessageJson, plainCipherMessageJson, }: SendMessageInput): Promise<LrMutation<import("./message.gql").SendMessageMutationResult, {
22
- input: {
23
- receiverUsername: string;
24
- receiverId: string;
25
- sharedKeyId: string;
26
- senderSigPbkId: string;
27
- signedCipherMessage: string;
28
- plainMessage: string;
29
- };
30
- }>>;
31
- decryptMessage(message: MessageNode, options: {
32
- sharedKey: JWK.Key;
33
- senderSigPbk: JWK.Key;
34
- }): Promise<void>;
35
- getMessage(id: string): Promise<MessageNode>;
36
- }
@@ -1,12 +0,0 @@
1
- import { JWK } from 'node-jose';
2
- import { JSONObject } from '../api/types';
3
- export interface SendMessageInput {
4
- username?: string;
5
- userId?: string;
6
- plainMessageJson?: JSONObject;
7
- plainCipherMessageJson?: JSONObject;
8
- }
9
- export interface DecryptMessageOptions {
10
- sharedKey: JWK.Key;
11
- senderSigPbk: JWK.Key;
12
- }
@@ -1,11 +0,0 @@
1
- export declare const CreateStripeCheckoutSessionMutation: import("graphql").DocumentNode;
2
- export declare const CreateStripeBillingPortalSessionMutation: import("graphql").DocumentNode;
3
- export declare const planFields = "\n name\n data\n state\n";
4
- export declare const CreateUserIssuedPlanMutation: import("graphql").DocumentNode;
5
- export declare const DeleteUserIssuedPlanMutation: import("graphql").DocumentNode;
6
- export declare const UserIssuablePlansQuery: import("graphql").DocumentNode;
7
- export declare const UserIssuedPlansQuery: import("graphql").DocumentNode;
8
- export declare const UserIssuedPlanQuery: import("graphql").DocumentNode;
9
- export declare const AssociateUserIssuedPlanMutation: import("graphql").DocumentNode;
10
- export declare const UserPlansQuery: import("graphql").DocumentNode;
11
- export declare const StripeQuery: import("graphql").DocumentNode;
@@ -1,34 +0,0 @@
1
- import { LrApolloService } from '../api/lr-apollo.service';
2
- import { JSONObject } from '../api/types';
3
- import { StripeBillingPortalSession, StripeCheckoutSession, UserIssuablePlan, UserIssuedPlan, UserPlan } from './plan.types';
4
- export declare function mapUserPlans(userPlans: any[]): UserPlan[];
5
- export declare class PlanService {
6
- private lrApollo;
7
- constructor(lrApollo: LrApolloService);
8
- createStripeCheckoutSession(input: {
9
- priceId: string;
10
- successUrl: string;
11
- cancelUrl: string;
12
- }): Promise<StripeCheckoutSession>;
13
- createStripeBillingPortalSession(returnUrl: string): Promise<StripeBillingPortalSession>;
14
- getUserIssuablePlans(): Promise<UserIssuablePlan[]>;
15
- createUserIssuedPlan({ planName, tokenExpiryTime, planPeriodEnd, planPeriodEndAfterSeconds, }: {
16
- planName: string;
17
- tokenExpiryTime: Date;
18
- planPeriodEnd?: Date;
19
- planPeriodEndAfterSeconds?: number;
20
- }): Promise<UserIssuedPlan>;
21
- deleteUserIssuedPlan(id: string): Promise<void>;
22
- getUserIssuedPlans(): Promise<any[]>;
23
- getUserIssuedPlan(id: string, token?: string): Promise<any>;
24
- associateUserIssuedPlan({ id, token, }: {
25
- id: string;
26
- token: string;
27
- }): Promise<UserPlan>;
28
- getUserPlans(): Promise<UserPlan[]>;
29
- getPlanType(subscriptionId: string): Promise<string>;
30
- getStripe(): Promise<{
31
- id: string;
32
- customer: Record<string, JSONObject>;
33
- }>;
34
- }
@@ -1,32 +0,0 @@
1
- import { JSONObject } from '../api/types';
2
- export declare class Plan {
3
- name: string;
4
- data: Record<string, JSONObject>;
5
- state: string;
6
- }
7
- export declare class Subscription {
8
- id: string;
9
- }
10
- export declare class UserPlan {
11
- id: string;
12
- plan: Plan;
13
- periodEnd: Date;
14
- subscription: Subscription;
15
- }
16
- export declare class StripeCheckoutSession {
17
- id: string;
18
- }
19
- export declare class StripeBillingPortalSession {
20
- url: string;
21
- }
22
- export interface UserIssuablePlan {
23
- plan: Plan;
24
- }
25
- export interface UserIssuedPlan {
26
- id: string;
27
- plan: Plan;
28
- token: string;
29
- tokenExpiryTime: Date;
30
- planPeriodEnd: Date;
31
- planPeriodEndAfterSeconds: number;
32
- }