fal-endpoint-types 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +20 -3
- package/readme.md +25 -6
- package/types/fal/endpoints/components.d.ts +1648 -3687
- package/types/fal/endpoints/index.d.ts +2256 -3896
- package/types/fal/endpoints/schema.d.ts +40950 -70514
- package/types/fal/index.d.ts +7 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fal-endpoint-types",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.3.4",
|
|
4
|
+
"description": "TypeScript types for Fal AI endpoints generated from the OpenAPI schemas.",
|
|
5
5
|
"homepage": "https://github.com/rawpixel-vincent/fal-endpoint-types#readme",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/rawpixel-vincent/fal-endpoint-types/issues"
|
|
@@ -15,6 +15,23 @@
|
|
|
15
15
|
"type": "module",
|
|
16
16
|
"main": "./types/fal/index.d.ts",
|
|
17
17
|
"types": "./types/fal/index.d.ts",
|
|
18
|
+
"badges": [
|
|
19
|
+
{
|
|
20
|
+
"url": "https://npmjs.com/package/fal-endpoint-types",
|
|
21
|
+
"href": "https://img.shields.io/npm/v/fal-endpoint-types",
|
|
22
|
+
"description": "npm version"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"url": "https://npmjs.com/package/fal-endpoint-types",
|
|
26
|
+
"href": "https://img.shields.io/npm/l/fal-endpoint-types",
|
|
27
|
+
"description": "license"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"url": "https://npmjs.com/package/fal-endpoint-types",
|
|
31
|
+
"href": "https://img.shields.io/npm/dm/fal-endpoint-types",
|
|
32
|
+
"description": "downloads"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
18
35
|
"exports": {
|
|
19
36
|
".": {
|
|
20
37
|
"types": "./types/fal/index.d.ts"
|
|
@@ -25,7 +42,7 @@
|
|
|
25
42
|
},
|
|
26
43
|
"files": [
|
|
27
44
|
"types/**/*.d.ts",
|
|
28
|
-
"
|
|
45
|
+
"readme.md",
|
|
29
46
|
"LICENSE"
|
|
30
47
|
],
|
|
31
48
|
"scripts": {
|
package/readme.md
CHANGED
|
@@ -1,9 +1,31 @@
|
|
|
1
|
+
[](https://npmjs.com/package/fal-endpoint-types)
|
|
2
|
+
[](https://npmjs.com/package/fal-endpoint-types)
|
|
3
|
+
[](https://npmjs.com/package/fal-endpoint-types)
|
|
4
|
+
|
|
1
5
|
Fal.ai model endpoints Input and Output ts shapes.
|
|
2
6
|
Built from the Open API schemas provided by fal.ai.
|
|
3
7
|
|
|
4
8
|
- https://fal.ai/api/models
|
|
5
9
|
- https://fal.ai/api/openapi/queue/openapi.json?endpoint_id={endpointId}
|
|
6
10
|
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install --save-dev fal-endpoint-types
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
yarn add --dev fal-endpoint-types
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm add --dev fal-endpoint-types
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
bun add --dev fal-endpoint-types
|
|
27
|
+
```
|
|
28
|
+
|
|
7
29
|
**It's a drop in replacement for import('@fal-ai/client').RunOptions<'endpointId'>['input'].** (that is missing some endpoints / or incorrect types)
|
|
8
30
|
there's discussion in fal.ai to build the types from openapi, as soon as that's done, this repo will be archived.
|
|
9
31
|
|
|
@@ -24,17 +46,14 @@ Usage example:
|
|
|
24
46
|
// to infer the type of the returned value,
|
|
25
47
|
// this example uses an index signature.
|
|
26
48
|
// The input type is infered in the function.
|
|
27
|
-
const FalInputs
|
|
28
|
-
[x: number | string | symbol]: any;
|
|
29
|
-
} & {
|
|
30
|
-
[K in fal.Endpoint]?: (userInputs: Record<string, any>) => fal.EndpointInput<K>;
|
|
31
|
-
} = {
|
|
49
|
+
const FalInputs = {
|
|
32
50
|
'fal-ai/flux-kontext/dev': (userInputs) => ({
|
|
33
51
|
// typed FluxKontextDevInput
|
|
34
52
|
prompt: typeof userInputs['prompt'] === 'string' ? userInputs['prompt'] : '',
|
|
35
53
|
image_url: typeof userInputs['image_url'] === 'string' ? userInputs['image_url'] : '',
|
|
36
54
|
}),
|
|
37
|
-
|
|
55
|
+
} as {
|
|
56
|
+
[K in fal.Endpoint]: (userInputs: Record<string, any>) => fal.EndpointInput<K>;
|
|
38
57
|
};
|
|
39
58
|
|
|
40
59
|
const endpointIdString = String('fal-ai/flux-kontext/dev');
|