Compare commits

...
Author SHA1 Message Date
StandardNotes CI 32c917e6c8 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected].7
2023-01-10 18:45:25 +00:00
Mo 9f02329293 chore: update links 2023-01-10 12:15:18 -06:00
Karol Sójko aa236c784f chore: remove invalidatin cache on non-existing cloudfront distribution 2023-01-10 07:23:05 +01:00
StandardNotes CI d2a66556e0 chore(release): publish
- @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected].6
2023-01-09 16:54:54 +00:00
Karol SójkoandMo 8deeae5a16 feat(snjs): add account recovery e2e test suite (#2134)
* feat(snjs): add account recovery e2e test suite

* fix(snjs): request params in account recovery tests

* fix(snjs): context password passing

* refactor: replace factory functions with context

Co-authored-by: Mo <[email protected]>
2023-01-09 17:25:52 +01:00
StandardNotes CI 0d8a05b805 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].5
2023-01-09 07:40:10 +00:00
Karol Sójko 10751ea2ed feat(snjs): add getting recovery codes (#2132) 2023-01-09 08:13:12 +01:00
StandardNotes CI 6b774db222 chore(release): publish
- @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].4
2023-01-09 06:23:12 +00:00
Karol SójkoandMo be028ff87b feat(snjs): add sign in with recovery codes use case (#2130)
* feat(snjs): add sign in with recovery codes use case

* fix(snjs): code review adjustments

* fix(snjs): remove unnecessary exposed getter

* fix(services): waiting for event handling

* fix: preferences test

Co-authored-by: Mo <[email protected]>
2023-01-09 06:52:56 +01:00
StandardNotes CI 5f09fc74da chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2023-01-07 09:52:22 +00:00
Aman Harwara 340f4f7f09 fix: Fixed issue where search button would not show up in Files view 2023-01-07 14:50:06 +05:30
Aman Harwara 371a47d838 refactor: new note default editor options 2023-01-07 14:47:17 +05:30
StandardNotes CI b839ebb58a chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2023-01-06 20:16:01 +00:00
Aman Harwara 482c4d1ca4 fix: Fixed issue where the "Attached to" in table view would report an extra number of links 2023-01-07 01:18:50 +05:30
StandardNotes CI 5f96281948 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].1
2023-01-06 16:02:46 +00:00
Aman Harwara 2e79fc412c fix: Fixed issue where the importer would not correctly parse Google Keep JSON notes 2023-01-06 20:57:18 +05:30
StandardNotes CI 5bdbfe9fc7 chore(release): publish
- @standardnotes/[email protected].4
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].0
2023-01-06 11:59:51 +00:00
Aman Harwara dd8ccdeadc feat: Added per-tag preference to use table layout and removed "Files Table View" from Labs 2023-01-06 17:00:19 +05:30
StandardNotes CI eea97362f8 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
2023-01-05 20:59:57 +00:00
Aman Harwara 01294868c9 Merge branch 'main' of github.com:standardnotes/app 2023-01-06 02:02:16 +05:30
Aman Harwara 77ec9ca335 refactor: files table view -> content table view 2023-01-06 02:02:07 +05:30
StandardNotes CI 3e6c752967 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
2023-01-05 18:43:40 +00:00
Aman Harwara ba017d42f5 feat: Added keyboard navigation to Files table view (#2131) 2023-01-05 23:45:10 +05:30
StandardNotes CI bd3df71dd4 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2023-01-05 10:28:19 +00:00
Aman Harwara 22c6e2c56c feat: Added linked items container & autocomplete input to file preview modal 2023-01-05 15:32:18 +05:30
StandardNotes CI 496525ef61 chore(release): publish
- @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].0
2023-01-04 20:27:27 +00:00
Aman Harwara 6b2f8f3da2 Merge branch 'main' of github.com:standardnotes/app 2023-01-05 01:23:24 +05:30
Aman Harwara e57b28fe29 feat: Added file options menu to file preview modal 2023-01-05 01:23:15 +05:30
Aman Harwara ba4b6a580b feat: Added "Add tag" option to file context menu 2023-01-05 01:16:35 +05:30
Mo 59fc68296b refactor: optimize delay between batches on mobile to allow UI interactivity during load (#2129) 2023-01-04 13:31:45 -06:00
StandardNotes CI 69b2af7612 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].3
2023-01-04 19:10:43 +00:00
Aman Harwara 30dda73e90 fix: Fixed issue where file upload toast would close before completion if you switched windows 2023-01-05 00:13:42 +05:30
StandardNotes CI 81ea9e896c chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2023-01-04 01:14:43 +00:00
Mo bc9247df41 chore: trigger build 2023-01-03 18:46:49 -06:00
StandardNotes CI 71e8645ca4 chore(release): publish
- @standardnotes/[email protected].1
 - @standardnotes/[email protected]
