Skip to content

Commit

Permalink
remove tsr api contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnmclean committed Dec 20, 2024
1 parent d7188cb commit f1387f0
Show file tree
Hide file tree
Showing 23 changed files with 4 additions and 457 deletions.
51 changes: 0 additions & 51 deletions apps/sovoli.com/src/api/query-client.ts

This file was deleted.

20 changes: 0 additions & 20 deletions apps/sovoli.com/src/api/react.tsx

This file was deleted.

43 changes: 0 additions & 43 deletions apps/sovoli.com/src/api/tsr.ts

This file was deleted.

10 changes: 1 addition & 9 deletions apps/sovoli.com/src/app/(settings)/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import { auth, signIn } from "@sovoli/auth";

import { getQueryClientRsc } from "~/api/query-client";
import { tsrReactQuery } from "~/api/tsr";

export default async function SettingsPage() {
const client = tsrReactQuery.initQueryClient(getQueryClientRsc());
await client.prefetchQuery({
queryKey: ["me"],
});

export default function SettingsPage() {
return (
<div className="min-h-screen dark:bg-black">
<h1>Settings</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ export async function getKnowledgeBySlug({
'title', ${schema.Knowledge.title},
'description', ${schema.Knowledge.description},
'content', ${schema.Knowledge.content},
'context', ${schema.Knowledge.context},
'contextDescription', ${schema.Knowledge.contextDescription},
'type', ${schema.Knowledge.type},
'isPublic', ${schema.Knowledge.isPublic},
'createdAt', ${schema.Knowledge.createdAt},
Expand Down
3 changes: 1 addition & 2 deletions apps/sovoli.com/src/app/api/v1/knowledge/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ export async function POST(request: NextRequest) {
const bodyRaw = await request.json();
const body = PostKnowledgeSchemaRequest.parse(bodyRaw);

const { knowledge, authToken } = await createKnowledge({
const { knowledge } = await createKnowledge({
knowledge: body,
authUserId: user.id,
});

const response = {
...knowledge,
url: `${getBaseUrl()}/${user.username}/${knowledge.slug}`,
authToken,
};
return NextResponse.json(response, { status: 200 });
} catch {
Expand Down
68 changes: 0 additions & 68 deletions apps/sovoli.com/src/app/api/v1/openapi/chatgpt/openApiDocument.ts

This file was deleted.

5 changes: 0 additions & 5 deletions apps/sovoli.com/src/app/api/v1/openapi/chatgpt/route.ts

This file was deleted.

68 changes: 0 additions & 68 deletions apps/sovoli.com/src/app/api/v1/openapi/openApiDocument.ts

This file was deleted.

5 changes: 0 additions & 5 deletions apps/sovoli.com/src/app/api/v1/openapi/route.ts

This file was deleted.

11 changes: 0 additions & 11 deletions apps/sovoli.com/src/app/api/v1/swagger/route.ts

This file was deleted.

3 changes: 1 addition & 2 deletions apps/sovoli.com/src/app/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { ThemeProvider } from "next-themes";
import posthog from "posthog-js";
import { PostHogProvider } from "posthog-js/react";

import { QueryProviders } from "~/api/react";
import { env } from "~/env";
import { PostHogPageView } from "./PostHogPageView";

Expand All @@ -30,7 +29,7 @@ export function Providers({ children }: { children: React.ReactNode }) {
</Suspense>
<NextUIProvider navigate={(href) => router.push(href)}>
<ThemeProvider attribute="class" defaultTheme="dark">
<QueryProviders>{children}</QueryProviders>
{children}
</ThemeProvider>
</NextUIProvider>
</PostHogProvider>
Expand Down
5 changes: 0 additions & 5 deletions apps/sovoli.com/src/services/knowledge/createKnowledge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { MediaAssetHost } from "@sovoli/db/schema";
import type { PostKnowledgeSchemaRequest } from "../../tsr/router/knowledge/knowledgeContract";
import { knowledgeUpsertedEvent } from "~/trigger/knowledgeUpsertedEvent";
import { hydrateMedia } from "~/trigger/media";
import { generateAuthToken, hashAuthToken } from "~/utils/authTokens";
import { slugify } from "../../utils/slugify";
import { createConnections } from "./createConnections";

Expand All @@ -22,11 +21,8 @@ export const createKnowledge = async ({
authUserId,
knowledge,
}: CreateKnowledgeOptions) => {
const authToken = generateAuthToken();
const authTokenHashed = hashAuthToken(authToken);
const createdSourceKnowledge = (await createParentKnowledge({
...knowledge,
authTokenHashed,
userId: authUserId,
isOrigin: true,
})) as SelectKnowledgeSchema;
Expand Down Expand Up @@ -105,7 +101,6 @@ export const createKnowledge = async ({
// TOODO: rebuild the knowledge with the connections and media assets
return {
knowledge: createdSourceKnowledge,
authToken,
};
};

Expand Down
Loading

0 comments on commit f1387f0

Please sign in to comment.