Skip to content

Commit

Permalink
move type back
Browse files Browse the repository at this point in the history
  • Loading branch information
thewbuk committed Jul 31, 2024
1 parent 9a0d561 commit dd15357
Show file tree
Hide file tree
Showing 25 changed files with 27 additions and 36 deletions.
4 changes: 2 additions & 2 deletions packages/toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@instill-ai/toolkit",
"version": "0.97.0-rc.28",
"version": "0.97.0-rc.29",
"description": "Instill AI's frontend toolkit",
"repository": "https://github.com/instill-ai/design-system.git",
"bugs": "https://github.com/instill-ai/design-system/issues",
Expand Down Expand Up @@ -170,4 +170,4 @@
"eslint --cache --fix"
]
}
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMutation } from "@tanstack/react-query";

import { KnowledgeBase } from "../../../../../sdk/src/knowledge/types";
import { createInstillAxiosClient } from "../../vdp-sdk/helper";
import { KnowledgeBase } from "./types";

async function createKnowledgeBaseMutation({
payload,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMutation } from "@tanstack/react-query";

import { KnowledgeBase } from "../../../../../sdk/src/knowledge/types";
import { createInstillAxiosClient } from "../../vdp-sdk/helper";
import { KnowledgeBase } from "./types";

async function deleteKnowledgeBaseMutation({
ownerId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { useQuery } from "@tanstack/react-query";

import { Nullable } from "@instill-ai/toolkit";

import { File } from "../../../../../sdk/src/knowledge/types";
import { createInstillAxiosClient } from "../../vdp-sdk/helper";
import { File } from "./types";

export function useGetFileDetails({
fileUid,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQuery } from "@tanstack/react-query";

import { KnowledgeBase } from "../../../../../sdk/src/knowledge/types";
import { createInstillAxiosClient } from "../../vdp-sdk/helper";
import { KnowledgeBase } from "./types";

async function getKnowledgeBases({
ownerId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { useQuery } from "@tanstack/react-query";

import { Nullable } from "@instill-ai/toolkit";

import { File } from "../../../../../sdk/src/knowledge/types";
import { createInstillAxiosClient } from "../../vdp-sdk/helper";
import { File } from "./types";

export function useListKnowledgeBaseFiles({
namespaceId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";

import { Nullable } from "@instill-ai/toolkit";

import { File } from "../../../../../sdk/src/knowledge/types";
import { createInstillAxiosClient } from "../../vdp-sdk/helper";
import { File } from "./types";

export function useProcessKnowledgeBaseFiles() {
const queryClient = useQueryClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";

import { Nullable } from "@instill-ai/toolkit";

import { Chunk } from "../../../../../sdk/src/knowledge/types";
import { createInstillAxiosClient } from "../../vdp-sdk/helper";
import { Chunk } from "./types";

export function useUpdateChunk() {
const queryClient = useQueryClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";

import { Nullable } from "@instill-ai/toolkit";

import { File } from "../../../../../sdk/src/knowledge/types";
import { createInstillAxiosClient } from "../../vdp-sdk/helper";
import { File } from "./types";

export function useUploadKnowledgeBaseFile() {
const queryClient = useQueryClient();
Expand Down
8 changes: 1 addition & 7 deletions packages/toolkit/src/view/knowledge/KnowledgeBaseView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Nullable } from "@instill-ai/toolkit";
import {
GeneralAppPageProp,
InstillStore,
useAuthenticatedUser,
useInstillStore,
useShallow,
} from "../../lib";
Expand All @@ -14,7 +13,7 @@ import {
useGetKnowledgeBases,
useListKnowledgeBaseFiles,
} from "../../lib/react-query-service/knowledge";
import { KnowledgeBase } from "../../../../sdk/src/knowledge/types";
import { KnowledgeBase } from "../../lib/react-query-service/knowledge/types";
import { DeleteKnowledgeBaseNotification, CreditUsageFileNotification } from "./components/notifications";
import { Sidebar } from "./components";
import { CatalogFilesTab, ChunkTab, ImageTab, KnowledgeBaseTab, MarkdownTab, RetrieveTestTab, UploadExploreTab } from "./components/tabs";
Expand Down Expand Up @@ -47,11 +46,6 @@ export const KnowledgeBaseView = (props: KnowledgeBaseViewProps) => {
})),
);

const me = useAuthenticatedUser({
enabled: enabledQuery,
accessToken,
});

const deleteKnowledgeBase = useDeleteKnowledgeBase();
const { refetch: refetchKnowledgeBases } = useGetKnowledgeBases({
accessToken,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from "react";

import { Icons, Separator, Switch, Tag } from "@instill-ai/design-system";

import { Chunk } from "../../../../../sdk/src/knowledge/types";
import { Chunk } from "../../../lib/react-query-service/knowledge/types";

type ChunkCardProps = {
chunk: Chunk;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {

import { InstillStore, useInstillStore, useShallow } from "../../../lib";
import { useListChunks } from "../../../lib/react-query-service/knowledge";
import { KnowledgeBase } from "../../../../../sdk/src/knowledge/types";
import { KnowledgeBase } from "../../../lib/react-query-service/knowledge/types";
import { EditKnowledgeDialog } from "./EditKnowledgeDialog";

type EditKnowledgeDialogData = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Chunk,
KnowledgeBase,
KnowledgeFile,
} from "../../../../../sdk/src/knowledge/types";
} from "../../../lib/react-query-service/knowledge/types";
import ChunkCard from "./ChunkCard";

type FileChunksProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { File, FileStatus } from "../../../../../sdk/src/knowledge/types";
import { File, FileStatus } from "../../../lib/react-query-service/knowledge/types";
import { FileTableRow } from "./FileTableRow";
import { FileTableHeader } from "./FileTableHeader";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { Button, Icons } from "@instill-ai/design-system";
import { File } from "../../../../../sdk/src/knowledge/types";
import { File } from "../../../lib/react-query-service/knowledge/types";

type FileTableHeaderProps = {
sortConfig: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { Button, Icons } from "@instill-ai/design-system";
import { File } from "../../../../../sdk/src/knowledge/types";
import { File } from "../../../lib/react-query-service/knowledge/types";
import { StatusTag } from "./StatusTag";

type FileTableRowProps = {
Expand All @@ -18,9 +18,8 @@ export const FileTableRow: React.FC<FileTableRowProps> = ({
}) => {
return (
<div
className={`grid h-[72px] grid-cols-[minmax(0,3fr)_1fr_1fr_1fr_1fr_2fr_1fr] items-center bg-semantic-bg-primary border border-semantic-bg-line ${
index !== 0 ? "" : ""
}`}
className={`grid h-[72px] grid-cols-[minmax(0,3fr)_1fr_1fr_1fr_1fr_2fr_1fr] items-center bg-semantic-bg-primary border border-semantic-bg-line ${index !== 0 ? "" : ""
}`}
>
<div
className="flex items-center justify-center px-4 truncate cursor-pointer text-semantic-bg-secondary-alt-primary product-body-text-3-regular"
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/view/knowledge/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useRouter } from "next/navigation";

import { Icons } from "@instill-ai/design-system";

import { KnowledgeBase } from "../../../../../sdk/src/knowledge/types";
import { KnowledgeBase } from "../../../lib/react-query-service/knowledge/types";

type SidebarProps = {
activeTab: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
useDeleteKnowledgeBaseFile,
useListKnowledgeBaseFiles,
} from "../../../../lib/react-query-service/knowledge";
import { File, KnowledgeBase } from "../../../../../../sdk/src/knowledge/types";
import { File, KnowledgeBase } from "../../../../lib/react-query-service/knowledge/types";
import FileDetailsOverlay from "../FileDetailsOverlay";
import { DELETE_FILE_TIMEOUT } from "../lib/undoDeleteTime";
import { DeleteFileNotification } from "../notifications";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from "../../../../lib/react-query-service/knowledge";
import FileChunks from "../FileChunks";
import FileDetailsOverlay from "../FileDetailsOverlay";
import { Chunk, KnowledgeBase, KnowledgeFile } from "../../../../../../sdk/src/knowledge/types";
import { Chunk, KnowledgeBase, KnowledgeFile } from "../../../../lib/react-query-service/knowledge/types";

type ChunkTabProps = {
knowledgeBase: KnowledgeBase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Tag,
} from "@instill-ai/design-system";

import { KnowledgeBase } from "../../../../../../sdk/src/knowledge/types";
import { KnowledgeBase } from "../../../../lib/react-query-service/knowledge/types";
import MetadataPreview from "../MetadataPreview";

type ImageTabProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Separator, Skeleton } from "@instill-ai/design-system";

import {
InstillStore,
useAuthenticatedUser,
useInstillStore,
useShallow,
} from "../../../../lib";
Expand All @@ -14,7 +13,7 @@ import {
useGetKnowledgeBases,
useUpdateKnowledgeBase,
} from "../../../../lib/react-query-service/knowledge";
import { KnowledgeBase } from "../../../../../../sdk/src/knowledge/types";
import { KnowledgeBase } from "../../../../lib/react-query-service/knowledge/types";
import { CreateKnowledgeBaseCard } from "../CreateKnowledgeBaseCard";
import { CreateKnowledgeDialog } from "../CreateKnowledgeDialog";
import { KnowledgeBaseCard } from "../KnowledgeBaseCard";
Expand Down Expand Up @@ -63,7 +62,6 @@ export const KnowledgeBaseTab = ({
}))
);

console.log("selectedNamespace", selectedNamespace);
const {
data: knowledgeBases,
isLoading,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Textarea,
} from "@instill-ai/design-system";

import { KnowledgeBase } from "../../../../../../sdk/src/knowledge/types";
import { KnowledgeBase } from "../../../../lib/react-query-service/knowledge/types";

type MarkdownTabProps = {
knowledgeBase: KnowledgeBase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Separator } from "@instill-ai/design-system";
import { CodeBlock } from "../../../../components";
import { CodeString } from "../../../../components/CodeString";
import { defaultCodeSnippetStyles } from "../../../../constant";
import { KnowledgeBase } from "../../../../../../sdk/src/knowledge/types";
import { KnowledgeBase } from "../../../../lib/react-query-service/knowledge/types";

type RetrieveTestTabProps = {
knowledgeBase: KnowledgeBase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
useProcessKnowledgeBaseFiles,
useUploadKnowledgeBaseFile,
} from "../../../../lib/react-query-service/knowledge";
import { KnowledgeBase } from "../../../../../../sdk/src/knowledge/types";
import { KnowledgeBase } from "../../../../lib/react-query-service/knowledge/types";
// import FilePreview from "./FilePreview";
import { IncorrectFormatFileNotification, DuplicateFileNotification, FileSizeNotification } from "../notifications";
import { FILE_ERROR_TIMEOUT } from "../lib/undoDeleteTime";
Expand Down

0 comments on commit dd15357

Please sign in to comment.