@secrecy/lib 1.0.0-dev.9 → 1.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 (117) hide show
  1. package/README.md +1 -1
  2. package/{lib → dist}/BaseClient.d.ts +62 -69
  3. package/dist/BaseClient.js +1124 -0
  4. package/{lib → dist}/PopupTools.d.ts +1 -1
  5. package/dist/PopupTools.js +212 -0
  6. package/{lib → dist}/ZeusThunder.d.ts +0 -0
  7. package/dist/ZeusThunder.js +79 -0
  8. package/dist/cache.d.ts +6 -0
  9. package/dist/cache.js +4 -0
  10. package/dist/client/admin/index.d.ts +11 -0
  11. package/dist/client/admin/index.js +110 -0
  12. package/{lib → dist}/client/convert/file.d.ts +3 -3
  13. package/dist/client/convert/file.js +34 -0
  14. package/{lib → dist}/client/convert/mail.d.ts +0 -0
  15. package/dist/client/convert/mail.js +46 -0
  16. package/dist/client/convert/node.d.ts +9 -0
  17. package/dist/client/convert/node.js +101 -0
  18. package/{lib → dist}/client/helpers.d.ts +1 -1
  19. package/dist/client/helpers.js +114 -0
  20. package/dist/client/index.d.ts +164 -0
  21. package/dist/client/index.js +3206 -0
  22. package/{lib → dist}/client/storage.d.ts +0 -0
  23. package/dist/client/storage.js +12 -0
  24. package/dist/client/types/File.d.ts +14 -0
  25. package/dist/client/types/File.js +3 -0
  26. package/{lib → dist}/client/types/Inputs.d.ts +2 -7
  27. package/dist/client/types/Inputs.js +3 -0
  28. package/dist/client/types/Node.d.ts +49 -0
  29. package/dist/client/types/Node.js +3 -0
  30. package/{lib → dist}/client/types/UserAppNotifications.d.ts +1 -1
  31. package/dist/client/types/UserAppNotifications.js +3 -0
  32. package/{lib → dist}/client/types/UserAppSettings.d.ts +0 -1
  33. package/dist/client/types/UserAppSettings.js +3 -0
  34. package/{lib → dist}/client/types/index.d.ts +7 -13
  35. package/dist/client/types/index.js +8 -0
  36. package/dist/client/types/selectors.d.ts +476 -0
  37. package/dist/client/types/selectors.js +125 -0
  38. package/{lib → dist}/crypto/file.d.ts +0 -0
  39. package/dist/crypto/file.js +210 -0
  40. package/{lib → dist}/crypto/index.d.ts +0 -0
  41. package/dist/crypto/index.js +47 -0
  42. package/dist/error.d.ts +30 -0
  43. package/dist/error.js +3 -0
  44. package/{lib → dist}/index.d.ts +3 -3
  45. package/dist/index.js +10 -0
  46. package/{lib → dist}/minify/index.d.ts +0 -0
  47. package/dist/minify/index.js +28 -0
  48. package/{lib → dist}/minify/lz4.d.ts +0 -0
  49. package/dist/minify/lz4.js +627 -0
  50. package/{lib → dist}/sodium.d.ts +0 -0
  51. package/dist/sodium.js +6 -0
  52. package/{lib → dist}/utils/store-buddy.d.ts +0 -0
  53. package/dist/utils/store-buddy.js +65 -0
  54. package/{lib → dist}/utils/time.d.ts +0 -0
  55. package/dist/utils/time.js +14 -0
  56. package/{lib → dist/utils}/utils.d.ts +0 -0
  57. package/dist/utils/utils.js +57 -0
  58. package/{lib → dist}/worker/__mock__/sodium.worker.d.ts +0 -0
  59. package/dist/worker/__mock__/sodium.worker.js +49 -0
  60. package/{lib → dist}/worker/md5.d.ts +0 -0
  61. package/dist/worker/md5.js +25 -0
  62. package/{lib → dist}/worker/sodium.d.ts +0 -0
  63. package/dist/worker/sodium.js +120 -0
  64. package/{lib → dist}/worker/workerCodes.d.ts +0 -0
  65. package/dist/worker/workerCodes.js +3 -0
  66. package/{lib → dist}/zeus/const.d.ts +5 -0
  67. package/dist/zeus/const.js +1230 -0
  68. package/dist/zeus/index.d.ts +4069 -0
  69. package/dist/zeus/index.js +657 -0
  70. package/package.json +64 -57
  71. package/lib/BaseClient.js +0 -1332
  72. package/lib/PopupTools.js +0 -213
  73. package/lib/ZeusThunder.js +0 -115
  74. package/lib/cache.d.ts +0 -7
  75. package/lib/cache.js +0 -5
  76. package/lib/client/admin/index.d.ts +0 -10
  77. package/lib/client/admin/index.js +0 -145
  78. package/lib/client/convert/file.js +0 -39
  79. package/lib/client/convert/folder.d.ts +0 -8
  80. package/lib/client/convert/folder.js +0 -264
  81. package/lib/client/convert/mail.js +0 -46
  82. package/lib/client/convert/vFile.d.ts +0 -5
  83. package/lib/client/convert/vFile.js +0 -164
  84. package/lib/client/helpers.js +0 -116
  85. package/lib/client/index.d.ts +0 -169
  86. package/lib/client/index.js +0 -3803
  87. package/lib/client/storage.js +0 -12
  88. package/lib/client/types/File.d.ts +0 -21
  89. package/lib/client/types/File.js +0 -2
  90. package/lib/client/types/FilesOnUsersOnApplications.d.ts +0 -9
  91. package/lib/client/types/FilesOnUsersOnApplications.js +0 -2
  92. package/lib/client/types/Folder.d.ts +0 -68
  93. package/lib/client/types/Folder.js +0 -7
  94. package/lib/client/types/Inputs.js +0 -2
  95. package/lib/client/types/UserAppNotifications.js +0 -2
  96. package/lib/client/types/UserAppSettings.js +0 -2
  97. package/lib/client/types/VFile.d.ts +0 -62
  98. package/lib/client/types/VFile.js +0 -4
  99. package/lib/client/types/index.js +0 -9
  100. package/lib/client/types/queries.d.ts +0 -535
  101. package/lib/client/types/queries.js +0 -192
  102. package/lib/crypto/file.js +0 -291
  103. package/lib/crypto/index.js +0 -37
  104. package/lib/index.js +0 -41
  105. package/lib/minify/index.js +0 -28
  106. package/lib/minify/lz4.js +0 -633
  107. package/lib/sodium.js +0 -28
  108. package/lib/utils/store-buddy.js +0 -69
  109. package/lib/utils/time.js +0 -22
  110. package/lib/utils.js +0 -188
  111. package/lib/worker/__mock__/sodium.worker.js +0 -57
  112. package/lib/worker/md5.js +0 -43
  113. package/lib/worker/sodium.js +0 -155
  114. package/lib/worker/workerCodes.js +0 -3
  115. package/lib/zeus/const.js +0 -1671
  116. package/lib/zeus/index.d.ts +0 -33302
  117. package/lib/zeus/index.js +0 -558
