[web] Misc minor tsc improvements (#2352)
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@/accounts": "*",
|
||||
"@/next": "*",
|
||||
"@ente/accounts": "*",
|
||||
"@ente/shared": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
{
|
||||
"extends": "@/build-config/tsconfig-next.json",
|
||||
"compilerOptions": {
|
||||
/* Set the base directory from which to resolve bare module names */
|
||||
/* Set the base directory from which to resolve bare module names. */
|
||||
"baseUrl": "./src",
|
||||
/* MUI doesn't work with exactOptionalPropertyTypes yet. */
|
||||
"exactOptionalPropertyTypes": false
|
||||
},
|
||||
"include": [
|
||||
"src",
|
||||
"next-env.d.ts",
|
||||
"../../packages/next/global-electron.d.ts",
|
||||
"../../packages/shared/themes/mui-theme.d.ts"
|
||||
]
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@/accounts": "*",
|
||||
"@/build-config": "*",
|
||||
"@/next": "*",
|
||||
"@ente/accounts": "*",
|
||||
"@ente/eslint-config": "*",
|
||||
"@ente/shared": "*",
|
||||
"jssha": "~3.3.1",
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { accountLogout } from "@/accounts/services/logout";
|
||||
import type { AccountsContextT } from "@/accounts/types/context";
|
||||
import { clientPackageName, staticAppTitle } from "@/next/app";
|
||||
import { CustomHead } from "@/next/components/Head";
|
||||
import { setupI18n } from "@/next/i18n";
|
||||
@@ -6,8 +8,6 @@ import {
|
||||
logUnhandledErrorsAndRejections,
|
||||
} from "@/next/log-web";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { accountLogout } from "@ente/accounts/services/logout";
|
||||
import type { AccountsContextT } from "@ente/accounts/types/context";
|
||||
import { Overlay } from "@ente/shared/components/Container";
|
||||
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
|
||||
import type { DialogBoxAttributesV2 } from "@ente/shared/components/DialogBoxV2/types";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/change-email";
|
||||
import Page_ from "@/accounts/pages/change-email";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/change-password";
|
||||
import Page_ from "@/accounts/pages/change-password";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/credentials";
|
||||
import Page_ from "@/accounts/pages/credentials";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/generate";
|
||||
import Page_ from "@/accounts/pages/generate";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/login";
|
||||
import Page_ from "@/accounts/pages/login";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/passkeys/finish";
|
||||
import Page_ from "@/accounts/pages/passkeys/finish";
|
||||
import { useAppContext } from "../_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/two-factor/recover";
|
||||
import Page_ from "@/accounts/pages/two-factor/recover";
|
||||
import { useAppContext } from "../_app";
|
||||
|
||||
const Page = () => (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/recover";
|
||||
import Page_ from "@/accounts/pages/recover";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/signup";
|
||||
import Page_ from "@/accounts/pages/signup";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/two-factor/recover";
|
||||
import Page_ from "@/accounts/pages/two-factor/recover";
|
||||
import { useAppContext } from "../_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} twoFactorType="totp" />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/two-factor/setup";
|
||||
import Page_ from "@/accounts/pages/two-factor/setup";
|
||||
import { useAppContext } from "../_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/two-factor/verify";
|
||||
import Page_ from "@/accounts/pages/two-factor/verify";
|
||||
import { useAppContext } from "../_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/verify";
|
||||
import Page_ from "@/accounts/pages/verify";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -31,12 +31,12 @@ export class Steam {
|
||||
const digest = sha1HMACDigest(this.secret.buffer, uintToArray(counter));
|
||||
|
||||
// Same calculation as regular HOTP.
|
||||
const offset = digest[digest.length - 1] & 15;
|
||||
const offset = digest[digest.length - 1]! & 15;
|
||||
let otp =
|
||||
((digest[offset] & 127) << 24) |
|
||||
((digest[offset + 1] & 255) << 16) |
|
||||
((digest[offset + 2] & 255) << 8) |
|
||||
(digest[offset + 3] & 255);
|
||||
((digest[offset]! & 127) << 24) |
|
||||
((digest[offset + 1]! & 255) << 16) |
|
||||
((digest[offset + 2]! & 255) << 8) |
|
||||
(digest[offset + 3]! & 255);
|
||||
|
||||
// However, instead of using this as the OTP, use it to index into
|
||||
// the steam OTP alphabet.
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
{
|
||||
"extends": "@/build-config/tsconfig-next.json",
|
||||
"compilerOptions": {
|
||||
/* Set the base directory from which to resolve bare module names */
|
||||
/* Set the base directory from which to resolve bare module names. */
|
||||
"baseUrl": "./src",
|
||||
|
||||
/* This is hard to enforce in certain cases where we do a lot of array
|
||||
indexing, e.g. image/ML ops, and TS doesn't currently have a way to
|
||||
disable this for blocks of code. */
|
||||
"noUncheckedIndexedAccess": false,
|
||||
/* MUI doesn't play great with exactOptionalPropertyTypes currently. */
|
||||
/* MUI doesn't work with exactOptionalPropertyTypes yet. */
|
||||
"exactOptionalPropertyTypes": false
|
||||
},
|
||||
"include": [
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@/accounts": "*",
|
||||
"@/media": "*",
|
||||
"@/next": "*",
|
||||
"@ente/accounts": "*",
|
||||
"@ente/eslint-config": "*",
|
||||
"@ente/shared": "*"
|
||||
},
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
},
|
||||
"include": [
|
||||
"src",
|
||||
"next-env.d.ts",
|
||||
"../../packages/next/global-electron.d.ts",
|
||||
"../../packages/shared/themes/mui-theme.d.ts"
|
||||
]
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@/accounts": "*",
|
||||
"@/media": "*",
|
||||
"@/new": "*",
|
||||
"@/next": "*",
|
||||
"@date-io/date-fns": "^2.14.0",
|
||||
"@ente/accounts": "*",
|
||||
"@ente/eslint-config": "*",
|
||||
"@ente/shared": "*",
|
||||
"@mui/x-date-pickers": "^5.0.0-alpha.6",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { checkSessionValidity } from "@/accounts/services/session";
|
||||
import log from "@/next/log";
|
||||
import { checkSessionValidity } from "@ente/accounts/services/session";
|
||||
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
|
||||
import type { DialogBoxAttributesV2 } from "@ente/shared/components/DialogBoxV2/types";
|
||||
import VerifyMasterPasswordForm, {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { openAccountsManagePasskeysPage } from "@/accounts/services/passkey";
|
||||
import log from "@/next/log";
|
||||
import { savedLogs } from "@/next/log-web";
|
||||
import { customAPIHost } from "@/next/origins";
|
||||
import { openAccountsManagePasskeysPage } from "@ente/accounts/services/passkey";
|
||||
import { SpaceBetweenFlex } from "@ente/shared/components/Container";
|
||||
import { EnteLogo } from "@ente/shared/components/EnteLogo";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { t } from "i18next";
|
||||
import { useContext } from "react";
|
||||
|
||||
import { disableTwoFactor } from "@ente/accounts/api/user";
|
||||
import { disableTwoFactor } from "@/accounts/api/user";
|
||||
import { PHOTOS_PAGES as PAGES } from "@ente/shared/constants/pages";
|
||||
import { LS_KEYS, getData, setLSUser } from "@ente/shared/storage/localStorage";
|
||||
import { Button, Grid } from "@mui/material";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { AccountsContextT } from "@/accounts/types/context";
|
||||
import DownloadManager from "@/new/photos/services/download";
|
||||
import {
|
||||
isFaceIndexingEnabled,
|
||||
@@ -14,7 +15,6 @@ import {
|
||||
} from "@/next/log-web";
|
||||
import { AppUpdate } from "@/next/types/ipc";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import type { AccountsContextT } from "@ente/accounts/types/context";
|
||||
import { Overlay } from "@ente/shared/components/Container";
|
||||
import DialogBox from "@ente/shared/components/DialogBox";
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/change-email";
|
||||
import Page_ from "@/accounts/pages/change-email";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/change-password";
|
||||
import Page_ from "@/accounts/pages/change-password";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/credentials";
|
||||
import Page_ from "@/accounts/pages/credentials";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/generate";
|
||||
import Page_ from "@/accounts/pages/generate";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Login } from "@/accounts/components/Login";
|
||||
import { SignUp } from "@/accounts/components/SignUp";
|
||||
import { DevSettings } from "@/new/photos/components/DevSettings";
|
||||
import log from "@/next/log";
|
||||
import { albumsAppOrigin, customAPIHost } from "@/next/origins";
|
||||
import { Login } from "@ente/accounts/components/Login";
|
||||
import { SignUp } from "@ente/accounts/components/SignUp";
|
||||
import { EnteLogo } from "@ente/shared/components/EnteLogo";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
import { PHOTOS_PAGES as PAGES } from "@ente/shared/constants/pages";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/login";
|
||||
import Page_ from "@/accounts/pages/login";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/passkeys/finish";
|
||||
import Page_ from "@/accounts/pages/passkeys/finish";
|
||||
import { useAppContext } from "../_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/two-factor/recover";
|
||||
import Page_ from "@/accounts/pages/two-factor/recover";
|
||||
import { useAppContext } from "../_app";
|
||||
|
||||
const Page = () => (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/recover";
|
||||
import Page_ from "@/accounts/pages/recover";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/signup";
|
||||
import Page_ from "@/accounts/pages/signup";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/two-factor/recover";
|
||||
import Page_ from "@/accounts/pages/two-factor/recover";
|
||||
import { useAppContext } from "../_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} twoFactorType="totp" />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/two-factor/setup";
|
||||
import Page_ from "@/accounts/pages/two-factor/setup";
|
||||
import { useAppContext } from "../_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/two-factor/verify";
|
||||
import Page_ from "@/accounts/pages/two-factor/verify";
|
||||
import { useAppContext } from "../_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Page_ from "@ente/accounts/pages/verify";
|
||||
import Page_ from "@/accounts/pages/verify";
|
||||
import { useAppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={useAppContext()} />;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { accountLogout } from "@/accounts/services/logout";
|
||||
import DownloadManager from "@/new/photos/services/download";
|
||||
import { clearFeatureFlagSessionState } from "@/new/photos/services/feature-flags";
|
||||
import { terminateMLWorker } from "@/new/photos/services/ml";
|
||||
import { clearFaceDB } from "@/new/photos/services/ml/db";
|
||||
import mlWorkManager from "@/new/photos/services/ml/mlWorkManager";
|
||||
import log from "@/next/log";
|
||||
import { accountLogout } from "@ente/accounts/services/logout";
|
||||
import { clipService } from "services/clip-service";
|
||||
import exportService from "./export";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { putAttributes } from "@/accounts/api/user";
|
||||
import log from "@/next/log";
|
||||
import { apiURL, customAPIOrigin, familyAppOrigin } from "@/next/origins";
|
||||
import { putAttributes } from "@ente/accounts/api/user";
|
||||
import { ApiError } from "@ente/shared/error";
|
||||
import HTTPService from "@ente/shared/network/HTTPService";
|
||||
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## @ente/accounts
|
||||
## @/accounts
|
||||
|
||||
A package for sharing the pages involved in the signup/login flow.
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import log from "@/next/log";
|
||||
import { apiURL } from "@/next/origins";
|
||||
import { ApiError, CustomError } from "@ente/shared/error";
|
||||
import HTTPService from "@ente/shared/network/HTTPService";
|
||||
import { HttpStatusCode } from "axios";
|
||||
import type {
|
||||
CompleteSRPSetupRequest,
|
||||
CompleteSRPSetupResponse,
|
||||
@@ -11,10 +14,7 @@ import type {
|
||||
SetupSRPResponse,
|
||||
UpdateSRPAndKeysRequest,
|
||||
UpdateSRPAndKeysResponse,
|
||||
} from "@ente/accounts/types/srp";
|
||||
import { ApiError, CustomError } from "@ente/shared/error";
|
||||
import HTTPService from "@ente/shared/network/HTTPService";
|
||||
import { HttpStatusCode } from "axios";
|
||||
} from "../types/srp";
|
||||
|
||||
export const getSRPAttributes = async (
|
||||
email: string,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { appName } from "@/next/app";
|
||||
import { apiURL } from "@/next/origins";
|
||||
import type {
|
||||
RecoveryKey,
|
||||
TwoFactorRecoveryResponse,
|
||||
TwoFactorSecret,
|
||||
TwoFactorVerificationResponse,
|
||||
UserVerificationResponse,
|
||||
} from "@ente/accounts/types/user";
|
||||
} from "@/accounts/types/user";
|
||||
import { appName } from "@/next/app";
|
||||
import { apiURL } from "@/next/origins";
|
||||
import type { B64EncryptionResult } from "@ente/shared/crypto/internal/libsodium";
|
||||
import { ApiError, CustomError } from "@ente/shared/error";
|
||||
import HTTPService from "@ente/shared/network/HTTPService";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { estimatePasswordStrength } from "@ente/accounts/utils";
|
||||
import { estimatePasswordStrength } from "@/accounts/utils";
|
||||
import { FlexWrapper } from "@ente/shared/components/Container";
|
||||
import { Typography } from "@mui/material";
|
||||
import { t } from "i18next";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { isWeakPassword } from "@ente/accounts/utils";
|
||||
import { isWeakPassword } from "@/accounts/utils";
|
||||
import ShowHidePassword from "@ente/shared/components/Form/ShowHidePassword";
|
||||
import SubmitButton from "@ente/shared/components/SubmitButton";
|
||||
import { Box, Input, TextField, Typography } from "@mui/material";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { sendOtt } from "@/accounts/api/user";
|
||||
import { PasswordStrengthHint } from "@/accounts/components/PasswordStrength";
|
||||
import { PAGES } from "@/accounts/constants/pages";
|
||||
import { isWeakPassword } from "@/accounts/utils";
|
||||
import { generateKeyAndSRPAttributes } from "@/accounts/utils/srp";
|
||||
import log from "@/next/log";
|
||||
import { sendOtt } from "@ente/accounts/api/user";
|
||||
import { PasswordStrengthHint } from "@ente/accounts/components/PasswordStrength";
|
||||
import { PAGES } from "@ente/accounts/constants/pages";
|
||||
import { isWeakPassword } from "@ente/accounts/utils";
|
||||
import { generateKeyAndSRPAttributes } from "@ente/accounts/utils/srp";
|
||||
import { LS_KEYS, setLSUser } from "@ente/shared//storage/localStorage";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import InvalidInputMessage from "@/accounts/components/two-factor/InvalidInputMessage";
|
||||
import { wait } from "@/utils/promise";
|
||||
import InvalidInputMessage from "@ente/accounts/components/two-factor/InvalidInputMessage";
|
||||
import {
|
||||
CenteredFlex,
|
||||
VerticallyCentered,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TwoFactorSecret } from "@ente/accounts/types/user";
|
||||
import type { TwoFactorSecret } from "@/accounts/types/user";
|
||||
import CodeBlock from "@ente/shared/components/CodeBlock";
|
||||
import { Typography } from "@mui/material";
|
||||
import { t } from "i18next";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TwoFactorSecret } from "@ente/accounts/types/user";
|
||||
import type { TwoFactorSecret } from "@/accounts/types/user";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
import { t } from "i18next";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import SetupManualMode from "@ente/accounts/components/two-factor/setup/ManualMode";
|
||||
import SetupQRMode from "@ente/accounts/components/two-factor/setup/QRMode";
|
||||
import { SetupMode } from "@ente/accounts/pages/two-factor/setup";
|
||||
import type { TwoFactorSecret } from "@ente/accounts/types/user";
|
||||
import SetupManualMode from "@/accounts/components/two-factor/setup/ManualMode";
|
||||
import SetupQRMode from "@/accounts/components/two-factor/setup/QRMode";
|
||||
import { SetupMode } from "@/accounts/pages/two-factor/setup";
|
||||
import type { TwoFactorSecret } from "@/accounts/types/user";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import { useState } from "react";
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "@ente/accounts",
|
||||
"name": "@/accounts",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@/next": "*",
|
||||
"@ente/eslint-config": "*",
|
||||
"@ente/shared": "*"
|
||||
},
|
||||
"devDependencies": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { changeEmail, sendOTTForEmailChange } from "@/accounts/api/user";
|
||||
import { PAGES } from "@/accounts/constants/pages";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { wait } from "@/utils/promise";
|
||||
import { changeEmail, sendOTTForEmailChange } from "@ente/accounts/api/user";
|
||||
import { PAGES } from "@ente/accounts/constants/pages";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import FormPaper from "@ente/shared/components/Form/FormPaper";
|
||||
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import {
|
||||
getSRPAttributes,
|
||||
startSRPSetup,
|
||||
updateSRPAndKeys,
|
||||
} from "@ente/accounts/api/srp";
|
||||
} from "@/accounts/api/srp";
|
||||
import SetPasswordForm, {
|
||||
type SetPasswordFormProps,
|
||||
} from "@ente/accounts/components/SetPasswordForm";
|
||||
import { PAGES } from "@ente/accounts/constants/pages";
|
||||
} from "@/accounts/components/SetPasswordForm";
|
||||
import { PAGES } from "@/accounts/constants/pages";
|
||||
import {
|
||||
generateSRPClient,
|
||||
generateSRPSetupAttributes,
|
||||
} from "@ente/accounts/services/srp";
|
||||
import type { UpdatedKey } from "@ente/accounts/types/user";
|
||||
import {
|
||||
convertBase64ToBuffer,
|
||||
convertBufferToBase64,
|
||||
} from "@ente/accounts/utils";
|
||||
} from "@/accounts/services/srp";
|
||||
import type { UpdatedKey } from "@/accounts/types/user";
|
||||
import { convertBase64ToBuffer, convertBufferToBase64 } from "@/accounts/utils";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import FormPaper from "@ente/shared/components/Form/FormPaper";
|
||||
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import log from "@/next/log";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { putAttributes } from "@ente/accounts/api/user";
|
||||
import { putAttributes } from "@/accounts/api/user";
|
||||
import SetPasswordForm, {
|
||||
type SetPasswordFormProps,
|
||||
} from "@ente/accounts/components/SetPasswordForm";
|
||||
import { PAGES } from "@ente/accounts/constants/pages";
|
||||
import { configureSRP } from "@ente/accounts/services/srp";
|
||||
import { generateKeyAndSRPAttributes } from "@ente/accounts/utils/srp";
|
||||
} from "@/accounts/components/SetPasswordForm";
|
||||
import { PAGES } from "@/accounts/constants/pages";
|
||||
import { configureSRP } from "@/accounts/services/srp";
|
||||
import { generateKeyAndSRPAttributes } from "@/accounts/utils/srp";
|
||||
import log from "@/next/log";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
import FormPaper from "@ente/shared/components/Form/FormPaper";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { sendOtt } from "@/accounts/api/user";
|
||||
import { PAGES } from "@/accounts/constants/pages";
|
||||
import log from "@/next/log";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { sendOtt } from "@ente/accounts/api/user";
|
||||
import { PAGES } from "@ente/accounts/constants/pages";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import FormPaper from "@ente/shared/components/Form/FormPaper";
|
||||
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { PAGES } from "@/accounts/constants/pages";
|
||||
import { customAPIHost } from "@/next/origins";
|
||||
import { PAGES } from "@ente/accounts/constants/pages";
|
||||
import { LS_KEYS, getData } from "@ente/shared//storage/localStorage";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import log from "@/next/log";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import {
|
||||
recoverTwoFactor,
|
||||
removeTwoFactor,
|
||||
type TwoFactorType,
|
||||
} from "@ente/accounts/api/user";
|
||||
import { PAGES } from "@ente/accounts/constants/pages";
|
||||
import type { AccountsContextT } from "@ente/accounts/types/context";
|
||||
} from "@/accounts/api/user";
|
||||
import { PAGES } from "@/accounts/constants/pages";
|
||||
import type { AccountsContextT } from "@/accounts/types/context";
|
||||
import log from "@/next/log";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import type { DialogBoxAttributesV2 } from "@ente/shared/components/DialogBoxV2/types";
|
||||
import FormPaper from "@ente/shared/components/Form/FormPaper";
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import log from "@/next/log";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { enableTwoFactor, setupTwoFactor } from "@ente/accounts/api/user";
|
||||
import { enableTwoFactor, setupTwoFactor } from "@/accounts/api/user";
|
||||
import VerifyTwoFactor, {
|
||||
type VerifyTwoFactorCallback,
|
||||
} from "@ente/accounts/components/two-factor/VerifyForm";
|
||||
import { TwoFactorSetup } from "@ente/accounts/components/two-factor/setup";
|
||||
import type { TwoFactorSecret } from "@ente/accounts/types/user";
|
||||
} from "@/accounts/components/two-factor/VerifyForm";
|
||||
import { TwoFactorSetup } from "@/accounts/components/two-factor/setup";
|
||||
import type { TwoFactorSecret } from "@/accounts/types/user";
|
||||
import log from "@/next/log";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import LinkButton from "@ente/shared/components/LinkButton";
|
||||
import { encryptWithRecoveryKey } from "@ente/shared/crypto/helpers";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { verifyTwoFactor } from "@ente/accounts/api/user";
|
||||
import { verifyTwoFactor } from "@/accounts/api/user";
|
||||
import VerifyTwoFactor, {
|
||||
type VerifyTwoFactorCallback,
|
||||
} from "@ente/accounts/components/two-factor/VerifyForm";
|
||||
import { PAGES } from "@ente/accounts/constants/pages";
|
||||
} from "@/accounts/components/two-factor/VerifyForm";
|
||||
import { PAGES } from "@/accounts/constants/pages";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import FormPaper from "@ente/shared/components/Form/FormPaper";
|
||||
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UserVerificationResponse } from "@/accounts/types/user";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import type { UserVerificationResponse } from "@ente/accounts/types/user";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
import FormPaper from "@ente/shared/components/Form/FormPaper";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UserVerificationResponse } from "@/accounts/types/user";
|
||||
import log from "@/next/log";
|
||||
import type { UserVerificationResponse } from "@ente/accounts/types/user";
|
||||
import ComlinkCryptoWorker from "@ente/shared/crypto";
|
||||
import { generateLoginSubKey } from "@ente/shared/crypto/helpers";
|
||||
import InMemoryStore, { MS_KEYS } from "@ente/shared/storage/InMemoryStore";
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
{
|
||||
"extends": "@/build-config/tsconfig-next.json",
|
||||
"compilerOptions": {
|
||||
/* TODO(MR): Enable this */
|
||||
"noUncheckedIndexedAccess": false,
|
||||
/* MUI doesn't play great with exactOptionalPropertyTypes currently. */
|
||||
/* MUI doesn't work with exactOptionalPropertyTypes yet. */
|
||||
"exactOptionalPropertyTypes": false
|
||||
},
|
||||
"include": [
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { AccountsContextT } from "@ente/accounts/types/context";
|
||||
import type { AccountsContextT } from "./context";
|
||||
|
||||
/**
|
||||
* The default type for pages exposed by this package.
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import type {
|
||||
UpdatedKey,
|
||||
UserVerificationResponse,
|
||||
} from "@ente/accounts/types/user";
|
||||
import type { UpdatedKey, UserVerificationResponse } from "./user";
|
||||
|
||||
export interface SRPAttributes {
|
||||
srpUserID: string;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import log from "@/next/log";
|
||||
import { customAPIHost } from "@/next/origins";
|
||||
import {
|
||||
checkPasskeyVerificationStatus,
|
||||
passkeySessionExpiredErrorMessage,
|
||||
saveCredentialsAndNavigateTo,
|
||||
} from "@ente/accounts/services/passkey";
|
||||
} from "@/accounts/services/passkey";
|
||||
import log from "@/next/log";
|
||||
import { customAPIHost } from "@/next/origins";
|
||||
import EnteButton from "@ente/shared/components/EnteButton";
|
||||
import { CircularProgress, Stack, Typography, styled } from "@mui/material";
|
||||
import { t } from "i18next";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { SRPAttributes } from "@/accounts/types/srp";
|
||||
import log from "@/next/log";
|
||||
import type { SRPAttributes } from "@ente/accounts/types/srp";
|
||||
import { Input, type ButtonProps } from "@mui/material";
|
||||
import { t } from "i18next";
|
||||
import SingleInputForm, {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { setRecoveryKey } from "@/accounts/api/user";
|
||||
import log from "@/next/log";
|
||||
import { setRecoveryKey } from "@ente/accounts/api/user";
|
||||
import {
|
||||
LS_KEYS,
|
||||
getData,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PAGES } from "@ente/accounts/constants/pages";
|
||||
import { PAGES } from "@/accounts/constants/pages";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect } from "react";
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
"target": "es2021",
|
||||
"paths": {
|
||||
"@ente/eslint-config/*": ["./packages/eslint-config/*"],
|
||||
"@ente/shared/*": ["./packages/shared/*"],
|
||||
"@ente/accounts/*": ["./packages/accounts/*"]
|
||||
"@ente/shared/*": ["./packages/shared/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["**/node_modules", "**/.*/"]
|
||||
|
||||
Reference in New Issue
Block a user