diff --git a/packages/api/CHANGELOG.md b/packages/api/CHANGELOG.md index a364127be51..bef38ec4d9b 100644 --- a/packages/api/CHANGELOG.md +++ b/packages/api/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.26.87](https://github.com/standardnotes/app/compare/@standardnotes/api@1.26.86...@standardnotes/api@1.26.87) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/api + +## [1.26.86](https://github.com/standardnotes/app/compare/@standardnotes/api@1.26.85...@standardnotes/api@1.26.86) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/api + +## [1.26.85](https://github.com/standardnotes/app/compare/@standardnotes/api@1.26.84...@standardnotes/api@1.26.85) (2024-04-08) + +**Note:** Version bump only for package @standardnotes/api + ## [1.26.84](https://github.com/standardnotes/app/compare/@standardnotes/api@1.26.83...@standardnotes/api@1.26.84) (2024-03-14) **Note:** Version bump only for package @standardnotes/api diff --git a/packages/api/package.json b/packages/api/package.json index 61b6942c8b6..b72a0c4b06e 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "@standardnotes/api", - "version": "1.26.84", + "version": "1.26.87", "engines": { "node": ">=16.0.0 <17.0.0" }, diff --git a/packages/api/src/Domain/Client/Auth/AuthApiService.ts b/packages/api/src/Domain/Client/Auth/AuthApiService.ts index d4e4a82f659..8a01135239c 100644 --- a/packages/api/src/Domain/Client/Auth/AuthApiService.ts +++ b/packages/api/src/Domain/Client/Auth/AuthApiService.ts @@ -72,6 +72,7 @@ export class AuthApiService implements AuthApiServiceInterface { password: string codeVerifier: string recoveryCodes: string + hvmToken?: string }): Promise> { if (this.operationsInProgress.get(AuthApiOperations.SignInWithRecoveryCodes)) { throw new ApiCallError(ErrorMessage.GenericInProgress) @@ -86,6 +87,7 @@ export class AuthApiService implements AuthApiServiceInterface { password: dto.password, recovery_codes: dto.recoveryCodes, username: dto.username, + hvm_token: dto.hvmToken, }) return response diff --git a/packages/api/src/Domain/Client/Auth/AuthApiServiceInterface.ts b/packages/api/src/Domain/Client/Auth/AuthApiServiceInterface.ts index e7026b41556..a2bb31cd0ab 100644 --- a/packages/api/src/Domain/Client/Auth/AuthApiServiceInterface.ts +++ b/packages/api/src/Domain/Client/Auth/AuthApiServiceInterface.ts @@ -17,5 +17,6 @@ export interface AuthApiServiceInterface { password: string codeVerifier: string recoveryCodes: string + hvmToken?: string }): Promise> } diff --git a/packages/api/src/Domain/Client/User/UserApiService.ts b/packages/api/src/Domain/Client/User/UserApiService.ts index 146ad4a17fb..98b112fb67f 100644 --- a/packages/api/src/Domain/Client/User/UserApiService.ts +++ b/packages/api/src/Domain/Client/User/UserApiService.ts @@ -66,6 +66,7 @@ export class UserApiService implements UserApiServiceInterface { async register(registerDTO: { email: string serverPassword: string + hvmToken?: string keyParams: RootKeyParamsInterface ephemeral: boolean }): Promise> { @@ -76,6 +77,7 @@ export class UserApiService implements UserApiServiceInterface { [ApiEndpointParam.ApiVersion]: this.apiVersion, password: registerDTO.serverPassword, email: registerDTO.email, + hvm_token: registerDTO.hvmToken, ephemeral: registerDTO.ephemeral, ...registerDTO.keyParams.getPortableValue(), }) diff --git a/packages/api/src/Domain/Client/User/UserApiServiceInterface.ts b/packages/api/src/Domain/Client/User/UserApiServiceInterface.ts index f10f798a492..a574dd86509 100644 --- a/packages/api/src/Domain/Client/User/UserApiServiceInterface.ts +++ b/packages/api/src/Domain/Client/User/UserApiServiceInterface.ts @@ -11,6 +11,7 @@ export interface UserApiServiceInterface { register(registerDTO: { email: string serverPassword: string + hvmToken?: string keyParams: RootKeyParamsInterface ephemeral: boolean }): Promise> diff --git a/packages/api/src/Domain/Request/Recovery/SignInWithRecoveryCodesRequestParams.ts b/packages/api/src/Domain/Request/Recovery/SignInWithRecoveryCodesRequestParams.ts index f4233bab044..0ad4b33e798 100644 --- a/packages/api/src/Domain/Request/Recovery/SignInWithRecoveryCodesRequestParams.ts +++ b/packages/api/src/Domain/Request/Recovery/SignInWithRecoveryCodesRequestParams.ts @@ -4,4 +4,5 @@ export interface SignInWithRecoveryCodesRequestParams { password: string code_verifier: string recovery_codes: string + hvm_token?: string } diff --git a/packages/api/src/Domain/Request/User/UserRegistrationRequestParams.ts b/packages/api/src/Domain/Request/User/UserRegistrationRequestParams.ts index 4169558fa08..417a9935ae3 100644 --- a/packages/api/src/Domain/Request/User/UserRegistrationRequestParams.ts +++ b/packages/api/src/Domain/Request/User/UserRegistrationRequestParams.ts @@ -6,5 +6,6 @@ export type UserRegistrationRequestParams = AnyKeyParamsContent & { [additionalParam: string]: unknown password: string email: string + hvm_token?: string ephemeral: boolean } diff --git a/packages/clipper/CHANGELOG.md b/packages/clipper/CHANGELOG.md index a921ad1fbb8..ac115e2aa11 100644 --- a/packages/clipper/CHANGELOG.md +++ b/packages/clipper/CHANGELOG.md @@ -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.1.452](https://github.com/standardnotes/app/compare/@standardnotes/clipper@1.1.451...@standardnotes/clipper@1.1.452) (2024-04-11) + +**Note:** Version bump only for package @standardnotes/clipper + +## [1.1.451](https://github.com/standardnotes/app/compare/@standardnotes/clipper@1.1.450...@standardnotes/clipper@1.1.451) (2024-04-11) + +**Note:** Version bump only for package @standardnotes/clipper + +## [1.1.450](https://github.com/standardnotes/app/compare/@standardnotes/clipper@1.1.449...@standardnotes/clipper@1.1.450) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/clipper + +## [1.1.449](https://github.com/standardnotes/app/compare/@standardnotes/clipper@1.1.448...@standardnotes/clipper@1.1.449) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/clipper + +## [1.1.448](https://github.com/standardnotes/app/compare/@standardnotes/clipper@1.1.447...@standardnotes/clipper@1.1.448) (2024-04-08) + +**Note:** Version bump only for package @standardnotes/clipper + +## [1.1.447](https://github.com/standardnotes/app/compare/@standardnotes/clipper@1.1.446...@standardnotes/clipper@1.1.447) (2024-04-04) + +**Note:** Version bump only for package @standardnotes/clipper + ## [1.1.446](https://github.com/standardnotes/app/compare/@standardnotes/clipper@1.1.445...@standardnotes/clipper@1.1.446) (2024-04-01) **Note:** Version bump only for package @standardnotes/clipper diff --git a/packages/clipper/package.json b/packages/clipper/package.json index 88fd453884d..6c27b158543 100644 --- a/packages/clipper/package.json +++ b/packages/clipper/package.json @@ -1,7 +1,7 @@ { "name": "@standardnotes/clipper", "description": "Web clipper browser extension for Standard Notes", - "version": "1.1.446", + "version": "1.1.452", "private": true, "scripts": { "build-mv2": "yarn clean && webpack --config ./webpack.config.prod.js", diff --git a/packages/desktop/CHANGELOG.md b/packages/desktop/CHANGELOG.md index cad08bbc2d9..9c25213abb7 100644 --- a/packages/desktop/CHANGELOG.md +++ b/packages/desktop/CHANGELOG.md @@ -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. +## [3.110.54](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.110.53...@standardnotes/desktop@3.110.54) (2024-04-11) + +**Note:** Version bump only for package @standardnotes/desktop + +## [3.110.53](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.192.15...@standardnotes/desktop@3.110.53) (2024-04-11) + +**Note:** Version bump only for package @standardnotes/desktop + +## [3.110.52](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.192.14...@standardnotes/desktop@3.110.52) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/desktop + +## [3.110.51](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.192.13...@standardnotes/desktop@3.110.51) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/desktop + +## [3.110.50](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.192.10...@standardnotes/desktop@3.110.50) (2024-04-08) + +**Note:** Version bump only for package @standardnotes/desktop + +## [3.110.49](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.192.9...@standardnotes/desktop@3.110.49) (2024-04-04) + +**Note:** Version bump only for package @standardnotes/desktop + ## [3.110.48](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.192.8...@standardnotes/desktop@3.110.48) (2024-04-01) **Note:** Version bump only for package @standardnotes/desktop diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 2c57fa17c66..2fc7b6d31ab 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -1,7 +1,7 @@ { "name": "@standardnotes/desktop", "main": "./app/dist/index.js", - "version": "3.110.48", + "version": "3.110.54", "license": "AGPL-3.0", "author": "Standard Notes.", "private": true, diff --git a/packages/encryption/CHANGELOG.md b/packages/encryption/CHANGELOG.md index 1bcd5a95e54..3d0912261cc 100644 --- a/packages/encryption/CHANGELOG.md +++ b/packages/encryption/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.21.105](https://github.com/standardnotes/app/compare/@standardnotes/encryption@1.21.104...@standardnotes/encryption@1.21.105) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/encryption + +## [1.21.104](https://github.com/standardnotes/app/compare/@standardnotes/encryption@1.21.103...@standardnotes/encryption@1.21.104) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/encryption + +## [1.21.103](https://github.com/standardnotes/app/compare/@standardnotes/encryption@1.21.102...@standardnotes/encryption@1.21.103) (2024-04-08) + +**Note:** Version bump only for package @standardnotes/encryption + ## [1.21.102](https://github.com/standardnotes/app/compare/@standardnotes/encryption@1.21.101...@standardnotes/encryption@1.21.102) (2024-02-17) **Note:** Version bump only for package @standardnotes/encryption diff --git a/packages/encryption/package.json b/packages/encryption/package.json index c782701ec82..5d92bb0d18d 100644 --- a/packages/encryption/package.json +++ b/packages/encryption/package.json @@ -1,6 +1,6 @@ { "name": "@standardnotes/encryption", - "version": "1.21.102", + "version": "1.21.105", "engines": { "node": ">=16.0.0 <17.0.0" }, diff --git a/packages/features/CHANGELOG.md b/packages/features/CHANGELOG.md index 1e4c84ed8ab..f505c896f9c 100644 --- a/packages/features/CHANGELOG.md +++ b/packages/features/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.61.3](https://github.com/standardnotes/app/compare/@standardnotes/features@1.61.2...@standardnotes/features@1.61.3) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/features + +## [1.61.2](https://github.com/standardnotes/app/compare/@standardnotes/features@1.61.1...@standardnotes/features@1.61.2) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/features + ## [1.61.1](https://github.com/standardnotes/app/compare/@standardnotes/features@1.61.0...@standardnotes/features@1.61.1) (2023-11-30) ### Bug Fixes diff --git a/packages/features/package.json b/packages/features/package.json index dd1600bb503..f7d3982fef1 100644 --- a/packages/features/package.json +++ b/packages/features/package.json @@ -1,6 +1,6 @@ { "name": "@standardnotes/features", - "version": "1.61.1", + "version": "1.61.3", "engines": { "node": ">=16.0.0 <17.0.0" }, diff --git a/packages/features/src/Domain/Feature/NativeFeatureIdentifier.ts b/packages/features/src/Domain/Feature/NativeFeatureIdentifier.ts index e2d1c313c36..3877399a5b8 100644 --- a/packages/features/src/Domain/Feature/NativeFeatureIdentifier.ts +++ b/packages/features/src/Domain/Feature/NativeFeatureIdentifier.ts @@ -28,6 +28,7 @@ export class NativeFeatureIdentifier extends ValueObject=16.0.0 <17.0.0" }, diff --git a/packages/files/CHANGELOG.md b/packages/files/CHANGELOG.md index 421885bbeee..f63b86614b8 100644 --- a/packages/files/CHANGELOG.md +++ b/packages/files/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.20.5](https://github.com/standardnotes/app/compare/@standardnotes/files@1.20.4...@standardnotes/files@1.20.5) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/files + +## [1.20.4](https://github.com/standardnotes/app/compare/@standardnotes/files@1.20.3...@standardnotes/files@1.20.4) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/files + +## [1.20.3](https://github.com/standardnotes/app/compare/@standardnotes/files@1.20.2...@standardnotes/files@1.20.3) (2024-04-08) + +**Note:** Version bump only for package @standardnotes/files + ## [1.20.2](https://github.com/standardnotes/app/compare/@standardnotes/files@1.20.1...@standardnotes/files@1.20.2) (2024-02-17) **Note:** Version bump only for package @standardnotes/files diff --git a/packages/files/package.json b/packages/files/package.json index eb823e0cbb1..da60a21005e 100644 --- a/packages/files/package.json +++ b/packages/files/package.json @@ -1,6 +1,6 @@ { "name": "@standardnotes/files", - "version": "1.20.2", + "version": "1.20.5", "engines": { "node": ">=16.0.0 <17.0.0" }, diff --git a/packages/mobile/CHANGELOG.md b/packages/mobile/CHANGELOG.md index dd94a26e260..ce4fd569157 100644 --- a/packages/mobile/CHANGELOG.md +++ b/packages/mobile/CHANGELOG.md @@ -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. +## [3.58.111](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.192.16...@standardnotes/mobile@3.58.111) (2024-04-11) + +**Note:** Version bump only for package @standardnotes/mobile + +## [3.58.110](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.58.109...@standardnotes/mobile@3.58.110) (2024-04-11) + +**Note:** Version bump only for package @standardnotes/mobile + +## [3.58.109](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.58.108...@standardnotes/mobile@3.58.109) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/mobile + +## [3.58.108](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.58.107...@standardnotes/mobile@3.58.108) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/mobile + +## [3.58.107](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.58.106...@standardnotes/mobile@3.58.107) (2024-04-08) + +**Note:** Version bump only for package @standardnotes/mobile + +## [3.58.106](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.58.105...@standardnotes/mobile@3.58.106) (2024-04-04) + +**Note:** Version bump only for package @standardnotes/mobile + ## [3.58.105](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.58.104...@standardnotes/mobile@3.58.105) (2024-04-01) ### Bug Fixes diff --git a/packages/mobile/fastlane/Fastfile b/packages/mobile/fastlane/Fastfile index cf7a4383a1e..2d914321914 100755 --- a/packages/mobile/fastlane/Fastfile +++ b/packages/mobile/fastlane/Fastfile @@ -158,7 +158,7 @@ platform :android do desc 'Deploy production app' lane :prod do - version = 3_002_000 + ENV['BUILD_NUMBER'].to_i + version = 3_004_000 + ENV['BUILD_NUMBER'].to_i deploy_android 'prod', version end end diff --git a/packages/mobile/package.json b/packages/mobile/package.json index 3792c84dd6a..32dea45aeba 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -1,6 +1,6 @@ { "name": "@standardnotes/mobile", - "version": "3.58.105", + "version": "3.58.111", "author": "Standard Notes.", "private": true, "license": "AGPL-3.0", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index 30f20bf65db..45781ea908d 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.55.3](https://github.com/standardnotes/app/compare/@standardnotes/models@1.55.2...@standardnotes/models@1.55.3) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/models + +## [1.55.2](https://github.com/standardnotes/app/compare/@standardnotes/models@1.55.1...@standardnotes/models@1.55.2) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/models + +## [1.55.1](https://github.com/standardnotes/app/compare/@standardnotes/models@1.55.0...@standardnotes/models@1.55.1) (2024-04-08) + +**Note:** Version bump only for package @standardnotes/models + # [1.55.0](https://github.com/standardnotes/app/compare/@standardnotes/models@1.54.0...@standardnotes/models@1.55.0) (2024-02-17) ### Features diff --git a/packages/models/package.json b/packages/models/package.json index ce5254562a9..cd1feed5e0a 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@standardnotes/models", - "version": "1.55.0", + "version": "1.55.3", "publishConfig": { "access": "public" }, diff --git a/packages/releases/CHANGELOG.md b/packages/releases/CHANGELOG.md index 6fdba96fae2..959250572c1 100644 --- a/packages/releases/CHANGELOG.md +++ b/packages/releases/CHANGELOG.md @@ -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.4.747](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.746...@standardnotes/releases@1.4.747) (2024-04-11) + +**Note:** Version bump only for package @standardnotes/releases + +## [1.4.746](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.745...@standardnotes/releases@1.4.746) (2024-04-11) + +**Note:** Version bump only for package @standardnotes/releases + +## [1.4.745](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.744...@standardnotes/releases@1.4.745) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/releases + +## [1.4.744](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.743...@standardnotes/releases@1.4.744) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/releases + +## [1.4.743](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.742...@standardnotes/releases@1.4.743) (2024-04-08) + +**Note:** Version bump only for package @standardnotes/releases + +## [1.4.742](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.741...@standardnotes/releases@1.4.742) (2024-04-04) + +**Note:** Version bump only for package @standardnotes/releases + ## [1.4.741](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.740...@standardnotes/releases@1.4.741) (2024-04-01) **Note:** Version bump only for package @standardnotes/releases diff --git a/packages/releases/package.json b/packages/releases/package.json index 1f21e3cc6ec..3437c389d03 100644 --- a/packages/releases/package.json +++ b/packages/releases/package.json @@ -1,6 +1,6 @@ { "name": "@standardnotes/releases", - "version": "1.4.741", + "version": "1.4.747", "license": "AGPL-3.0", "main": "dist/releases.json", "types": "dist/index.d.ts", diff --git a/packages/responses/CHANGELOG.md b/packages/responses/CHANGELOG.md index d68fdcc3a90..dfc94243c01 100644 --- a/packages/responses/CHANGELOG.md +++ b/packages/responses/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.13.56](https://github.com/standardnotes/app/compare/@standardnotes/responses@1.13.55...@standardnotes/responses@1.13.56) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/responses + +## [1.13.55](https://github.com/standardnotes/app/compare/@standardnotes/responses@1.13.54...@standardnotes/responses@1.13.55) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/responses + +## [1.13.54](https://github.com/standardnotes/app/compare/@standardnotes/responses@1.13.53...@standardnotes/responses@1.13.54) (2024-04-08) + +**Note:** Version bump only for package @standardnotes/responses + ## [1.13.53](https://github.com/standardnotes/app/compare/@standardnotes/responses@1.13.52...@standardnotes/responses@1.13.53) (2023-11-30) **Note:** Version bump only for package @standardnotes/responses diff --git a/packages/responses/package.json b/packages/responses/package.json index f145ffb4fd9..0c3f78cedc4 100644 --- a/packages/responses/package.json +++ b/packages/responses/package.json @@ -1,6 +1,6 @@ { "name": "@standardnotes/responses", - "version": "1.13.53", + "version": "1.13.56", "engines": { "node": ">=16.0.0 <17.0.0" }, diff --git a/packages/responses/src/Domain/Auth/MetaEndpointResponse.ts b/packages/responses/src/Domain/Auth/MetaEndpointResponse.ts new file mode 100644 index 00000000000..c0a34425f90 --- /dev/null +++ b/packages/responses/src/Domain/Auth/MetaEndpointResponse.ts @@ -0,0 +1,3 @@ +export type MetaEndpointResponse = { + captchaUIUrl: string | null +} diff --git a/packages/responses/src/Domain/Http/HttpResponse.ts b/packages/responses/src/Domain/Http/HttpResponse.ts index 8b9294d0e4c..34c1df8e32a 100644 --- a/packages/responses/src/Domain/Http/HttpResponse.ts +++ b/packages/responses/src/Domain/Http/HttpResponse.ts @@ -26,6 +26,30 @@ export function isErrorResponse(response: HttpResponse): response is HttpE return (response.data as HttpErrorResponseBody)?.error != undefined || response.status >= 400 } +export function getCaptchaHeader(response: HttpResponse) { + const captchaHeader = response.headers?.get('x-captcha-required') + if (captchaHeader) { + return captchaHeader + } + return null +} + +export function getErrorMessageFromErrorResponseBody(data: HttpErrorResponseBody, defaultMessage?: string): string { + let errorMessage = defaultMessage || 'Unknown error' + if ( + data && + typeof data === 'object' && + 'error' in data && + data.error && + typeof data.error === 'object' && + 'message' in data.error + ) { + errorMessage = data.error.message as string + } + + return errorMessage +} + export function getErrorFromErrorResponse(response: HttpErrorResponse): HttpError { const embeddedError = response.data.error if (embeddedError) { diff --git a/packages/responses/src/Domain/index.ts b/packages/responses/src/Domain/index.ts index bb3ec6e851c..b09a3242bcd 100644 --- a/packages/responses/src/Domain/index.ts +++ b/packages/responses/src/Domain/index.ts @@ -13,6 +13,7 @@ export * from './Auth/SignInData' export * from './Auth/SignInResponse' export * from './Auth/SignOutResponse' export * from './Auth/User' +export * from './Auth/MetaEndpointResponse' /** Temps are awaiting final publish state on server repo */ export * from './Temp/SharedVaultMoveType' diff --git a/packages/services/CHANGELOG.md b/packages/services/CHANGELOG.md index c310f72c8ce..90b737c12d8 100644 --- a/packages/services/CHANGELOG.md +++ b/packages/services/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.70.8](https://github.com/standardnotes/app/compare/@standardnotes/services@1.70.7...@standardnotes/services@1.70.8) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/services + +## [1.70.7](https://github.com/standardnotes/app/compare/@standardnotes/services@1.70.6...@standardnotes/services@1.70.7) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/services + +## [1.70.6](https://github.com/standardnotes/app/compare/@standardnotes/services@1.70.5...@standardnotes/services@1.70.6) (2024-04-08) + +**Note:** Version bump only for package @standardnotes/services + ## [1.70.5](https://github.com/standardnotes/app/compare/@standardnotes/services@1.70.4...@standardnotes/services@1.70.5) (2024-03-22) ### Bug Fixes diff --git a/packages/services/package.json b/packages/services/package.json index 48690270a69..7a015fb4cd2 100644 --- a/packages/services/package.json +++ b/packages/services/package.json @@ -1,6 +1,6 @@ { "name": "@standardnotes/services", - "version": "1.70.5", + "version": "1.70.8", "engines": { "node": ">=16.0.0 <17.0.0" }, diff --git a/packages/services/src/Domain/Auth/AuthClientInterface.ts b/packages/services/src/Domain/Auth/AuthClientInterface.ts index 6aa5d292bc7..e471442e8ef 100644 --- a/packages/services/src/Domain/Auth/AuthClientInterface.ts +++ b/packages/services/src/Domain/Auth/AuthClientInterface.ts @@ -13,8 +13,10 @@ export interface AuthClientInterface { password: string codeVerifier: string recoveryCodes: string + hvmToken?: string }): Promise< | { + success: true keyParams: AnyKeyParamsContent session: SessionBody user: { @@ -23,6 +25,9 @@ export interface AuthClientInterface { protocolVersion: string } } - | false + | { + success: false + captchaURL: string + } > } diff --git a/packages/services/src/Domain/Auth/AuthManager.ts b/packages/services/src/Domain/Auth/AuthManager.ts index 857e77c6694..5dcb48bc5cf 100644 --- a/packages/services/src/Domain/Auth/AuthManager.ts +++ b/packages/services/src/Domain/Auth/AuthManager.ts @@ -1,6 +1,6 @@ import { AuthApiServiceInterface } from '@standardnotes/api' import { AnyKeyParamsContent } from '@standardnotes/common' -import { isErrorResponse, SessionBody } from '@standardnotes/responses' +import { isErrorResponse, getCaptchaHeader } from '@standardnotes/responses' import { InternalEventBusInterface } from '../Internal/InternalEventBusInterface' import { AbstractService } from '../Service/AbstractService' @@ -45,37 +45,39 @@ export class AuthManager extends AbstractService implements AuthClientInterface } } - async signInWithRecoveryCodes(dto: { - username: string - password: string - codeVerifier: string - recoveryCodes: string - }): Promise< - | { - keyParams: AnyKeyParamsContent - session: SessionBody - user: { - uuid: string - email: string - protocolVersion: string - } - } - | false - > { + async signInWithRecoveryCodes( + dto: Parameters[0], + ): ReturnType { try { const result = await this.authApiService.signInWithRecoveryCodes(dto) + const captchaURL = getCaptchaHeader(result) + + if (captchaURL) { + return { + success: false, + captchaURL, + } + } + if (isErrorResponse(result)) { - return false + return { + success: false, + captchaURL: '', + } } return { + success: true, keyParams: result.data.key_params as AnyKeyParamsContent, session: result.data.session, user: result.data.user, } } catch (error) { - return false + return { + success: false, + captchaURL: '', + } } } } diff --git a/packages/services/src/Domain/Session/SessionsClientInterface.ts b/packages/services/src/Domain/Session/SessionsClientInterface.ts index 5c1e4e6882f..457eea35e00 100644 --- a/packages/services/src/Domain/Session/SessionsClientInterface.ts +++ b/packages/services/src/Domain/Session/SessionsClientInterface.ts @@ -30,13 +30,14 @@ export interface SessionsClientInterface { revokeAllOtherSessions(): Promise isCurrentSessionReadOnly(): boolean | undefined - register(email: string, password: string, ephemeral: boolean): Promise + register(email: string, password: string, hvmToken: string, ephemeral: boolean): Promise signIn( email: string, password: string, strict: boolean, ephemeral: boolean, minAllowedVersion?: ProtocolVersion, + hvmToken?: string, ): Promise bypassChecksAndSignInWithRootKey( email: string, diff --git a/packages/services/src/Domain/User/UserService.ts b/packages/services/src/Domain/User/UserService.ts index 0151fda9470..6d137546ad2 100644 --- a/packages/services/src/Domain/User/UserService.ts +++ b/packages/services/src/Domain/User/UserService.ts @@ -142,6 +142,7 @@ export class UserService public async register( email: string, password: string, + hvmToken: string, ephemeral = false, mergeLocal = true, ): Promise { @@ -157,7 +158,7 @@ export class UserService try { this.lockSyncing() - const response = await this.sessions.register(email, password, ephemeral) + const response = await this.sessions.register(email, password, hvmToken, ephemeral) await this.notifyEventSync(AccountEvent.SignedInOrRegistered, { payload: { @@ -190,6 +191,7 @@ export class UserService ephemeral = false, mergeLocal = true, awaitSync = false, + hvmToken?: string, ): Promise> { if (this.encryption.hasAccount()) { throw Error('Tried to sign in when an account already exists.') @@ -205,7 +207,7 @@ export class UserService /** Prevent a timed sync from occuring while signing in. */ this.lockSyncing() - const { response } = await this.sessions.signIn(email, password, strict, ephemeral) + const { response } = await this.sessions.signIn(email, password, strict, ephemeral, undefined, hvmToken) if (!isErrorResponse(response)) { const notifyingFunction = awaitSync ? this.notifyEventSync.bind(this) : this.notifyEvent.bind(this) diff --git a/packages/services/src/Domain/User/UserServiceInterface.ts b/packages/services/src/Domain/User/UserServiceInterface.ts index c7d78b93e4e..2b53768db49 100644 --- a/packages/services/src/Domain/User/UserServiceInterface.ts +++ b/packages/services/src/Domain/User/UserServiceInterface.ts @@ -21,6 +21,7 @@ export interface UserServiceInterface extends AbstractService @@ -31,6 +32,7 @@ export interface UserServiceInterface extends AbstractService> deleteAccount(): Promise<{ error: boolean diff --git a/packages/services/src/Domain/index.ts b/packages/services/src/Domain/index.ts index d5eda0a86f0..4993a91acf5 100644 --- a/packages/services/src/Domain/index.ts +++ b/packages/services/src/Domain/index.ts @@ -203,7 +203,6 @@ export * from './User/SignedInOrRegisteredEventPayload' export * from './User/SignedOutEventPayload' export * from './User/UserService' export * from './User/UserServiceInterface' -export * from './User/UserServiceInterface' export * from './UserEvent/NotificationService' export * from './UserEvent/NotificationServiceEvent' export * from './Vault/UseCase/AuthorizeVaultDeletion' diff --git a/packages/snjs/CHANGELOG.md b/packages/snjs/CHANGELOG.md index 92e8aa03041..a91302ef902 100644 --- a/packages/snjs/CHANGELOG.md +++ b/packages/snjs/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.208.18](https://github.com/standardnotes/app/compare/@standardnotes/snjs@2.208.17...@standardnotes/snjs@2.208.18) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/snjs + +## [2.208.17](https://github.com/standardnotes/app/compare/@standardnotes/snjs@2.208.16...@standardnotes/snjs@2.208.17) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/snjs + +## [2.208.16](https://github.com/standardnotes/app/compare/@standardnotes/snjs@2.208.15...@standardnotes/snjs@2.208.16) (2024-04-08) + +**Note:** Version bump only for package @standardnotes/snjs + ## [2.208.15](https://github.com/standardnotes/app/compare/@standardnotes/snjs@2.208.14...@standardnotes/snjs@2.208.15) (2024-03-26) **Note:** Version bump only for package @standardnotes/snjs diff --git a/packages/snjs/lib/Application/Application.ts b/packages/snjs/lib/Application/Application.ts index 500eae0f5cb..79977ffc904 100644 --- a/packages/snjs/lib/Application/Application.ts +++ b/packages/snjs/lib/Application/Application.ts @@ -98,6 +98,7 @@ import { SignInResponse, ClientDisplayableError, SessionListEntry, + MetaEndpointResponse, } from '@standardnotes/responses' import { SyncService, @@ -117,7 +118,7 @@ import { LoggerInterface, canBlockDeinit, } from '@standardnotes/utils' -import { UuidString, ApplicationEventPayload } from '../Types' +import { UuidString } from '../Types' import { applicationEventForSyncEvent } from '@Lib/Application/Event' import { BackupServiceInterface, FilesClientInterface } from '@standardnotes/files' import { ComputePrivateUsername } from '@standardnotes/encryption' @@ -275,12 +276,12 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli }), ) - const syncEventCallback = async (eventName: SyncEvent) => { + const syncEventCallback = async (eventName: SyncEvent, data?: unknown) => { const appEvent = applicationEventForSyncEvent(eventName) if (appEvent) { await encryptionService.onSyncEvent(eventName) - await this.notifyEvent(appEvent) + await this.notifyEvent(appEvent, data) if (appEvent === ApplicationEvent.CompletedFullSync) { if (!this.handledFullSyncStage) { @@ -535,7 +536,7 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli return this.addEventObserver(filteredCallback, event) } - private async notifyEvent(event: ApplicationEvent, data?: ApplicationEventPayload) { + private async notifyEvent(event: ApplicationEvent, data?: unknown) { if (event === ApplicationEvent.Started) { this.onStart() } else if (event === ApplicationEvent.Launched) { @@ -768,10 +769,11 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli public async register( email: string, password: string, + hvmToken: string, ephemeral = false, mergeLocal = true, ): Promise { - return this.user.register(email, password, ephemeral, mergeLocal) + return this.user.register(email, password, hvmToken, ephemeral, mergeLocal) } /** @@ -785,8 +787,13 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli ephemeral = false, mergeLocal = true, awaitSync = false, + hvmToken?: string, ): Promise> { - return this.user.signIn(email, password, strict, ephemeral, mergeLocal, awaitSync) + return this.user.signIn(email, password, strict, ephemeral, mergeLocal, awaitSync, hvmToken) + } + + public async getCaptchaUrl(): Promise> { + return this.legacyApi.getCaptchaUrl() } public async changeEmail( diff --git a/packages/snjs/lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodes.spec.ts b/packages/snjs/lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodes.spec.ts index e73b3834d5f..b989f079402 100644 --- a/packages/snjs/lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodes.spec.ts +++ b/packages/snjs/lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodes.spec.ts @@ -166,7 +166,9 @@ describe('SignInWithRecoveryCodes', () => { }) it('should fail if the sign in with recovery code fails', async () => { - authManager.signInWithRecoveryCodes = jest.fn().mockReturnValue(false) + authManager.signInWithRecoveryCodes = jest.fn().mockReturnValue({ + success: false, + }) const useCase = createUseCase() const result = await useCase.execute({ diff --git a/packages/snjs/lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodes.ts b/packages/snjs/lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodes.ts index 3478380bcb2..e5e66a76950 100644 --- a/packages/snjs/lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodes.ts +++ b/packages/snjs/lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodes.ts @@ -68,9 +68,18 @@ export class SignInWithRecoveryCodes implements UseCaseInterface { recoveryCodes: dto.recoveryCodes, username: dto.username, password: rootKey.serverPassword as string, + hvmToken: dto.hvmToken, }) - if (signInResult === false) { + if (signInResult.success === false) { + if (signInResult.captchaURL) { + return Result.fail( + JSON.stringify({ + captchaURL: signInResult.captchaURL, + }), + ) + } + return Result.fail('Could not sign in with recovery code') } diff --git a/packages/snjs/lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodesDTO.ts b/packages/snjs/lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodesDTO.ts index 01f38b2dc39..ed37d660000 100644 --- a/packages/snjs/lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodesDTO.ts +++ b/packages/snjs/lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodesDTO.ts @@ -2,4 +2,5 @@ export interface SignInWithRecoveryCodesDTO { recoveryCodes: string username: string password: string + hvmToken?: string } diff --git a/packages/snjs/lib/Services/Api/ApiService.ts b/packages/snjs/lib/Services/Api/ApiService.ts index d127e68f5ba..103c8a1231e 100644 --- a/packages/snjs/lib/Services/Api/ApiService.ts +++ b/packages/snjs/lib/Services/Api/ApiService.ts @@ -68,6 +68,7 @@ import { isErrorResponse, MoveFileResponse, ValetTokenOperation, + MetaEndpointResponse, } from '@standardnotes/responses' import { LegacySession, MapperInterface, Session, SessionToken } from '@standardnotes/domain-core' import { HttpServiceInterface } from '@standardnotes/api' @@ -290,6 +291,7 @@ export class LegacyApiService email: string serverPassword: string ephemeral: boolean + hvmToken?: string }): Promise> { if (this.authenticating) { return this.createErrorResponse(API_MESSAGE_LOGIN_IN_PROGRESS, HttpStatusCode.BadRequest) @@ -301,6 +303,7 @@ export class LegacyApiService password: dto.serverPassword, ephemeral: dto.ephemeral, code_verifier: this.inMemoryStore.getValue(StorageKey.CodeVerifier) as string, + hvm_token: dto.hvmToken, }) const response = await this.request({ @@ -958,4 +961,9 @@ export class LegacyApiService return this.session.accessToken } + + public getCaptchaUrl() { + const response = this.httpService.get(Paths.v1.meta) + return response + } } diff --git a/packages/snjs/lib/Services/Api/Paths.ts b/packages/snjs/lib/Services/Api/Paths.ts index 077b8ee9fc8..6639ed8dcb8 100644 --- a/packages/snjs/lib/Services/Api/Paths.ts +++ b/packages/snjs/lib/Services/Api/Paths.ts @@ -70,6 +70,7 @@ export const Paths = { ...SettingsPaths, ...SubscriptionPaths, ...UserPaths, + meta: '/v1/meta', }, v2: { ...UserPathsV2, diff --git a/packages/snjs/lib/Services/Features/UseCase/GetFeatureStatus.ts b/packages/snjs/lib/Services/Features/UseCase/GetFeatureStatus.ts index 73acb658add..99aa283f3c5 100644 --- a/packages/snjs/lib/Services/Features/UseCase/GetFeatureStatus.ts +++ b/packages/snjs/lib/Services/Features/UseCase/GetFeatureStatus.ts @@ -114,8 +114,10 @@ export class GetFeatureStatusUseCase { } private isFreeFeature(featureId: NativeFeatureIdentifier) { - return [NativeFeatureIdentifier.TYPES.DarkTheme, NativeFeatureIdentifier.TYPES.PlainEditor].includes( - featureId.value, - ) + return [ + NativeFeatureIdentifier.TYPES.DarkTheme, + NativeFeatureIdentifier.TYPES.PlainEditor, + NativeFeatureIdentifier.TYPES.ProtonTheme, + ].includes(featureId.value) } } diff --git a/packages/snjs/lib/Services/Session/SessionManager.ts b/packages/snjs/lib/Services/Session/SessionManager.ts index 920e6a104cc..00550a86f6a 100644 --- a/packages/snjs/lib/Services/Session/SessionManager.ts +++ b/packages/snjs/lib/Services/Session/SessionManager.ts @@ -404,7 +404,12 @@ export class SessionManager return undefined } - async register(email: string, password: string, ephemeral: boolean): Promise { + async register( + email: string, + password: string, + hvmToken: string, + ephemeral: boolean, + ): Promise { if (password.length < MINIMUM_PASSWORD_LENGTH) { throw new ApiCallError( ErrorMessage.InsufficientPasswordMessage.replace('%LENGTH%', MINIMUM_PASSWORD_LENGTH.toString()), @@ -429,6 +434,7 @@ export class SessionManager const registerResponse = await this.userApiService.register({ email, serverPassword, + hvmToken, keyParams, ephemeral, }) @@ -503,8 +509,9 @@ export class SessionManager strict = false, ephemeral = false, minAllowedVersion?: Common.ProtocolVersion, + hvmToken?: string, ): Promise { - const result = await this.performSignIn(email, password, strict, ephemeral, minAllowedVersion) + const result = await this.performSignIn(email, password, strict, ephemeral, minAllowedVersion, hvmToken) if ( isErrorResponse(result.response) && getErrorFromErrorResponse(result.response).tag !== ErrorTag.ClientValidationError && @@ -515,7 +522,7 @@ export class SessionManager /** * Try signing in with trimmed + lowercase version of email */ - return this.performSignIn(cleanedEmail, password, strict, ephemeral, minAllowedVersion) + return this.performSignIn(cleanedEmail, password, strict, ephemeral, minAllowedVersion, hvmToken) } else { return result } @@ -530,6 +537,7 @@ export class SessionManager strict = false, ephemeral = false, minAllowedVersion?: Common.ProtocolVersion, + hvmToken?: string, ): Promise { const paramsResult = await this.retrieveKeyParams({ email, @@ -593,7 +601,7 @@ export class SessionManager } } const rootKey = await this.encryptionService.computeRootKey(password, keyParams) - const signInResponse = await this.bypassChecksAndSignInWithRootKey(email, rootKey, ephemeral) + const signInResponse = await this.bypassChecksAndSignInWithRootKey(email, rootKey, ephemeral, hvmToken) return { response: signInResponse, @@ -604,6 +612,7 @@ export class SessionManager email: string, rootKey: SNRootKey, ephemeral = false, + hvmToken?: string, ): Promise> { const { wrappingKey, canceled } = await this.challengeService.getWrappingKeyIfApplicable() @@ -619,6 +628,7 @@ export class SessionManager email, serverPassword: rootKey.serverPassword as string, ephemeral, + hvmToken, }) if (!signInResponse.data || isErrorResponse(signInResponse)) { diff --git a/packages/snjs/package.json b/packages/snjs/package.json index a84f0e3e57d..f8ae0e1b862 100644 --- a/packages/snjs/package.json +++ b/packages/snjs/package.json @@ -1,6 +1,6 @@ { "name": "@standardnotes/snjs", - "version": "2.208.15", + "version": "2.208.18", "engines": { "node": ">=16.0.0 <17.0.0" }, diff --git a/packages/ui-services/CHANGELOG.md b/packages/ui-services/CHANGELOG.md index 7fc7c93d926..5ece5936ef3 100644 --- a/packages/ui-services/CHANGELOG.md +++ b/packages/ui-services/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.37.10](https://github.com/standardnotes/app/compare/@standardnotes/ui-services@1.37.9...@standardnotes/ui-services@1.37.10) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/ui-services + +## [1.37.9](https://github.com/standardnotes/app/compare/@standardnotes/ui-services@1.37.8...@standardnotes/ui-services@1.37.9) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/ui-services + +## [1.37.8](https://github.com/standardnotes/app/compare/@standardnotes/ui-services@1.37.7...@standardnotes/ui-services@1.37.8) (2024-04-08) + +**Note:** Version bump only for package @standardnotes/ui-services + ## [1.37.7](https://github.com/standardnotes/app/compare/@standardnotes/ui-services@1.37.6...@standardnotes/ui-services@1.37.7) (2024-03-26) ### Bug Fixes diff --git a/packages/ui-services/package.json b/packages/ui-services/package.json index 1f55ddd9773..1f2127648f4 100644 --- a/packages/ui-services/package.json +++ b/packages/ui-services/package.json @@ -1,6 +1,6 @@ { "name": "@standardnotes/ui-services", - "version": "1.37.7", + "version": "1.37.10", "engines": { "node": ">=16.0.0 <17.0.0" }, diff --git a/packages/web/CHANGELOG.md b/packages/web/CHANGELOG.md index 1b208660581..fe6cd8d5e1d 100644 --- a/packages/web/CHANGELOG.md +++ b/packages/web/CHANGELOG.md @@ -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. +## [3.192.17](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.16...@standardnotes/web@3.192.17) (2024-04-11) + +**Note:** Version bump only for package @standardnotes/web + +## [3.192.16](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.15...@standardnotes/web@3.192.16) (2024-04-11) + +**Note:** Version bump only for package @standardnotes/web + +## [3.192.15](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.14...@standardnotes/web@3.192.15) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/web + +## [3.192.14](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.13...@standardnotes/web@3.192.14) (2024-04-10) + +**Note:** Version bump only for package @standardnotes/web + +## [3.192.13](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.10...@standardnotes/web@3.192.13) (2024-04-08) + +**Note:** Version bump only for package @standardnotes/web + +## [3.192.10](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.9...@standardnotes/web@3.192.10) (2024-04-04) + +**Note:** Version bump only for package @standardnotes/web + ## [3.192.9](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.8...@standardnotes/web@3.192.9) (2024-04-01) ### Bug Fixes diff --git a/packages/web/CHANGELOG.md.json b/packages/web/CHANGELOG.md.json index 63e86a71992..2ffafb840f3 100644 --- a/packages/web/CHANGELOG.md.json +++ b/packages/web/CHANGELOG.md.json @@ -1,5 +1,71 @@ { "versions": [ + { + "version": "3.192.17", + "title": "[3.192.17](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.16...@standardnotes/web@3.192.17) (2024-04-11)", + "date": null, + "body": "**Note:** Version bump only for package @standardnotes/web", + "parsed": { + "_": [ + "Note: Version bump only for package @standardnotes/web" + ] + } + }, + { + "version": "3.192.16", + "title": "[3.192.16](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.15...@standardnotes/web@3.192.16) (2024-04-11)", + "date": null, + "body": "**Note:** Version bump only for package @standardnotes/web", + "parsed": { + "_": [ + "Note: Version bump only for package @standardnotes/web" + ] + } + }, + { + "version": "3.192.15", + "title": "[3.192.15](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.14...@standardnotes/web@3.192.15) (2024-04-10)", + "date": null, + "body": "**Note:** Version bump only for package @standardnotes/web", + "parsed": { + "_": [ + "Note: Version bump only for package @standardnotes/web" + ] + } + }, + { + "version": "3.192.14", + "title": "[3.192.14](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.13...@standardnotes/web@3.192.14) (2024-04-10)", + "date": null, + "body": "**Note:** Version bump only for package @standardnotes/web", + "parsed": { + "_": [ + "Note: Version bump only for package @standardnotes/web" + ] + } + }, + { + "version": "3.192.13", + "title": "[3.192.13](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.10...@standardnotes/web@3.192.13) (2024-04-08)", + "date": null, + "body": "**Note:** Version bump only for package @standardnotes/web", + "parsed": { + "_": [ + "Note: Version bump only for package @standardnotes/web" + ] + } + }, + { + "version": "3.192.10", + "title": "[3.192.10](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.9...@standardnotes/web@3.192.10) (2024-04-04)", + "date": null, + "body": "**Note:** Version bump only for package @standardnotes/web", + "parsed": { + "_": [ + "Note: Version bump only for package @standardnotes/web" + ] + } + }, { "version": "3.192.9", "title": "[3.192.9](https://github.com/standardnotes/app/compare/@standardnotes/web@3.192.8...@standardnotes/web@3.192.9) (2024-04-01)", diff --git a/packages/web/package.json b/packages/web/package.json index e7da751398f..8c2a1610577 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,6 +1,6 @@ { "name": "@standardnotes/web", - "version": "3.192.9", + "version": "3.192.17", "license": "AGPL-3.0", "main": "dist/app.js", "author": "Standard Notes", diff --git a/packages/web/src/components/assets/com.standardnotes.theme-proton/index.css b/packages/web/src/components/assets/com.standardnotes.theme-proton/index.css new file mode 100644 index 00000000000..3765b4aa27f --- /dev/null +++ b/packages/web/src/components/assets/com.standardnotes.theme-proton/index.css @@ -0,0 +1,68 @@ +:root { + --background-norm: #191927; + --background-weak: #292733; + --background-strong: #13131d; + --text-norm: #ffffff; + --text-weak: #a7a4b5; + --border-norm: #4a4658; + --border-weak: #343140; + --primary: #7777f8; + --interaction-norm: #6d4aff; + --warning: #ffb84d; + --success: #54948e; + --danger: #f5385a; + + --sn-stylekit-background-color: var(--background-norm); + --sn-stylekit-foreground-color: var(--text-norm); + --sn-stylekit-border-color: var(--border-weak); + --sn-stylekit-contrast-background-color: var(--background-weak); + --sn-stylekit-contrast-foreground-color: var(--text-norm); + --sn-stylekit-contrast-border-color: var(--border-norm); + --sn-stylekit-secondary-background-color: var(--background-weak); + --sn-stylekit-secondary-foreground-color: var(--text-norm); + --sn-stylekit-info-color: var(--interaction-norm); + --sn-stylekit-info-backdrop-color: #6e4aff0f; + --sn-stylekit-passive-color-0: var(--text-weak); + --sn-stylekit-passive-color-3: var(--background-strong); + --sn-stylekit-passive-color-4: #3f3b4c; + --sn-stylekit-passive-color-5: var(--background-weak); + --sn-stylekit-warning-color: var(--warning); + --sn-stylekit-success-color: var(--success); + --sn-stylekit-danger-color: var(--danger); + + --navigation-column-background-color: var(--background-strong); + --navigation-item-selected-background-color: var(--background-weak); + + --sn-stylekit-paragraph-text-color: var(--text-weak); + --sn-stylekit-scrollbar-thumb-color: var(--primary); + + --sn-stylekit-accessory-tint-color-1: var(--primary); + --sn-stylekit-accessory-tint-color-3: var(--warning); + --sn-stylekit-accessory-tint-color-5: var(--success); + + --preferences-background-color: var(--background-strong); + --preferences-navigation-selected-background-color: var(--background-norm); +} + +a, +.Lexical__link, +.Lexical__textCode { + color: var(--primary); +} + +.Collapsible__container, +.Lexical__tableCellHeader { + border-color: var(--border-norm); +} + +.Lexical__quote { + color: var(--text-weak); +} + +#blocks-editor hr.selected { + outline-color: var(--primary); +} + +[role='combobox'].border-passive-3 { + border-color: var(--border-weak); +} diff --git a/packages/web/src/javascripts/Components/AccountMenu/ConfirmPassword.tsx b/packages/web/src/javascripts/Components/AccountMenu/ConfirmPassword.tsx index 9d6f03fda06..3a20e8217e0 100644 --- a/packages/web/src/javascripts/Components/AccountMenu/ConfirmPassword.tsx +++ b/packages/web/src/javascripts/Components/AccountMenu/ConfirmPassword.tsx @@ -16,6 +16,8 @@ import DecoratedPasswordInput from '@/Components/Input/DecoratedPasswordInput' import Icon from '@/Components/Icon/Icon' import IconButton from '@/Components/Button/IconButton' import { useApplication } from '../ApplicationProvider' +import { useCaptcha } from '@/Hooks/useCaptcha' +import { isErrorResponse } from '@standardnotes/snjs' type Props = { setMenuPane: (pane: AccountMenuPane) => void @@ -33,6 +35,39 @@ const ConfirmPassword: FunctionComponent = ({ setMenuPane, email, passwor const [shouldMergeLocal, setShouldMergeLocal] = useState(true) const [error, setError] = useState('') + const [hvmToken, setHVMToken] = useState('') + const [captchaURL, setCaptchaURL] = useState('') + + const register = useCallback(() => { + setIsRegistering(true) + application + .register(email, password, hvmToken, isEphemeral, shouldMergeLocal) + .then(() => { + application.accountMenuController.closeAccountMenu() + application.accountMenuController.setCurrentPane(AccountMenuPane.GeneralMenu) + }) + .catch((err) => { + console.error(err) + setError(err.message) + }) + .finally(() => { + setIsRegistering(false) + }) + }, [application, email, hvmToken, isEphemeral, password, shouldMergeLocal]) + + const captchaIframe = useCaptcha(captchaURL, (token) => { + setHVMToken(token) + setCaptchaURL('') + }) + + useEffect(() => { + if (!hvmToken) { + return + } + + register() + }, [hvmToken, register]) + const passwordInputRef = useRef(null) useEffect(() => { @@ -51,6 +86,28 @@ const ConfirmPassword: FunctionComponent = ({ setMenuPane, email, passwor setShouldMergeLocal(!shouldMergeLocal) }, [shouldMergeLocal]) + const checkIfCaptchaRequiredAndRegister = useCallback(() => { + application + .getCaptchaUrl() + .then((response) => { + if (isErrorResponse(response)) { + throw new Error() + } + const { captchaUIUrl } = response.data + if (captchaUIUrl) { + setCaptchaURL(captchaUIUrl) + } else { + setCaptchaURL('') + register() + } + }) + .catch((error) => { + console.error(error) + setCaptchaURL('') + register() + }) + }, [application, register]) + const handleConfirmFormSubmit: FormEventHandler = useCallback( (e) => { e.preventDefault() @@ -60,28 +117,16 @@ const ConfirmPassword: FunctionComponent = ({ setMenuPane, email, passwor return } - if (password === confirmPassword) { - setIsRegistering(true) - application - .register(email, password, isEphemeral, shouldMergeLocal) - .then(() => { - application.accountMenuController.closeAccountMenu() - application.accountMenuController.setCurrentPane(AccountMenuPane.GeneralMenu) - }) - .catch((err) => { - console.error(err) - setError(err.message) - }) - .finally(() => { - setIsRegistering(false) - }) - } else { + if (password !== confirmPassword) { setError(STRING_NON_MATCHING_PASSWORDS) setConfirmPassword('') passwordInputRef.current?.focus() + return } + + checkIfCaptchaRequiredAndRegister() }, - [application, confirmPassword, email, isEphemeral, password, shouldMergeLocal], + [checkIfCaptchaRequiredAndRegister, confirmPassword, password], ) const handleKeyDown: KeyboardEventHandler = useCallback( @@ -100,35 +145,26 @@ const ConfirmPassword: FunctionComponent = ({ setMenuPane, email, passwor setMenuPane(AccountMenuPane.Register) }, [setMenuPane]) - return ( + const confirmPasswordForm = ( <> -
- -
Confirm password
-
Because your notes are encrypted using your password,{' '} Standard Notes does not have a password reset option. If you forget your password, you will permanently lose access to your data.
- ]} - onChange={handlePasswordChange} - onKeyDown={handleKeyDown} - placeholder="Confirm password" - ref={passwordInputRef} - value={confirmPassword} - /> + {!isRegistering && ( + ]} + onChange={handlePasswordChange} + onKeyDown={handleKeyDown} + placeholder="Confirm password" + ref={passwordInputRef} + value={confirmPassword} + /> + )} {error ?
{error}
: null}