@lifeready/core 9.0.7 → 10.0.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.
Files changed (225) hide show
  1. package/fesm2022/lifeready-core.mjs +10522 -0
  2. package/fesm2022/lifeready-core.mjs.map +1 -0
  3. package/package.json +21 -16
  4. package/types/lifeready-core.d.ts +5329 -0
  5. package/bundles/lifeready-core.umd.js +0 -13231
  6. package/bundles/lifeready-core.umd.js.map +0 -1
  7. package/bundles/lifeready-core.umd.min.js +0 -2
  8. package/bundles/lifeready-core.umd.min.js.map +0 -1
  9. package/esm2015/lib/_common/ast.js +0 -41
  10. package/esm2015/lib/_common/deferred-promise.js +0 -24
  11. package/esm2015/lib/_common/exceptions.js +0 -186
  12. package/esm2015/lib/_common/index.js +0 -3
  13. package/esm2015/lib/_common/kc-lodash.js +0 -11
  14. package/esm2015/lib/_common/key.js +0 -28
  15. package/esm2015/lib/_common/queries.gql.js +0 -43
  16. package/esm2015/lib/_common/run-outside-angular.js +0 -80
  17. package/esm2015/lib/_common/storage.js +0 -28
  18. package/esm2015/lib/_common/types.js +0 -2
  19. package/esm2015/lib/_common/utils.js +0 -73
  20. package/esm2015/lib/api/lr-apollo.service.js +0 -47
  21. package/esm2015/lib/api/lr-graphql/index.js +0 -6
  22. package/esm2015/lib/api/lr-graphql/lr-graphql.service.js +0 -170
  23. package/esm2015/lib/api/lr-graphql/lr-merged-mutation.js +0 -216
  24. package/esm2015/lib/api/lr-graphql/lr-mutation-base.js +0 -51
  25. package/esm2015/lib/api/lr-graphql/lr-mutation.js +0 -91
  26. package/esm2015/lib/api/lr-graphql/lr.service.js +0 -18
  27. package/esm2015/lib/api/query-processor/common-processors.service.js +0 -94
  28. package/esm2015/lib/api/query-processor/index.js +0 -3
  29. package/esm2015/lib/api/query-processor/query-processor.service.js +0 -307
  30. package/esm2015/lib/api/query-processor/tp-password-reset-processor.service.js +0 -110
  31. package/esm2015/lib/api/types/graphql.types.js +0 -8
  32. package/esm2015/lib/api/types/index.js +0 -3
  33. package/esm2015/lib/api/types/lr-graphql.types.js +0 -182
  34. package/esm2015/lib/auth/auth.config.js +0 -57
  35. package/esm2015/lib/auth/auth.gql.private.js +0 -85
  36. package/esm2015/lib/auth/auth.service.js +0 -616
  37. package/esm2015/lib/auth/auth.types.js +0 -19
  38. package/esm2015/lib/contact-card/contact-card.gql.js +0 -79
  39. package/esm2015/lib/contact-card/contact-card.service.js +0 -156
  40. package/esm2015/lib/contact-card/contact-card2.gql.js +0 -29
  41. package/esm2015/lib/contact-card/contact-card2.service.js +0 -103
  42. package/esm2015/lib/encryption/encryption.service.js +0 -188
  43. package/esm2015/lib/file-upload/file-upload.service.js +0 -70
  44. package/esm2015/lib/file-upload/file-upload.types.js +0 -2
  45. package/esm2015/lib/idle/idle.service.js +0 -159
  46. package/esm2015/lib/idle/idle.types.js +0 -7
  47. package/esm2015/lib/item/item.gql.js +0 -166
  48. package/esm2015/lib/item/item.gql.private.js +0 -41
  49. package/esm2015/lib/item/item.service.js +0 -662
  50. package/esm2015/lib/item/item.types.js +0 -2
  51. package/esm2015/lib/key/key-factory.service.js +0 -226
  52. package/esm2015/lib/key/key-graph.service.js +0 -314
  53. package/esm2015/lib/key/key-meta.service.js +0 -153
  54. package/esm2015/lib/key/key.service.js +0 -124
  55. package/esm2015/lib/key/key.types.js +0 -16
  56. package/esm2015/lib/key-exchange/key-exchange.gql.js +0 -174
  57. package/esm2015/lib/key-exchange/key-exchange.service.js +0 -496
  58. package/esm2015/lib/lbop/lbop.service.js +0 -351
  59. package/esm2015/lib/life-ready.config.js +0 -96
  60. package/esm2015/lib/life-ready.module.js +0 -42
  61. package/esm2015/lib/lock/lock.gql.js +0 -40
  62. package/esm2015/lib/lock/lock.service.js +0 -64
  63. package/esm2015/lib/notification/notification.gql.js +0 -43
  64. package/esm2015/lib/notification/notification.service.js +0 -118
  65. package/esm2015/lib/password/password.gql.js +0 -28
  66. package/esm2015/lib/password/password.service.js +0 -309
  67. package/esm2015/lib/persist/persist.service.js +0 -181
  68. package/esm2015/lib/plan/plan.gql.js +0 -91
  69. package/esm2015/lib/plan/plan.service.js +0 -191
  70. package/esm2015/lib/plan/plan.types.js +0 -2
  71. package/esm2015/lib/profile/profile-details.service.js +0 -261
  72. package/esm2015/lib/profile/profile.gql.js +0 -170
  73. package/esm2015/lib/profile/profile.service.js +0 -166
  74. package/esm2015/lib/profile/profile.types.js +0 -45
  75. package/esm2015/lib/register/register.service.js +0 -173
  76. package/esm2015/lib/register/register.types.js +0 -3
  77. package/esm2015/lib/reminder/reminder.gql.js +0 -27
  78. package/esm2015/lib/reminder/reminder.service.js +0 -85
  79. package/esm2015/lib/reminder/reminder.types.js +0 -2
  80. package/esm2015/lib/scenario/scenario.constants.js +0 -2
  81. package/esm2015/lib/scenario/scenario.controller.js +0 -34
  82. package/esm2015/lib/scenario/scenario.gql.js +0 -90
  83. package/esm2015/lib/scenario/scenario.private.gql.js +0 -200
  84. package/esm2015/lib/scenario/scenario.service.js +0 -679
  85. package/esm2015/lib/scenario/scenario.types.js +0 -2
  86. package/esm2015/lib/server-config/server-config.gql.js +0 -9
  87. package/esm2015/lib/server-config/server-config.service.js +0 -41
  88. package/esm2015/lib/shared-contact-card/shared-contact-card.service.js +0 -119
  89. package/esm2015/lib/shared-contact-card/shared-contact-card2.gql.js +0 -41
  90. package/esm2015/lib/shared-contact-card/shared-contact-card2.service.js +0 -117
  91. package/esm2015/lib/slip39/slip39.service.js +0 -167
  92. package/esm2015/lib/time/time.service.js +0 -152
  93. package/esm2015/lib/tp-assembly/tp-assembly.js +0 -363
  94. package/esm2015/lib/tp-assembly/tp-assembly.private.gql.js +0 -22
  95. package/esm2015/lib/tp-assembly/tp-assembly.types.js +0 -2
  96. package/esm2015/lib/tp-password-reset/tp-password-reset-request.service.js +0 -98
  97. package/esm2015/lib/tp-password-reset/tp-password-reset-user.service.js +0 -121
  98. package/esm2015/lib/tp-password-reset/tp-password-reset.constants.js +0 -4
  99. package/esm2015/lib/tp-password-reset/tp-password-reset.controller.js +0 -34
  100. package/esm2015/lib/tp-password-reset/tp-password-reset.gql.js +0 -74
  101. package/esm2015/lib/tp-password-reset/tp-password-reset.private.gql.js +0 -166
  102. package/esm2015/lib/tp-password-reset/tp-password-reset.private.service.js +0 -54
  103. package/esm2015/lib/tp-password-reset/tp-password-reset.service.js +0 -110
  104. package/esm2015/lib/tp-password-reset/tp-password-reset.types.js +0 -2
  105. package/esm2015/lib/trusted-party/trusted-party.gql.js +0 -96
  106. package/esm2015/lib/trusted-party/trusted-party.gql.private.js +0 -51
  107. package/esm2015/lib/trusted-party/trusted-party.service.js +0 -461
  108. package/esm2015/lib/trusted-party/trusted-party.types.js +0 -2
  109. package/esm2015/lib/two-factor/two-factor.service.js +0 -74
  110. package/esm2015/lib/user/user.gql.js +0 -32
  111. package/esm2015/lib/user/user.service.js +0 -58
  112. package/esm2015/lib/user/user.types.js +0 -2
  113. package/esm2015/lib/web-crypto/web-crypto.service.js +0 -29
  114. package/esm2015/lifeready-core.js +0 -17
  115. package/esm2015/public-api.js +0 -60
  116. package/fesm2015/lifeready-core.js +0 -10970
  117. package/fesm2015/lifeready-core.js.map +0 -1
  118. package/lib/_common/ast.d.ts +0 -11
  119. package/lib/_common/deferred-promise.d.ts +0 -12
  120. package/lib/_common/exceptions.d.ts +0 -126
  121. package/lib/_common/index.d.ts +0 -2
  122. package/lib/_common/kc-lodash.d.ts +0 -5
  123. package/lib/_common/key.d.ts +0 -14
  124. package/lib/_common/queries.gql.d.ts +0 -4
  125. package/lib/_common/run-outside-angular.d.ts +0 -14
  126. package/lib/_common/storage.d.ts +0 -13
  127. package/lib/_common/types.d.ts +0 -15
  128. package/lib/_common/utils.d.ts +0 -12
  129. package/lib/api/lr-apollo.service.d.ts +0 -15
  130. package/lib/api/lr-graphql/index.d.ts +0 -5
  131. package/lib/api/lr-graphql/lr-graphql.service.d.ts +0 -81
  132. package/lib/api/lr-graphql/lr-merged-mutation.d.ts +0 -46
  133. package/lib/api/lr-graphql/lr-mutation-base.d.ts +0 -28
  134. package/lib/api/lr-graphql/lr-mutation.d.ts +0 -48
  135. package/lib/api/lr-graphql/lr.service.d.ts +0 -9
  136. package/lib/api/query-processor/common-processors.service.d.ts +0 -36
  137. package/lib/api/query-processor/index.d.ts +0 -2
  138. package/lib/api/query-processor/query-processor.service.d.ts +0 -18
  139. package/lib/api/query-processor/tp-password-reset-processor.service.d.ts +0 -15
  140. package/lib/api/types/graphql.types.d.ts +0 -30
  141. package/lib/api/types/index.d.ts +0 -2
  142. package/lib/api/types/lr-graphql.types.d.ts +0 -807
  143. package/lib/auth/auth.config.d.ts +0 -5
  144. package/lib/auth/auth.gql.private.d.ts +0 -25
  145. package/lib/auth/auth.service.d.ts +0 -72
  146. package/lib/auth/auth.types.d.ts +0 -70
  147. package/lib/contact-card/contact-card.gql.d.ts +0 -7
  148. package/lib/contact-card/contact-card.service.d.ts +0 -53
  149. package/lib/contact-card/contact-card2.gql.d.ts +0 -25
  150. package/lib/contact-card/contact-card2.service.d.ts +0 -64
  151. package/lib/encryption/encryption.service.d.ts +0 -42
  152. package/lib/file-upload/file-upload.service.d.ts +0 -15
  153. package/lib/file-upload/file-upload.types.d.ts +0 -5
  154. package/lib/idle/idle.service.d.ts +0 -47
  155. package/lib/idle/idle.types.d.ts +0 -10
  156. package/lib/item/item.gql.d.ts +0 -134
  157. package/lib/item/item.gql.private.d.ts +0 -35
  158. package/lib/item/item.service.d.ts +0 -201
  159. package/lib/item/item.types.d.ts +0 -95
  160. package/lib/key/key-factory.service.d.ts +0 -40
  161. package/lib/key/key-graph.service.d.ts +0 -41
  162. package/lib/key/key-meta.service.d.ts +0 -51
  163. package/lib/key/key.service.d.ts +0 -36
  164. package/lib/key/key.types.d.ts +0 -86
  165. package/lib/key-exchange/key-exchange.gql.d.ts +0 -141
  166. package/lib/key-exchange/key-exchange.service.d.ts +0 -179
  167. package/lib/lbop/lbop.service.d.ts +0 -99
  168. package/lib/life-ready.config.d.ts +0 -26
  169. package/lib/life-ready.module.d.ts +0 -5
  170. package/lib/lock/lock.gql.d.ts +0 -27
  171. package/lib/lock/lock.service.d.ts +0 -34
  172. package/lib/notification/notification.gql.d.ts +0 -37
  173. package/lib/notification/notification.service.d.ts +0 -64
  174. package/lib/password/password.gql.d.ts +0 -3
  175. package/lib/password/password.service.d.ts +0 -79
  176. package/lib/persist/persist.service.d.ts +0 -31
  177. package/lib/plan/plan.gql.d.ts +0 -69
  178. package/lib/plan/plan.service.d.ts +0 -111
  179. package/lib/plan/plan.types.d.ts +0 -16
  180. package/lib/profile/profile-details.service.d.ts +0 -20
  181. package/lib/profile/profile.gql.d.ts +0 -21
  182. package/lib/profile/profile.service.d.ts +0 -32
  183. package/lib/profile/profile.types.d.ts +0 -121
  184. package/lib/register/register.service.d.ts +0 -25
  185. package/lib/register/register.types.d.ts +0 -6
  186. package/lib/reminder/reminder.gql.d.ts +0 -23
  187. package/lib/reminder/reminder.service.d.ts +0 -33
  188. package/lib/reminder/reminder.types.d.ts +0 -17
  189. package/lib/scenario/scenario.constants.d.ts +0 -1
  190. package/lib/scenario/scenario.controller.d.ts +0 -10
  191. package/lib/scenario/scenario.gql.d.ts +0 -78
  192. package/lib/scenario/scenario.private.gql.d.ts +0 -16
  193. package/lib/scenario/scenario.service.d.ts +0 -655
  194. package/lib/scenario/scenario.types.d.ts +0 -64
  195. package/lib/server-config/server-config.gql.d.ts +0 -5
  196. package/lib/server-config/server-config.service.d.ts +0 -9
  197. package/lib/shared-contact-card/shared-contact-card.service.d.ts +0 -33
  198. package/lib/shared-contact-card/shared-contact-card2.gql.d.ts +0 -36
  199. package/lib/shared-contact-card/shared-contact-card2.service.d.ts +0 -45
  200. package/lib/slip39/slip39.service.d.ts +0 -42
  201. package/lib/time/time.service.d.ts +0 -26
  202. package/lib/tp-assembly/tp-assembly.d.ts +0 -177
  203. package/lib/tp-assembly/tp-assembly.private.gql.d.ts +0 -5
  204. package/lib/tp-assembly/tp-assembly.types.d.ts +0 -40
  205. package/lib/tp-password-reset/tp-password-reset-request.service.d.ts +0 -16
  206. package/lib/tp-password-reset/tp-password-reset-user.service.d.ts +0 -29
  207. package/lib/tp-password-reset/tp-password-reset.constants.d.ts +0 -3
  208. package/lib/tp-password-reset/tp-password-reset.controller.d.ts +0 -10
  209. package/lib/tp-password-reset/tp-password-reset.gql.d.ts +0 -63
  210. package/lib/tp-password-reset/tp-password-reset.private.gql.d.ts +0 -163
  211. package/lib/tp-password-reset/tp-password-reset.private.service.d.ts +0 -59
  212. package/lib/tp-password-reset/tp-password-reset.service.d.ts +0 -112
  213. package/lib/tp-password-reset/tp-password-reset.types.d.ts +0 -40
  214. package/lib/trusted-party/trusted-party.gql.d.ts +0 -85
  215. package/lib/trusted-party/trusted-party.gql.private.d.ts +0 -40
  216. package/lib/trusted-party/trusted-party.service.d.ts +0 -192
  217. package/lib/trusted-party/trusted-party.types.d.ts +0 -31
  218. package/lib/two-factor/two-factor.service.d.ts +0 -15
  219. package/lib/user/user.gql.d.ts +0 -8
  220. package/lib/user/user.service.d.ts +0 -9
  221. package/lib/user/user.types.d.ts +0 -16
  222. package/lib/web-crypto/web-crypto.service.d.ts +0 -5
  223. package/lifeready-core.d.ts +0 -16
  224. package/lifeready-core.metadata.json +0 -1
  225. package/public-api.d.ts +0 -56
