Merge branch 'main' of github.com:standardnotes/app

This commit is contained in:
Aman Harwara
2023-01-11 23:11:43 +05:30
31 changed files with 80 additions and 85 deletions

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.23.1](https://github.com/standardnotes/app/compare/@standardnotes/api@1.23.0...@standardnotes/api@1.23.1) (2023-01-11)
### Bug Fixes
* **snjs:** simplify authenticator api for generating options ([#2147](https://github.com/standardnotes/app/issues/2147)) ([5d20a53](https://github.com/standardnotes/app/commit/5d20a53e6ea9ec08fdc1403a36a1b371ffaf9cd2))
# [1.23.0](https://github.com/standardnotes/app/compare/@standardnotes/api@1.22.0...@standardnotes/api@1.23.0) (2023-01-09)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.23.0",
"version": "1.23.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},

View File

@@ -58,10 +58,7 @@ export class AuthenticatorApiService implements AuthenticatorApiServiceInterface
}
}
async generateRegistrationOptions(
userUuid: string,
username: string,
): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
async generateRegistrationOptions(): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
if (this.operationsInProgress.get(AuthenticatorApiOperations.GenerateRegistrationOptions)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
@@ -69,10 +66,7 @@ export class AuthenticatorApiService implements AuthenticatorApiServiceInterface
this.operationsInProgress.set(AuthenticatorApiOperations.GenerateRegistrationOptions, true)
try {
const response = await this.authenticatorServer.generateRegistrationOptions({
username,
userUuid,
})
const response = await this.authenticatorServer.generateRegistrationOptions()
return response
} catch (error) {
@@ -116,7 +110,7 @@ export class AuthenticatorApiService implements AuthenticatorApiServiceInterface
this.operationsInProgress.set(AuthenticatorApiOperations.GenerateAuthenticationOptions, true)
try {
const response = await this.authenticatorServer.generateAuthenticationOptions({})
const response = await this.authenticatorServer.generateAuthenticationOptions()
return response
} catch (error) {

View File

@@ -10,10 +10,7 @@ import {
export interface AuthenticatorApiServiceInterface {
list(): Promise<ListAuthenticatorsResponse>
delete(authenticatorId: string): Promise<DeleteAuthenticatorResponse>
generateRegistrationOptions(
userUuid: string,
username: string,
): Promise<GenerateAuthenticatorRegistrationOptionsResponse>
generateRegistrationOptions(): Promise<GenerateAuthenticatorRegistrationOptionsResponse>
verifyRegistrationResponse(
userUuid: string,
name: string,

View File

@@ -1,3 +0,0 @@
export interface GenerateAuthenticatorAuthenticationOptionsRequestParams {
[additionalParam: string]: unknown
}

View File

@@ -1,5 +0,0 @@
export interface GenerateAuthenticatorRegistrationOptionsRequestParams {
userUuid: string
username: string
[additionalParam: string]: unknown
}

View File

@@ -1,7 +1,5 @@
export * from './ApiEndpointParam'
export * from './Authenticator/DeleteAuthenticatorRequestParams'
export * from './Authenticator/GenerateAuthenticatorAuthenticationOptionsRequestParams'
export * from './Authenticator/GenerateAuthenticatorRegistrationOptionsRequestParams'
export * from './Authenticator/ListAuthenticatorsRequestParams'
export * from './Authenticator/VerifyAuthenticatorAuthenticationResponseRequestParams'
export * from './Authenticator/VerifyAuthenticatorRegistrationResponseRequestParams'

View File

@@ -2,9 +2,7 @@ import { HttpServiceInterface } from '../../Http/HttpServiceInterface'
import {
ListAuthenticatorsRequestParams,
DeleteAuthenticatorRequestParams,
GenerateAuthenticatorRegistrationOptionsRequestParams,
VerifyAuthenticatorRegistrationResponseRequestParams,
GenerateAuthenticatorAuthenticationOptionsRequestParams,
VerifyAuthenticatorAuthenticationResponseRequestParams,
} from '../../Request'
import {
@@ -33,10 +31,8 @@ export class AuthenticatorServer implements AuthenticatorServerInterface {
return response as DeleteAuthenticatorResponse
}
async generateRegistrationOptions(
params: GenerateAuthenticatorRegistrationOptionsRequestParams,
): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
const response = await this.httpService.get(Paths.v1.generateRegistrationOptions, params)
async generateRegistrationOptions(): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
const response = await this.httpService.get(Paths.v1.generateRegistrationOptions)
return response as GenerateAuthenticatorRegistrationOptionsResponse
}
@@ -49,10 +45,8 @@ export class AuthenticatorServer implements AuthenticatorServerInterface {
return response as VerifyAuthenticatorRegistrationResponseResponse
}
async generateAuthenticationOptions(
params: GenerateAuthenticatorAuthenticationOptionsRequestParams,
): Promise<GenerateAuthenticatorAuthenticationOptionsResponse> {
const response = await this.httpService.get(Paths.v1.generateAuthenticationOptions, params)
async generateAuthenticationOptions(): Promise<GenerateAuthenticatorAuthenticationOptionsResponse> {
const response = await this.httpService.get(Paths.v1.generateAuthenticationOptions)
return response as GenerateAuthenticatorAuthenticationOptionsResponse
}

View File

@@ -1,9 +1,7 @@
import {
ListAuthenticatorsRequestParams,
DeleteAuthenticatorRequestParams,
GenerateAuthenticatorRegistrationOptionsRequestParams,
VerifyAuthenticatorRegistrationResponseRequestParams,
GenerateAuthenticatorAuthenticationOptionsRequestParams,
VerifyAuthenticatorAuthenticationResponseRequestParams,
} from '../../Request'
import {
@@ -18,15 +16,11 @@ import {
export interface AuthenticatorServerInterface {
list(params: ListAuthenticatorsRequestParams): Promise<ListAuthenticatorsResponse>
delete(params: DeleteAuthenticatorRequestParams): Promise<DeleteAuthenticatorResponse>
generateRegistrationOptions(
params: GenerateAuthenticatorRegistrationOptionsRequestParams,
): Promise<GenerateAuthenticatorRegistrationOptionsResponse>
generateRegistrationOptions(): Promise<GenerateAuthenticatorRegistrationOptionsResponse>
verifyRegistrationResponse(
params: VerifyAuthenticatorRegistrationResponseRequestParams,
): Promise<VerifyAuthenticatorRegistrationResponseResponse>
generateAuthenticationOptions(
params: GenerateAuthenticatorAuthenticationOptionsRequestParams,
): Promise<GenerateAuthenticatorAuthenticationOptionsResponse>
generateAuthenticationOptions(): Promise<GenerateAuthenticatorAuthenticationOptionsResponse>
verifyAuthenticationResponse(
params: VerifyAuthenticatorAuthenticationResponseRequestParams,
): Promise<VerifyAuthenticatorAuthenticationResponseResponse>

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.12.4](https://github.com/standardnotes/app/compare/@standardnotes/blocks-editor@1.12.3...@standardnotes/blocks-editor@1.12.4) (2023-01-11)
**Note:** Version bump only for package @standardnotes/blocks-editor
## [1.12.3](https://github.com/standardnotes/app/compare/@standardnotes/blocks-editor@1.12.2...@standardnotes/blocks-editor@1.12.3) (2023-01-11)
**Note:** Version bump only for package @standardnotes/blocks-editor

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/blocks-editor",
"version": "1.12.3",
"version": "1.12.4",
"private": true,
"main": "./src/index.ts",
"scripts": {

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.
## [3.104.84](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.137.2...@standardnotes/desktop@3.104.84) (2023-01-11)
**Note:** Version bump only for package @standardnotes/desktop
## [3.104.83](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.137.1...@standardnotes/desktop@3.104.83) (2023-01-11)
**Note:** Version bump only for package @standardnotes/desktop

View File

@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.104.83",
"version": "3.104.84",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,

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.
## [3.50.20](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.50.19...@standardnotes/mobile@3.50.20) (2023-01-11)
**Note:** Version bump only for package @standardnotes/mobile
## [3.50.19](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.50.18...@standardnotes/mobile@3.50.19) (2023-01-11)
**Note:** Version bump only for package @standardnotes/mobile

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.50.19",
"version": "3.50.20",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",

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.4.107](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.106...@standardnotes/releases@1.4.107) (2023-01-11)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.106](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.105...@standardnotes/releases@1.4.106) (2023-01-11)
**Note:** Version bump only for package @standardnotes/releases

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.4.106",
"version": "1.4.107",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.55.1](https://github.com/standardnotes/app/compare/@standardnotes/services@1.55.0...@standardnotes/services@1.55.1) (2023-01-11)
### Bug Fixes
* **snjs:** simplify authenticator api for generating options ([#2147](https://github.com/standardnotes/app/issues/2147)) ([5d20a53](https://github.com/standardnotes/app/commit/5d20a53e6ea9ec08fdc1403a36a1b371ffaf9cd2))
# [1.55.0](https://github.com/standardnotes/app/compare/@standardnotes/services@1.54.0...@standardnotes/services@1.55.0) (2023-01-11)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/services",
"version": "1.55.0",
"version": "1.55.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},

View File

@@ -1,9 +1,9 @@
import { Username, Uuid } from '@standardnotes/domain-core'
import { Uuid } from '@standardnotes/domain-core'
export interface AuthenticatorClientInterface {
list(): Promise<Array<{ id: string; name: string }>>
delete(authenticatorId: Uuid): Promise<boolean>
generateRegistrationOptions(userUuid: Uuid, username: Username): Promise<Record<string, unknown> | null>
generateRegistrationOptions(): Promise<Record<string, unknown> | null>
verifyRegistrationResponse(
userUuid: Uuid,
name: string,

View File

@@ -1,7 +1,7 @@
/* istanbul ignore file */
import { AuthenticatorApiServiceInterface } from '@standardnotes/api'
import { Username, Uuid } from '@standardnotes/domain-core'
import { Uuid } from '@standardnotes/domain-core'
import { InternalEventBusInterface } from '../Internal/InternalEventBusInterface'
import { AbstractService } from '../Service/AbstractService'
@@ -43,9 +43,9 @@ export class AuthenticatorManager extends AbstractService implements Authenticat
}
}
async generateRegistrationOptions(userUuid: Uuid, username: Username): Promise<Record<string, unknown> | null> {
async generateRegistrationOptions(): Promise<Record<string, unknown> | null> {
try {
const result = await this.authenticatorApiService.generateRegistrationOptions(userUuid.value, username.value)
const result = await this.authenticatorApiService.generateRegistrationOptions()
if (result.data.error) {
return null

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.163.1](https://github.com/standardnotes/app/compare/@standardnotes/snjs@2.163.0...@standardnotes/snjs@2.163.1) (2023-01-11)
### Bug Fixes
* **snjs:** simplify authenticator api for generating options ([#2147](https://github.com/standardnotes/app/issues/2147)) ([5d20a53](https://github.com/standardnotes/app/commit/5d20a53e6ea9ec08fdc1403a36a1b371ffaf9cd2))
# [2.163.0](https://github.com/standardnotes/app/compare/@standardnotes/snjs@2.162.0...@standardnotes/snjs@2.163.0) (2023-01-11)
### Features

View File

@@ -23,7 +23,6 @@ describe('AddAuthenticator', () => {
const result = await useCase.execute({
userUuid: 'invalid',
username: 'username',
authenticatorName: 'authenticatorName',
})
@@ -31,25 +30,11 @@ describe('AddAuthenticator', () => {
expect(result.getError()).toBe('Could not generate authenticator registration options: Given value is not a valid uuid: invalid')
})
it('should return error if username is invalid', async () => {
const useCase = createUseCase()
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
username: '',
authenticatorName: 'authenticatorName',
})
expect(result.isFailed()).toBe(true)
expect(result.getError()).toBe('Could not generate authenticator registration options: Username cannot be empty')
})
it('should return error if authenticatorName is invalid', async () => {
const useCase = createUseCase()
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
username: 'username',
authenticatorName: '',
})
@@ -64,7 +49,6 @@ describe('AddAuthenticator', () => {
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
username: 'username',
authenticatorName: 'authenticator',
})
@@ -79,7 +63,6 @@ describe('AddAuthenticator', () => {
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
username: 'username',
authenticatorName: 'authenticator',
})
@@ -96,7 +79,6 @@ describe('AddAuthenticator', () => {
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
username: 'username',
authenticatorName: 'authenticator',
})
@@ -111,7 +93,7 @@ describe('AddAuthenticator', () => {
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
username: 'username',
authenticatorName: 'authenticator',
})
@@ -124,7 +106,6 @@ describe('AddAuthenticator', () => {
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
username: 'username',
authenticatorName: 'authenticator',
})
@@ -136,7 +117,6 @@ describe('AddAuthenticator', () => {
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
username: 'username',
authenticatorName: 'authenticator',
})

View File

@@ -1,5 +1,5 @@
import { AuthenticatorClientInterface } from '@standardnotes/services'
import { Result, UseCaseInterface, Username, Uuid, Validator } from '@standardnotes/domain-core'
import { Result, UseCaseInterface, Uuid, Validator } from '@standardnotes/domain-core'
import { AddAuthenticatorDTO } from './AddAuthenticatorDTO'
@@ -24,12 +24,6 @@ export class AddAuthenticator implements UseCaseInterface<void> {
}
const userUuid = userUuidOrError.getValue()
const usernameOrError = Username.create(dto.username)
if (usernameOrError.isFailed()) {
return Result.fail(`Could not generate authenticator registration options: ${usernameOrError.getError()}`)
}
const username = usernameOrError.getValue()
const authenticatorNameValidatorResult = Validator.isNotEmpty(dto.authenticatorName)
if (authenticatorNameValidatorResult.isFailed()) {
return Result.fail(
@@ -37,7 +31,7 @@ export class AddAuthenticator implements UseCaseInterface<void> {
)
}
const registrationOptions = await this.authenticatorClient.generateRegistrationOptions(userUuid, username)
const registrationOptions = await this.authenticatorClient.generateRegistrationOptions()
if (registrationOptions === null) {
return Result.fail('Could not generate authenticator registration options')
}

View File

@@ -1,5 +1,4 @@
export interface AddAuthenticatorDTO {
userUuid: string
username: string
authenticatorName: string
}

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.163.0",
"version": "2.163.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},

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.23.9](https://github.com/standardnotes/app/compare/@standardnotes/ui-services@1.23.8...@standardnotes/ui-services@1.23.9) (2023-01-11)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.23.8](https://github.com/standardnotes/app/compare/@standardnotes/ui-services@1.23.7...@standardnotes/ui-services@1.23.8) (2023-01-11)
**Note:** Version bump only for package @standardnotes/ui-services

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.23.8",
"version": "1.23.9",
"engines": {
"node": ">=16.0.0 <17.0.0"
},

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.
## [3.137.3](https://github.com/standardnotes/app/compare/@standardnotes/web@3.137.2...@standardnotes/web@3.137.3) (2023-01-11)
**Note:** Version bump only for package @standardnotes/web
## [3.137.2](https://github.com/standardnotes/app/compare/@standardnotes/web@3.137.1...@standardnotes/web@3.137.2) (2023-01-11)
**Note:** Version bump only for package @standardnotes/web

View File

@@ -1,5 +1,16 @@
{
"versions": [
{
"version": "3.137.3",
"title": "[3.137.3](https://github.com/standardnotes/app/compare/@standardnotes/web@3.137.2...@standardnotes/web@3.137.3) (2023-01-11)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.137.2",
"title": "[3.137.2](https://github.com/standardnotes/app/compare/@standardnotes/web@3.137.1...@standardnotes/web@3.137.2) (2023-01-11)",

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.137.2",
"version": "3.137.3",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",