Compare commits

...
Author SHA1 Message Date
StandardNotes CI 168880eec6 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-28 16:23:45 +00:00
Karol Sójko 94de5b73db chore: skip test to allow server changes in behavior 2023-09-28 14:34:59 +02:00
Karol Sójko 4b1140d8f0 chore: fix getting vault method (#2547)
* chore: fix getting vault method

* remove only attribute

* fix checking for vaults

* fix expected missing vaults
2023-09-28 14:18:48 +02:00
Aman Harwara 397d33285c chore: update delegated contacts test 2023-09-27 18:27:51 +05:30
Karol Sójko 981417f952 chore: designated survivor test suite (#2540)
* chore: designated survivor test suite

* add more tests

* fix: tests exclusivness

* fix removing account from shared vaults test
2023-09-27 14:27:12 +02:00
StandardNotes CI 70cc15c6d9 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-26 14:02:07 +00:00
Aman Harwara 9de994bcba chore: add tests for moving items into vault (#2539) 2023-09-26 18:37:17 +05:30
Mo 896bd1eda7 chore: add test for invalid content type duplication 2023-09-26 07:48:59 -05:00
StandardNotes CI 487f3e7b57 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-26 12:36:13 +00:00
Karol Sójko 2ce908da29 chore: add method to designate a shared vault survivor (#2538) 2023-09-26 13:48:36 +02:00
Aman Harwara 60f96bc201 chore: handle moving & removing tags with subtags into/out of vaults (#2528) 2023-09-26 16:40:09 +05:30
Karol Sójko fe0cd96883 chore: re-enable history tests (#2536) 2023-09-26 12:31:44 +02:00
Aman Harwara b2ead8fc84 chore: handle notification on guest when host cancels invite (#2537) 2023-09-26 15:53:18 +05:30
Karol Sójko 3777a5389e chore: refactor notifications and re-enable vault tests (#2532)
* chore: refactor notifications and re-enable vault tests

* fix message in error expected
2023-09-26 10:21:26 +02:00
StandardNotes CI 192a2eccb8 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-26 07:58:07 +00:00
Aman Harwara 2a27e512fb chore: fix conflicts filter 2023-09-26 12:57:42 +05:30
StandardNotes CI 4aa7314eef chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-25 13:35:49 +00:00
Karol Sójko bd803aed0c chore: disable vault tests to allow notifications refactor 2023-09-25 15:05:59 +02:00
StandardNotes CI 7364d6b0e0 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-22 14:54:11 +00:00
Aman Harwara 9fa52d9039 chore: fix note view error [skip e2e] 2023-09-22 20:08:35 +05:30
Aman Harwara e357a7820c chore: allow viewing note history as readonly member 2023-09-22 19:48:49 +05:30
StandardNotes CI ab1699c114 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-22 14:03:16 +00:00
Karol Sójko c084dcd11e chore: enable vault tests (#2518) 2023-09-22 15:09:45 +02:00
StandardNotes CI 41ae1dae83 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-22 11:31:32 +00:00
Karol Sójko f7d204b205 chore: add designated survivor uuid to shared vault metadata (#2527)
* chore: add designated survivor uuid to shared vault metadata

* fix specs
2023-09-22 12:54:42 +02:00
StandardNotes CI 2c599df6be chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-22 08:11:18 +00:00
Aman Harwara 80711a17fa chore: handle notification of another member being removed (#2525) 2023-09-22 13:10:53 +05:30
StandardNotes CI 07d18a6e9a chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-21 17:32:30 +00:00
Aman Harwara 6839ad9e5a chore: clear multiple selection if selected items are not supposed to be in the current view anymore 2023-09-21 22:27:03 +05:30
StandardNotes CI 1defde14fe chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-21 16:48:34 +00:00
Aman Harwara febaf5185d chore: when creating new tag from link input, move it to the vault the item is in before linking 2023-09-21 21:46:46 +05:30
StandardNotes CI d55d0eb806 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-21 15:26:24 +00:00
Aman Harwara 6530aa4c79 chore: hide conflicts button if note is readonly 2023-09-21 20:24:29 +05:30
Aman Harwara e36c36f401 chore: fix conflicts count not taking into account exclusive vault mode (#2505) 2023-09-21 20:04:05 +05:30
StandardNotes CI 40d45d2484 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
2023-09-21 08:33:38 +00:00
Aman Harwara bd1310b1fc chore: show alert when deleting contact belonging to an owned vault 2023-09-21 13:29:16 +05:30
StandardNotes CI 062e50e901 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].8
2023-09-20 15:50:55 +00:00
Aman Harwara ec61901aa5 fix: Fixed issue where using table or image option in Super mobile toolbar would make uninteractive 2023-09-20 20:52:01 +05:30
Karol Sójko 0d15858b5f chore: fix notification type on shared vault user removal (#2521) 2023-09-20 17:01:07 +02:00
StandardNotes CI 09d139846e chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
2023-09-20 13:40:09 +00:00
Karol Sójko da234f960e chore: skip still flaky history tests (#2520) 2023-09-20 15:10:23 +02:00
StandardNotes CI f7c2434141 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
2023-09-20 12:25:08 +00:00
Aman Harwara e2901d9535 chore: only invalidate vault user cache when required (#2519) 2023-09-20 17:20:30 +05:30
StandardNotes CI 3a42925ca2 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
2023-09-20 10:25:37 +00:00
Karol Sójko 3e1557ab36 chore: fix history test with additional await if needed (#2517) 2023-09-20 11:50:15 +02:00
StandardNotes CI 9e1583f798 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2023-09-19 19:23:41 +00:00
Aman Harwara 35d92be63c chore: update vaults preferences 2023-09-20 00:22:34 +05:30
Karol Sójko 3b61fa5911 chore: disabling history tests as they are still flaky 2023-09-19 15:13:19 +02:00
StandardNotes CI 0f046cbe83 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2023-09-19 06:04:39 +00:00
Karol Sójko 102d9c8e2d chore: re-enable flaky history tests (#2510) 2023-09-19 07:33:58 +02:00
StandardNotes CI ca01b2dc95 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2023-09-18 17:39:29 +00:00
Aman Harwara dbf918523c chore: show account update prompt in vaults preferences if account protocol is older than 004 2023-09-18 22:39:24 +05:30
StandardNotes CI fe8521eff7 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2023-09-18 14:51:53 +00:00
Aman Harwara 48e7820100 chore: vault member permissions (#2509) 2023-09-18 19:53:34 +05:30
StandardNotes CI 2af610c7bf chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2023-09-16 10:17:30 +00:00
Aman Harwara 896372f04d feat: Added table cell menu for adding/removing rows and columns to Super note tables and merging cells (#2508) 2023-09-16 15:14:20 +05:30
StandardNotes CI 2ff120d29c chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-15 15:37:35 +00:00
Aman Harwara dcd64408a1 chore: update vaults prefs (#2504) 2023-09-15 20:30:41 +05:30
StandardNotes CI 983b122537 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-15 11:26:50 +00:00
Aman Harwara 520bede842 chore: fix issue where child tags would get hidden in exclusive vault mode if parent tag is in different vault (#2502) 2023-09-15 16:28:16 +05:30
StandardNotes CI 2ecd6cf5cd chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-15 10:48:02 +00:00
Aman Harwara daab6e12cf chore: make "move to vault" stricter if item has links (#2501) 2023-09-15 15:46:57 +05:30
StandardNotes CI a3e1a1f366 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-15 09:41:10 +00:00
Karol Sójko 7f7ff6a8ce chore: upgrade simplewebauthn library (#2500) 2023-09-15 11:11:41 +02:00
Aman Harwara aab67ff5d8 chore: update note vault change correctly 2023-09-15 14:26:54 +05:30
StandardNotes CI 3d0c08e283 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-15 08:48:18 +00:00
Aman Harwara fab0e9a27b chore: show permission in members/invites list 2023-09-15 13:43:02 +05:30
Aman Harwara daea46d764 chore: fix count bubble styles 2023-09-15 13:43:02 +05:30
StandardNotes CI 9407b61787 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-15 08:08:51 +00:00
Aman Harwara a977e7f754 chore: add keys to array map 2023-09-15 00:49:12 +05:30
StandardNotes CI 1e2c26ffeb chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-14 17:05:19 +00:00
Aman Harwara c3996be0fa chore: add options menu to vault selection menu items (#2497) 2023-09-14 22:02:40 +05:30
StandardNotes CI 6759457f39 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-14 10:29:22 +00:00
Aman Harwara 7b0e4d0edc chore: show current vault in template note if using exclusive mode 2023-09-14 15:25:24 +05:30
Aman Harwara cac8f4adf5 chore: fix input border color 2023-09-14 13:28:59 +05:30
StandardNotes CI c80424b3ee chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-13 19:51:22 +00:00
Aman Harwara 26f8815a4d chore: fix create new note regression 2023-09-14 00:48:13 +05:30
StandardNotes CI 557036dd27 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-13 14:28:29 +00:00
Aman Harwara 7eb0098fff chore: add permission selection dropdown when inviting contacts 2023-09-13 19:26:22 +05:30
StandardNotes CI f0566c7d07 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-13 13:21:53 +00:00
Mo bea266a69a chore(temp): disable history tests 2023-09-13 07:47:05 -05:00
Mo e079e0ec86 chore(ci): notify only if publish succeeds 2023-09-13 07:24:37 -05:00
Mo 5fc98b9de5 chore: bump version 2023-09-13 07:12:12 -05:00
Mo 94be549f30 chore: add e2e tests for case insensitive aad compare [no ci] 2023-09-13 07:10:58 -05:00
Aman Harwara 1275a2e148 chore: remember previous multiple vault selection when switching back from single to multiple 2023-09-13 16:50:35 +05:30
Aman Harwara 9ebb095aaa chore: fix typos 2023-09-13 16:37:45 +05:30
Aman Harwara 5517c96822 chore: fix vault selection menu not auto-updating on vault changes 2023-09-13 16:15:45 +05:30
Aman Harwara a07fa23c70 refactor: radio button group value generic 2023-09-13 15:59:57 +05:30
Aman Harwara 7c9cc821a2 chore: don't show listed menu option if note is in shared vault 2023-09-13 15:48:38 +05:30
StandardNotes CI 327abbf5ae chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
2023-09-12 22:18:14 +00:00
Mo 09ba8fb99b chore: add mechanism for legacy uuid aad 2023-09-12 16:47:24 -05:00
Aman Harwara 6978b56960 chore: only allow vault admins to invite more contacts 2023-09-13 02:17:15 +05:30
Aman Harwara ab2707d122 chore: fix issue where vault admin wouldn't show up in members list and improve styles 2023-09-13 02:11:24 +05:30
Aman Harwara 2a0fdeedd6 chore: show spinner when loading vault collaboration info 2023-09-13 01:46:26 +05:30
Aman Harwara b17b25666b chore: move vault key options inside advanced options accordion 2023-09-13 01:35:21 +05:30
Aman Harwara 9157dc1364 chore: show key option descriptions & improve style 2023-09-13 00:10:32 +05:30
Aman Harwara 464af45b50 chore: fix icon picker state not changing in tag context menu 2023-09-12 23:43:31 +05:30
Aman Harwara 56642422e4 chore: correctly change exclusively selected vault in footer option 2023-09-12 23:41:01 +05:30
Karol Sójko 43fc95a7ac chore: e2e test for fetching revisions (#2480) 2023-09-12 15:56:48 +02:00
Aman Harwara 57265d1d4e chore: fix current tag selection on vault display option change 2023-09-12 16:42:07 +05:30
Aman Harwara 6f6600ebd6 chore: change vault name badge style 2023-09-12 16:42:07 +05:30
Aman Harwara 2ed68ada6b chore: stop "last edited by" badge flickering when editing a note 2023-09-12 16:42:07 +05:30
Aman Harwara 53785c7100 chore: correctly refresh vault info badge 2023-09-12 16:42:07 +05:30
StandardNotes CI ada155a8c9 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
2023-09-12 08:14:28 +00:00
Karol Sójko d6a3e69d8c chore: remove the option to trigger transition from the UI (#2489) 2023-09-12 09:25:05 +02:00
StandardNotes CI e50cc591c0 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-11 14:08:11 +00:00
Aman Harwara 5311f1e098 chore: reset values changed for testing 2023-09-11 18:36:51 +05:30
Aman Harwara 7ca2fa8eab chore: fix preferences count bubble size & position 2023-09-11 18:36:11 +05:30
Aman Harwara 51c095efa9 chore: update checklist editor 2023-09-11 15:11:11 +05:30
StandardNotes CI 0eb30598df chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-11 09:35:07 +00:00
Aman Harwara 4907011ff2 chore: add labels to edit contact modal instead of placeholders for better ux 2023-09-11 14:08:49 +05:30
Aman Harwara 98dff43ab5 chore: improve contacts list ui 2023-09-11 14:02:32 +05:30
Aman Harwara 5fc8f6e6a0 chore: upgrade lexical 2023-09-11 13:22:05 +05:30
Aman Harwara 95c0352464 chore: fix error when multiple files are moved into another vault 2023-09-10 20:56:09 +05:30
StandardNotes CI 725a40b833 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-08 15:22:51 +00:00
Aman Harwara 0447b450d7 chore: improve vault ui element sizing 2023-09-08 20:00:32 +05:30
Aman Harwara dfa994ee8d chore: fix initial value for count bubble 2023-09-08 19:35:38 +05:30
Aman Harwara 126e9abd9c chore: hide collaboration options if no account 2023-09-08 19:14:41 +05:30
Karol Sójko 5faeaaf330 chore: fix input params for e2e test suites 2023-09-08 15:22:03 +02:00
Aman Harwara 22d6fcf973 chore: remove testing default 2023-09-08 18:42:53 +05:30
Aman Harwara 2e364dc016 chore: show preferences notification count bubble on mobile 2023-09-08 18:35:57 +05:30
Karol Sójko 986985b7de chore: fix e2e test to wait for transition to finish upon signout (#2487) 2023-09-08 14:49:42 +02:00
Aman Harwara 7c5f5c82a1 chore: improve note view vault info style (#2488) 2023-09-08 17:49:30 +05:30
StandardNotes CI 25c0d655ab chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-09-08 10:40:54 +00:00
Aman Harwara bf3f6cec43 chore: catch error when fetching changelog 2023-09-08 13:49:32 +05:30
214 changed files with 5417 additions and 1455 deletions
+11 -5
View File
@@ -199,6 +199,16 @@ jobs:
draft: false
files: packages/desktop/dist/*
- name: Publish Snap
continue-on-error: true
run: |
sudo snap install snapcraft --classic
snapcraft upload dist/standard-notes-${{ env.APP_VERSION }}-linux-amd64.snap --release stable,candidate,beta,edge
Notify:
runs-on: ubuntu-latest
needs: [Publish]
steps:
- name: Notify Release Update
uses: peter-evans/repository-dispatch@v2
with:
@@ -206,8 +216,4 @@ jobs:
repository: ${{ secrets.RELEASES_EVENT_RECEIVING_REPO }}
event-type: releases-updated-event
- name: Publish Snap
continue-on-error: true
run: |
sudo snap install snapcraft --classic
snapcraft upload dist/standard-notes-${{ env.APP_VERSION }}-linux-amd64.snap --release stable,candidate,beta,edge
+1 -1
View File
@@ -71,7 +71,7 @@ jobs:
github_token: ${{ secrets.CI_PAT_TOKEN }}
workflow_file_name: e2e-test-suite.yml
wait_interval: 30
client_payload: '{"snjs_image_tag": "${{ github.sha }}"}'
client_payload: '{"snjs_image_tag": "${{ github.sha }}", "author": "${{ github.actor }}", "ref_name": "app:${{ github.ref }}"}'
propagate_failure: true
trigger_workflow: true
wait_workflow: true
+1 -1
View File
@@ -48,7 +48,7 @@ jobs:
github_token: ${{ secrets.CI_PAT_TOKEN }}
workflow_file_name: e2e-test-suite.yml
wait_interval: 30
client_payload: '{"snjs_image_tag": "${{ github.sha }}"}'
client_payload: '{"snjs_image_tag": "${{ github.sha }}", "author": "${{ github.actor }}", "ref_name": "app:${{ github.ref }}"}'
propagate_failure: true
trigger_workflow: true
wait_workflow: true
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+24
View File
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.26.61](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-28)
**Note:** Version bump only for package @standardnotes/api
## [1.26.60](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/api
## [1.26.59](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/api
## [1.26.58](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/api
## [1.26.57](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/api
## [1.26.56](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/api
## [1.26.55](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-07)
**Note:** Version bump only for package @standardnotes/api
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.26.55",
"version": "1.26.61",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -36,7 +36,7 @@
},
"dependencies": {
"@standardnotes/common": "^1.50.0",
"@standardnotes/domain-core": "^1.28.0",
"@standardnotes/domain-core": "^1.34.1",
"@standardnotes/models": "workspace:*",
"@standardnotes/responses": "workspace:*",
"@standardnotes/utils": "workspace:*",
@@ -2,4 +2,8 @@ import { SharedVaultServerHash } from '@standardnotes/responses'
export type GetSharedVaultsResponse = {
sharedVaults: SharedVaultServerHash[]
designatedSurvivors: Array<{
userUuid: string
sharedVaultUuid: string
}>
}
@@ -0,0 +1,3 @@
export type DesignateSurvivorResponse = {
success: boolean
}
@@ -2,4 +2,6 @@ export const SharedVaultUsersPaths = {
getSharedVaultUsers: (sharedVaultUuid: string) => `/v1/shared-vaults/${sharedVaultUuid}/users`,
deleteSharedVaultUser: (sharedVaultUuid: string, userUuid: string) =>
`/v1/shared-vaults/${sharedVaultUuid}/users/${userUuid}`,
designateSurvivor: (sharedVaultUuid: string, sharedVaultMemberUuid: string) =>
`/v1/shared-vaults/${sharedVaultUuid}/users/${sharedVaultMemberUuid}/designate-survivor`,
}
@@ -1,4 +1,6 @@
import { HttpResponse } from '@standardnotes/responses'
import { Uuid } from '@standardnotes/domain-core'
import { HttpServiceInterface } from '../../Http'
import { GetSharedVaultUsersRequestParams } from '../../Request/SharedVaultUser/GetSharedVaultUsersRequestParams'
import { DeleteSharedVaultUserRequestParams } from '../../Request/SharedVaultUser/DeleteSharedVaultUserRequestParams'
@@ -6,10 +8,20 @@ import { DeleteSharedVaultUserResponse } from '../../Response/SharedVaultUsers/D
import { SharedVaultUsersServerInterface } from './SharedVaultUsersServerInterface'
import { SharedVaultUsersPaths } from './Paths'
import { GetSharedVaultUsersResponse } from '../../Response/SharedVaultUsers/GetSharedVaultUsersResponse'
import { DesignateSurvivorResponse } from '../../Response/SharedVaultUsers/DesignateSurvivorResponse'
export class SharedVaultUsersServer implements SharedVaultUsersServerInterface {
constructor(private httpService: HttpServiceInterface) {}
async designateSurvivor(params: {
sharedVaultUuid: Uuid
sharedVaultMemberUuid: Uuid
}): Promise<HttpResponse<DesignateSurvivorResponse>> {
return this.httpService.post(
SharedVaultUsersPaths.designateSurvivor(params.sharedVaultUuid.value, params.sharedVaultMemberUuid.value),
)
}
getSharedVaultUsers(params: GetSharedVaultUsersRequestParams): Promise<HttpResponse<GetSharedVaultUsersResponse>> {
return this.httpService.get(SharedVaultUsersPaths.getSharedVaultUsers(params.sharedVaultUuid))
}
@@ -1,12 +1,18 @@
import { HttpResponse } from '@standardnotes/responses'
import { Uuid } from '@standardnotes/domain-core'
import { GetSharedVaultUsersRequestParams } from '../../Request/SharedVaultUser/GetSharedVaultUsersRequestParams'
import { DeleteSharedVaultUserRequestParams } from '../../Request/SharedVaultUser/DeleteSharedVaultUserRequestParams'
import { DeleteSharedVaultUserResponse } from '../../Response/SharedVaultUsers/DeleteSharedVaultUserResponse'
import { GetSharedVaultUsersResponse } from '../../Response/SharedVaultUsers/GetSharedVaultUsersResponse'
import { DesignateSurvivorResponse } from '../../Response/SharedVaultUsers/DesignateSurvivorResponse'
export interface SharedVaultUsersServerInterface {
getSharedVaultUsers(params: GetSharedVaultUsersRequestParams): Promise<HttpResponse<GetSharedVaultUsersResponse>>
designateSurvivor(params: {
sharedVaultUuid: Uuid
sharedVaultMemberUuid: Uuid
}): Promise<HttpResponse<DesignateSurvivorResponse>>
deleteSharedVaultUser(
params: DeleteSharedVaultUserRequestParams,
): Promise<HttpResponse<DeleteSharedVaultUserResponse>>
+156
View File
@@ -3,6 +3,162 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.247](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-28)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.246](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.245](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.244](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.243](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-25)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.242](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.241](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.240](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.239](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.238](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.237](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.236](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.235](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.234](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.233](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.232](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.231](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.230](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-19)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.229](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-19)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.228](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-18)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.227](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-18)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.226](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-16)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.225](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.224](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.223](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.222](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.221](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.220](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.219](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-14)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.218](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-14)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.217](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.216](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.215](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.214](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-12)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.213](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-12)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.212](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-11)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.211](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-11)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.210](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-08)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.209](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-08)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.208](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-07)
**Note:** Version bump only for package @standardnotes/clipper
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/clipper",
"description": "Web clipper browser extension for Standard Notes",
"version": "1.1.208",
"version": "1.1.247",
"private": true,
"scripts": {
"build-mv2": "yarn clean && webpack --config ./webpack.config.prod.js",
+156
View File
@@ -3,6 +3,162 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.108.179](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-28)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.178](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.177](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.176](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.175](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-25)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.174](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.173](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.172](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.171](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.170](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.169](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.168](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.167](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.166](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.165](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.164](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.163](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.162](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-19)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.161](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-19)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.160](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-18)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.159](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-18)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.158](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-16)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.157](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.156](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.155](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.154](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.153](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.152](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.151](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-14)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.150](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-14)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.149](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.148](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.147](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.146](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-12)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.145](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-12)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.144](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-11)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.143](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-11)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.142](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-08)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.141](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-08)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.140](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-07)
**Note:** Version bump only for package @standardnotes/desktop
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.108.140",
"version": "3.108.179",
"license": "CC BY-NC-SA 4.0",
"author": "Standard Notes.",
"private": true,
@@ -35,7 +35,7 @@
},
"dependencies": {
"@electron/remote": "^2.0.9",
"@standardnotes/domain-core": "^1.28.0",
"@standardnotes/domain-core": "^1.34.1",
"@standardnotes/electron-clear-data": "1.1.1",
"@standardnotes/web": "workspace:*",
"axios": "^1.1.3",
+28
View File
@@ -3,6 +3,34 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.21.83](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-28)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.82](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.81](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.80](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.79](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.78](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.77](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-12)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.76](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-07)
**Note:** Version bump only for package @standardnotes/encryption
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/encryption",
"version": "1.21.76",
"version": "1.21.83",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -29,7 +29,7 @@
},
"dependencies": {
"@standardnotes/common": "^1.50.0",
"@standardnotes/domain-core": "^1.28.0",
"@standardnotes/domain-core": "^1.34.1",
"@standardnotes/models": "workspace:*",
"@standardnotes/responses": "workspace:*",
"@standardnotes/sncrypto-common": "workspace:*",
@@ -17,6 +17,7 @@ import {
} from './../../../../Types/EncryptedParameters'
import { DecryptedParameters } from '../../../../Types/DecryptedParameters'
import { DeriveHashingKeyUseCase } from '../Hash/DeriveHashingKey'
import { V004Components } from '../../V004AlgorithmTypes'
export class GenerateDecryptedParametersUseCase {
private base64DataUsecase = new CreateConsistentBase64JsonPayloadUseCase(this.crypto)
@@ -39,7 +40,7 @@ export class GenerateDecryptedParametersUseCase {
}
}
const contentResult = this.decryptContent(encrypted, contentKeyResult.contentKey)
const contentResult = this.decryptContent(encrypted, contentKeyResult.decrypted)
if (!contentResult) {
return {
uuid: encrypted.uuid,
@@ -54,17 +55,17 @@ export class GenerateDecryptedParametersUseCase {
hashingKey,
{
additionalData: contentKeyResult.components.additionalData,
plaintext: contentKeyResult.contentKey,
plaintext: contentKeyResult.decrypted,
},
{
additionalData: contentResult.components.additionalData,
plaintext: contentResult.content,
plaintext: contentResult.decrypted,
},
)
return {
uuid: encrypted.uuid,
content: JSON.parse(contentResult.content),
content: JSON.parse(contentResult.decrypted),
signatureData: signatureVerificationResult,
}
}
@@ -72,34 +73,7 @@ export class GenerateDecryptedParametersUseCase {
private decryptContent(encrypted: EncryptedOutputParameters, contentKey: string) {
const contentComponents = deconstructEncryptedPayloadString(encrypted.content)
const contentAuthenticatedData = this.stringToAuthenticatedDataUseCase.execute(
contentComponents.authenticatedData,
{
u: encrypted.uuid,
v: encrypted.version,
ksi: encrypted.key_system_identifier,
svu: encrypted.shared_vault_uuid,
},
)
const authenticatedDataString = this.base64DataUsecase.execute(contentAuthenticatedData)
const content = this.crypto.xchacha20Decrypt(
contentComponents.ciphertext,
contentComponents.nonce,
contentKey,
authenticatedDataString,
)
if (!content) {
return null
}
return {
content,
components: contentComponents,
authenticatedDataString,
}
return this.decrypt(encrypted, contentComponents, contentKey)
}
private decryptContentKey(
@@ -108,32 +82,37 @@ export class GenerateDecryptedParametersUseCase {
) {
const contentKeyComponents = deconstructEncryptedPayloadString(encrypted.enc_item_key)
const contentKeyAuthenticatedData = this.stringToAuthenticatedDataUseCase.execute(
contentKeyComponents.authenticatedData,
{
u: encrypted.uuid,
v: encrypted.version,
ksi: encrypted.key_system_identifier,
svu: encrypted.shared_vault_uuid,
},
)
return this.decrypt(encrypted, contentKeyComponents, key.itemsKey)
}
const authenticatedDataString = this.base64DataUsecase.execute(contentKeyAuthenticatedData)
private decrypt(encrypted: EncryptedOutputParameters, components: V004Components, key: string) {
const rawAuthenticatedData = this.stringToAuthenticatedDataUseCase.executeRaw(components.authenticatedData)
const contentKey = this.crypto.xchacha20Decrypt(
contentKeyComponents.ciphertext,
contentKeyComponents.nonce,
key.itemsKey,
const doesRawContainLegacyUppercaseUuid = /[A-Z]/.test(rawAuthenticatedData.u)
const authenticatedData = this.stringToAuthenticatedDataUseCase.execute(components.authenticatedData, {
u: doesRawContainLegacyUppercaseUuid ? encrypted.uuid.toUpperCase() : encrypted.uuid,
v: encrypted.version,
ksi: encrypted.key_system_identifier,
svu: encrypted.shared_vault_uuid,
})
const authenticatedDataString = this.base64DataUsecase.execute(authenticatedData)
const decrypted = this.crypto.xchacha20Decrypt(
components.ciphertext,
components.nonce,
key,
authenticatedDataString,
)
if (!contentKey) {
if (!decrypted) {
return null
}
return {
contentKey,
components: contentKeyComponents,
decrypted,
components: components,
authenticatedDataString,
}
}
@@ -16,4 +16,9 @@ export class StringToAuthenticatedDataUseCase {
...override,
})
}
executeRaw(rawAuthenticatedData: string): RootKeyEncryptedAuthenticatedData | ItemAuthenticatedData {
const base = JSON.parse(this.crypto.base64Decode(rawAuthenticatedData))
return base
}
}
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.59.21](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-28)
**Note:** Version bump only for package @standardnotes/features
## [1.59.20](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/features
## [1.59.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/features
## [1.59.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-07)
**Note:** Version bump only for package @standardnotes/features
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/features",
"version": "1.59.18",
"version": "1.59.21",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -26,7 +26,7 @@
},
"dependencies": {
"@standardnotes/common": "^1.50.0",
"@standardnotes/domain-core": "^1.28.0",
"@standardnotes/domain-core": "^1.34.1",
"reflect-metadata": "^0.1.13"
},
"devDependencies": {
+28
View File
@@ -3,6 +3,34 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.28.94](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-28)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.93](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.92](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.91](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.90](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.89](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.88](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-12)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.87](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-07)
**Note:** Version bump only for package @standardnotes/filepicker
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/filepicker",
"version": "1.28.87",
"version": "1.28.94",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+28
View File
@@ -3,6 +3,34 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.17.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-28)
**Note:** Version bump only for package @standardnotes/files
## [1.17.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/files
## [1.17.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/files
## [1.17.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/files
## [1.17.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/files
## [1.17.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/files
## [1.17.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-12)
**Note:** Version bump only for package @standardnotes/files
## [1.17.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-07)
**Note:** Version bump only for package @standardnotes/files
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files",
"version": "1.17.6",
"version": "1.17.13",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+156
View File
@@ -3,6 +3,162 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.56.158](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-28)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.157](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.156](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.155](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.154](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-25)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.153](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.152](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.151](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.150](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.149](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.148](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.147](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.146](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.145](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.144](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.143](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.142](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.141](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-19)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.140](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-19)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.139](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-18)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.138](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-18)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.137](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-16)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.136](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.135](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.134](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.133](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.132](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.131](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.130](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-14)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.129](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-14)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.128](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.127](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.126](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.125](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-12)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.124](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-12)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.123](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-11)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.122](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-11)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.121](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-08)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.120](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-08)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.119](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-07)
**Note:** Version bump only for package @standardnotes/mobile
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.56.119",
"version": "3.56.158",
"author": "Standard Notes.",
"private": true,
"license": "CC BY-NC-SA 4.0",
+24
View File
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.47.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-28)
**Note:** Version bump only for package @standardnotes/models
## [1.47.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/models
## [1.47.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/models
## [1.47.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/models
## [1.47.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/models
## [1.47.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/models
## [1.47.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-07)
**Note:** Version bump only for package @standardnotes/models
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/models",
"version": "1.47.13",
"version": "1.47.19",
"publishConfig": {
"access": "public"
},
@@ -20,7 +20,7 @@
},
"dependencies": {
"@standardnotes/common": "^1.50.0",
"@standardnotes/domain-core": "^1.28.0",
"@standardnotes/domain-core": "^1.34.1",
"@standardnotes/features": "workspace:*",
"@standardnotes/responses": "workspace:*",
"@standardnotes/sncrypto-common": "workspace:^",
@@ -20,6 +20,7 @@ export type AsymmetricMessageSharedVaultInvite = {
description?: string
iconString: IconType | EmojiString
fileBytesUsed: number
designatedSurvivor: string | null
}
}
}
@@ -11,7 +11,7 @@ import { ExclusiveVaultCriteriaValidator } from '../../Display/Validator/Exclusi
import { HiddenContentCriteriaValidator } from '../../Display/Validator/HiddenContentCriteriaValidator'
import { CustomFilterCriteriaValidator } from '../../Display/Validator/CustomFilterCriteriaValidator'
import { AnyDisplayOptions, VaultDisplayOptions } from '../../Display'
import { isExclusioanaryOptionsValue } from '../../Display/VaultDisplayOptionsTypes'
import { isExclusionaryOptionsValue } from '../../Display/VaultDisplayOptionsTypes'
import { ContentType } from '@standardnotes/domain-core'
type AllNotesUuidSignifier = undefined
@@ -83,7 +83,7 @@ export class ItemCounter implements SNIndex {
if (this.vaultDisplayOptions) {
const options = this.vaultDisplayOptions.getOptions()
if (isExclusioanaryOptionsValue(options)) {
if (isExclusionaryOptionsValue(options)) {
filters.push(new ExcludeVaultsCriteriaValidator([...options.exclude, ...options.locked], element))
} else {
filters.push(new ExclusiveVaultCriteriaValidator(options.exclusive, element))
@@ -11,7 +11,7 @@ import { ExcludeVaultsCriteriaValidator } from './Validator/ExcludeVaultsCriteri
import { ExclusiveVaultCriteriaValidator } from './Validator/ExclusiveVaultCriteriaValidator'
import { HiddenContentCriteriaValidator } from './Validator/HiddenContentCriteriaValidator'
import { VaultDisplayOptions } from './VaultDisplayOptions'
import { isExclusioanaryOptionsValue } from './VaultDisplayOptionsTypes'
import { isExclusionaryOptionsValue } from './VaultDisplayOptionsTypes'
export class ItemDisplayController<I extends DisplayItem, O extends AnyDisplayOptions = GenericDisplayOptions> {
private sortMap: UuidToSortedPositionMap = {}
@@ -31,6 +31,10 @@ export class ItemDisplayController<I extends DisplayItem, O extends AnyDisplayOp
return this.sortedItems
}
public hasExclusiveVaultOptions(): boolean {
return this.vaultOptions ? !isExclusionaryOptionsValue(this.vaultOptions.getOptions()) : false
}
public getDisplayOptions(): DisplayControllerDisplayOptions & O {
return this.options
}
@@ -61,7 +65,7 @@ export class ItemDisplayController<I extends DisplayItem, O extends AnyDisplayOp
if (this.vaultOptions) {
const options = this.vaultOptions.getOptions()
if (isExclusioanaryOptionsValue(options)) {
if (isExclusionaryOptionsValue(options)) {
filters.push(new ExcludeVaultsCriteriaValidator([...options.exclude, ...options.locked], element))
} else {
filters.push(new ExclusiveVaultCriteriaValidator(options.exclusive, element))
@@ -1,10 +1,10 @@
import { VaultListingInterface } from '../../Syncable/VaultListing/VaultListingInterface'
import { uniqueArray } from '@standardnotes/utils'
import {
ExclusioanaryOptions,
ExclusionaryOptions,
ExclusiveOptions,
VaultDisplayOptionsPersistable,
isExclusioanaryOptionsValue,
isExclusionaryOptionsValue,
} from './VaultDisplayOptionsTypes'
import { KeySystemIdentifier } from '../../Syncable/KeySystemRootKey/KeySystemIdentifier'
@@ -13,14 +13,14 @@ function KeySystemIdentifiers(vaults: VaultListingInterface[]): KeySystemIdentif
}
export class VaultDisplayOptions {
constructor(private readonly options: ExclusioanaryOptions | ExclusiveOptions) {}
constructor(private readonly options: ExclusionaryOptions | ExclusiveOptions) {}
public getOptions(): ExclusioanaryOptions | ExclusiveOptions {
public getOptions(): ExclusionaryOptions | ExclusiveOptions {
return this.options
}
public getExclusivelyShownVault(): KeySystemIdentifier {
if (isExclusioanaryOptionsValue(this.options)) {
if (isExclusionaryOptionsValue(this.options)) {
throw new Error('Not in exclusive display mode')
}
@@ -28,11 +28,11 @@ export class VaultDisplayOptions {
}
public isInExclusiveDisplayMode(): boolean {
return !isExclusioanaryOptionsValue(this.options)
return !isExclusionaryOptionsValue(this.options)
}
public isVaultExplicitelyExcluded(vault: VaultListingInterface): boolean {
if (isExclusioanaryOptionsValue(this.options)) {
public isVaultExplicitlyExcluded(vault: VaultListingInterface): boolean {
if (isExclusionaryOptionsValue(this.options)) {
return this.options.exclude.some((excludedVault) => excludedVault === vault.systemIdentifier)
} else if (this.options.exclusive) {
return this.options.exclusive !== vault.systemIdentifier
@@ -42,18 +42,18 @@ export class VaultDisplayOptions {
}
isVaultExclusivelyShown(vault: VaultListingInterface): boolean {
return !isExclusioanaryOptionsValue(this.options) && this.options.exclusive === vault.systemIdentifier
return !isExclusionaryOptionsValue(this.options) && this.options.exclusive === vault.systemIdentifier
}
isVaultDisabledOrLocked(vault: VaultListingInterface): boolean {
if (isExclusioanaryOptionsValue(this.options)) {
if (isExclusionaryOptionsValue(this.options)) {
const matchingLocked = this.options.locked.find((lockedVault) => lockedVault === vault.systemIdentifier)
if (matchingLocked) {
return true
}
}
return this.isVaultExplicitelyExcluded(vault)
return this.isVaultExplicitlyExcluded(vault)
}
getPersistableValue(): VaultDisplayOptionsPersistable {
@@ -61,7 +61,7 @@ export class VaultDisplayOptions {
}
newOptionsByIntakingLockedVaults(lockedVaults: VaultListingInterface[]): VaultDisplayOptions {
if (isExclusioanaryOptionsValue(this.options)) {
if (isExclusionaryOptionsValue(this.options)) {
return new VaultDisplayOptions({ exclude: this.options.exclude, locked: KeySystemIdentifiers(lockedVaults) })
} else {
return new VaultDisplayOptions({ exclusive: this.options.exclusive })
@@ -76,7 +76,7 @@ export class VaultDisplayOptions {
vaults: VaultListingInterface[],
lockedVaults: VaultListingInterface[],
): VaultDisplayOptions {
if (isExclusioanaryOptionsValue(this.options)) {
if (isExclusionaryOptionsValue(this.options)) {
return new VaultDisplayOptions({
exclude: uniqueArray([...this.options.exclude, ...KeySystemIdentifiers(vaults)]),
locked: KeySystemIdentifiers(lockedVaults),
@@ -93,7 +93,7 @@ export class VaultDisplayOptions {
vault: VaultListingInterface,
lockedVaults: VaultListingInterface[],
): VaultDisplayOptions {
if (isExclusioanaryOptionsValue(this.options)) {
if (isExclusionaryOptionsValue(this.options)) {
return new VaultDisplayOptions({
exclude: this.options.exclude.filter((excludedVault) => excludedVault !== vault.systemIdentifier),
locked: KeySystemIdentifiers(lockedVaults),
@@ -1,12 +1,12 @@
import { KeySystemIdentifier } from '../../Syncable/KeySystemRootKey/KeySystemIdentifier'
export type ExclusioanaryOptions = { exclude: KeySystemIdentifier[]; locked: KeySystemIdentifier[] }
export type ExclusionaryOptions = { exclude: KeySystemIdentifier[]; locked: KeySystemIdentifier[] }
export type ExclusiveOptions = { exclusive: KeySystemIdentifier }
export function isExclusioanaryOptionsValue(
options: ExclusioanaryOptions | ExclusiveOptions,
): options is ExclusioanaryOptions {
export function isExclusionaryOptionsValue(
options: ExclusionaryOptions | ExclusiveOptions,
): options is ExclusionaryOptions {
return 'exclude' in options || 'locked' in options
}
export type VaultDisplayOptionsPersistable = ExclusioanaryOptions | ExclusiveOptions
export type VaultDisplayOptionsPersistable = ExclusionaryOptions | ExclusiveOptions
@@ -2,4 +2,5 @@ export type VaultListingSharingInfo = {
sharedVaultUuid: string
ownerUserUuid: string
fileBytesUsed: number
designatedSurvivor: string | null
}
+156
View File
@@ -3,6 +3,162 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.4.531](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-28)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.530](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.529](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.528](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.527](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-25)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.526](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.525](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.524](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.523](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.522](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.521](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.520](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.519](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.518](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.517](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.516](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.515](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.514](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-19)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.513](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-19)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.512](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-18)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.511](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-18)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.510](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-16)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.509](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.508](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.507](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.506](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.505](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.504](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.503](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-14)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.502](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-14)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.501](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.500](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.499](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.498](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-12)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.497](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-12)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.496](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-11)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.495](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-11)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.494](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-08)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.493](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-08)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.492](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-07)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.4.492",
"version": "1.4.531",
"license": "CC BY-NC-SA 4.0",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.13.45](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-28)
**Note:** Version bump only for package @standardnotes/responses
## [1.13.44](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/responses
## [1.13.43](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/responses
## [1.13.42](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-07)
**Note:** Version bump only for package @standardnotes/responses
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/responses",
"version": "1.13.42",
"version": "1.13.45",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+68
View File
@@ -3,6 +3,74 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.64.30](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-28)
**Note:** Version bump only for package @standardnotes/services
## [1.64.29](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/services
## [1.64.28](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-26)
**Note:** Version bump only for package @standardnotes/services
## [1.64.27](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/services
## [1.64.26](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/services
## [1.64.25](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/services
## [1.64.24](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-22)
**Note:** Version bump only for package @standardnotes/services
## [1.64.23](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-21)
**Note:** Version bump only for package @standardnotes/services
## [1.64.22](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/services
## [1.64.21](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-20)
**Note:** Version bump only for package @standardnotes/services
## [1.64.20](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-18)
**Note:** Version bump only for package @standardnotes/services
## [1.64.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/services
## [1.64.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/services
## [1.64.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-15)
**Note:** Version bump only for package @standardnotes/services
## [1.64.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-13)
**Note:** Version bump only for package @standardnotes/services
## [1.64.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-12)
**Note:** Version bump only for package @standardnotes/services
## [1.64.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-12)
**Note:** Version bump only for package @standardnotes/services
## [1.64.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-09-07)
**Note:** Version bump only for package @standardnotes/services
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/services",
"version": "1.64.13",
"version": "1.64.30",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -18,7 +18,7 @@
"dependencies": {
"@standardnotes/api": "workspace:^",
"@standardnotes/common": "^1.50.0",
"@standardnotes/domain-core": "^1.28.0",
"@standardnotes/domain-core": "^1.34.1",
"@standardnotes/encryption": "workspace:^",
"@standardnotes/features": "workspace:^",
"@standardnotes/files": "workspace:^",
@@ -13,8 +13,6 @@ import {
MfaServiceInterface,
GenerateUuid,
CreateDecryptedBackupFile,
GetTransitionStatus,
StartTransition,
} from '@standardnotes/services'
import { VaultLockServiceInterface } from './../VaultLock/VaultLockServiceInterface'
import { HistoryServiceInterface } from './../History/HistoryServiceInterface'
@@ -78,8 +76,6 @@ export interface ApplicationInterface {
get generateUuid(): GenerateUuid
get getHost(): GetHost
get setHost(): SetHost
get getTransitionStatus(): GetTransitionStatus
get startTransition(): StartTransition
// Services
get alerts(): AlertService
@@ -39,6 +39,7 @@ describe('ProcessAcceptedVaultInvite', () => {
name: 'test-name',
iconString: 'safe-square',
fileBytesUsed: 0,
designatedSurvivor: null,
},
trustedContacts: [],
},
@@ -37,6 +37,7 @@ export class ProcessAcceptedVaultInvite {
sharedVaultUuid: sharedVaultUuid,
ownerUserUuid: ownerUuid,
fileBytesUsed: metadata.fileBytesUsed,
designatedSurvivor: metadata.designatedSurvivor,
},
}
@@ -1,5 +1,4 @@
export enum InternalFeature {
Vaults = 'vaults',
HomeServer = 'home-server',
Transition = 'transition',
}
@@ -87,7 +87,6 @@ export interface ItemManagerInterface extends AbstractService {
removeItemsFromMemory(items: AnyItemInterface[]): void
getDirtyItems(): (DecryptedItemInterface | DeletedItemInterface)[]
getTagLongTitle(tag: SNTag): string
getSortedTagsForItem(item: DecryptedItemInterface<ItemContent>): SNTag[]
itemsReferencingItem<I extends DecryptedItemInterface = DecryptedItemInterface>(
itemToLookupUuidFor: { uuid: string },
contentType?: string,
@@ -117,7 +116,9 @@ export interface ItemManagerInterface extends AbstractService {
getNoteCount(): number
getDisplayableTags(): SNTag[]
getTagChildren(itemToLookupUuidFor: SNTag): SNTag[]
getDeepTagChildren(itemToLookupUuidFor: SNTag): SNTag[]
getTagParent(itemToLookupUuidFor: SNTag): SNTag | undefined
getDisplayableTagParent(itemToLookupUuidFor: SNTag): SNTag | undefined
isValidTagParent(parentTagToLookUpUuidFor: SNTag, childToLookUpUuidFor: SNTag): boolean
isSmartViewTitle(title: string): boolean
getDisplayableComponents(): ComponentInterface[]
@@ -130,6 +131,9 @@ export interface ItemManagerInterface extends AbstractService {
getDisplayableNotesAndFiles(): (SNNote | FileItem)[]
setPrimaryItemDisplayOptions(options: NotesAndFilesDisplayControllerOptions): void
getTagPrefixTitle(tag: SNTag): string | undefined
getNoteLinkedFiles(note: SNNote): FileItem[]
getItemLinkedFiles(item: DecryptedItemInterface): FileItem[]
getItemLinkedNotes(item: DecryptedItemInterface): SNNote[]
getSortedTagsForItem(item: DecryptedItemInterface<ItemContent>): SNTag[]
getUnsortedTagsForItem(item: DecryptedItemInterface<ItemContent>): SNTag[]
conflictsOf(uuid: string): AnyItemInterface[]
}
@@ -15,6 +15,7 @@ import { ItemManagerInterface } from '../Item/ItemManagerInterface'
import { SessionsClientInterface } from '../Session/SessionsClientInterface'
import { ContactPublicKeySetInterface, TrustedContactInterface } from '@standardnotes/models'
import { SyncLocalVaultsWithRemoteSharedVaults } from './UseCase/SyncLocalVaultsWithRemoteSharedVaults'
import { VaultUserServiceInterface } from '../VaultUser/VaultUserServiceInterface'
describe('SharedVaultService', () => {
let service: SharedVaultService
@@ -27,6 +28,8 @@ describe('SharedVaultService', () => {
const items = {} as jest.Mocked<ItemManagerInterface>
items.addObserver = jest.fn()
const vaultUsers = {} as jest.Mocked<VaultUserServiceInterface>
const session = {} as jest.Mocked<SessionsClientInterface>
const getVault = {} as jest.Mocked<GetVault>
const getOwnedVaults = {} as jest.Mocked<GetOwnedSharedVaults>
@@ -48,6 +51,7 @@ describe('SharedVaultService', () => {
service = new SharedVaultService(
items,
session,
vaultUsers,
syncLocalVaultsWithRemoteSharedVaults,
getVault,
getOwnedVaults,
@@ -33,6 +33,7 @@ import { HandleKeyPairChange } from '../Contacts/UseCase/HandleKeyPairChange'
import { FindContact } from '../Contacts/UseCase/FindContact'
import { GetOwnedSharedVaults } from './UseCase/GetOwnedSharedVaults'
import { SyncLocalVaultsWithRemoteSharedVaults } from './UseCase/SyncLocalVaultsWithRemoteSharedVaults'
import { VaultUserServiceInterface } from '../VaultUser/VaultUserServiceInterface'
export class SharedVaultService
extends AbstractService<SharedVaultServiceEvent, SharedVaultServiceEventPayload>
@@ -41,6 +42,7 @@ export class SharedVaultService
constructor(
private items: ItemManagerInterface,
private session: SessionsClientInterface,
private vaultUsers: VaultUserServiceInterface,
private _syncLocalVaultsWithRemoteSharedVaults: SyncLocalVaultsWithRemoteSharedVaults,
private _getVault: GetVault,
private _getOwnedSharedVaults: GetOwnedSharedVaults,
@@ -94,38 +96,56 @@ export class SharedVaultService
await this.handleNotification(event.payload as NotificationServiceEventPayload)
break
case SyncEvent.ReceivedRemoteSharedVaults:
void this.notifyEventSync(SharedVaultServiceEvent.SharedVaultStatusChanged)
void this.notifyEvent(SharedVaultServiceEvent.SharedVaultStatusChanged)
break
}
}
private async handleNotification(event: NotificationServiceEventPayload): Promise<void> {
switch (event.eventPayload.props.type.value) {
case NotificationType.TYPES.RemovedFromSharedVault: {
case NotificationType.TYPES.SelfRemovedFromSharedVault: {
const vault = this._getVault.execute<SharedVaultListingInterface>({
sharedVaultUuid: event.eventPayload.props.sharedVaultUuid.value,
sharedVaultUuid: event.eventPayload.props.primaryIdentifier.value,
})
if (!vault.isFailed()) {
await this._deleteThirdPartyVault.execute(vault.getValue())
}
break
}
case NotificationType.TYPES.UserRemovedFromSharedVault: {
const vaultOrError = this._getVault.execute<SharedVaultListingInterface>({
sharedVaultUuid: event.eventPayload.props.primaryIdentifier.value,
})
if (!vaultOrError.isFailed()) {
const vault = vaultOrError.getValue()
this.vaultUsers
.invalidateVaultUsersCache(event.eventPayload.props.primaryIdentifier.value)
.catch(console.error)
await this._syncLocalVaultsWithRemoteSharedVaults.execute([vault])
void this.notifyEvent(SharedVaultServiceEvent.SharedVaultStatusChanged)
}
break
}
case NotificationType.TYPES.SharedVaultItemRemoved: {
const item = this.items.findItem((event.eventPayload.props.itemUuid as Uuid).value)
const item = this.items.findItem((event.eventPayload.props.secondaryIdentifier as Uuid).value)
if (item) {
void this._discardItemsLocally.execute([item])
}
break
}
case NotificationType.TYPES.SharedVaultFileRemoved:
case NotificationType.TYPES.SharedVaultFileUploaded: {
case NotificationType.TYPES.SharedVaultFileUploaded:
case NotificationType.TYPES.UserDesignatedAsSurvivor: {
const vaultOrError = this._getVault.execute<SharedVaultListingInterface>({
sharedVaultUuid: event.eventPayload.props.sharedVaultUuid.value,
sharedVaultUuid: event.eventPayload.props.primaryIdentifier.value,
})
if (!vaultOrError.isFailed()) {
await this._syncLocalVaultsWithRemoteSharedVaults.execute([vaultOrError.getValue()])
void this.notifyEventSync(SharedVaultServiceEvent.SharedVaultStatusChanged)
void this.notifyEvent(SharedVaultServiceEvent.SharedVaultStatusChanged)
}
break
@@ -5,6 +5,8 @@ import {
SharedVaultListingInterface,
VaultListingInterface,
KeySystemRootKeyStorageMode,
EmojiString,
IconType,
} from '@standardnotes/models'
import { AbstractService } from '../Service/AbstractService'
import { SharedVaultServiceEvent, SharedVaultServiceEventPayload } from './SharedVaultServiceEvent'
@@ -14,6 +16,7 @@ export interface SharedVaultServiceInterface
createSharedVault(dto: {
name: string
description?: string
iconString: IconType | EmojiString
userInputtedPassword: string | undefined
storagePreference?: KeySystemRootKeyStorageMode
}): Promise<VaultListingInterface | ClientDisplayableError>
@@ -32,6 +32,7 @@ export class ConvertToSharedVault {
sharedVaultUuid: serverVaultHash.uuid,
ownerUserUuid: serverVaultHash.user_uuid,
fileBytesUsed: serverVaultHash.file_upload_bytes_used,
designatedSurvivor: null,
}
},
)
@@ -51,6 +51,7 @@ export class CreateSharedVault {
sharedVaultUuid: serverVaultHash.uuid,
ownerUserUuid: serverVaultHash.user_uuid,
fileBytesUsed: serverVaultHash.file_upload_bytes_used,
designatedSurvivor: null,
}
},
)
@@ -18,18 +18,22 @@ export class SyncLocalVaultsWithRemoteSharedVaults implements UseCaseInterface<v
}
const remoteVaults = remoteVaultsResponse.data.sharedVaults
const designatedSurvivors = remoteVaultsResponse.data.designatedSurvivors || []
for (const localVault of localVaults) {
if (!localVault.isSharedVaultListing()) {
continue
}
const remoteVault = remoteVaults.find((vault) => vault.uuid === localVault.sharing.sharedVaultUuid)
if (remoteVault) {
const designatedSurvivor = designatedSurvivors.find((survivor) => survivor.sharedVaultUuid === remoteVault.uuid)
await this.mutator.changeItem<VaultListingMutator, SharedVaultListingInterface>(localVault, (mutator) => {
/* istanbul ignore next */
mutator.sharing = {
sharedVaultUuid: remoteVault.uuid,
ownerUserUuid: remoteVault.user_uuid,
fileBytesUsed: remoteVault.file_upload_bytes_used,
designatedSurvivor: designatedSurvivor ? designatedSurvivor.userUuid : null,
}
})
}
@@ -3,7 +3,7 @@ import { Result, SyncUseCaseInterface } from '@standardnotes/domain-core'
import { GetHost } from './GetHost'
export class IsApplicationUsingThirdPartyHost implements SyncUseCaseInterface<boolean> {
private readonly APPLICATION_DEFAULT_HOSTS = ['api.standardnotes.com', 'sync.standardnotes.org']
private readonly APPLICATION_DEFAULT_HOSTS = ['api.standardnotes.com', 'sync.standardnotes.org', 'localhost:3123']
private readonly FILES_DEFAULT_HOSTS = ['files.standardnotes.com']
@@ -1,34 +0,0 @@
import { HttpServiceInterface } from '@standardnotes/api'
import { GetTransitionStatus } from './GetTransitionStatus'
describe('GetTransitionStatus', () => {
let httpService: HttpServiceInterface
const createUseCase = () => new GetTransitionStatus(httpService)
beforeEach(() => {
httpService = {
get: jest.fn(),
} as unknown as HttpServiceInterface
})
it('should get transition status', async () => {
const useCase = createUseCase()
;(httpService.get as jest.Mock).mockResolvedValueOnce({ status: 200, data: { status: 'TO-DO' } })
const result = await useCase.execute()
expect(result.isFailed()).toBe(false)
expect(result.getValue()).toBe('TO-DO')
})
it('should fail to get transition status', async () => {
const useCase = createUseCase()
;(httpService.get as jest.Mock).mockResolvedValueOnce({ status: 400 })
const result = await useCase.execute()
expect(result.isFailed()).toBe(true)
})
})
@@ -1,17 +0,0 @@
import { Result, UseCaseInterface } from '@standardnotes/domain-core'
import { HttpServiceInterface } from '@standardnotes/api'
import { HttpStatusCode } from '@standardnotes/responses'
export class GetTransitionStatus implements UseCaseInterface<'TO-DO' | 'STARTED' | 'FINISHED' | 'FAILED'> {
constructor(private httpService: HttpServiceInterface) {}
async execute(): Promise<Result<'TO-DO' | 'STARTED' | 'FINISHED' | 'FAILED'>> {
const response = await this.httpService.get('/v1/users/transition-status')
if (response.status !== HttpStatusCode.Success) {
return Result.fail('Failed to get transition status')
}
return Result.ok((response.data as { status: 'TO-DO' | 'STARTED' | 'FINISHED' | 'FAILED' }).status)
}
}
@@ -1,33 +0,0 @@
import { HttpServiceInterface } from '@standardnotes/api'
import { StartTransition } from './StartTransition'
describe('StartTransition', () => {
let httpService: HttpServiceInterface
const createUseCase = () => new StartTransition(httpService)
beforeEach(() => {
httpService = {
post: jest.fn(),
} as unknown as HttpServiceInterface
})
it('should start transition', async () => {
const useCase = createUseCase()
;(httpService.post as jest.Mock).mockResolvedValueOnce({ status: 200 })
const result = await useCase.execute()
expect(result.isFailed()).toBe(false)
})
it('should fail to start transition', async () => {
const useCase = createUseCase()
;(httpService.post as jest.Mock).mockResolvedValueOnce({ status: 400 })
const result = await useCase.execute()
expect(result.isFailed()).toBe(true)
})
})
@@ -1,17 +0,0 @@
import { HttpServiceInterface } from '@standardnotes/api'
import { Result, UseCaseInterface } from '@standardnotes/domain-core'
import { HttpStatusCode } from '@standardnotes/responses'
export class StartTransition implements UseCaseInterface<void> {
constructor(private httpService: HttpServiceInterface) {}
async execute(): Promise<Result<void>> {
const response = await this.httpService.post('/v1/items/transition')
if (response.status !== HttpStatusCode.Success) {
return Result.fail('Failed to start transition')
}
return Result.ok()
}
}
@@ -0,0 +1,238 @@
import {
DecryptedItemInterface,
DecryptedPayload,
FileContent,
FileItem,
FillItemContent,
NoteContent,
PayloadSource,
PayloadTimestampDefaults,
SNNote,
SNTag,
TagContent,
VaultListingInterface,
} from '@standardnotes/models'
import {
SyncServiceInterface,
ItemManagerInterface,
InternalEventBusInterface,
VaultService,
AlertService,
ChangeVaultKeyOptions,
CreateVault,
DeleteVault,
GetVault,
GetVaults,
IsVaultOwner,
MoveItemsToVault,
MutatorClientInterface,
RemoveItemFromVault,
RotateVaultKey,
SendVaultDataChangedMessage,
ValidateVaultPassword,
VaultLockServiceInterface,
} from '../..'
import { AuthorizeVaultDeletion } from './UseCase/AuthorizeVaultDeletion'
import { ContentType } from '@standardnotes/domain-core'
let currentId = 0
const mockUuid = () => {
return `${currentId++}`
}
const createNoteWithContent = (content: Partial<NoteContent>, createdAt?: Date): SNNote => {
return new SNNote(
new DecryptedPayload(
{
uuid: mockUuid(),
content_type: ContentType.TYPES.Note,
content: FillItemContent<NoteContent>(content),
...PayloadTimestampDefaults(),
created_at: createdAt || new Date(),
},
PayloadSource.Constructor,
),
)
}
const createFile = (name: string) => {
return new FileItem(
new DecryptedPayload({
uuid: mockUuid(),
content_type: ContentType.TYPES.File,
content: FillItemContent<FileContent>({
name: name,
}),
...PayloadTimestampDefaults(),
}),
)
}
const createTagWithContent = (content: Partial<TagContent>, key_system_identifier?: string): SNTag => {
return new SNTag(
new DecryptedPayload(
{
uuid: mockUuid(),
content_type: ContentType.TYPES.Tag,
content: FillItemContent<TagContent>(content),
key_system_identifier,
...PayloadTimestampDefaults(),
},
PayloadSource.Constructor,
),
)
}
describe('VaultService', () => {
let sync: SyncServiceInterface
let items: ItemManagerInterface
let mutator: MutatorClientInterface
let vaultLocks: VaultLockServiceInterface
let alerts: AlertService
let _getVault: GetVault
let _getVaults: GetVaults
let _changeVaultKeyOptions: ChangeVaultKeyOptions
let _moveItemsToVault: MoveItemsToVault
let _createVault: CreateVault
let _removeItemFromVault: RemoveItemFromVault
let _deleteVault: DeleteVault
let _rotateVaultKey: RotateVaultKey
let _sendVaultDataChangeMessage: SendVaultDataChangedMessage
let _isVaultOwner: IsVaultOwner
let _validateVaultPassword: ValidateVaultPassword
let _authorizeVaultDeletion: AuthorizeVaultDeletion
let eventBus: InternalEventBusInterface
let service: VaultService
beforeEach(() => {
sync = {} as jest.Mocked<SyncServiceInterface>
items = {} as jest.Mocked<ItemManagerInterface>
mutator = {} as jest.Mocked<MutatorClientInterface>
vaultLocks = {} as jest.Mocked<VaultLockServiceInterface>
vaultLocks.isVaultLocked = jest.fn()
alerts = {} as jest.Mocked<AlertService>
alerts.alertV2 = jest.fn().mockResolvedValue({})
eventBus = {} as jest.Mocked<InternalEventBusInterface>
_getVault = {} as jest.Mocked<GetVault>
_getVaults = {} as jest.Mocked<GetVaults>
_changeVaultKeyOptions = {} as jest.Mocked<ChangeVaultKeyOptions>
_moveItemsToVault = {} as jest.Mocked<MoveItemsToVault>
_moveItemsToVault.execute = jest.fn().mockResolvedValue({})
_createVault = {} as jest.Mocked<CreateVault>
_removeItemFromVault = {} as jest.Mocked<RemoveItemFromVault>
_deleteVault = {} as jest.Mocked<DeleteVault>
_rotateVaultKey = {} as jest.Mocked<RotateVaultKey>
_sendVaultDataChangeMessage = {} as jest.Mocked<SendVaultDataChangedMessage>
_isVaultOwner = {} as jest.Mocked<IsVaultOwner>
_validateVaultPassword = {} as jest.Mocked<ValidateVaultPassword>
_authorizeVaultDeletion = {} as jest.Mocked<AuthorizeVaultDeletion>
service = new VaultService(
sync,
items,
mutator,
vaultLocks,
alerts,
_getVault,
_getVaults,
_changeVaultKeyOptions,
_moveItemsToVault,
_createVault,
_removeItemFromVault,
_deleteVault,
_rotateVaultKey,
_sendVaultDataChangeMessage,
_isVaultOwner,
_validateVaultPassword,
_authorizeVaultDeletion,
eventBus,
)
})
describe('moveItemToVault', () => {
it('should throw error if vault is locked', async () => {
vaultLocks.isVaultLocked = jest.fn().mockReturnValue(true)
const vault = {
uuid: '123',
} as VaultListingInterface
const item = {
uuid: '456',
} as DecryptedItemInterface
await expect(service.moveItemToVault(vault, item)).rejects.toThrow('Attempting to add item to locked vault')
})
describe('moving note/file into vault', () => {
it('should not move note/file if any item linked to it is already in another vault', async () => {
const vault = {
uuid: '123',
systemIdentifier: '456',
} as VaultListingInterface
const note = createNoteWithContent({ title: 'a' })
const file = createFile('b')
const returnValue = [
{
uuid: '789',
key_system_identifier: '234',
},
{
uuid: '012',
},
] as DecryptedItemInterface[]
items.getItemLinkedFiles = jest.fn().mockReturnValue(returnValue)
items.getItemLinkedNotes = jest.fn().mockReturnValue(returnValue)
items.getUnsortedTagsForItem = jest.fn().mockReturnValue(returnValue)
const result = await service.moveItemToVault(vault, note)
expect(result.isFailed()).toBe(true)
const result2 = await service.moveItemToVault(vault, file)
expect(result2.isFailed()).toBe(true)
})
})
describe('moving tag into vault', () => {
it('should not move tag if any deeply nested subtag is already in another vault', async () => {
const vault = {
uuid: '123',
systemIdentifier: '456',
} as VaultListingInterface
const parentTag = createTagWithContent({ title: 'a' })
const subTag = createTagWithContent({ title: 'b' }, '123')
const anotherSubTag = createTagWithContent({ title: 'c' })
items.getDeepTagChildren = jest.fn().mockReturnValue([subTag, anotherSubTag])
const result = await service.moveItemToVault(vault, parentTag)
expect(result.isFailed()).toBe(true)
})
it('should move parent tag and all deeply nested subtags into vault', async () => {
const vault = {
uuid: '123',
systemIdentifier: '456',
} as VaultListingInterface
const parentTag = createTagWithContent({ title: 'a' })
const subTag = createTagWithContent({ title: 'b' })
const anotherSubTag = createTagWithContent({ title: 'c' })
items.getDeepTagChildren = jest.fn().mockReturnValue([subTag, anotherSubTag])
items.findSureItem = jest.fn().mockReturnValue(parentTag.uuid)
const result = await service.moveItemToVault(vault, parentTag)
expect(result.isFailed()).toBe(false)
})
})
})
})
@@ -5,14 +5,16 @@ import { isClientDisplayableError } from '@standardnotes/responses'
import {
DecryptedItemInterface,
EmojiString,
FileItem,
IconType,
KeySystemIdentifier,
KeySystemRootKeyStorageMode,
SNTag,
SharedVaultListingInterface,
VaultListingInterface,
VaultListingMutator,
isFile,
isNote,
isTag,
} from '@standardnotes/models'
import { VaultServiceInterface } from './VaultServiceInterface'
import { ChangeVaultKeyOptionsDTO } from './UseCase/ChangeVaultKeyOptionsDTO'
@@ -83,22 +85,8 @@ export class VaultService
return this._getVaults.execute().getValue()
}
public getVault(dto: { keySystemIdentifier: KeySystemIdentifier }): VaultListingInterface | undefined {
const result = this._getVault.execute(dto)
if (result.isFailed()) {
return undefined
}
return result.getValue()
}
public getSureVault(dto: { keySystemIdentifier: KeySystemIdentifier }): VaultListingInterface {
const vault = this.getVault(dto)
if (!vault) {
throw new Error('Vault not found')
}
return vault
getVault(dto: { keySystemIdentifier: KeySystemIdentifier }): Result<VaultListingInterface> {
return this._getVault.execute(dto)
}
async createRandomizedVault(dto: {
@@ -146,29 +134,56 @@ export class VaultService
async moveItemToVault(
vault: VaultListingInterface,
item: DecryptedItemInterface,
): Promise<DecryptedItemInterface | undefined> {
): Promise<Result<DecryptedItemInterface>> {
if (this.vaultLocks.isVaultLocked(vault)) {
throw new Error('Attempting to add item to locked vault')
}
let linkedFiles: FileItem[] = []
if (isNote(item)) {
linkedFiles = this.items.getNoteLinkedFiles(item)
if (isNote(item) || isFile(item)) {
const linkedFiles = this.items.getItemLinkedFiles(item)
const linkedNotes = this.items.getItemLinkedNotes(item)
const linkedTags = this.items.getUnsortedTagsForItem(item)
if (linkedFiles.length > 0) {
const confirmed = await this.alerts.confirmV2({
title: 'Linked files will be moved to vault',
text: `This note has ${linkedFiles.length} linked files. They will also be moved to the vault. Do you want to continue?`,
})
if (!confirmed) {
return undefined
}
const areAnyLinkedItemsInOtherVaults = [...linkedFiles, ...linkedNotes, ...linkedTags].some((linkedItem) => {
return linkedItem.key_system_identifier !== vault.systemIdentifier
})
if (areAnyLinkedItemsInOtherVaults) {
const reason =
'This item is linked to other items that are not in the same vault. Please move those items to this vault first.'
this.alerts
.alertV2({
title: 'Cannot move item to vault',
text: reason,
})
.catch(console.error)
return Result.fail(reason)
}
}
await this._moveItemsToVault.execute({ vault, items: [item, ...linkedFiles] })
let moveableSubtags: SNTag[] = []
if (isTag(item)) {
const deepSubtags = this.items.getDeepTagChildren(item)
const anySubtagIsInOtherVault = deepSubtags.some((subtag) => {
return subtag.key_system_identifier && subtag.key_system_identifier !== vault.systemIdentifier
})
if (anySubtagIsInOtherVault) {
const reason =
'One or more subtags are in other vaults. Please remove those subtags from the vaults or move them to this vault first.'
this.alerts
.alertV2({
title: 'Cannot move item to vault',
text: reason,
})
.catch(console.error)
return Result.fail(reason)
}
moveableSubtags = deepSubtags
}
return this.items.findSureItem(item.uuid)
await this._moveItemsToVault.execute({ vault, items: [item, ...moveableSubtags] })
return Result.ok(this.items.findSureItem(item.uuid))
}
async removeItemFromVault(item: DecryptedItemInterface): Promise<DecryptedItemInterface> {
@@ -181,6 +196,13 @@ export class VaultService
throw new Error('Attempting to remove item from locked vault')
}
if (isTag(item)) {
const deepSubtags = this.items.getDeepTagChildren(item)
for (const subtag of deepSubtags) {
await this._removeItemFromVault.execute({ item: subtag })
}
}
await this._removeItemFromVault.execute({ item })
return this.items.findSureItem(item.uuid)
}
@@ -244,6 +266,11 @@ export class VaultService
getItemVault(item: DecryptedItemInterface): VaultListingInterface | undefined {
const latestItem = this.items.findItem(item.uuid)
if (this.items.isTemplateItem(item)) {
return undefined
}
if (!latestItem) {
throw new Error('Cannot find latest version of item to get vault for')
}
@@ -252,7 +279,12 @@ export class VaultService
return undefined
}
return this.getVault({ keySystemIdentifier: latestItem.key_system_identifier })
const vault = this.getVault({ keySystemIdentifier: latestItem.key_system_identifier })
if (vault.isFailed()) {
throw new Error('Cannot find vault for item')
}
return vault.getValue()
}
async changeVaultKeyOptions(dto: ChangeVaultKeyOptionsDTO): Promise<Result<void>> {
@@ -28,14 +28,11 @@ export interface VaultServiceInterface
}): Promise<VaultListingInterface>
getVaults(): VaultListingInterface[]
getVault(dto: { keySystemIdentifier: KeySystemIdentifier }): VaultListingInterface | undefined
getVault(dto: { keySystemIdentifier: KeySystemIdentifier }): Result<VaultListingInterface>
authorizeVaultDeletion(vault: VaultListingInterface): Promise<Result<boolean>>
deleteVault(vault: VaultListingInterface): Promise<boolean>
moveItemToVault(
vault: VaultListingInterface,
item: DecryptedItemInterface,
): Promise<DecryptedItemInterface | undefined>
moveItemToVault(vault: VaultListingInterface, item: DecryptedItemInterface): Promise<Result<DecryptedItemInterface>>
removeItemFromVault(item: DecryptedItemInterface): Promise<DecryptedItemInterface>
isItemInVault(item: DecryptedItemInterface): boolean
getItemVault(item: DecryptedItemInterface): VaultListingInterface | undefined
@@ -124,6 +124,7 @@ export class InviteToVault implements UseCaseInterface<SharedVaultInviteServerHa
description: params.sharedVault.description,
iconString: params.sharedVault.iconString,
fileBytesUsed: params.sharedVault.sharing.fileBytesUsed,
designatedSurvivor: params.sharedVault.sharing.designatedSurvivor,
},
},
},
@@ -6,7 +6,7 @@ import {
isClientDisplayableError,
isErrorResponse,
} from '@standardnotes/responses'
import { ContentType, Result } from '@standardnotes/domain-core'
import { ContentType, NotificationType, Result } from '@standardnotes/domain-core'
import { SharedVaultInvitesServer } from '@standardnotes/api'
import {
AsymmetricMessageSharedVaultInvite,
@@ -40,6 +40,7 @@ import { DecryptErroredPayloads } from '../Encryption/UseCase/DecryptErroredPayl
import { StatusServiceInterface } from '../Status/StatusServiceInterface'
import { ApplicationEvent } from '../Event/ApplicationEvent'
import { WebSocketsServiceEvent } from '../Api/WebSocketsServiceEvent'
import { NotificationServiceEvent, NotificationServiceEventPayload } from '../UserEvent/NotificationServiceEvent'
export class VaultInviteService
extends AbstractService<VaultInviteServiceEvent>
@@ -124,12 +125,25 @@ export class VaultInviteService
}
void this.downloadInboundInvites()
break
case NotificationServiceEvent.NotificationReceived:
await this.handleNotification(event.payload as NotificationServiceEventPayload)
break
case WebSocketsServiceEvent.UserInvitedToSharedVault:
await this.processInboundInvites([(event as UserInvitedToSharedVaultEvent).payload.invite])
break
}
}
private async handleNotification(event: NotificationServiceEventPayload): Promise<void> {
switch (event.eventPayload.props.type.value) {
case NotificationType.TYPES.SharedVaultInviteCanceled: {
this.removePendingInvite(event.eventPayload.props.primaryIdentifier.value)
void this.notifyEvent(VaultInviteServiceEvent.InvitesReloaded)
break
}
}
}
public getCachedPendingInviteRecords(): InviteRecord[] {
return Object.values(this.pendingInvites)
}
@@ -179,7 +193,8 @@ export class VaultInviteService
this.removePendingInvite(pendingInvite.invite.uuid)
void this.sync.sync()
this.sync.sync().catch(console.error)
this.vaultUsers.invalidateVaultUsersCache(pendingInvite.invite.shared_vault_uuid).catch(console.error)
await this._decryptErroredPayloads.execute()
@@ -191,7 +206,7 @@ export class VaultInviteService
public async getInvitableContactsForSharedVault(
sharedVault: SharedVaultListingInterface,
): Promise<TrustedContactInterface[]> {
const users = await this.vaultUsers.getSharedVaultUsers(sharedVault)
const users = await this.vaultUsers.getSharedVaultUsersFromServer(sharedVault)
if (!users) {
return []
}
@@ -0,0 +1,66 @@
import { SharedVaultUsersServerInterface } from '@standardnotes/api'
import { DesignateSurvivor } from './DesignateSurvivor'
describe('DesignateSurvivor', () => {
let sharedVaultUserServer: SharedVaultUsersServerInterface
const createUseCase = () => new DesignateSurvivor(
sharedVaultUserServer,
)
beforeEach(() => {
sharedVaultUserServer = {} as jest.Mocked<SharedVaultUsersServerInterface>
sharedVaultUserServer.designateSurvivor = jest.fn().mockReturnValue({
status: 200,
})
})
it('should mark designated survivor', async () => {
const useCase = createUseCase()
const result = await useCase.execute({
sharedVaultUuid: '00000000-0000-0000-0000-000000000000',
sharedVaultMemberUuid: '00000000-0000-0000-0000-000000000000',
})
expect(result.isFailed()).toBe(false)
})
it('should fail if shared vault uuid is invalid', async () => {
const useCase = createUseCase()
const result = await useCase.execute({
sharedVaultUuid: 'invalid',
sharedVaultMemberUuid: '00000000-0000-0000-0000-000000000000',
})
expect(result.isFailed()).toBe(true)
})
it('should fail if shared vault member uuid is invalid', async () => {
const useCase = createUseCase()
const result = await useCase.execute({
sharedVaultUuid: '00000000-0000-0000-0000-000000000000',
sharedVaultMemberUuid: 'invalid',
})
expect(result.isFailed()).toBe(true)
})
it('should fail if shared vault user server fails', async () => {
sharedVaultUserServer.designateSurvivor = jest.fn().mockReturnValue({
status: 500,
})
const useCase = createUseCase()
const result = await useCase.execute({
sharedVaultUuid: '00000000-0000-0000-0000-000000000000',
sharedVaultMemberUuid: '00000000-0000-0000-0000-000000000000',
})
expect(result.isFailed()).toBe(true)
})
})
@@ -0,0 +1,34 @@
import { Result, UseCaseInterface, Uuid } from '@standardnotes/domain-core'
import { SharedVaultUsersServerInterface } from '@standardnotes/api'
import { HttpStatusCode } from '@standardnotes/responses'
import { DesignateSurvivorDTO } from './DesignateSurvivorDTO'
export class DesignateSurvivor implements UseCaseInterface<void> {
constructor(private sharedVaultUserServer: SharedVaultUsersServerInterface) {}
async execute(dto: DesignateSurvivorDTO): Promise<Result<void>> {
const sharedVaultUuidOrError = Uuid.create(dto.sharedVaultUuid)
if (sharedVaultUuidOrError.isFailed()) {
return Result.fail(sharedVaultUuidOrError.getError())
}
const sharedVaultUuid = sharedVaultUuidOrError.getValue()
const sharedVaultMemberUuidOrError = Uuid.create(dto.sharedVaultMemberUuid)
if (sharedVaultMemberUuidOrError.isFailed()) {
return Result.fail(sharedVaultMemberUuidOrError.getError())
}
const sharedVaultMemberUuid = sharedVaultMemberUuidOrError.getValue()
const response = await this.sharedVaultUserServer.designateSurvivor({
sharedVaultUuid,
sharedVaultMemberUuid,
})
if (response.status !== HttpStatusCode.Success) {
return Result.fail('Failed to mark designated survivor on the server')
}
return Result.ok()
}
}
@@ -0,0 +1,4 @@
export interface DesignateSurvivorDTO {
sharedVaultUuid: string
sharedVaultMemberUuid: string
}

Some files were not shown because too many files have changed in this diff Show More