@@ -1,201 +0,0 @@
1
- import { Injector, NgZone } from '@angular/core';
2
- import { LrMutation, LrService } from '../api/lr-graphql';
3
- import { ID, LrRelayIdInput } from '../api/types';
4
- import { AuthService } from '../auth/auth.service';
5
- import { FileUploadService } from '../file-upload/file-upload.service';
6
- import { KeyFactoryService } from '../key/key-factory.service';
7
- import { KeyGraphService } from '../key/key-graph.service';
8
- import { KeyService } from '../key/key.service';
9
- import { LockService } from '../lock/lock.service';
10
- import { ArchiveDirectoryOptions, BeginDeleteChildItemLinksWindowOptions, ChangeDirectoryParentsOptions, ChangeFileParentsOptions, CreateDirectoryOptions, CreateDirectoryWithStagingOptions, CreateFileOptions, CreateFileWithStagingOptions, DownloadFileContentOptions, IdKeyPair, ParentDirectoryInput, ParentRootDirectoryInput, RevertFileOptions, SetDirectoryConfidentialOptions, SetFileConfidentialOptions, UnarchiveDirectoryOptions, UpdateDirectoryOptions, UpdateFileOptions } from './item.types';
11
- export declare class ItemService extends LrService {
12
- private ngZone;
13
- private injector;
14
- private fileUploadService;
15
- private keyService;
16
- private keyFactory;
17
- private keyGraph;
18
- private lockService;
19
- private authService;
20
- private tempDirectory;
21
- constructor(ngZone: NgZone, injector: Injector, fileUploadService: FileUploadService, keyService: KeyService, keyFactory: KeyFactoryService, keyGraph: KeyGraphService, lockService: LockService, authService: AuthService);
22
- static TEMP_DIRECTORY_PLAIN_META: {
23
- kcType: string;
24
- };
25
- static TEMP_DIRECTORY_PLAIN_META_FILTER: string;
26
- downloadFileContent(options: DownloadFileContentOptions): Promise<Uint8Array>;
27
- getDirectoryKeyId(directoryId: LrRelayIdInput): Promise<string>;
28
- getFileKeyId(fileId: LrRelayIdInput): Promise<string>;
29
- getDirectoryKeyIdFromDirectoryShare(directoryShareId: LrRelayIdInput): Promise<string>;
30
- getFileKeyIdFromFileShare(fileShareId: LrRelayIdInput): Promise<string>;
31
- getDirectoryKey(directoryId: LrRelayIdInput, directoryKeyId?: LrRelayIdInput): Promise<import("../key/key.types").Key>;
32
- getFileKey(fileId: LrRelayIdInput, fileKeyId?: LrRelayIdInput): Promise<import("../key/key.types").Key>;
33
- createDirectory(options: CreateDirectoryOptions): Promise<import("./item.gql").CreateDirectoryMutationResult>;
34
- createDirectoryMutation(options: CreateDirectoryOptions): Promise<LrMutation<import("./item.gql").CreateDirectoryMutationResult, {
35
- input: {
36
- parentDirectories: ParentDirectoryInput[];
37
- parentRootDirectory: ParentRootDirectoryInput;
38
- plainMeta: string;
39
- cipherMeta: string;
40
- };
41
- }>>;
42
- updateDirectory(options: UpdateDirectoryOptions): Promise<import("./item.gql").UpdateDirectoryMutationResult>;
43
- updateDirectoryMutation(options: UpdateDirectoryOptions): Promise<LrMutation<import("./item.gql").UpdateDirectoryMutationResult, {
44
- input: {
45
- directoryId: string;
46
- plainMeta: string;
47
- cipherMeta: string;
48
- };
49
- }>>;
50
- deleteDirectory(id: ID): Promise<import("./item.gql").DeleteDirectoryMutationResult>;
51
- deleteDirectoryMutation(id: ID): LrMutation<import("./item.gql").DeleteDirectoryMutationResult, {
52
- input: {
53
- directoryId: string;
54
- };
55
- }>;
56
- createFile(options: CreateFileOptions): Promise<import("./item.gql").CreateFileMutationResult>;
57
- createFileMutation(options: CreateFileOptions): Promise<LrMutation<import("./item.gql").CreateFileMutationResult, {
58
- input: {
59
- parentDirectories: ParentDirectoryInput[];
60
- wrappedStateKey: string;
61
- contentResource: string;
62
- plainMeta: string;
63
- cipherMeta: string;
64
- };
65
- }>>;
66
- updateFile(options: UpdateFileOptions): Promise<import("./item.gql").UpdateFileMutationResult>;
67
- updateFileMutation(options: UpdateFileOptions): Promise<LrMutation<import("./item.gql").UpdateFileMutationResult, {
68
- input: {
69
- fileId: string;
70
- wrappedStateKey: string;
71
- contentResource: string;
72
- plainMeta: string;
73
- cipherMeta: string;
74
- };
75
- }>>;
76
- revertFile(options: RevertFileOptions): Promise<import("./item.gql").RevertFileMutationResult>;
77
- revertFileMutation(options: RevertFileOptions): Promise<LrMutation<import("./item.gql").RevertFileMutationResult, {
78
- input: RevertFileOptions;
79
- }>>;
80
- deleteFile(id: ID): Promise<import("./item.gql").DeleteFileMutationResult>;
81
- deleteFileMutation(id: ID): LrMutation<import("./item.gql").DeleteFileMutationResult, {
82
- input: {
83
- fileId: string;
84
- };
85
- }>;
86
- archiveDirectory(directoryId: string, options: ArchiveDirectoryOptions): Promise<import("./item.gql").ArchiveDirectoryMutationResult>;
87
- archiveDirectoryMutation(directoryId: string, options: ArchiveDirectoryOptions): LrMutation<import("./item.gql").ArchiveDirectoryMutationResult, {
88
- input: {
89
- directoryId: string;
90
- recursive: boolean;
91
- };
92
- }>;
93
- archiveFile(fileId: string): Promise<import("./item.gql").ArchiveFileMutationResult>;
94
- archiveFileMutation(fileId: string): LrMutation<import("./item.gql").ArchiveFileMutationResult, {
95
- input: {
96
- fileId: string;
97
- };
98
- }>;
99
- unarchiveDirectory(directoryId: string, options: UnarchiveDirectoryOptions): Promise<import("./item.gql").UnarchiveDirectoryMutationResult>;
100
- unarchiveDirectoryMutation(directoryId: string, options: UnarchiveDirectoryOptions): LrMutation<import("./item.gql").UnarchiveDirectoryMutationResult, {
101
- input: {
102
- directoryId: string;
103
- recursive: boolean;
104
- };
105
- }>;
106
- unarchiveFile(fileId: string): Promise<import("./item.gql").UnarchiveFileMutationResult>;
107
- unarchiveFileMutation(fileId: string): LrMutation<import("./item.gql").UnarchiveFileMutationResult, {
108
- input: {
109
- fileId: string;
110
- };
111
- }>;
112
- changeDirectoryParents(options: ChangeDirectoryParentsOptions): Promise<import("./item.gql").ChangeDirectoryParentsMutationResult>;
113
- changeDirectoryParentsMutation(options: ChangeDirectoryParentsOptions): Promise<LrMutation<import("./item.gql").ChangeDirectoryParentsMutationResult, {
114
- input: {
115
- directoryId: string;
116
- directoriesToRemove: string[];
117
- directoriesToAdd: ParentDirectoryInput[];
118
- };
119
- }>>;
120
- changeFileParents(options: ChangeFileParentsOptions): Promise<import("./item.gql").ChangeFileParentsMutationResult>;
121
- changeFileParentsMutation(options: ChangeFileParentsOptions): Promise<LrMutation<import("./item.gql").ChangeFileParentsMutationResult, {
122
- input: {
123
- fileId: string;
124
- directoriesToRemove: string[];
125
- directoriesToAdd: ParentDirectoryInput[];
126
- };
127
- }>>;
128
- beginDeleteChildItemLinksWindow(options: BeginDeleteChildItemLinksWindowOptions): Promise<import("./item.gql").BeginDeleteChildItemLinksWindowMutationResult>;
129
- /**
130
- * Schedule cleanup of the hard links in a directory.
131
- * The server will delete all hard link within the directory within a time window: starting from now and
132
- * ending at requestWindowMs after now.
133
- * The server decides _when_ it will perform the delete. It's not guaranteed that it will perform
134
- * the delete at "now + requestWindowMs", but it will happen at some time after "now + requestWindowMs".
135
- * This allows multiple overlapping calls to this function and the server allocates enough for each request.
136
- * The server has a setting that allows for a maximum value on requestWindowMs. If the requested value
137
- * is larger than this maximum, the call will fail.
138
- */
139
- beginDeleteChildItemLinksWindowMutation(options: BeginDeleteChildItemLinksWindowOptions): Promise<LrMutation<import("./item.gql").BeginDeleteChildItemLinksWindowMutationResult, {
140
- input: BeginDeleteChildItemLinksWindowOptions;
141
- }>>;
142
- /**
143
- *
144
- * This method may raise VERSION_MISMATCH exception if there is a race condition
145
- * when multiple clients try to create the temp directory.
146
- *
147
- * TODO There is a retry mechanism in graphql with exponential back off but that's internal.
148
- * But need to use an exponential back off lib if we want to retry here.
149
- *
150
- * @returns The ID of the temp directory
151
- *
152
- */
153
- ensureTempDirectory(): Promise<IdKeyPair>;
154
- createDirectoryWithStaging(options: CreateDirectoryWithStagingOptions): Promise<import("./item.gql").ChangeDirectoryParentsMutationResult>;
155
- /**
156
- * You must run this mutation within the temp directory cleanup window on the
157
- * server, otherwise the temp directory will get cleaned up.
158
- *
159
- */
160
- createDirectoryWithStagingMutation(options: CreateDirectoryWithStagingOptions): Promise<LrMutation<import("./item.gql").ChangeDirectoryParentsMutationResult, {
161
- input: {
162
- directoryId: string;
163
- directoriesToRemove: string[];
164
- directoriesToAdd: ParentDirectoryInput[];
165
- };
166
- }>>;
167
- createFileWithStaging(options: CreateFileWithStagingOptions): Promise<import("./item.gql").ChangeFileParentsMutationResult>;
168
- createFileWithStagingMutation(options: CreateFileWithStagingOptions): Promise<LrMutation<import("./item.gql").ChangeFileParentsMutationResult, {
169
- input: {
170
- fileId: string;
171
- directoriesToRemove: string[];
172
- directoriesToAdd: ParentDirectoryInput[];
173
- };
174
- }>>;
175
- setFileConfidential(options: SetFileConfidentialOptions): Promise<import("./item.gql").SetFileConfidentialMutationResult>;
176
- setFileConfidentialMutation(options: SetFileConfidentialOptions): Promise<LrMutation<import("./item.gql").SetFileConfidentialMutationResult, {
177
- input: {
178
- fileId: string;
179
- confidential: boolean;
180
- };
181
- }>>;
182
- setDirectoryConfidential(options: SetDirectoryConfidentialOptions): Promise<import("./item.gql").SetDirectoryConfidentialMutationResult>;
183
- setDirectoryConfidentialMutation(options: SetDirectoryConfidentialOptions): Promise<LrMutation<import("./item.gql").SetDirectoryConfidentialMutationResult, {
184
- input: {
185
- directoryId: string;
186
- confidential: boolean;
187
- };
188
- }>>;
189
- private prepareParentDirectory;
190
- private getFileStateKeyId;
191
- private prepareCreateFileState;
192
- private prepareChangeItemParents;
193
- private prepareItem;
194
- private prepareCreateDirectory;
195
- private prepareUpdateDirectory;
196
- private prepareCreateFile;
197
- private prepareUpdateFile;
198
- private prepareChangeDirectoryParents;
199
- private prepareChangeFileParents;
200
- private onLogout;
201
- }
@@ -1,95 +0,0 @@
1
- import { JSONObject, LinkTypeField, LrRelayIdInput } from '../api/types';
2
- import { SomeRequired } from '../_common/types';
3
- export interface IdKeyPair {
4
- id: string;
5
- keyId: string;
6
- }
7
- export interface ParentDirectoryOptions {
8
- directory?: IdKeyPair;
9
- linkType?: LinkTypeField;
10
- directoryId?: LrRelayIdInput;
11
- wrappingKeyId?: LrRelayIdInput;
12
- }
13
- export interface ParentRootDirectoryInput {
14
- wrappedKey: string;
15
- wrappingKeyId: LrRelayIdInput;
16
- }
17
- export interface ParentDirectoryInput {
18
- directoryId: LrRelayIdInput;
19
- wrappingKeyId?: LrRelayIdInput;
20
- wrappedKey?: string;
21
- linkType?: LinkTypeField;
22
- }
23
- export interface DownloadFileContentOptions {
24
- fileStateNodeId: LrRelayIdInput;
25
- fileStateKeyId?: LrRelayIdInput;
26
- }
27
- export interface CommonDirectoryOptions {
28
- plainMetaJson?: JSONObject;
29
- cipherMetaClearJson?: JSONObject;
30
- }
31
- export interface CreateDirectoryOptions extends CommonDirectoryOptions {
32
- asRootDirectory?: boolean;
33
- parentDirectories?: ParentDirectoryOptions[];
34
- }
35
- export interface UpdateDirectoryOptions extends CommonDirectoryOptions {
36
- directoryId: LrRelayIdInput;
37
- directoryKeyId?: LrRelayIdInput;
38
- }
39
- export interface CommonFileOptions {
40
- plainMetaJson?: JSONObject;
41
- cipherMetaClearJson?: JSONObject;
42
- file?: File | ArrayBuffer;
43
- upload?: (cipherFileContent: string) => Promise<string>;
44
- }
45
- export interface CreateFileOptions extends CommonFileOptions {
46
- parentDirectories: ParentDirectoryOptions[];
47
- }
48
- export interface UpdateFileOptions extends CommonFileOptions {
49
- fileId: LrRelayIdInput;
50
- fileKeyId?: LrRelayIdInput;
51
- }
52
- export interface RevertFileOptions {
53
- fileId: LrRelayIdInput;
54
- versionId: LrRelayIdInput;
55
- }
56
- export interface ChangeItemParentsOptions {
57
- parentsToRemove?: LrRelayIdInput[];
58
- parentsToAdd?: ParentDirectoryOptions[];
59
- }
60
- export interface ChangeDirectoryParentsOptions extends ChangeItemParentsOptions {
61
- directory?: IdKeyPair;
62
- directoryId?: LrRelayIdInput;
63
- directoryKeyId?: LrRelayIdInput;
64
- }
65
- export interface ChangeFileParentsOptions extends ChangeItemParentsOptions {
66
- file?: IdKeyPair;
67
- fileId?: LrRelayIdInput;
68
- fileKeyId?: LrRelayIdInput;
69
- }
70
- export interface BeginDeleteChildItemLinksWindowOptions {
71
- directoryId: LrRelayIdInput;
72
- requestWindowMs: number;
73
- }
74
- export interface CreateDirectoryWithStagingOptions extends Omit<SomeRequired<CreateDirectoryOptions, 'parentDirectories'>, 'asRootDirectory'> {
75
- requestWindowMs: number;
76
- onCreatedInStaging: (directory: IdKeyPair) => Promise<void>;
77
- }
78
- export interface CreateFileWithStagingOptions extends CreateFileOptions {
79
- requestWindowMs: number;
80
- onCreatedInStaging: (file: IdKeyPair) => Promise<void>;
81
- }
82
- export interface SetFileConfidentialOptions {
83
- fileId: LrRelayIdInput;
84
- confidential: boolean;
85
- }
86
- export interface SetDirectoryConfidentialOptions {
87
- directoryId: LrRelayIdInput;
88
- confidential: boolean;
89
- }
90
- export interface ArchiveDirectoryOptions {
91
- recursive: boolean;
92
- }
93
- export interface UnarchiveDirectoryOptions {
94
- recursive: boolean;
95
- }
@@ -1,40 +0,0 @@
1
- /// <reference types="node" />
2
- import { JWK } from 'node-jose';
3
- import { JSONObject } from '../api/types';
4
- import { WebCryptoService } from '../web-crypto/web-crypto.service';
5
- import { DeriveKeyResult, DeriveLbopKeyParams, DerivePassIdpParams, DerivePassKeyParams, LbopKeyParams, PassIdpParams, PassKeyParams } from './key.types';
6
- export declare class KeyFactoryService {
7
- private webCryptoService;
8
- constructor(webCryptoService: WebCryptoService);
9
- private readonly kcCrypto;
10
- private readonly store;
11
- readonly MIN_PASS_IDP_PBKDF_ITER = 100000;
12
- readonly MIN_PASS_KEY_PBKDF_ITER = 100000;
13
- readonly MIN_LBOP_KEY_PBKDF_ITER = 100000;
14
- readonly DEFAULT_PASS_IDP_PBKDF_ITER = 100000;
15
- readonly DEFAULT_PASS_KEY_PBKDF_ITER = 100000;
16
- readonly DEFAULT_LBOP_KEY_PBKDF_ITER = 100000;
17
- static asKey(key: string | Buffer | Record<string, JSONObject> | JWK.RawKey, form?: 'json' | 'private' | 'pkcs8' | 'public' | 'spki' | 'pkix' | 'x509' | 'pem', extras?: Record<string, unknown>): Promise<JWK.Key>;
18
- randomString(digits: number): string;
19
- randomDigitsNoZeros(digits: number): string;
20
- randomChoices<T>(array: T[], chooseN: number): T[];
21
- createSalt(): string;
22
- createKey(): Promise<JWK.Key>;
23
- createSignKey(): Promise<JWK.Key>;
24
- createPkcKey(): Promise<JWK.Key>;
25
- createPkcSignKey(): Promise<JWK.Key>;
26
- importPassword(plainPassword: string): Promise<CryptoKey>;
27
- deriveKey({ password, salt, iterations, kid, }: {
28
- password: CryptoKey;
29
- salt: string;
30
- iterations: number;
31
- kid?: string;
32
- }): Promise<DeriveKeyResult>;
33
- derivePassIdp(params: DerivePassIdpParams): Promise<DeriveKeyResult>;
34
- derivePassKey(params: DerivePassKeyParams): Promise<DeriveKeyResult>;
35
- deriveLbopKey(params: DeriveLbopKeyParams): Promise<DeriveKeyResult>;
36
- createKid(): Promise<string>;
37
- createPassIdpParams(): Promise<PassIdpParams>;
38
- createPassKeyParams(): Promise<PassKeyParams>;
39
- createLbopKeyParams(): Promise<LbopKeyParams>;
40
- }
@@ -1,41 +0,0 @@
1
- import { JWK } from 'node-jose';
2
- import { JSONObject } from '../api/types';
3
- import { DecryptOptions, EncryptionService } from '../encryption/encryption.service';
4
- import { KeyFactoryService } from './key-factory.service';
5
- import { KeyService, UserKeys } from './key.service';
6
- import { Key, KeyGraphEdge, KeyGraphResponse, PassKey } from './key.types';
7
- export interface GraphKey extends Key {
8
- task?: Promise<any>;
9
- }
10
- export declare class KeyGraphService {
11
- private encryptionService;
12
- private keyService;
13
- private keyFactory;
14
- private graph;
15
- constructor(encryptionService: EncryptionService, keyService: KeyService, keyFactory: KeyFactoryService);
16
- purgeKeys(): void;
17
- populateKeys(userKey: UserKeys): Promise<void>;
18
- hasKey(keyId: string): boolean;
19
- private getNode;
20
- key(id: any): GraphKey;
21
- passKey(id: any): PassKey;
22
- addKeys(src: KeyGraphResponse): void;
23
- tracePath(distances: any, keyId: string): KeyGraphEdge[];
24
- getPath(knownKeyId: string, keyId: string): KeyGraphEdge[];
25
- getJwkKey(keyOrId: string | Key, getKeyIdCallback?: () => Promise<string> | string): Promise<JWK.Key>;
26
- getKey(keyOrId: string | Key, getKeyIdCallback?: () => Promise<string> | string): Promise<Key>;
27
- private _unwrapLink;
28
- private _unwrap;
29
- unwrapWithPassKey(passKeyId: string, passKey: JWK.Key, keyId: string): Promise<Key>;
30
- unwrapKey(masterKeyId: string, keyId: string): Promise<Key>;
31
- decryptFromString<T>(keyOrId: string | Key, cipherData: string, options?: DecryptOptions): Promise<T>;
32
- decryptFile(keyId: string, file: any): Promise<any>;
33
- encryptToString(key: string | Key | JWK.Key, content: any): Promise<string>;
34
- wrapKey(wrappingKey: string | Key | JWK.Key, key: JWK.Key): Promise<string>;
35
- encryptWithNewKey(wrappingKeyId: string, cipherClearJson: JSONObject): Promise<{
36
- key: JWK.Key;
37
- wrappingKeyId: string;
38
- wrappedKey: string;
39
- cipher: string;
40
- }>;
41
- }
@@ -1,51 +0,0 @@
1
- import { JWK } from 'node-jose';
2
- import { LrApolloService } from '../api/lr-apollo.service';
3
- import { ID } from '../api/types';
4
- import { EncryptionService } from '../encryption/encryption.service';
5
- import { KeyFactoryService } from './key-factory.service';
6
- import { KeyGraphService } from './key-graph.service';
7
- import { KeyService } from './key.service';
8
- export interface DirectoryKeyQueryResult {
9
- directory: {
10
- keyId: ID;
11
- };
12
- }
13
- export declare const DirectoryKeyQuery: import("../_common/ast").TypedDocumentNode<DirectoryKeyQueryResult>;
14
- export interface HasCipherMeta {
15
- keyId: string;
16
- cipherMeta: string;
17
- }
18
- export declare class WrappedContent {
19
- key: JWK.Key;
20
- cipherMeta: string;
21
- wrappedKeys?: WrappingKey[];
22
- rootKey?: WrappingKey;
23
- }
24
- export declare class WrappingKey {
25
- directoryId?: string;
26
- wrappingKeyId: string;
27
- wrappedKey: string;
28
- }
29
- export declare class KeyMetaService {
30
- private encryptionService;
31
- private keyGraph;
32
- private lrApollo;
33
- private keyService;
34
- private keyFactory;
35
- constructor(encryptionService: EncryptionService, keyGraph: KeyGraphService, lrApollo: LrApolloService, keyService: KeyService, keyFactory: KeyFactoryService);
36
- decryptMeta<T>(metaHaver: HasCipherMeta): Promise<T>;
37
- doubleWrapContent(secureContent: any, categoryIds: string[], fileContent?: ArrayBuffer): Promise<{
38
- rootKey: WrappingKey;
39
- wrappedKeys: WrappingKey[];
40
- doubleWrappedKey: string;
41
- cipherMeta: string;
42
- cipherFileContent: string;
43
- }>;
44
- reWrapContent(keyId: string, secureContent: any): Promise<{
45
- doubleWrappedKey: string;
46
- cipherMeta: string;
47
- }>;
48
- wrapContent(secureContent: any, categoryIds?: string[]): Promise<WrappedContent>;
49
- wrapContentWithKey(secureContent: any, keyId: string): Promise<WrappedContent>;
50
- private getDirectoryKeyId;
51
- }
@@ -1,36 +0,0 @@
1
- import { KcConfig } from '../life-ready.config';
2
- import { PersistService } from '../persist/persist.service';
3
- import { Key, PassKey } from './key.types';
4
- export declare class UserKeys {
5
- passKey: PassKey;
6
- masterKey: Key;
7
- rootKey?: Key;
8
- pxk?: Key;
9
- sigPxk?: Key;
10
- }
11
- export declare class KeyService {
12
- private config;
13
- private persistService;
14
- private readonly STORE_MASTER_KEY;
15
- private keys;
16
- private masterKey;
17
- readonly MIN_PASS_IDP_PBKDF_ITER = 100000;
18
- readonly MIN_PASS_KEY_PBKDF_ITER = 100000;
19
- readonly MIN_LBOP_KEY_PBKDF_ITER = 100000;
20
- readonly DEFAULT_PASS_IDP_PBKDF_ITER = 100000;
21
- readonly DEFAULT_PASS_KEY_PBKDF_ITER = 100000;
22
- readonly DEFAULT_LBOP_KEY_PBKDF_ITER = 100000;
23
- constructor(config: KcConfig, persistService: PersistService);
24
- resetKeys(): void;
25
- purgeKeys(): void;
26
- setKeys(keys: UserKeys): void;
27
- get currentPassKey(): Key;
28
- get currentMasterKey(): Key;
29
- get currentRootKey(): Key;
30
- get currentPxk(): Key;
31
- get currentSigPxk(): Key;
32
- private expiresAfter;
33
- persistMasterKey(masterKey: Key, expiresAfterSeconds: number): Promise<void>;
34
- setMasterKeyExpiresAfterSeconds(seconds: number): Promise<void>;
35
- loadMasterKey(masterKeyId: string): Promise<Key>;
36
- }
@@ -1,86 +0,0 @@
1
- import { JWK } from 'node-jose';
2
- import { JSONObject, PassKeyNode } from '../api/types';
3
- import { HasEdges, SomeRequired } from '../_common/types';
4
- export interface Key {
5
- id: string;
6
- pbk?: string;
7
- jwk?: JWK.Key;
8
- }
9
- export interface PassKeyParams {
10
- kid: string;
11
- salt: string;
12
- iterations: number;
13
- }
14
- export interface PassIdpParams {
15
- salt: string;
16
- iterations: number;
17
- }
18
- export interface LbopKeyParams {
19
- kid: string;
20
- salt: string;
21
- iterations: number;
22
- }
23
- export interface PassIdpVerifier {
24
- wrappedPrK: Record<string, JSONObject>;
25
- pbk: Record<string, JSONObject>;
26
- }
27
- export interface LbopKeyVerifier {
28
- wrappedKey: Record<string, JSONObject>;
29
- key: Record<string, JSONObject>;
30
- }
31
- export declare type PassKey = SomeRequired<PassKeyNode, 'id'>;
32
- export interface KeyLink {
33
- keyId: string;
34
- wrappingKeyId: string;
35
- nestedWrappingKeyIds: string[];
36
- wrappedKey: string;
37
- }
38
- export interface PassKeyLink {
39
- keyId: string;
40
- passKeyId: string;
41
- wrappedKey: string;
42
- }
43
- export declare enum KeyGraphNodeType {
44
- Key = "key",
45
- PassKey = "passKey"
46
- }
47
- export interface KeyGraphNode {
48
- type: KeyGraphNodeType;
49
- data: Key | PassKey;
50
- }
51
- export declare enum KeyGraphEdgeType {
52
- KeyLink = "keyLink",
53
- PassKeyLink = "passKeyLink"
54
- }
55
- export interface KeyGraphEdge {
56
- type: KeyGraphEdgeType;
57
- data: KeyLink | PassKeyLink;
58
- }
59
- export interface KeyGraphResponse {
60
- keys?: Key[];
61
- keyLinks?: KeyLink[];
62
- passKeys?: PassKey[];
63
- passKeyLinks?: PassKeyLink[];
64
- }
65
- export interface HasKeyGraph {
66
- keyGraph?: KeyGraphResponse;
67
- }
68
- export declare enum PayloadType {
69
- JSON = "JSON",
70
- UINT_8_ARRAY = "UINT_8_ARRAY"
71
- }
72
- export interface DeriveKeyResult {
73
- jwk: JWK.Key;
74
- }
75
- export interface DerivePassIdpParams extends PassIdpParams {
76
- password: CryptoKey;
77
- }
78
- export interface DerivePassKeyParams extends PassKeyParams {
79
- password: CryptoKey;
80
- }
81
- export interface DeriveLbopKeyParams extends PassKeyParams {
82
- password: CryptoKey;
83
- }
84
- export interface HasKeyGraphEdges<T> extends HasKeyGraph {
85
- list: HasEdges<T>;
86
- }