Move last API functions into common 'components' package

This commit is contained in:
Brandon Thomas committed 2023-01-25 22:31:57 -05:00
1 parent 517b5dc68b
commit c70b93d486
44 files changed
+37 -37

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react";
import { TtsCategory } from "./v2/api/category/ListTtsCategories";
import { TtsCategory } from "@storyteller/components/src/api/category/ListTtsCategories";
import { TtsModelListItem } from "@storyteller/components/src/api/tts/ListTtsModels";
import { App } from "./App";
import { GetComputedTtsCategoryAssignmentsSuccessResponse } from "@storyteller/components/src/api/category/GetComputedTtsCategoryAssignments";
@@ -6,9 +6,9 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import React from "react";
import { Link } from "react-router-dom";
import { WebUrl } from "../../../common/WebUrl";
import { TtsCategory } from "../../api/category/ListTtsCategories";
import { TtsModelCategory } from "../../api/category/ListTtsCategoriesForModel";
import { ModerationTtsCategory } from "../../api/moderation/category/ListTtsCategoriesForModeration";
import { TtsCategory } from "@storyteller/components/src/api/category/ListTtsCategories";
import { TtsModelCategory } from "@storyteller/components/src/api/category/ListTtsCategoriesForModel";
import { ModerationTtsCategory } from "@storyteller/components/src/api/moderation/category/ListTtsCategoriesForModeration";
export interface Props {
// This is a list of categories in order: [grandparent/root, parent, child/leaf]
@@ -7,7 +7,7 @@ import {
CreateCategoryIsError,
CreateCategoryIsSuccess,
CreateCategoryRequest,
} from "../../../api/category/CreateCategory";
} from "@storyteller/components/src/api/category/CreateCategory";
import { BackLink } from "../../_common/BackLink";
import { WebUrl } from "../../../../common/WebUrl";
import { motion } from "framer-motion";
@@ -10,7 +10,7 @@ import {
Leaderboard,
LeaderboardEntryForList,
LeaderboardLookupError,
} from "../../../api/misc/GetLeaderboard";
} from "@storyteller/components/src/api/leaderboard/GetLeaderboard";
import { DiscordLink2 } from "@storyteller/components/src/elements/DiscordLink2";
import { motion } from "framer-motion";
import { container, item, panel } from "../../../../data/animation";
@@ -1,11 +1,11 @@
import React, { useCallback, useEffect, useState } from 'react';
import { BackLink } from '../../../_common/BackLink';
import { Category, GetCategory, GetCategoryIsError, GetCategoryIsOk } from '../../../../api/category/GetCategory';
import { Category, GetCategory, GetCategoryIsError, GetCategoryIsOk } from '@storyteller/components/src/api/category/GetCategory';
import { WebUrl } from '../../../../../common/WebUrl';
import { Link, useHistory } from 'react-router-dom';
import { SessionWrapper } from '@storyteller/components/src/session/SessionWrapper';
import { useParams } from 'react-router-dom';
import { SetCategoryDeletionState, SetCategoryDeletionStateIsError, SetCategoryDeletionStateIsSuccess } from '../../../../api/moderation/category/SetCategoryDeletionState';
import { SetCategoryDeletionState, SetCategoryDeletionStateIsError, SetCategoryDeletionStateIsSuccess } from '@storyteller/components/src/api/moderation/category/SetCategoryDeletionState';
interface Props {
sessionWrapper: SessionWrapper,
@@ -1,12 +1,12 @@
import React, { useCallback, useEffect, useState } from 'react';
import { BackLink } from '../../../_common/BackLink';
import { Category, GetCategory, GetCategoryIsError, GetCategoryIsOk } from '../../../../api/category/GetCategory';
import { Category, GetCategory, GetCategoryIsError, GetCategoryIsOk } from '@storyteller/components/src/api/category/GetCategory';
import { WebUrl } from '../../../../../common/WebUrl';
import { Link, useHistory } from 'react-router-dom';
import { SessionWrapper } from '@storyteller/components/src/session/SessionWrapper';
import { useParams } from 'react-router-dom';
import { EditCategory, EditCategoryIsError, EditCategoryIsSuccess, EditCategoryRequest } from '../../../../api/moderation/category/EditCategory';
import { ListTtsCategories, ListTtsCategoriesIsError, ListTtsCategoriesIsOk, TtsCategory } from '../../../../api/category/ListTtsCategories';
import { EditCategory, EditCategoryIsError, EditCategoryIsSuccess, EditCategoryRequest } from '@storyteller/components/src/api/moderation/category/EditCategory';
import { ListTtsCategories, ListTtsCategoriesIsError, ListTtsCategoriesIsOk, TtsCategory } from '@storyteller/components/src/api/category/ListTtsCategories';
import { CategoryBreadcrumb } from '../../../_common/CategoryBreadcrumb';
interface Props {
@@ -3,7 +3,7 @@ import { SessionWrapper } from '@storyteller/components/src/session/SessionWrapp
import { Gravatar } from '@storyteller/components/src/elements/Gravatar';
import { WebUrl } from '../../../../../common/WebUrl';
import { BackLink } from '../../../_common/BackLink';
import { ListTtsCategoriesForModeration, ListTtsCategoriesForModerationIsError, ListTtsCategoriesForModerationIsOk, ListTtsCategoriesTriState, ModerationTtsCategory } from '../../../../api/moderation/category/ListTtsCategoriesForModeration';
import { ListTtsCategoriesForModeration, ListTtsCategoriesForModerationIsError, ListTtsCategoriesForModerationIsOk, ListTtsCategoriesTriState, ModerationTtsCategory } from '@storyteller/components/src/api/moderation/category/ListTtsCategoriesForModeration';
import { Link } from 'react-router-dom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faBox, faBoxOpen, faLock } from '@fortawesome/free-solid-svg-icons';
@@ -5,11 +5,11 @@ import { BackLink } from "../../../_common/BackLink";
import {
GetTtsInferenceStats,
GetTtsInferenceStatsIsOk,
} from "../../../../api/moderation/GetTtsInferenceStats";
} from "@storyteller/components/src/api/moderation/stats/GetTtsInferenceStats";
import {
GetW2lInferenceStats,
GetW2lInferenceStatsIsOk,
} from "../../../../api/moderation/GetW2lInferenceStats";
} from "@storyteller/components/src/api/moderation/stats/GetW2lInferenceStats";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faBomb, faRedo } from "@fortawesome/free-solid-svg-icons";
import {
@@ -5,7 +5,7 @@ import { Gravatar } from '@storyteller/components/src/elements/Gravatar';
import { formatDistance } from 'date-fns';
import { WebUrl } from '../../../../../common/WebUrl';
import { BackLink } from '../../../_common/BackLink';
import { GetPendingW2lTemplates, GetPendingW2lTemplatesIsOk, PendingW2lTemplatesEntryForList } from '../../../../api/moderation/GetPendingW2lTemplates';
import { GetPendingW2lTemplates, GetPendingW2lTemplatesIsOk, PendingW2lTemplatesEntryForList } from '@storyteller/components/src/api/moderation/w2l/GetPendingW2lTemplates';
import { PhotoVideoIcon } from '../../../_icons/PhotoVideoIcon';
interface Props {
@@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { SessionWrapper } from '@storyteller/components/src/session/SessionWrapper';
import { Gravatar } from '@storyteller/components/src/elements/Gravatar';
import { GetUserList, GetUserListIsOk, UserForList } from '../../../../api/moderation/GetUserList';
import { GetUserList, GetUserListIsOk, UserForList } from '@storyteller/components/src/api/moderation/user/GetUserList';
import { formatDistance } from 'date-fns';
import { WebUrl } from '../../../../../common/WebUrl';
import { BackLink } from '../../../_common/BackLink';
@@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useState } from 'react';
import { SessionWrapper } from '@storyteller/components/src/session/SessionWrapper';
import { WebUrl } from '../../../../../common/WebUrl';
import { BackLink } from '../../../_common/BackLink';
import { GetVoiceInventoryStats, GetVoiceInventoryStatsIsOk } from '../../../../api/moderation/GetVoiceInventoryStats';
import { GetVoiceInventoryStats, GetVoiceInventoryStatsIsOk } from '@storyteller/components/src/api/moderation/stats/GetVoiceInventoryStats';
interface Props {
sessionWrapper: SessionWrapper,
@@ -7,7 +7,7 @@ import {
GetUserByUsername,
GetUserByUsernameIsOk,
User,
} from "../../../../api/user/GetUserByUsername";
} from "@storyteller/components/src/api/user/GetUserByUsername";
import { BackLink } from "../../../_common/BackLink";
import { motion } from "framer-motion";
import { container, item, panel } from "../../../../../data/animation";
@@ -34,7 +34,7 @@ import {
GetUserByUsernameIsOk,
User,
UserLookupError,
} from "../../../../api/user/GetUserByUsername";
} from "@storyteller/components/src/api/user/GetUserByUsername";
import { format } from "date-fns";
import { WebUrl } from "../../../../../common/WebUrl";
import { container, item, panel } from "../../../../../data/animation";
@@ -3,7 +3,7 @@ import {
AssignTtsCategory,
AssignTtsCategoryIsError,
AssignTtsCategoryIsOk,
} from "../../../../api/category/AssignTtsCategory";
} from "@storyteller/components/src/api/category/AssignTtsCategory";
import { BackLink } from "../../../_common/BackLink";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { WebUrl } from "../../../../../common/WebUrl";
@@ -19,13 +19,13 @@ import {
ListTtsCategoriesIsError,
ListTtsCategoriesIsOk,
TtsCategory,
} from "../../../../api/category/ListTtsCategories";
} from "@storyteller/components/src/api/category/ListTtsCategories";
import {
ListTtsCategoriesForModel,
ListTtsCategoriesForModelIsError,
ListTtsCategoriesForModelIsOk,
TtsModelCategory,
} from "../../../../api/category/ListTtsCategoriesForModel";
} from "@storyteller/components/src/api/category/ListTtsCategoriesForModel";
import { SessionWrapper } from "@storyteller/components/src/session/SessionWrapper";
import {
faExclamationCircle,
@@ -28,7 +28,7 @@ import {
ListTtsCategories,
ListTtsCategoriesIsError,
ListTtsCategoriesIsOk,
} from "../../../../api/category/ListTtsCategories";
} from "@storyteller/components/src/api/category/ListTtsCategories";
import { TtsCategoryType } from "../../../../../AppWrapper";
import { SelectSearch } from "./search/SelectSearch";
import { LanguageNotice } from "./notices/LanguageNotice";
@@ -20,20 +20,20 @@ import {
TtsModel,
TtsModelLookupError,
} from "@storyteller/components/src/api/tts/GetTtsModel";
import { GetTtsModelUseCount } from "../../../../api/tts/GetTtsModelUseCount";
import { GetTtsModelUseCount } from "@storyteller/components/src/api/tts/GetTtsModelUseCount";
import { BackLink } from "../../../_common/BackLink";
import {
ListTtsCategoriesForModel,
ListTtsCategoriesForModelIsError,
ListTtsCategoriesForModelIsOk,
TtsModelCategory,
} from "../../../../api/category/ListTtsCategoriesForModel";
} from "@storyteller/components/src/api/category/ListTtsCategoriesForModel";
import {
ListTtsCategories,
ListTtsCategoriesIsError,
ListTtsCategoriesIsOk,
TtsCategory,
} from "../../../../api/category/ListTtsCategories";
} from "@storyteller/components/src/api/category/ListTtsCategories";
import { CategoryBreadcrumb } from "../../../_common/CategoryBreadcrumb";
import { DiscordLink } from "@storyteller/components/src/elements/DiscordLink";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@@ -2,7 +2,7 @@ import React from "react";
import WaveSurfer from "wavesurfer.js";
import { useEffect, useState } from "react";
import { BucketConfig } from "@storyteller/components/src/api/BucketConfig";
import { TtsResult } from "../../../../api/tts/GetTtsResult";
import { TtsResult } from "@storyteller/components/src/api/tts/GetTtsResult";
import { PlayIcon } from "../../../_icons/PlayIcon";
import { PauseIcon } from "../../../_icons/PauseIcon";
import { RepeatIcon } from "../../../_icons/RepeatIcon";
@@ -13,7 +13,7 @@ import {
GetTtsResultIsOk,
TtsResult,
TtsResultLookupError,
} from "../../../../api/tts/GetTtsResult";
} from "@storyteller/components/src/api/tts/GetTtsResult";
import { TtsResultAudioPlayerFc } from "./TtsResultAudioPlayerFc";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {
@@ -7,7 +7,7 @@ import {
GetW2lResult,
GetW2lResultIsOk,
W2lResult,
} from "../../../../api/w2l/GetW2lResult";
} from "@storyteller/components/src/api/w2l/GetW2lResult";
import { motion } from "framer-motion";
import { container, item, panel } from "../../../../../data/animation";
@@ -13,7 +13,7 @@ import {
GetW2lResultIsOk,
W2lResult,
W2lResultLookupError,
} from "../../../../api/w2l/GetW2lResult";
} from "@storyteller/components/src/api/w2l/GetW2lResult";
import { MetaTags } from "../../../../../common/MetaTags";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faDownload, faEdit, faTrash } from "@fortawesome/free-solid-svg-icons";
@@ -7,8 +7,8 @@ import {
GetW2lTemplate,
GetW2lTemplateIsOk,
W2lTemplate,
} from "../../../../api/w2l/GetW2lTemplate";
import { GetW2lTemplateUseCount } from "../../../../api/w2l/GetW2lTemplateUseCount";
} from "@storyteller/components/src/api/w2l/GetW2lTemplate";
import { GetW2lTemplateUseCount } from "@storyteller/components/src/api/w2l/GetW2lTemplateUseCount";
import { BackLink } from "../../../_common/BackLink";
import { motion } from "framer-motion";
import { container, item, panel } from "../../../../../data/animation";
@@ -7,8 +7,8 @@ import {
GetW2lTemplate,
GetW2lTemplateIsOk,
W2lTemplate,
} from "../../../../api/w2l/GetW2lTemplate";
import { GetW2lTemplateUseCount } from "../../../../api/w2l/GetW2lTemplateUseCount";
} from "@storyteller/components/src/api/w2l/GetW2lTemplate";
import { GetW2lTemplateUseCount } from "@storyteller/components/src/api/w2l/GetW2lTemplateUseCount";
import { BackLink } from "../../../_common/BackLink";
import { motion } from "framer-motion";
import { container, item, panel } from "../../../../../data/animation";
@@ -9,7 +9,7 @@ import {
GetW2lTemplate,
GetW2lTemplateIsOk,
W2lTemplate,
} from "../../../../api/w2l/GetW2lTemplate";
} from "@storyteller/components/src/api/w2l/GetW2lTemplate";
import { BackLink } from "../../../_common/BackLink";
import { motion } from "framer-motion";
import { container, item, panel } from "../../../../../data/animation";
@@ -18,8 +18,8 @@ import {
GetW2lTemplateIsOk,
W2lTemplate,
W2lTemplateLookupError,
} from "../../../../api/w2l/GetW2lTemplate";
import { GetW2lTemplateUseCount } from "../../../../api/w2l/GetW2lTemplateUseCount";
} from "@storyteller/components/src/api/w2l/GetW2lTemplate";
import { GetW2lTemplateUseCount } from "@storyteller/components/src/api/w2l/GetW2lTemplateUseCount";
import { BackLink } from "../../../_common/BackLink";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faEdit, faTrash } from "@fortawesome/free-solid-svg-icons";