2023-01-03 23:51:59 +00:00
Mo 72f384c215 ci: remove mobile dev 2023-01-03 17:26:29 -06:00
Mo b65e8562f2 ci: remove unused workflow 2023-01-03 16:30:16 -06:00
StandardNotes CI 8ff7fb605a chore(release): publish
- @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].0
2023-01-03 20:43:29 +00:00
Mo 3c332a35f6 feat: improve initial load performance on mobile (#2126) 2023-01-03 14:15:45 -06:00
Mo a447fa1ad7 test: fix e2e testing setup 2023-01-03 11:00:12 -06:00
Mo 76d2d2112b ci: remove linux ia32 builds
Electron no longer offers builds for this architecture
2023-01-03 10:42:04 -06:00
StandardNotes CI 63cd1f9b07 chore(release): publish
- @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
2023-01-03 07:12:09 +00:00
Aman Harwara fbc93a4f28 refactor: only show open filesend menu option on mobile 2023-01-03 11:53:44 +05:30
Mo a896b4d9cf chore: remove redunant electronVersion from desktop build params 2023-01-02 23:26:15 -06:00
Mo c0a0ea185c chore(ci): fix mobile version script 2023-01-01 15:28:43 -06:00
StandardNotes CI a3d8f1f3ff chore(release): publish
- @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
2022-12-29 20:21:46 +00:00
Aman Harwara 6e4bf2417a feat: Added "Import" option in the account menu that allows you to import from plaintext/markdown files, Evernote exports, Simplenote exports, Google Keep exports and also convert Aegis exports to TokenVault notes 2022-12-30 01:22:59 +05:30
StandardNotes CI f1ae7a53ef chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
2022-12-29 16:11:00 +00:00
Aman Harwara cd5bd1640c fix: Use regular file list on mobile instead of table view 2022-12-29 21:11:00 +05:30
StandardNotes CI 7508a23979 chore(release): publish
- @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected].4
2022-12-29 15:30:13 +00:00
Karol Sójko 59e8b5c8b5 feat(api): add authenticators api (#2124)
* feat(api): add authenticators api

* fix(services): responses interpreting in authenticator manager
2022-12-29 16:04:53 +01:00
StandardNotes CI 5a8a37413e chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected].3
2022-12-29 07:50:08 +00:00
Aman Harwara 113d3bebb4 fix: Fixed issue where Super note font size would shift on first load 2022-12-29 12:51:32 +05:30
Aman Harwara 874f2e90bb Merge branch 'main' of github.com:standardnotes/app 2022-12-29 12:31:59 +05:30
Aman Harwara df4acbb1bc fix: Fixed issue where converting a note to Super from the note options menu would not work 2022-12-29 12:31:50 +05:30
StandardNotes CI b75be1d0f8 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2022-12-29 05:02:30 +00:00
Mo 015dd1e806 chore: bump version (skip e2e) 2022-12-28 22:47:56 -06:00
Mo 8e3ae80aa0 fix: Fixed issue where Moments could incorrectly get engaged during biometrics unlocking 2022-12-28 22:20:44 -06:00
StandardNotes CI 5a0d87845c chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].0
2022-12-28 21:47:36 +00:00
Aman Harwara b764296c8f feat: Added "Files Table View" to Labs 2022-12-29 02:44:04 +05:30
StandardNotes CI b0c11b1b4d chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2022-12-28 17:21:41 +00:00
Aman Harwara e81ecfc024 Update CHANGELOG.md 2022-12-28 22:20:28 +05:30
Aman Harwara b408d0a4c5 Update CHANGELOG.md.json 2022-12-28 22:20:08 +05:30
StandardNotes CI 9ec68c9bf6 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2022-12-28 16:44:26 +00:00
Aman Harwara 2611c690b0 fix: Fixed issue where Moments would capture even after disabling (#2122) 2022-12-28 21:44:01 +05:30
StandardNotes CI ef6e971592 chore(release): publish
- @standardnotes/[email protected]
2022-12-28 07:47:42 +00:00
Karol Sójko 1c48dd135c fix(docs): update self-hosted instructions 2022-12-28 08:20:16 +01:00
StandardNotes CI 495786514e chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].1
2022-12-27 20:17:11 +00:00
Aman Harwara cfd6cf5932 refactor(dev-only): disable note list keyboard nav when showing files table view 2022-12-28 01:20:08 +05:30
Aman Harwara 8c5944f233 refactor(dev-only): allow sorting files table view by file size 2022-12-28 01:14:57 +05:30
Aman Harwara 2b63484758 refactor(dev-only): use file view display prefs for files table 2022-12-28 00:49:09 +05:30
StandardNotes CI ccb15faff5 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].0
2022-12-27 18:29:52 +00:00
Aman Harwara dc33aef660 feat: Allow changing per-view display preferences for system views (#2120) 2022-12-27 23:33:08 +05:30
StandardNotes CI 771758fcd4 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
2022-12-27 15:59:31 +00:00
Aman Harwara 3fbe28e068 refactor(dev-only): import tools (#2121) 2022-12-27 21:03:01 +05:30
Karol Sójko e67240821c chore: fix triggered workflow for e2e test suites 2022-12-27 15:52:10 +01:00
StandardNotes CI d7c6ef6134 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-12-27 13:20:25 +00:00
Karol Sójko 8311271a49 fix(snjs): skip workspaces tests as they are a pending backlog feature 2022-12-27 13:49:02 +01:00
StandardNotes CI 4e61d9b3e3 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
2022-12-27 10:16:51 +00:00
Karol Sójko dd41082e71 fix(snjs): add error log upon not being able to reach the mock event publisher 2022-12-27 10:48:55 +01:00
StandardNotes CI adc6e9a353 chore(release): publish
- @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].8
2022-12-26 13:04:05 +00:00
Aman Harwara bfd9f37331 Merge branch 'main' of github.com:standardnotes/app 2022-12-26 18:08:00 +05:30
Aman Harwara 044a4fc36b fix: Fixed issue where right-clicking system view would open "Edit smart view" modal 2022-12-26 18:07:53 +05:30
StandardNotes CI fe4841c631 chore(release): publish
- @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
2022-12-26 11:18:12 +00:00
Aman Harwara 14a98b5736 Merge branch 'main' of github.com:standardnotes/app 2022-12-26 16:22:36 +05:30
Aman Harwara 326e1a455b feat: Clicking the link option in Super notes will automatically add the selected text as the link 2022-12-26 16:22:26 +05:30
StandardNotes CI c3c8c2b9ce chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
2022-12-26 10:25:01 +00:00
Aman Harwara 5e79cf90f4 Merge branch 'main' of github.com:standardnotes/app 2022-12-26 15:28:13 +05:30
Aman Harwara e798b71b9f fix: Fixed issue where adding child tag to note would also add all parent tags even though the related setting was turned off 2022-12-26 15:28:02 +05:30
StandardNotes CI afd89c387f chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
2022-12-26 07:31:06 +00:00
Aman Harwara 6bf6924a8b refactor(dev-only): table deferred loading and aria improvements 2022-12-26 12:34:06 +05:30
StandardNotes CI 0f7b1539e0 chore(release): publish
- @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2022-12-24 18:59:31 +00:00
Aman Harwara e1c21d5fbd Merge branch 'main' of github.com:standardnotes/app 2022-12-25 00:02:45 +05:30
Aman Harwara 52d0fed437 refactor(dev-only): add animation to file view search box and fix search bar on mobile 2022-12-25 00:02:36 +05:30
StandardNotes CI caee8f1c6f chore(release): publish
- @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2022-12-24 18:23:07 +00:00
Aman Harwara 40194d010f refactor(dev-only): add blurred bg to file table row actions 2022-12-24 23:27:39 +05:30
Aman Harwara 0373bf9a2d Merge branch 'main' of github.com:standardnotes/app 2022-12-24 23:01:22 +05:30
Aman Harwara d7eb43401a refactor(dev-only): fixed link item bubble bg color and text 2022-12-24 23:01:13 +05:30
StandardNotes CI a5a866a62a chore(release): publish
- @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2022-12-24 16:55:41 +00:00
Aman Harwara 6090962b2c Merge branch 'main' of github.com:standardnotes/app 2022-12-24 21:56:48 +05:30
Aman Harwara a9445dfcca refactor(dev-only): file list item style 2022-12-24 21:56:38 +05:30
Aman Harwara b3fe769a60 refactor(dev-only): hide non-applicable options in display options menu 2022-12-24 21:55:24 +05:30
Aman Harwara fc6d28d166 refactor(dev-only): show file local backup status in table 2022-12-24 21:54:53 +05:30
Aman Harwara 03eac4353d refactor(dev-only): align text-only cells correctly in table 2022-12-24 21:54:18 +05:30
StandardNotes CI 58d84c47c1 chore(release): publish
- @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2022-12-24 15:38:00 +00:00
Aman Harwara 577318e208 feat: Persist collapsible block state in Super notes (#2119) 2022-12-24 20:35:41 +05:30
StandardNotes CI b8da877804 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
2022-12-24 12:40:15 +00:00
Aman Harwara 17f4d20fb5 Merge branch 'main' of github.com:standardnotes/app 2022-12-24 17:43:35 +05:30
Aman Harwara 4f07b915f0 feat: Added FileSend links to general account menu and preferences menu 2022-12-24 17:43:26 +05:30
StandardNotes CI f2f61b18e2 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-12-24 12:11:23 +00:00
Aman Harwara 9fb506e532 refactor(dev-only): show file link row action in table view 2022-12-24 17:09:26 +05:30
Aman Harwara 3b64acc290 refactor(dev-only): files table view attached column wrapping 2022-12-24 17:05:13 +05:30
Aman Harwara e6824a3414 chore: remove comment 2022-12-24 17:00:17 +05:30
Aman Harwara 08985bb5c8 refactor(dev-only): file preview navigation from table view 2022-12-24 16:58:46 +05:30
Aman Harwara 77cb6e7891 refactor(dev-only): files table view 2022-12-24 16:48:55 +05:30
Aman Harwara 7e7c5e14ab refactor(dev-only): files table view (#2118) 2022-12-24 16:46:18 +05:30
StandardNotes CI 631be2e494 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-12-23 18:11:05 +00:00
Mo fe36009482 fix: Fixed issue where navigating to a Daily Notebook on iOS would cause editor panel to be offscreen 2022-12-23 11:46:22 -06:00
StandardNotes CI e77e852801 chore(release): publish
- @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-12-23 17:41:00 +00:00
Aman Harwara c59d824240 fix: Made Moments-related toast messages dismissable 2022-12-23 22:44:06 +05:30
Aman Harwara 2f3bc9b85b chore: Update Lexical to 0.7.5 (#2117) 2022-12-23 22:22:19 +05:30
StandardNotes CI 1ec173dcd6 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-12-23 09:59:41 +00:00
Aman Harwara 35b00737bf fix: Fixed issue where Super note would convert whole line into tag even after closing menu 2022-12-23 15:03:18 +05:30
StandardNotes CI f3e147f4c9 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
2022-12-22 15:23:29 +00:00
Mo 63fdb328cb chore: adjust mobile price copy 2022-12-22 08:54:02 -06:00
Aman Harwara 94c280256e fix: Disabled Moments photo capture when app is passcode or biometrics locked (#2114) 2022-12-22 20:07:48 +05:30
StandardNotes CI cf0dc19f63 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].9
2022-12-21 13:48:03 +00:00
Karol Sójko 2696b07759 fix(api): handling expired token responses (#2113) 2022-12-21 14:22:20 +01:00
StandardNotes CI 2cc5afb00a chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].8
2022-12-20 19:24:12 +00:00
Aman Harwara 1828f80ba5 chore: removed unnecessary warning 2022-12-21 00:27:16 +05:30
Aman Harwara 9c260c02f1 Merge branch 'main' of github.com:standardnotes/app 2022-12-20 23:58:31 +05:30
Aman Harwara e4b3028d67 fix: Increased interval between Moments capturing photos 2022-12-20 23:54:05 +05:30
Aman Harwara eceb46bed7 fix: Fixed issue where Moments-related toasts would not get correctly dismissed 2022-12-20 23:52:43 +05:30
StandardNotes CI b9e0d0d154 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
2022-12-20 17:03:06 +00:00
Aman Harwara a7add80633 fix: Added potential fix for issue where some video would show as not supported 2022-12-20 22:02:30 +05:30
StandardNotes CI 0941183c8b chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
2022-12-20 13:58:49 +00:00
Aman Harwara c94035c1d6 feat-dev(wip): files table view (#2100) 2022-12-20 19:01:24 +05:30
StandardNotes CI 343c39e873 chore(release): publish
- @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
2022-12-19 17:43:16 +00:00
Mo 889f245ab9 chore: upgrade web deps and lexical (#2094) 2022-12-19 11:11:32 -06:00
Tony e8ada146e1 docs: update edit link (#2104) 2022-12-19 11:09:16 -06:00
StandardNotes CI c9c5e915ce chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected].4
2022-12-19 15:22:56 +00:00
Karol Sójko a1ec13d0b0 fix(snjs): skip subscriptions test suite until fixed 2022-12-19 15:52:32 +01:00
Aman Harwara 31bb03943d refactor: de-couple linking controller from active item (#2108) 2022-12-19 20:08:57 +05:30
StandardNotes CI 2b84c242f7 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected].3
2022-12-19 13:49:02 +00:00
Karol Sójko b8bf8ca112 fix(snjs): mark flaky subscription test as skipped until fixed 2022-12-19 14:23:34 +01:00
StandardNotes CI c914b88e2d chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].2
2022-12-19 10:06:43 +00:00
Aman Harwara 0169224bf2 chore(ci): trigger publish (skip e2e) 2022-12-19 15:22:08 +05:30
Aman Harwara 4049b19170 Merge branch 'main' of github.com:standardnotes/app 2022-12-19 14:44:46 +05:30
Aman Harwara df4148f824 fix: Fixed issue where the first item in item link autcomplete would not be correctly focused (skip e2e) 2022-12-19 14:44:34 +05:30
Aman Harwara 91f3295cff fix: Fixed white screen issue on mobile 2022-12-19 13:36:16 +05:30
StandardNotes CI c9078f374b chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
2022-12-19 07:53:04 +00:00
Karol Sójko bb4f1ff099 fix(snjs): refreshing sessions (#2106)
* fix(snjs): refreshing sessions

* fix(snjs): bring back all tests

* fix(snjs): passing session tokens values

* fix(api): remove redundant specs

* fix(snjs): add projecting sessions to storage values

* fix(snjs): deps tree

* fix(snjs): bring back subscription tests

* fix(snjs): remove only tag for migration tests

* fix(snjs): session specs
2022-12-19 08:28:10 +01:00
StandardNotes CI abdaec89b7 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
2022-12-16 20:09:12 +00:00
Aman Harwara f559442a67 feat: Added "Whats New" indicator to Preferences button (#2107) 2022-12-17 00:35:25 +05:30
StandardNotes CI 51aed0a518 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2022-12-15 16:01:35 +00:00
Mo 35bb671e31 build: only unpack keytar for macOS to avoid Windows runtime issue (skip e2e) 2022-12-15 09:47:17 -06:00
StandardNotes CI d76b190aba chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-12-15 09:54:12 +00:00
Aman Harwara d6fd85e451 fix(desktop): Fixed issue where the "Record video" modal would error after stopping recording 2022-12-15 14:55:31 +05:30
StandardNotes CI c90087462f chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2022-12-14 16:57:03 +00:00
Mo 58838a44cc ci: trigger desktop build 2022-12-14 10:24:20 -06:00
StandardNotes CI 0223800fdf chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-12-14 15:55:51 +00:00
Mo 318b1fdb0f build: remove entitlements no longer required by newer versions of Electron 2022-12-14 08:54:56 -06:00
StandardNotes CI fb517a91b0 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].0
2022-12-13 17:15:10 +00:00
Mo c7b158eb64 ci(temp): skip subscription tests 2022-12-13 10:50:44 -06:00
Aman Harwara d4b63e4ea6 feat: Ability to record videos and capture photos directly in app by selecting + in Files view (#2095) 2022-12-13 21:41:41 +05:30
Karol Sójko cd8596b14e Revert "fix(snjs): add sleep intervals for subscription sharing tests"
This reverts commit 4e576d7526.
2022-12-13 06:39:23 +01:00
Karol Sójko 6c11766051 chore: upgrade trigger-workflow-and-wait procedure 2022-12-12 13:25:14 +01:00
Karol Sójko 7f41564328 fix(snjs): remove @newrelic/native-metrics by upgrading @standardnotes/settings 2022-12-12 13:23:20 +01:00
Karol Sójko 4e576d7526 fix(snjs): add sleep intervals for subscription sharing tests 2022-12-12 13:22:53 +01:00
StandardNotes CI 317c6555d2 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2022-12-08 19:53:54 +00:00
Aman Harwara 220f62665e feat: Added "Open" button to file upload success notification (#2091) 2022-12-09 00:58:32 +05:30
StandardNotes CI 1dc9086257 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
2022-12-08 17:37:43 +00:00
Mo d149b500ee feat: Add current Writing Streak to Daily Notebooks (#2093) 2022-12-08 11:11:13 -06:00
StandardNotes CI ad70bea368 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected].1
2022-12-08 16:09:41 +00:00
Aman Harwara 3bcd969f83 chore: remove unnecessary conditions 2022-12-08 21:12:45 +05:30
Aman Harwara d4af612fea fix: Fixed issue where passcode lock setting was not visible on mobile 2022-12-08 21:00:54 +05:30
Aman Harwara b068b814f2 refactor: allow opting out of toast pause on window blur behavior 2022-12-08 20:49:13 +05:30
StandardNotes CI 51de012236 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2022-12-08 03:35:46 +00:00
Mo 2694c2f1a9 refactor: class-based photo recorder for Moments 2022-12-07 21:09:23 -06:00
Mo d3609853c6 fix: alignment of Loading text in What's New screen 2022-12-07 20:37:53 -06:00
Mo a7ac715499 feat: Moments will now create a link with the current open note, so you can look back on what you were working on during a moment 2022-12-07 20:34:17 -06:00
StandardNotes CI 5ac93a6bd8 chore(release): publish
- @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].0
2022-12-07 17:40:15 +00:00
Mo be4cc4e605 feat: add ability to convert selection in Super to bulleted or numbered list 2022-12-07 11:14:03 -06:00
StandardNotes CI 2fa3fec9ab chore(release): publish
- @standardnotes/[email protected]
2022-12-07 15:08:32 +00:00
Mo 059ee9ea36 chore: update documentation 2022-12-07 08:39:07 -06:00
Mo 66d08895fe chore: update documentation 2022-12-07 08:35:47 -06:00
StandardNotes CI 518643dc71 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].1
2022-12-07 13:03:02 +00:00
Aman Harwara 5a0c005e8c fix: Fixed issue about note UUID not being selectable in menu 2022-12-07 18:01:07 +05:30
Aman Harwara 45cdab6f6c fix: Fixed workspace menu item rename issue 2022-12-07 17:46:49 +05:30
StandardNotes CI 46245b5569 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2022-12-07 04:27:17 +00:00
Mo 8b103307cb fix: improve variance between Super header font sizes and weights 2022-12-06 22:01:44 -06:00
Mo a70d1009a3 feat: add Indent/Outdent options in Super when on mobile 2022-12-06 21:56:05 -06:00
Mo a5b1ff9595 fix: Fixed issue where entering a space or punctuation in Super autocomplete would dismiss menu 2022-12-06 21:43:45 -06:00
Mo d691d7a3b3 fix: Fixed issue where Dark theme could be called 'Focus' in Appearance preferences 2022-12-06 21:13:04 -06:00
StandardNotes CI 71675dc6a2 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2022-12-06 19:39:07 +00:00
Aman Harwara 6a1b6cef1b fix: Fixed error when trying to upload file 2022-12-07 00:42:03 +05:30
Karol Sójko 3d8c12a789 fix: invalidate cache on web deploy for both .com and .org domains 2022-12-06 09:34:45 +01:00
StandardNotes CI 370aaecfb8 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].2
2022-12-06 01:52:37 +00:00
Mo 68bfb2ff68 chore: fix test 2022-12-05 19:25:46 -06:00
Mo a66bb08c3b fix: fixed issue where popover menus would open with incorrect positioning on desktop 2022-12-05 17:34:41 -06:00
Mo ccde207de8 chore: add deprecation notice on dot org site 2022-12-05 17:20:47 -06:00
Mo d3262b0f01 chore: fix permission 2022-12-05 17:05:34 -06:00
Mo ffbc984c58 fix: fixed issue where camera was not accessible for Moments on Android 2022-12-05 17:01:04 -06:00
StandardNotes CI 979163bae7 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2022-12-05 22:15:54 +00:00
Mo c928f8a281 fix: fixes issue where add button would not be visible at times on iOS (#2087)
* fix: fixes issue where add button would not be visible at times on iOS

* fix: fixes issue where screens could not be navigated with certain window sizes
2022-12-05 15:50:19 -06:00
StandardNotes CI 0e10b347b6 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].0
2022-12-05 16:06:51 +00:00
Mo caf2c4a876 feat: add Super note type to list of note types (#2086) 2022-12-05 09:38:42 -06:00
Mo 1d22365086 fix: fixes issue where first change was ignored with Super notes 2022-12-05 07:56:10 -06:00
Mo bd5ccbfab6 refactor: avoid deallocing note controller until local propagation complete 2022-12-05 07:53:21 -06:00
StandardNotes CI 46b19d8caf chore(release): publish
- @standardnotes/[email protected].9
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2022-12-05 13:22:42 +00:00
Mo a6a0d615c5 fix: fixes issue where toggled-off panes would reappear after making selection 2022-12-05 06:55:39 -06:00
StandardNotes CI f3203e2e80 chore(release): publish
- @standardnotes/[email protected].8
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
2022-12-05 09:41:22 +00:00
Aman Harwara e0edabb4b9 Merge branch 'main' of github.com:standardnotes/app 2022-12-05 14:17:36 +05:30
Aman Harwara e68c708628 feat: Added keyboard shortcut to toggle dark theme (Ctrl/Cmd+Shift+D) 2022-12-05 14:17:29 +05:30
StandardNotes CI e4f3f26937 chore(release): publish
- @standardnotes/[email protected].7
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
2022-12-05 08:34:49 +00:00
Aman Harwara 8575b3e714 feat: Show preferences keyboard shortcut in tooltip 2022-12-05 13:37:21 +05:30
Aman Harwara 7c261af230 feat: Added keyboard shortcut (Ctrl/Cmd+,) for opening preferences 2022-12-05 13:34:34 +05:30
Aman Harwara 71e20f2a2f fix: Fixed purchase flow padding 2022-12-05 13:18:22 +05:30
StandardNotes CI 3855b9f767 chore(release): publish
- @standardnotes/[email protected].6
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
2022-12-04 11:47:50 +00:00
Aman Harwara 5c29e22ea4 Merge branch 'main' of github.com:standardnotes/app 2022-12-04 16:49:55 +05:30
Aman Harwara 07cb00a815 fix(mobile): Fixed issue where pressing the back button on editor screen wouldn't switch back to the items list on Android 2022-12-04 16:49:46 +05:30
StandardNotes CI 4f2ee4b56f chore(release): publish
- @standardnotes/[email protected].5
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2022-12-04 06:06:27 +00:00
Aman Harwara 90e10c76f7 refactor: separate selectAndUploadFile and uploadFile functions (#2085) 2022-12-04 11:11:37 +05:30
StandardNotes CI 2175c9cdcb chore(release): publish
- @standardnotes/[email protected].4
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2022-12-02 17:31:37 +00:00
Mo 8c41f0ecc3 fix: fixes issue where Moments camera wouldn't properly start on desktop app (#2084) 2022-12-02 11:05:32 -06:00
StandardNotes CI c8c166d2a0 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].2
2022-12-02 16:44:12 +00:00
Aman Harwara 6cacdd8c58 fix(mobile): Fixes issue where file upload doesn't work with immediate biometrics (#2083) 2022-12-02 21:48:56 +05:30
Mo b5b6192b60 fix: fixes issue where files imported from another account could not be deleted (#2082) 2022-12-02 10:13:25 -06:00
StandardNotes CI 635e2d9150 chore(release): publish
- @standardnotes/[email protected].2
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2022-12-02 15:59:51 +00:00
Aman Harwara 0c23e4d36c fix(mobile): PDF preview causing loop when biometrics are set to Immediate (#2080) 2022-12-02 21:02:52 +05:30
StandardNotes CI 1e8ce4bee6 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected].0
2022-12-02 15:13:17 +00:00
Mo 29368c51b8 feat: Moments: your personal photo journal, now available in Labs (#2079) 2022-12-02 08:41:21 -06:00
521 changed files with 13736 additions and 6588 deletions
+2 -8
View File
@@ -74,7 +74,7 @@ jobs:
- name: Compile for AppImage
run: yarn run webpack --config desktop.webpack.prod.js
- name: AppImage
run: yarn run electron-builder --linux --x64 --ia32 -c.linux.target=AppImage --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
run: yarn run electron-builder --linux --x64 -c.linux.target=AppImage --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
- name: AppImageX64
run: yarn run electron-builder --linux --x64 -c.linux.target=AppImage --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
- name: AppImageArm64
@@ -83,7 +83,7 @@ jobs:
- name: Deb
run: |
yarn run webpack --config desktop.webpack.prod.js --env deb
yarn run electron-builder --linux --x64 --ia32 -c.linux.target=deb --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
yarn run electron-builder --linux --x64 -c.linux.target=deb --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
- name: DebArm64
env:
npm_config_target_arch: 'arm64'
@@ -180,12 +180,6 @@ jobs:
- name: Generate Checksums
run: node scripts/sums.mjs
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
with:
path: packages/desktop
- name: Generate Release Notes
uses: ./actions/release-notes
with:
@@ -53,8 +53,3 @@ jobs:
with:
name: assets
path: packages/desktop/dist
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
with:
path: packages/desktop
+2 -8
View File
@@ -43,12 +43,6 @@ jobs:
lane: 'android prod'
subdirectory: 'packages/mobile'
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
with:
path: packages/mobile
- name: Generate Release Notes
uses: ./actions/release-notes
with:
@@ -60,8 +54,8 @@ jobs:
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.CI_PAT_TOKEN }}
tag_name: "@standardnotes/mobile@${{ steps.package-version.outputs.current-version}}"
name: "Mobile ${{ steps.package-version.outputs.current-version }}"
tag_name: "@standardnotes/mobile@${{ env.PACKAGE_VERSION }}"
name: "Mobile ${{ env.PACKAGE_VERSION }}"
body: ${{ steps.release-notes.outputs.result }}
prerelease: true
draft: false
-102
View File
@@ -1,102 +0,0 @@
name: Mobile TestFlight
on:
push:
tags:
- '*standardnotes/web*'
workflow_dispatch:
jobs:
android:
defaults:
run:
working-directory: packages/mobile
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Export version from package.json
run: |
echo "PACKAGE_VERSION=$(grep '"version"' ../web/package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV
- name: Setup react-native kernel and increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Decode Dev Android keystore
run: |
echo "${{ secrets.DEV_KEYSTORE }}" > keystore.keystore.asc
gpg -d --passphrase "${{ secrets.DEV_KEYSTORE_PASSPHRASE }}" --batch keystore.keystore.asc > android/app/keystore.keystore
- name: Ruby Setup for Fastlane
uses: ruby/setup-ruby@v1
- name: Install dependencies
run: yarn install --immutable
- run: yarn build:mobile
- name: fastlane
uses: maierj/[email protected]
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
BUILD_NUMBER: ${{ github.run_number }}
ANDROID_KEYSTORE_ALIAS: ${{ secrets.DEV_ANDROID_KEYSTORE_ALIAS }}
ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD: ${{ secrets.DEV_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.DEV_ANDROID_KEYSTORE_PASSWORD }}
GOOGLE_PLAY_JSON_KEY_DATA: ${{ secrets.GOOGLE_PLAY_JSON_KEY_DATA }}
with:
lane: 'android dev'
subdirectory: 'packages/mobile'
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
with:
path: packages/mobile
ios:
env:
ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD: true
defaults:
run:
working-directory: packages/mobile
runs-on: macos-11
timeout-minutes: 90
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Export version from package.json
run: |
echo "PACKAGE_VERSION=$(grep '"version"' ../web/package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV
- name: Ruby Setup for Fastlane
uses: ruby/setup-ruby@v1
- name: Install dependencies
run: yarn install --immutable && yarn install:pods
- run: yarn build:mobile
- name: Set ssh connection to Github
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Export Apple AppStore Connect API key
run: echo "${{ secrets.APPSTORE_CONNECT_KEY }}" > ios/Authkey.p8
- name: Setup fastlane
uses: maierj/[email protected]
env:
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
with:
lane: 'ios setup'
subdirectory: 'packages/mobile'
- name: fastlane
uses: maierj/[email protected]
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
APPLE_APP_ID: ${{ secrets.DEV_APP_APPLE_ID }}
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
APPSTORE_CONNECT_KEY_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ISSUER_ID }}
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
MATCH_CERTIFICATES_URL: ${{ secrets.MATCH_CERTIFICATES_URL }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
BUILD_NUMBER: ${{ github.run_number }}
with:
lane: 'ios dev'
subdirectory: 'packages/mobile'
+4 -4
View File
@@ -64,14 +64,14 @@ jobs:
- name: Run E2E test suite
if: "${{ contains(github.event.head_commit.message, 'skip e2e') == false }}"
uses: convictional/trigger-workflow-and-wait@v1.6.1
uses: convictional/trigger-workflow-and-wait@master
with:
owner: standardnotes
repo: e2e
repo: self-hosted
github_token: ${{ secrets.CI_PAT_TOKEN }}
workflow_file_name: testing-with-stable-server.yml
workflow_file_name: testing-with-updating-client-and-server.yml
wait_interval: 30
client_payload: '{"image_tag": "${{ github.sha }}"}'
client_payload: '{"snjs_image_tag": "${{ github.sha }}"}'
propagate_failure: true
trigger_workflow: true
wait_workflow: true
+4 -4
View File
@@ -40,14 +40,14 @@ jobs:
docker tag standardnotes/snjs:${{ github.sha }} standardnotes/snjs:test
docker push standardnotes/snjs:test
- name: Run E2E test suite
uses: convictional/trigger-workflow-and-wait@v1.6.1
uses: convictional/trigger-workflow-and-wait@master
with:
owner: standardnotes
repo: e2e
repo: self-hosted
github_token: ${{ secrets.CI_PAT_TOKEN }}
workflow_file_name: testing-with-stable-server.yml
workflow_file_name: testing-with-updating-client-and-server.yml
wait_interval: 30
client_payload: '{"image_tag": "${{ github.sha }}"}'
client_payload: '{"snjs_image_tag": "${{ github.sha }}"}'
propagate_failure: true
trigger_workflow: true
wait_workflow: true
+1 -1
View File
@@ -48,7 +48,7 @@ jobs:
- name: Invalidate CloudFront Cache
uses: chetan/invalidate-cloudfront-action@master
env:
DISTRIBUTION: ${{ secrets.WEBAPP_CLOUDFRONT_DISTRIBUTION_ID }}
DISTRIBUTION: ${{ secrets.WEBAPP_CLOUDFRONT_COM_DISTRIBUTION_ID }}
PATHS: '/*'
AWS_REGION: 'us-east-1'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
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.
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.
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.
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.
Binary file not shown.
+1 -1
View File
@@ -37,7 +37,7 @@ Join us on
- [Discord](https://standardnotes.com/discord)
- [Twitter](https://twitter.com/StandardNotes)
- [Forum](https://forum.standardnotes.org)
- [Forum](https://standardnotes.com/forum)
Developers can create and publish their own extensions. Visit the [documentation hub](https://docs.standardnotes.com/) to learn more.
+2 -2
View File
@@ -3,9 +3,9 @@ Thank you for your work in helping keep Standard Notes safe and secure. If you b
# Disclosure Policy
- Let us know as soon as possible upon discovery of a potential security issue, and we'll make every
effort to quickly resolve the issue. Please email [security@standardnotes.org](mailto:security@standardnotes.org) for a direct response.
effort to quickly resolve the issue. Please email [security@standardnotes.com](mailto:security@standardnotes.com) for a direct response.
- Provide us a reasonable amount of time to resolve the issue before any disclosure to the public or a
third-party. We may publicly disclose the issue before resolving it, if appropriate.
third-party. We may publicly disclose the issue before resolving it, if appropriate.
- Make a good faith effort to avoid privacy violations, destruction of data, and interruption or
degradation of our service. Only interact with accounts you own or with explicit permission of the
account holder.
+1 -1
View File
@@ -27,7 +27,7 @@
"build:services": "yarn workspaces foreach -pt --topological-dev --verbose -R --from @standardnotes/services run build",
"build:api": "yarn workspaces foreach -pt --topological-dev --verbose -R --from @standardnotes/api run build",
"start:server:web": "lerna run start --scope=@standardnotes/web",
"start:server:e2e": "lerna run start:test-server --scope=@standardnotes/snjs",
"e2e": "lerna run start:test-server --scope=@standardnotes/snjs",
"reset": "find . -type dir -name node_modules | xargs rm -rf && rm -rf yarn.lock && yarn install",
"release:prod": "lerna version --conventional-commits --yes -m \"chore(release): publish\"",
"publish:prod": "lerna publish from-git --yes --no-verify-access --loglevel verbose",
+82
View File
@@ -3,6 +3,88 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.23.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-09)
### Features
* **snjs:** add account recovery e2e test suite ([#2134](https://github.com/standardnotes/app/issues/2134)) ([8deeae5](https://github.com/standardnotes/app/commit/8deeae5a16191da7b4aad2ddc568e714fbeef8b8))
# [1.22.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-09)
### Features
* **snjs:** add sign in with recovery codes use case ([#2130](https://github.com/standardnotes/app/issues/2130)) ([be028ff](https://github.com/standardnotes/app/commit/be028ff87bb5306fc266b70567cbea8a13547e7e))
## [1.21.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-06)
**Note:** Version bump only for package @standardnotes/api
## [1.21.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-04)
**Note:** Version bump only for package @standardnotes/api
## [1.21.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-03)
**Note:** Version bump only for package @standardnotes/api
## [1.21.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-03)
**Note:** Version bump only for package @standardnotes/api
# [1.21.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-29)
### Features
* **api:** add authenticators api ([#2124](https://github.com/standardnotes/app/issues/2124)) ([59e8b5c](https://github.com/standardnotes/app/commit/59e8b5c8b5b61ef1cd8f291798c45860736a1296))
## [1.20.26](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-29)
**Note:** Version bump only for package @standardnotes/api
## [1.20.25](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-28)
**Note:** Version bump only for package @standardnotes/api
## [1.20.24](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/api
## [1.20.23](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/api
## [1.20.22](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-21)
### Bug Fixes
* **api:** handling expired token responses ([#2113](https://github.com/standardnotes/app/issues/2113)) ([2696b07](https://github.com/standardnotes/app/commit/2696b07759104fb1d40781897f69e63133ad824a))
## [1.20.21](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-19)
**Note:** Version bump only for package @standardnotes/api
## [1.20.20](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-19)
### Bug Fixes
* **snjs:** refreshing sessions ([#2106](https://github.com/standardnotes/app/issues/2106)) ([bb4f1ff](https://github.com/standardnotes/app/commit/bb4f1ff0990eb5a6f64e76a699fb95540cffdbb4))
## [1.20.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-08)
**Note:** Version bump only for package @standardnotes/api
## [1.20.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-05)
**Note:** Version bump only for package @standardnotes/api
## [1.20.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-02)
**Note:** Version bump only for package @standardnotes/api
## [1.20.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-02)
**Note:** Version bump only for package @standardnotes/api
## [1.20.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-01)
**Note:** Version bump only for package @standardnotes/api
-8
View File
@@ -6,12 +6,4 @@ module.exports = {
transform: {
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.json' }],
},
coverageThreshold: {
global: {
branches: 22,
functions: 69,
lines: 67,
statements: 67
}
}
};
+3 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.20.15",
"version": "1.23.0",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -23,7 +23,7 @@
"build": "tsc -p tsconfig.json",
"lint": "eslint src --ext .ts",
"lint:fix": "eslint src --ext .ts --fix",
"test": "jest spec --coverage"
"test": "jest spec --coverage --passWithNoTests"
},
"devDependencies": {
"@types/jest": "^29.2.3",
@@ -37,6 +37,7 @@
},
"dependencies": {
"@standardnotes/common": "^1.45.0",
"@standardnotes/domain-core": "^1.11.0",
"@standardnotes/encryption": "workspace:*",
"@standardnotes/models": "workspace:*",
"@standardnotes/responses": "workspace:*",
@@ -0,0 +1,5 @@
export enum AuthApiOperations {
GenerateRecoveryCodes,
GetRecoveryKeyParams,
SignInWithRecoveryCodes,
}
@@ -0,0 +1,94 @@
import { ApiVersion } from '../../Api'
import { ApiCallError } from '../../Error/ApiCallError'
import { ErrorMessage } from '../../Error/ErrorMessage'
import {
GenerateRecoveryCodesResponse,
RecoveryKeyParamsResponse,
SignInWithRecoveryCodesResponse,
} from '../../Response'
import { AuthServerInterface } from '../../Server'
import { AuthApiOperations } from './AuthApiOperations'
import { AuthApiServiceInterface } from './AuthApiServiceInterface'
export class AuthApiService implements AuthApiServiceInterface {
private operationsInProgress: Map<AuthApiOperations, boolean>
constructor(private authServer: AuthServerInterface) {
this.operationsInProgress = new Map()
}
async generateRecoveryCodes(): Promise<GenerateRecoveryCodesResponse> {
if (this.operationsInProgress.get(AuthApiOperations.GenerateRecoveryCodes)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
this.operationsInProgress.set(AuthApiOperations.GenerateRecoveryCodes, true)
try {
const response = await this.authServer.generateRecoveryCodes()
return response
} catch (error) {
throw new ApiCallError(ErrorMessage.GenericFail)
} finally {
this.operationsInProgress.set(AuthApiOperations.GenerateRecoveryCodes, false)
}
}
async recoveryKeyParams(dto: {
username: string
codeChallenge: string
recoveryCodes: string
}): Promise<RecoveryKeyParamsResponse> {
if (this.operationsInProgress.get(AuthApiOperations.GetRecoveryKeyParams)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
this.operationsInProgress.set(AuthApiOperations.GetRecoveryKeyParams, true)
try {
const response = await this.authServer.recoveryKeyParams({
api_version: ApiVersion.v0,
code_challenge: dto.codeChallenge,
recovery_codes: dto.recoveryCodes,
username: dto.username,
})
return response
} catch (error) {
throw new ApiCallError(ErrorMessage.GenericFail)
} finally {
this.operationsInProgress.set(AuthApiOperations.GetRecoveryKeyParams, false)
}
}
async signInWithRecoveryCodes(dto: {
username: string
password: string
codeVerifier: string
recoveryCodes: string
}): Promise<SignInWithRecoveryCodesResponse> {
if (this.operationsInProgress.get(AuthApiOperations.SignInWithRecoveryCodes)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
this.operationsInProgress.set(AuthApiOperations.SignInWithRecoveryCodes, true)
try {
const response = await this.authServer.signInWithRecoveryCodes({
api_version: ApiVersion.v0,
code_verifier: dto.codeVerifier,
password: dto.password,
recovery_codes: dto.recoveryCodes,
username: dto.username,
})
return response
} catch (error) {
throw new ApiCallError(ErrorMessage.GenericFail)
} finally {
this.operationsInProgress.set(AuthApiOperations.SignInWithRecoveryCodes, false)
}
}
}
@@ -0,0 +1,20 @@
import {
GenerateRecoveryCodesResponse,
RecoveryKeyParamsResponse,
SignInWithRecoveryCodesResponse,
} from '../../Response'
export interface AuthApiServiceInterface {
generateRecoveryCodes(): Promise<GenerateRecoveryCodesResponse>
recoveryKeyParams(dto: {
username: string
codeChallenge: string
recoveryCodes: string
}): Promise<RecoveryKeyParamsResponse>
signInWithRecoveryCodes(dto: {
username: string
password: string
codeVerifier: string
recoveryCodes: string
}): Promise<SignInWithRecoveryCodesResponse>
}
@@ -0,0 +1,8 @@
export enum AuthenticatorApiOperations {
List,
Delete,
GenerateRegistrationOptions,
GenerateAuthenticationOptions,
VerifyRegistrationResponse,
VerifyAuthenticationResponse,
}
@@ -0,0 +1,152 @@
import { ErrorMessage } from '../../Error/ErrorMessage'
import { ApiCallError } from '../../Error/ApiCallError'
import { AuthenticatorApiServiceInterface } from './AuthenticatorApiServiceInterface'
import { AuthenticatorApiOperations } from './AuthenticatorApiOperations'
import {
ListAuthenticatorsResponse,
DeleteAuthenticatorResponse,
GenerateAuthenticatorRegistrationOptionsResponse,
VerifyAuthenticatorRegistrationResponseResponse,
GenerateAuthenticatorAuthenticationOptionsResponse,
VerifyAuthenticatorAuthenticationResponseResponse,
} from '../../Response'
import { AuthenticatorServerInterface } from '../../Server/Authenticator/AuthenticatorServerInterface'
export class AuthenticatorApiService implements AuthenticatorApiServiceInterface {
private operationsInProgress: Map<AuthenticatorApiOperations, boolean>
constructor(private authenticatorServer: AuthenticatorServerInterface) {
this.operationsInProgress = new Map()
}
async list(): Promise<ListAuthenticatorsResponse> {
if (this.operationsInProgress.get(AuthenticatorApiOperations.List)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
this.operationsInProgress.set(AuthenticatorApiOperations.List, true)
try {
const response = await this.authenticatorServer.list({})
return response
} catch (error) {
throw new ApiCallError(ErrorMessage.GenericFail)
} finally {
this.operationsInProgress.set(AuthenticatorApiOperations.List, false)
}
}
async delete(authenticatorId: string): Promise<DeleteAuthenticatorResponse> {
if (this.operationsInProgress.get(AuthenticatorApiOperations.Delete)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
this.operationsInProgress.set(AuthenticatorApiOperations.Delete, true)
try {
const response = await this.authenticatorServer.delete({
authenticatorId,
})
return response
} catch (error) {
throw new ApiCallError(ErrorMessage.GenericFail)
} finally {
this.operationsInProgress.set(AuthenticatorApiOperations.Delete, false)
}
}
async generateRegistrationOptions(
userUuid: string,
username: string,
): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
if (this.operationsInProgress.get(AuthenticatorApiOperations.GenerateRegistrationOptions)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
this.operationsInProgress.set(AuthenticatorApiOperations.GenerateRegistrationOptions, true)
try {
const response = await this.authenticatorServer.generateRegistrationOptions({
username,
userUuid,
})
return response
} catch (error) {
throw new ApiCallError(ErrorMessage.GenericFail)
} finally {
this.operationsInProgress.set(AuthenticatorApiOperations.GenerateRegistrationOptions, false)
}
}
async verifyRegistrationResponse(
userUuid: string,
name: string,
registrationCredential: Record<string, unknown>,
): Promise<VerifyAuthenticatorRegistrationResponseResponse> {
if (this.operationsInProgress.get(AuthenticatorApiOperations.VerifyRegistrationResponse)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
this.operationsInProgress.set(AuthenticatorApiOperations.VerifyRegistrationResponse, true)
try {
const response = await this.authenticatorServer.verifyRegistrationResponse({
userUuid,
name,
registrationCredential,
})
return response
} catch (error) {
throw new ApiCallError(ErrorMessage.GenericFail)
} finally {
this.operationsInProgress.set(AuthenticatorApiOperations.VerifyRegistrationResponse, false)
}
}
async generateAuthenticationOptions(): Promise<GenerateAuthenticatorAuthenticationOptionsResponse> {
if (this.operationsInProgress.get(AuthenticatorApiOperations.GenerateAuthenticationOptions)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
this.operationsInProgress.set(AuthenticatorApiOperations.GenerateAuthenticationOptions, true)
try {
const response = await this.authenticatorServer.generateAuthenticationOptions({})
return response
} catch (error) {
throw new ApiCallError(ErrorMessage.GenericFail)
} finally {
this.operationsInProgress.set(AuthenticatorApiOperations.GenerateAuthenticationOptions, false)
}
}
async verifyAuthenticationResponse(
userUuid: string,
authenticationCredential: Record<string, unknown>,
): Promise<VerifyAuthenticatorAuthenticationResponseResponse> {
if (this.operationsInProgress.get(AuthenticatorApiOperations.VerifyAuthenticationResponse)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
this.operationsInProgress.set(AuthenticatorApiOperations.VerifyAuthenticationResponse, true)
try {
const response = await this.authenticatorServer.verifyAuthenticationResponse({
authenticationCredential,
userUuid,
})
return response
} catch (error) {
throw new ApiCallError(ErrorMessage.GenericFail)
} finally {
this.operationsInProgress.set(AuthenticatorApiOperations.VerifyAuthenticationResponse, false)
}
}
}
@@ -0,0 +1,27 @@
import {
ListAuthenticatorsResponse,
DeleteAuthenticatorResponse,
GenerateAuthenticatorRegistrationOptionsResponse,
VerifyAuthenticatorRegistrationResponseResponse,
GenerateAuthenticatorAuthenticationOptionsResponse,
VerifyAuthenticatorAuthenticationResponseResponse,
} from '../../Response'
export interface AuthenticatorApiServiceInterface {
list(): Promise<ListAuthenticatorsResponse>
delete(authenticatorId: string): Promise<DeleteAuthenticatorResponse>
generateRegistrationOptions(
userUuid: string,
username: string,
): Promise<GenerateAuthenticatorRegistrationOptionsResponse>
verifyRegistrationResponse(
userUuid: string,
name: string,
registrationCredential: Record<string, unknown>,
): Promise<VerifyAuthenticatorRegistrationResponseResponse>
generateAuthenticationOptions(): Promise<GenerateAuthenticatorAuthenticationOptionsResponse>
verifyAuthenticationResponse(
userUuid: string,
authenticationCredential: Record<string, unknown>,
): Promise<VerifyAuthenticatorAuthenticationResponseResponse>
}
@@ -1,211 +0,0 @@
import { type Invitation } from '@standardnotes/models'
import { SubscriptionInviteAcceptResponse } from '../../Response/Subscription/SubscriptionInviteAcceptResponse'
import { SubscriptionInviteCancelResponse } from '../../Response/Subscription/SubscriptionInviteCancelResponse'
import { SubscriptionInviteListResponse } from '../../Response/Subscription/SubscriptionInviteListResponse'
import { SubscriptionInviteResponse } from '../../Response/Subscription/SubscriptionInviteResponse'
import { SubscriptionServerInterface } from '../../Server/Subscription/SubscriptionServerInterface'
import { SubscriptionApiOperations } from './SubscriptionApiOperations'
import { SubscriptionApiService } from './SubscriptionApiService'
describe('SubscriptionApiService', () => {
let subscriptionServer: SubscriptionServerInterface
const createService = () => new SubscriptionApiService(subscriptionServer)
beforeEach(() => {
subscriptionServer = {} as jest.Mocked<SubscriptionServerInterface>
subscriptionServer.invite = jest.fn().mockReturnValue({
data: { success: true, sharedSubscriptionInvitationUuid: '1-2-3' },
} as jest.Mocked<SubscriptionInviteResponse>)
subscriptionServer.cancelInvite = jest.fn().mockReturnValue({
data: { success: true },
} as jest.Mocked<SubscriptionInviteCancelResponse>)
subscriptionServer.listInvites = jest.fn().mockReturnValue({
data: { invitations: [{} as jest.Mocked<Invitation>] },
} as jest.Mocked<SubscriptionInviteListResponse>)
subscriptionServer.acceptInvite = jest.fn().mockReturnValue({
data: { success: true },
} as jest.Mocked<SubscriptionInviteAcceptResponse>)
})
it('should invite a user', async () => {
const response = await createService().invite('[email protected]')
expect(response).toEqual({
data: {
success: true,
sharedSubscriptionInvitationUuid: '1-2-3',
},
})
expect(subscriptionServer.invite).toHaveBeenCalledWith({
api: '20200115',
identifier: '[email protected]',
})
})
it('should not invite a user if it is already inviting', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[SubscriptionApiOperations.Inviting, true]]),
})
let error = null
try {
await service.invite('[email protected]')
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not invite a user if the server fails', async () => {
subscriptionServer.invite = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().invite('[email protected]')
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should cancel an invite', async () => {
const response = await createService().cancelInvite('1-2-3')
expect(response).toEqual({
data: {
success: true,
},
})
expect(subscriptionServer.cancelInvite).toHaveBeenCalledWith({
api: '20200115',
inviteUuid: '1-2-3',
})
})
it('should not cancel an invite if it is already canceling', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[SubscriptionApiOperations.CancelingInvite, true]]),
})
let error = null
try {
await service.cancelInvite('1-2-3')
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not cancel an invite if the server fails', async () => {
subscriptionServer.cancelInvite = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().cancelInvite('1-2-3')
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should list invites', async () => {
const response = await createService().listInvites()
expect(response).toEqual({
data: {
invitations: [{} as jest.Mocked<Invitation>],
},
})
expect(subscriptionServer.listInvites).toHaveBeenCalledWith({
api: '20200115',
})
})
it('should not list invitations if it is already listing', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[SubscriptionApiOperations.ListingInvites, true]]),
})
let error = null
try {
await service.listInvites()
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not list invites if the server fails', async () => {
subscriptionServer.listInvites = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().listInvites()
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should accept an invite', async () => {
const response = await createService().acceptInvite('1-2-3')
expect(response).toEqual({
data: {
success: true,
},
})
expect(subscriptionServer.acceptInvite).toHaveBeenCalledWith({
inviteUuid: '1-2-3',
})
})
it('should not accept an invite if it is already accepting', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[SubscriptionApiOperations.AcceptingInvite, true]]),
})
let error = null
try {
await service.acceptInvite('1-2-3')
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not accept an invite if the server fails', async () => {
subscriptionServer.acceptInvite = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().acceptInvite('1-2-3')
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
})
@@ -1,197 +0,0 @@
import { ProtocolVersion, UserRequestType } from '@standardnotes/common'
import { type RootKeyParamsInterface } from '@standardnotes/models'
import { UserDeletionResponse } from '../../Response/User/UserDeletionResponse'
import { UserRegistrationResponse } from '../../Response/User/UserRegistrationResponse'
import { UserRequestResponse } from '../../Response/UserRequest/UserRequestResponse'
import { UserServerInterface } from '../../Server'
import { UserRequestServerInterface } from '../../Server/UserRequest/UserRequestServerInterface'
import { UserApiOperations } from './UserApiOperations'
import { UserApiService } from './UserApiService'
describe('UserApiService', () => {
let userServer: UserServerInterface
let userRequestServer: UserRequestServerInterface
let keyParams: RootKeyParamsInterface
const createService = () => new UserApiService(userServer, userRequestServer)
beforeEach(() => {
userServer = {} as jest.Mocked<UserServerInterface>
userServer.register = jest.fn().mockReturnValue({
data: { user: { email: '[email protected]', uuid: '1-2-3' } },
} as jest.Mocked<UserRegistrationResponse>)
userServer.deleteAccount = jest.fn().mockReturnValue({
data: { message: 'Success' },
} as jest.Mocked<UserDeletionResponse>)
userRequestServer = {} as jest.Mocked<UserRequestServerInterface>
userRequestServer.submitUserRequest = jest.fn().mockReturnValue({
data: { success: true },
} as jest.Mocked<UserRequestResponse>)
keyParams = {} as jest.Mocked<RootKeyParamsInterface>
keyParams.getPortableValue = jest.fn().mockReturnValue({
identifier: '[email protected]',
version: ProtocolVersion.V004,
})
})
it('should register a user', async () => {
const response = await createService().register({
email: '[email protected]',
serverPassword: 'testpasswd',
keyParams,
ephemeral: false,
})
expect(response).toEqual({
data: {
user: {
email: '[email protected]',
uuid: '1-2-3',
},
},
})
expect(userServer.register).toHaveBeenCalledWith({
api: '20200115',
email: '[email protected]',
ephemeral: false,
identifier: '[email protected]',
password: 'testpasswd',
version: '004',
})
})
it('should not register a user if it is already registering', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[UserApiOperations.Registering, true]]),
})
let error = null
try {
await service.register({ email: '[email protected]', serverPassword: 'testpasswd', keyParams, ephemeral: false })
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not register a user if the server fails', async () => {
userServer.register = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().register({
email: '[email protected]',
serverPassword: 'testpasswd',
keyParams,
ephemeral: false,
})
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should submit a user request', async () => {
const response = await createService().submitUserRequest({
userUuid: '1-2-3',
requestType: UserRequestType.ExitDiscount,
})
expect(response).toEqual({
data: {
success: true,
},
})
expect(userRequestServer.submitUserRequest).toHaveBeenCalledWith({
userUuid: '1-2-3',
requestType: UserRequestType.ExitDiscount,
})
})
it('should not submit a user request if it is already submitting', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[UserApiOperations.SubmittingRequest, true]]),
})
let error = null
try {
await service.submitUserRequest({ userUuid: '1-2-3', requestType: UserRequestType.ExitDiscount })
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not submit a user request if the server fails', async () => {
userRequestServer.submitUserRequest = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().submitUserRequest({
userUuid: '1-2-3',
requestType: UserRequestType.ExitDiscount,
})
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should delete a user', async () => {
const response = await createService().deleteAccount('1-2-3')
expect(response).toEqual({
data: {
message: 'Success',
},
})
expect(userServer.deleteAccount).toHaveBeenCalledWith({
userUuid: '1-2-3',
})
})
it('should not delete a user if it is already deleting', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[UserApiOperations.DeletingAccount, true]]),
})
let error = null
try {
await service.deleteAccount('1-2-3')
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not delete a user if the server fails', async () => {
userServer.deleteAccount = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().deleteAccount('1-2-3')
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
})
@@ -1,61 +0,0 @@
import { WebSocketConnectionTokenResponse } from '../../Response'
import { WebSocketServerInterface } from '../../Server/WebSocket/WebSocketServerInterface'
import { WebSocketApiOperations } from './WebSocketApiOperations'
import { WebSocketApiService } from './WebSocketApiService'
describe('WebSocketApiService', () => {
let webSocketServer: WebSocketServerInterface
const createService = () => new WebSocketApiService(webSocketServer)
beforeEach(() => {
webSocketServer = {} as jest.Mocked<WebSocketServerInterface>
webSocketServer.createConnectionToken = jest.fn().mockReturnValue({
data: { token: 'foobar' },
} as jest.Mocked<WebSocketConnectionTokenResponse>)
})
it('should create a websocket connection token', async () => {
const response = await createService().createConnectionToken()
expect(response).toEqual({
data: {
token: 'foobar',
},
})
expect(webSocketServer.createConnectionToken).toHaveBeenCalledWith({})
})
it('should not create a token if it is already creating', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[WebSocketApiOperations.CreatingConnectionToken, true]]),
})
let error = null
try {
await service.createConnectionToken()
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not create a token if the server fails', async () => {
webSocketServer.createConnectionToken = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().createConnectionToken()
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
})
@@ -1,368 +0,0 @@
import { WorkspaceAccessLevel, WorkspaceType } from '@standardnotes/common'
import { HttpStatusCode } from '../../Http'
import { WorkspaceCreationResponse } from '../../Response/Workspace/WorkspaceCreationResponse'
import { WorkspaceInvitationAcceptingResponse } from '../../Response/Workspace/WorkspaceInvitationAcceptingResponse'
import { WorkspaceInvitationResponse } from '../../Response/Workspace/WorkspaceInvitationResponse'
import { WorkspaceListResponse } from '../../Response/Workspace/WorkspaceListResponse'
import { WorkspaceUserListResponse } from '../../Response/Workspace/WorkspaceUserListResponse'
import { WorkspaceServerInterface } from '../../Server/Workspace/WorkspaceServerInterface'
import { WorkspaceKeyshareInitiatingResponse } from '../../Response/Workspace/WorkspaceKeyshareInitiatingResponse'
import { WorkspaceApiOperations } from './WorkspaceApiOperations'
import { WorkspaceApiService } from './WorkspaceApiService'
describe('WorkspaceApiService', () => {
let workspaceServer: WorkspaceServerInterface
const createService = () => new WorkspaceApiService(workspaceServer)
beforeEach(() => {
workspaceServer = {} as jest.Mocked<WorkspaceServerInterface>
workspaceServer.createWorkspace = jest.fn().mockReturnValue({
data: { uuid: '1-2-3' },
} as jest.Mocked<WorkspaceCreationResponse>)
workspaceServer.inviteToWorkspace = jest.fn().mockReturnValue({
data: { uuid: 'i-1-2-3' },
} as jest.Mocked<WorkspaceInvitationResponse>)
workspaceServer.acceptInvite = jest.fn().mockReturnValue({
data: { success: true },
} as jest.Mocked<WorkspaceInvitationAcceptingResponse>)
workspaceServer.listWorkspaces = jest.fn().mockReturnValue({
status: HttpStatusCode.Success,
data: { ownedWorkspaces: [], joinedWorkspaces: [] },
} as jest.Mocked<WorkspaceListResponse>)
workspaceServer.listWorkspaceUsers = jest.fn().mockReturnValue({
status: HttpStatusCode.Success,
data: { users: [] },
} as jest.Mocked<WorkspaceUserListResponse>)
workspaceServer.initiateKeyshare = jest.fn().mockReturnValue({
status: HttpStatusCode.Success,
data: { success: true },
} as jest.Mocked<WorkspaceKeyshareInitiatingResponse>)
})
it('should create a workspace', async () => {
const response = await createService().createWorkspace({
workspaceType: WorkspaceType.Private,
encryptedPrivateKey: 'foo',
encryptedWorkspaceKey: 'bar',
publicKey: 'buzz',
})
expect(response).toEqual({
data: {
uuid: '1-2-3',
},
})
expect(workspaceServer.createWorkspace).toHaveBeenCalledWith({
encryptedPrivateKey: 'foo',
encryptedWorkspaceKey: 'bar',
publicKey: 'buzz',
workspaceType: 'private',
})
})
it('should not create a workspace if it is already creating', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[WorkspaceApiOperations.Creating, true]]),
})
let error = null
try {
await service.createWorkspace({
workspaceType: WorkspaceType.Private,
encryptedPrivateKey: 'foo',
encryptedWorkspaceKey: 'bar',
publicKey: 'buzz',
})
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not create a workspace if the server fails', async () => {
workspaceServer.createWorkspace = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().createWorkspace({
workspaceType: WorkspaceType.Private,
encryptedPrivateKey: 'foo',
encryptedWorkspaceKey: 'bar',
publicKey: 'buzz',
})
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should invite to a workspace', async () => {
const response = await createService().inviteToWorkspace({
workspaceUuid: 'w-1-2-3',
inviteeEmail: '[email protected]',
accessLevel: WorkspaceAccessLevel.WriteAndRead,
})
expect(response).toEqual({
data: {
uuid: 'i-1-2-3',
},
})
expect(workspaceServer.inviteToWorkspace).toHaveBeenCalledWith({
workspaceUuid: 'w-1-2-3',
inviteeEmail: '[email protected]',
accessLevel: 'write-and-read',
})
})
it('should not invite to a workspace if it is already inviting', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[WorkspaceApiOperations.Inviting, true]]),
})
let error = null
try {
await service.inviteToWorkspace({
workspaceUuid: 'w-1-2-3',
inviteeEmail: '[email protected]',
accessLevel: WorkspaceAccessLevel.WriteAndRead,
})
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not invite to a workspace if the server fails', async () => {
workspaceServer.inviteToWorkspace = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().inviteToWorkspace({
workspaceUuid: 'w-1-2-3',
inviteeEmail: '[email protected]',
accessLevel: WorkspaceAccessLevel.WriteAndRead,
})
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should accept invite to a workspace', async () => {
const response = await createService().acceptInvite({
userUuid: 'u-1-2-3',
inviteUuid: 'i-1-2-3',
publicKey: 'foo',
encryptedPrivateKey: 'bar',
})
expect(response).toEqual({
data: {
success: true,
},
})
expect(workspaceServer.acceptInvite).toHaveBeenCalledWith({
userUuid: 'u-1-2-3',
inviteUuid: 'i-1-2-3',
publicKey: 'foo',
encryptedPrivateKey: 'bar',
})
})
it('should not accept invite to a workspace if it is already accepting', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[WorkspaceApiOperations.Accepting, true]]),
})
let error = null
try {
await service.acceptInvite({
userUuid: 'u-1-2-3',
inviteUuid: 'i-1-2-3',
publicKey: 'foo',
encryptedPrivateKey: 'bar',
})
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not accept invite to a workspace if the server fails', async () => {
workspaceServer.acceptInvite = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().acceptInvite({
userUuid: 'u-1-2-3',
inviteUuid: 'i-1-2-3',
publicKey: 'foo',
encryptedPrivateKey: 'bar',
})
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should list workspaces', async () => {
const response = await createService().listWorkspaces()
expect(response).toEqual({
status: 200,
data: {
ownedWorkspaces: [],
joinedWorkspaces: [],
},
})
expect(workspaceServer.listWorkspaces).toHaveBeenCalled()
})
it('should not list workspaces if it is already listing them', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[WorkspaceApiOperations.ListingWorkspaces, true]]),
})
let error = null
try {
await service.listWorkspaces()
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not list workspaces if the server fails', async () => {
workspaceServer.listWorkspaces = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().listWorkspaces()
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should list workspace users', async () => {
const response = await createService().listWorkspaceUsers({ workspaceUuid: 'w-1-2-3' })
expect(response).toEqual({
status: 200,
data: {
users: [],
},
})
expect(workspaceServer.listWorkspaceUsers).toHaveBeenCalledWith({ workspaceUuid: 'w-1-2-3' })
})
it('should not list workspace users if it is already listing them', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[WorkspaceApiOperations.ListingWorkspaceUsers, true]]),
})
let error = null
try {
await service.listWorkspaceUsers({ workspaceUuid: 'w-1-2-3' })
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not list workspace users if the server fails', async () => {
workspaceServer.listWorkspaceUsers = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().listWorkspaceUsers({ workspaceUuid: 'w-1-2-3' })
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should initiate keyshare in workspace for user', async () => {
const response = await createService().initiateKeyshare({
workspaceUuid: 'w-1-2-3',
userUuid: 'u-1-2-3',
encryptedWorkspaceKey: 'foobar',
})
expect(response).toEqual({
status: 200,
data: {
success: true,
},
})
expect(workspaceServer.initiateKeyshare).toHaveBeenCalledWith({
workspaceUuid: 'w-1-2-3',
userUuid: 'u-1-2-3',
encryptedWorkspaceKey: 'foobar',
})
})
it('should not initiate keyshare in workspace if it is already initiating', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[WorkspaceApiOperations.InitiatingKeyshare, true]]),
})
let error = null
try {
await service.initiateKeyshare({ workspaceUuid: 'w-1-2-3', userUuid: 'u-1-2-3', encryptedWorkspaceKey: 'foobar' })
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not initiate keyshare in workspace if the server fails', async () => {
workspaceServer.initiateKeyshare = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().initiateKeyshare({
workspaceUuid: 'w-1-2-3',
userUuid: 'u-1-2-3',
encryptedWorkspaceKey: 'foobar',
})
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
})
+6
View File
@@ -1,3 +1,9 @@
export * from './Auth/AuthApiOperations'
export * from './Auth/AuthApiService'
export * from './Auth/AuthApiServiceInterface'
export * from './Authenticator/AuthenticatorApiOperations'
export * from './Authenticator/AuthenticatorApiService'
export * from './Authenticator/AuthenticatorApiServiceInterface'
export * from './Subscription/SubscriptionApiOperations'
export * from './Subscription/SubscriptionApiService'
export * from './Subscription/SubscriptionApiServiceInterface'
@@ -1 +1 @@
export type HttpRequestParams = Record<string, unknown>
export type HttpRequestParams = unknown
@@ -1,42 +0,0 @@
import { Environment } from '@standardnotes/models'
import { HttpResponseMeta } from './HttpResponseMeta'
import { HttpService } from './HttpService'
describe('HttpService', () => {
const environment = Environment.Web
const appVersion = '1.2.3'
const snjsVersion = '2.3.4'
const host = 'http://bar'
let updateMetaCallback: (meta: HttpResponseMeta) => void
const createService = () => {
const service = new HttpService(environment, appVersion, snjsVersion, updateMetaCallback)
service.setHost(host)
return service
}
beforeEach(() => {
updateMetaCallback = jest.fn()
})
it('should set host', () => {
const service = createService()
expect(service['host']).toEqual('http://bar')
service.setHost('http://foo')
expect(service['host']).toEqual('http://foo')
})
it('should set and use the authorization token', () => {
const service = createService()
expect(service['authorizationToken']).toBeUndefined()
service.setAuthorizationToken('foo-bar')
expect(service['authorizationToken']).toEqual('foo-bar')
})
})
+81 -16
View File
@@ -1,5 +1,7 @@
import { isString, joinPaths, sleep } from '@standardnotes/utils'
import { Environment } from '@standardnotes/models'
import { Session, SessionToken } from '@standardnotes/domain-core'
import { HttpRequestParams } from './HttpRequestParams'
import { HttpVerb } from './HttpVerb'
import { HttpRequest } from './HttpRequest'
@@ -10,21 +12,26 @@ import { XMLHttpRequestState } from './XMLHttpRequestState'
import { ErrorMessage } from '../Error/ErrorMessage'
import { HttpResponseMeta } from './HttpResponseMeta'
import { HttpErrorResponseBody } from './HttpErrorResponseBody'
import { Paths } from '../Server/Auth/Paths'
import { SessionRefreshResponse } from '../Response/Auth/SessionRefreshResponse'
export class HttpService implements HttpServiceInterface {
private authorizationToken?: string
private session: Session | null
private __latencySimulatorMs?: number
private host!: string
private declare host: string
constructor(
private environment: Environment,
private appVersion: string,
private snjsVersion: string,
private updateMetaCallback: (meta: HttpResponseMeta) => void,
) {}
private refreshSessionCallback: (session: Session) => void,
) {
this.session = null
}
setAuthorizationToken(authorizationToken: string): void {
this.authorizationToken = authorizationToken
setSession(session: Session): void {
this.session = session
}
setHost(host: string): void {
@@ -36,7 +43,7 @@ export class HttpService implements HttpServiceInterface {
url: joinPaths(this.host, path),
params,
verb: HttpVerb.Get,
authentication: authentication ?? this.authorizationToken,
authentication: authentication ?? this.session?.accessToken.value,
})
}
@@ -45,7 +52,7 @@ export class HttpService implements HttpServiceInterface {
url: joinPaths(this.host, path),
params,
verb: HttpVerb.Post,
authentication: authentication ?? this.authorizationToken,
authentication: authentication ?? this.session?.accessToken.value,
})
}
@@ -54,7 +61,7 @@ export class HttpService implements HttpServiceInterface {
url: joinPaths(this.host, path),
params,
verb: HttpVerb.Put,
authentication: authentication ?? this.authorizationToken,
authentication: authentication ?? this.session?.accessToken.value,
})
}
@@ -63,7 +70,7 @@ export class HttpService implements HttpServiceInterface {
url: joinPaths(this.host, path),
params,
verb: HttpVerb.Patch,
authentication: authentication ?? this.authorizationToken,
authentication: authentication ?? this.session?.accessToken.value,
})
}
@@ -72,7 +79,7 @@ export class HttpService implements HttpServiceInterface {
url: joinPaths(this.host, path),
params,
verb: HttpVerb.Delete,
authentication: authentication ?? this.authorizationToken,
authentication: authentication ?? this.session?.accessToken.value,
})
}
@@ -89,9 +96,68 @@ export class HttpService implements HttpServiceInterface {
this.updateMetaCallback(response.meta)
}
if (response.status === HttpStatusCode.ExpiredAccessToken) {
const isSessionRefreshed = await this.refreshSession()
if (!isSessionRefreshed) {
return response
}
httpRequest.authentication = this.session?.accessToken.value
return this.runHttp(httpRequest)
}
return response
}
private async refreshSession(): Promise<boolean> {
if (this.session === null) {
return false
}
const response = (await this.post(Paths.v1.refreshSession, {
access_token: this.session.accessToken.value,
refresh_token: this.session.refreshToken.value,
})) as SessionRefreshResponse
if (response.data.error) {
return false
}
if (response.meta) {
this.updateMetaCallback(response.meta)
}
const accessTokenOrError = SessionToken.create(
response.data.session.access_token,
response.data.session.access_expiration,
)
if (accessTokenOrError.isFailed()) {
return false
}
const accessToken = accessTokenOrError.getValue()
const refreshTokenOrError = SessionToken.create(
response.data.session.refresh_token,
response.data.session.refresh_expiration,
)
if (refreshTokenOrError.isFailed()) {
return false
}
const refreshToken = refreshTokenOrError.getValue()
const sessionOrError = Session.create(accessToken, refreshToken, response.data.session.readonly_access)
if (sessionOrError.isFailed()) {
return false
}
this.setSession(sessionOrError.getValue())
this.refreshSessionCallback(this.session)
return true
}
private createRequestBody(httpRequest: HttpRequest): string | Uint8Array | undefined {
if (
httpRequest.params !== undefined &&
@@ -199,21 +265,20 @@ export class HttpService implements HttpServiceInterface {
} catch (error) {
console.error(error)
}
if (httpStatus >= HttpStatusCode.Success && httpStatus < HttpStatusCode.MultipleChoices) {
resolve(response)
} else {
if (httpStatus >= HttpStatusCode.Success && httpStatus < HttpStatusCode.InternalServerError) {
if (httpStatus === HttpStatusCode.Forbidden && response.data && response.data.error !== undefined) {
;(response.data as HttpErrorResponseBody).error.message = ErrorMessage.RateLimited
}
resolve(response)
} else {
reject(response)
}
}
private urlForUrlAndParams(url: string, params: HttpRequestParams) {
const keyValueString = Object.keys(params)
const keyValueString = Object.keys(params as Record<string, unknown>)
.map((key) => {
return key + '=' + encodeURIComponent(params[key] as string)
return key + '=' + encodeURIComponent((params as Record<string, unknown>)[key] as string)
})
.join('&')
@@ -1,9 +1,11 @@
import { Session } from '@standardnotes/domain-core'
import { HttpRequestParams } from './HttpRequestParams'
import { HttpResponse } from './HttpResponse'
export interface HttpServiceInterface {
setHost(host: string): void
setAuthorizationToken(authorizationToken: string): void
setSession(session: Session): void
get(path: string, params?: HttpRequestParams, authentication?: string): Promise<HttpResponse>
post(path: string, params?: HttpRequestParams, authentication?: string): Promise<HttpResponse>
put(path: string, params?: HttpRequestParams, authentication?: string): Promise<HttpResponse>
@@ -7,4 +7,5 @@ export enum HttpStatusCode {
Forbidden = 403,
Gone = 410,
ExpiredAccessToken = 498,
InternalServerError = 500,
}
@@ -0,0 +1,4 @@
export interface DeleteAuthenticatorRequestParams {
authenticatorId: string
[additionalParam: string]: unknown
}
@@ -0,0 +1,3 @@
export interface GenerateAuthenticatorAuthenticationOptionsRequestParams {
[additionalParam: string]: unknown
}

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