From 9339490e8e8813d2aec0dd2ffddda1b2300aab61 Mon Sep 17 00:00:00 2001 From: Kitteh Date: Sun, 9 May 2021 11:18:18 +0100 Subject: [PATCH] Organise API methods. --- src/api/{ => auth}/usernameLogin.ts | 2 +- src/api/{ => kv}/createOrUpdateSecret.ts | 5 ++--- src/api/{ => kv}/deleteSecret.ts | 5 ++--- src/api/{ => kv}/getSecret.ts | 3 +-- src/api/{ => kv}/getSecretMetadata.ts | 2 +- src/api/{ => kv}/getSecrets.ts | 4 ++-- src/api/{ => kv}/undeleteSecret.ts | 4 ++-- src/api/{ => sys}/getCapabilities.ts | 4 ++-- src/api/{ => sys}/getMounts.ts | 2 +- src/api/{ => sys}/getSealStatus.ts | 2 +- src/api/{ => sys}/lookupSelf.ts | 2 +- src/api/{ => sys}/renewSelf.ts | 2 +- src/api/{ => sys}/sealVault.ts | 2 +- src/api/{ => sys}/submitUnsealKey.ts | 2 +- src/api/{ => totp}/addNewTOTP.ts | 4 ++-- src/api/{ => totp}/getTOTPCode.ts | 2 +- src/api/{ => totp}/getTOTPKeys.ts | 4 ++-- src/api/{ => transit}/getTransitKeys.ts | 4 ++-- src/api/{ => transit}/transitDecrypt.ts | 4 ++-- src/api/{ => transit}/transitEncrypt.ts | 4 ++-- src/main.ts | 2 +- src/pageUtils.ts | 4 ++-- src/pages/Home.ts | 4 ++-- src/pages/KeyValue/KeyValueDelete.ts | 2 +- src/pages/KeyValue/KeyValueNew.ts | 2 +- src/pages/KeyValue/KeyValueSecret.ts | 6 +++--- src/pages/KeyValue/KeyValueSecretsEdit.ts | 4 ++-- src/pages/KeyValue/KeyValueVersions.ts | 2 +- src/pages/KeyValue/KeyValueView.ts | 2 +- src/pages/Login.ts | 4 ++-- src/pages/Me.ts | 6 +++--- src/pages/TOTP/NewTOTP.ts | 2 +- src/pages/TOTP/TOTPView.ts | 4 ++-- src/pages/Transit/TransitDecrypt.ts | 2 +- src/pages/Transit/TransitEncrypt.ts | 2 +- src/pages/Transit/TransitView.ts | 2 +- src/pages/Unseal.ts | 4 ++-- 37 files changed, 57 insertions(+), 60 deletions(-) rename src/api/{ => auth}/usernameLogin.ts (92%) rename src/api/{ => kv}/createOrUpdateSecret.ts (89%) rename src/api/{ => kv}/deleteSecret.ts (91%) rename src/api/{ => kv}/getSecret.ts (92%) rename src/api/{ => kv}/getSecretMetadata.ts (89%) rename src/api/{ => kv}/getSecrets.ts (84%) rename src/api/{ => kv}/undeleteSecret.ts (88%) rename src/api/{ => sys}/getCapabilities.ts (87%) rename src/api/{ => sys}/getMounts.ts (87%) rename src/api/{ => sys}/getSealStatus.ts (88%) rename src/api/{ => sys}/lookupSelf.ts (88%) rename src/api/{ => sys}/renewSelf.ts (88%) rename src/api/{ => sys}/sealVault.ts (85%) rename src/api/{ => sys}/submitUnsealKey.ts (90%) rename src/api/{ => totp}/addNewTOTP.ts (82%) rename src/api/{ => totp}/getTOTPCode.ts (85%) rename src/api/{ => totp}/getTOTPKeys.ts (76%) rename src/api/{ => transit}/getTransitKeys.ts (76%) rename src/api/{ => transit}/transitDecrypt.ts (86%) rename src/api/{ => transit}/transitEncrypt.ts (86%) diff --git a/src/api/usernameLogin.ts b/src/api/auth/usernameLogin.ts similarity index 92% rename from src/api/usernameLogin.ts rename to src/api/auth/usernameLogin.ts index 2da2608..88ca35d 100644 --- a/src/api/usernameLogin.ts +++ b/src/api/auth/usernameLogin.ts @@ -1,4 +1,4 @@ -import { appendAPIURL } from "./apiUtils"; +import { appendAPIURL } from "../apiUtils"; export async function usernameLogin(username: string, password: string): Promise { const request = new Request(appendAPIURL(`/v1/auth/userpass/login/${username}`), { diff --git a/src/api/createOrUpdateSecret.ts b/src/api/kv/createOrUpdateSecret.ts similarity index 89% rename from src/api/createOrUpdateSecret.ts rename to src/api/kv/createOrUpdateSecret.ts index 9daf706..0fbb7ad 100644 --- a/src/api/createOrUpdateSecret.ts +++ b/src/api/kv/createOrUpdateSecret.ts @@ -1,6 +1,5 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; -import { removeDoubleSlash } from "../utils"; - +import { appendAPIURL, getHeaders } from "../apiUtils"; +import { removeDoubleSlash } from "../../utils"; export async function createOrUpdateSecret( baseMount: string, diff --git a/src/api/deleteSecret.ts b/src/api/kv/deleteSecret.ts similarity index 91% rename from src/api/deleteSecret.ts rename to src/api/kv/deleteSecret.ts index be10a64..15dac21 100644 --- a/src/api/deleteSecret.ts +++ b/src/api/kv/deleteSecret.ts @@ -1,6 +1,5 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; -import { removeDoubleSlash } from "../utils"; - +import { appendAPIURL, getHeaders } from "../apiUtils"; +import { removeDoubleSlash } from "../../utils"; export async function deleteSecret( baseMount: string, diff --git a/src/api/getSecret.ts b/src/api/kv/getSecret.ts similarity index 92% rename from src/api/getSecret.ts rename to src/api/kv/getSecret.ts index 5a4af5a..85dbd52 100644 --- a/src/api/getSecret.ts +++ b/src/api/kv/getSecret.ts @@ -1,5 +1,4 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; - +import { appendAPIURL, getHeaders } from "../apiUtils"; export async function getSecret( baseMount: string, diff --git a/src/api/getSecretMetadata.ts b/src/api/kv/getSecretMetadata.ts similarity index 89% rename from src/api/getSecretMetadata.ts rename to src/api/kv/getSecretMetadata.ts index fc1e09f..0491039 100644 --- a/src/api/getSecretMetadata.ts +++ b/src/api/kv/getSecretMetadata.ts @@ -1,4 +1,4 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; +import { appendAPIURL, getHeaders } from "../apiUtils"; type SecretMetadataType = { versions: Record> diff --git a/src/api/getSecrets.ts b/src/api/kv/getSecrets.ts similarity index 84% rename from src/api/getSecrets.ts rename to src/api/kv/getSecrets.ts index ff50cd0..783c5ee 100644 --- a/src/api/getSecrets.ts +++ b/src/api/kv/getSecrets.ts @@ -1,5 +1,5 @@ -import { DoesNotExistError } from "../types/internalErrors"; -import { appendAPIURL, getHeaders } from "./apiUtils"; +import { DoesNotExistError } from "../../types/internalErrors"; +import { appendAPIURL, getHeaders } from "../apiUtils"; export async function getSecrets( baseMount: string, diff --git a/src/api/undeleteSecret.ts b/src/api/kv/undeleteSecret.ts similarity index 88% rename from src/api/undeleteSecret.ts rename to src/api/kv/undeleteSecret.ts index c43cd13..2f84034 100644 --- a/src/api/undeleteSecret.ts +++ b/src/api/kv/undeleteSecret.ts @@ -1,5 +1,5 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; -import { getObjectKeys, removeDoubleSlash } from "../utils"; +import { appendAPIURL, getHeaders } from "../apiUtils"; +import { getObjectKeys, removeDoubleSlash } from "../../utils"; import { getSecretMetadata } from "./getSecretMetadata"; export async function undeleteSecret( diff --git a/src/api/getCapabilities.ts b/src/api/sys/getCapabilities.ts similarity index 87% rename from src/api/getCapabilities.ts rename to src/api/sys/getCapabilities.ts index 01dce97..fd9d2fa 100644 --- a/src/api/getCapabilities.ts +++ b/src/api/sys/getCapabilities.ts @@ -1,5 +1,5 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; -import { removeDoubleSlash } from "../utils"; +import { appendAPIURL, getHeaders } from "../apiUtils"; +import { removeDoubleSlash } from "../../utils"; export async function getCapabilitiesPath(path: string): Promise { diff --git a/src/api/getMounts.ts b/src/api/sys/getMounts.ts similarity index 87% rename from src/api/getMounts.ts rename to src/api/sys/getMounts.ts index 17e90e1..fb4b22a 100644 --- a/src/api/getMounts.ts +++ b/src/api/sys/getMounts.ts @@ -1,4 +1,4 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; +import { appendAPIURL, getHeaders } from "../apiUtils"; type MountsType = { [key: string]: { diff --git a/src/api/getSealStatus.ts b/src/api/sys/getSealStatus.ts similarity index 88% rename from src/api/getSealStatus.ts rename to src/api/sys/getSealStatus.ts index 69ad0d2..119f51b 100644 --- a/src/api/getSealStatus.ts +++ b/src/api/sys/getSealStatus.ts @@ -1,4 +1,4 @@ -import { appendAPIURL } from "./apiUtils"; +import { appendAPIURL } from "../apiUtils"; export type SealStatusType = { progress: number; diff --git a/src/api/lookupSelf.ts b/src/api/sys/lookupSelf.ts similarity index 88% rename from src/api/lookupSelf.ts rename to src/api/sys/lookupSelf.ts index fbf453b..a2c7f5c 100644 --- a/src/api/lookupSelf.ts +++ b/src/api/sys/lookupSelf.ts @@ -1,4 +1,4 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; +import { appendAPIURL, getHeaders } from "../apiUtils"; type TokenInfo = { expire_time: string; diff --git a/src/api/renewSelf.ts b/src/api/sys/renewSelf.ts similarity index 88% rename from src/api/renewSelf.ts rename to src/api/sys/renewSelf.ts index 317d7ed..b55784f 100644 --- a/src/api/renewSelf.ts +++ b/src/api/sys/renewSelf.ts @@ -1,4 +1,4 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; +import { appendAPIURL, getHeaders } from "../apiUtils"; export async function renewSelf(): Promise { const request = new Request(appendAPIURL("/v1/auth/token/renew-self"), { diff --git a/src/api/sealVault.ts b/src/api/sys/sealVault.ts similarity index 85% rename from src/api/sealVault.ts rename to src/api/sys/sealVault.ts index 92d945d..264f439 100644 --- a/src/api/sealVault.ts +++ b/src/api/sys/sealVault.ts @@ -1,4 +1,4 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; +import { appendAPIURL, getHeaders } from "../apiUtils"; export async function sealVault(): Promise { diff --git a/src/api/submitUnsealKey.ts b/src/api/sys/submitUnsealKey.ts similarity index 90% rename from src/api/submitUnsealKey.ts rename to src/api/sys/submitUnsealKey.ts index cc160f6..cda94aa 100644 --- a/src/api/submitUnsealKey.ts +++ b/src/api/sys/submitUnsealKey.ts @@ -1,4 +1,4 @@ -import { appendAPIURL } from "./apiUtils"; +import { appendAPIURL } from "../apiUtils"; export async function submitUnsealKey(key: string): Promise { const request = new Request(appendAPIURL("/v1/sys/unseal"), { diff --git a/src/api/addNewTOTP.ts b/src/api/totp/addNewTOTP.ts similarity index 82% rename from src/api/addNewTOTP.ts rename to src/api/totp/addNewTOTP.ts index 4d05421..3f836c1 100644 --- a/src/api/addNewTOTP.ts +++ b/src/api/totp/addNewTOTP.ts @@ -1,5 +1,5 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; -import { removeDoubleSlash } from "../utils"; +import { appendAPIURL, getHeaders } from "../apiUtils"; +import { removeDoubleSlash } from "../../utils"; export async function addNewTOTP(baseMount: string, parms: {name: string}): Promise { diff --git a/src/api/getTOTPCode.ts b/src/api/totp/getTOTPCode.ts similarity index 85% rename from src/api/getTOTPCode.ts rename to src/api/totp/getTOTPCode.ts index 539f17e..70eb660 100644 --- a/src/api/getTOTPCode.ts +++ b/src/api/totp/getTOTPCode.ts @@ -1,4 +1,4 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; +import { appendAPIURL, getHeaders } from "../apiUtils"; export async function getTOTPCode(baseMount: string, name: string): Promise { const request = diff --git a/src/api/getTOTPKeys.ts b/src/api/totp/getTOTPKeys.ts similarity index 76% rename from src/api/getTOTPKeys.ts rename to src/api/totp/getTOTPKeys.ts index 2d0bcab..6b654cc 100644 --- a/src/api/getTOTPKeys.ts +++ b/src/api/totp/getTOTPKeys.ts @@ -1,5 +1,5 @@ -import { DoesNotExistError } from "../types/internalErrors"; -import { appendAPIURL, getHeaders } from "./apiUtils"; +import { DoesNotExistError } from "../../types/internalErrors"; +import { appendAPIURL, getHeaders } from "../apiUtils"; export async function getTOTPKeys(baseMount: string): Promise { diff --git a/src/api/getTransitKeys.ts b/src/api/transit/getTransitKeys.ts similarity index 76% rename from src/api/getTransitKeys.ts rename to src/api/transit/getTransitKeys.ts index d2f9533..8bc8c2f 100644 --- a/src/api/getTransitKeys.ts +++ b/src/api/transit/getTransitKeys.ts @@ -1,5 +1,5 @@ -import { DoesNotExistError } from "../types/internalErrors"; -import { appendAPIURL, getHeaders } from "./apiUtils"; +import { DoesNotExistError } from "../../types/internalErrors"; +import { appendAPIURL, getHeaders } from "../apiUtils"; export async function getTransitKeys(baseMount: string): Promise { const request = new Request(appendAPIURL(`/v1/${baseMount}/keys?list=true`), { diff --git a/src/api/transitDecrypt.ts b/src/api/transit/transitDecrypt.ts similarity index 86% rename from src/api/transitDecrypt.ts rename to src/api/transit/transitDecrypt.ts index cc606a3..1a7ff5e 100644 --- a/src/api/transitDecrypt.ts +++ b/src/api/transit/transitDecrypt.ts @@ -1,5 +1,5 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; -import { removeDoubleSlash } from "../utils"; +import { appendAPIURL, getHeaders } from "../apiUtils"; +import { removeDoubleSlash } from "../../utils"; type DecryptionResult = { plaintext: string; diff --git a/src/api/transitEncrypt.ts b/src/api/transit/transitEncrypt.ts similarity index 86% rename from src/api/transitEncrypt.ts rename to src/api/transit/transitEncrypt.ts index 5949a35..0d7d271 100644 --- a/src/api/transitEncrypt.ts +++ b/src/api/transit/transitEncrypt.ts @@ -1,5 +1,5 @@ -import { appendAPIURL, getHeaders } from "./apiUtils"; -import { removeDoubleSlash } from "../utils"; +import { appendAPIURL, getHeaders } from "../apiUtils"; +import { removeDoubleSlash } from "../../utils"; type EncryptionResult = { ciphertext: string; diff --git a/src/main.ts b/src/main.ts index 9fc0483..468d33d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,7 +17,7 @@ import { changePage, renderPage, } from "./pageUtils"; -import { getSealStatus } from "./api/getSealStatus"; +import { getSealStatus } from "./api/sys/getSealStatus"; import { makeElement } from "./htmlUtils"; import { pageState } from "./globalPageState"; import { playground } from "./playground"; diff --git a/src/pageUtils.ts b/src/pageUtils.ts index 512d0af..e390a5e 100644 --- a/src/pageUtils.ts +++ b/src/pageUtils.ts @@ -1,7 +1,7 @@ import { Page } from "./types/Page"; import { PageState } from "./PageState"; -import { getSealStatus } from "./api/getSealStatus"; -import { lookupSelf } from "./api/lookupSelf"; +import { getSealStatus } from "./api/sys/getSealStatus"; +import { lookupSelf } from "./api/sys/lookupSelf"; import { makeElement } from "./htmlUtils"; import { pageState } from "./globalPageState"; import ClipboardJS from "clipboard"; diff --git a/src/pages/Home.ts b/src/pages/Home.ts index 7c9faa0..f6c009f 100644 --- a/src/pages/Home.ts +++ b/src/pages/Home.ts @@ -1,7 +1,7 @@ import { Page } from "../types/Page"; import { changePage, prePageChecks, setErrorText, setPageContent } from "../pageUtils"; -import { getMounts } from "../api/getMounts"; -import { lookupSelf } from "../api/lookupSelf"; +import { getMounts } from "../api/sys/getMounts"; +import { lookupSelf } from "../api/sys/lookupSelf"; import { makeElement } from "../htmlUtils"; import { pageState } from "../globalPageState"; import { sortedObjectMap } from "../utils"; diff --git a/src/pages/KeyValue/KeyValueDelete.ts b/src/pages/KeyValue/KeyValueDelete.ts index 74bcd03..f198b84 100644 --- a/src/pages/KeyValue/KeyValueDelete.ts +++ b/src/pages/KeyValue/KeyValueDelete.ts @@ -1,6 +1,6 @@ import { Page } from "../../types/Page"; import { changePage, setPageContent, setTitleElement } from "../../pageUtils"; -import { deleteSecret } from "../../api/deleteSecret"; +import { deleteSecret } from "../../api/kv/deleteSecret"; import { makeElement } from "../../htmlUtils"; import { pageState } from "../../globalPageState"; import i18next from 'i18next'; diff --git a/src/pages/KeyValue/KeyValueNew.ts b/src/pages/KeyValue/KeyValueNew.ts index 7a084a3..75ebcbb 100644 --- a/src/pages/KeyValue/KeyValueNew.ts +++ b/src/pages/KeyValue/KeyValueNew.ts @@ -1,6 +1,6 @@ import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; -import { createOrUpdateSecret } from "../../api/createOrUpdateSecret"; +import { createOrUpdateSecret } from "../../api/kv/createOrUpdateSecret"; import { makeElement } from "../../htmlUtils"; import { pageState } from "../../globalPageState"; import i18next from 'i18next'; diff --git a/src/pages/KeyValue/KeyValueSecret.ts b/src/pages/KeyValue/KeyValueSecret.ts index 2bdd594..a7c5197 100644 --- a/src/pages/KeyValue/KeyValueSecret.ts +++ b/src/pages/KeyValue/KeyValueSecret.ts @@ -1,12 +1,12 @@ import { CopyableInputBox } from "../../elements/CopyableInputBox"; import { Page } from "../../types/Page"; import { changePage, setPageContent, setTitleElement } from "../../pageUtils"; -import { getCapabilities } from "../../api/getCapabilities"; -import { getSecret } from "../../api/getSecret"; +import { getCapabilities } from "../../api/sys/getCapabilities"; +import { getSecret } from "../../api/kv/getSecret"; import { makeElement } from "../../htmlUtils"; import { pageState } from "../../globalPageState"; import { sortedObjectMap } from "../../utils"; -import { undeleteSecret } from "../../api/undeleteSecret"; +import { undeleteSecret } from "../../api/kv/undeleteSecret"; import Prism from "prismjs"; import i18next from 'i18next'; diff --git a/src/pages/KeyValue/KeyValueSecretsEdit.ts b/src/pages/KeyValue/KeyValueSecretsEdit.ts index 9a00f10..b4bb3f5 100644 --- a/src/pages/KeyValue/KeyValueSecretsEdit.ts +++ b/src/pages/KeyValue/KeyValueSecretsEdit.ts @@ -1,8 +1,8 @@ import { CodeJar } from "codejar"; import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; -import { createOrUpdateSecret } from "../../api/createOrUpdateSecret"; -import { getSecret } from "../../api/getSecret"; +import { createOrUpdateSecret } from "../../api/kv/createOrUpdateSecret"; +import { getSecret } from "../../api/kv/getSecret"; import { makeElement } from "../../htmlUtils"; import { pageState } from "../../globalPageState"; import { sortedObjectMap, verifyJSONString } from "../../utils"; diff --git a/src/pages/KeyValue/KeyValueVersions.ts b/src/pages/KeyValue/KeyValueVersions.ts index f113eaf..1209ce2 100644 --- a/src/pages/KeyValue/KeyValueVersions.ts +++ b/src/pages/KeyValue/KeyValueVersions.ts @@ -1,6 +1,6 @@ import { Page } from "../../types/Page"; import { changePage, setPageContent, setTitleElement } from "../../pageUtils"; -import { getSecretMetadata } from "../../api/getSecretMetadata"; +import { getSecretMetadata } from "../../api/kv/getSecretMetadata"; import { makeElement } from "../../htmlUtils"; import { objectToMap } from "../../utils"; import { pageState } from "../../globalPageState"; diff --git a/src/pages/KeyValue/KeyValueView.ts b/src/pages/KeyValue/KeyValueView.ts index af129fa..96b634b 100644 --- a/src/pages/KeyValue/KeyValueView.ts +++ b/src/pages/KeyValue/KeyValueView.ts @@ -1,7 +1,7 @@ import { DoesNotExistError } from "../../types/internalErrors"; import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; -import { getSecrets } from "../../api/getSecrets"; +import { getSecrets } from "../../api/kv/getSecrets"; import { makeElement } from "../../htmlUtils"; import { pageState } from "../../globalPageState"; import i18next from 'i18next'; diff --git a/src/pages/Login.ts b/src/pages/Login.ts index 5f2f19d..46c57fe 100644 --- a/src/pages/Login.ts +++ b/src/pages/Login.ts @@ -2,10 +2,10 @@ import { Margin } from "../elements/Margin"; import { MarginInline } from "../elements/MarginInline"; import { Page } from "../types/Page"; import { changePage, setErrorText, setPageContent } from "../pageUtils"; -import { lookupSelf } from "../api/lookupSelf"; +import { lookupSelf } from "../api/sys/lookupSelf"; import { makeElement } from "../htmlUtils"; import { pageState } from "../globalPageState"; -import { usernameLogin } from "../api/usernameLogin"; +import { usernameLogin } from "../api/auth/usernameLogin"; import i18next from 'i18next'; export class LoginPage extends Page { diff --git a/src/pages/Me.ts b/src/pages/Me.ts index 47b416b..fd525eb 100644 --- a/src/pages/Me.ts +++ b/src/pages/Me.ts @@ -1,10 +1,10 @@ import { Page } from "../types/Page"; import { addClipboardNotifications, changePage, prePageChecks, setErrorText, setPageContent } from "../pageUtils"; -import { getCapabilitiesPath } from "../api/getCapabilities"; +import { getCapabilitiesPath } from "../api/sys/getCapabilities"; import { makeElement } from "../htmlUtils"; import { pageState } from "../globalPageState"; -import { renewSelf } from "../api/renewSelf"; -import { sealVault } from "../api/sealVault"; +import { renewSelf } from "../api/sys/renewSelf"; +import { sealVault } from "../api/sys/sealVault"; import ClipboardJS from "clipboard"; import i18next from 'i18next'; diff --git a/src/pages/TOTP/NewTOTP.ts b/src/pages/TOTP/NewTOTP.ts index 1e7d34b..ec55b13 100644 --- a/src/pages/TOTP/NewTOTP.ts +++ b/src/pages/TOTP/NewTOTP.ts @@ -1,7 +1,7 @@ import { Margin } from "../../elements/Margin"; import { MarginInline } from "../../elements/MarginInline"; import { Page } from "../../types/Page"; -import { addNewTOTP } from "../../api/addNewTOTP"; +import { addNewTOTP } from "../../api/totp/addNewTOTP"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; import { makeElement } from "../../htmlUtils"; import { pageState } from "../../globalPageState"; diff --git a/src/pages/TOTP/TOTPView.ts b/src/pages/TOTP/TOTPView.ts index 7115196..ebdc226 100644 --- a/src/pages/TOTP/TOTPView.ts +++ b/src/pages/TOTP/TOTPView.ts @@ -2,8 +2,8 @@ import { CopyableInputBox } from "../../elements/CopyableInputBox"; import { DoesNotExistError } from "../../types/internalErrors"; import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; -import { getTOTPCode } from "../../api/getTOTPCode"; -import { getTOTPKeys } from "../../api/getTOTPKeys"; +import { getTOTPCode } from "../../api/totp/getTOTPCode"; +import { getTOTPKeys } from "../../api/totp/getTOTPKeys"; import { makeElement } from "../../htmlUtils"; import { objectToMap } from "../../utils"; import { pageState } from "../../globalPageState"; diff --git a/src/pages/Transit/TransitDecrypt.ts b/src/pages/Transit/TransitDecrypt.ts index ae13ba5..363e29f 100644 --- a/src/pages/Transit/TransitDecrypt.ts +++ b/src/pages/Transit/TransitDecrypt.ts @@ -5,7 +5,7 @@ import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; import { fileToBase64, makeElement } from "../../htmlUtils"; import { pageState } from "../../globalPageState"; -import { transitDecrypt } from "../../api/transitDecrypt"; +import { transitDecrypt } from "../../api/transit/transitDecrypt"; import UIkit from 'uikit/dist/js/uikit.min.js'; import i18next from "i18next"; diff --git a/src/pages/Transit/TransitEncrypt.ts b/src/pages/Transit/TransitEncrypt.ts index b8d3bb9..b14844f 100644 --- a/src/pages/Transit/TransitEncrypt.ts +++ b/src/pages/Transit/TransitEncrypt.ts @@ -5,7 +5,7 @@ import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; import { fileToBase64, makeElement } from "../../htmlUtils"; import { pageState } from "../../globalPageState"; -import { transitEncrypt } from "../../api/transitEncrypt"; +import { transitEncrypt } from "../../api/transit/transitEncrypt"; import UIkit from 'uikit/dist/js/uikit.min.js'; import i18next from "i18next"; diff --git a/src/pages/Transit/TransitView.ts b/src/pages/Transit/TransitView.ts index 72deefb..c2da5cb 100644 --- a/src/pages/Transit/TransitView.ts +++ b/src/pages/Transit/TransitView.ts @@ -1,7 +1,7 @@ import { DoesNotExistError } from "../../types/internalErrors"; import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; -import { getTransitKeys } from "../../api/getTransitKeys"; +import { getTransitKeys } from "../../api/transit/getTransitKeys"; import { makeElement } from "../../htmlUtils"; import { pageState } from "../../globalPageState"; import i18next from 'i18next'; diff --git a/src/pages/Unseal.ts b/src/pages/Unseal.ts index 1dc84ad..b7351e3 100644 --- a/src/pages/Unseal.ts +++ b/src/pages/Unseal.ts @@ -1,10 +1,10 @@ import { MarginInline } from "../elements/MarginInline"; import { Page } from "../types/Page"; import { QRScanner, QRScannerType } from "../elements/QRScanner"; -import { SealStatusType, getSealStatus } from "../api/getSealStatus"; +import { SealStatusType, getSealStatus } from "../api/sys/getSealStatus"; import { changePage, setErrorText, setPageContent } from "../pageUtils"; import { makeElement } from "../htmlUtils"; -import { submitUnsealKey } from "../api/submitUnsealKey"; +import { submitUnsealKey } from "../api/sys/submitUnsealKey"; import i18next from 'i18next';