fal 1.0.8__py3-none-any.whl → 1.1.1__py3-none-any.whl

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.

Potentially problematic release.


This version of fal might be problematic. Click here for more details.

Files changed (48) hide show
  1. fal/_fal_version.py +2 -2
  2. fal/api.py +27 -26
  3. fal/cli/deploy.py +18 -8
  4. fal/toolkit/file/file.py +2 -0
  5. fal/toolkit/file/providers/fal.py +15 -3
  6. fal/toolkit/file/types.py +1 -1
  7. fal/workflows.py +1 -1
  8. {fal-1.0.8.dist-info → fal-1.1.1.dist-info}/METADATA +1 -1
  9. {fal-1.0.8.dist-info → fal-1.1.1.dist-info}/RECORD +47 -26
  10. {fal-1.0.8.dist-info → fal-1.1.1.dist-info}/WHEEL +1 -1
  11. openapi_fal_rest/api/comfy/__init__.py +0 -0
  12. openapi_fal_rest/api/comfy/create_workflow.py +172 -0
  13. openapi_fal_rest/api/comfy/delete_workflow.py +175 -0
  14. openapi_fal_rest/api/comfy/get_workflow.py +181 -0
  15. openapi_fal_rest/api/comfy/list_user_workflows.py +189 -0
  16. openapi_fal_rest/api/comfy/update_workflow.py +198 -0
  17. openapi_fal_rest/api/users/__init__.py +0 -0
  18. openapi_fal_rest/api/users/get_current_user.py +143 -0
  19. openapi_fal_rest/api/workflows/{create_or_update_workflow_workflows_post.py → create_workflow.py} +4 -4
  20. openapi_fal_rest/api/workflows/{get_workflows_workflows_get.py → list_user_workflows.py} +4 -4
  21. openapi_fal_rest/api/workflows/update_workflow.py +198 -0
  22. openapi_fal_rest/models/__init__.py +32 -10
  23. openapi_fal_rest/models/comfy_workflow_detail.py +109 -0
  24. openapi_fal_rest/models/comfy_workflow_item.py +88 -0
  25. openapi_fal_rest/models/comfy_workflow_schema.py +119 -0
  26. openapi_fal_rest/models/{execute_workflow_workflows_user_id_workflow_name_post_json_body_type_0.py → comfy_workflow_schema_extra_data.py} +5 -5
  27. openapi_fal_rest/models/{execute_workflow_workflows_user_id_workflow_name_post_response_200_type_0.py → comfy_workflow_schema_fal_inputs.py} +5 -5
  28. openapi_fal_rest/models/comfy_workflow_schema_fal_inputs_dev_info.py +44 -0
  29. openapi_fal_rest/models/{workflow_detail_contents_type_0.py → comfy_workflow_schema_prompt.py} +5 -5
  30. openapi_fal_rest/models/current_user.py +138 -0
  31. openapi_fal_rest/models/customer_details.py +8 -8
  32. openapi_fal_rest/models/lock_reason.py +3 -0
  33. openapi_fal_rest/models/page_comfy_workflow_item.py +107 -0
  34. openapi_fal_rest/models/team_role.py +10 -0
  35. openapi_fal_rest/models/typed_comfy_workflow.py +85 -0
  36. openapi_fal_rest/models/typed_comfy_workflow_update.py +95 -0
  37. openapi_fal_rest/models/typed_workflow_update.py +95 -0
  38. openapi_fal_rest/models/user_member.py +87 -0
  39. openapi_fal_rest/models/workflow_contents.py +20 -1
  40. openapi_fal_rest/models/workflow_contents_metadata.py +44 -0
  41. openapi_fal_rest/models/workflow_detail.py +18 -59
  42. openapi_fal_rest/models/workflow_detail_contents.py +44 -0
  43. openapi_fal_rest/models/workflow_item.py +19 -1
  44. openapi_fal_rest/api/workflows/execute_workflow_workflows_user_id_workflow_name_post.py +0 -268
  45. {fal-1.0.8.dist-info → fal-1.1.1.dist-info}/entry_points.txt +0 -0
  46. {fal-1.0.8.dist-info → fal-1.1.1.dist-info}/top_level.txt +0 -0
  47. /openapi_fal_rest/api/workflows/{delete_workflow_workflows_user_id_workflow_name_delete.py → delete_workflow.py} +0 -0
  48. /openapi_fal_rest/api/workflows/{get_workflow_workflows_user_id_workflow_name_get.py → get_workflow.py} +0 -0
