feat: 1.0.0 release (#91)
* chore(client): rename function module * chore: allow client to be created multiple times singleton client is not the default but it still present as a compatibility layer * chore: update docs * feat(client): improved result typing * chore: update demo app code * chore: updated reference docs * chore: update proxy code * chore: alpha release * chore: fix lint staged rule * chore: clean-up docs * chore: reference docs updated
This commit is contained in:
parent
762f28918d
commit
543b9208eb
20
README.md
20
README.md
@ -1,17 +1,17 @@
|
||||
# The fal.ai JS client
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## About the Project
|
||||
|
||||
The fal serverless JavaScript/TypeScript Client is a robust and user-friendly library designed for seamless integration of fal serverless functions in Web, Node.js, and React Native applications. Developed in TypeScript, it provides developers with type safety right from the start.
|
||||
The fal JavaScript/TypeScript Client is a robust and user-friendly library designed for seamless integration of fal endpoints in Web, Node.js, and React Native applications. Developed in TypeScript, it provides developers with type safety right from the start.
|
||||
|
||||
## Getting Started
|
||||
|
||||
The `@fal-ai/serverless-client` library serves as a client for fal serverless Python functions. For guidance on creating your functions, refer to the [quickstart guide](https://fal.ai/docs).
|
||||
The `@fal-ai/client` library serves as a client for fal apps hosted on fal. For guidance on consuming and creating apps, refer to the [quickstart guide](https://fal.ai/docs).
|
||||
|
||||
### Client Library
|
||||
|
||||
@ -22,12 +22,12 @@ This client library is crafted as a lightweight layer atop platform standards li
|
||||
|
||||
1. Install the client library
|
||||
```sh
|
||||
npm install --save @fal-ai/serverless-client
|
||||
npm install --save @fal-ai/client
|
||||
```
|
||||
2. Start by configuring your credentials:
|
||||
|
||||
```ts
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { fal } from "@fal-ai/client";
|
||||
|
||||
fal.config({
|
||||
// Can also be auto-configured using environment variables:
|
||||
@ -46,21 +46,21 @@ See the available [model APIs](https://fal.ai/models) for more details.
|
||||
|
||||
### The fal client proxy
|
||||
|
||||
Although the fal client is designed to work in any JS environment, including directly in your browser, **it is not recommended** to store your credentials in your client source code. The common practice is to use your own server to serve as a proxy to serverless APIs. Luckily fal supports that out-of-the-box with plug-and-play proxy functions for the most common engines/frameworks.
|
||||
Although the fal client is designed to work in any JS environment, including directly in your browser, **it is not recommended** to store your credentials in your client source code. The common practice is to use your own server to serve as a proxy to fal APIs. Luckily fal supports that out-of-the-box with plug-and-play proxy functions for the most common engines/frameworks.
|
||||
|
||||
For example, if you are using Next.js, you can:
|
||||
|
||||
1. Instal the proxy library
|
||||
```sh
|
||||
npm install --save @fal-ai/serverless-proxy
|
||||
npm install --save @fal-ai/server-proxy
|
||||
```
|
||||
2. Add the proxy as an API endpoint of your app, see an example here in [pages/api/fal/proxy.ts](https://github.com/fal-ai/fal-js/blob/main/apps/demo-nextjs-page-router/pages/api/fal/proxy.ts)
|
||||
```ts
|
||||
export { handler as default } from "@fal-ai/serverless-proxy/nextjs";
|
||||
export { handler as default } from "@fal-ai/server-proxy/nextjs";
|
||||
```
|
||||
3. Configure the client to use the proxy:
|
||||
```ts
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { fal } from "@fal-ai/client";
|
||||
fal.config({
|
||||
proxyUrl: "/api/fal/proxy",
|
||||
});
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
* This is only a minimal backend to get started.
|
||||
*/
|
||||
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import * as falProxy from "@fal-ai/serverless-proxy/express";
|
||||
import { fal } from "@fal-ai/client";
|
||||
import * as falProxy from "@fal-ai/server-proxy/express";
|
||||
import cors from "cors";
|
||||
import { configDotenv } from "dotenv";
|
||||
import express from "express";
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
import { route } from "@fal-ai/serverless-proxy/nextjs";
|
||||
import { route } from "@fal-ai/server-proxy/nextjs";
|
||||
|
||||
export const { GET, POST, PUT } = route;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
/* eslint-disable @next/next/no-img-element */
|
||||
"use client";
|
||||
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { createFalClient } from "@fal-ai/client";
|
||||
import { MutableRefObject, useEffect, useRef, useState } from "react";
|
||||
|
||||
fal.config({
|
||||
const fal = createFalClient({
|
||||
proxyUrl: "/api/fal/proxy",
|
||||
});
|
||||
|
||||
|
||||
@ -1,16 +1,14 @@
|
||||
/* eslint-disable @next/next/no-img-element */
|
||||
"use client";
|
||||
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { createFalClient } from "@fal-ai/client";
|
||||
import { useMemo, useState } from "react";
|
||||
|
||||
// @snippet:start(client.config)
|
||||
fal.config({
|
||||
const fal = createFalClient({
|
||||
proxyUrl: "/api/fal/proxy", // the built-int nextjs proxy
|
||||
// proxyUrl: 'http://localhost:3333/api/fal/proxy', // or your own external proxy
|
||||
});
|
||||
// @snippet:end
|
||||
|
||||
// @snippet:start(client.result.type)
|
||||
type Image = {
|
||||
filename: string;
|
||||
subfolder: string;
|
||||
@ -18,12 +16,11 @@ type Image = {
|
||||
url: string;
|
||||
};
|
||||
|
||||
type Result = {
|
||||
type ComfyOutput = {
|
||||
url: string;
|
||||
outputs: Record<string, any>[];
|
||||
images: Image[];
|
||||
};
|
||||
// @snippet:end
|
||||
|
||||
type ErrorProps = {
|
||||
error: any;
|
||||
@ -54,7 +51,7 @@ export default function ComfyImageToImagePage() {
|
||||
// Result state
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<Error | null>(null);
|
||||
const [result, setResult] = useState<Result | null>(null);
|
||||
const [result, setResult] = useState<ComfyOutput | null>(null);
|
||||
const [logs, setLogs] = useState<string[]>([]);
|
||||
const [elapsedTime, setElapsedTime] = useState<number>(0);
|
||||
// @snippet:end
|
||||
@ -73,7 +70,7 @@ export default function ComfyImageToImagePage() {
|
||||
setElapsedTime(0);
|
||||
};
|
||||
|
||||
const getImageURL = (result: Result) => {
|
||||
const getImageURL = (result: ComfyOutput) => {
|
||||
return result.outputs[9].images[0];
|
||||
};
|
||||
|
||||
@ -83,7 +80,7 @@ export default function ComfyImageToImagePage() {
|
||||
setLoading(true);
|
||||
const start = Date.now();
|
||||
try {
|
||||
const result: Result = await fal.subscribe(
|
||||
const { data } = await fal.subscribe<ComfyOutput>(
|
||||
"comfy/fal-ai/image-to-image",
|
||||
{
|
||||
input: {
|
||||
@ -102,7 +99,7 @@ export default function ComfyImageToImagePage() {
|
||||
},
|
||||
},
|
||||
);
|
||||
setResult(getImageURL(result));
|
||||
setResult(getImageURL(data));
|
||||
} catch (error: any) {
|
||||
setError(error);
|
||||
} finally {
|
||||
|
||||
@ -1,16 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { createFalClient } from "@fal-ai/client";
|
||||
import { useMemo, useState } from "react";
|
||||
|
||||
// @snippet:start(client.config)
|
||||
fal.config({
|
||||
const fal = createFalClient({
|
||||
proxyUrl: "/api/fal/proxy", // the built-int nextjs proxy
|
||||
// proxyUrl: 'http://localhost:3333/api/fal/proxy', // or your own external proxy
|
||||
});
|
||||
// @snippet:end
|
||||
|
||||
// @snippet:start(client.result.type)
|
||||
type Image = {
|
||||
filename: string;
|
||||
subfolder: string;
|
||||
@ -18,12 +15,11 @@ type Image = {
|
||||
url: string;
|
||||
};
|
||||
|
||||
type Result = {
|
||||
type ComfyOutput = {
|
||||
url: string;
|
||||
outputs: Record<string, any>[];
|
||||
images: Image[];
|
||||
};
|
||||
// @snippet:end
|
||||
|
||||
type ErrorProps = {
|
||||
error: any;
|
||||
@ -50,7 +46,7 @@ export default function ComfyImageToVideoPage() {
|
||||
// Result state
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<Error | null>(null);
|
||||
const [result, setResult] = useState<Result | null>(null);
|
||||
const [result, setResult] = useState<ComfyOutput | null>(null);
|
||||
const [logs, setLogs] = useState<string[]>([]);
|
||||
const [elapsedTime, setElapsedTime] = useState<number>(0);
|
||||
// @snippet:end
|
||||
@ -69,7 +65,7 @@ export default function ComfyImageToVideoPage() {
|
||||
setElapsedTime(0);
|
||||
};
|
||||
|
||||
const getImageURL = (result: Result) => {
|
||||
const getImageURL = (result: ComfyOutput) => {
|
||||
return result.outputs[10].images[0];
|
||||
};
|
||||
|
||||
@ -79,7 +75,7 @@ export default function ComfyImageToVideoPage() {
|
||||
setLoading(true);
|
||||
const start = Date.now();
|
||||
try {
|
||||
const result: Result = await fal.subscribe(
|
||||
const { data } = await fal.subscribe<ComfyOutput>(
|
||||
"comfy/fal-ai/image-to-video",
|
||||
{
|
||||
input: {
|
||||
@ -97,7 +93,7 @@ export default function ComfyImageToVideoPage() {
|
||||
},
|
||||
},
|
||||
);
|
||||
setResult(getImageURL(result));
|
||||
setResult(getImageURL(data));
|
||||
} catch (error: any) {
|
||||
setError(error);
|
||||
} finally {
|
||||
|
||||
@ -1,16 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { createFalClient } from "@fal-ai/client";
|
||||
import { useMemo, useState } from "react";
|
||||
|
||||
// @snippet:start(client.config)
|
||||
fal.config({
|
||||
const fal = createFalClient({
|
||||
proxyUrl: "/api/fal/proxy", // the built-int nextjs proxy
|
||||
// proxyUrl: 'http://localhost:3333/api/fal/proxy', // or your own external proxy
|
||||
});
|
||||
// @snippet:end
|
||||
|
||||
// @snippet:start(client.result.type)
|
||||
type Image = {
|
||||
filename: string;
|
||||
subfolder: string;
|
||||
@ -18,12 +15,11 @@ type Image = {
|
||||
url: string;
|
||||
};
|
||||
|
||||
type Result = {
|
||||
type ComfyOutput = {
|
||||
url: string;
|
||||
outputs: Record<string, any>[];
|
||||
images: Image[];
|
||||
};
|
||||
// @snippet:end
|
||||
|
||||
type ErrorProps = {
|
||||
error: any;
|
||||
@ -53,7 +49,7 @@ export default function ComfyTextToImagePage() {
|
||||
// Result state
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<Error | null>(null);
|
||||
const [result, setResult] = useState<Result | null>(null);
|
||||
const [result, setResult] = useState<ComfyOutput | null>(null);
|
||||
const [logs, setLogs] = useState<string[]>([]);
|
||||
const [elapsedTime, setElapsedTime] = useState<number>(0);
|
||||
// @snippet:end
|
||||
@ -72,7 +68,7 @@ export default function ComfyTextToImagePage() {
|
||||
setElapsedTime(0);
|
||||
};
|
||||
|
||||
const getImageURL = (result: Result) => {
|
||||
const getImageURL = (result: ComfyOutput) => {
|
||||
return result.outputs[9].images[0];
|
||||
};
|
||||
|
||||
@ -82,7 +78,9 @@ export default function ComfyTextToImagePage() {
|
||||
setLoading(true);
|
||||
const start = Date.now();
|
||||
try {
|
||||
const result: Result = await fal.subscribe("comfy/fal-ai/text-to-image", {
|
||||
const { data } = await fal.subscribe<ComfyOutput>(
|
||||
"comfy/fal-ai/text-to-image",
|
||||
{
|
||||
input: {
|
||||
prompt: prompt,
|
||||
},
|
||||
@ -96,8 +94,9 @@ export default function ComfyTextToImagePage() {
|
||||
setLogs((update.logs || []).map((log) => log.message));
|
||||
}
|
||||
},
|
||||
});
|
||||
setResult(getImageURL(result));
|
||||
},
|
||||
);
|
||||
setResult(getImageURL(data));
|
||||
} catch (error: any) {
|
||||
setError(error);
|
||||
} finally {
|
||||
|
||||
@ -1,23 +1,20 @@
|
||||
"use client";
|
||||
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { createFalClient } from "@fal-ai/client";
|
||||
import { useMemo, useState } from "react";
|
||||
|
||||
// @snippet:start(client.config)
|
||||
fal.config({
|
||||
const fal = createFalClient({
|
||||
// credentials: 'FAL_KEY_ID:FAL_KEY_SECRET',
|
||||
proxyUrl: "/api/fal/proxy", // the built-int nextjs proxy
|
||||
// proxyUrl: 'http://localhost:3333/api/fal/proxy', // or your own external proxy
|
||||
});
|
||||
// @snippet:end
|
||||
|
||||
// @snippet:start(client.result.type)
|
||||
type Image = {
|
||||
url: string;
|
||||
file_name: string;
|
||||
file_size: number;
|
||||
};
|
||||
type Result = {
|
||||
type Output = {
|
||||
image: Image;
|
||||
};
|
||||
// @snippet:end
|
||||
@ -51,7 +48,7 @@ export default function Home() {
|
||||
// Result state
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<Error | null>(null);
|
||||
const [result, setResult] = useState<Result | null>(null);
|
||||
const [result, setResult] = useState<Output | null>(null);
|
||||
const [logs, setLogs] = useState<string[]>([]);
|
||||
const [elapsedTime, setElapsedTime] = useState<number>(0);
|
||||
// @snippet:end
|
||||
@ -79,7 +76,7 @@ export default function Home() {
|
||||
setLoading(true);
|
||||
const start = Date.now();
|
||||
try {
|
||||
const result: Result = await fal.subscribe("fal-ai/illusion-diffusion", {
|
||||
const result = await fal.subscribe<Output>("fal-ai/illusion-diffusion", {
|
||||
input: {
|
||||
prompt,
|
||||
image_url: imageFile,
|
||||
@ -96,7 +93,7 @@ export default function Home() {
|
||||
}
|
||||
},
|
||||
});
|
||||
setResult(result);
|
||||
setResult(result.data);
|
||||
} catch (error: any) {
|
||||
setError(error);
|
||||
} finally {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { fal } from "@fal-ai/client";
|
||||
import { useState } from "react";
|
||||
|
||||
fal.config({
|
||||
@ -54,7 +54,7 @@ export default function Home() {
|
||||
setLoading(true);
|
||||
const start = Date.now();
|
||||
try {
|
||||
const result: any = await fal.subscribe(endpointId, {
|
||||
const result = await fal.subscribe(endpointId, {
|
||||
input: JSON.parse(input),
|
||||
logs: true,
|
||||
// mode: "streaming",
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
"use client";
|
||||
|
||||
/* eslint-disable @next/next/no-img-element */
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { createFalClient } from "@fal-ai/client";
|
||||
import { ChangeEvent, useRef, useState } from "react";
|
||||
import { DrawingCanvas } from "../../components/drawing";
|
||||
|
||||
fal.config({
|
||||
const fal = createFalClient({
|
||||
proxyUrl: "/api/fal/proxy",
|
||||
});
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { createFalClient } from "@fal-ai/client";
|
||||
import { useState } from "react";
|
||||
|
||||
fal.config({
|
||||
const fal = createFalClient({
|
||||
proxyUrl: "/api/fal/proxy",
|
||||
});
|
||||
|
||||
@ -29,7 +29,7 @@ export default function StreamingDemo() {
|
||||
const [streamStatus, setStreamStatus] = useState<string>("idle");
|
||||
|
||||
const runInference = async () => {
|
||||
const stream = await fal.stream<LlavaInput, LlavaOutput>(
|
||||
const stream = await fal.stream<LlavaOutput, LlavaInput>(
|
||||
"fal-ai/llavav15-13b",
|
||||
{
|
||||
input: {
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { createFalClient } from "@fal-ai/client";
|
||||
import { useCallback, useMemo, useState } from "react";
|
||||
|
||||
fal.config({
|
||||
const fal = createFalClient({
|
||||
// credentials: 'FAL_KEY_ID:FAL_KEY_SECRET',
|
||||
proxyUrl: "/api/fal/proxy",
|
||||
});
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
// @snippet:start("client.proxy.nextjs")
|
||||
export { handler as default } from "@fal-ai/serverless-proxy/nextjs";
|
||||
export { handler as default } from "@fal-ai/server-proxy/nextjs";
|
||||
// @snippet:end
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { createFalClient } from "@fal-ai/client";
|
||||
import { useMemo, useState } from "react";
|
||||
|
||||
// @snippet:start(client.config)
|
||||
fal.config({
|
||||
const fal = createFalClient({
|
||||
proxyUrl: "/api/fal/proxy", // the built-int nextjs proxy
|
||||
// proxyUrl: 'http://localhost:3333/api/fal/proxy', // or your own external proxy
|
||||
});
|
||||
@ -14,7 +14,7 @@ type Image = {
|
||||
file_name: string;
|
||||
file_size: number;
|
||||
};
|
||||
type Result = {
|
||||
type Output = {
|
||||
images: Image[];
|
||||
};
|
||||
// @snippet:end
|
||||
@ -47,7 +47,7 @@ export function Index() {
|
||||
// Result state
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<Error | null>(null);
|
||||
const [result, setResult] = useState<Result | null>(null);
|
||||
const [result, setResult] = useState<Output | null>(null);
|
||||
const [logs, setLogs] = useState<string[]>([]);
|
||||
const [elapsedTime, setElapsedTime] = useState<number>(0);
|
||||
// @snippet:end
|
||||
@ -72,7 +72,7 @@ export function Index() {
|
||||
setLoading(true);
|
||||
const start = Date.now();
|
||||
try {
|
||||
const result: Result = await fal.subscribe("fal-ai/lora", {
|
||||
const result = await fal.subscribe<Output>("fal-ai/lora", {
|
||||
input: {
|
||||
prompt,
|
||||
model_name: "stabilityai/stable-diffusion-xl-base-1.0",
|
||||
@ -89,7 +89,7 @@ export function Index() {
|
||||
}
|
||||
},
|
||||
});
|
||||
setResult(result);
|
||||
setResult(result.data);
|
||||
} catch (error: any) {
|
||||
setError(error);
|
||||
} finally {
|
||||
|
||||
13
docs/reference/assets/icons.js
generated
13
docs/reference/assets/icons.js
generated
File diff suppressed because one or more lines are too long
2163
docs/reference/assets/main.js
generated
2163
docs/reference/assets/main.js
generated
File diff suppressed because one or more lines are too long
3
docs/reference/assets/navigation.js
generated
3
docs/reference/assets/navigation.js
generated
@ -1,2 +1 @@
|
||||
window.navigationData =
|
||||
"data:application/octet-stream;base64,H4sIAAAAAAAAE4WTS2sCMRRG/0vW0qn27U6koItCH9AuSheZmasGYxLvvalK6X8vasd5xcz6fOcQLuTzRzBsWQzFyKlHRIuiJ5zkhRiKTEsioKQgFwteadETS2VyMewP7n97J/tdapVLVtaciTQGsdaLBw9vLNlT2eGdA0oqqF4YXD7c9W8GlcorrD0QP6k817CRCM1Wa9BdJGcNwUSaXAO2ezXcVWscZGpmtlkMTLqqH5BOrF0Wb2kWG7irtt6fu2x8S1Qy1UDJAdTtq6qIIDWrVdAtWEQntijnQfsfReTMmpmal+7Mm2x/Q0qOpK7eXlfUOfD4rH2CkYCTSDBybpqHCiWNJNCbkIveRCRiBLkKeUcSU31KGaoUgnYBI4GN4kXol5WV+qIj9Yx2uztXOcBW4OsPsjwAYcYEAAA=";
|
||||
window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAE43U0U7CMBQG4HfpNXGCgsqdIRhIJCJGvTBeHLYzaCjtbM8EYnx3Iwrbuq7ldv9/vmynWd++GOGWWJ/dZnyotdKsxTKgJeuzWIAxaKJDcraktWAttuIyYf125/q7dZx+AcETIK5kA2IVfNZArTOBhMljjjk+EVBuCpBLQp1CjCZyFatwp9srwXcgBoKjJKd2TH3EWE61Wmg0JvRyzqaf3hfDrl3zofua56NLuY+ZIQjia59UrfiwJ1IaFj6r0vBTGmHN5cKLVTo+boKkeVzaO+0yNNH/Y2vy/Oaq3e3Yu7ZP7k9oPq2aMsOPHA3dq4WNFMmJxoQnicANaGygikJYNJmSBkcgE4G67lXiE7RckAPJhX0+9dlcPmS/90htyUUSMp61aDCKJGRYF9pYpsrGHJWQ+orzkVKrwz5t0YpDWgqiED5Bc5gLNFEKojp5UR6KNQKh465McxnvVxNZlSrWuyxh3Phv88J0N710UDwNykAbHMokU1zSOHFRVsWDbTgtXf9dYVUbAWqq1XbXpOzDGvD+A5P5Ic/UBwAA"
|
||||
3
docs/reference/assets/search.js
generated
3
docs/reference/assets/search.js
generated
@ -1,2 +1 @@
|
||||
window.searchData =
|
||||
"data:application/octet-stream;base64,H4sIAAAAAAAAE62ZXW+jOBSG/4vn1k1zDiEhuRutdjW9WGk/pNkLFFUkuA0qAcZAO6Oo/31lIGDjQ2umc9UK+33PwX58jJ0Lk/lLyXbhhT0lWcx26xVnWXQWbMeOefaQPDLOapmyHXuos2OV5Fl52zYsTtU5ZZwd06gsRcl2jL1ywuZRVL9NOfVtb5p52Jt9q0UteqPnSCbRIRXlbfPcNSNZZ0Quss5cDcr6UB5lchCETd/mavaSVKc/kzhOxUskKUezwxzbv2T+/ceEY9P2phkutxvwh7H/R3yrRVkRuVY/ClHeWu1vp+r73rr3vr9XHk6Gn/q+mi9nRSRFVpFpkiRJEaVVcqZguja9mT9g0Ht9LpLfpcxl79Upbq8Nbzr5gPqaKytZH6v3zD6ZPemh6PPS0l6ixnEVVXX5TqC+08/FOOTxj3ciqC43OCuCNvhfozSJIwU2PQej9l8yFZSn04yMk9VW2xphNQzbQyLSuOljzw8Z3RTMjr5cBXrF/mNueEszNwMXMMnIBJ9VGd8k5U2SnYRMKhH/RAYktmT8rudHo9vVtizyrBRfoixOhbRKo9H68Upr271fZ80EySpbVrmMHqki27U4b7mVFNGZ2m+bhlkb2d/qY+FfE7F2HLSWWY6jab3LHvKRM9Hjo5M2ZfnexFHJTqyCc/k4L+iiVTgHXnS5TsRP8+PM+K3iV8WfP+qLuUNvZzCG6z9x+JLnT9f1Nspn1Oq6nopIluJzUdzFxJoaGim7PWdJFovvbHdhz0KWSZ6xHcOFt9gy3m5c6kTRRuLsmJ/P6u05i/Nj3fy777p9FWqzVJ3b3rdLxsMl95aLLez3PLxqm+fNg6vF8KTRAeMhEDqwdGDokPEQCR1aOjR0HuOhR+g8S+cZuhXj4YrQrSzdytD5jIc+ofMtnW/o1oyHa0K3tnRrQ7dhPNwQuo2l2xi6gPEw4IiLlbcxhIElDAzhlvFwSwTcWrqtOfGKA6CQAZsZGEHTUAMc/UWwRFNMgGOSAwoIQFJs0wMmPqCoAI8U2wiByRAoNICiCGyMwOQI/OlXtlkCEyZQjACFIdg8gQkUKE6AQhFspsCECoLpoba5AhMs2E4PtQ0XmHRhQxe1ENCmC026EKbWAtpw4agsNXAFVFyiMplsYcMWtZbQRgtNtFDRgtRqQhstNNFCBQtSRRhtstAkC9eTY2WThSZZqGBBsojbZKFJFipWkCrkaIOFJlioUEFqGaLNFZpceQoVpFaSZ3PlmVx5ChWkVpJnc9U9anbsZyErEd+1O3cY9t+UF3bfbef9CfDCAra7vHKG0P1dq7+vw2bePO33c9Wm4kZFItoz+GAKy8EVlk427YlKs/A0C68VwdbJ6nqHOZhp6bhlYxzrtaRAS6obJvCdHJtvH9EdlDVHX3N0G/BHUdlvqCfm6jKV0lrz2jiZNR/ggwNqc4eBk0NzhNAcUHNwy6H5fo2KIokNI+1lPLeR6a6bNQ8tF3eH6xWF5qNhiCsnp+HCcrDZDi5u60G2l6Nn7Q53cNsMbm7jLLtDx+l6R6GRo5mh20JrruUHBw0cz0lvjzJo0wXYrVE3CPuLC81Nq4/oNvvXWwvNRJsydHyv4deGwWc12LjhMy72qDmgGzzP/enVrvKaG7glNHJLmjsTLT+tjKFbXX0Rh1OeP8n+oKy5abXVc8NR/UhCrxPNyzGxpDoV7W8xg4tWjRyK/Z6zIilEmmSC7cL96+v/kPat4robAAA=";
|
||||
window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE72cWY/bRhKA/wvnVZanT1LztggSxMAGm83uZh8EY8CRODNEJFIhKTuG4f++aB5iFatabI6MfZI97Dq6+qvqg8fXqCo/19HD9mv0R17sowclV1GRHrPoIXpOD9EqOleH6CH6lFZ5+nTI6vfP6WH92hzdpd0hreusjh6i6NtqUGD1RcGuytIm+yk9/HDIs6K5KHs+F7smL4v6/aTFVcXS2ItmqjMvmqx6TndZ/T5MnbiXo6d/nrNzNq/rbmgHNK6iU1o5T6BXHjNVlh6a/BhiCTR9o7G6Kav0JcTW2PLNpqosPebFS5CxsW24OXmvkzGM5yIkgm2rN5qoz0/1rsqfgsIH2t4UwODoLTJkjVFj5jw+Nl9OYVA4S+tL+xmD694zthB8zpvXX/L9/pB9TquMqQO4QWh9cVK/VuVfXzwa22vXa8r9JhZmLHm/ZX+es7phfHVRqN+T69ddvRb5awrvZqJO3eTL5D9dufIXSnB5Jko4M455kLq7S1O+F9A7n7Embc51mLGh6Q3GHMH/WmISCbzd8FBA/l0usc5IvdmFKqvPh7BRvTR9s7FdWuyyQ5CxS9NFxkAK/NbPo/4swC3CE2FXFkW2C1V5Nzb35TRyFEwUcrT5t1P+Y1WV1cVor+v9cOGq+0ZI6H3dVOddM6fsDrfknb/45Z3fENa8oZkMnrPxVO6/zFhwTd7JRRZA8H9PD/k+ddMLPwaT699lKDidQSMydRZAbKXQY9ie8+ywb9vQ8WGtY4HF1mEKvWTNT0vNE5mlHoSAyVpm+Gzq/bu8fpcXr1mVN9n+DR6w2LL2+5a3WqdrnvpUFnX2c1rsD1lFFijo6u3rHapufrWDHeQL/b+6TYy/zqMG4VvD8+lQpvswhXeXxnxPsI/Ll+hei/0y/Uptw6K9n54uN1Va1M9ldfxQnM6BsbwjQv+3EGDLczsWrGDitQ+tfst6DS7UZMFy2rvz41TO7f+mnvqzvl05TVabXYqCK4v2TpOK86F4LieamRa31hOfyrmawjnryYZj/bLM6LqTCDY8EOuxfyh3C+13Et/L/vKor5eGnnowheu/2dPPZfnHMBVM/JlcDT0/OKVVnf1Y7E9lXjQfxho/niJMWoQqzmsuvUa16Hq40h/K4+mQNdl+TjvXcOE5CNoOXubu8+F6aQtbAQxaAiZ+54WHy33apLO6132rawZm+K+6wxbAh9cYbLrMIhmAc/GPUzucU6uXCzcPBNY0OxijR55A5Wi1cM3Ium36TgQYmxmcY9a8lmRkeKOXtsttTofnP9WBH57xwq3DM9E0NzzAI99W5/y0L49pXgQZWsPmcyZnBunPc1Z9CbM6NL3R4iltXsMM9i2X2/McHf+9nK4Wxgvf6bB40BR4Suw88mZPXcNbRNfMrMfGc+bmFjTZJ3D6d9Xm0PRGi3V5rnaB3by0vdGmO8urm/R4CjMLmy+3PIXxl6yp8t20OPV/vRVDqGaOwcER75TxnFVZscse0W1Rr501EbhqlgkU2NZ9KNrlEbeYAtsw2ir87MB/+8Kjde4MlHH52h3tx1NZ565+LXGBSN7qStUvyx+dCwscmcjd7kabP485e5jjdwJIhR29XXUJA/hrVb5UWc1uF5BzTMPvg6FP8TyJnO9vJsDrRiAEC5w5lC9LY9GLfJdIXIfwShzewOF1xyCKV7eWwMPFO8tAEL165zhkHX8jhn4ngihc4ooPQr8LVxlcYvo4WRsEWR+FvscwXMuBa4OwOAV4tz6uorzYZ39FD1+jT1lVu2nuIZJrtd5Eq+6GmHskrvN3Fe3K47E79t2Xu3P7z499s98zdxPONe5av7+PVtv7lRZrYdXHj6vtINxeaP8w6Bj/0gqKaLUVnKAgggIJymi1lZygJIISCapotVWcoCKCCgnqaLXVnKAmghoJmmi1NZygIYIGCdpotbWcoCWCFgnG0Wobc4IxEYyRYBKttgknmBDBBAluotV2s1J2fW8MEtwQwQ0GwPEg7lfyfh1vNEaAwiMm9LT48PwwAGGChONCsAwJCpHAFAnHhmA5EhQkgUkS2t9nCpPANAnHiGBBFBQogYkSjhPBwigoVAJTJRwrwq6kXeMxFhQrgbkSjhbBIikoWgKzJRwxgsVSULwE5ku2fLFoSsqXxHxJR4xkC5ukfMlJhWpLFAunZIoU5ks6YiRf4ChfEvMlHTGShVNSviTmSzpipGYDRvmSmC9pPYhISpfEdElHjDSsXcqXxHxJR4xka6WkfEnMl9z4e0z5kpgv5YiRLNmK8qUwX6rliyVbUb4U5ktJT6wVpUtN5kDljbVipkFMl2rp2rBOU7oUpksZb+lTlC6F6VKOGMWmo6J8KcyXcsQoNh0V5UthvlTid5vypTBfyhGj2FxWlC+F+dL++VFTvjTmSztiFFsINOVLY7609M3pmgKmMWC6XWXxqyUKmJ4stBwyip2kNLPWwoBpP2CaAqYxYLoFjC0jmgKmMWC6BYytBJoCpjFg2iGj2EqgKWAaA6ZbwNiM1BQwjQEzDhnNJpWhgBkMmHHIaDapDAXMYMCMY0azeWEoYQYTZpR3XjeUMIMJM/4FmKGEmcly3jGj2aQyzIoeE2YcM5pNDEMJM5gw45jR/FaCEmYwYcZfwgwlzGDCjGNGs4lhKGEGE2ZbwtjEsJQwiwmzLWFsYlhKmMWEWents6WEWUyYdcxoNqssJcxiwqxjxrBZZSlhFhNm2x0jm1WWEmYnm0bHjGGzyjL7RkyYjf0Bo4RZTJh1zBg2MSwlzGLCrGPGsIlhKWEWExY7ZgybGDElLMaExY4Zw7IdU8JiTFjsmDExV4ZiSliMCYuVN9oxJSzGhMUtYWxixJSwGBMWt4SxbMeUsBgTFvsW+THlK54cTDhiLJsWMXM2gfmKHTFWrJRc2w2WpXjFGK/YAWMlJ0vpijFdiePFslwnlK4E05UIT7ASylaC2Uqkr78JRSvBaCUOFsvuaRKKVoLRSrQvWAklK8FkJY4Vy6ZiQslKMFmJj6yEkpVgspLYGywKVjI59Ur8wWIOvjBZycZbARKKVoLR2tz7Ir2hZPV/ao9xP2VVk+0/dMe52+3ljvXX6LE/4xX3w8nz10jcRw9fv60iobtfZfrfpPvV/XXd/9307Ux/3cr+N+5+Y+V+v41nxO1fL8fE7przPD3lWffKyOiWVKNbUgep6V4AACoMUNF7pMI8Gt6rAspAmKQIUzKcrre3jIcbNaNKC/xLTKDK/i0p4JgEjgX2Dr4gAzRpoKkfYbkJ09i+qP6cHnb9I+CAL4BXkK7ukcRRgQYkmLAwta/mjxrA0N2HytOOwDiHaXG3QLL+PRygJx4VqTB/XrLGpywBysLiO31GZFRmgLI4LOfy4tTfRPVBDkYvCett/6AkIMACAsKAzIvWH49TZgM6GoZUXs+lswaAmDBCcl/UNMgaEzas/bNgoJMgnW1Y1Non40cNCpCq40ANL3j4gROJ6oSSJEjV5YE60CUAkw3V0j3VCmILemXDiLzc3gWuAC1xP+0lYVFu338AUQZ0axukoX3uPuufu89x70CxM2G9657xBF0D8Nmw7OifSwU6gBs2rJT0Hw8BgQGlLVwDeDQLYAjcicNIbpUx0xkAWgQHh8txBTTpsA6OXz0BAw60LFLCzHBg4GVYBYMPHYBwg1IYb/rk6NeKmzAoe8UTuEFnTViq9HoOJco5Axy0ixQdwbcvABWAVRE6lvCZGRA7MAhxv65OhgIThu6g+nV4ZRUMMZj5VCgv3csuoLdAiey3BCaw12eUl7CIhsqXw5sFgAuwkjZhiobnmAETQEkcBilNagGKuej3HNJ2v6ofxbj/fyL63zAAL58hAi6Dbi/RQVNfgQKpQv3p3rUclQAs+qTXYVUEfPQIJAJI0WVamO6B/NRh66lOGzPCgFkRtgYB74oAZkG0bFjyDB+MAc4AAkRglMbPMY16wMI/uEudlqZkQgTUibA1EXi+H+ANEIjDRu3ywjLZRChQ8lWgU5OjEgX6pcPiNLzxDpSA+q7CatW5OnBFD3hjw6Lz6fJuKT1vAbGWYX2baMvbN5pBRwGbOmyq+Zw9vZblH9XlNVagDaSLDhs+940rz3QNDyXCQueUnbqPaQE9gCkRUOo+rqJTfsoOeZFFD9uP3779D9KIs1xgUAAA";
|
||||
4
docs/reference/classes/ApiError.html
generated
4
docs/reference/classes/ApiError.html
generated
File diff suppressed because one or more lines are too long
4
docs/reference/classes/ValidationError.html
generated
4
docs/reference/classes/ValidationError.html
generated
File diff suppressed because one or more lines are too long
3
docs/reference/functions/config.html
generated
3
docs/reference/functions/config.html
generated
@ -1,3 +0,0 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>config | @fal-ai/serverless-client - v0.14.2</title><meta name="description" content="Documentation for @fal-ai/serverless-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/serverless-client - v0.14.2</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/serverless-client</a></li><li><a href="config.html">config</a></li></ul><h1>Function config</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="config" class="tsd-anchor"></a><span class="tsd-kind-call-signature">config</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">config</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#config" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Configures the fal serverless client.</p>
|
||||
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">config</span>: <span class="tsd-signature-type">Config</span></span><div class="tsd-comment tsd-typography"><p>the new configuration.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/b3ab5f0e15d70d83c439f6a77bb3a5cfa7fa3271/libs/client/src/config.ts#L107">config.ts:107</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/serverless-client - v0.14.2</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
4
docs/reference/functions/createFalClient.html
generated
Normal file
4
docs/reference/functions/createFalClient.html
generated
Normal file
@ -0,0 +1,4 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>createFalClient | @fal-ai/client - v1.0.0</title><meta name="description" content="Documentation for @fal-ai/client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/client - v1.0.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/client</a></li><li><a href="createFalClient.html">createFalClient</a></li></ul><h1>Function createFalClient</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="createFalClient" class="tsd-anchor"></a><span class="tsd-kind-call-signature">create<wbr/>Fal<wbr/>Client</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">userConfig</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/FalClient.html" class="tsd-signature-type tsd-kind-interface">FalClient</a><a href="#createFalClient" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a new reference of the <code>FalClient</code>.</p>
|
||||
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">userConfig</span>: <span class="tsd-signature-type">Config</span><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>Optional configuration to override the default settings.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../interfaces/FalClient.html" class="tsd-signature-type tsd-kind-interface">FalClient</a></h4><p>a new instance of the <code>FalClient</code>.</p>
|
||||
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/client.ts#L81">client.ts:81</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/client - v1.0.0</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
3
docs/reference/functions/getConfig.html
generated
3
docs/reference/functions/getConfig.html
generated
@ -1,3 +0,0 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>getConfig | @fal-ai/serverless-client - v0.14.2</title><meta name="description" content="Documentation for @fal-ai/serverless-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/serverless-client - v0.14.2</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/serverless-client</a></li><li><a href="getConfig.html">getConfig</a></li></ul><h1>Function getConfig</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getConfig" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Config</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">RequiredConfig</span><a href="#getConfig" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Get the current fal serverless client configuration.</p>
|
||||
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">RequiredConfig</span></h4><p>the current client configuration.</p>
|
||||
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/b3ab5f0e15d70d83c439f6a77bb3a5cfa7fa3271/libs/client/src/config.ts#L145">config.ts:145</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/serverless-client - v0.14.2</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
1
docs/reference/functions/isCompletedQueueStatus.html
generated
Normal file
1
docs/reference/functions/isCompletedQueueStatus.html
generated
Normal file
File diff suppressed because one or more lines are too long
1
docs/reference/functions/isQueueStatus.html
generated
Normal file
1
docs/reference/functions/isQueueStatus.html
generated
Normal file
File diff suppressed because one or more lines are too long
1
docs/reference/functions/parseAppId.html
generated
1
docs/reference/functions/parseAppId.html
generated
File diff suppressed because one or more lines are too long
1
docs/reference/functions/parseEndpointId.html
generated
Normal file
1
docs/reference/functions/parseEndpointId.html
generated
Normal file
File diff suppressed because one or more lines are too long
4
docs/reference/functions/run.html
generated
4
docs/reference/functions/run.html
generated
@ -1,4 +0,0 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>run | @fal-ai/serverless-client - v0.14.2</title><meta name="description" content="Documentation for @fal-ai/serverless-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/serverless-client - v0.14.2</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/serverless-client</a></li><li><a href="run.html">run</a></li></ul><h1>Function run</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="run" class="tsd-anchor"></a><span class="tsd-kind-call-signature">run</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="run.html#run.Input">Input</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="run.html#run.Output">Output</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">id</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="run.html#run.Output">Output</a><span class="tsd-signature-symbol">></span><a href="#run" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Runs a fal serverless function identified by its <code>id</code>.</p>
|
||||
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="run.Input" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Input</span></span></li><li><span><a id="run.Output" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Output</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>the registered function revision id or alias.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type">RunOptions</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="run.html#run.Input">Input</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> = {}</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="run.html#run.Output">Output</a><span class="tsd-signature-symbol">></span></h4><p>the remote function output</p>
|
||||
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/b3ab5f0e15d70d83c439f6a77bb3a5cfa7fa3271/libs/client/src/function.ts#L119">function.ts:119</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/serverless-client - v0.14.2</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
7
docs/reference/functions/stream.html
generated
7
docs/reference/functions/stream.html
generated
@ -1,7 +0,0 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>stream | @fal-ai/serverless-client - v0.14.2</title><meta name="description" content="Documentation for @fal-ai/serverless-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/serverless-client - v0.14.2</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/serverless-client</a></li><li><a href="stream.html">stream</a></li></ul><h1>Function stream</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="stream" class="tsd-anchor"></a><span class="tsd-kind-call-signature">stream</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="stream.html#stream.Input">Input</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="stream.html#stream.Output">Output</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">endpointId</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">FalStream</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="stream.html#stream.Input">Input</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="stream.html#stream.Output">Output</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#stream" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Calls a fal app that supports streaming and provides a streaming-capable
|
||||
object as a result, that can be used to get partial results through either
|
||||
<code>AsyncIterator</code> or through an event listener.</p>
|
||||
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="stream.Input" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Input</span> = <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" class="tsd-signature-type external" target="_blank">Record</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span></li><li><span><a id="stream.Output" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Output</span> = <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">endpointId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>the endpoint id, e.g. <code>fal-ai/llavav15-13b</code>.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type">StreamOptions</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="stream.html#stream.Input">Input</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>the request options, including the input payload.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">FalStream</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="stream.html#stream.Input">Input</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="stream.html#stream.Output">Output</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>the <code>FalStream</code> instance.</p>
|
||||
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/b3ab5f0e15d70d83c439f6a77bb3a5cfa7fa3271/libs/client/src/streaming.ts#L323">streaming.ts:323</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/serverless-client - v0.14.2</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
5
docs/reference/functions/subscribe.html
generated
5
docs/reference/functions/subscribe.html
generated
@ -1,5 +0,0 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>subscribe | @fal-ai/serverless-client - v0.14.2</title><meta name="description" content="Documentation for @fal-ai/serverless-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/serverless-client - v0.14.2</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/serverless-client</a></li><li><a href="subscribe.html">subscribe</a></li></ul><h1>Function subscribe</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="subscribe" class="tsd-anchor"></a><span class="tsd-kind-call-signature">subscribe</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="subscribe.html#subscribe.Input">Input</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="subscribe.html#subscribe.Output">Output</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">endpointId</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="subscribe.html#subscribe.Output">Output</a><span class="tsd-signature-symbol">></span><a href="#subscribe" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Subscribes to updates for a specific request in the queue.</p>
|
||||
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="subscribe.Input" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Input</span></span></li><li><span><a id="subscribe.Output" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Output</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">endpointId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The ID of the function web endpoint.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type">RunOptions</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="subscribe.html#subscribe.Input">Input</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-type">QueueSubscribeOptions</span><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>Options to configure how the request is run and how updates are received.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="subscribe.html#subscribe.Output">Output</a><span class="tsd-signature-symbol">></span></h4><p>A promise that resolves to the result of the request once it's completed.</p>
|
||||
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/b3ab5f0e15d70d83c439f6a77bb3a5cfa7fa3271/libs/client/src/function.ts#L511">function.ts:511</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/serverless-client - v0.14.2</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
4
docs/reference/functions/withMiddleware.html
generated
4
docs/reference/functions/withMiddleware.html
generated
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>withMiddleware | @fal-ai/serverless-client - v0.14.2</title><meta name="description" content="Documentation for @fal-ai/serverless-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/serverless-client - v0.14.2</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/serverless-client</a></li><li><a href="withMiddleware.html">withMiddleware</a></li></ul><h1>Function withMiddleware</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="withMiddleware" class="tsd-anchor"></a><span class="tsd-kind-call-signature">with<wbr/>Middleware</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">middlewares</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../types/RequestMiddleware.html" class="tsd-signature-type tsd-kind-type-alias">RequestMiddleware</a><a href="#withMiddleware" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Setup a execution chain of middleware functions.</p>
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>withMiddleware | @fal-ai/client - v1.0.0</title><meta name="description" content="Documentation for @fal-ai/client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/client - v1.0.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/client</a></li><li><a href="withMiddleware.html">withMiddleware</a></li></ul><h1>Function withMiddleware</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="withMiddleware" class="tsd-anchor"></a><span class="tsd-kind-call-signature">with<wbr/>Middleware</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">middlewares</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../types/RequestMiddleware.html" class="tsd-signature-type tsd-kind-type-alias">RequestMiddleware</a><a href="#withMiddleware" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Setup a execution chain of middleware functions.</p>
|
||||
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">Rest</code><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">middlewares</span>: <a href="../types/RequestMiddleware.html" class="tsd-signature-type tsd-kind-type-alias">RequestMiddleware</a><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>one or more middleware functions.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../types/RequestMiddleware.html" class="tsd-signature-type tsd-kind-type-alias">RequestMiddleware</a></h4><p>a middleware function that executes the given middlewares in order.</p>
|
||||
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/b3ab5f0e15d70d83c439f6a77bb3a5cfa7fa3271/libs/client/src/middleware.ts#L25">middleware.ts:25</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/serverless-client - v0.14.2</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/middleware.ts#L26">middleware.ts:26</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/client - v1.0.0</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
|
||||
2
docs/reference/functions/withProxy.html
generated
2
docs/reference/functions/withProxy.html
generated
File diff suppressed because one or more lines are too long
2
docs/reference/hierarchy.html
generated
2
docs/reference/hierarchy.html
generated
@ -1 +1 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@fal-ai/serverless-client - v0.14.2</title><meta name="description" content="Documentation for @fal-ai/serverless-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@fal-ai/serverless-client - v0.14.2</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>@fal-ai/serverless-client - v0.14.2</h2></div><h2>Class Hierarchy</h2><ul class="tsd-full-hierarchy"><li><a id="ApiError" class="tsd-anchor"></a><a href="classes/ApiError.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-128"></use></svg>ApiError</a><ul><li><a id="ValidationError" class="tsd-anchor"></a><a href="classes/ValidationError.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-128"></use></svg>ValidationError</a><ul></ul></li></ul></li></ul></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="index.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>@fal-ai/serverless-client - v0.14.2</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@fal-ai/client - v1.0.0</title><meta name="description" content="Documentation for @fal-ai/client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@fal-ai/client - v1.0.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>@fal-ai/client - v1.0.0</h2></div><h2>Class Hierarchy</h2><ul class="tsd-full-hierarchy"><li><a id="ApiError" class="tsd-anchor"></a><a href="classes/ApiError.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-128"></use></svg>ApiError</a><ul><li><a id="ValidationError" class="tsd-anchor"></a><a href="classes/ValidationError.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-128"></use></svg>ValidationError</a><ul></ul></li></ul></li></ul></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="index.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>@fal-ai/client - v1.0.0</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
|
||||
33
docs/reference/index.html
generated
33
docs/reference/index.html
generated
@ -1,19 +1,28 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@fal-ai/serverless-client - v0.14.2</title><meta name="description" content="Documentation for @fal-ai/serverless-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@fal-ai/serverless-client - v0.14.2</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>@fal-ai/serverless-client - v0.14.2</h2></div><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><h3 class="tsd-index-heading uppercase">Index</h3><section class="tsd-index-section"><h3 class="tsd-index-heading">Classes</h3><div class="tsd-index-list"><a href="classes/ApiError.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-128"></use></svg><span>Api<wbr/>Error</span></a>
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@fal-ai/client - v1.0.0</title><meta name="description" content="Documentation for @fal-ai/client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@fal-ai/client - v1.0.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>@fal-ai/client - v1.0.0</h2></div><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><h3 class="tsd-index-heading uppercase">Index</h3><section class="tsd-index-section"><h3 class="tsd-index-heading">Classes</h3><div class="tsd-index-list"><a href="classes/ApiError.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-128"></use></svg><span>Api<wbr/>Error</span></a>
|
||||
<a href="classes/ValidationError.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-128"></use></svg><span>Validation<wbr/>Error</span></a>
|
||||
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Type Aliases</h3><div class="tsd-index-list"><a href="types/QueueStatus.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2097152"></use></svg><span>Queue<wbr/>Status</span></a>
|
||||
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Interfaces</h3><div class="tsd-index-list"><a href="interfaces/CompletedQueueStatus.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-256"></use></svg><span>Completed<wbr/>Queue<wbr/>Status</span></a>
|
||||
<a href="interfaces/FalClient.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-256"></use></svg><span>Fal<wbr/>Client</span></a>
|
||||
<a href="interfaces/InProgressQueueStatus.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-256"></use></svg><span>In<wbr/>Progress<wbr/>Queue<wbr/>Status</span></a>
|
||||
<a href="interfaces/InQueueQueueStatus.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-256"></use></svg><span>In<wbr/>Queue<wbr/>Queue<wbr/>Status</span></a>
|
||||
<a href="interfaces/QueueClient.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-256"></use></svg><span>Queue<wbr/>Client</span></a>
|
||||
<a href="interfaces/RealtimeClient.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-256"></use></svg><span>Realtime<wbr/>Client</span></a>
|
||||
<a href="interfaces/StorageClient.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-256"></use></svg><span>Storage<wbr/>Client</span></a>
|
||||
<a href="interfaces/StreamingClient.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-256"></use></svg><span>Streaming<wbr/>Client</span></a>
|
||||
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Type Aliases</h3><div class="tsd-index-list"><a href="types/Metrics.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2097152"></use></svg><span>Metrics</span></a>
|
||||
<a href="types/QueueStatus.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2097152"></use></svg><span>Queue<wbr/>Status</span></a>
|
||||
<a href="types/RequestLog.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2097152"></use></svg><span>Request<wbr/>Log</span></a>
|
||||
<a href="types/RequestMiddleware.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2097152"></use></svg><span>Request<wbr/>Middleware</span></a>
|
||||
<a href="types/ResponseHandler.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2097152"></use></svg><span>Response<wbr/>Handler</span></a>
|
||||
<a href="types/Result.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2097152"></use></svg><span>Result</span></a>
|
||||
<a href="types/RunOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2097152"></use></svg><span>Run<wbr/>Options</span></a>
|
||||
<a href="types/UrlOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2097152"></use></svg><span>Url<wbr/>Options</span></a>
|
||||
<a href="types/ValidationErrorInfo.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2097152"></use></svg><span>Validation<wbr/>Error<wbr/>Info</span></a>
|
||||
<a href="types/WebHookResponse.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-2097152"></use></svg><span>Web<wbr/>Hook<wbr/>Response</span></a>
|
||||
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Variables</h3><div class="tsd-index-list"><a href="variables/queue.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-32"></use></svg><span>queue</span></a>
|
||||
<a href="variables/realtime.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-32"></use></svg><span>realtime</span></a>
|
||||
<a href="variables/storage.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-32"></use></svg><span>storage</span></a>
|
||||
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Functions</h3><div class="tsd-index-list"><a href="functions/config.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>config</span></a>
|
||||
<a href="functions/getConfig.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>get<wbr/>Config</span></a>
|
||||
<a href="functions/parseAppId.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>parse<wbr/>App<wbr/>Id</span></a>
|
||||
<a href="functions/run.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>run</span></a>
|
||||
<a href="functions/stream.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>stream</span></a>
|
||||
<a href="functions/subscribe.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>subscribe</span></a>
|
||||
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Variables</h3><div class="tsd-index-list"><a href="variables/fal.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-32"></use></svg><span>fal</span></a>
|
||||
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Functions</h3><div class="tsd-index-list"><a href="functions/createFalClient.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>create<wbr/>Fal<wbr/>Client</span></a>
|
||||
<a href="functions/isCompletedQueueStatus.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>is<wbr/>Completed<wbr/>Queue<wbr/>Status</span></a>
|
||||
<a href="functions/isQueueStatus.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>is<wbr/>Queue<wbr/>Status</span></a>
|
||||
<a href="functions/parseEndpointId.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>parse<wbr/>Endpoint<wbr/>Id</span></a>
|
||||
<a href="functions/withMiddleware.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>with<wbr/>Middleware</span></a>
|
||||
<a href="functions/withProxy.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>with<wbr/>Proxy</span></a>
|
||||
</div></section></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="index.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>@fal-ai/serverless-client - v0.14.2</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
</div></section></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="index.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>@fal-ai/client - v1.0.0</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
|
||||
6
docs/reference/interfaces/CompletedQueueStatus.html
generated
Normal file
6
docs/reference/interfaces/CompletedQueueStatus.html
generated
Normal file
File diff suppressed because one or more lines are too long
40
docs/reference/interfaces/FalClient.html
generated
Normal file
40
docs/reference/interfaces/FalClient.html
generated
Normal file
File diff suppressed because one or more lines are too long
5
docs/reference/interfaces/InProgressQueueStatus.html
generated
Normal file
5
docs/reference/interfaces/InProgressQueueStatus.html
generated
Normal file
File diff suppressed because one or more lines are too long
5
docs/reference/interfaces/InQueueQueueStatus.html
generated
Normal file
5
docs/reference/interfaces/InQueueQueueStatus.html
generated
Normal file
File diff suppressed because one or more lines are too long
36
docs/reference/interfaces/QueueClient.html
generated
Normal file
36
docs/reference/interfaces/QueueClient.html
generated
Normal file
File diff suppressed because one or more lines are too long
6
docs/reference/interfaces/RealtimeClient.html
generated
Normal file
6
docs/reference/interfaces/RealtimeClient.html
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>RealtimeClient | @fal-ai/client - v1.0.0</title><meta name="description" content="Documentation for @fal-ai/client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/client - v1.0.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/client</a></li><li><a href="RealtimeClient.html">RealtimeClient</a></li></ul><h1>Interface RealtimeClient</h1></div><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">RealtimeClient</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-call-signature" href="RealtimeClient.html#connect.connect-1">connect</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="RealtimeClient.html#connect.connect-1.Input">Input</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="RealtimeClient.html#connect.connect-1.Output">Output</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">app</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, <span class="tsd-kind-parameter">handler</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">RealtimeConnectionHandler</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="RealtimeClient.html#connect.connect-1.Output">Output</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">RealtimeConnection</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="RealtimeClient.html#connect.connect-1.Input">Input</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/realtime.ts#L230">realtime.ts:230</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="RealtimeClient.html#connect" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>connect</span></a>
|
||||
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="connect" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>connect</span><a href="#connect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="connect.connect-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">connect</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="RealtimeClient.html#connect.connect-1.Input">Input</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="RealtimeClient.html#connect.connect-1.Output">Output</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">app</span>, <span class="tsd-kind-parameter">handler</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">RealtimeConnection</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="RealtimeClient.html#connect.connect-1.Input">Input</a><span class="tsd-signature-symbol">></span><a href="#connect.connect-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Connect to the realtime endpoint. The default implementation uses
|
||||
WebSockets to connect to fal function endpoints that support WSS.</p>
|
||||
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="connect.connect-1.Input" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Input</span> = <span class="tsd-signature-type">any</span></span></li><li><span><a id="connect.connect-1.Output" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Output</span> = <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">app</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>the app alias or identifier.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">handler</span>: <span class="tsd-signature-type">RealtimeConnectionHandler</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="RealtimeClient.html#connect.connect-1.Output">Output</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>the connection handler.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">RealtimeConnection</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="RealtimeClient.html#connect.connect-1.Input">Input</a><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/realtime.ts#L238">realtime.ts:238</a></li></ul></aside></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#connect" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>connect</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/client - v1.0.0</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
14
docs/reference/interfaces/StorageClient.html
generated
Normal file
14
docs/reference/interfaces/StorageClient.html
generated
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>StorageClient | @fal-ai/client - v1.0.0</title><meta name="description" content="Documentation for @fal-ai/client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/client - v1.0.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/client</a></li><li><a href="StorageClient.html">StorageClient</a></li></ul><h1>Interface StorageClient</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>File support for the client. This interface establishes the contract for
|
||||
uploading files to the server and transforming the input to replace file
|
||||
objects with URLs.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">StorageClient</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-property" href="StorageClient.html#transformInput">transformInput</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">input</span><span class="tsd-signature-symbol">: </span><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" class="tsd-signature-type external" target="_blank">Record</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" class="tsd-signature-type external" target="_blank">Record</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="StorageClient.html#upload">upload</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">file</span><span class="tsd-signature-symbol">: </span><a href="https://developer.mozilla.org/docs/Web/API/Blob" class="tsd-signature-type external" target="_blank">Blob</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/storage.ts#L10">storage.ts:10</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="StorageClient.html#transformInput" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>transform<wbr/>Input</span></a>
|
||||
<a href="StorageClient.html#upload" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>upload</span></a>
|
||||
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="transformInput" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>transform<wbr/>Input</span><a href="#transformInput" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">transform<wbr/>Input</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">input</span><span class="tsd-signature-symbol">: </span><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" class="tsd-signature-type external" target="_blank">Record</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" class="tsd-signature-type external" target="_blank">Record</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Transform the input to replace file objects with URLs. This is used
|
||||
to transform the input before sending it to the server and ensures
|
||||
that the server receives URLs instead of file objects.</p>
|
||||
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="transformInput.__type.__type-1"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">input</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" class="tsd-signature-type external" target="_blank">Record</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">input</span>: <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" class="tsd-signature-type external" target="_blank">Record</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>the input to transform.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" class="tsd-signature-type external" target="_blank">Record</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>the transformed input.</p>
|
||||
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/storage.ts#L28">storage.ts:28</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="upload" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>upload</span><a href="#upload" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">upload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">file</span><span class="tsd-signature-symbol">: </span><a href="https://developer.mozilla.org/docs/Web/API/Blob" class="tsd-signature-type external" target="_blank">Blob</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Upload a file to the server. Returns the URL of the uploaded file.</p>
|
||||
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="upload.__type-2.__type-3"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">file</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">file</span>: <a href="https://developer.mozilla.org/docs/Web/API/Blob" class="tsd-signature-type external" target="_blank">Blob</a></span><div class="tsd-comment tsd-typography"><p>the file to upload</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4><p>the URL of the uploaded file</p>
|
||||
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/storage.ts#L17">storage.ts:17</a></li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#transformInput" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>transform<wbr/>Input</span></a><a href="#upload" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>upload</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/client - v1.0.0</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
9
docs/reference/interfaces/StreamingClient.html
generated
Normal file
9
docs/reference/interfaces/StreamingClient.html
generated
Normal file
@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>StreamingClient | @fal-ai/client - v1.0.0</title><meta name="description" content="Documentation for @fal-ai/client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/client - v1.0.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/client</a></li><li><a href="StreamingClient.html">StreamingClient</a></li></ul><h1>Interface StreamingClient</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>The streaming client interface.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">StreamingClient</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-call-signature" href="StreamingClient.html#stream.stream-1">stream</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="StreamingClient.html#stream.stream-1.Output">Output</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="StreamingClient.html#stream.stream-1.Input">Input</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">endpointId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">StreamOptions</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="FalClient.html#stream.__type.__type-1.Input">Input</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">FalStream</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="FalClient.html#stream.__type.__type-1.Input">Input</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="FalClient.html#stream.__type.__type-1.Output">Output</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/streaming.ts#L333">streaming.ts:333</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="StreamingClient.html#stream" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>stream</span></a>
|
||||
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="stream" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>stream</span><a href="#stream" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="stream.stream-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">stream</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="StreamingClient.html#stream.stream-1.Output">Output</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="StreamingClient.html#stream.stream-1.Input">Input</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">endpointId</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">FalStream</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="FalClient.html#stream.__type.__type-1.Input">Input</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="FalClient.html#stream.__type.__type-1.Output">Output</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#stream.stream-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Calls a fal app that supports streaming and provides a streaming-capable
|
||||
object as a result, that can be used to get partial results through either
|
||||
<code>AsyncIterator</code> or through an event listener.</p>
|
||||
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="stream.stream-1.Output" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Output</span> = <span class="tsd-signature-type">any</span></span></li><li><span><a id="stream.stream-1.Input" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Input</span> = <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" class="tsd-signature-type external" target="_blank">Record</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">endpointId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>the endpoint id, e.g. <code>fal-ai/llavav15-13b</code>.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type">StreamOptions</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="FalClient.html#stream.__type.__type-1.Input">Input</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>the request options, including the input payload.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">FalStream</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="FalClient.html#stream.__type.__type-1.Input">Input</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="FalClient.html#stream.__type.__type-1.Output">Output</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>the <code>FalStream</code> instance.</p>
|
||||
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/streaming.ts#L343">streaming.ts:343</a></li></ul></aside></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#stream" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>stream</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/client - v1.0.0</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
1
docs/reference/types/Metrics.html
generated
Normal file
1
docs/reference/types/Metrics.html
generated
Normal file
File diff suppressed because one or more lines are too long
2
docs/reference/types/QueueStatus.html
generated
2
docs/reference/types/QueueStatus.html
generated
File diff suppressed because one or more lines are too long
1
docs/reference/types/RequestLog.html
generated
Normal file
1
docs/reference/types/RequestLog.html
generated
Normal file
File diff suppressed because one or more lines are too long
2
docs/reference/types/RequestMiddleware.html
generated
2
docs/reference/types/RequestMiddleware.html
generated
File diff suppressed because one or more lines are too long
2
docs/reference/types/ResponseHandler.html
generated
2
docs/reference/types/ResponseHandler.html
generated
File diff suppressed because one or more lines are too long
3
docs/reference/types/Result.html
generated
Normal file
3
docs/reference/types/Result.html
generated
Normal file
@ -0,0 +1,3 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Result | @fal-ai/client - v1.0.0</title><meta name="description" content="Documentation for @fal-ai/client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/client - v1.0.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/client</a></li><li><a href="Result.html">Result</a></li></ul><h1>Type Alias Result<T></h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">Result</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Result.html#T">T</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">data</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Result.html#T">T</a><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">requestId</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>Represents an API result, containing the data,
|
||||
the request ID and any other relevant information.</p>
|
||||
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="T" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span></span></li></ul></section><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/types.ts#L5">types.ts:5</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/client - v1.0.0</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
6
docs/reference/types/RunOptions.html
generated
Normal file
6
docs/reference/types/RunOptions.html
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>RunOptions | @fal-ai/client - v1.0.0</title><meta name="description" content="Documentation for @fal-ai/client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/client - v1.0.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/client</a></li><li><a href="RunOptions.html">RunOptions</a></li></ul><h1>Type Alias RunOptions<Input></h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">Run<wbr/>Options</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="RunOptions.html#Input">Input</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">input</span><span class="tsd-signature-symbol">?: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="RunOptions.html#Input">Input</a><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">method</span><span class="tsd-signature-symbol">?: </span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"get"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"post"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"put"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"delete"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>The function input and other configuration when running
|
||||
the function, such as the HTTP method to use.</p>
|
||||
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="Input" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Input</span></span></li></ul></section><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code> <code class="tsd-tag">Readonly</code><span class="tsd-kind-property">input</span><span class="tsd-signature-symbol">?: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="RunOptions.html#Input">Input</a></h5><div class="tsd-comment tsd-typography"><p>The function input. It will be submitted either as query params
|
||||
or the body payload, depending on the <code>method</code>.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code> <code class="tsd-tag">Readonly</code><span class="tsd-kind-property">method</span><span class="tsd-signature-symbol">?: </span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"get"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"post"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"put"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"delete"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>The HTTP method, defaults to <code>post</code>;</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/types.ts#L14">types.ts:14</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/client - v1.0.0</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
6
docs/reference/types/UrlOptions.html
generated
Normal file
6
docs/reference/types/UrlOptions.html
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>UrlOptions | @fal-ai/client - v1.0.0</title><meta name="description" content="Documentation for @fal-ai/client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/client - v1.0.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/client</a></li><li><a href="UrlOptions.html">UrlOptions</a></li></ul><h1>Type Alias UrlOptions</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">Url<wbr/>Options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">path</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">?: </span><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" class="tsd-signature-type external" target="_blank">Record</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">subdomain</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">path</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>The path to append to the function URL.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code> <code class="tsd-tag">Readonly</code><span class="tsd-kind-property">query</span><span class="tsd-signature-symbol">?: </span><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" class="tsd-signature-type external" target="_blank">Record</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h5><div class="tsd-comment tsd-typography"><p>The query parameters to include in the URL.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code> <code class="tsd-tag">Readonly</code><span class="tsd-kind-property">subdomain</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>If <code>true</code>, the function will use the queue to run the function
|
||||
asynchronously and return the result in a separate call. This
|
||||
influences how the URL is built.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/types.ts#L27">types.ts:27</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/client - v1.0.0</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
2
docs/reference/types/ValidationErrorInfo.html
generated
2
docs/reference/types/ValidationErrorInfo.html
generated
File diff suppressed because one or more lines are too long
4
docs/reference/types/WebHookResponse.html
generated
4
docs/reference/types/WebHookResponse.html
generated
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WebHookResponse | @fal-ai/serverless-client - v0.14.2</title><meta name="description" content="Documentation for @fal-ai/serverless-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/serverless-client - v0.14.2</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/serverless-client</a></li><li><a href="WebHookResponse.html">WebHookResponse</a></li></ul><h1>Type Alias WebHookResponse<Payload></h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">Web<wbr/>Hook<wbr/>Response</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="WebHookResponse.html#Payload">Payload</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">error</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">payload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WebHookResponse.html#Payload">Payload</a><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">request_id</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">status</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"OK"</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">error</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">payload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WebHookResponse.html#Payload">Payload</a><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">request_id</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">status</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ERROR"</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>Represents the response from a WebHook request.
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WebHookResponse | @fal-ai/client - v1.0.0</title><meta name="description" content="Documentation for @fal-ai/client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/client - v1.0.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/client</a></li><li><a href="WebHookResponse.html">WebHookResponse</a></li></ul><h1>Type Alias WebHookResponse<Payload></h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">Web<wbr/>Hook<wbr/>Response</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="WebHookResponse.html#Payload">Payload</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">error</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">payload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WebHookResponse.html#Payload">Payload</a><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">request_id</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">status</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"OK"</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">error</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">payload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WebHookResponse.html#Payload">Payload</a><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">request_id</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">status</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ERROR"</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>Represents the response from a WebHook request.
|
||||
This is a union type that varies based on the <code>status</code> property.</p>
|
||||
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="Payload" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Payload</span> = <span class="tsd-signature-type">any</span></span><div class="tsd-comment tsd-typography"><p>The type of the payload in the response. It defaults to <code>any</code>,
|
||||
allowing for flexibility in specifying the structure of the payload.</p>
|
||||
@ -10,4 +10,4 @@ allowing for flexibility in specifying the structure of the payload.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">payload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WebHookResponse.html#Payload">Payload</a></h5><div class="tsd-comment tsd-typography"><p>The payload of the response, structure determined by the Payload type.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">request_<wbr/>id</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>The unique identifier for the request.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">status</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"ERROR"</span></h5><div class="tsd-comment tsd-typography"><p>Indicates an unsuccessful response.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/b3ab5f0e15d70d83c439f6a77bb3a5cfa7fa3271/libs/client/src/types.ts#L69">types.ts:69</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/serverless-client - v0.14.2</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/types.ts#L107">types.ts:107</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/client - v1.0.0</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
|
||||
3
docs/reference/variables/fal.html
generated
Normal file
3
docs/reference/variables/fal.html
generated
Normal file
@ -0,0 +1,3 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>fal | @fal-ai/client - v1.0.0</title><meta name="description" content="Documentation for @fal-ai/client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/client - v1.0.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/client</a></li><li><a href="fal.html">fal</a></li></ul><h1>Variable fal<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">fal</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SingletonFalClient</span><span class="tsd-signature-symbol"> = ...</span></div><div class="tsd-comment tsd-typography"><p>Creates a singleton instance of the client. This is useful as a compatibility
|
||||
layer for existing code that uses the clients version prior to 1.0.0.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/c44136942ec1a9025b4453d6bd2a2a6b54677d19/libs/client/src/index.ts#L31">index.ts:31</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/client - v1.0.0</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
4
docs/reference/variables/queue.html
generated
4
docs/reference/variables/queue.html
generated
@ -1,4 +0,0 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>queue | @fal-ai/serverless-client - v0.14.2</title><meta name="description" content="Documentation for @fal-ai/serverless-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/serverless-client - v0.14.2</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/serverless-client</a></li><li><a href="queue.html">queue</a></li></ul><h1>Variable queue<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">queue</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Queue</span><span class="tsd-signature-symbol"> = ...</span></div><div class="tsd-comment tsd-typography"><p>The fal run queue module. It allows to submit a function to the queue and get its result
|
||||
on a separate call. This is useful for long running functions that can be executed
|
||||
asynchronously and not .</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/b3ab5f0e15d70d83c439f6a77bb3a5cfa7fa3271/libs/client/src/function.ts#L317">function.ts:317</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/serverless-client - v0.14.2</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
2
docs/reference/variables/realtime.html
generated
2
docs/reference/variables/realtime.html
generated
@ -1,2 +0,0 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>realtime | @fal-ai/serverless-client - v0.14.2</title><meta name="description" content="Documentation for @fal-ai/serverless-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/serverless-client - v0.14.2</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/serverless-client</a></li><li><a href="realtime.html">realtime</a></li></ul><h1>Variable realtime<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">realtime</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">RealtimeClient</span><span class="tsd-signature-symbol"> = ...</span></div><div class="tsd-comment tsd-typography"><p>The default implementation of the realtime client.</p>
|
||||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/b3ab5f0e15d70d83c439f6a77bb3a5cfa7fa3271/libs/client/src/realtime.ts#L352">realtime.ts:352</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/serverless-client - v0.14.2</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
1
docs/reference/variables/storage.html
generated
1
docs/reference/variables/storage.html
generated
@ -1 +0,0 @@
|
||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>storage | @fal-ai/serverless-client - v0.14.2</title><meta name="description" content="Documentation for @fal-ai/serverless-client"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="stylesheet" href="../assets/typedoc-github-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@fal-ai/serverless-client - v0.14.2</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@fal-ai/serverless-client</a></li><li><a href="storage.html">storage</a></li></ul><h1>Variable storage<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">storage</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">StorageSupport</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/fal-ai/fal-js/blob/b3ab5f0e15d70d83c439f6a77bb3a5cfa7fa3271/libs/client/src/storage.ts#L77">storage.ts:77</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@fal-ai/serverless-client - v0.14.2</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
||||
@ -1,17 +1,17 @@
|
||||
# fal.ai JavaScript/TypeScript client library
|
||||
|
||||

|
||||

|
||||
|
||||
## Introduction
|
||||
|
||||
The `fal.ai` JavaScript Client Library provides a seamless way to interact with `fal` serverless functions from your JavaScript or TypeScript applications. With built-in support for various platforms, it ensures consistent behavior across web, Node.js, and React Native environments.
|
||||
The `fal.ai` JavaScript Client Library provides a seamless way to interact with `fal` endpoints from your JavaScript or TypeScript applications. With built-in support for various platforms, it ensures consistent behavior across web, Node.js, and React Native environments.
|
||||
|
||||
## Getting started
|
||||
|
||||
Before diving into the client-specific features, ensure you've set up your credentials:
|
||||
|
||||
```ts
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { fal } from "@fal-ai/client";
|
||||
|
||||
fal.config({
|
||||
// Can also be auto-configured using environment variables:
|
||||
@ -49,4 +49,4 @@ const result = await fal.subscribe("my-function-id", {
|
||||
|
||||
## More features
|
||||
|
||||
The client library offers a plethora of features designed to simplify your serverless journey with `fal.ai`. Dive into the [official documentation](https://fal.ai/docs) for a comprehensive guide.
|
||||
The client library offers a plethora of features designed to simplify your journey with `fal.ai`. Dive into the [official documentation](https://fal.ai/docs) for a comprehensive guide.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@fal-ai/serverless-client",
|
||||
"description": "The fal serverless JS/TS client",
|
||||
"version": "0.14.3",
|
||||
"name": "@fal-ai/client",
|
||||
"description": "The fal.ai client for JavaScript and TypeScript",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -10,10 +10,10 @@
|
||||
},
|
||||
"keywords": [
|
||||
"fal",
|
||||
"serverless",
|
||||
"client",
|
||||
"ai",
|
||||
"ml"
|
||||
"ml",
|
||||
"typescript"
|
||||
],
|
||||
"dependencies": {
|
||||
"@msgpack/msgpack": "^3.0.0-beta2",
|
||||
|
||||
@ -1,22 +1,26 @@
|
||||
import { getRestApiUrl } from "./config";
|
||||
import { getRestApiUrl, RequiredConfig } from "./config";
|
||||
import { dispatchRequest } from "./request";
|
||||
import { parseAppId } from "./utils";
|
||||
import { parseEndpointId } from "./utils";
|
||||
|
||||
export const TOKEN_EXPIRATION_SECONDS = 120;
|
||||
|
||||
/**
|
||||
* Get a token to connect to the realtime endpoint.
|
||||
*/
|
||||
export async function getTemporaryAuthToken(app: string): Promise<string> {
|
||||
const appId = parseAppId(app);
|
||||
const token: string | object = await dispatchRequest<any, string>(
|
||||
"POST",
|
||||
`${getRestApiUrl()}/tokens/`,
|
||||
{
|
||||
export async function getTemporaryAuthToken(
|
||||
app: string,
|
||||
config: RequiredConfig,
|
||||
): Promise<string> {
|
||||
const appId = parseEndpointId(app);
|
||||
const token: string | object = await dispatchRequest<any, string>({
|
||||
method: "POST",
|
||||
targetUrl: `${getRestApiUrl()}/tokens/`,
|
||||
config,
|
||||
input: {
|
||||
allowed_apps: [appId.alias],
|
||||
token_expiration: TOKEN_EXPIRATION_SECONDS,
|
||||
},
|
||||
);
|
||||
});
|
||||
// keep this in case the response was wrapped (old versions of the proxy do that)
|
||||
// should be safe to remove in the future
|
||||
if (typeof token !== "string" && token["detail"]) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { buildUrl } from "./function";
|
||||
import { buildUrl } from "./request";
|
||||
|
||||
describe("The function test suite", () => {
|
||||
it("should build the URL with a function username/app-alias", () => {
|
||||
122
libs/client/src/client.ts
Normal file
122
libs/client/src/client.ts
Normal file
@ -0,0 +1,122 @@
|
||||
import { Config, createConfig } from "./config";
|
||||
import { createQueueClient, QueueClient, QueueSubscribeOptions } from "./queue";
|
||||
import { createRealtimeClient, RealtimeClient } from "./realtime";
|
||||
import { buildUrl, dispatchRequest } from "./request";
|
||||
import { resultResponseHandler } from "./response";
|
||||
import { createStorageClient, StorageClient } from "./storage";
|
||||
import { createStreamingClient, StreamingClient } from "./streaming";
|
||||
import { Result, RunOptions } from "./types";
|
||||
|
||||
/**
|
||||
* The main client type, it provides access to simple API model usage,
|
||||
* as well as access to the `queue` and `storage` APIs.
|
||||
*
|
||||
* @see createFalClient
|
||||
*/
|
||||
export interface FalClient {
|
||||
/**
|
||||
* The queue client to interact with the queue API.
|
||||
*/
|
||||
readonly queue: QueueClient;
|
||||
|
||||
/**
|
||||
* The realtime client to interact with the realtime API
|
||||
* and receive updates in real-time.
|
||||
* @see #RealtimeClient
|
||||
* @see #RealtimeClient.connect
|
||||
*/
|
||||
readonly realtime: RealtimeClient;
|
||||
|
||||
/**
|
||||
* The storage client to interact with the storage API.
|
||||
*/
|
||||
readonly storage: StorageClient;
|
||||
|
||||
/**
|
||||
* The streaming client to interact with the streaming API.
|
||||
* @see #stream
|
||||
*/
|
||||
readonly streaming: StreamingClient;
|
||||
|
||||
/**
|
||||
* Runs a fal endpoints identified by its `endpointId`.
|
||||
*
|
||||
* @param endpointId the registered function revision id or alias.
|
||||
* @returns the remote function output
|
||||
*/
|
||||
run<Output = any, Input = Record<string, any>>(
|
||||
endpointId: string,
|
||||
options: RunOptions<Input>,
|
||||
): Promise<Result<Output>>;
|
||||
|
||||
/**
|
||||
* Subscribes to updates for a specific request in the queue.
|
||||
*
|
||||
* @param endpointId - The ID of the API endpoint.
|
||||
* @param options - Options to configure how the request is run and how updates are received.
|
||||
* @returns A promise that resolves to the result of the request once it's completed.
|
||||
*/
|
||||
subscribe<Output = any, Input = Record<string, any>>(
|
||||
endpointId: string,
|
||||
options: RunOptions<Input> & QueueSubscribeOptions,
|
||||
): Promise<Result<Output>>;
|
||||
|
||||
/**
|
||||
* Calls a fal app that supports streaming and provides a streaming-capable
|
||||
* object as a result, that can be used to get partial results through either
|
||||
* `AsyncIterator` or through an event listener.
|
||||
*
|
||||
* @param endpointId the endpoint id, e.g. `fal-ai/llavav15-13b`.
|
||||
* @param options the request options, including the input payload.
|
||||
* @returns the `FalStream` instance.
|
||||
*/
|
||||
stream: StreamingClient["stream"];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new reference of the `FalClient`.
|
||||
* @param userConfig Optional configuration to override the default settings.
|
||||
* @returns a new instance of the `FalClient`.
|
||||
*/
|
||||
export function createFalClient(userConfig: Config = {}): FalClient {
|
||||
const config = createConfig(userConfig);
|
||||
const storage = createStorageClient({ config });
|
||||
const queue = createQueueClient({ config, storage });
|
||||
const streaming = createStreamingClient({ config, storage });
|
||||
const realtime = createRealtimeClient({ config });
|
||||
return {
|
||||
queue,
|
||||
realtime,
|
||||
storage,
|
||||
streaming,
|
||||
stream: streaming.stream,
|
||||
async run<Output, Input>(
|
||||
endpointId: string,
|
||||
options: RunOptions<Input> = {},
|
||||
): Promise<Result<Output>> {
|
||||
const input = options.input
|
||||
? await storage.transformInput(options.input)
|
||||
: undefined;
|
||||
return dispatchRequest<Input, Result<Output>>({
|
||||
method: options.method,
|
||||
targetUrl: buildUrl(endpointId, options),
|
||||
input: input as Input,
|
||||
config: {
|
||||
...config,
|
||||
responseHandler: resultResponseHandler,
|
||||
},
|
||||
});
|
||||
},
|
||||
async subscribe<Output, Input>(
|
||||
endpointId: string,
|
||||
options: RunOptions<Input> & QueueSubscribeOptions = {},
|
||||
): Promise<Result<Output>> {
|
||||
const { request_id: requestId } = await queue.submit(endpointId, options);
|
||||
if (options.onEnqueue) {
|
||||
options.onEnqueue(requestId);
|
||||
}
|
||||
await queue.subscribeToStatus(endpointId, { requestId, ...options });
|
||||
return queue.result(endpointId, { requestId });
|
||||
},
|
||||
};
|
||||
}
|
||||
@ -1,12 +1,11 @@
|
||||
import { config, getConfig } from "./config";
|
||||
import { createConfig } from "./config";
|
||||
|
||||
describe("The config test suite", () => {
|
||||
it("should set the config variables accordingly", () => {
|
||||
const newConfig = {
|
||||
credentials: "key-id:key-secret",
|
||||
};
|
||||
config(newConfig);
|
||||
const currentConfig = getConfig();
|
||||
const currentConfig = createConfig(newConfig);
|
||||
expect(currentConfig.credentials).toEqual(newConfig.credentials);
|
||||
});
|
||||
});
|
||||
|
||||
@ -21,7 +21,7 @@ export function resolveDefaultFetch(): FetchType {
|
||||
|
||||
export type Config = {
|
||||
/**
|
||||
* The credentials to use for the fal serverless client. When using the
|
||||
* The credentials to use for the fal client. When using the
|
||||
* client in the browser, it's recommended to use a proxy server to avoid
|
||||
* exposing the credentials in the client's environment.
|
||||
*
|
||||
@ -40,7 +40,7 @@ export type Config = {
|
||||
suppressLocalCredentialsWarning?: boolean;
|
||||
/**
|
||||
* The URL of the proxy server to use for the client requests. The proxy
|
||||
* server should forward the requests to the fal serverless rest api.
|
||||
* server should forward the requests to the fal api.
|
||||
*/
|
||||
proxyUrl?: string;
|
||||
/**
|
||||
@ -97,15 +97,13 @@ const DEFAULT_CONFIG: Partial<Config> = {
|
||||
responseHandler: defaultResponseHandler,
|
||||
};
|
||||
|
||||
let configuration: RequiredConfig;
|
||||
|
||||
/**
|
||||
* Configures the fal serverless client.
|
||||
* Configures the fal client.
|
||||
*
|
||||
* @param config the new configuration.
|
||||
*/
|
||||
export function config(config: Config) {
|
||||
configuration = {
|
||||
export function createConfig(config: Config): RequiredConfig {
|
||||
let configuration = {
|
||||
...DEFAULT_CONFIG,
|
||||
...config,
|
||||
fetch: config.fetch ?? resolveDefaultFetch(),
|
||||
@ -114,8 +112,8 @@ export function config(config: Config) {
|
||||
configuration = {
|
||||
...configuration,
|
||||
requestMiddleware: withMiddleware(
|
||||
withProxy({ targetUrl: config.proxyUrl }),
|
||||
configuration.requestMiddleware,
|
||||
withProxy({ targetUrl: config.proxyUrl }),
|
||||
),
|
||||
};
|
||||
}
|
||||
@ -135,26 +133,11 @@ export function config(config: Config) {
|
||||
"That's not recommended for production use cases.",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current fal serverless client configuration.
|
||||
*
|
||||
* @returns the current client configuration.
|
||||
*/
|
||||
export function getConfig(): RequiredConfig {
|
||||
if (!configuration) {
|
||||
console.info("Using default configuration for the fal client");
|
||||
return {
|
||||
...DEFAULT_CONFIG,
|
||||
fetch: resolveDefaultFetch(),
|
||||
} as RequiredConfig;
|
||||
}
|
||||
return configuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns the URL of the fal serverless rest api endpoint.
|
||||
* @returns the URL of the fal REST api endpoint.
|
||||
*/
|
||||
export function getRestApiUrl(): string {
|
||||
return "https://rest.alpha.fal.ai";
|
||||
|
||||
@ -1,521 +0,0 @@
|
||||
import { dispatchRequest } from "./request";
|
||||
import { storageImpl } from "./storage";
|
||||
import { FalStream, StreamingConnectionMode } from "./streaming";
|
||||
import {
|
||||
CompletedQueueStatus,
|
||||
EnqueueResult,
|
||||
QueueStatus,
|
||||
RequestLog,
|
||||
} from "./types";
|
||||
import { ensureAppIdFormat, isValidUrl, parseAppId } from "./utils";
|
||||
|
||||
/**
|
||||
* The function input and other configuration when running
|
||||
* the function, such as the HTTP method to use.
|
||||
*/
|
||||
type RunOptions<Input> = {
|
||||
/**
|
||||
* The path to the function, if any. Defaults to ``.
|
||||
* @deprecated Pass the path as part of the app id itself, e.g. `fal-ai/sdxl/image-to-image`
|
||||
*/
|
||||
readonly path?: string;
|
||||
|
||||
/**
|
||||
* The function input. It will be submitted either as query params
|
||||
* or the body payload, depending on the `method`.
|
||||
*/
|
||||
readonly input?: Input;
|
||||
|
||||
/**
|
||||
* The HTTP method, defaults to `post`;
|
||||
*/
|
||||
readonly method?: "get" | "post" | "put" | "delete" | string;
|
||||
|
||||
/**
|
||||
* If `true`, the function will automatically upload any files
|
||||
* (i.e. instances of `Blob`).
|
||||
*
|
||||
* This is enabled by default. You can disable it by setting it to `false`.
|
||||
*/
|
||||
readonly autoUpload?: boolean;
|
||||
};
|
||||
|
||||
type ExtraOptions = {
|
||||
/**
|
||||
* If `true`, the function will use the queue to run the function
|
||||
* asynchronously and return the result in a separate call. This
|
||||
* influences how the URL is built.
|
||||
*/
|
||||
readonly subdomain?: string;
|
||||
|
||||
/**
|
||||
* The query parameters to include in the URL.
|
||||
*/
|
||||
readonly query?: Record<string, string>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Builds the final url to run the function based on its `id` or alias and
|
||||
* a the options from `RunOptions<Input>`.
|
||||
*
|
||||
* @private
|
||||
* @param id the function id or alias
|
||||
* @param options the run options
|
||||
* @returns the final url to run the function
|
||||
*/
|
||||
export function buildUrl<Input>(
|
||||
id: string,
|
||||
options: RunOptions<Input> & ExtraOptions = {},
|
||||
): string {
|
||||
const method = (options.method ?? "post").toLowerCase();
|
||||
const path = (options.path ?? "").replace(/^\//, "").replace(/\/{2,}/, "/");
|
||||
const input = options.input;
|
||||
const params = {
|
||||
...(options.query || {}),
|
||||
...(method === "get" ? input : {}),
|
||||
};
|
||||
|
||||
const queryParams =
|
||||
Object.keys(params).length > 0
|
||||
? `?${new URLSearchParams(params).toString()}`
|
||||
: "";
|
||||
|
||||
// if a fal url is passed, just use it
|
||||
if (isValidUrl(id)) {
|
||||
const url = id.endsWith("/") ? id : `${id}/`;
|
||||
return `${url}${path}${queryParams}`;
|
||||
}
|
||||
|
||||
const appId = ensureAppIdFormat(id);
|
||||
const subdomain = options.subdomain ? `${options.subdomain}.` : "";
|
||||
const url = `https://${subdomain}fal.run/${appId}/${path}`;
|
||||
return `${url.replace(/\/$/, "")}${queryParams}`;
|
||||
}
|
||||
|
||||
export async function send<Input, Output>(
|
||||
id: string,
|
||||
options: RunOptions<Input> & ExtraOptions = {},
|
||||
): Promise<Output> {
|
||||
const input =
|
||||
options.input && options.autoUpload !== false
|
||||
? await storageImpl.transformInput(options.input)
|
||||
: options.input;
|
||||
return dispatchRequest<Input, Output>(
|
||||
options.method ?? "post",
|
||||
buildUrl(id, options),
|
||||
input as Input,
|
||||
);
|
||||
}
|
||||
|
||||
export type QueueStatusSubscriptionOptions = QueueStatusOptions &
|
||||
Omit<QueueSubscribeOptions, "onEnqueue" | "webhookUrl">;
|
||||
|
||||
/**
|
||||
* Runs a fal serverless function identified by its `id`.
|
||||
*
|
||||
* @param id the registered function revision id or alias.
|
||||
* @returns the remote function output
|
||||
*/
|
||||
export async function run<Input, Output>(
|
||||
id: string,
|
||||
options: RunOptions<Input> = {},
|
||||
): Promise<Output> {
|
||||
return send(id, options);
|
||||
}
|
||||
|
||||
type TimeoutId = ReturnType<typeof setTimeout> | undefined;
|
||||
|
||||
const DEFAULT_POLL_INTERVAL = 500;
|
||||
|
||||
/**
|
||||
* Options for subscribing to the request queue.
|
||||
*/
|
||||
type QueueSubscribeOptions = {
|
||||
/**
|
||||
* The mode to use for subscribing to updates. It defaults to `polling`.
|
||||
* You can also use client-side streaming by setting it to `streaming`.
|
||||
*
|
||||
* **Note:** Streaming is currently experimental and once stable, it will
|
||||
* be the default mode.
|
||||
*
|
||||
* @see pollInterval
|
||||
*/
|
||||
mode?: "polling" | "streaming";
|
||||
|
||||
/**
|
||||
* Callback function that is called when a request is enqueued.
|
||||
* @param requestId - The unique identifier for the enqueued request.
|
||||
*/
|
||||
onEnqueue?: (requestId: string) => void;
|
||||
|
||||
/**
|
||||
* Callback function that is called when the status of the queue changes.
|
||||
* @param status - The current status of the queue.
|
||||
*/
|
||||
onQueueUpdate?: (status: QueueStatus) => void;
|
||||
|
||||
/**
|
||||
* If `true`, the response will include the logs for the request.
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
logs?: boolean;
|
||||
|
||||
/**
|
||||
* The timeout (in milliseconds) for the request. If the request is not
|
||||
* completed within this time, the subscription will be cancelled.
|
||||
*
|
||||
* Keep in mind that although the client resolves the function on a timeout,
|
||||
* and will try to cancel the request on the server, the server might not be
|
||||
* able to cancel the request if it's already running.
|
||||
*
|
||||
* Note: currently, the timeout is not enforced and the default is `undefined`.
|
||||
* This behavior might change in the future.
|
||||
*/
|
||||
timeout?: number;
|
||||
|
||||
/**
|
||||
* The URL to send a webhook notification to when the request is completed.
|
||||
* @see WebHookResponse
|
||||
*/
|
||||
webhookUrl?: string;
|
||||
} & (
|
||||
| {
|
||||
mode?: "polling";
|
||||
/**
|
||||
* The interval (in milliseconds) at which to poll for updates.
|
||||
* If not provided, a default value of `500` will be used.
|
||||
*
|
||||
* This value is ignored if `mode` is set to `streaming`.
|
||||
*/
|
||||
pollInterval?: number;
|
||||
}
|
||||
| {
|
||||
mode: "streaming";
|
||||
|
||||
/**
|
||||
* The connection mode to use for streaming updates. It defaults to `server`.
|
||||
* Set to `client` if your server proxy doesn't support streaming.
|
||||
*/
|
||||
connectionMode?: StreamingConnectionMode;
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Options for submitting a request to the queue.
|
||||
*/
|
||||
type SubmitOptions<Input> = RunOptions<Input> & {
|
||||
/**
|
||||
* The URL to send a webhook notification to when the request is completed.
|
||||
* @see WebHookResponse
|
||||
*/
|
||||
webhookUrl?: string;
|
||||
};
|
||||
|
||||
type BaseQueueOptions = {
|
||||
/**
|
||||
* The unique identifier for the enqueued request.
|
||||
*/
|
||||
requestId: string;
|
||||
};
|
||||
|
||||
type QueueStatusOptions = BaseQueueOptions & {
|
||||
/**
|
||||
* If `true`, the response will include the logs for the request.
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
logs?: boolean;
|
||||
};
|
||||
|
||||
type QueueStatusStreamOptions = QueueStatusOptions & {
|
||||
/**
|
||||
* The connection mode to use for streaming updates. It defaults to `server`.
|
||||
* Set to `client` if your server proxy doesn't support streaming.
|
||||
*/
|
||||
connectionMode?: StreamingConnectionMode;
|
||||
};
|
||||
|
||||
/**
|
||||
* Represents a request queue with methods for submitting requests,
|
||||
* checking their status, retrieving results, and subscribing to updates.
|
||||
*/
|
||||
interface Queue {
|
||||
/**
|
||||
* Submits a request to the queue.
|
||||
*
|
||||
* @param endpointId - The ID of the function web endpoint.
|
||||
* @param options - Options to configure how the request is run.
|
||||
* @returns A promise that resolves to the result of enqueuing the request.
|
||||
*/
|
||||
submit<Input>(
|
||||
endpointId: string,
|
||||
options: SubmitOptions<Input>,
|
||||
): Promise<EnqueueResult>;
|
||||
|
||||
/**
|
||||
* Retrieves the status of a specific request in the queue.
|
||||
*
|
||||
* @param endpointId - The ID of the function web endpoint.
|
||||
* @param options - Options to configure how the request is run.
|
||||
* @returns A promise that resolves to the status of the request.
|
||||
*/
|
||||
status(endpointId: string, options: QueueStatusOptions): Promise<QueueStatus>;
|
||||
|
||||
/**
|
||||
* Subscribes to updates for a specific request in the queue using HTTP streaming events.
|
||||
*
|
||||
* @param endpointId - The ID of the function web endpoint.
|
||||
* @param options - Options to configure how the request is run and how updates are received.
|
||||
* @returns The streaming object that can be used to listen for updates.
|
||||
*/
|
||||
streamStatus(
|
||||
endpointId: string,
|
||||
options: QueueStatusStreamOptions,
|
||||
): Promise<FalStream<unknown, QueueStatus>>;
|
||||
|
||||
/**
|
||||
* Subscribes to updates for a specific request in the queue using polling or streaming.
|
||||
* See `options.mode` for more details.
|
||||
*
|
||||
* @param endpointId - The ID of the function web endpoint.
|
||||
* @param options - Options to configure how the request is run and how updates are received.
|
||||
* @returns A promise that resolves to the final status of the request.
|
||||
*/
|
||||
subscribeToStatus(
|
||||
endpointId: string,
|
||||
options: QueueStatusSubscriptionOptions,
|
||||
): Promise<CompletedQueueStatus>;
|
||||
|
||||
/**
|
||||
* Retrieves the result of a specific request from the queue.
|
||||
*
|
||||
* @param endpointId - The ID of the function web endpoint.
|
||||
* @param options - Options to configure how the request is run.
|
||||
* @returns A promise that resolves to the result of the request.
|
||||
*/
|
||||
result<Output>(
|
||||
endpointId: string,
|
||||
options: BaseQueueOptions,
|
||||
): Promise<Output>;
|
||||
|
||||
/**
|
||||
* Cancels a request in the queue.
|
||||
*
|
||||
* @param endpointId - The ID of the function web endpoint.
|
||||
* @param options - Options to configure how the request
|
||||
* is run and how updates are received.
|
||||
* @returns A promise that resolves once the request is cancelled.
|
||||
* @throws {Error} If the request cannot be cancelled.
|
||||
*/
|
||||
cancel(endpointId: string, options: BaseQueueOptions): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* The fal run queue module. It allows to submit a function to the queue and get its result
|
||||
* on a separate call. This is useful for long running functions that can be executed
|
||||
* asynchronously and not .
|
||||
*/
|
||||
export const queue: Queue = {
|
||||
async submit<Input>(
|
||||
endpointId: string,
|
||||
options: SubmitOptions<Input>,
|
||||
): Promise<EnqueueResult> {
|
||||
const { webhookUrl, path = "", ...runOptions } = options;
|
||||
return send(endpointId, {
|
||||
...runOptions,
|
||||
subdomain: "queue",
|
||||
method: "post",
|
||||
path: path,
|
||||
query: webhookUrl ? { fal_webhook: webhookUrl } : undefined,
|
||||
});
|
||||
},
|
||||
async status(
|
||||
endpointId: string,
|
||||
{ requestId, logs = false }: QueueStatusOptions,
|
||||
): Promise<QueueStatus> {
|
||||
const appId = parseAppId(endpointId);
|
||||
const prefix = appId.namespace ? `${appId.namespace}/` : "";
|
||||
return send(`${prefix}${appId.owner}/${appId.alias}`, {
|
||||
subdomain: "queue",
|
||||
method: "get",
|
||||
path: `/requests/${requestId}/status`,
|
||||
input: {
|
||||
logs: logs ? "1" : "0",
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
async streamStatus(
|
||||
endpointId: string,
|
||||
{ requestId, logs = false, connectionMode }: QueueStatusStreamOptions,
|
||||
): Promise<FalStream<unknown, QueueStatus>> {
|
||||
const appId = parseAppId(endpointId);
|
||||
const prefix = appId.namespace ? `${appId.namespace}/` : "";
|
||||
|
||||
const queryParams = {
|
||||
logs: logs ? "1" : "0",
|
||||
};
|
||||
|
||||
const url = buildUrl(`${prefix}${appId.owner}/${appId.alias}`, {
|
||||
subdomain: "queue",
|
||||
path: `/requests/${requestId}/status/stream`,
|
||||
query: queryParams,
|
||||
});
|
||||
|
||||
return new FalStream<unknown, QueueStatus>(endpointId, {
|
||||
url,
|
||||
method: "get",
|
||||
connectionMode,
|
||||
queryParams,
|
||||
});
|
||||
},
|
||||
|
||||
async subscribeToStatus(endpointId, options): Promise<CompletedQueueStatus> {
|
||||
const requestId = options.requestId;
|
||||
const timeout = options.timeout;
|
||||
let timeoutId: TimeoutId = undefined;
|
||||
|
||||
const handleCancelError = () => {
|
||||
// Ignore errors as the client will follow through with the timeout
|
||||
// regardless of the server response. In case cancelation fails, we
|
||||
// still want to reject the promise and consider the client call canceled.
|
||||
};
|
||||
if (options.mode === "streaming") {
|
||||
const status = await queue.streamStatus(endpointId, {
|
||||
requestId,
|
||||
logs: options.logs,
|
||||
connectionMode:
|
||||
"connectionMode" in options
|
||||
? (options.connectionMode as StreamingConnectionMode)
|
||||
: undefined,
|
||||
});
|
||||
const logs: RequestLog[] = [];
|
||||
if (timeout) {
|
||||
timeoutId = setTimeout(() => {
|
||||
status.abort();
|
||||
queue.cancel(endpointId, { requestId }).catch(handleCancelError);
|
||||
// TODO this error cannot bubble up to the user since it's thrown in
|
||||
// a closure in the global scope due to setTimeout behavior.
|
||||
// User will get a platform error instead. We should find a way to
|
||||
// make this behavior aligned with polling.
|
||||
throw new Error(
|
||||
`Client timed out waiting for the request to complete after ${timeout}ms`,
|
||||
);
|
||||
}, timeout);
|
||||
}
|
||||
status.on("data", (data: QueueStatus) => {
|
||||
if (options.onQueueUpdate) {
|
||||
// accumulate logs to match previous polling behavior
|
||||
if (
|
||||
"logs" in data &&
|
||||
Array.isArray(data.logs) &&
|
||||
data.logs.length > 0
|
||||
) {
|
||||
logs.push(...data.logs);
|
||||
}
|
||||
options.onQueueUpdate("logs" in data ? { ...data, logs } : data);
|
||||
}
|
||||
});
|
||||
const doneStatus = await status.done();
|
||||
if (timeoutId) {
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
return doneStatus as CompletedQueueStatus;
|
||||
}
|
||||
// default to polling until status streaming is stable and faster
|
||||
return new Promise<CompletedQueueStatus>((resolve, reject) => {
|
||||
let pollingTimeoutId: TimeoutId;
|
||||
// type resolution isn't great in this case, so check for its presence
|
||||
// and and type so the typechecker behaves as expected
|
||||
const pollInterval =
|
||||
"pollInterval" in options && typeof options.pollInterval === "number"
|
||||
? (options.pollInterval ?? DEFAULT_POLL_INTERVAL)
|
||||
: DEFAULT_POLL_INTERVAL;
|
||||
|
||||
const clearScheduledTasks = () => {
|
||||
if (timeoutId) {
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
if (pollingTimeoutId) {
|
||||
clearTimeout(pollingTimeoutId);
|
||||
}
|
||||
};
|
||||
if (timeout) {
|
||||
timeoutId = setTimeout(() => {
|
||||
clearScheduledTasks();
|
||||
queue.cancel(endpointId, { requestId }).catch(handleCancelError);
|
||||
reject(
|
||||
new Error(
|
||||
`Client timed out waiting for the request to complete after ${timeout}ms`,
|
||||
),
|
||||
);
|
||||
}, timeout);
|
||||
}
|
||||
const poll = async () => {
|
||||
try {
|
||||
const requestStatus = await queue.status(endpointId, {
|
||||
requestId,
|
||||
logs: options.logs ?? false,
|
||||
});
|
||||
if (options.onQueueUpdate) {
|
||||
options.onQueueUpdate(requestStatus);
|
||||
}
|
||||
if (requestStatus.status === "COMPLETED") {
|
||||
clearScheduledTasks();
|
||||
resolve(requestStatus);
|
||||
return;
|
||||
}
|
||||
pollingTimeoutId = setTimeout(poll, pollInterval);
|
||||
} catch (error) {
|
||||
clearScheduledTasks();
|
||||
reject(error);
|
||||
}
|
||||
};
|
||||
poll().catch(reject);
|
||||
});
|
||||
},
|
||||
|
||||
async result<Output>(
|
||||
endpointId: string,
|
||||
{ requestId }: BaseQueueOptions,
|
||||
): Promise<Output> {
|
||||
const appId = parseAppId(endpointId);
|
||||
const prefix = appId.namespace ? `${appId.namespace}/` : "";
|
||||
return send(`${prefix}${appId.owner}/${appId.alias}`, {
|
||||
subdomain: "queue",
|
||||
method: "get",
|
||||
path: `/requests/${requestId}`,
|
||||
});
|
||||
},
|
||||
|
||||
async cancel(
|
||||
endpointId: string,
|
||||
{ requestId }: BaseQueueOptions,
|
||||
): Promise<void> {
|
||||
const appId = parseAppId(endpointId);
|
||||
const prefix = appId.namespace ? `${appId.namespace}/` : "";
|
||||
await send(`${prefix}${appId.owner}/${appId.alias}`, {
|
||||
subdomain: "queue",
|
||||
method: "put",
|
||||
path: `/requests/${requestId}/cancel`,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Subscribes to updates for a specific request in the queue.
|
||||
*
|
||||
* @param endpointId - The ID of the function web endpoint.
|
||||
* @param options - Options to configure how the request is run and how updates are received.
|
||||
* @returns A promise that resolves to the result of the request once it's completed.
|
||||
*/
|
||||
export async function subscribe<Input, Output>(
|
||||
endpointId: string,
|
||||
options: RunOptions<Input> & QueueSubscribeOptions = {},
|
||||
): Promise<Output> {
|
||||
const { request_id: requestId } = await queue.submit(endpointId, options);
|
||||
if (options.onEnqueue) {
|
||||
options.onEnqueue(requestId);
|
||||
}
|
||||
await queue.subscribeToStatus(endpointId, { requestId, ...options });
|
||||
return queue.result(endpointId, { requestId });
|
||||
}
|
||||
@ -1,15 +1,59 @@
|
||||
export { config, getConfig } from "./config";
|
||||
export { queue, run, subscribe } from "./function";
|
||||
import { createFalClient, type FalClient } from "./client";
|
||||
import { Config } from "./config";
|
||||
import { StreamOptions } from "./streaming";
|
||||
import { RunOptions } from "./types";
|
||||
|
||||
export { createFalClient, type FalClient } from "./client";
|
||||
export { withMiddleware, withProxy } from "./middleware";
|
||||
export type { RequestMiddleware } from "./middleware";
|
||||
export { realtimeImpl as realtime } from "./realtime";
|
||||
export type { QueueClient } from "./queue";
|
||||
export type { RealtimeClient } from "./realtime";
|
||||
export { ApiError, ValidationError } from "./response";
|
||||
export type { ResponseHandler } from "./response";
|
||||
export { storageImpl as storage } from "./storage";
|
||||
export { stream } from "./streaming";
|
||||
export type { StorageClient } from "./storage";
|
||||
export type { StreamingClient } from "./streaming";
|
||||
export * from "./types";
|
||||
export type {
|
||||
QueueStatus,
|
||||
ValidationErrorInfo,
|
||||
WebHookResponse,
|
||||
} from "./types";
|
||||
export { parseAppId } from "./utils";
|
||||
export { parseEndpointId } from "./utils";
|
||||
|
||||
type SingletonFalClient = {
|
||||
config(config: Config): void;
|
||||
} & FalClient;
|
||||
|
||||
/**
|
||||
* Creates a singleton instance of the client. This is useful as a compatibility
|
||||
* layer for existing code that uses the clients version prior to 1.0.0.
|
||||
*/
|
||||
export const fal: SingletonFalClient = (function createSingletonFalClient() {
|
||||
let currentInstance: FalClient = createFalClient();
|
||||
return {
|
||||
config(config: Config) {
|
||||
currentInstance = createFalClient(config);
|
||||
},
|
||||
get queue() {
|
||||
return currentInstance.queue;
|
||||
},
|
||||
get realtime() {
|
||||
return currentInstance.realtime;
|
||||
},
|
||||
get storage() {
|
||||
return currentInstance.storage;
|
||||
},
|
||||
get streaming() {
|
||||
return currentInstance.streaming;
|
||||
},
|
||||
run<Output, Input>(id: string, options: RunOptions<Input>) {
|
||||
return currentInstance.run<Output, Input>(id, options);
|
||||
},
|
||||
subscribe<Output, Input>(endpointId: string, options: RunOptions<Input>) {
|
||||
return currentInstance.subscribe<Output, Input>(endpointId, options);
|
||||
},
|
||||
stream<Output, Input>(endpointId: string, options: StreamOptions<Input>) {
|
||||
return currentInstance.stream<Output, Input>(endpointId, options);
|
||||
},
|
||||
} satisfies SingletonFalClient;
|
||||
})();
|
||||
|
||||
@ -26,12 +26,16 @@ export type RequestMiddleware = (
|
||||
export function withMiddleware(
|
||||
...middlewares: RequestMiddleware[]
|
||||
): RequestMiddleware {
|
||||
return (config) =>
|
||||
middlewares.reduce(
|
||||
(configPromise, middleware) =>
|
||||
configPromise.then((req) => middleware(req)),
|
||||
Promise.resolve(config),
|
||||
);
|
||||
const isDefined = (middleware: RequestMiddleware): boolean =>
|
||||
typeof middleware === "function";
|
||||
|
||||
return async (config: RequestConfig) => {
|
||||
let currentConfig = { ...config };
|
||||
for (const middleware of middlewares.filter(isDefined)) {
|
||||
currentConfig = await middleware(currentConfig);
|
||||
}
|
||||
return currentConfig;
|
||||
};
|
||||
}
|
||||
|
||||
export type RequestProxyConfig = {
|
||||
@ -41,12 +45,17 @@ export type RequestProxyConfig = {
|
||||
export const TARGET_URL_HEADER = "x-fal-target-url";
|
||||
|
||||
export function withProxy(config: RequestProxyConfig): RequestMiddleware {
|
||||
const passthrough = (requestConfig: RequestConfig) =>
|
||||
Promise.resolve(requestConfig);
|
||||
// when running on the server, we don't need to proxy the request
|
||||
if (typeof window === "undefined") {
|
||||
return (requestConfig) => Promise.resolve(requestConfig);
|
||||
return passthrough;
|
||||
}
|
||||
// if x-fal-target-url is already set, we skip it
|
||||
return (requestConfig) =>
|
||||
Promise.resolve({
|
||||
requestConfig.headers && TARGET_URL_HEADER in requestConfig
|
||||
? passthrough(requestConfig)
|
||||
: Promise.resolve({
|
||||
...requestConfig,
|
||||
url: config.targetUrl,
|
||||
headers: {
|
||||
|
||||
420
libs/client/src/queue.ts
Normal file
420
libs/client/src/queue.ts
Normal file
@ -0,0 +1,420 @@
|
||||
import { RequiredConfig } from "./config";
|
||||
import { buildUrl, dispatchRequest } from "./request";
|
||||
import { resultResponseHandler } from "./response";
|
||||
import { StorageClient } from "./storage";
|
||||
import { FalStream, StreamingConnectionMode } from "./streaming";
|
||||
import {
|
||||
CompletedQueueStatus,
|
||||
InQueueQueueStatus,
|
||||
QueueStatus,
|
||||
RequestLog,
|
||||
Result,
|
||||
RunOptions,
|
||||
} from "./types";
|
||||
import { parseEndpointId } from "./utils";
|
||||
|
||||
export type QueueStatusSubscriptionOptions = QueueStatusOptions &
|
||||
Omit<QueueSubscribeOptions, "onEnqueue" | "webhookUrl">;
|
||||
|
||||
type TimeoutId = ReturnType<typeof setTimeout> | undefined;
|
||||
|
||||
const DEFAULT_POLL_INTERVAL = 500;
|
||||
|
||||
/**
|
||||
* Options for subscribing to the request queue.
|
||||
*/
|
||||
export type QueueSubscribeOptions = {
|
||||
/**
|
||||
* The mode to use for subscribing to updates. It defaults to `polling`.
|
||||
* You can also use client-side streaming by setting it to `streaming`.
|
||||
*
|
||||
* **Note:** Streaming is currently experimental and once stable, it will
|
||||
* be the default mode.
|
||||
*
|
||||
* @see pollInterval
|
||||
*/
|
||||
mode?: "polling" | "streaming";
|
||||
|
||||
/**
|
||||
* Callback function that is called when a request is enqueued.
|
||||
* @param requestId - The unique identifier for the enqueued request.
|
||||
*/
|
||||
onEnqueue?: (requestId: string) => void;
|
||||
|
||||
/**
|
||||
* Callback function that is called when the status of the queue changes.
|
||||
* @param status - The current status of the queue.
|
||||
*/
|
||||
onQueueUpdate?: (status: QueueStatus) => void;
|
||||
|
||||
/**
|
||||
* If `true`, the response will include the logs for the request.
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
logs?: boolean;
|
||||
|
||||
/**
|
||||
* The timeout (in milliseconds) for the request. If the request is not
|
||||
* completed within this time, the subscription will be cancelled.
|
||||
*
|
||||
* Keep in mind that although the client resolves the function on a timeout,
|
||||
* and will try to cancel the request on the server, the server might not be
|
||||
* able to cancel the request if it's already running.
|
||||
*
|
||||
* Note: currently, the timeout is not enforced and the default is `undefined`.
|
||||
* This behavior might change in the future.
|
||||
*/
|
||||
timeout?: number;
|
||||
|
||||
/**
|
||||
* The URL to send a webhook notification to when the request is completed.
|
||||
* @see WebHookResponse
|
||||
*/
|
||||
webhookUrl?: string;
|
||||
} & (
|
||||
| {
|
||||
mode?: "polling";
|
||||
/**
|
||||
* The interval (in milliseconds) at which to poll for updates.
|
||||
* If not provided, a default value of `500` will be used.
|
||||
*
|
||||
* This value is ignored if `mode` is set to `streaming`.
|
||||
*/
|
||||
pollInterval?: number;
|
||||
}
|
||||
| {
|
||||
mode: "streaming";
|
||||
|
||||
/**
|
||||
* The connection mode to use for streaming updates. It defaults to `server`.
|
||||
* Set to `client` if your server proxy doesn't support streaming.
|
||||
*/
|
||||
connectionMode?: StreamingConnectionMode;
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Options for submitting a request to the queue.
|
||||
*/
|
||||
export type SubmitOptions<Input> = RunOptions<Input> & {
|
||||
/**
|
||||
* The URL to send a webhook notification to when the request is completed.
|
||||
* @see WebHookResponse
|
||||
*/
|
||||
webhookUrl?: string;
|
||||
};
|
||||
|
||||
type BaseQueueOptions = {
|
||||
/**
|
||||
* The unique identifier for the enqueued request.
|
||||
*/
|
||||
requestId: string;
|
||||
};
|
||||
|
||||
export type QueueStatusOptions = BaseQueueOptions & {
|
||||
/**
|
||||
* If `true`, the response will include the logs for the request.
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
logs?: boolean;
|
||||
};
|
||||
|
||||
export type QueueStatusStreamOptions = QueueStatusOptions & {
|
||||
/**
|
||||
* The connection mode to use for streaming updates. It defaults to `server`.
|
||||
* Set to `client` if your server proxy doesn't support streaming.
|
||||
*/
|
||||
connectionMode?: StreamingConnectionMode;
|
||||
};
|
||||
|
||||
/**
|
||||
* Represents a request queue with methods for submitting requests,
|
||||
* checking their status, retrieving results, and subscribing to updates.
|
||||
*/
|
||||
export interface QueueClient {
|
||||
/**
|
||||
* Submits a request to the queue.
|
||||
*
|
||||
* @param endpointId - The ID of the function web endpoint.
|
||||
* @param options - Options to configure how the request is run.
|
||||
* @returns A promise that resolves to the result of enqueuing the request.
|
||||
*/
|
||||
submit<Input>(
|
||||
endpointId: string,
|
||||
options: SubmitOptions<Input>,
|
||||
): Promise<InQueueQueueStatus>;
|
||||
|
||||
/**
|
||||
* Retrieves the status of a specific request in the queue.
|
||||
*
|
||||
* @param endpointId - The ID of the function web endpoint.
|
||||
* @param options - Options to configure how the request is run.
|
||||
* @returns A promise that resolves to the status of the request.
|
||||
*/
|
||||
status(endpointId: string, options: QueueStatusOptions): Promise<QueueStatus>;
|
||||
|
||||
/**
|
||||
* Subscribes to updates for a specific request in the queue using HTTP streaming events.
|
||||
*
|
||||
* @param endpointId - The ID of the function web endpoint.
|
||||
* @param options - Options to configure how the request is run and how updates are received.
|
||||
* @returns The streaming object that can be used to listen for updates.
|
||||
*/
|
||||
streamStatus(
|
||||
endpointId: string,
|
||||
options: QueueStatusStreamOptions,
|
||||
): Promise<FalStream<unknown, QueueStatus>>;
|
||||
|
||||
/**
|
||||
* Subscribes to updates for a specific request in the queue using polling or streaming.
|
||||
* See `options.mode` for more details.
|
||||
*
|
||||
* @param endpointId - The ID of the function web endpoint.
|
||||
* @param options - Options to configure how the request is run and how updates are received.
|
||||
* @returns A promise that resolves to the final status of the request.
|
||||
*/
|
||||
subscribeToStatus(
|
||||
endpointId: string,
|
||||
options: QueueStatusSubscriptionOptions,
|
||||
): Promise<CompletedQueueStatus>;
|
||||
|
||||
/**
|
||||
* Retrieves the result of a specific request from the queue.
|
||||
*
|
||||
* @param endpointId - The ID of the function web endpoint.
|
||||
* @param options - Options to configure how the request is run.
|
||||
* @returns A promise that resolves to the result of the request.
|
||||
*/
|
||||
result<Output>(
|
||||
endpointId: string,
|
||||
options: BaseQueueOptions,
|
||||
): Promise<Result<Output>>;
|
||||
|
||||
/**
|
||||
* Cancels a request in the queue.
|
||||
*
|
||||
* @param endpointId - The ID of the function web endpoint.
|
||||
* @param options - Options to configure how the request
|
||||
* is run and how updates are received.
|
||||
* @returns A promise that resolves once the request is cancelled.
|
||||
* @throws {Error} If the request cannot be cancelled.
|
||||
*/
|
||||
cancel(endpointId: string, options: BaseQueueOptions): Promise<void>;
|
||||
}
|
||||
|
||||
type QueueClientDependencies = {
|
||||
config: RequiredConfig;
|
||||
storage: StorageClient;
|
||||
};
|
||||
|
||||
export const createQueueClient = ({
|
||||
config,
|
||||
storage,
|
||||
}: QueueClientDependencies): QueueClient => {
|
||||
const ref: QueueClient = {
|
||||
async submit<Input>(
|
||||
endpointId: string,
|
||||
options: SubmitOptions<Input>,
|
||||
): Promise<InQueueQueueStatus> {
|
||||
const { webhookUrl, ...runOptions } = options;
|
||||
const input = options.input
|
||||
? await storage.transformInput(options.input)
|
||||
: undefined;
|
||||
return dispatchRequest<Input, InQueueQueueStatus>({
|
||||
method: options.method,
|
||||
targetUrl: buildUrl(endpointId, {
|
||||
...runOptions,
|
||||
subdomain: "queue",
|
||||
query: webhookUrl ? { fal_webhook: webhookUrl } : undefined,
|
||||
}),
|
||||
input: input as Input,
|
||||
config,
|
||||
});
|
||||
},
|
||||
async status(
|
||||
endpointId: string,
|
||||
{ requestId, logs = false }: QueueStatusOptions,
|
||||
): Promise<QueueStatus> {
|
||||
const appId = parseEndpointId(endpointId);
|
||||
const prefix = appId.namespace ? `${appId.namespace}/` : "";
|
||||
return dispatchRequest<unknown, QueueStatus>({
|
||||
method: "get",
|
||||
targetUrl: buildUrl(`${prefix}${appId.owner}/${appId.alias}`, {
|
||||
subdomain: "queue",
|
||||
query: { logs: logs ? "1" : "0" },
|
||||
path: `/requests/${requestId}/status`,
|
||||
}),
|
||||
config,
|
||||
});
|
||||
},
|
||||
|
||||
async streamStatus(
|
||||
endpointId: string,
|
||||
{ requestId, logs = false, connectionMode }: QueueStatusStreamOptions,
|
||||
): Promise<FalStream<unknown, QueueStatus>> {
|
||||
const appId = parseEndpointId(endpointId);
|
||||
const prefix = appId.namespace ? `${appId.namespace}/` : "";
|
||||
|
||||
const queryParams = {
|
||||
logs: logs ? "1" : "0",
|
||||
};
|
||||
|
||||
const url = buildUrl(`${prefix}${appId.owner}/${appId.alias}`, {
|
||||
subdomain: "queue",
|
||||
path: `/requests/${requestId}/status/stream`,
|
||||
query: queryParams,
|
||||
});
|
||||
|
||||
return new FalStream<unknown, QueueStatus>(endpointId, config, {
|
||||
url,
|
||||
method: "get",
|
||||
connectionMode,
|
||||
queryParams,
|
||||
});
|
||||
},
|
||||
|
||||
async subscribeToStatus(
|
||||
endpointId,
|
||||
options,
|
||||
): Promise<CompletedQueueStatus> {
|
||||
const requestId = options.requestId;
|
||||
const timeout = options.timeout;
|
||||
let timeoutId: TimeoutId = undefined;
|
||||
|
||||
const handleCancelError = () => {
|
||||
// Ignore errors as the client will follow through with the timeout
|
||||
// regardless of the server response. In case cancelation fails, we
|
||||
// still want to reject the promise and consider the client call canceled.
|
||||
};
|
||||
if (options.mode === "streaming") {
|
||||
const status = await ref.streamStatus(endpointId, {
|
||||
requestId,
|
||||
logs: options.logs,
|
||||
connectionMode:
|
||||
"connectionMode" in options
|
||||
? (options.connectionMode as StreamingConnectionMode)
|
||||
: undefined,
|
||||
});
|
||||
const logs: RequestLog[] = [];
|
||||
if (timeout) {
|
||||
timeoutId = setTimeout(() => {
|
||||
status.abort();
|
||||
ref.cancel(endpointId, { requestId }).catch(handleCancelError);
|
||||
// TODO this error cannot bubble up to the user since it's thrown in
|
||||
// a closure in the global scope due to setTimeout behavior.
|
||||
// User will get a platform error instead. We should find a way to
|
||||
// make this behavior aligned with polling.
|
||||
throw new Error(
|
||||
`Client timed out waiting for the request to complete after ${timeout}ms`,
|
||||
);
|
||||
}, timeout);
|
||||
}
|
||||
status.on("data", (data: QueueStatus) => {
|
||||
if (options.onQueueUpdate) {
|
||||
// accumulate logs to match previous polling behavior
|
||||
if (
|
||||
"logs" in data &&
|
||||
Array.isArray(data.logs) &&
|
||||
data.logs.length > 0
|
||||
) {
|
||||
logs.push(...data.logs);
|
||||
}
|
||||
options.onQueueUpdate("logs" in data ? { ...data, logs } : data);
|
||||
}
|
||||
});
|
||||
const doneStatus = await status.done();
|
||||
if (timeoutId) {
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
return doneStatus as CompletedQueueStatus;
|
||||
}
|
||||
// default to polling until status streaming is stable and faster
|
||||
return new Promise<CompletedQueueStatus>((resolve, reject) => {
|
||||
let pollingTimeoutId: TimeoutId;
|
||||
// type resolution isn't great in this case, so check for its presence
|
||||
// and and type so the typechecker behaves as expected
|
||||
const pollInterval =
|
||||
"pollInterval" in options && typeof options.pollInterval === "number"
|
||||
? (options.pollInterval ?? DEFAULT_POLL_INTERVAL)
|
||||
: DEFAULT_POLL_INTERVAL;
|
||||
|
||||
const clearScheduledTasks = () => {
|
||||
if (timeoutId) {
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
if (pollingTimeoutId) {
|
||||
clearTimeout(pollingTimeoutId);
|
||||
}
|
||||
};
|
||||
if (timeout) {
|
||||
timeoutId = setTimeout(() => {
|
||||
clearScheduledTasks();
|
||||
ref.cancel(endpointId, { requestId }).catch(handleCancelError);
|
||||
reject(
|
||||
new Error(
|
||||
`Client timed out waiting for the request to complete after ${timeout}ms`,
|
||||
),
|
||||
);
|
||||
}, timeout);
|
||||
}
|
||||
const poll = async () => {
|
||||
try {
|
||||
const requestStatus = await ref.status(endpointId, {
|
||||
requestId,
|
||||
logs: options.logs ?? false,
|
||||
});
|
||||
if (options.onQueueUpdate) {
|
||||
options.onQueueUpdate(requestStatus);
|
||||
}
|
||||
if (requestStatus.status === "COMPLETED") {
|
||||
clearScheduledTasks();
|
||||
resolve(requestStatus);
|
||||
return;
|
||||
}
|
||||
pollingTimeoutId = setTimeout(poll, pollInterval);
|
||||
} catch (error) {
|
||||
clearScheduledTasks();
|
||||
reject(error);
|
||||
}
|
||||
};
|
||||
poll().catch(reject);
|
||||
});
|
||||
},
|
||||
|
||||
async result<Output>(
|
||||
endpointId: string,
|
||||
{ requestId }: BaseQueueOptions,
|
||||
): Promise<Result<Output>> {
|
||||
const appId = parseEndpointId(endpointId);
|
||||
const prefix = appId.namespace ? `${appId.namespace}/` : "";
|
||||
return dispatchRequest<unknown, Result<Output>>({
|
||||
method: "get",
|
||||
targetUrl: buildUrl(`${prefix}${appId.owner}/${appId.alias}`, {
|
||||
subdomain: "queue",
|
||||
path: `/requests/${requestId}`,
|
||||
}),
|
||||
config: {
|
||||
...config,
|
||||
responseHandler: resultResponseHandler,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
async cancel(
|
||||
endpointId: string,
|
||||
{ requestId }: BaseQueueOptions,
|
||||
): Promise<void> {
|
||||
const appId = parseEndpointId(endpointId);
|
||||
const prefix = appId.namespace ? `${appId.namespace}/` : "";
|
||||
await dispatchRequest<unknown, void>({
|
||||
method: "put",
|
||||
targetUrl: buildUrl(`${prefix}${appId.owner}/${appId.alias}`, {
|
||||
subdomain: "queue",
|
||||
path: `/requests/${requestId}/cancel`,
|
||||
}),
|
||||
config,
|
||||
});
|
||||
},
|
||||
};
|
||||
return ref;
|
||||
};
|
||||
@ -13,9 +13,10 @@ import {
|
||||
transition,
|
||||
} from "robot3";
|
||||
import { TOKEN_EXPIRATION_SECONDS, getTemporaryAuthToken } from "./auth";
|
||||
import { RequiredConfig } from "./config";
|
||||
import { ApiError } from "./response";
|
||||
import { isBrowser } from "./runtime";
|
||||
import { ensureAppIdFormat, isReact, throttle } from "./utils";
|
||||
import { ensureEndpointIdFormat, isReact, throttle } from "./utils";
|
||||
|
||||
// Define the context
|
||||
interface Context {
|
||||
@ -258,7 +259,7 @@ function buildRealtimeUrl(
|
||||
if (maxBuffering !== undefined) {
|
||||
queryParams.set("max_buffering", maxBuffering.toFixed(0));
|
||||
}
|
||||
const appId = ensureAppIdFormat(app);
|
||||
const appId = ensureEndpointIdFormat(app);
|
||||
return `wss://fal.run/${appId}/realtime?${queryParams.toString()}`;
|
||||
}
|
||||
|
||||
@ -346,10 +347,14 @@ function isFalErrorResult(data: any): data is FalErrorResult {
|
||||
return data.type === "x-fal-error";
|
||||
}
|
||||
|
||||
/**
|
||||
* The default implementation of the realtime client.
|
||||
*/
|
||||
export const realtimeImpl: RealtimeClient = {
|
||||
type RealtimeClientDependencies = {
|
||||
config: RequiredConfig;
|
||||
};
|
||||
|
||||
export function createRealtimeClient({
|
||||
config,
|
||||
}: RealtimeClientDependencies): RealtimeClient {
|
||||
return {
|
||||
connect<Input, Output>(
|
||||
app: string,
|
||||
handler: RealtimeConnectionHandler<Output>,
|
||||
@ -392,7 +397,7 @@ export const realtimeImpl: RealtimeClient = {
|
||||
previousState !== machine.current
|
||||
) {
|
||||
send({ type: "initiateAuth" });
|
||||
getTemporaryAuthToken(app)
|
||||
getTemporaryAuthToken(app, config)
|
||||
.then((token) => {
|
||||
send({ type: "authenticated", token });
|
||||
const tokenExpirationTimeout = Math.round(
|
||||
@ -463,7 +468,10 @@ export const realtimeImpl: RealtimeClient = {
|
||||
// In the future, we might want to handle other types of messages.
|
||||
// TODO: specify the fal ws protocol format
|
||||
if (isUnauthorizedError(data)) {
|
||||
send({ type: "unauthorized", error: new Error("Unauthorized") });
|
||||
send({
|
||||
type: "unauthorized",
|
||||
error: new Error("Unauthorized"),
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (isSuccessfulResult(data)) {
|
||||
@ -520,4 +528,5 @@ export const realtimeImpl: RealtimeClient = {
|
||||
close,
|
||||
};
|
||||
},
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import { getConfig } from "./config";
|
||||
import { RequiredConfig } from "./config";
|
||||
import { ResponseHandler } from "./response";
|
||||
import { getUserAgent, isBrowser } from "./runtime";
|
||||
import { RunOptions, UrlOptions } from "./types";
|
||||
import { ensureEndpointIdFormat, isValidUrl } from "./utils";
|
||||
|
||||
const isCloudflareWorkers =
|
||||
typeof navigator !== "undefined" &&
|
||||
@ -10,27 +12,33 @@ type RequestOptions = {
|
||||
responseHandler?: ResponseHandler<any>;
|
||||
};
|
||||
|
||||
type RequestParams<Input = any> = {
|
||||
method?: string;
|
||||
targetUrl: string;
|
||||
input?: Input;
|
||||
config: RequiredConfig;
|
||||
options?: RequestOptions & RequestInit;
|
||||
};
|
||||
|
||||
export async function dispatchRequest<Input, Output>(
|
||||
method: string,
|
||||
targetUrl: string,
|
||||
input: Input,
|
||||
options: RequestOptions & RequestInit = {},
|
||||
params: RequestParams<Input>,
|
||||
): Promise<Output> {
|
||||
const { targetUrl, input, config, options = {} } = params;
|
||||
const {
|
||||
credentials: credentialsValue,
|
||||
requestMiddleware,
|
||||
responseHandler,
|
||||
fetch,
|
||||
} = getConfig();
|
||||
} = config;
|
||||
const userAgent = isBrowser() ? {} : { "User-Agent": getUserAgent() };
|
||||
const credentials =
|
||||
typeof credentialsValue === "function"
|
||||
? credentialsValue()
|
||||
: credentialsValue;
|
||||
|
||||
const { url, headers } = await requestMiddleware({
|
||||
const { method, url, headers } = await requestMiddleware({
|
||||
method: (params.method ?? options.method ?? "post").toUpperCase(),
|
||||
url: targetUrl,
|
||||
method: method.toUpperCase(),
|
||||
});
|
||||
const authHeader = credentials ? { Authorization: `Key ${credentials}` } : {};
|
||||
const requestHeaders = {
|
||||
@ -58,3 +66,41 @@ export async function dispatchRequest<Input, Output>(
|
||||
const handleResponse = customResponseHandler ?? responseHandler;
|
||||
return await handleResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the final url to run the function based on its `id` or alias and
|
||||
* a the options from `RunOptions<Input>`.
|
||||
*
|
||||
* @private
|
||||
* @param id the function id or alias
|
||||
* @param options the run options
|
||||
* @returns the final url to run the function
|
||||
*/
|
||||
export function buildUrl<Input>(
|
||||
id: string,
|
||||
options: RunOptions<Input> & UrlOptions = {},
|
||||
): string {
|
||||
const method = (options.method ?? "post").toLowerCase();
|
||||
const path = (options.path ?? "").replace(/^\//, "").replace(/\/{2,}/, "/");
|
||||
const input = options.input;
|
||||
const params = {
|
||||
...(options.query || {}),
|
||||
...(method === "get" ? input : {}),
|
||||
};
|
||||
|
||||
const queryParams =
|
||||
Object.keys(params).length > 0
|
||||
? `?${new URLSearchParams(params).toString()}`
|
||||
: "";
|
||||
|
||||
// if a fal url is passed, just use it
|
||||
if (isValidUrl(id)) {
|
||||
const url = id.endsWith("/") ? id : `${id}/`;
|
||||
return `${url}${path}${queryParams}`;
|
||||
}
|
||||
|
||||
const appId = ensureEndpointIdFormat(id);
|
||||
const subdomain = options.subdomain ? `${options.subdomain}.` : "";
|
||||
const url = `https://${subdomain}fal.run/${appId}/${path}`;
|
||||
return `${url.replace(/\/$/, "")}${queryParams}`;
|
||||
}
|
||||
|
||||
@ -1,7 +1,14 @@
|
||||
import { ValidationErrorInfo } from "./types";
|
||||
import { RequiredConfig } from "./config";
|
||||
import { Result, ValidationErrorInfo } from "./types";
|
||||
|
||||
export type ResponseHandler<Output> = (response: Response) => Promise<Output>;
|
||||
|
||||
const REQUEST_ID_HEADER = "x-fal-request-id";
|
||||
|
||||
export type ResponseHandlerCreator<Output> = (
|
||||
config: RequiredConfig,
|
||||
) => ResponseHandler<Output>;
|
||||
|
||||
type ApiErrorArgs = {
|
||||
message: string;
|
||||
status: number;
|
||||
@ -81,3 +88,13 @@ export async function defaultResponseHandler<Output>(
|
||||
// TODO convert to either number or bool automatically
|
||||
return response.text() as Promise<Output>;
|
||||
}
|
||||
|
||||
export async function resultResponseHandler<Output>(
|
||||
response: Response,
|
||||
): Promise<Result<Output>> {
|
||||
const data = await defaultResponseHandler<Output>(response);
|
||||
return {
|
||||
data,
|
||||
requestId: response.headers.get(REQUEST_ID_HEADER) || "",
|
||||
} satisfies Result<Output>;
|
||||
}
|
||||
|
||||
@ -14,6 +14,6 @@ describe("the runtime test suite", () => {
|
||||
});
|
||||
|
||||
it("should create the correct user agent identifier", () => {
|
||||
expect(getUserAgent()).toMatch(/@fal-ai\/serverless-client/);
|
||||
expect(getUserAgent()).toMatch(/@fal-ai\/client/);
|
||||
});
|
||||
});
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { getConfig, getRestApiUrl } from "./config";
|
||||
import { getRestApiUrl, RequiredConfig } from "./config";
|
||||
import { dispatchRequest } from "./request";
|
||||
import { isPlainObject } from "./utils";
|
||||
|
||||
@ -7,7 +7,7 @@ import { isPlainObject } from "./utils";
|
||||
* uploading files to the server and transforming the input to replace file
|
||||
* objects with URLs.
|
||||
*/
|
||||
export interface StorageSupport {
|
||||
export interface StorageClient {
|
||||
/**
|
||||
* Upload a file to the server. Returns the URL of the uploaded file.
|
||||
* @param file the file to upload
|
||||
@ -57,27 +57,41 @@ function getExtensionFromContentType(contentType: string): string {
|
||||
* @param file the file to upload
|
||||
* @returns the URL to upload the file to and the URL of the file once it is uploaded.
|
||||
*/
|
||||
async function initiateUpload(file: Blob): Promise<InitiateUploadResult> {
|
||||
async function initiateUpload(
|
||||
file: Blob,
|
||||
config: RequiredConfig,
|
||||
): Promise<InitiateUploadResult> {
|
||||
const contentType = file.type || "application/octet-stream";
|
||||
const filename =
|
||||
file.name || `${Date.now()}.${getExtensionFromContentType(contentType)}`;
|
||||
return await dispatchRequest<InitiateUploadData, InitiateUploadResult>(
|
||||
"POST",
|
||||
`${getRestApiUrl()}/storage/upload/initiate`,
|
||||
{
|
||||
return await dispatchRequest<InitiateUploadData, InitiateUploadResult>({
|
||||
method: "POST",
|
||||
targetUrl: `${getRestApiUrl()}/storage/upload/initiate`,
|
||||
input: {
|
||||
content_type: contentType,
|
||||
file_name: filename,
|
||||
},
|
||||
);
|
||||
config,
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
type KeyValuePair = [string, any];
|
||||
|
||||
export const storageImpl: StorageSupport = {
|
||||
type StorageClientDependencies = {
|
||||
config: RequiredConfig;
|
||||
};
|
||||
|
||||
export function createStorageClient({
|
||||
config,
|
||||
}: StorageClientDependencies): StorageClient {
|
||||
const ref: StorageClient = {
|
||||
upload: async (file: Blob) => {
|
||||
const { fetch } = getConfig();
|
||||
const { upload_url: uploadUrl, file_url: url } = await initiateUpload(file);
|
||||
const { fetch, responseHandler } = config;
|
||||
const { upload_url: uploadUrl, file_url: url } = await initiateUpload(
|
||||
file,
|
||||
config,
|
||||
);
|
||||
const response = await fetch(uploadUrl, {
|
||||
method: "PUT",
|
||||
body: file,
|
||||
@ -85,7 +99,6 @@ export const storageImpl: StorageSupport = {
|
||||
"Content-Type": file.type || "application/octet-stream",
|
||||
},
|
||||
});
|
||||
const { responseHandler } = getConfig();
|
||||
await responseHandler(response);
|
||||
return url;
|
||||
},
|
||||
@ -93,14 +106,14 @@ export const storageImpl: StorageSupport = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
transformInput: async (input: any): Promise<any> => {
|
||||
if (Array.isArray(input)) {
|
||||
return Promise.all(input.map((item) => storageImpl.transformInput(item)));
|
||||
return Promise.all(input.map((item) => ref.transformInput(item)));
|
||||
} else if (input instanceof Blob) {
|
||||
return await storageImpl.upload(input);
|
||||
return await ref.upload(input);
|
||||
} else if (isPlainObject(input)) {
|
||||
const inputObject = input as Record<string, any>;
|
||||
const promises = Object.entries(inputObject).map(
|
||||
async ([key, value]): Promise<KeyValuePair> => {
|
||||
return [key, await storageImpl.transformInput(value)];
|
||||
return [key, await ref.transformInput(value)];
|
||||
},
|
||||
);
|
||||
const results = await Promise.all(promises);
|
||||
@ -109,4 +122,6 @@ export const storageImpl: StorageSupport = {
|
||||
// Return the input as is if it's neither an object nor a file/blob/data URI
|
||||
return input;
|
||||
},
|
||||
};
|
||||
};
|
||||
return ref;
|
||||
}
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
import { createParser } from "eventsource-parser";
|
||||
import { getTemporaryAuthToken } from "./auth";
|
||||
import { getConfig } from "./config";
|
||||
import { buildUrl } from "./function";
|
||||
import { dispatchRequest } from "./request";
|
||||
import { RequiredConfig } from "./config";
|
||||
import { buildUrl, dispatchRequest } from "./request";
|
||||
import { ApiError, defaultResponseHandler } from "./response";
|
||||
import { storageImpl } from "./storage";
|
||||
import { type StorageClient } from "./storage";
|
||||
|
||||
export type StreamingConnectionMode = "client" | "server";
|
||||
|
||||
@ -14,7 +13,7 @@ const CONTENT_TYPE_EVENT_STREAM = "text/event-stream";
|
||||
* The stream API options. It requires the API input and also
|
||||
* offers configuration options.
|
||||
*/
|
||||
type StreamOptions<Input> = {
|
||||
export type StreamOptions<Input> = {
|
||||
/**
|
||||
* The endpoint URL. If not provided, it will be generated from the
|
||||
* `endpointId` and the `queryParams`.
|
||||
@ -76,6 +75,7 @@ type EventHandler<T = any> = (event: T) => void;
|
||||
*/
|
||||
export class FalStream<Input, Output> {
|
||||
// properties
|
||||
config: RequiredConfig;
|
||||
endpointId: string;
|
||||
url: string;
|
||||
options: StreamOptions<Input>;
|
||||
@ -92,8 +92,13 @@ export class FalStream<Input, Output> {
|
||||
|
||||
private abortController = new AbortController();
|
||||
|
||||
constructor(endpointId: string, options: StreamOptions<Input>) {
|
||||
constructor(
|
||||
endpointId: string,
|
||||
config: RequiredConfig,
|
||||
options: StreamOptions<Input>,
|
||||
) {
|
||||
this.endpointId = endpointId;
|
||||
this.config = config;
|
||||
this.url =
|
||||
options.url ??
|
||||
buildUrl(endpointId, {
|
||||
@ -130,8 +135,8 @@ export class FalStream<Input, Output> {
|
||||
if (connectionMode === "client") {
|
||||
// if we are in the browser, we need to get a temporary token
|
||||
// to authenticate the request
|
||||
const token = await getTemporaryAuthToken(endpointId);
|
||||
const { fetch } = getConfig();
|
||||
const token = await getTemporaryAuthToken(endpointId, this.config);
|
||||
const { fetch } = this.config;
|
||||
const parsedUrl = new URL(this.url);
|
||||
parsedUrl.searchParams.set("fal_jwt_token", token);
|
||||
const response = await fetch(parsedUrl.toString(), {
|
||||
@ -145,12 +150,18 @@ export class FalStream<Input, Output> {
|
||||
});
|
||||
return await this.handleResponse(response);
|
||||
}
|
||||
return await dispatchRequest(method.toUpperCase(), this.url, input, {
|
||||
return await dispatchRequest({
|
||||
method: method.toUpperCase(),
|
||||
targetUrl: this.url,
|
||||
input,
|
||||
config: this.config,
|
||||
options: {
|
||||
headers: {
|
||||
accept: options.accept ?? CONTENT_TYPE_EVENT_STREAM,
|
||||
},
|
||||
responseHandler: this.handleResponse,
|
||||
signal: this.abortController.signal,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
this.handleError(error);
|
||||
@ -182,9 +193,9 @@ export class FalStream<Input, Output> {
|
||||
return;
|
||||
}
|
||||
|
||||
const isEventStream = response.headers
|
||||
.get("content-type")
|
||||
.startsWith(CONTENT_TYPE_EVENT_STREAM);
|
||||
const isEventStream = (
|
||||
response.headers.get("content-type") ?? ""
|
||||
).startsWith(CONTENT_TYPE_EVENT_STREAM);
|
||||
// any response that is not a text/event-stream will be handled as a binary stream
|
||||
if (!isEventStream) {
|
||||
const reader = body.getReader();
|
||||
@ -317,6 +328,10 @@ export class FalStream<Input, Output> {
|
||||
}
|
||||
|
||||
/**
|
||||
* The streaming client interface.
|
||||
*/
|
||||
export interface StreamingClient {
|
||||
/**
|
||||
* Calls a fal app that supports streaming and provides a streaming-capable
|
||||
* object as a result, that can be used to get partial results through either
|
||||
* `AsyncIterator` or through an event listener.
|
||||
@ -325,16 +340,33 @@ export class FalStream<Input, Output> {
|
||||
* @param options the request options, including the input payload.
|
||||
* @returns the `FalStream` instance.
|
||||
*/
|
||||
export async function stream<Input = Record<string, any>, Output = any>(
|
||||
stream<Output = any, Input = Record<string, any>>(
|
||||
endpointId: string,
|
||||
options: StreamOptions<Input>,
|
||||
): Promise<FalStream<Input, Output>> {
|
||||
const input =
|
||||
options.input && options.autoUpload !== false
|
||||
? await storageImpl.transformInput(options.input)
|
||||
: options.input;
|
||||
return new FalStream<Input, Output>(endpointId, {
|
||||
): Promise<FalStream<Input, Output>>;
|
||||
}
|
||||
|
||||
type StreamingClientDependencies = {
|
||||
config: RequiredConfig;
|
||||
storage: StorageClient;
|
||||
};
|
||||
|
||||
export function createStreamingClient({
|
||||
config,
|
||||
storage,
|
||||
}: StreamingClientDependencies): StreamingClient {
|
||||
return {
|
||||
async stream<Input, Output>(
|
||||
endpointId: string,
|
||||
options: StreamOptions<Input>,
|
||||
) {
|
||||
const input = options.input
|
||||
? await storage.transformInput(options.input)
|
||||
: undefined;
|
||||
return new FalStream<Input, Output>(endpointId, config, {
|
||||
...options,
|
||||
input: input as Input,
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,9 +1,46 @@
|
||||
/**
|
||||
* Represents an API result, containing the data,
|
||||
* the request ID and any other relevant information.
|
||||
*/
|
||||
export type Result<T> = {
|
||||
result: T;
|
||||
data: T;
|
||||
requestId: string;
|
||||
};
|
||||
|
||||
export type EnqueueResult = {
|
||||
request_id: string;
|
||||
/**
|
||||
* The function input and other configuration when running
|
||||
* the function, such as the HTTP method to use.
|
||||
*/
|
||||
export type RunOptions<Input> = {
|
||||
/**
|
||||
* The function input. It will be submitted either as query params
|
||||
* or the body payload, depending on the `method`.
|
||||
*/
|
||||
readonly input?: Input;
|
||||
|
||||
/**
|
||||
* The HTTP method, defaults to `post`;
|
||||
*/
|
||||
readonly method?: "get" | "post" | "put" | "delete" | string;
|
||||
};
|
||||
|
||||
export type UrlOptions = {
|
||||
/**
|
||||
* If `true`, the function will use the queue to run the function
|
||||
* asynchronously and return the result in a separate call. This
|
||||
* influences how the URL is built.
|
||||
*/
|
||||
readonly subdomain?: string;
|
||||
|
||||
/**
|
||||
* The query parameters to include in the URL.
|
||||
*/
|
||||
readonly query?: Record<string, string>;
|
||||
|
||||
/**
|
||||
* The path to append to the function URL.
|
||||
*/
|
||||
path?: string;
|
||||
};
|
||||
|
||||
export type RequestLog = {
|
||||
@ -18,7 +55,14 @@ export type Metrics = {
|
||||
};
|
||||
|
||||
interface BaseQueueStatus {
|
||||
status: "IN_PROGRESS" | "COMPLETED" | "IN_QUEUE";
|
||||
status: "IN_QUEUE" | "IN_PROGRESS" | "COMPLETED";
|
||||
request_id: string;
|
||||
}
|
||||
|
||||
export interface InQueueQueueStatus extends BaseQueueStatus {
|
||||
status: "IN_QUEUE";
|
||||
queue_position: number;
|
||||
response_url: string;
|
||||
}
|
||||
|
||||
export interface InProgressQueueStatus extends BaseQueueStatus {
|
||||
@ -31,19 +75,13 @@ export interface CompletedQueueStatus extends BaseQueueStatus {
|
||||
status: "COMPLETED";
|
||||
response_url: string;
|
||||
logs: RequestLog[];
|
||||
metrics: Metrics;
|
||||
}
|
||||
|
||||
export interface EnqueuedQueueStatus extends BaseQueueStatus {
|
||||
status: "IN_QUEUE";
|
||||
queue_position: number;
|
||||
response_url: string;
|
||||
metrics?: Metrics;
|
||||
}
|
||||
|
||||
export type QueueStatus =
|
||||
| InProgressQueueStatus
|
||||
| CompletedQueueStatus
|
||||
| EnqueuedQueueStatus;
|
||||
| InQueueQueueStatus;
|
||||
|
||||
export function isQueueStatus(obj: any): obj is QueueStatus {
|
||||
return obj && obj.status && obj.response_url;
|
||||
|
||||
@ -1,24 +1,24 @@
|
||||
import { ensureAppIdFormat, parseAppId } from "./utils";
|
||||
import { ensureEndpointIdFormat, parseEndpointId } from "./utils";
|
||||
|
||||
describe("The utils test suite", () => {
|
||||
it("shoud match a current appOwner/appId format", () => {
|
||||
const id = "fal-ai/fast-sdxl";
|
||||
expect(ensureAppIdFormat(id)).toBe(id);
|
||||
expect(ensureEndpointIdFormat(id)).toBe(id);
|
||||
});
|
||||
|
||||
it("shoud match a current appOwner/appId/path format", () => {
|
||||
const id = "fal-ai/fast-sdxl/image-to-image";
|
||||
expect(ensureAppIdFormat(id)).toBe(id);
|
||||
expect(ensureEndpointIdFormat(id)).toBe(id);
|
||||
});
|
||||
|
||||
it("should throw on an invalid app id format", () => {
|
||||
const id = "just-an-id";
|
||||
expect(() => ensureAppIdFormat(id)).toThrowError();
|
||||
expect(() => ensureEndpointIdFormat(id)).toThrowError();
|
||||
});
|
||||
|
||||
it("should parse a current app id", () => {
|
||||
const id = "fal-ai/fast-sdxl";
|
||||
const parsed = parseAppId(id);
|
||||
const parsed = parseEndpointId(id);
|
||||
expect(parsed).toEqual({
|
||||
owner: "fal-ai",
|
||||
alias: "fast-sdxl",
|
||||
@ -27,7 +27,7 @@ describe("The utils test suite", () => {
|
||||
|
||||
it("should parse a current app id with path", () => {
|
||||
const id = "fal-ai/fast-sdxl/image-to-image";
|
||||
const parsed = parseAppId(id);
|
||||
const parsed = parseEndpointId(id);
|
||||
expect(parsed).toEqual({
|
||||
owner: "fal-ai",
|
||||
alias: "fast-sdxl",
|
||||
@ -37,7 +37,7 @@ describe("The utils test suite", () => {
|
||||
|
||||
it("should parse a current app id with namespace", () => {
|
||||
const id = "workflows/fal-ai/fast-sdxl";
|
||||
const parsed = parseAppId(id);
|
||||
const parsed = parseEndpointId(id);
|
||||
expect(parsed).toEqual({
|
||||
owner: "fal-ai",
|
||||
alias: "fast-sdxl",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
export function ensureAppIdFormat(id: string): string {
|
||||
export function ensureEndpointIdFormat(id: string): string {
|
||||
const parts = id.split("/");
|
||||
if (parts.length > 1) {
|
||||
return id;
|
||||
@ -12,26 +12,26 @@ export function ensureAppIdFormat(id: string): string {
|
||||
);
|
||||
}
|
||||
|
||||
const APP_NAMESPACES = ["workflows", "comfy"] as const;
|
||||
const ENDPOINT_NAMESPACES = ["workflows", "comfy"] as const;
|
||||
|
||||
type AppNamespace = (typeof APP_NAMESPACES)[number];
|
||||
type EndpointNamespace = (typeof ENDPOINT_NAMESPACES)[number];
|
||||
|
||||
export type AppId = {
|
||||
export type EndpointId = {
|
||||
readonly owner: string;
|
||||
readonly alias: string;
|
||||
readonly path?: string;
|
||||
readonly namespace?: AppNamespace;
|
||||
readonly namespace?: EndpointNamespace;
|
||||
};
|
||||
|
||||
export function parseAppId(id: string): AppId {
|
||||
const normalizedId = ensureAppIdFormat(id);
|
||||
export function parseEndpointId(id: string): EndpointId {
|
||||
const normalizedId = ensureEndpointIdFormat(id);
|
||||
const parts = normalizedId.split("/");
|
||||
if (APP_NAMESPACES.includes(parts[0] as any)) {
|
||||
if (ENDPOINT_NAMESPACES.includes(parts[0] as any)) {
|
||||
return {
|
||||
owner: parts[1],
|
||||
alias: parts[2],
|
||||
path: parts.slice(3).join("/") || undefined,
|
||||
namespace: parts[0] as AppNamespace,
|
||||
namespace: parts[0] as EndpointNamespace,
|
||||
};
|
||||
}
|
||||
return {
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
# fal.ai proxy library
|
||||
|
||||

|
||||

|
||||
|
||||
## Introduction
|
||||
|
||||
The `@fal-ai/serverless-proxy` library enables you to route client requests through your own server, therefore safeguarding sensitive credentials. With built-in support for popular frameworks like Next.js and Express, setting up the proxy becomes a breeze.
|
||||
The `@fal-ai/server-proxy` library enables you to route client requests through your own server, therefore safeguarding sensitive credentials. With built-in support for popular frameworks like Next.js and Express, setting up the proxy becomes a breeze.
|
||||
|
||||
### Install the proxy library:
|
||||
|
||||
```
|
||||
npm install --save @fal-ai/serverless-proxy
|
||||
npm install --save @fal-ai/server-proxy
|
||||
```
|
||||
|
||||
## Next.js page router integration
|
||||
@ -19,7 +19,7 @@ For Next.js applications using the page router:
|
||||
1. Create an API route in your Next.js app, as a convention we suggest using `pages/api/fal/proxy.js` (or `.ts` if you're using TypeScript):
|
||||
2. Re-export the proxy handler from the library as the default export:
|
||||
```ts
|
||||
export { handler as default } from "@fal-ai/serverless-proxy/nextjs";
|
||||
export { handler as default } from "@fal-ai/server-proxy/nextjs";
|
||||
```
|
||||
3. Ensure you've set the `FAL_KEY` as an environment variable in your server, containing a valid API Key.
|
||||
|
||||
@ -31,9 +31,9 @@ For Next.js applications using the app router:
|
||||
2. Re-export the proxy handler from the library as the default export:
|
||||
|
||||
```ts
|
||||
import { route } from "@fal-ai/serverless-proxy/nextjs";
|
||||
import { route } from "@fal-ai/server-proxy/nextjs";
|
||||
|
||||
export const { GET, POST } = route;
|
||||
export const { GET, POST, PUT } = route;
|
||||
```
|
||||
|
||||
3. Ensure you've set the `FAL_KEY` as an environment variable in your server, containing a valid API Key.
|
||||
@ -49,7 +49,7 @@ For Express applications:
|
||||
2. Add the proxy route and its handler. Note that if your client lives outside of the express app (i.e. the express app is solely used as an external API for other clients), you will need to allow CORS on the proxy route:
|
||||
|
||||
```ts
|
||||
import * as falProxy from "@fal-ai/serverless-proxy/express";
|
||||
import * as falProxy from "@fal-ai/server-proxy/express";
|
||||
|
||||
app.all(
|
||||
falProxy.route, // '/api/fal/proxy' or you can use your own
|
||||
@ -65,7 +65,7 @@ For Express applications:
|
||||
Once you've set up the proxy, you can configure the client to use it:
|
||||
|
||||
```ts
|
||||
import * as fal from "@fal-ai/serverless-client";
|
||||
import { fal } from "@fal-ai/client";
|
||||
|
||||
fal.config({
|
||||
proxyUrl: "/api/fal/proxy", // or https://my.app.com/api/fal/proxy
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "@fal-ai/serverless-proxy",
|
||||
"version": "0.9.0",
|
||||
"name": "@fal-ai/server-proxy",
|
||||
"description": "The fal.ai server proxy adapter for JavaScript and TypeScript Web frameworks",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -9,16 +10,17 @@
|
||||
},
|
||||
"keywords": [
|
||||
"fal",
|
||||
"serverless",
|
||||
"client",
|
||||
"next",
|
||||
"nextjs",
|
||||
"express",
|
||||
"hono",
|
||||
"proxy"
|
||||
],
|
||||
"exports": {
|
||||
".": "./src/index.js",
|
||||
"./express": "./src/express.js",
|
||||
"./hono": "./src/hono.js",
|
||||
"./nextjs": "./src/nextjs.js",
|
||||
"./remix": "./src/remix.js",
|
||||
"./svelte": "./src/svelte.js"
|
||||
@ -28,6 +30,9 @@
|
||||
"express": [
|
||||
"src/express.d.ts"
|
||||
],
|
||||
"hono": [
|
||||
"src/hono.d.ts"
|
||||
],
|
||||
"nextjs": [
|
||||
"src/nextjs.d.ts"
|
||||
],
|
||||
@ -45,6 +50,7 @@
|
||||
"@remix-run/dev": "^2.0.0",
|
||||
"@sveltejs/kit": "^2.0.0",
|
||||
"express": "^4.0.0",
|
||||
"hono": "^4.0.0",
|
||||
"next": "13.4 - 14",
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
@ -59,6 +65,9 @@
|
||||
"express": {
|
||||
"optional": true
|
||||
},
|
||||
"hono": {
|
||||
"optional": true
|
||||
},
|
||||
"next": {
|
||||
"optional": true
|
||||
},
|
||||
|
||||
51
libs/proxy/src/hono.ts
Normal file
51
libs/proxy/src/hono.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import { Context } from "hono";
|
||||
import { type StatusCode } from "hono/utils/http-status";
|
||||
import {
|
||||
handleRequest,
|
||||
HeaderValue,
|
||||
resolveApiKeyFromEnv,
|
||||
responsePassthrough,
|
||||
} from "./index";
|
||||
|
||||
export type FalHonoProxyOptions = {
|
||||
/**
|
||||
* A function to resolve the API key used by the proxy.
|
||||
* By default, it uses the `FAL_KEY` environment variable.
|
||||
*/
|
||||
resolveApiKey?: () => Promise<string | undefined>;
|
||||
};
|
||||
|
||||
type RouteHandler = (context: Context) => Promise<Response>;
|
||||
|
||||
/**
|
||||
* Creates a route handler that proxies requests to the fal API.
|
||||
*
|
||||
* This is a drop-in handler for Hono applications so that the client can be called
|
||||
* directly from the client-side code while keeping API keys safe.
|
||||
*
|
||||
* @param param the proxy options.
|
||||
* @returns a Hono route handler function.
|
||||
*/
|
||||
export function createRouteHandler({
|
||||
resolveApiKey = resolveApiKeyFromEnv,
|
||||
}: FalHonoProxyOptions): RouteHandler {
|
||||
const routeHandler: RouteHandler = async (context) => {
|
||||
const responseHeaders: Record<string, HeaderValue> = {};
|
||||
const response = await handleRequest({
|
||||
id: "hono",
|
||||
method: context.req.method,
|
||||
respondWith: (status, data) => {
|
||||
return context.json(data, status as StatusCode, responseHeaders);
|
||||
},
|
||||
getHeaders: () => responseHeaders,
|
||||
getHeader: (name) => context.req.header[name],
|
||||
sendHeader: (name, value) => (responseHeaders[name] = value),
|
||||
getRequestBody: async () => JSON.stringify(await context.req.json()),
|
||||
sendResponse: responsePassthrough,
|
||||
resolveApiKey,
|
||||
});
|
||||
return response;
|
||||
};
|
||||
|
||||
return routeHandler;
|
||||
}
|
||||
@ -57,8 +57,8 @@ function getFalKey(): string | undefined {
|
||||
const EXCLUDED_HEADERS = ["content-length", "content-encoding"];
|
||||
|
||||
/**
|
||||
* A request handler that proxies the request to the fal-serverless
|
||||
* endpoint. This is useful so client-side calls to the fal-serverless endpoint
|
||||
* A request handler that proxies the request to the fal API
|
||||
* endpoint. This is useful so client-side calls to the fal endpoint
|
||||
* can be made without CORS issues and the correct credentials can be added
|
||||
* effortlessly.
|
||||
*
|
||||
@ -93,7 +93,7 @@ export async function handleRequest<ResponseType>(
|
||||
}
|
||||
});
|
||||
|
||||
const proxyUserAgent = `@fal-ai/serverless-proxy/${behavior.id}`;
|
||||
const proxyUserAgent = `@fal-ai/server-proxy/${behavior.id}`;
|
||||
const userAgent = singleHeaderValue(behavior.getHeader("user-agent"));
|
||||
const res = await fetch(targetUrl, {
|
||||
method: behavior.method,
|
||||
|
||||
@ -47,18 +47,14 @@ export const handler: NextApiHandler = async (request, response) => {
|
||||
* @returns a promise that resolves when the request is handled.
|
||||
*/
|
||||
async function routeHandler(request: NextRequest) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const responseHeaders: Record<string, any> = {};
|
||||
|
||||
// check if response if from a streaming request
|
||||
|
||||
const responseHeaders = new Headers();
|
||||
return await handleRequest({
|
||||
id: "nextjs-app-router",
|
||||
method: request.method,
|
||||
getRequestBody: async () => request.text(),
|
||||
getHeaders: () => fromHeaders(request.headers),
|
||||
getHeader: (name) => request.headers.get(name),
|
||||
sendHeader: (name, value) => (responseHeaders[name] = value),
|
||||
sendHeader: (name, value) => responseHeaders.set(name, value),
|
||||
respondWith: (status, data) =>
|
||||
NextResponse.json(data, {
|
||||
status,
|
||||
|
||||
@ -21,10 +21,9 @@ export const createRequestHandler = ({
|
||||
}: RequestHandlerParams = {}) => {
|
||||
const handler: RequestHandler = async ({ request }) => {
|
||||
const FAL_KEY = credentials || process.env.FAL_KEY || "";
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const responseHeaders: Record<string, any> = {
|
||||
const responseHeaders = new Headers({
|
||||
"Content-Type": "application/json",
|
||||
};
|
||||
});
|
||||
return await handleRequest({
|
||||
id: "svelte-app-router",
|
||||
method: request.method,
|
||||
|
||||
10
package-lock.json
generated
10
package-lock.json
generated
@ -89,6 +89,7 @@
|
||||
"eslint-plugin-react": "7.32.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"fs-extra": "^11.1.0",
|
||||
"hono": "^4.6.3",
|
||||
"husky": "^8.0.0",
|
||||
"jest": "29.4.3",
|
||||
"jest-environment-jsdom": "29.4.3",
|
||||
@ -17458,6 +17459,15 @@
|
||||
"tslib": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/hono": {
|
||||
"version": "4.6.3",
|
||||
"resolved": "https://registry.npmjs.org/hono/-/hono-4.6.3.tgz",
|
||||
"integrity": "sha512-0LeEuBNFeSHGqZ9sNVVgZjB1V5fmhkBSB0hZrpqStSMLOWgfLy0dHOvrjbJh0H2khsjet6rbHfWTHY0kpYThKQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hook-std": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz",
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
"cspell",
|
||||
"prettier --write"
|
||||
],
|
||||
"libs/client/src/**/*.{ts}": [
|
||||
"libs/client/src/**/*.ts": [
|
||||
"npm run docs:typedoc"
|
||||
]
|
||||
},
|
||||
@ -109,6 +109,7 @@
|
||||
"eslint-plugin-react": "7.32.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"fs-extra": "^11.1.0",
|
||||
"hono": "^4.6.3",
|
||||
"husky": "^8.0.0",
|
||||
"jest": "29.4.3",
|
||||
"jest-environment-jsdom": "29.4.3",
|
||||
|
||||
@ -15,11 +15,11 @@
|
||||
"skipDefaultLibCheck": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@fal-ai/client": ["libs/client/src/index.ts"],
|
||||
"@fal-ai/create-app": ["libs/create-app/src/index.ts"],
|
||||
"@fal-ai/serverless-client": ["libs/client/src/index.ts"],
|
||||
"@fal-ai/serverless-proxy": ["libs/proxy/src/index.ts"],
|
||||
"@fal-ai/serverless-proxy/express": ["libs/proxy/src/express.ts"],
|
||||
"@fal-ai/serverless-proxy/nextjs": ["libs/proxy/src/nextjs.ts"]
|
||||
"@fal-ai/server-proxy": ["libs/proxy/src/index.ts"],
|
||||
"@fal-ai/server-proxy/express": ["libs/proxy/src/express.ts"],
|
||||
"@fal-ai/server-proxy/nextjs": ["libs/proxy/src/nextjs.ts"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules/**", "tmp/**", "dist/**"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user