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