@@ -1,13 +1,11 @@
1
1
  import datetime
2
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
2
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar
3
3
 
4
4
  import attr
5
5
  from dateutil.parser import isoparse
6
6
 
7
- from ..types import UNSET, Unset
8
-
9
7
  if TYPE_CHECKING:
10
- from ..models.workflow_detail_contents_type_0 import WorkflowDetailContentsType0
8
+ from ..models.workflow_detail_contents import WorkflowDetailContents
11
9
 
12
10
 
13
11
  T = TypeVar("T", bound="WorkflowDetail")
@@ -19,114 +17,75 @@ class WorkflowDetail:
19
17
  Attributes:
20
18
  name (str):
21
19
  title (str):
20
+ contents (WorkflowDetailContents):
22
21
  is_public (bool):
23
22
  user_id (str):
23
+ user_nickname (str):
24
24
  created_at (datetime.datetime):
25
- contents (Union['WorkflowDetailContentsType0', List[Any], Unset, bool, float, int, str]):
26
25
  """
27
26
 
28
27
  name: str
29
28
  title: str
29
+ contents: "WorkflowDetailContents"
30
30
  is_public: bool
31
31
  user_id: str
32
+ user_nickname: str
32
33
  created_at: datetime.datetime
33
- contents: Union["WorkflowDetailContentsType0", List[Any], Unset, bool, float, int, str] = UNSET
34
34
  additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
35
35
 
36
36
  def to_dict(self) -> Dict[str, Any]:
37
- from ..models.workflow_detail_contents_type_0 import WorkflowDetailContentsType0
38
-
39
37
  name = self.name
40
38
  title = self.title
39
+ contents = self.contents.to_dict()
40
+
41
41
  is_public = self.is_public
42
42
  user_id = self.user_id
43
+ user_nickname = self.user_nickname
43
44
  created_at = self.created_at.isoformat()
44
45
 
45
- contents: Union[Dict[str, Any], List[Any], Unset, bool, float, int, str]
46
- if isinstance(self.contents, Unset):
47
- contents = UNSET
48
-
49
- elif isinstance(self.contents, WorkflowDetailContentsType0):
50
- contents = UNSET
51
- if not isinstance(self.contents, Unset):
52
- contents = self.contents.to_dict()
53
-
54
- elif isinstance(self.contents, list):
55
- contents = UNSET
56
- if not isinstance(self.contents, Unset):
57
- contents = self.contents
58
-
59
- else:
60
- contents = self.contents
61
-
62
46
  field_dict: Dict[str, Any] = {}
63
47
  field_dict.update(self.additional_properties)
64
48
  field_dict.update(
65
49
  {
66
50
  "name": name,
67
51
  "title": title,
52
+ "contents": contents,
68
53
  "is_public": is_public,
69
54
  "user_id": user_id,
55
+ "user_nickname": user_nickname,
70
56
  "created_at": created_at,
71
57
  }
72
58
  )
73
- if contents is not UNSET:
74
- field_dict["contents"] = contents
75
59
 
76
60
  return field_dict
77
61
 
78
62
  @classmethod
79
63
  def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
80
- from ..models.workflow_detail_contents_type_0 import WorkflowDetailContentsType0
64
+ from ..models.workflow_detail_contents import WorkflowDetailContents
81
65
 
82
66
  d = src_dict.copy()
83
67
  name = d.pop("name")
84
68
 
85
69
  title = d.pop("title")
86
70
 
71
+ contents = WorkflowDetailContents.from_dict(d.pop("contents"))
72
+
87
73
  is_public = d.pop("is_public")
88
74
 
89
75
  user_id = d.pop("user_id")
90
76
 
91
- created_at = isoparse(d.pop("created_at"))
77
+ user_nickname = d.pop("user_nickname")
92
78
 
93
- def _parse_contents(
94
- data: object,
95
- ) -> Union["WorkflowDetailContentsType0", List[Any], Unset, bool, float, int, str]:
96
- if isinstance(data, Unset):
97
- return data
98
- try:
99
- if not isinstance(data, dict):
100
- raise TypeError()
101
- _contents_type_0 = data
102
- contents_type_0: Union[Unset, WorkflowDetailContentsType0]
103
- if isinstance(_contents_type_0, Unset):
104
- contents_type_0 = UNSET
105
- else:
106
- contents_type_0 = WorkflowDetailContentsType0.from_dict(_contents_type_0)
107
-
108
- return contents_type_0
109
- except: # noqa: E722
110
- pass
111
- try:
112
- if not isinstance(data, list):
113
- raise TypeError()
114
- contents_type_1 = cast(List[Any], data)
115
-
116
- return contents_type_1
117
- except: # noqa: E722
118
- pass
119
- return cast(Union["WorkflowDetailContentsType0", List[Any], Unset, bool, float, int, str], data)
120
-
121
- contents = _parse_contents(d.pop("contents", UNSET))
79
+ created_at = isoparse(d.pop("created_at"))
122
80
 
123
81
  workflow_detail = cls(
124
82
  name=name,
125
83
  title=title,
84
+ contents=contents,
126
85
  is_public=is_public,
127
86
  user_id=user_id,
87
+ user_nickname=user_nickname,
128
88
  created_at=created_at,
129
- contents=contents,
130
89
  )
131
90
 
132
91
  workflow_detail.additional_properties = d
@@ -0,0 +1,44 @@
1
+ from typing import Any, Dict, List, Type, TypeVar
2
+
3
+ import attr
4
+
5
+ T = TypeVar("T", bound="WorkflowDetailContents")
6
+
7
+
8
+ @attr.s(auto_attribs=True)
9
+ class WorkflowDetailContents:
10
+ """ """
11
+
12
+ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
13
+
14
+ def to_dict(self) -> Dict[str, Any]:
15
+
16
+ field_dict: Dict[str, Any] = {}
17
+ field_dict.update(self.additional_properties)
18
+ field_dict.update({})
19
+
20
+ return field_dict
21
+
22
+ @classmethod
23
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
24
+ d = src_dict.copy()
25
+ workflow_detail_contents = cls()
26
+
27
+ workflow_detail_contents.additional_properties = d
28
+ return workflow_detail_contents
29
+
30
+ @property
31
+ def additional_keys(self) -> List[str]:
32
+ return list(self.additional_properties.keys())
33
+
34
+ def __getitem__(self, key: str) -> Any:
35
+ return self.additional_properties[key]
36
+
37
+ def __setitem__(self, key: str, value: Any) -> None:
38
+ self.additional_properties[key] = value
39
+
40
+ def __delitem__(self, key: str) -> None:
41
+ del self.additional_properties[key]
42
+
43
+ def __contains__(self, key: str) -> bool:
44
+ return key in self.additional_properties
@@ -1,9 +1,11 @@
1
1
  import datetime
2
- from typing import Any, Dict, List, Type, TypeVar
2
+ from typing import Any, Dict, List, Type, TypeVar, Union
3
3
 
4
4
  import attr
5
5
  from dateutil.parser import isoparse
6
6
 
7
+ from ..types import UNSET, Unset
8
+
7
9
  T = TypeVar("T", bound="WorkflowItem")
8
10
 
9
11
 
@@ -14,21 +16,28 @@ class WorkflowItem:
14
16
  name (str):
15
17
  title (str):
16
18
  user_id (str):
19
+ user_nickname (str):
17
20
  created_at (datetime.datetime):
21
+ thumbnail_url (Union[Unset, str]):
18
22
  """
