Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
209 changes: 206 additions & 3 deletions apps/api/openapi.gen.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"get": {
"responses": {
"200": {
"description": "-",
"description": "result",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -222,6 +222,209 @@
}
}
},
"/file-transcription/start": {
"post": {
"responses": {
"200": {
"description": "Pipeline started",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"pipelineId": {
"type": "string"
},
"invocationId": {
"type": "string"
}
},
"required": [
"pipelineId",
"invocationId"
],
"additionalProperties": false
}
}
}
},
"400": {
"description": "Invalid fileId"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal error"
}
},
"operationId": "postFile-transcriptionStart",
"tags": [
"private"
],
"parameters": [],
"security": [
{
"Bearer": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"fileId": {
"type": "string"
},
"pipelineId": {
"type": "string"
}
},
"required": [
"fileId"
],
"additionalProperties": false
}
}
}
}
}
},
"/file-transcription/status/{pipelineId}": {
"get": {
"responses": {
"200": {
"description": "Pipeline status",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"QUEUED",
"TRANSCRIBING",
"TRANSCRIBED",
"LLM_RUNNING",
"DONE",
"ERROR"
]
},
"transcript": {
"type": "string"
},
"llmResult": {
"type": "string"
},
"error": {
"type": "string"
}
},
"required": [
"status"
],
"additionalProperties": false
}
}
}
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal error"
}
},
"operationId": "getFile-transcriptionStatusByPipelineId",
"tags": [
"private"
],
"parameters": [
{
"in": "path",
"name": "pipelineId",
"schema": {
"type": "string"
},
"required": true
}
],
"security": [
{
"Bearer": []
}
]
}
},
"/file-transcription/result/{pipelineId}": {
"get": {
"responses": {
"200": {
"description": "Pipeline result",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"QUEUED",
"TRANSCRIBING",
"TRANSCRIBED",
"LLM_RUNNING",
"DONE",
"ERROR"
]
},
"transcript": {
"type": "string"
},
"llmResult": {
"type": "string"
},
"error": {
"type": "string"
}
},
"required": [
"status"
],
"additionalProperties": false
}
}
}
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal error"
}
},
"operationId": "getFile-transcriptionResultByPipelineId",
"tags": [
"private"
],
"parameters": [
{
"in": "path",
"name": "pipelineId",
"schema": {
"type": "string"
},
"required": true
}
],
"security": [
{
"Bearer": []
}
]
}
},
"/rpc/can-start-trial": {
"get": {
"responses": {
Expand Down Expand Up @@ -287,7 +490,7 @@
"post": {
"responses": {
"200": {
"description": "-",
"description": "result",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -421,7 +624,7 @@
"post": {
"responses": {
"200": {
"description": "-",
"description": "result",
"content": {
"application/json": {
"schema": {
Expand Down
3 changes: 2 additions & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
"private": true,
"type": "module",
"scripts": {
"dev": "dotenvx run --ignore MISSING_ENV_FILE -f ../../.env.supabase -f ../../.env.stripe -f .env -- bun --hot src/index.ts",
"dev": "dotenvx run --ignore MISSING_ENV_FILE -f ../../.env.supabase -f ../../.env.stripe -f ../../.env.restate -f .env -- bun --hot src/index.ts",
"stripe:migrate": "dotenvx run --ignore MISSING_ENV_FILE -f ../../.env.supabase -f ../../.env.stripe -f .env -- bun src/scripts/run-stripe-migrations.ts",
"openapi": "CI=true bun src/scripts/generate-openapi.ts",
"typecheck": "tsc --noEmit",
"test": "bun test"
},
"dependencies": {
"@hypr/api-client": "workspace:*",
"@restatedev/restate-sdk-clients": "^1.9.1",
"@hono/zod-validator": "^0.7.5",
"@posthog/ai": "^7.2.1",
"@scalar/hono-api-reference": "^0.5.184",
Expand Down
1 change: 1 addition & 0 deletions apps/api/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const env = createEnv({
ASSEMBLYAI_API_KEY: z.string().min(1),
SONIOX_API_KEY: z.string().min(1),
POSTHOG_API_KEY: z.string().min(1),
RESTATE_INGRESS_URL: z.url(),
OVERRIDE_AUTH: z.string().optional(),
},
runtimeEnv: Bun.env,
Expand Down
1 change: 1 addition & 0 deletions apps/api/src/integration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from "./supabase";
export * from "./stripe";
export * from "./openrouter";
export * from "./posthog";
export * from "./restate";
12 changes: 12 additions & 0 deletions apps/api/src/integration/restate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as clients from "@restatedev/restate-sdk-clients";

import { env } from "../env";

let restateClientInstance: ReturnType<typeof clients.connect> | null = null;

export function getRestateClient() {
if (!restateClientInstance) {
restateClientInstance = clients.connect({ url: env.RESTATE_INGRESS_URL });
}
return restateClientInstance;
}
Loading
Loading