Compare commits

...
Author SHA1 Message Date
Brandon Thomas 6c10357557 call api host method 2026-05-08 22:00:40 -04:00
Brandon Thomas 52fb116f3a path method 2026-05-08 21:54:52 -04:00
Brandon Thomas 72e052fe7e add redirects for netlify 2026-05-08 21:44:01 -04:00
Brandon Thomas 7471259d28 fix frontend errors (missing vite config, type errors) (#1490) 2026-05-08 21:40:46 -04:00
10 changed files with 68 additions and 5 deletions
@@ -1,3 +1,7 @@
/background-change /index.html 200
/background-change/ /index.html 200
/background-change/* /index.html 200
/checkout_cancel /index.html 200
/checkout_cancel/ /index.html 200
/checkout_cancel/* /index.html 200
+6 -1
View File
@@ -4,10 +4,15 @@ import { FilterEngineCategories } from "./enums/QueryFilters.js";
import { Visibility } from "./enums/Visibility.js";
import { EIntermediateFile } from "./enums/EIntermediateFile.js";
import { UploaderStates, UploaderState } from "@storyteller/common";
type GetSessionTokenForUploadStuioShotResult =
| { success: true; data?: string }
| { success: false; errorMessage?: any };
export class MediaUploadApi extends ApiManager {
private sessionToken = "";
private async getSessionTokenForUploadStudioShot() {
private async getSessionTokenForUploadStudioShot(): Promise<GetSessionTokenForUploadStuioShotResult> {
const endpoint = `${this.getApiSchemeAndHost()}/v1/session_token`;
return await this.get<{
maybe_signed_session: string;
-1
View File
@@ -106,7 +106,6 @@ export class PromptsApi extends ApiManager {
console.log(response);
const success = response.success ?? false;
const status = response.status ?? "";
const errorMessage = response.BadInput;
return {
@@ -39,6 +39,12 @@ export class StorytellerApiHostStore {
return instance;
}
/** Convert an API path to a full URL using the configured scheme and host. */
public pathToFullUrl(path: string): string {
const trimmedPath = path.startsWith("/") ? path.slice(1) : path;
return `${this.apiSchemeAndHost}/${trimmedPath}`;
}
/** Get the API scheme and host. */
public getApiSchemeAndHost(): string {
console.debug("StorytellerApiHostStore.getApiSchemeAndHost()", this.apiSchemeAndHost, this.constructor.name);
+1 -1
View File
@@ -1,4 +1,4 @@
import { USER_FEATURE_FLAGS } from "../../libs/api/src/lib/enums/UserFeatures";
import { USER_FEATURE_FLAGS } from "../enums/UserFeatures";
export interface CoreInfo {
default_avatar: {
+5 -1
View File
@@ -1,3 +1,5 @@
import { StorytellerApiHostStore } from "@storyteller/api";
export type SubmitVFXJobRequest = {
source_video_media_token: string;
reference_image_media_token: string | null;
@@ -22,7 +24,9 @@ export async function submitVFXJob(
req: SubmitVFXJobRequest,
): Promise<SubmitVFXJobResponse> {
try {
const res = await fetch(VFX_ENDPOINT, {
const url = StorytellerApiHostStore.getInstance().pathToFullUrl(VFX_ENDPOINT);
const res = await fetch(url, {
method: "POST",
headers: { "Content-Type": "application/json" },
credentials: "include",
@@ -2,6 +2,9 @@
"files": [],
"include": [],
"references": [
{
"path": "../../api"
},
{
"path": "../../common"
},
@@ -31,6 +31,9 @@
"src/**/*.tsx"
],
"references": [
{
"path": "../../api/tsconfig.lib.json"
},
{
"path": "../../common/tsconfig.lib.json"
},
@@ -0,0 +1,40 @@
/// <reference types='vitest' />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import * as path from 'path';
import { isExternal } from '../../shared-vite-config';
export default defineConfig(() => ({
root: __dirname,
cacheDir: '../../../node_modules/.vite/libs/components/vfx',
plugins: [react(), dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.lib.json') })],
build: {
outDir: './dist',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
},
lib: {
entry: 'src/index.ts',
name: '@storyteller/ui-vfx',
fileName: 'index',
formats: ['es' as const]
},
rollupOptions: {
external: isExternal
},
},
test: {
watch: false,
globals: true,
environment: 'jsdom',
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
reporters: ['default'],
coverage: {
reportsDirectory: './test-output/vitest/coverage',
provider: 'v8' as const,
}
},
}));
-1
View File
@@ -13,7 +13,6 @@ export * from "./lib/enqueue/EnqueueImageTo3dObject.js";
export * from "./lib/enqueue/EnqueueImageTo3dWorld.js";
export * from "./lib/enqueue/EnqueueImageToGaussian.js";
export * from "./lib/enqueue/EnqueueImageToVideo.js";
export * from "./lib/enqueue/GenerateVideoCommand.js";
export * from "./lib/enqueue/EnqueueTextToImage.js";
export * from "./lib/generate/GenerateImage.js";
export * from "./lib/generate/GenerateVideo.js";