19
23
 
20
24
  name: str
21
25
  title: str
22
26
  user_id: str
27
+ user_nickname: str
23
28
  created_at: datetime.datetime
29
+ thumbnail_url: Union[Unset, str] = UNSET
24
30
  additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
25
31
 
26
32
  def to_dict(self) -> Dict[str, Any]:
27
33
  name = self.name
28
34
  title = self.title
29
35
  user_id = self.user_id
36
+ user_nickname = self.user_nickname
30
37
  created_at = self.created_at.isoformat()
31
38
 
39
+ thumbnail_url = self.thumbnail_url
40
+
32
41
  field_dict: Dict[str, Any] = {}
33
42
  field_dict.update(self.additional_properties)
34
43
  field_dict.update(
@@ -36,9 +45,12 @@ class WorkflowItem:
36
45
  "name": name,
37
46
  "title": title,
38
47
  "user_id": user_id,
48
+ "user_nickname": user_nickname,
39
49
  "created_at": created_at,
40
50
  }
41
51
  )
52
+ if thumbnail_url is not UNSET:
53
+ field_dict["thumbnail_url"] = thumbnail_url
42
54
 
43
55
  return field_dict
44
56
 
@@ -51,13 +63,19 @@ class WorkflowItem:
51
63
 
52
64
  user_id = d.pop("user_id")
