@secrecy/lib 1.0.0-dev.25 → 1.0.0-dev.28

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 (155) hide show
  1. package/dist/BaseClient.d.ts +274 -0
  2. package/dist/BaseClient.js +2227 -0
  3. package/dist/PopupTools.d.ts +17 -0
  4. package/dist/PopupTools.js +213 -0
  5. package/dist/ZeusThunder.d.ts +2 -0
  6. package/dist/ZeusThunder.js +113 -0
  7. package/dist/cache.d.ts +7 -0
  8. package/dist/cache.js +5 -0
  9. package/dist/client/admin/index.d.ts +11 -0
  10. package/dist/client/admin/index.js +198 -0
  11. package/dist/client/convert/file.d.ts +5 -0
  12. package/dist/client/convert/file.js +39 -0
  13. package/dist/client/convert/folder.d.ts +8 -0
  14. package/dist/client/convert/folder.js +264 -0
  15. package/dist/client/convert/mail.d.ts +3 -0
  16. package/dist/client/convert/mail.js +46 -0
  17. package/dist/client/convert/vFile.d.ts +5 -0
  18. package/dist/client/convert/vFile.js +164 -0
  19. package/dist/client/helpers.d.ts +23 -0
  20. package/dist/client/helpers.js +114 -0
  21. package/dist/client/index.d.ts +172 -0
  22. package/dist/client/index.js +6169 -0
  23. package/dist/client/storage.d.ts +7 -0
  24. package/dist/client/storage.js +12 -0
  25. package/dist/client/types/File.d.ts +21 -0
  26. package/dist/client/types/File.js +3 -0
  27. package/dist/client/types/FilesOnUsersOnApplications.d.ts +9 -0
  28. package/dist/client/types/FilesOnUsersOnApplications.js +3 -0
  29. package/dist/client/types/Folder.d.ts +68 -0
  30. package/dist/client/types/Folder.js +7 -0
  31. package/dist/client/types/Inputs.d.ts +21 -0
  32. package/dist/client/types/Inputs.js +3 -0
  33. package/dist/client/types/UserAppNotifications.d.ts +6 -0
  34. package/dist/client/types/UserAppNotifications.js +3 -0
  35. package/dist/client/types/UserAppSettings.d.ts +7 -0
  36. package/dist/client/types/UserAppSettings.js +3 -0
  37. package/dist/client/types/VFile.d.ts +62 -0
  38. package/dist/client/types/VFile.js +4 -0
  39. package/dist/client/types/index.d.ts +154 -0
  40. package/dist/client/types/index.js +10 -0
  41. package/dist/client/types/queries.d.ts +535 -0
  42. package/dist/client/types/queries.js +192 -0
  43. package/dist/crypto/file.d.ts +14 -0
  44. package/dist/crypto/file.js +291 -0
  45. package/dist/crypto/index.d.ts +12 -0
  46. package/dist/crypto/index.js +45 -0
  47. package/dist/error.d.ts +30 -0
  48. package/dist/error.js +3 -0
  49. package/dist/index.d.ts +13 -3857
  50. package/dist/index.js +42 -255
  51. package/dist/minify/index.d.ts +2 -0
  52. package/dist/minify/index.js +28 -0
  53. package/dist/minify/lz4.d.ts +5 -0
  54. package/dist/minify/lz4.js +633 -0
  55. package/dist/sodium.d.ts +3 -0
  56. package/dist/sodium.js +28 -0
  57. package/dist/utils/store-buddy.d.ts +14 -0
  58. package/dist/utils/store-buddy.js +69 -0
  59. package/dist/utils/time.d.ts +10 -0
  60. package/dist/utils/time.js +22 -0
  61. package/dist/utils.d.ts +4 -0
  62. package/dist/utils.js +188 -0
  63. package/dist/worker/__mock__/sodium.worker.d.ts +19 -0
  64. package/dist/worker/__mock__/sodium.worker.js +46 -0
  65. package/dist/worker/md5.d.ts +1 -0
  66. package/dist/worker/md5.js +43 -0
  67. package/dist/worker/sodium.d.ts +3 -0
  68. package/dist/worker/sodium.js +155 -0
  69. package/dist/worker/workerCodes.d.ts +2 -0
  70. package/dist/worker/workerCodes.js +3 -0
  71. package/dist/zeus/const.d.ts +2 -0
  72. package/dist/zeus/const.js +2267 -0
  73. package/dist/zeus/index.d.ts +4043 -0
  74. package/dist/zeus/index.js +549 -0
  75. package/package.json +24 -16
  76. package/CHANGELOG.md +0 -178
  77. package/__tests__/client/client.test.ts +0 -81
  78. package/__tests__/client/folder.test.ts +0 -302
  79. package/__tests__/client/mail.test.ts +0 -476
  80. package/__tests__/client/timing.test.ts +0 -35
  81. package/__tests__/client/utils.ts +0 -41
  82. package/__tests__/client/vFile.test.ts +0 -207
  83. package/__tests__/index.test.ts +0 -171
  84. package/commitlint.config.cjs +0 -3
  85. package/dist/index.js.map +0 -1
  86. package/dist/index.mjs +0 -255
  87. package/dist/index.mjs.map +0 -1
  88. package/docs/assets/css/main.css +0 -2660
  89. package/docs/assets/images/icons.png +0 -0
  90. package/docs/assets/images/icons@2x.png +0 -0
  91. package/docs/assets/images/widgets.png +0 -0
  92. package/docs/assets/images/widgets@2x.png +0 -0
  93. package/docs/assets/js/main.js +0 -248
  94. package/docs/assets/js/search.js +0 -1
  95. package/docs/classes/baseclient.baseclient-1.html +0 -1165
  96. package/docs/classes/client.secrecyclient.html +0 -2527
  97. package/docs/enums/index.sodium.base64_variants.html +0 -205
  98. package/docs/index.html +0 -198
  99. package/docs/interfaces/client_types.draftmail.html +0 -335
  100. package/docs/interfaces/client_types.filecontentbase.html +0 -231
  101. package/docs/interfaces/client_types.filecontentcloud.html +0 -244
  102. package/docs/interfaces/client_types.filecontentreceivedmail.html +0 -244
  103. package/docs/interfaces/client_types.filecontentsentmail.html +0 -230
  104. package/docs/interfaces/client_types.receivedmail.html +0 -363
  105. package/docs/interfaces/client_types.sentmail.html +0 -335
  106. package/docs/interfaces/crypto.keypair.html +0 -202
  107. package/docs/interfaces/index.sodium.cryptobox.html +0 -185
  108. package/docs/interfaces/index.sodium.cryptokx.html +0 -185
  109. package/docs/interfaces/index.sodium.keypair.html +0 -199
  110. package/docs/interfaces/index.sodium.messagetag.html +0 -185
  111. package/docs/interfaces/index.sodium.secretbox.html +0 -185
  112. package/docs/interfaces/index.sodium.stateaddress.html +0 -171
  113. package/docs/interfaces/index.sodium.stringcryptobox.html +0 -185
  114. package/docs/interfaces/index.sodium.stringcryptokx.html +0 -185
  115. package/docs/interfaces/index.sodium.stringkeypair.html +0 -199
  116. package/docs/interfaces/index.sodium.stringmessagetag.html +0 -185
  117. package/docs/interfaces/index.sodium.stringsecretbox.html +0 -185
  118. package/docs/interfaces/utils_store_buddy.storebuddy.html +0 -333
  119. package/docs/modules/baseclient.html +0 -929
  120. package/docs/modules/cache.html +0 -185
  121. package/docs/modules/client.html +0 -207
  122. package/docs/modules/client_convert_file.html +0 -216
  123. package/docs/modules/client_convert_folder.html +0 -303
  124. package/docs/modules/client_convert_vfile.html +0 -216
  125. package/docs/modules/client_helpers.html +0 -311
  126. package/docs/modules/client_storage.html +0 -167
  127. package/docs/modules/client_types.html +0 -1227
  128. package/docs/modules/client_types_file.html +0 -233
  129. package/docs/modules/client_types_filesonusersonapplications.html +0 -168
  130. package/docs/modules/client_types_folder.html +0 -383
  131. package/docs/modules/client_types_inputs.html +0 -263
  132. package/docs/modules/client_types_mail.html +0 -181
  133. package/docs/modules/client_types_queries.html +0 -199
  134. package/docs/modules/client_types_userappsettings.html +0 -163
  135. package/docs/modules/client_types_vfile.html +0 -364
  136. package/docs/modules/crypto.html +0 -366
  137. package/docs/modules/crypto_file.html +0 -344
  138. package/docs/modules/index.html +0 -779
  139. package/docs/modules/index.sodium.html +0 -6039
  140. package/docs/modules/minify.html +0 -183
  141. package/docs/modules/minify_lz4.html +0 -279
  142. package/docs/modules/popuptools.html +0 -259
  143. package/docs/modules/sodium.html +0 -167
  144. package/docs/modules/utils.html +0 -219
  145. package/docs/modules/utils_store_buddy.html +0 -208
  146. package/docs/modules/utils_time.html +0 -330
  147. package/docs/modules/worker_md5.html +0 -156
  148. package/docs/modules/worker_sodium.html +0 -231
  149. package/docs/modules/worker_workercodes.html +0 -157
  150. package/docs/modules.html +0 -235
  151. package/index.html +0 -21
  152. package/jest.config.ts +0 -27
  153. package/jest.setup.ts +0 -6
  154. package/release.config.cjs +0 -15
  155. package/tsup.config.ts +0 -23