@@ -1,169 +0,0 @@
1
- import type { MailType } from "./../zeus/index";
2
- import type { DownloadProgress } from "ky";
3
- import { BaseClient } from "../BaseClient.js";
4
- import type { Progress } from "../crypto/file.js";
5
- import type { ReceivedMail, SentMail, Folder, VFileWithFolder, FolderFull, UserAppSettings, UserAppNotifications, File as SecrecyFile, WaitingReceivedMail, DraftMail, VFile, Mail } from "./types/index.js";
6
- import type { KeyPair } from "../crypto/index.js";
7
- import type { SecrecyEnv } from "./helpers.js";
8
- import type { Rights } from "../zeus/index.js";
9
- export declare type NewMail = {
10
- body: string;
11
- subject: string;
12
- files: {
13
- id: string;
14
- name: string;
15
- }[];
16
- recipientsIds: string[];
17
- replyTo?: string | null | undefined;
18
- };
19
- export declare type ProgressCallback = (progress: Progress) => Promise<void>;
20
- export declare class SecrecyClient extends BaseClient {
21
- #private;
22
- jwt: string;
23
- constructor(uaSession: string, uaKeys: KeyPair, uaJwt: string, env: SecrecyEnv);
24
- get publicKey(): string;
25
- addFileToHistory({ fileId, vFileId }: {
26
- fileId: string;
27
- vFileId: string;
28
- }): Promise<VFile>;
29
- uploadFile({ file, encryptProgress, uploadProgress, signal }: {
30
- file: globalThis.File | Uint8Array;
31
- encryptProgress?: ProgressCallback;
32
- uploadProgress?: ProgressCallback;
33
- signal?: AbortSignal;
34
- }): Promise<string | null>;
35
- uploadFileInCloud({ file, name, folderId, encryptProgress, uploadProgress, signal }: {
36
- file: globalThis.File | Uint8Array;
37
- name: string;
38
- folderId?: string;
39
- encryptProgress?: ProgressCallback;
40
- uploadProgress?: ProgressCallback;
41
- signal?: AbortSignal;
42
- }): Promise<VFileWithFolder>;
43
- logout(sessionId?: string | null | undefined): Promise<void>;
44
- createFolder({ name, parentFolderId }: {
45
- name: string;
46
- parentFolderId?: string | null;
47
- }): Promise<FolderFull>;
48
- folder({ id, deleted }?: {
49
- id?: string | null | undefined;
50
- deleted?: boolean | null | undefined;
51
- }): Promise<FolderFull | null>;
52
- file({ id }: {
53
- id: string;
54
- }): Promise<SecrecyFile | null>;
55
- vFile({ id }: {
56
- id: string;
57
- }): Promise<VFileWithFolder | null>;
58
- mail({ id }: {
59
- id: string;
60
- }): Promise<Mail | null>;
61
- shareVFile({ vFileId, userId, rights }: {
62
- vFileId: string;
63
- userId: string;
64
- rights: Rights;
65
- }): Promise<boolean>;
66
- sharedVFiles(): Promise<VFileWithFolder[]>;
67
- vFilesSharedWithMe(): Promise<VFileWithFolder[]>;
68
- deletedVFiles(): Promise<VFile[]>;
69
- sharedFolders(): Promise<Folder[]>;
70
- foldersSharedWithMe(): Promise<Folder[]>;
71
- deletedFolders(): Promise<Folder[]>;
72
- deletedMails({ mailType }: {
73
- mailType: MailType;
74
- }): Promise<Mail[]>;
75
- shareFolder({ folderId, userId, rights }: {
76
- folderId: string;
77
- userId: string;
78
- rights: Rights;
79
- }): Promise<boolean>;
80
- updateFolder({ folderId, name, isFavorite, deletedAt }: {
81
- folderId: string;
82
- name?: string | null | undefined;
83
- isFavorite?: boolean | null | undefined;
84
- deletedAt?: Date | null | undefined;
85
- }): Promise<FolderFull>;
86
- updateAppNotifications(notifications: Partial<UserAppNotifications>): Promise<UserAppNotifications | null>;
87
- appNotifications(): Promise<UserAppNotifications | null>;
88
- createMail(data: NewMail, customMessage?: string | null | undefined): Promise<boolean>;
89
- waitingReceivedMails(): Promise<WaitingReceivedMail[]>;
90
- updateDraftMail(draftId: string, { body, subject, files, recipientsIds, replyTo }: Partial<NewMail>): Promise<DraftMail | null>;
91
- deleteDraftMail(draftId: string): Promise<boolean>;
92
- deleteVFileSharing({ vFileId, userId }: {
93
- vFileId: string;
94
- userId: string;
95
- }): Promise<boolean>;
96
- deleteFolderSharing({ folderId, userId }: {
97
- folderId: string;
98
- userId: string;
99
- }): Promise<boolean>;
100
- duplicateVFile({ vFileId, folderId, customName }: {
101
- vFileId: string;
102
- folderId?: string | null | undefined;
103
- customName?: string | null | undefined;
104
- }): Promise<boolean>;
105
- deleteFolderCloudTrash({ ids }: {
106
- ids: Array<string>;
107
- }): Promise<boolean>;
108
- deleteVFileCloudTrash({ ids }: {
109
- ids: Array<string>;
110
- }): Promise<boolean>;
111
- deleteMailTrash({ ids }: {
112
- ids: Array<string>;
113
- }): Promise<boolean>;
114
- emptyMailTrash(): Promise<boolean>;
115
- emptyCloudTrash(): Promise<boolean>;
116
- recoverVFile({ vFileId }: {
117
- vFileId: string;
118
- }): Promise<boolean>;
119
- recoverFolder({ id }: {
120
- id: string;
121
- }): Promise<boolean>;
122
- recoverMail({ mailId }: {
123
- mailId: string;
124
- }): Promise<boolean>;
125
- deleteFile({ fileId, vFileId }: {
126
- fileId: string;
127
- vFileId: string;
128
- }): Promise<boolean>;
129
- deleteVFile({ fileId }: {
130
- fileId: string;
131
- }): Promise<boolean>;
132
- deleteMail({ mailId }: {
133
- mailId: string;
134
- }): Promise<boolean>;
135
- saveInCloud({ fileId, name, folderId }: {
136
- fileId: string;
137
- name: string;
138
- folderId?: string;
139
- }): Promise<VFileWithFolder>;
140
- sendDraftMail(draftId: string, customMessage?: string | null | undefined): Promise<boolean>;
141
- sendWaitingEmails(): Promise<boolean>;
142
- createDraftMail({ body, subject, files, recipientsIds, replyTo }: NewMail): Promise<DraftMail | null>;
143
- fileContent({ fileId, onDownloadProgress, progressDecrypt, signal }: {
144
- fileId: string;
145
- onDownloadProgress?: (progress: DownloadProgress) => void;
146
- progressDecrypt?: ProgressCallback;
147
- signal?: AbortSignal;
148
- }): Promise<Uint8Array>;
149
- updateFile({ fileId, filename, isFavorite, deletedAt }: {
150
- fileId: string;
151
- filename?: string | null | undefined;
152
- isFavorite?: boolean | null | undefined;
153
- deletedAt?: Date | null | undefined;
154
- }): Promise<VFile>;
155
- readMail({ mailId }: {
156
- mailId: string;
157
- }): Promise<boolean>;
158
- unreadMail({ mailId }: {
159
- mailId: string;
160
- }): Promise<boolean>;
161
- appSettings(): Promise<UserAppSettings | null>;
162
- updateAppSettings(settings: Partial<UserAppSettings>): Promise<UserAppSettings>;
163
- receivedMails(): Promise<ReceivedMail[]>;
164
- sentMails(): Promise<SentMail[]>;
165
- draftMails(): Promise<DraftMail[]>;
166
- private perFolder;
167
- private perVFile;
168
- private _eachUser;
169
- }