53
65
 
66
+ user_nickname = d.pop("user_nickname")
67
+
54
68
  created_at = isoparse(d.pop("created_at"))
55
69
 
70
+ thumbnail_url = d.pop("thumbnail_url", UNSET)
71
+
56
72
  workflow_item = cls(
57
73
  name=name,
58
74
  title=title,
59
75
  user_id=user_id,
76
+ user_nickname=user_nickname,
60
77
  created_at=created_at,
78
+ thumbnail_url=thumbnail_url,
61
79
  )
62
80
 
63
81
  workflow_item.additional_properties = d
@@ -1,268 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Dict, List, Optional, Union, cast
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import Client
8
- from ...models.execute_workflow_workflows_user_id_workflow_name_post_json_body_type_0 import (
9
- ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0,
10
- )
11
- from ...models.execute_workflow_workflows_user_id_workflow_name_post_response_200_type_0 import (
12
- ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0,
13
- )
14
- from ...models.http_validation_error import HTTPValidationError
15
- from ...types import Response
16
-
17
-
18
- def _get_kwargs(
19
- user_id: str,
20
- workflow_name: str,
21
- *,
22
- client: Client,
23
- json_body: Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0", List[Any], bool, float, int, str],
24
- ) -> Dict[str, Any]:
25
- url = "{}/workflows/{user_id}/{workflow_name}".format(client.base_url, user_id=user_id, workflow_name=workflow_name)
26
-
27
- headers: Dict[str, str] = client.get_headers()
28
- cookies: Dict[str, Any] = client.get_cookies()
29
-
30
- json_json_body: Union[Dict[str, Any], List[Any], bool, float, int, str]
31
-
32
- if isinstance(json_body, ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0):
33
- json_json_body = json_body.to_dict()
34
-
35
- elif isinstance(json_body, list):
36
- json_json_body = json_body
37
-
38
- else:
39
- json_json_body = json_body
40
-
41
- return {
42
- "method": "post",
43
- "url": url,
44
- "headers": headers,
45
- "cookies": cookies,
46
- "timeout": client.get_timeout(),
47
- "follow_redirects": client.follow_redirects,
48
- "json": json_json_body,
49
- }
50
-
51
-
52
- def _parse_response(*, client: Client, response: httpx.Response) -> Optional[
53
- Union[
54
- HTTPValidationError,
55
- Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str],
56
- ]
57
- ]:
58
- if response.status_code == HTTPStatus.OK:
59
-
60
- def _parse_response_200(
61
- data: object,
62
- ) -> Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str]:
63
- try:
64
- if not isinstance(data, dict):
65
- raise TypeError()
66
- response_200_type_0 = ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0.from_dict(data)
67
-
68
- return response_200_type_0
69
- except: # noqa: E722
70
- pass
71
- try:
72
- if not isinstance(data, list):
73
- raise TypeError()
74
- response_200_type_1 = cast(List[Any], data)
75
-
76
- return response_200_type_1
77
- except: # noqa: E722
78
- pass
79
- return cast(
80
- Union[
81
- "ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str
82
- ],
83
- data,
84
- )
85
-
86
- response_200 = _parse_response_200(response.json())
87
-
88
- return response_200
89
- if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
90
- response_422 = HTTPValidationError.from_dict(response.json())
91
-
92
- return response_422
93
- if client.raise_on_unexpected_status:
94
- raise errors.UnexpectedStatus(response.status_code, response.content)
95
- else:
96
- return None
97
-
98
-
99
- def _build_response(*, client: Client, response: httpx.Response) -> Response[
100
- Union[
101
- HTTPValidationError,
102
- Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str],
103
- ]
104
- ]:
105
- return Response(
106
- status_code=HTTPStatus(response.status_code),
107
- content=response.content,
108
- headers=response.headers,
109
- parsed=_parse_response(client=client, response=response),
110
- )
111
-
112
-
113
- def sync_detailed(
114
- user_id: str,
115
- workflow_name: str,
116
- *,
117
- client: Client,
118
- json_body: Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0", List[Any], bool, float, int, str],
119
- ) -> Response[
120
- Union[
121
- HTTPValidationError,
122
- Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str],
123
- ]
124
- ]:
125
- """Execute Workflow
126
-
127
- Args:
128
- user_id (str):
129
- workflow_name (str):
130
- json_body (Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0', List[Any],
131
- bool, float, int, str]):
132
-
133
- Raises:
134
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
135
- httpx.TimeoutException: If the request takes longer than Client.timeout.
136
-
137
- Returns:
138
- Response[Union[HTTPValidationError, Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0', List[Any], bool, float, int, str]]]
139
- """
140
-
141
- kwargs = _get_kwargs(
142
- user_id=user_id,
143
- workflow_name=workflow_name,
144
- client=client,
145
- json_body=json_body,
146
- )
147
-
148
- response = httpx.request(
149
- verify=client.verify_ssl,
150
- **kwargs,
151
- )
152
-
153
- return _build_response(client=client, response=response)
154
-
155
-
156
- def sync(
157
- user_id: str,
158
- workflow_name: str,
159
- *,
160
- client: Client,
161
- json_body: Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0", List[Any], bool, float, int, str],
162
- ) -> Optional[
163
- Union[
164
- HTTPValidationError,
165
- Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str],
166
- ]
167
- ]:
168
- """Execute Workflow
169
-
170
- Args:
171
- user_id (str):
172
- workflow_name (str):
173
- json_body (Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0', List[Any],
174
- bool, float, int, str]):
175
-
176
- Raises:
177
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
178
- httpx.TimeoutException: If the request takes longer than Client.timeout.
179
-
180
- Returns:
181
- Union[HTTPValidationError, Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0', List[Any], bool, float, int, str]]
182
- """
183
-
184
- return sync_detailed(
185
- user_id=user_id,
186
- workflow_name=workflow_name,
187
- client=client,
188
- json_body=json_body,
189
- ).parsed
190
-
191
-
192
- async def asyncio_detailed(
193
- user_id: str,
194
- workflow_name: str,
195
- *,
196
- client: Client,
197
- json_body: Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0", List[Any], bool, float, int, str],
198
- ) -> Response[
199
- Union[
200
- HTTPValidationError,
201
- Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str],
202
- ]
203
- ]:
204
- """Execute Workflow
205
-
206
- Args:
207
- user_id (str):
208
- workflow_name (str):
209
- json_body (Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0', List[Any],
210
- bool, float, int, str]):
211
-
212
- Raises:
213
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
214
- httpx.TimeoutException: If the request takes longer than Client.timeout.
215
-
216
- Returns:
217
- Response[Union[HTTPValidationError, Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0', List[Any], bool, float, int, str]]]
218
- """
219
-
220
- kwargs = _get_kwargs(
221
- user_id=user_id,
222
- workflow_name=workflow_name,
223
- client=client,
224
- json_body=json_body,
225
- )
226
-
227
- async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
228
- response = await _client.request(**kwargs)
229
-
230
- return _build_response(client=client, response=response)
231
-
232
-
233
- async def asyncio(
234
- user_id: str,
235
- workflow_name: str,
236
- *,
237
- client: Client,
238
- json_body: Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0", List[Any], bool, float, int, str],
239
- ) -> Optional[
240
- Union[
241
- HTTPValidationError,
242
- Union["ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0", List[Any], bool, float, int, str],
243
- ]
244
- ]:
245
- """Execute Workflow
246
-
247
- Args:
248
- user_id (str):
249
- workflow_name (str):
250
- json_body (Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0', List[Any],
251
- bool, float, int, str]):
252
-
253
- Raises:
254
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
255
- httpx.TimeoutException: If the request takes longer than Client.timeout.
256
-
257
- Returns:
258
- Union[HTTPValidationError, Union['ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0', List[Any], bool, float, int, str]]
259
- """
260
-
261
- return (
262
- await asyncio_detailed(
263
- user_id=user_id,
264
- workflow_name=workflow_name,
265
- client=client,
266
- json_body=json_body,
267
- )
268
- ).parsed