feat: add sending user requests to process (#1908)
* feat: add sending user requests to process * fix(snjs): yarn lock * fix(snjs): imports * fix: specs
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { AnyKeyParamsContent } from '@standardnotes/common'
|
||||
import { RootKeyInterface } from '@standardnotes/models'
|
||||
import { HttpResponse } from '@standardnotes/responses'
|
||||
|
||||
export type SessionManagerResponse = {
|
||||
response: HttpResponse
|
||||
rootKey?: RootKeyInterface
|
||||
keyParams?: AnyKeyParamsContent
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { UserRegistrationResponseBody } from '@standardnotes/api'
|
||||
import { ProtocolVersion } from '@standardnotes/common'
|
||||
import { RootKeyInterface } from '@standardnotes/models'
|
||||
import { ClientDisplayableError, HttpResponse, SignInResponse, User } 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
|
||||
register(email: string, password: string, ephemeral: boolean): Promise<UserRegistrationResponseBody>
|
||||
signIn(
|
||||
email: string,
|
||||
password: string,
|
||||
strict: boolean,
|
||||
ephemeral: boolean,
|
||||
minAllowedVersion?: ProtocolVersion,
|
||||
): Promise<SessionManagerResponse>
|
||||
getSureUser(): User
|
||||
bypassChecksAndSignInWithRootKey(
|
||||
email: string,
|
||||
rootKey: RootKeyInterface,
|
||||
ephemeral: boolean,
|
||||
): Promise<SignInResponse | HttpResponse>
|
||||
signOut(): Promise<void>
|
||||
changeCredentials(parameters: {
|
||||
currentServerPassword: string
|
||||
newRootKey: RootKeyInterface
|
||||
wrappingKey?: RootKeyInterface
|
||||
newEmail?: string
|
||||
}): Promise<SessionManagerResponse>
|
||||
}
|
||||
Reference in New Issue
Block a user