@@ -1,476 +0,0 @@
1
- import { raph, chris, chrisId, raphId } from "./utils.js";
2
- import { MailType } from "./../../src/zeus/index.js";
3
- import { setup } from "../../src/index.js";
4
-
5
- const mailSubject = "jest unitTest";
6
-
7
- beforeAll(setup);
8
-
9
- beforeAll(async () => {
10
- await Promise.all([chris.emptyMailTrash(), raph.emptyMailTrash()]);
11
- });
12
-
13
- afterAll(async () => {
14
- const reqRaphSentMails = await raph.sentMails();
15
- if (!reqRaphSentMails) {
16
- throw new Error("reqRaphSentMails not found");
17
- }
18
- if (reqRaphSentMails.__typename === "ErrorNotFound") {
19
- throw new Error("Error: raph sentMails not found");
20
- }
21
- const sentMailsRaph = reqRaphSentMails.data.filter(
22
- m => m.subject === mailSubject
23
- );
24
-
25
- const reqChrisSentMails = await chris.sentMails();
26
- if (!reqChrisSentMails) {
27
- throw new Error("reqChrisSentMails not found");
28
- }
29
- if (reqChrisSentMails.__typename === "ErrorNotFound") {
30
- throw new Error("Error: chris sentMails not found");
31
- }
32
- const sentMailsChris = reqChrisSentMails.data.filter(
33
- m => m.subject === mailSubject
34
- );
35
-
36
- const reqRaphReceivedMails = await raph.receivedMails();
37
- if (!reqRaphReceivedMails) {
38
- throw new Error("reqRaphReceivedMails not found");
39
- }
40
- if (reqRaphReceivedMails.__typename === "ErrorNotFound") {
41
- throw new Error("Error: raph receivedMails not found");
42
- }
43
- const receivedMailsRaph = reqRaphReceivedMails.data.filter(
44
- m => m.subject === mailSubject
45
- );
46
-
47
- const reqChrisReceivedMails = await chris.receivedMails();
48
- if (!reqChrisReceivedMails) {
49
- throw new Error("reqChrisReceivedMails not found");
50
- }
51
- if (reqChrisReceivedMails.__typename === "ErrorNotFound") {
52
- throw new Error("Error: chris receivedMails not found");
53
- }
54
- const receivedMailsChris = reqChrisReceivedMails.data.filter(
55
- m => m.subject === mailSubject
56
- );
57
-
58
- const chrisMails = [...sentMailsChris, ...receivedMailsChris].map(m =>
59
- chris.deleteMail({ mailId: m.id })
60
- );
61
- const raphMails = [...sentMailsRaph, ...receivedMailsRaph].map(m =>
62
- raph.deleteMail({ mailId: m.id })
63
- );
64
- await Promise.all([chrisMails, raphMails]);
65
- }, 50000);
66
-
67
- describe("SecrecyClient - mail", () => {
68
- test("wrong mail", async () => {
69
- //wrong mail
70
- const mail = await raph.mail({
71
- id: "id"
72
- });
73
- expect(mail).toBeNull();
74
- });
75
-
76
- test("search mail", async () => {
77
- //create draft mail
78
- const mail = await raph.createDraftMail({
79
- body: "test",
80
- subject: mailSubject,
81
- files: [],
82
- recipientsIds: [chrisId],
83
- replyTo: null
84
- });
85
-
86
- expect(mail).not.toBeNull();
87
- if (!mail) {
88
- throw new Error("empty or undefined value: mail");
89
- }
90
-
91
- if (mail.__typename !== "SuccessResponse") {
92
- throw new Error("mail is not a SuccessResponse");
93
- }
94
-
95
- //search for existing mail
96
- const mailFound = await raph.mail({
97
- id: mail.data.id
98
- });
99
- if (!mailFound) {
100
- throw new Error("undefined value: mailFound");
101
- }
102
- expect(mailFound).not.toBeNull();
103
-
104
- if (mailFound.__typename === "ErrorAccessDenied") {
105
- throw new Error("mailFound: Access denied");
106
- }
107
-
108
- //delete draft mail
109
- const deletedDraftMail = await raph.deleteDraftMail(
110
- mailFound.data.mailIntegrityId
111
- );
112
- expect(deletedDraftMail).toStrictEqual({
113
- __typename: "SuccessResponse",
114
- data: true
115
- });
116
- });
117
-
118
- test("create, send draft mail and delete send and received mail", async () => {
119
- //create draft mail
120
- const mail = await raph.createDraftMail({
121
- body: "hello ceci est un test",
122
- subject: mailSubject,
123
- files: [],
124
- recipientsIds: [chrisId],
125
- replyTo: null
126
- });
127
- expect(mail).not.toBeNull();
128
- if (!mail) {
129
- throw new Error("empty or undefined value: mail");
130
- }
131
- if (mail.__typename !== "SuccessResponse") {
132
- throw new Error("mail is not a SuccessResponse");
133
- }
134
-
135
- //search for previous created draftMail
136
- const draftMails = await raph.draftMails();
137
- if (!draftMails) {
138
- throw new Error("undefined value: draftMails");
139
- }
140
- if (draftMails.__typename === "ErrorNotFound") {
141
- throw new Error("draftMails: not found");
142
- }
143
- const draftMail = draftMails.data.find(m => m.id === mail.data.id);
144
- if (!draftMail) {
145
- throw new Error("undefined value: draftMail");
146
- }
147
- expect(draftMail).toStrictEqual(mail.data);
148
-
149
- //send draft mail
150
- const draftMailSent = await raph.sendDraftMail(
151
- mail.data.mailIntegrityId,
152
- null
153
- );
154
- expect(draftMailSent).toStrictEqual({
155
- __typename: "SuccessResponse",
156
- data: true
157
- });
158
- });
159
-
160
- test("Create, update and delete draft mails", async () => {
161
- //create draft mail
162
- const mail = await raph.createDraftMail({
163
- body: "hello ceci est un test c'est le numero 2",
164
- subject: mailSubject,
165
- files: [],
166
- recipientsIds: [chrisId],
167
- replyTo: null
168
- });
169
- expect(mail).not.toBeNull();
170
- if (!mail) {
171
- throw new Error("empty or undefined value: mail");
172
- }
173
- if (mail.__typename !== "SuccessResponse") {
174
- throw new Error("mail is not a SuccessResponse");
175
- }
176
-
177
- //search for previous created draftMail
178
- const draftMails = await raph.draftMails();
179
- if (!draftMails) {
180
- throw new Error("empty or undefined value: draftMails");
181
- }
182
- if (draftMails.__typename === "ErrorNotFound") {
183
- throw new Error("draftMails: not found");
184
- }
185
- const draftMail = draftMails.data.find(m => m.id === mail.data.id);
186
- if (!draftMail) {
187
- throw new Error("empty or undefined value: draftMail");
188
- }
189
- expect(draftMail).toStrictEqual(mail.data);
190
-
191
- //update draft mail
192
- const mailUpdated = await raph.updateDraftMail(mail.data.mailIntegrityId, {
193
- body: "hello ceci est un draft mail mis a jour",
194
- subject: mailSubject,
195
- files: [],
196
- recipientsIds: [chrisId],
197
- replyTo: null
198
- });
199
- expect(mailUpdated).not.toBeNull();
200
- if (!mailUpdated) {
201
- throw new Error("empty or undefined value: mailUpdated");
202
- }
203
- if (mailUpdated.__typename !== "SuccessResponse") {
204
- throw new Error("mailUpdated is not a SuccessResponse");
205
- }
206
-
207
- expect(mailUpdated.data.body).toBe(
208
- "hello ceci est un draft mail mis a jour"
209
- );
210
-
211
- //delete draft mail
212
- const deletedDraftMail = await raph.deleteDraftMail(
213
- mail.data.mailIntegrityId
214
- );
215
- expect(deletedDraftMail).toStrictEqual({
216
- __typename: "SuccessResponse",
217
- data: true
218
- });
219
- });
220
-
221
- test("Create and send mail", async () => {
222
- //create draftMail
223
- const mail = await raph.createDraftMail({
224
- body: "hello ceci est un test c'est le numero 3",
225
- subject: mailSubject,
226
- files: [],
227
- recipientsIds: [chrisId],
228
- replyTo: null
229
- });
230
- expect(mail).not.toBeNull();
231
- if (!mail) {
232
- throw new Error("empty or undefined value: mail");
233
- }
234
- if (mail.__typename !== "SuccessResponse") {
235
- throw new Error("mail is not a SuccessResponse");
236
- }
237
-
238
- //send draft mail
239
- const draftMailSent = await raph.sendDraftMail(
240
- mail.data.mailIntegrityId,
241
- null
242
- );
243
- expect(draftMailSent).not.toBeNull();
244
- if (!draftMailSent) {
245
- throw new Error("empty or undefined value: mail");
246
- }
247
- expect(draftMailSent.__typename).toBe("SuccessResponse");
248
-
249
- //sent Mail
250
- const sentMails = await raph.sentMails();
251
- expect(sentMails).not.toBeNull();
252
- if (!sentMails) {
253
- throw new Error("empty or undefined value: sentMails");
254
- }
255
- if (sentMails.__typename !== "SuccessResponse") {
256
- throw new Error("sentMails is not a SuccessResponse");
257
- }
258
- const mailSent = sentMails.data.find(m => m.id === mail.data.id);
259
- if (!mailSent) {
260
- throw new Error("empty or undefined value: mailSent");
261
- }
262
- expect(mailSent.id).toStrictEqual(mail.data.id);
263
- });
264
-
265
- test("Create and received mail", async () => {
266
- //create draftMail
267
- const mail = await chris.createDraftMail({
268
- body: "test mail send from chris to raph",
269
- subject: mailSubject,
270
- files: [],
271
- recipientsIds: [raphId],
272
- replyTo: null
273
- });
274
- expect(mail).not.toBeNull();
275
- if (!mail) {
276
- throw new Error("empty or undefined value: mail");
277
- }
278
- if (mail.__typename !== "SuccessResponse") {
279
- throw new Error("mail is not a SuccessResponse");
280
- }
281
-
282
- //send draft mail
283
- const draftMailSent = await chris.sendDraftMail(
284
- mail.data.mailIntegrityId,
285
- null
286
- );
287
- expect(draftMailSent).not.toBeNull();
288
- if (!draftMailSent) {
289
- throw new Error("empty or undefined value: mail");
290
- }
291
- expect(draftMailSent.__typename).toBe("SuccessResponse");
292
-
293
- //received Mail
294
- const receivedMailsToDel = await raph.receivedMails();
295
- if (!receivedMailsToDel) {
296
- throw new Error("empty or undefined value: receivedMailsToDel");
297
- }
298
- if (receivedMailsToDel.__typename === "ErrorNotFound") {
299
- throw new Error("receivedMails: not found");
300
- }
301
- const mailReceived = receivedMailsToDel.data.find(
302
- m => m.body === mail.data.body
303
- );
304
- if (!mailReceived) {
305
- throw new Error("empty or undefined value: mailReceived");
306
- }
307
- expect(mailReceived.body).toBe("test mail send from chris to raph");
308
- });
309
-
310
- test("read and unread mail", async () => {
311
- //create draftMail
312
- const mail = await chris.createDraftMail({
313
- body: "read and unread test",
314
- subject: mailSubject,
315
- files: [],
316
- recipientsIds: [raphId],
317
- replyTo: null
318
- });
319
-
320
- expect(mail).not.toBeNull();
321
- if (!mail) {
322
- throw new Error("empty or undefined value: mail");
323
- }
324
-
325
- if (mail.__typename !== "SuccessResponse") {
326
- throw new Error("mail is not a SuccessResponse");
327
- }
328
-
329
- //send draft mail
330
- const draftMailSent = await chris.sendDraftMail(
331
- mail.data.mailIntegrityId,
332
- null
333
- );
334
- expect(draftMailSent).toStrictEqual({
335
- __typename: "SuccessResponse",
336
- data: true
337
- });
338
-
339
- //mail from chris
340
- const receivedMails = await raph.receivedMails();
341
- if (!receivedMails) {
342
- throw new Error("empty or undefined value: receivedMails");
343
- }
344
- if (receivedMails.__typename === "ErrorNotFound") {
345
- throw new Error("receivedMails: not found");
346
- }
347
- const mailReceived = receivedMails.data.find(
348
- m => m.body === mail.data.body
349
- );
350
- if (!mailReceived) {
351
- throw new Error("empty or undefined value: mailReceived");
352
- }
353
- expect(mailReceived.body).toBe("read and unread test");
354
-
355
- //read mail
356
- const readMail = await raph.readMail({ mailId: mailReceived.id });
357
- expect(readMail).toStrictEqual({
358
- __typename: "SuccessResponse",
359
- data: true
360
- });
361
-
362
- //looker for mail opened
363
- const mailReaded = await raph.mail({ id: mailReceived.id });
364
- if (!mailReaded) {
365
- throw new Error("empty or undefined value: mailReaded");
366
- }
367
- if (mailReaded.__typename === "ErrorAccessDenied") {
368
- throw new Error("mailReaded: access denied");
369
- }
370
- expect(mailReaded.data.openedAt).not.toBeNull();
371
-
372
- //unread mail
373
- const unreadMail = await raph.unreadMail({ mailId: mailReceived.id });
374
- expect(unreadMail).toStrictEqual({
375
- __typename: "SuccessResponse",
376
- data: true
377
- });
378
-
379
- //looker for mail unreaded
380
- const mailUnread = await raph.mail({ id: mailReceived.id });
381
- if (!mailUnread) {
382
- throw new Error("empty or undefined value: mailUnread");
383
- }
384
- if (mailUnread.__typename === "ErrorAccessDenied") {
385
- throw new Error("mailUnread: access denied");
386
- }
387
- expect(mailUnread.data.openedAt).toBeNull();
388
- });
389
-
390
- test("deletedMails", async () => {
391
- //create draftMail
392
- const mail = await raph.createDraftMail({
393
- body: "hello ceci est un test c'est pour test les deletedMails",
394
- subject: mailSubject,
395
- files: [],
396
- recipientsIds: [chrisId],
397
- replyTo: null
398
- });
399
-
400
- expect(mail).not.toBeNull();
401
- if (!mail) {
402
- throw new Error("empty or undefined value: mail");
403
- }
404
-
405
- if (mail.__typename !== "SuccessResponse") {
406
- throw new Error("mail is not a SuccessResponse");
407
- }
408
-
409
- //send draft mail
410
- const draftMailSent = await raph.sendDraftMail(
411
- mail.data.mailIntegrityId,
412
- null
413
- );
414
- expect(draftMailSent).toStrictEqual({
415
- __typename: "SuccessResponse",
416
- data: true
417
- });
418
-
419
- //delete mail sent
420
- //sent
421
- const sentMailsRaph = await raph.sentMails();
422
- if (!sentMailsRaph) {
423
- throw new Error("empty or undefined value: sentMailsRaph");
424
- }
425
- if (sentMailsRaph.__typename === "ErrorNotFound") {
426
- throw new Error("sentMails: not found");
427
- }
428
-
429
- for (const m of sentMailsRaph.data) {
430
- if (m.subject === mailSubject) {
431
- await raph.deleteMail({ mailId: m.id });
432
- }
433
- }
434
-
435
- //deleted Mails
436
- const deletedMails = await raph.deletedMails({ mailType: MailType.sent });
437
- if (!deletedMails) {
438
- throw new Error("empty or undefined value: deletedMails");
439
- }
440
- if (deletedMails.__typename === "ErrorAccessDenied") {
441
- throw new Error("deletedMails: access denied");
442
- }
443
- expect(deletedMails.data[0].type).toBe(MailType.sent);
444
- expect(deletedMails.data[0].deletedAt).not.toBeNull();
445
- }, 50000);
446
-
447
- test("unreadReceivedMailsCount", async () => {
448
- const count = await raph.unreadReceivedMailsCount();
449
-
450
- await chris.createMail({
451
- body: "hello ceci est un test c'est pour test les unreadReceivedMailsCount",
452
- subject: mailSubject,
453
- files: [],
454
- recipientsIds: [raphId],
455
- replyTo: null
456
- });
457
-
458
- if (!count) {
459
- throw new Error("empty or undefined value: count");
460
- }
461
-
462
- if (count.__typename === "ErrorAccessDenied") {
463
- throw new Error("unreadReceivedMailsCount2: access denied");
464
- }
465
-
466
- const countTwo = await raph.unreadReceivedMailsCount();
467
- if (!countTwo) {
468
- throw new Error("empty or undefined value: count2");
469
- }
470
-
471
- if (countTwo.__typename === "ErrorAccessDenied") {
472
- throw new Error("unreadReceivedMailsCount2: access denied");
473
- }
474
- expect(count.data + 1).toBe(countTwo.data);
475
- });
476
- });
@@ -1,35 +0,0 @@
1
- import { raph } from "./utils.js";
2
- import { setup } from "../../src/index.js";
3
-
4
- beforeAll(setup);
5
-
6
- describe("Testing Timer", () => {
7
- test("Load Cloud", async () => {
8
- const load = await raph.folder();
9
- if (!load) {
10
- return false;
11
- }
12
- return true;
13
- }, 50000);
14
- test("Load Sent Mails", async () => {
15
- const load = await raph.sentMails();
16
- if (!load) {
17
- return false;
18
- }
19
- return true;
20
- }, 50000);
21
- test("Load Receive Mails", async () => {
22
- const load = await raph.receivedMails();
23
- if (!load) {
24
- return false;
25
- }
26
- return true;
27
- }, 50000);
28
- test("Load Draft Mails", async () => {
29
- const load = await raph.draftMails();
30
- if (!load) {
31
- return false;
32
- }
33
- return true;
34
- }, 50000);
35
- });
@@ -1,41 +0,0 @@
1
- import { SecrecyClient } from "../../src/index.js";
2
-
3
- export const chrisId = "ckudr5prq005801aznqly0rv2";
4
- export const axelId = "ckufkdt40004901293cxftrav";
5
- export const raphId = "ckxit9sbk6268901c1svzcvwzu";
6
-
7
- export const chris = new SecrecyClient(
8
- "e11dfbe1ba291b5fc9d69c0922e7dd6a720e0a06257c41274c98b1b597851b75",
9
- {
10
- privateKey:
11
- "dfe06b209231e07b85de05c2428b8fed7465c8c04b6b09fd10126643d229c6b1",
12
- publicKey:
13
- "27fb31855dba1e3466822dfe90e51455918d8c7934bf168816de93d922aaf705"
14
- },
15
- "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImNocmlzQHNlY3JlY3kubWUiLCJpYXQiOjE2MzM2MDU0ODksImV4cCI6MTYzNDIxMDI4OSwiYXVkIjoiaHR0cHM6Ly9hcHAuZGV2LnNlY3JlY3kubWUiLCJpc3MiOiJodHRwczovL2F1dGguc2VjcmVjeS5tZSIsInN1YiI6ImNrdWRyNmVlbjAxMjgwMWF6MzI4MXB1OHUifQ.9MuQJpLFhW2nSJA_S6svQttRxOreItOZ1876Lz-tRkjcGW6M6yLM0S5lsqrT0_DzDN1jxoRSyZA9nzfZoEnmdA",
16
- "dev"
17
- );
18
-
19
- export const axel = new SecrecyClient(
20
- "539dfe1e23b799c684ff5df0cfe52821f5debfc2cdb81da999e6a26b003e8651",
21
- {
22
- privateKey:
23
- "fd7b5a72b6f71094782a6b744bff8f0d061a32c4dcca0f0efb3c91b78ccf244f",
24
- publicKey:
25
- "00f97b35ce49815202107cd4ce7831dfb00d6ec8cafd25fb06b4e2ef1a475404"
26
- },
27
- "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImF4ZWwubGF2b2llQGdtYWlsLmNvbSIsImlhdCI6MTYzMzYwNTQ0MCwiZXhwIjoxNjM0MjEwMjQwLCJhdWQiOiJodHRwczovL2FwcC5kZXYuc2VjcmVjeS5tZSIsImlzcyI6Imh0dHBzOi8vYXV0aC5zZWNyZWN5Lm1lIiwic3ViIjoiY2t1Zmtkdm50MDEwNzAxMjk5a2ZqanpxcyJ9.XqFB7oXCqNYAlW9uP919i8rdvJjZ5AZAda76fr_9x2d5ScImVzGm6ALiG5tb8lIt804aRaJ_qAVaQdikoSG2-Q",
28
- "dev"
29
- );
30
-
31
- export const raph = new SecrecyClient(
32
- "a10db5cedd6096713ef44c4f98d62c698513cf4e77a20945e528d7cdedd6c6e2",
33
- {
34
- privateKey:
35
- "7673fa7c534987ae69dc6d7c85458133afb03e2d2c43c3a5982d1abb04c7fbdc",
36
- publicKey:
37
- "113fd1991579d5e787ea9e8ce8ec944df930586e5a04af04e9ef4971e087c04e"
38
- },
39
- "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InJhcGhhZWxtb3J0aWVyQG91dGxvb2suZnIiLCJpYXQiOjE2NDA4NzIyNjcsImV4cCI6MTY0MTQ3NzA2NywiYXVkIjoiaHR0cHM6Ly9hcHAuZGV2LnNlY3JlY3kubWUiLCJpc3MiOiJodHRwczovL2F1dGguc2VjcmVjeS5tZSIsInN1YiI6ImNreGl0YmEzcjYyNzc3MDFjMTJqM2J4Y2cwIn0.mKZVKRSxVMOy6uuTFyxJuz2tH2MWpjQZEzjbny5ScwMYdexjnkGCy1EkHX-iZ-SdcOUQkk39buIl_W1kIFQQKg",
40
- "dev"
41
- );