@secrecy/lib 1.0.0-dev.5 → 1.0.0-dev.50

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 (116) hide show
  1. package/README.md +1 -1
  2. package/{lib → dist}/BaseClient.d.ts +62 -73
  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 +102 -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 +163 -0
  21. package/dist/client/index.js +3209 -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 +56 -0
  29. package/dist/client/types/Node.js +3 -0
  30. package/dist/client/types/UserAppNotifications.d.ts +6 -0
  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 +8 -13
  35. package/dist/client/types/index.js +8 -0
  36. package/dist/client/types/selectors.d.ts +400 -0
  37. package/dist/client/types/selectors.js +130 -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/dist/index.d.ts +12 -0
  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/dist/worker/sodium.d.ts +3 -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 +1234 -0
  68. package/dist/zeus/index.d.ts +5893 -0
  69. package/dist/zeus/index.js +681 -0
  70. package/package.json +58 -51
  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 -3699
  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/UserAppSettings.js +0 -2
  94. package/lib/client/types/VFile.d.ts +0 -62
  95. package/lib/client/types/VFile.js +0 -4
  96. package/lib/client/types/index.js +0 -8
  97. package/lib/client/types/queries.d.ts +0 -535
  98. package/lib/client/types/queries.js +0 -192
  99. package/lib/crypto/file.js +0 -291
  100. package/lib/crypto/index.js +0 -37
  101. package/lib/index.d.ts +0 -11
  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.d.ts +0 -3
  112. package/lib/worker/sodium.js +0 -141
  113. package/lib/worker/workerCodes.js +0 -3
  114. package/lib/zeus/const.js +0 -1609
  115. package/lib/zeus/index.d.ts +0 -26113
  116. 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 type { CancelToken } from "axios";
4
- import { BaseClient } from "../BaseClient.js";
5
- import type { Progress } from "../crypto/file.js";
6
- import type { ReceivedMail, SentMail, Folder, VFileWithFolder, FolderFull, UserAppSettings, File as SecrecyFile, WaitingReceivedMail, DraftMail, VFile, Mail } from "./types/index.js";
7
- import type { KeyPair } from "../crypto/index.js";
8
- import type { SecrecyEnv } from "./helpers.js";
9
- import type { Rights } from "../zeus/index.js";
10
- export declare type NewMail = {
11
- body: string;
12
- subject: string;
13
- files: {
14
- id: string;
15
- name: string;
16
- }[];
17
- recipientsIds: string[];
18
- replyTo?: string | null | undefined;
19
- };
20
- export declare type ProgressCallback = (progress: Progress) => Promise<void>;
21
- export declare class SecrecyClient extends BaseClient {
22
- #private;
23
- jwt: string;
24
- constructor(uaSession: string, uaKeys: KeyPair, uaJwt: string, env: SecrecyEnv);
25
- addFileToHistory({ fileId, vFileId }: {
26
- fileId: string;
27
- vFileId: string;
28
- }): Promise<VFile>;
29
- uploadFile({ file, encryptProgress, uploadProgress, cancelToken }: {
30
- file: globalThis.File | Uint8Array;
31
- cancelToken?: CancelToken;
32
- encryptProgress?: ProgressCallback;
33
- uploadProgress?: ProgressCallback;
34
- }): Promise<string | null>;
35
- uploadFileInCloud({ file, name, folderId, cancelToken, encryptProgress, uploadProgress }: {
36
- file: globalThis.File | Uint8Array;
37
- name: string;
38
- cancelToken?: CancelToken;
39
- folderId?: string;
40
- encryptProgress?: ProgressCallback;
41
- uploadProgress?: ProgressCallback;
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
- 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, abort }: {
142
- fileId: string;
143
- onDownloadProgress?: (progress: DownloadProgress) => void;
144
- progressDecrypt?: ProgressCallback;
145
- abort?: AbortController;
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
- }