Compare commits

...
Author SHA1 Message Date
StandardNotes CI ddc290e302 chore(release): publish
- @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-03-10 20:13:08 +00:00
Karol Sójko 0ca26d0f75 chore: features fix specs 2023-03-10 20:40:23 +01:00
Karol Sójko bd4bc0614e chore: features fix to enable u2f for INTERNAL_TEAM_USER role 2023-03-10 20:19:43 +01:00
StandardNotes CI 2524d2615c chore(release): publish
- @standardnotes/[email protected].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-03-10 14:15:09 +00:00
Karol Sójko 7eab5dc680 chore: fix features to remove u2f from pro subscription 2023-03-10 14:46:34 +01:00
StandardNotes CI 09c503da68 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-03-09 12:27:50 +00:00
Karol Sójko 2fd879bb2d Revert "chore: add temporary error log on authenticator authentication options generation"
This reverts commit c098256f2f.
2023-03-09 13:01:14 +01:00
Karol Sójko 33e6ff67d6 chore: remove redundant testing procedure during web deployment - already tested on publish job 2023-03-09 12:47:34 +01:00
StandardNotes CI bac39f45c5 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-03-09 11:41:25 +00:00
Karol Sójko c098256f2f chore: add temporary error log on authenticator authentication options generation 2023-03-09 12:10:27 +01:00
StandardNotes CI 9c9f6ce0f3 chore(release): publish
- @standardnotes/[email protected].6
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-03-09 10:39:31 +00:00
Karol Sójko 54f1e618de chore: store authenticator devices labels in preferences instead of server (#2252) 2023-03-09 11:05:15 +01:00
StandardNotes CI aeab3fed0d chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
2023-03-08 12:42:18 +00:00
Karol Sójko 5bd7e785c8 chore: change u2f from feature trunk to role based permission restricted (#2250) 2023-03-08 13:15:16 +01:00
Karol Sójko 896834f65a chore(web): put sign-in email notifications setting under paywall (#2249)
* chore: upgrade setting names to value objects

* chore(web): put sign-in email notifications setting under paywall

* chore: fix using setting name value objects in mocha tests

* chore: fix wording on email notifications titles
2023-03-08 12:53:59 +01:00
StandardNotes CI e47b6253c1 chore(release): publish
- @standardnotes/[email protected].5
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-03-08 09:57:58 +00:00
Karol Sójko 7fc9182869 chore: remove files beta permission (#2247) 2023-03-08 10:30:29 +01:00
Karol SójkoandKarol Sójko 0c9ed13678 chore: add u2f permissions and features (#2246)
Co-authored-by: Karol Sójko <[email protected]>
2023-03-08 09:57:36 +01:00
StandardNotes CI 95358ec1d5 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-03-07 17:34:30 +00:00
Mo a307e8a28c chore: associated domains 2023-03-07 11:01:35 -06:00
StandardNotes CI afcabc93eb chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-03-07 09:17:18 +00:00
Aman Harwara d30b1f8d15 chore: fix types 2023-03-07 14:18:43 +05:30
Aman Harwara 7a82f41585 chore: upgrade deps 2023-03-07 13:57:30 +05:30
StandardNotes CI c8f06ae65f chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-03-07 00:25:43 +00:00
Karol Sójko cf5330d7cf feat-dev: add U2F iframe for desktop client authentication (#2236) 2023-03-06 17:52:35 -06:00
StandardNotes CI e5ca69fc8e chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-03-03 16:55:22 +00:00
Mo 2a567ad052 refactor: demo params 2023-03-03 10:26:38 -06:00
StandardNotes CI c663482ea3 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected]
2023-03-02 13:07:23 +00:00
Karol Sójko 90f185059a chore(snjs): add error logs when not able to create session (#2240) 2023-03-02 13:39:20 +01:00
StandardNotes CI 5e1c8b90be chore(release): publish
- @standardnotes/[email protected].9
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
2023-03-02 01:34:31 +00:00
Mo 0c30d9cf03 chore: fix markdown visual 2023-03-01 19:07:44 -06:00
StandardNotes CI 44bd6f90bd chore(release): publish
- @standardnotes/[email protected].4
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected].8
2023-03-01 14:35:00 +00:00
Mo fd020af03f chore: upgrade sn deps 2023-03-01 08:06:14 -06:00
StandardNotes CI ab3740170e chore(release): publish
- @standardnotes/[email protected].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
2023-03-01 09:55:48 +00:00
Aman Harwara 4ab2efd738 chore: trigger build 2023-03-01 14:30:39 +05:30
Aman Harwara 01d23de9eb Merge branch 'main' of github.com:standardnotes/app 2023-03-01 14:25:50 +05:30
Aman Harwara fc54677356 chore: fix android build 2023-03-01 14:25:40 +05:30
StandardNotes CI 1fb78b1667 chore(release): publish
- @standardnotes/[email protected].6
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
2023-03-01 08:02:29 +00:00
Aman Harwara 66da4e62c6 Merge branch 'main' of github.com:standardnotes/app 2023-03-01 13:05:23 +05:30
Aman Harwara e3a3b859c1 chore: fix mobile release action ruby version 2023-03-01 13:05:12 +05:30
StandardNotes CI bc87eaedfc chore(release): publish
- @standardnotes/[email protected].5
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
2023-03-01 07:34:54 +00:00
Aman Harwara c70c1e9139 chore: trigger build 2023-03-01 12:36:02 +05:30
121 changed files with 1507 additions and 510 deletions
@@ -30,6 +30,8 @@ jobs:
- run: yarn build:mobile
- name: Ruby Setup for Fastlane
uses: ruby/setup-ruby@v1
with:
working-directory: 'packages/mobile'
- name: fastlane
uses: maierj/[email protected]
env:
@@ -88,6 +90,8 @@ jobs:
run: echo "${{ secrets.APPSTORE_CONNECT_KEY }}" > ios/Authkey.p8
- name: Ruby Setup for Fastlane
uses: ruby/setup-ruby@v1
with:
working-directory: 'packages/mobile'
- name: Setup fastlane
uses: maierj/[email protected]
env:
-15
View File
@@ -12,22 +12,7 @@ on:
- '!*standardnotes/*web*alpha*'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn build:web
- name: ESLint
run: yarn lint
- name: Test
run: yarn test
deploy:
needs: test
runs-on: ubuntu-latest
steps:
+1 -1
View File
@@ -1 +1 @@
2.7.5
2.7.6
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.
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.25.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/api
## [1.25.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/api
## [1.25.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/api
## [1.25.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/api
## [1.25.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/api
## [1.25.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/api
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.25.3",
"version": "1.25.8",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -36,12 +36,12 @@
"typescript": "*"
},
"dependencies": {
"@standardnotes/common": "^1.46.4",
"@standardnotes/common": "^1.46.6",
"@standardnotes/domain-core": "^1.11.3",
"@standardnotes/encryption": "workspace:*",
"@standardnotes/models": "workspace:*",
"@standardnotes/responses": "workspace:*",
"@standardnotes/security": "^1.7.5",
"@standardnotes/security": "^1.7.6",
"@standardnotes/utils": "workspace:*",
"reflect-metadata": "^0.1.13"
}
@@ -1,6 +1,5 @@
export interface ListAuthenticatorsResponseBody {
authenticators: Array<{
id: string
name: string
}>
}
@@ -1,3 +1,3 @@
export interface VerifyAuthenticatorRegistrationResponseBody {
success: boolean
id: string
}
+68
View File
@@ -3,6 +3,74 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.105.21](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.20](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-03)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-02)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-02)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/desktop
## [3.105.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/desktop
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.105.4",
"version": "3.105.21",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.21.22](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.21](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.20](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/encryption
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/encryption",
"version": "1.21.17",
"version": "1.21.22",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -35,7 +35,7 @@
"typescript": "*"
},
"dependencies": {
"@standardnotes/common": "^1.46.4",
"@standardnotes/common": "^1.46.6",
"@standardnotes/models": "workspace:*",
"@standardnotes/responses": "workspace:*",
"@standardnotes/sncrypto-common": "workspace:*",
+16
View File
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.58.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/features
## [1.58.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/features
## [1.58.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/features
## [1.58.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/features
## [1.58.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-02-15)
**Note:** Version bump only for package @standardnotes/features
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/features",
"version": "1.58.8",
"version": "1.58.12",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -25,9 +25,9 @@
"test": "jest"
},
"dependencies": {
"@standardnotes/common": "^1.46.4",
"@standardnotes/common": "^1.46.6",
"@standardnotes/domain-core": "^1.11.3",
"@standardnotes/security": "^1.7.5",
"@standardnotes/security": "^1.7.6",
"reflect-metadata": "^0.1.13"
},
"devDependencies": {
@@ -15,6 +15,7 @@ export enum FeatureIdentifier {
SmartFilters = 'org.standardnotes.smart-filters',
TagNesting = 'org.standardnotes.tag-nesting',
TwoFactorAuth = 'org.standardnotes.two-factor-auth',
UniversalSecondFactor = 'org.standardnotes.universal-second-factor',
SubscriptionSharing = 'org.standardnotes.subscription-sharing',
AutobiographyTheme = 'org.standardnotes.theme-autobiography',
@@ -2,11 +2,11 @@ import { SubscriptionName } from '@standardnotes/common'
import { GetFeatures, GetFeaturesForSubscription } from './Features'
describe('features', () => {
it('all features should have availableInSubscriptions populated', () => {
it('all features should have either availableInSubscriptions or availableInRoles populated', () => {
const features = GetFeatures()
for (const feature of features) {
expect(feature.availableInSubscriptions.length).toBeGreaterThan(0)
expect(feature.availableInSubscriptions.length > 0 || feature.availableInRoles !== undefined && feature.availableInRoles.length > 0).toBeTruthy()
}
})
it('gets features for plus plan', () => {
@@ -11,6 +11,13 @@ export function serverFeatures(): ServerFeatureDescription[] {
identifier: FeatureIdentifier.TwoFactorAuth,
permission_name: PermissionName.TwoFactorAuth,
},
{
availableInSubscriptions: [],
availableInRoles: ['INTERNAL_TEAM_USER'],
name: 'U2F authentication',
identifier: FeatureIdentifier.UniversalSecondFactor,
permission_name: PermissionName.UniversalSecondFactor,
},
{
availableInSubscriptions: [SubscriptionName.ProPlan],
name: 'Unlimited note history',
@@ -10,7 +10,6 @@ export enum PermissionName {
DailyEmailBackup = 'server:daily-email-backup',
DailyGDriveBackup = 'server:daily-gdrive-backup',
DailyOneDriveBackup = 'server:daily-onedrive-backup',
FilesBeta = 'app:files-beta',
Files = 'app:files',
FilesMaximumStorageTier = 'server:files-max-storage-tier',
FilesLowStorageTier = 'server:files-low-storage-tier',
@@ -38,6 +37,7 @@ export enum PermissionName {
TitaniumTheme = 'theme:titanium',
TokenVaultEditor = 'editor:token-vault',
TwoFactorAuth = 'server:two-factor-auth',
UniversalSecondFactor = 'server:universal-second-factor',
SubscriptionSharing = 'server:subscription-sharing',
SuperEditor = 'editor:super-editor',
}
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.28.27](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.26](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.25](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.24](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.23](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.22](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/filepicker
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/filepicker",
"version": "1.28.22",
"version": "1.28.27",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -26,7 +26,7 @@
"typescript": "*"
},
"dependencies": {
"@standardnotes/common": "^1.46.4",
"@standardnotes/common": "^1.46.6",
"@standardnotes/files": "workspace:*",
"@standardnotes/utils": "workspace:*",
"@types/wicg-file-system-access": "^2020.9.5",
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.14.37](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/files
## [1.14.36](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/files
## [1.14.35](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/files
## [1.14.34](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/files
## [1.14.33](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/files
## [1.14.32](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/files
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files",
"version": "1.14.32",
"version": "1.14.37",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+1
View File
@@ -0,0 +1 @@
2.7.6
+68
View File
@@ -3,6 +3,74 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.51.52](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.51](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.50](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.49](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.48](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.47](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.46](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.45](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.44](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.43](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.42](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-03)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.41](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-02)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.40](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-02)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.39](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.38](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.37](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.36](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/mobile
## [3.51.35](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/mobile
+3 -3
View File
@@ -282,13 +282,13 @@ PLATFORMS
ruby
DEPENDENCIES
cocoapods (~> 1.11, >= 1.11.2)
cocoapods (~> 1.11, >= 1.11.3)
fastlane
fastlane-plugin-bundletool
xcode-install
RUBY VERSION
ruby 2.7.5p203
ruby 2.7.6p219
BUNDLED WITH
2.3.15
2.3.25
@@ -2,12 +2,10 @@ package com.standardnotes;
import android.app.Application;
import android.app.Activity;
import android.content.Context;
import android.webkit.WebView;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
@@ -15,7 +13,6 @@ import com.facebook.react.defaults.DefaultReactNativeHost;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import com.facebook.react.modules.network.OkHttpClientProvider;
@@ -4,7 +4,7 @@
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.rndiffapp;
package com.standardnotes;
import android.content.Context;
import com.facebook.react.ReactInstanceManager;
/**
+2 -2
View File
@@ -637,7 +637,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"
SPEC CHECKSUMS:
boost: 57d2868c099736d80fcd648bf211b4431e51a558
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: 60195509584153283780abdac5569feffb8f08cc
@@ -658,7 +658,7 @@ SPEC CHECKSUMS:
MMKV: 9c4663aa7ca255d478ff10f2f5cb7d17c1651ccd
MMKVCore: 89f5c8a66bba2dcd551779dea4d412eeec8ff5bb
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda
RCTRequired: bec48f07daf7bcdc2655a0cde84e07d24d2a9e2a
RCTTypeSafety: 171394eebacf71e1cfad79dbfae7ee8fc16ca80a
React: d7433ccb6a8c36e4cbed59a73c0700fc83c3e98a
@@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>webcredentials:app.standardnotes.com</string>
</array>
<key>com.apple.developer.default-data-protection</key>
<string>NSFileProtectionComplete</string>
</dict>
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.51.35",
"version": "3.51.52",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.43.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/models
## [1.43.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/models
## [1.43.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/models
## [1.43.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/models
## [1.43.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/models
## [1.43.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/models
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/models",
"version": "1.43.5",
"version": "1.43.10",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -22,7 +22,7 @@
"test": "jest"
},
"dependencies": {
"@standardnotes/common": "^1.46.4",
"@standardnotes/common": "^1.46.6",
"@standardnotes/features": "workspace:*",
"@standardnotes/responses": "workspace:*",
"@standardnotes/utils": "workspace:^",
@@ -44,6 +44,7 @@ export enum PrefKey {
MomentsDefaultTagUuid = 'momentsDefaultTagUuid',
SystemViewPreferences = 'systemViewPreferences',
SuperNoteExportFormat = 'superNoteExportFormat',
AuthenticatorNames = 'authenticatorNames',
}
export enum NewNoteTitleFormat {
@@ -111,4 +112,5 @@ export type PrefValue = {
[PrefKey.MomentsDefaultTagUuid]: string | undefined
[PrefKey.SystemViewPreferences]: Partial<Record<SystemViewId, TagPreferences>>
[PrefKey.SuperNoteExportFormat]: 'json' | 'md' | 'html'
[PrefKey.AuthenticatorNames]: string
}
+68
View File
@@ -3,6 +3,74 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.4.195](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.194](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.193](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.192](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.191](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.190](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.189](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.188](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.187](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.186](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.185](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-03)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.184](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-02)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.183](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-02)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.182](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.181](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.180](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.179](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.178](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.4.178",
"version": "1.4.195",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+16
View File
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.13.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/responses
## [1.13.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/responses
## [1.13.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/responses
## [1.13.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/responses
## [1.13.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/responses
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/responses",
"version": "1.13.9",
"version": "1.13.13",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -33,9 +33,9 @@
"typescript": "*"
},
"dependencies": {
"@standardnotes/common": "^1.46.4",
"@standardnotes/common": "^1.46.6",
"@standardnotes/features": "workspace:*",
"@standardnotes/security": "^1.7.5",
"@standardnotes/security": "^1.7.6",
"reflect-metadata": "^0.1.13"
}
}
+24
View File
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.57.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/services
## [1.57.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/services
## [1.57.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/services
## [1.57.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/services
## [1.57.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-03)
**Note:** Version bump only for package @standardnotes/services
## [1.57.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/services
## [1.57.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/services
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/services",
"version": "1.57.3",
"version": "1.57.9",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -3,14 +3,17 @@
import { AuthenticatorApiServiceInterface } from '@standardnotes/api'
import { Username, Uuid } from '@standardnotes/domain-core'
import { isErrorResponse } from '@standardnotes/responses'
import { PrefKey } from '@standardnotes/models'
import { InternalEventBusInterface } from '../Internal/InternalEventBusInterface'
import { AbstractService } from '../Service/AbstractService'
import { AuthenticatorClientInterface } from './AuthenticatorClientInterface'
import { PreferenceServiceInterface } from '../Preferences/PreferenceServiceInterface'
export class AuthenticatorManager extends AbstractService implements AuthenticatorClientInterface {
constructor(
private authenticatorApiService: AuthenticatorApiServiceInterface,
private preferencesService: PreferenceServiceInterface,
protected override internalEventBus: InternalEventBusInterface,
) {
super(internalEventBus)
@@ -24,7 +27,18 @@ export class AuthenticatorManager extends AbstractService implements Authenticat
return []
}
return result.data.authenticators
const authenticatorNames = this.getAuthenticatorNamesFromPreferences()
const nameDecoratedAuthenticators: { id: string; name: string }[] = result.data.authenticators.map(
(authenticator: { id: string }) => ({
id: authenticator.id,
name: authenticatorNames.has(authenticator.id)
? (authenticatorNames.get(authenticator.id) as string)
: 'Security Key',
}),
)
return nameDecoratedAuthenticators
} catch (error) {
return []
}
@@ -37,6 +51,11 @@ export class AuthenticatorManager extends AbstractService implements Authenticat
return false
}
const authenticatorNames = this.getAuthenticatorNamesFromPreferences()
authenticatorNames.delete(authenticatorId.value)
await this.preferencesService.setValue(PrefKey.AuthenticatorNames, JSON.stringify([...authenticatorNames]))
return true
} catch (error) {
return false
@@ -73,7 +92,12 @@ export class AuthenticatorManager extends AbstractService implements Authenticat
return false
}
return result.data.success
const authenticatorNames = this.getAuthenticatorNamesFromPreferences()
authenticatorNames.set(result.data.id, name)
await this.preferencesService.setValue(PrefKey.AuthenticatorNames, JSON.stringify([...authenticatorNames]))
return true
} catch (error) {
return false
}
@@ -92,4 +116,18 @@ export class AuthenticatorManager extends AbstractService implements Authenticat
return null
}
}
private getAuthenticatorNamesFromPreferences(): Map<string, string> {
let authenticatorNames: Map<string, string> = new Map()
const authenticatorNamesFromPreferences = this.preferencesService.getValue(PrefKey.AuthenticatorNames)
if (authenticatorNamesFromPreferences !== undefined) {
try {
authenticatorNames = new Map(JSON.parse(authenticatorNamesFromPreferences))
} catch (error) {
authenticatorNames = new Map()
}
}
return authenticatorNames
}
}
@@ -2,13 +2,12 @@ import { UserRegistrationResponseBody } from '@standardnotes/api'
import { ProtocolVersion } from '@standardnotes/common'
import { SNRootKey } from '@standardnotes/encryption'
import { RootKeyInterface } from '@standardnotes/models'
import { ClientDisplayableError, SessionBody, SignInResponse, User, HttpResponse } from '@standardnotes/responses'
import { SessionBody, SignInResponse, User, HttpResponse } from '@standardnotes/responses'
import { Base64String } from '@standardnotes/sncrypto-common'
import { SessionManagerResponse } from './SessionManagerResponse'
export interface SessionsClientInterface {
createDemoShareToken(): Promise<Base64String | ClientDisplayableError>
populateSessionFromDemoShareToken(token: Base64String): Promise<void>
getUser(): User | undefined
isCurrentSessionReadOnly(): boolean | undefined
+46
View File
@@ -3,6 +3,52 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.166.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/snjs
## [2.166.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/snjs
## [2.166.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
### Reverts
* Revert "chore: add temporary error log on authenticator authentication options generation" ([2fd879b](https://github.com/standardnotes/app/commit/2fd879bb2df57678c87f70b062c0592d1c6c654c))
## [2.166.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/snjs
## [2.166.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/snjs
## [2.166.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/snjs
## [2.166.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/snjs
## [2.166.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/snjs
## [2.166.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-03)
**Note:** Version bump only for package @standardnotes/snjs
## [2.166.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-02)
**Note:** Version bump only for package @standardnotes/snjs
## [2.166.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/snjs
## [2.166.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/snjs
+15 -13
View File
@@ -79,7 +79,6 @@ import {
DecryptedItemInterface,
EncryptedItemInterface,
Environment,
HistoryEntry,
ItemStream,
Platform,
} from '@standardnotes/models'
@@ -90,7 +89,7 @@ import { SNLog } from '../Log'
import { ChallengeResponse, ListedClientInterface } from '../Services'
import { ApplicationConstructorOptions, FullyResolvedApplicationOptions } from './Options/ApplicationOptions'
import { ApplicationOptionsDefaults } from './Options/Defaults'
import { LegacySession, MapperInterface, Session, UseCaseInterface } from '@standardnotes/domain-core'
import { LegacySession, MapperInterface, Session } from '@standardnotes/domain-core'
import { SessionStorageMapper } from '@Lib/Services/Mapping/SessionStorageMapper'
import { LegacySessionStorageMapper } from '@Lib/Services/Mapping/LegacySessionStorageMapper'
import { SignInWithRecoveryCodes } from '@Lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodes'
@@ -102,7 +101,6 @@ import { DeleteAuthenticator } from '@Lib/Domain/UseCase/DeleteAuthenticator/Del
import { ListRevisions } from '@Lib/Domain/UseCase/ListRevisions/ListRevisions'
import { GetRevision } from '@Lib/Domain/UseCase/GetRevision/GetRevision'
import { DeleteRevision } from '@Lib/Domain/UseCase/DeleteRevision/DeleteRevision'
import { RevisionMetadata } from '@Lib/Domain/Revision/RevisionMetadata'
import { GetAuthenticatorAuthenticationResponse } from '@Lib/Domain/UseCase/GetAuthenticatorAuthenticationResponse/GetAuthenticatorAuthenticationResponse'
/** How often to automatically sync, in milliseconds */
@@ -266,39 +264,39 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli
return this.subscriptionManager
}
get signInWithRecoveryCodes(): UseCaseInterface<void> {
get signInWithRecoveryCodes(): SignInWithRecoveryCodes {
return this._signInWithRecoveryCodes
}
get getRecoveryCodes(): UseCaseInterface<string> {
get getRecoveryCodes(): GetRecoveryCodes {
return this._getRecoveryCodes
}
get addAuthenticator(): UseCaseInterface<void> {
get addAuthenticator(): AddAuthenticator {
return this._addAuthenticator
}
get listAuthenticators(): UseCaseInterface<Array<{ id: string; name: string }>> {
get listAuthenticators(): ListAuthenticators {
return this._listAuthenticators
}
get deleteAuthenticator(): UseCaseInterface<void> {
get deleteAuthenticator(): DeleteAuthenticator {
return this._deleteAuthenticator
}
get getAuthenticatorAuthenticationResponse(): UseCaseInterface<Record<string, unknown>> {
get getAuthenticatorAuthenticationResponse(): GetAuthenticatorAuthenticationResponse {
return this._getAuthenticatorAuthenticationResponse
}
get listRevisions(): UseCaseInterface<Array<RevisionMetadata>> {
get listRevisions(): ListRevisions {
return this._listRevisions
}
get getRevision(): UseCaseInterface<HistoryEntry> {
get getRevision(): GetRevision {
return this._getRevision
}
get deleteRevision(): UseCaseInterface<void> {
get deleteRevision(): DeleteRevision {
return this._deleteRevision
}
@@ -1777,7 +1775,11 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli
const authenticatorApiService = new AuthenticatorApiService(authenticatorServer)
this.authenticatorManager = new AuthenticatorManager(authenticatorApiService, this.internalEventBus)
this.authenticatorManager = new AuthenticatorManager(
authenticatorApiService,
this.preferencesService,
this.internalEventBus,
)
}
private createAuthManager() {
@@ -8,7 +8,9 @@ export class GetRecoveryCodes implements UseCaseInterface<string> {
constructor(private authClient: AuthClientInterface, private settingsClient: SettingsClientInterface) {}
async execute(): Promise<Result<string>> {
const existingRecoveryCodes = await this.settingsClient.getSetting(SettingName.RecoveryCodes)
const existingRecoveryCodes = await this.settingsClient.getSetting(
SettingName.create(SettingName.NAMES.RecoveryCodes).getValue(),
)
if (existingRecoveryCodes !== undefined) {
return Result.ok(existingRecoveryCodes)
}
@@ -1,16 +1,21 @@
import { HistoryEntry } from '@standardnotes/models'
import { UseCaseInterface } from '@standardnotes/domain-core'
import { RevisionMetadata } from '../Revision/RevisionMetadata'
import { AddAuthenticator } from './AddAuthenticator/AddAuthenticator'
import { GetRecoveryCodes } from './GetRecoveryCodes/GetRecoveryCodes'
import { SignInWithRecoveryCodes } from './SignInWithRecoveryCodes/SignInWithRecoveryCodes'
import { ListAuthenticators } from './ListAuthenticators/ListAuthenticators'
import { DeleteAuthenticator } from './DeleteAuthenticator/DeleteAuthenticator'
import { GetAuthenticatorAuthenticationResponse } from './GetAuthenticatorAuthenticationResponse/GetAuthenticatorAuthenticationResponse'
import { ListRevisions } from './ListRevisions/ListRevisions'
import { GetRevision } from './GetRevision/GetRevision'
import { DeleteRevision } from './DeleteRevision/DeleteRevision'
export interface UseCaseContainerInterface {
get signInWithRecoveryCodes(): UseCaseInterface<void>
get getRecoveryCodes(): UseCaseInterface<string>
get addAuthenticator(): UseCaseInterface<void>
get listAuthenticators(): UseCaseInterface<Array<{ id: string; name: string }>>
get deleteAuthenticator(): UseCaseInterface<void>
get getAuthenticatorAuthenticationResponse(): UseCaseInterface<Record<string, unknown>>
get listRevisions(): UseCaseInterface<Array<RevisionMetadata>>
get getRevision(): UseCaseInterface<HistoryEntry>
get deleteRevision(): UseCaseInterface<void>
get signInWithRecoveryCodes(): SignInWithRecoveryCodes
get getRecoveryCodes(): GetRecoveryCodes
get addAuthenticator(): AddAuthenticator
get listAuthenticators(): ListAuthenticators
get deleteAuthenticator(): DeleteAuthenticator
get getAuthenticatorAuthenticationResponse(): GetAuthenticatorAuthenticationResponse
get listRevisions(): ListRevisions
get getRevision(): GetRevision
get deleteRevision(): DeleteRevision
}
+16
View File
@@ -1,2 +1,18 @@
export * from './Revision/Revision'
export * from './Revision/RevisionMetadata'
export * from './UseCase/AddAuthenticator/AddAuthenticator'
export * from './UseCase/AddAuthenticator/AddAuthenticatorDTO'
export * from './UseCase/DeleteAuthenticator/DeleteAuthenticator'
export * from './UseCase/DeleteAuthenticator/DeleteAuthenticatorDTO'
export * from './UseCase/DeleteRevision/DeleteRevision'
export * from './UseCase/DeleteRevision/DeleteRevisionDTO'
export * from './UseCase/GetAuthenticatorAuthenticationResponse/GetAuthenticatorAuthenticationResponse'
export * from './UseCase/GetAuthenticatorAuthenticationResponse/GetAuthenticatorAuthenticationResponseDTO'
export * from './UseCase/GetRecoveryCodes/GetRecoveryCodes'
export * from './UseCase/GetRevision/GetRevision'
export * from './UseCase/GetRevision/GetRevisionDTO'
export * from './UseCase/ListAuthenticators/ListAuthenticators'
export * from './UseCase/ListRevisions/ListRevisions'
export * from './UseCase/ListRevisions/ListRevisionsDTO'
export * from './UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodes'
export * from './UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodesDTO'
+5 -12
View File
@@ -1,6 +1,5 @@
import { FeatureDescription } from '@standardnotes/features'
import { joinPaths } from '@standardnotes/utils'
import { SettingName, SubscriptionSettingName } from '@standardnotes/settings'
import {
AbstractService,
ApiServiceInterface,
@@ -568,31 +567,25 @@ export class SNApiService
})
}
async getSetting(userUuid: UuidString, settingName: SettingName): Promise<HttpResponse<GetSettingResponse>> {
async getSetting(userUuid: UuidString, settingName: string): Promise<HttpResponse<GetSettingResponse>> {
return await this.tokenRefreshableRequest<GetSettingResponse>({
verb: HttpVerb.Get,
url: joinPaths(this.host, Paths.v1.setting(userUuid, settingName.toLowerCase() as SettingName)),
url: joinPaths(this.host, Paths.v1.setting(userUuid, settingName.toLowerCase())),
authentication: this.getSessionAccessToken(),
fallbackErrorMessage: API_MESSAGE_FAILED_GET_SETTINGS,
})
}
async getSubscriptionSetting(
userUuid: UuidString,
settingName: SubscriptionSettingName,
): Promise<HttpResponse<GetSettingResponse>> {
async getSubscriptionSetting(userUuid: UuidString, settingName: string): Promise<HttpResponse<GetSettingResponse>> {
return await this.tokenRefreshableRequest<GetSettingResponse>({
verb: HttpVerb.Get,
url: joinPaths(
this.host,
Paths.v1.subscriptionSetting(userUuid, settingName.toLowerCase() as SubscriptionSettingName),
),
url: joinPaths(this.host, Paths.v1.subscriptionSetting(userUuid, settingName.toLowerCase())),
authentication: this.getSessionAccessToken(),
fallbackErrorMessage: API_MESSAGE_FAILED_GET_SETTINGS,
})
}
async deleteSetting(userUuid: UuidString, settingName: SettingName): Promise<HttpResponse<DeleteSettingResponse>> {
async deleteSetting(userUuid: UuidString, settingName: string): Promise<HttpResponse<DeleteSettingResponse>> {
return this.tokenRefreshableRequest<DeleteSettingResponse>({
verb: HttpVerb.Delete,
url: joinPaths(this.host, Paths.v1.setting(userUuid, settingName)),
+2 -4
View File
@@ -1,5 +1,3 @@
import { SettingName, SubscriptionSettingName } from '@standardnotes/settings'
const FilesPaths = {
closeUploadSession: '/v1/files/upload/close-session',
createFileValetToken: '/v1/files/valet-tokens',
@@ -31,8 +29,8 @@ const ItemsPaths = {
const SettingsPaths = {
settings: (userUuid: string) => `/v1/users/${userUuid}/settings`,
setting: (userUuid: string, settingName: SettingName) => `/v1/users/${userUuid}/settings/${settingName}`,
subscriptionSetting: (userUuid: string, settingName: SubscriptionSettingName) =>
setting: (userUuid: string, settingName: string) => `/v1/users/${userUuid}/settings/${settingName}`,
subscriptionSetting: (userUuid: string, settingName: string) =>
`/v1/users/${userUuid}/subscription-settings/${settingName}`,
}
@@ -725,7 +725,7 @@ describe('featuresService', () => {
const featuresService = createService()
await featuresService.migrateFeatureRepoToUserSetting([extensionRepoItem])
expect(settingsService.updateSetting).toHaveBeenCalledWith(SettingName.ExtensionKey, extensionKey, true)
expect(settingsService.updateSetting).toHaveBeenCalledWith(SettingName.create(SettingName.NAMES.ExtensionKey).getValue(), extensionKey, true)
})
})
@@ -341,7 +341,11 @@ export class SNFeaturesService
const userKeyMatch = repoUrl.match(/\w{32,64}/)
if (userKeyMatch && userKeyMatch.length > 0) {
const userKey = userKeyMatch[0]
await this.settingsService.updateSetting(SettingName.ExtensionKey, userKey, true)
await this.settingsService.updateSetting(
SettingName.create(SettingName.NAMES.ExtensionKey).getValue(),
userKey,
true,
)
await this.itemManager.changeFeatureRepo(item, (m) => {
m.migratedToUserSetting = true
})
@@ -108,7 +108,9 @@ export class ListedService extends AbstractService implements ListedClientInterf
}
private async getSettingsBasedListedAccounts(): Promise<ListedAccount[]> {
const response = await this.settingsService.getSetting(SettingName.ListedAuthorSecrets)
const response = await this.settingsService.getSetting(
SettingName.create(SettingName.NAMES.ListedAuthorSecrets).getValue(),
)
if (!response) {
return []
}
+9 -3
View File
@@ -16,11 +16,17 @@ export class SNMfaService extends AbstractService {
}
private async saveMfaSetting(secret: string): Promise<void> {
return await this.settingsService.updateSetting(SettingName.MfaSecret, secret, true)
return await this.settingsService.updateSetting(
SettingName.create(SettingName.NAMES.MfaSecret).getValue(),
secret,
true,
)
}
async isMfaActivated(): Promise<boolean> {
const mfaSetting = await this.settingsService.getDoesSensitiveSettingExist(SettingName.MfaSecret)
const mfaSetting = await this.settingsService.getDoesSensitiveSettingExist(
SettingName.create(SettingName.NAMES.MfaSecret).getValue(),
)
return mfaSetting != false
}
@@ -43,7 +49,7 @@ export class SNMfaService extends AbstractService {
}
async disableMfa(): Promise<void> {
return await this.settingsService.deleteSetting(SettingName.MfaSecret)
return await this.settingsService.deleteSetting(SettingName.create(SettingName.NAMES.MfaSecret).getValue())
}
override deinit(): void {
@@ -44,8 +44,8 @@ import {
HttpSuccessResponse,
} from '@standardnotes/responses'
import { CopyPayloadWithContentOverride } from '@standardnotes/models'
import { LegacySession, MapperInterface, Session, SessionToken } from '@standardnotes/domain-core'
import { KeyParamsFromApiResponse, SNRootKeyParams, SNRootKey, CreateNewRootKey } from '@standardnotes/encryption'
import { LegacySession, MapperInterface, Result, Session, SessionToken } from '@standardnotes/domain-core'
import { KeyParamsFromApiResponse, SNRootKeyParams, SNRootKey } from '@standardnotes/encryption'
import { Subscription } from '@standardnotes/security'
import * as Common from '@standardnotes/common'
@@ -640,32 +640,6 @@ export class SNSessionManager
}
}
public async createDemoShareToken(): Promise<Base64String | ClientDisplayableError> {
const session = this.getSession()
if (!session) {
return new ClientDisplayableError('Cannot generate share token without active session')
}
if (!(session instanceof Session)) {
return new ClientDisplayableError('Cannot generate share token with non-token session')
}
const keyParams = (await this.protocolService.getRootKeyParams()) as SNRootKeyParams
const payload: ShareToken = {
accessToken: session.accessToken.value,
refreshToken: session.refreshToken.value,
accessExpiration: session.accessToken.expiresAt,
refreshExpiration: session.refreshToken.expiresAt,
readonlyAccess: true,
masterKey: this.protocolService.getRootKey()?.masterKey as string,
keyParams: keyParams.content,
user: this.getSureUser(),
host: this.apiService.getHost(),
}
return this.protocolService.crypto.base64Encode(JSON.stringify(payload))
}
private decodeDemoShareToken(token: Base64String): ShareToken {
const jsonString = this.protocolService.crypto.base64Decode(token)
return JSON.parse(jsonString)
@@ -674,25 +648,7 @@ export class SNSessionManager
public async populateSessionFromDemoShareToken(token: Base64String): Promise<void> {
const sharePayload = this.decodeDemoShareToken(token)
const rootKey = CreateNewRootKey({
masterKey: sharePayload.masterKey,
keyParams: sharePayload.keyParams,
version: sharePayload.keyParams.version,
})
const user = sharePayload.user
const session = this.createSession(
sharePayload.accessToken,
sharePayload.accessExpiration,
sharePayload.refreshToken,
sharePayload.refreshExpiration,
sharePayload.readonlyAccess,
)
if (session !== null) {
await this.populateSession(rootKey, user, session, sharePayload.host)
}
await this.signIn(sharePayload.email, sharePayload.password, false, true)
}
private async populateSession(
@@ -724,17 +680,26 @@ export class SNSessionManager
rootKey: SNRootKey
wrappingKey?: SNRootKey
}): Promise<void> {
const session = this.createSession(
const sessionOrError = this.createSession(
dto.session.access_token,
dto.session.access_expiration,
dto.session.refresh_token,
dto.session.refresh_expiration,
dto.session.readonly_access,
)
if (sessionOrError.isFailed()) {
console.error(sessionOrError.getError())
if (session !== null) {
await this.populateSession(dto.rootKey, dto.user, session, this.apiService.getHost(), dto.wrappingKey)
return
}
await this.populateSession(
dto.rootKey,
dto.user,
sessionOrError.getValue(),
this.apiService.getHost(),
dto.wrappingKey,
)
}
/**
@@ -755,16 +720,25 @@ export class SNSessionManager
await this.populateSession(rootKey, user, sessionOrError.getValue(), this.apiService.getHost(), wrappingKey)
}
} else if (data.session) {
const session = this.createSession(
const sessionOrError = this.createSession(
data.session.access_token,
data.session.access_expiration,
data.session.refresh_token,
data.session.refresh_expiration,
data.session.readonly_access,
)
if (session !== null && user) {
await this.populateSession(rootKey, user, session, this.apiService.getHost(), wrappingKey)
if (sessionOrError.isFailed()) {
console.error(sessionOrError.getError())
return
}
if (!user) {
console.error('No user in response')
return
}
await this.populateSession(rootKey, user, sessionOrError.getValue(), this.apiService.getHost(), wrappingKey)
}
}
@@ -774,25 +748,25 @@ export class SNSessionManager
refreshTokenValue: string,
refreshExpiration: number,
readonlyAccess: boolean,
): Session | null {
): Result<Session> {
const accessTokenOrError = SessionToken.create(accessTokenValue, accessExpiration)
if (accessTokenOrError.isFailed()) {
return null
return Result.fail(`Could not create session: ${accessTokenOrError.getError()}`)
}
const accessToken = accessTokenOrError.getValue()
const refreshTokenOrError = SessionToken.create(refreshTokenValue, refreshExpiration)
if (refreshTokenOrError.isFailed()) {
return null
return Result.fail(`Could not create session: ${refreshTokenOrError.getError()}`)
}
const refreshToken = refreshTokenOrError.getValue()
const sessionOrError = Session.create(accessToken, refreshToken, readonlyAccess)
if (sessionOrError.isFailed()) {
return null
return Result.fail(`Could not create session: ${sessionOrError.getError()}`)
}
return sessionOrError.getValue()
return Result.ok(sessionOrError.getValue())
}
override getDiagnostics(): Promise<DiagnosticInfo | undefined> {
@@ -1,10 +1,6 @@
import { User } from '@standardnotes/responses'
import { AnyKeyParamsContent } from '@standardnotes/common'
import { RawSessionPayload } from './Sessions/Types'
export type ShareToken = RawSessionPayload & {
masterKey: string
keyParams: AnyKeyParamsContent
user: User
host: string
email: string
password: string
}
@@ -1,13 +1,7 @@
import { SNApiService } from '../Api/ApiService'
import { SettingsGateway } from './SettingsGateway'
import { SNSessionManager } from '../Session/SessionManager'
import {
CloudProvider,
EmailBackupFrequency,
SettingName,
SensitiveSettingName,
SubscriptionSettingName,
} from '@standardnotes/settings'
import { CloudProvider, EmailBackupFrequency, SettingName } from '@standardnotes/settings'
import { ExtensionsServerURL } from '@Lib/Hosts'
import { AbstractService, InternalEventBusInterface } from '@standardnotes/services'
import { SettingsClientInterface } from './SettingsClientInterface'
@@ -46,7 +40,7 @@ export class SNSettingsService extends AbstractService implements SettingsClient
return this.provider.getSetting(name)
}
async getSubscriptionSetting(name: SubscriptionSettingName) {
async getSubscriptionSetting(name: SettingName) {
return this.provider.getSubscriptionSetting(name)
}
@@ -54,7 +48,7 @@ export class SNSettingsService extends AbstractService implements SettingsClient
return this.provider.updateSetting(name, payload, sensitive)
}
async getDoesSensitiveSettingExist(name: SensitiveSettingName) {
async getDoesSensitiveSettingExist(name: SettingName) {
return this.provider.getDoesSensitiveSettingExist(name)
}
@@ -1,4 +1,4 @@
import { SettingName, SensitiveSettingName, EmailBackupFrequency } from '@standardnotes/settings'
import { SettingName, EmailBackupFrequency } from '@standardnotes/settings'
import { SettingsList } from './SettingsList'
export interface SettingsClientInterface {
@@ -6,7 +6,7 @@ export interface SettingsClientInterface {
getSetting(name: SettingName): Promise<string | undefined>
getDoesSensitiveSettingExist(name: SensitiveSettingName): Promise<boolean>
getDoesSensitiveSettingExist(name: SettingName): Promise<boolean>
updateSetting(name: SettingName, payload: string, sensitive?: boolean): Promise<void>
@@ -1,5 +1,5 @@
import { SettingsList } from './SettingsList'
import { SettingName, SensitiveSettingName, SubscriptionSettingName } from '@standardnotes/settings'
import { SettingName } from '@standardnotes/settings'
import { API_MESSAGE_INVALID_SESSION } from '@standardnotes/services'
import { HttpStatusCode, isErrorResponse, User } from '@standardnotes/responses'
import { SettingsServerInterface } from './SettingsServerInterface'
@@ -46,7 +46,7 @@ export class SettingsGateway {
}
async getSetting(name: SettingName): Promise<string | undefined> {
const response = await this.settingsApi.getSetting(this.userUuid, name)
const response = await this.settingsApi.getSetting(this.userUuid, name.value)
if (response.status === HttpStatusCode.BadRequest) {
return undefined
@@ -59,8 +59,12 @@ export class SettingsGateway {
return response?.data?.setting?.value ?? undefined
}
async getSubscriptionSetting(name: SubscriptionSettingName): Promise<string | undefined> {
const response = await this.settingsApi.getSubscriptionSetting(this.userUuid, name)
async getSubscriptionSetting(name: SettingName): Promise<string | undefined> {
if (!name.isASubscriptionSetting()) {
throw new Error(`Setting ${name.value} is not a subscription setting`)
}
const response = await this.settingsApi.getSubscriptionSetting(this.userUuid, name.value)
if (response.status === HttpStatusCode.BadRequest) {
return undefined
@@ -73,8 +77,12 @@ export class SettingsGateway {
return response?.data?.setting?.value ?? undefined
}
async getDoesSensitiveSettingExist(name: SensitiveSettingName): Promise<boolean> {
const response = await this.settingsApi.getSetting(this.userUuid, name)
async getDoesSensitiveSettingExist(name: SettingName): Promise<boolean> {
if (!name.isSensitive()) {
throw new Error(`Setting ${name.value} is not sensitive`)
}
const response = await this.settingsApi.getSetting(this.userUuid, name.value)
if (response.status === HttpStatusCode.BadRequest) {
return false
@@ -88,14 +96,14 @@ export class SettingsGateway {
}
async updateSetting(name: SettingName, payload: string, sensitive: boolean): Promise<void> {
const response = await this.settingsApi.updateSetting(this.userUuid, name, payload, sensitive)
const response = await this.settingsApi.updateSetting(this.userUuid, name.value, payload, sensitive)
if (isErrorResponse(response)) {
throw new Error(response.data?.error.message)
}
}
async deleteSetting(name: SettingName): Promise<void> {
const response = await this.settingsApi.deleteSetting(this.userUuid, name)
const response = await this.settingsApi.deleteSetting(this.userUuid, name.value)
if (isErrorResponse(response)) {
throw new Error(response.data?.error.message)
}
@@ -28,16 +28,16 @@ type SettingType =
| OneDriveBackupFrequency
export class SettingsList {
private map: Partial<Record<SettingName, SettingData>> = {}
private map: Partial<Record<string, SettingData>> = {}
constructor(settings: SettingData[]) {
for (const setting of settings) {
this.map[setting.name as SettingName] = setting
this.map[setting.name] = setting
}
}
getSettingValue<T = SettingType, D = SettingType>(setting: SettingName, defaultValue: D): T {
const settingData = this.map[setting]
getSettingValue<T = SettingType, D = SettingType>(settingName: SettingName, defaultValue: D): T {
const settingData = this.map[settingName.value]
return (settingData?.value as unknown as T) || (defaultValue as unknown as T)
}
}
-3
View File
@@ -13,10 +13,7 @@ export * from '@standardnotes/encryption'
export * from '@standardnotes/features'
export * from '@standardnotes/files'
export * from '@standardnotes/models'
export * from '@standardnotes/responses'
export { ErrorTag } from '@standardnotes/responses'
export * from '@standardnotes/services'
export * from '@standardnotes/settings'
export * from '@standardnotes/utils'
+1 -1
View File
@@ -194,7 +194,7 @@ describe('features', () => {
return false
})
expect(await application.settings.getDoesSensitiveSettingExist(SettingName.ExtensionKey)).to.equal(false)
expect(await application.settings.getDoesSensitiveSettingExist(SettingName.create(SettingName.NAMES.ExtensionKey).getValue())).to.equal(false)
const extensionKey = UuidGenerator.GenerateUuid().split('-').join('')
+2 -2
View File
@@ -26,13 +26,13 @@ describe('account recovery', function () {
})
it('should get the same recovery code at each consecutive call', async () => {
let recoveryCodesSetting = await application.settings.getSetting(SettingName.RecoveryCodes)
let recoveryCodesSetting = await application.settings.getSetting(SettingName.create(SettingName.NAMES.RecoveryCodes).getValue())
expect(recoveryCodesSetting).to.equal(undefined)
const generatedRecoveryCodesAfterFirstCall = await application.getRecoveryCodes.execute()
expect(generatedRecoveryCodesAfterFirstCall.getValue().length).to.equal(49)
recoveryCodesSetting = await application.settings.getSetting(SettingName.RecoveryCodes)
recoveryCodesSetting = await application.settings.getSetting(SettingName.create(SettingName.NAMES.RecoveryCodes).getValue())
expect(recoveryCodesSetting).to.equal(generatedRecoveryCodesAfterFirstCall.getValue())
const fetchedRecoveryCodesOnTheSecondCall = await application.getRecoveryCodes.execute()
-113
View File
@@ -1,113 +0,0 @@
/* eslint-disable no-undef */
import * as Factory from './lib/factory.js'
chai.use(chaiAsPromised)
const expect = chai.expect
describe('session sharing', function () {
this.timeout(Factory.TenSecondTimeout)
beforeEach(async function () {
localStorage.clear()
this.context = await Factory.createAppContext()
await this.context.launch()
this.application = this.context.application
this.email = this.context.email
this.password = this.context.password
await Factory.registerUserToApplication({
application: this.application,
email: this.email,
password: this.password,
})
})
afterEach(async function () {
await this.context.deinit()
this.context = undefined
this.application = undefined
localStorage.clear()
})
it('share token payloads should include neccessary params', async function () {
const token = await this.application.sessions.createDemoShareToken()
const payload = await this.application.sessions.decodeDemoShareToken(token)
const expectedKeys = [
'accessToken',
'refreshToken',
'accessExpiration',
'refreshExpiration',
'readonlyAccess',
'masterKey',
'keyParams',
'user',
'host',
]
for (const key of expectedKeys) {
expect(payload[key]).to.not.be.undefined
}
})
it('populating session from share token should allow pulling in new items', async function () {
const token = await this.application.sessions.createDemoShareToken()
await Factory.createSyncedNote(this.application, 'demo title', 'demo text')
const otherContext = await Factory.createAppContext()
await otherContext.launch()
const otherApplication = otherContext.application
expect(otherApplication.items.getItems(ContentType.Note).length).to.equal(0)
await otherApplication.sessions.populateSessionFromDemoShareToken(token)
await otherApplication.sync.sync()
const notes = otherApplication.items.getItems(ContentType.Note)
expect(notes.length).to.equal(1)
const note = notes[0]
expect(note.title).to.equal('demo title')
expect(note.text).to.equal('demo text')
await otherContext.deinit()
})
/**
* Demo session tokens can only be created manually via raw SQL entry on the DB side.
* There is no API to create share tokens. Therefore, the share token below is made from
* a copy of the master session, which is not readonly.
*/
it.skip('populating session from share token should not allow making changes', async function () {
const token = await this.application.sessions.createDemoShareToken()
await Factory.createSyncedNote(this.application, 'demo title', 'demo text')
const otherContext = await Factory.createAppContext()
await otherContext.launch()
const otherApplication = otherContext.application
await otherApplication.sessions.populateSessionFromDemoShareToken(token)
await otherApplication.sync.sync()
const note = otherApplication.items.getItems(ContentType.Note)[0]
const syncResponse = otherContext.awaitNextSyncEvent(SyncEvent.SingleRoundTripSyncCompleted)
await otherApplication.mutator.changeAndSaveItem(note, (mutator) => {
mutator.title = 'unauthorized change'
})
const result = await syncResponse
expect(result.rawResponse.unsaved_items.length).to.equal(1)
})
})
+13 -13
View File
@@ -7,7 +7,7 @@ const expect = chai.expect
describe('settings service', function () {
this.timeout(Factory.ThirtySecondTimeout)
const validSetting = SettingName.GoogleDriveBackupFrequency
const validSetting = SettingName.create(SettingName.NAMES.GoogleDriveBackupFrequency).getValue()
const fakePayload = 'Im so meta even this acronym'
const updatedFakePayload = 'is meta'
@@ -98,22 +98,22 @@ describe('settings service', function () {
})
it('reads a nonexistent sensitive setting', async () => {
const setting = await application.settings.getDoesSensitiveSettingExist(SettingName.MfaSecret)
const setting = await application.settings.getDoesSensitiveSettingExist(SettingName.create(SettingName.NAMES.MfaSecret).getValue())
expect(setting).to.equal(false)
})
it('creates and reads a sensitive setting', async () => {
await application.settings.updateSetting(SettingName.MfaSecret, 'fake_secret', true)
const setting = await application.settings.getDoesSensitiveSettingExist(SettingName.MfaSecret)
await application.settings.updateSetting(SettingName.create(SettingName.NAMES.MfaSecret).getValue(), 'fake_secret', true)
const setting = await application.settings.getDoesSensitiveSettingExist(SettingName.create(SettingName.NAMES.MfaSecret).getValue())
expect(setting).to.equal(true)
})
it('creates and lists a sensitive setting', async () => {
await application.settings.updateSetting(SettingName.MfaSecret, 'fake_secret', true)
await application.settings.updateSetting(SettingName.MuteFailedBackupsEmails, MuteFailedBackupsEmailsOption.Muted)
await application.settings.updateSetting(SettingName.create(SettingName.NAMES.MfaSecret).getValue(), 'fake_secret', true)
await application.settings.updateSetting(SettingName.create(SettingName.NAMES.MuteFailedBackupsEmails).getValue(), MuteFailedBackupsEmailsOption.Muted)
const settings = await application.settings.listSettings()
expect(settings.getSettingValue(SettingName.MuteFailedBackupsEmails)).to.eql(MuteFailedBackupsEmailsOption.Muted)
expect(settings.getSettingValue(SettingName.MfaSecret)).to.not.be.ok
expect(settings.getSettingValue(SettingName.create(SettingName.NAMES.MuteFailedBackupsEmails).getValue())).to.eql(MuteFailedBackupsEmailsOption.Muted)
expect(settings.getSettingValue(SettingName.create(SettingName.NAMES.MfaSecret).getValue())).to.not.be.ok
})
it('reads a subscription setting', async () => {
@@ -135,7 +135,7 @@ describe('settings service', function () {
await Factory.sleep(2)
const setting = await application.settings.getSubscriptionSetting('FILE_UPLOAD_BYTES_LIMIT')
const setting = await application.settings.getSubscriptionSetting(SettingName.create(SettingName.NAMES.FileUploadBytesLimit).getValue())
expect(setting).to.be.a('string')
})
@@ -166,10 +166,10 @@ describe('settings service', function () {
await Factory.sleep(1)
const limitSettingBefore = await application.settings.getSubscriptionSetting('FILE_UPLOAD_BYTES_LIMIT')
const limitSettingBefore = await application.settings.getSubscriptionSetting(SettingName.create(SettingName.NAMES.FileUploadBytesLimit).getValue())
expect(limitSettingBefore).to.equal('107374182400')
const usedSettingBefore = await application.settings.getSubscriptionSetting('FILE_UPLOAD_BYTES_USED')
const usedSettingBefore = await application.settings.getSubscriptionSetting(SettingName.create(SettingName.NAMES.FileUploadBytesUsed).getValue())
expect(usedSettingBefore).to.equal('196')
await Factory.publishMockedEvent('SUBSCRIPTION_EXPIRED', {
@@ -202,10 +202,10 @@ describe('settings service', function () {
})
await Factory.sleep(1)
const limitSettingAfter = await application.settings.getSubscriptionSetting('FILE_UPLOAD_BYTES_LIMIT')
const limitSettingAfter = await application.settings.getSubscriptionSetting(SettingName.create(SettingName.NAMES.FileUploadBytesLimit).getValue())
expect(limitSettingAfter).to.equal(limitSettingBefore)
const usedSettingAfter = await application.settings.getSubscriptionSetting('FILE_UPLOAD_BYTES_USED')
const usedSettingAfter = await application.settings.getSubscriptionSetting(SettingName.create(SettingName.NAMES.FileUploadBytesUsed).getValue())
expect(usedSettingAfter).to.equal(usedSettingBefore)
})
})
-1
View File
@@ -84,7 +84,6 @@
<script type="module" src="history.test.js"></script>
<script type="module" src="actions.test.js"></script>
<script type="module" src="preferences.test.js"></script>
<script type="module" src="session-sharing.test.js"></script>
<script type="module" src="files.test.js"></script>
<script type="module" src="session.test.js"></script>
<script type="module" src="subscriptions.test.js"></script>
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.166.3",
"version": "2.166.14",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -36,17 +36,17 @@
"@babel/core": "*",
"@babel/preset-env": "*",
"@standardnotes/api": "workspace:*",
"@standardnotes/common": "^1.46.4",
"@standardnotes/common": "^1.46.6",
"@standardnotes/domain-core": "^1.11.3",
"@standardnotes/domain-events": "^2.106.0",
"@standardnotes/domain-events": "^2.108.1",
"@standardnotes/encryption": "workspace:*",
"@standardnotes/features": "workspace:*",
"@standardnotes/files": "workspace:*",
"@standardnotes/models": "workspace:*",
"@standardnotes/responses": "workspace:*",
"@standardnotes/security": "^1.7.5",
"@standardnotes/security": "^1.7.6",
"@standardnotes/services": "workspace:*",
"@standardnotes/settings": "^1.19.0",
"@standardnotes/settings": "^1.20.0",
"@standardnotes/sncrypto-common": "workspace:*",
"@standardnotes/sncrypto-web": "workspace:*",
"@standardnotes/utils": "workspace:*",
+32
View File
@@ -3,6 +3,38 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.24.37](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.24.36](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.24.35](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.24.34](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.24.33](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.24.32](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.24.31](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-03)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.24.30](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.24.29](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
### Bug Fixes
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.24.29",
"version": "1.24.37",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -15,7 +15,7 @@
"test": "jest spec"
},
"dependencies": {
"@standardnotes/common": "^1.46.4",
"@standardnotes/common": "^1.46.6",
"@standardnotes/features": "workspace:^",
"@standardnotes/filepicker": "workspace:^",
"@standardnotes/services": "workspace:^",
@@ -73,7 +73,7 @@ export class ArchiveManager {
async getZippedDecryptedItemsBlob(data: BackupFile) {
const zip = await import('@zip.js/zip.js')
const zipWriter = new zip.ZipWriter(new zip.BlobWriter('application/zip'))
const zipWriter = new zip.ZipWriter<Blob>(new zip.BlobWriter('application/zip'))
const items = data.items
const blob = new Blob([JSON.stringify(data, null, 2)], {
@@ -116,7 +116,7 @@ export class ArchiveManager {
async zipData(data: ZippableData): Promise<Blob> {
const zip = await import('@zip.js/zip.js')
const writer = new zip.ZipWriter(new zip.BlobWriter('application/zip'))
const writer = new zip.ZipWriter<Blob>(new zip.BlobWriter('application/zip'))
const filenameCounts: Record<string, number> = {}
@@ -0,0 +1,3 @@
export const ValidAppViewRoutes = ['u2f'] as const
export type AppViewRouteParam = typeof ValidAppViewRoutes[number]
@@ -4,4 +4,5 @@ export enum RootQueryParam {
DemoToken = 'demo-token',
AcceptSubscriptionInvite = 'accept-subscription-invite',
UserRequest = 'user-request',
AppViewRoute = 'route',
}
@@ -1,5 +1,6 @@
import { UserRequestType } from '@standardnotes/common'
import { PreferenceId } from './../Preferences/PreferenceId'
import { AppViewRouteParam, ValidAppViewRoutes } from './Params/AppViewRouteParams'
import { DemoParams } from './Params/DemoParams'
import { OnboardingParams } from './Params/OnboardingParams'
import { PurchaseParams } from './Params/PurchaseParams'
@@ -78,6 +79,18 @@ export class RouteParser implements RouteParserInterface {
}
}
get appViewRouteParam(): AppViewRouteParam | undefined {
this.checkForProperRouteType(RouteType.AppViewRoute)
const appViewRoute = this.searchParams.get(RootQueryParam.AppViewRoute) as AppViewRouteParam
if (!ValidAppViewRoutes.includes(appViewRoute)) {
return
}
return this.searchParams.get(RootQueryParam.AppViewRoute) as AppViewRouteParam
}
private checkForProperRouteType(type: RouteType): void {
if (this.parsedType !== type) {
throw new Error('Accessing invalid params')
@@ -99,6 +112,7 @@ export class RouteParser implements RouteParserInterface {
[RootQueryParam.DemoToken, RouteType.Demo],
[RootQueryParam.AcceptSubscriptionInvite, RouteType.AcceptSubscriptionInvite],
[RootQueryParam.UserRequest, RouteType.UserRequest],
[RootQueryParam.AppViewRoute, RouteType.AppViewRoute],
])
for (const rootQueryParam of rootQueryParametersMap.keys()) {
@@ -1,3 +1,4 @@
import { AppViewRouteParam } from './Params/AppViewRouteParams'
import { DemoParams } from './Params/DemoParams'
import { OnboardingParams } from './Params/OnboardingParams'
import { PurchaseParams } from './Params/PurchaseParams'
@@ -13,5 +14,6 @@ export interface RouteParserInterface {
get onboardingParams(): OnboardingParams
get subscriptionInviteParams(): SubscriptionInviteParams
get userRequestParams(): UserRequestParams
get appViewRouteParam(): AppViewRouteParam | undefined
get type(): RouteType
}
@@ -5,5 +5,6 @@ export enum RouteType {
AcceptSubscriptionInvite = 'accept-subscription-invite',
UserRequest = 'user-request',
Demo = 'demo',
AppViewRoute = 'route',
None = 'none',
}
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.16.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/utils
## [1.16.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-24)
**Note:** Version bump only for package @standardnotes/utils
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/utils",
"version": "1.16.4",
"version": "1.16.5",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -25,7 +25,7 @@
"test": "jest spec"
},
"dependencies": {
"@standardnotes/common": "^1.46.4",
"@standardnotes/common": "^1.46.6",
"dompurify": "^2.4.1",
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13"
+68
View File
@@ -3,6 +3,74 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.150.21](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/web
## [3.150.20](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)
**Note:** Version bump only for package @standardnotes/web
## [3.150.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/web
## [3.150.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/web
## [3.150.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)
**Note:** Version bump only for package @standardnotes/web
## [3.150.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/web
## [3.150.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)
**Note:** Version bump only for package @standardnotes/web
## [3.150.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/web
## [3.150.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/web
## [3.150.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)
**Note:** Version bump only for package @standardnotes/web
## [3.150.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-03)
**Note:** Version bump only for package @standardnotes/web
## [3.150.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-02)
**Note:** Version bump only for package @standardnotes/web
## [3.150.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-02)
**Note:** Version bump only for package @standardnotes/web
## [3.150.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/web
## [3.150.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/web
## [3.150.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/web
## [3.150.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/web
## [3.150.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)
**Note:** Version bump only for package @standardnotes/web
+187
View File
@@ -1,5 +1,192 @@
{
"versions": [
{
"version": "3.150.21",
"title": "[3.150.21](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.20",
"title": "[3.150.20](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-10)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.19",
"title": "[3.150.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.18",
"title": "[3.150.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.17",
"title": "[3.150.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-09)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.16",
"title": "[3.150.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.15",
"title": "[3.150.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-08)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.14",
"title": "[3.150.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.13",
"title": "[3.150.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.12",
"title": "[3.150.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-07)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.11",
"title": "[3.150.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-03)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.10",
"title": "[3.150.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-02)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.9",
"title": "[3.150.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-02)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.8",
"title": "[3.150.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.7",
"title": "[3.150.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.6",
"title": "[3.150.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.5",
"title": "[3.150.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.150.4",
"title": "[3.150.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-03-01)",
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.150.4",
"version": "3.150.21",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",
@@ -38,6 +38,7 @@
"@reach/listbox": "^0.18.0",
"@reach/tooltip": "^0.18.0",
"@reach/visually-hidden": "^0.18.0",
"@simplewebauthn/browser": "^7.1.0",
"@standardnotes/authenticator": "^2.3.9",
"@standardnotes/autobiography-theme": "^1.2.7",
"@standardnotes/bold-editor": "^1.6.4",
@@ -51,7 +52,7 @@
"@standardnotes/markdown-hybrid": "^1.7.7",
"@standardnotes/markdown-math": "^1.4.2",
"@standardnotes/markdown-minimal": "^1.3.0",
"@standardnotes/markdown-visual": "^1.0.7",
"@standardnotes/markdown-visual": "^1.3.2",
"@standardnotes/midnight-theme": "^1.4.6",
"@standardnotes/rich-text": "^1.8.7",
"@standardnotes/simple-task-editor": "^1.3.10",
@@ -87,8 +88,8 @@
"lint-staged": ">=13",
"mini-css-extract-plugin": "^2.7.2",
"minimatch": "^5.1.1",
"mobx": "^6.7.0",
"mobx-react-lite": "^3.4.0",
"mobx": "^6.8.0",
"mobx-react-lite": "^3.4.2",
"node-sass": "^8.0.0",
"npm-check-updates": "*",
"postcss": "^8.4.19",
@@ -100,9 +101,9 @@
"react-dom": "^18.2.0",
"react-refresh": "^0.14.0",
"sass-loader": "*",
"styled-components": "^5.3.6",
"styled-components": "^5.3.8",
"svg-jest": "^1.0.1",
"tailwindcss": "^3.2.4",
"tailwindcss": "^3.2.7",
"ts-jest": "^29.0.3",
"ts-loader": "^9.4.2",
"typescript": "*",
@@ -116,7 +117,6 @@
},
"dependencies": {
"@lexical/headless": "0.8.1",
"@simplewebauthn/browser": "^7.0.0",
"contactjs": "2.1.5"
}
}
@@ -0,0 +1,7 @@
{
"webcredentials": {
"apps": [
"HKF9BXSN95.com.standardnotes.standardnotes"
]
}
}
+9
View File
@@ -36,6 +36,8 @@ import { WebApplication } from './Application/Application'
import { createRoot, Root } from 'react-dom/client'
import { ElementIds } from './Constants/ElementIDs'
import { setDefaultMonospaceFont } from './setDefaultMonospaceFont'
import { RouteParser, RouteType } from '@standardnotes/ui-services'
import U2FAuthIframe from './Components/U2FAuthIframe/U2FAuthIframe'
let keyCount = 0
const getKey = () => {
@@ -71,6 +73,13 @@ const startApplication: StartApplication = async function startApplication(
setDefaultMonospaceFont(device.platform)
const route = new RouteParser(window.location.href)
if (route.type === RouteType.AppViewRoute && route.appViewRouteParam === 'u2f') {
root.render(<U2FAuthIframe />)
return
}
root.render(
<ApplicationGroupView
key={getKey()}
@@ -426,6 +426,18 @@ export class WebApplication extends SNApplication implements WebApplicationInter
this.getViewControllerManager().accountMenuController.setShow(true)
}
hideAccountMenu(): void {
this.getViewControllerManager().accountMenuController.setShow(false)
}
/**
* Full U2F clients are only web browser clients. They support adding and removing keys as well as authentication.
* The desktop and mobile clients cannot support adding keys.
*/
get isFullU2FClient(): boolean {
return this.environment === Environment.Web
}
geDefaultEditorIdentifier(currentTag?: SNTag): EditorIdentifier {
return (
currentTag?.preferences?.editorIdentifier ||
@@ -90,7 +90,11 @@ const ApplicationView: FunctionComponent<Props> = ({ application, mainApplicatio
return
}
void application.user.populateSessionFromDemoShareToken(token)
const status = application.status.addMessage('Preparing demo...')
void application.user.populateSessionFromDemoShareToken(token).then(() => {
application.status.removeMessage(status)
application.hideAccountMenu()
})
}, [application])
const onAppLaunch = useCallback(() => {
@@ -4,6 +4,7 @@ import { RefObject, useState } from 'react'
import Button from '../Button/Button'
import Icon from '../Icon/Icon'
import { InputValue } from './InputValue'
import U2FPromptIframeContainer from './U2FPromptIframeContainer'
type Props = {
application: WebApplication
@@ -17,6 +18,18 @@ const U2FPrompt = ({ application, onValueChange, prompt, buttonRef, contextData
const [authenticatorResponse, setAuthenticatorResponse] = useState<Record<string, unknown> | null>(null)
const [error, setError] = useState('')
if (!application.isFullU2FClient) {
return (
<U2FPromptIframeContainer
contextData={contextData}
apiHost={application.getHost() || window.defaultSyncServer}
onResponse={(response) => {
onValueChange(response, prompt)
}}
/>
)
}
return (
<div className="min-w-76">
{error && <div className="text-red-500">{error}</div>}
@@ -27,18 +40,18 @@ const U2FPrompt = ({ application, onValueChange, prompt, buttonRef, contextData
onClick={async () => {
if (!contextData || contextData.username === undefined) {
setError('No username provided')
return
}
const authenticatorResponseOrError = await application.getAuthenticatorAuthenticationResponse.execute({
username: contextData.username,
username: contextData.username as string,
})
if (authenticatorResponseOrError.isFailed()) {
setError(authenticatorResponseOrError.getError())
return
}
const authenticatorResponse = authenticatorResponseOrError.getValue()
setAuthenticatorResponse(authenticatorResponse)
@@ -0,0 +1,66 @@
import { log, LoggingDomain } from '@/Logging'
import { isDev } from '@/Utils'
import { useEffect, useRef } from 'react'
type Props = {
contextData?: Record<string, unknown>
onResponse: (response: string) => void
apiHost: string
}
const U2F_IFRAME_ORIGIN = isDev ? 'http://localhost:3001/?route=u2f' : 'https://app.standardnotes.com/?route=u2f'
const U2FPromptIframeContainer = ({ contextData, onResponse, apiHost }: Props) => {
const iframeRef = useRef<HTMLIFrameElement>(null)
useEffect(() => {
const messageHandler = (event: MessageEvent) => {
log(LoggingDomain.U2F, 'Native client received message', event)
const eventDoesNotComeFromU2FIFrame = event.origin !== new URL(U2F_IFRAME_ORIGIN).origin
if (eventDoesNotComeFromU2FIFrame) {
log(
LoggingDomain.U2F,
'Not sending data to U2F iframe; origin does not match',
event.origin,
new URL(U2F_IFRAME_ORIGIN).origin,
)
return
}
if (event.data.mountedAuthView) {
if (iframeRef.current?.contentWindow) {
log(LoggingDomain.U2F, 'Sending contextData to U2F iframe', contextData)
iframeRef.current.contentWindow.postMessage(
{ username: (contextData as Record<string, unknown>).username, apiHost },
U2F_IFRAME_ORIGIN,
)
}
return
}
if (event.data.assertionResponse) {
log(LoggingDomain.U2F, 'Received assertion response from U2F iframe', event.data.assertionResponse)
onResponse(event.data.assertionResponse)
}
}
window.addEventListener('message', messageHandler)
return () => {
window.removeEventListener('message', messageHandler)
}
}, [contextData, onResponse, apiHost])
return (
<iframe
ref={iframeRef}
src={U2F_IFRAME_ORIGIN}
className="h-40 w-full"
title="U2F"
allow="publickey-credentials-get"
id="u2f"
/>
)
}
export default U2FPromptIframeContainer

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