fal 1.0.8__py3-none-any.whl → 1.1.0__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.
- fal/_fal_version.py +2 -2
- fal/api.py +27 -26
- fal/cli/deploy.py +18 -8
- fal/workflows.py +1 -1
- {fal-1.0.8.dist-info → fal-1.1.0.dist-info}/METADATA +1 -1
- {fal-1.0.8.dist-info → fal-1.1.0.dist-info}/RECORD +44 -23
- {fal-1.0.8.dist-info → fal-1.1.0.dist-info}/WHEEL +1 -1
- openapi_fal_rest/api/comfy/__init__.py +0 -0
- openapi_fal_rest/api/comfy/create_workflow.py +172 -0
- openapi_fal_rest/api/comfy/delete_workflow.py +175 -0
- openapi_fal_rest/api/comfy/get_workflow.py +181 -0
- openapi_fal_rest/api/comfy/list_user_workflows.py +189 -0
- openapi_fal_rest/api/comfy/update_workflow.py +198 -0
- openapi_fal_rest/api/users/__init__.py +0 -0
- openapi_fal_rest/api/users/get_current_user.py +143 -0
- openapi_fal_rest/api/workflows/{create_or_update_workflow_workflows_post.py → create_workflow.py} +4 -4
- openapi_fal_rest/api/workflows/{get_workflows_workflows_get.py → list_user_workflows.py} +4 -4
- openapi_fal_rest/api/workflows/update_workflow.py +198 -0
- openapi_fal_rest/models/__init__.py +32 -10
- openapi_fal_rest/models/comfy_workflow_detail.py +109 -0
- openapi_fal_rest/models/comfy_workflow_item.py +88 -0
- openapi_fal_rest/models/comfy_workflow_schema.py +119 -0
- 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
- 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
- openapi_fal_rest/models/comfy_workflow_schema_fal_inputs_dev_info.py +44 -0
- openapi_fal_rest/models/{workflow_detail_contents_type_0.py → comfy_workflow_schema_prompt.py} +5 -5
- openapi_fal_rest/models/current_user.py +138 -0
- openapi_fal_rest/models/customer_details.py +8 -8
- openapi_fal_rest/models/lock_reason.py +3 -0
- openapi_fal_rest/models/page_comfy_workflow_item.py +107 -0
- openapi_fal_rest/models/team_role.py +10 -0
- openapi_fal_rest/models/typed_comfy_workflow.py +85 -0
- openapi_fal_rest/models/typed_comfy_workflow_update.py +95 -0
- openapi_fal_rest/models/typed_workflow_update.py +95 -0
- openapi_fal_rest/models/user_member.py +87 -0
- openapi_fal_rest/models/workflow_contents.py +20 -1
- openapi_fal_rest/models/workflow_contents_metadata.py +44 -0
- openapi_fal_rest/models/workflow_detail.py +18 -59
- openapi_fal_rest/models/workflow_detail_contents.py +44 -0
- openapi_fal_rest/models/workflow_item.py +19 -1
- openapi_fal_rest/api/workflows/execute_workflow_workflows_user_id_workflow_name_post.py +0 -268
- {fal-1.0.8.dist-info → fal-1.1.0.dist-info}/entry_points.txt +0 -0
- {fal-1.0.8.dist-info → fal-1.1.0.dist-info}/top_level.txt +0 -0
- /openapi_fal_rest/api/workflows/{delete_workflow_workflows_user_id_workflow_name_delete.py → delete_workflow.py} +0 -0
- /openapi_fal_rest/api/workflows/{get_workflow_workflows_user_id_workflow_name_get.py → get_workflow.py} +0 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import Client
|
|
8
|
+
from ...models.comfy_workflow_detail import ComfyWorkflowDetail
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...models.typed_comfy_workflow_update import TypedComfyWorkflowUpdate
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
user_id: str,
|
|
16
|
+
name: str,
|
|
17
|
+
*,
|
|
18
|
+
client: Client,
|
|
19
|
+
json_body: TypedComfyWorkflowUpdate,
|
|
20
|
+
) -> Dict[str, Any]:
|
|
21
|
+
url = "{}/comfy/{user_id}/{name}".format(client.base_url, user_id=user_id, name=name)
|
|
22
|
+
|
|
23
|
+
headers: Dict[str, str] = client.get_headers()
|
|
24
|
+
cookies: Dict[str, Any] = client.get_cookies()
|
|
25
|
+
|
|
26
|
+
json_json_body = json_body.to_dict()
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
"method": "patch",
|
|
30
|
+
"url": url,
|
|
31
|
+
"headers": headers,
|
|
32
|
+
"cookies": cookies,
|
|
33
|
+
"timeout": client.get_timeout(),
|
|
34
|
+
"follow_redirects": client.follow_redirects,
|
|
35
|
+
"json": json_json_body,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _parse_response(
|
|
40
|
+
*, client: Client, response: httpx.Response
|
|
41
|
+
) -> Optional[Union[ComfyWorkflowDetail, HTTPValidationError]]:
|
|
42
|
+
if response.status_code == HTTPStatus.CREATED:
|
|
43
|
+
response_201 = ComfyWorkflowDetail.from_dict(response.json())
|
|
44
|
+
|
|
45
|
+
return response_201
|
|
46
|
+
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
|
|
47
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
48
|
+
|
|
49
|
+
return response_422
|
|
50
|
+
if client.raise_on_unexpected_status:
|
|
51
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
52
|
+
else:
|
|
53
|
+
return None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _build_response(
|
|
57
|
+
*, client: Client, response: httpx.Response
|
|
58
|
+
) -> Response[Union[ComfyWorkflowDetail, HTTPValidationError]]:
|
|
59
|
+
return Response(
|
|
60
|
+
status_code=HTTPStatus(response.status_code),
|
|
61
|
+
content=response.content,
|
|
62
|
+
headers=response.headers,
|
|
63
|
+
parsed=_parse_response(client=client, response=response),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def sync_detailed(
|
|
68
|
+
user_id: str,
|
|
69
|
+
name: str,
|
|
70
|
+
*,
|
|
71
|
+
client: Client,
|
|
72
|
+
json_body: TypedComfyWorkflowUpdate,
|
|
73
|
+
) -> Response[Union[ComfyWorkflowDetail, HTTPValidationError]]:
|
|
74
|
+
"""Update Workflow
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
user_id (str):
|
|
78
|
+
name (str):
|
|
79
|
+
json_body (TypedComfyWorkflowUpdate):
|
|
80
|
+
|
|
81
|
+
Raises:
|
|
82
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
83
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
Response[Union[ComfyWorkflowDetail, HTTPValidationError]]
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
kwargs = _get_kwargs(
|
|
90
|
+
user_id=user_id,
|
|
91
|
+
name=name,
|
|
92
|
+
client=client,
|
|
93
|
+
json_body=json_body,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
response = httpx.request(
|
|
97
|
+
verify=client.verify_ssl,
|
|
98
|
+
**kwargs,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
return _build_response(client=client, response=response)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def sync(
|
|
105
|
+
user_id: str,
|
|
106
|
+
name: str,
|
|
107
|
+
*,
|
|
108
|
+
client: Client,
|
|
109
|
+
json_body: TypedComfyWorkflowUpdate,
|
|
110
|
+
) -> Optional[Union[ComfyWorkflowDetail, HTTPValidationError]]:
|
|
111
|
+
"""Update Workflow
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
user_id (str):
|
|
115
|
+
name (str):
|
|
116
|
+
json_body (TypedComfyWorkflowUpdate):
|
|
117
|
+
|
|
118
|
+
Raises:
|
|
119
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
120
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
Union[ComfyWorkflowDetail, HTTPValidationError]
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
return sync_detailed(
|
|
127
|
+
user_id=user_id,
|
|
128
|
+
name=name,
|
|
129
|
+
client=client,
|
|
130
|
+
json_body=json_body,
|
|
131
|
+
).parsed
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
async def asyncio_detailed(
|
|
135
|
+
user_id: str,
|
|
136
|
+
name: str,
|
|
137
|
+
*,
|
|
138
|
+
client: Client,
|
|
139
|
+
json_body: TypedComfyWorkflowUpdate,
|
|
140
|
+
) -> Response[Union[ComfyWorkflowDetail, HTTPValidationError]]:
|
|
141
|
+
"""Update Workflow
|
|
142
|
+
|
|
143
|
+
Args:
|
|
144
|
+
user_id (str):
|
|
145
|
+
name (str):
|
|
146
|
+
json_body (TypedComfyWorkflowUpdate):
|
|
147
|
+
|
|
148
|
+
Raises:
|
|
149
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
150
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
151
|
+
|
|
152
|
+
Returns:
|
|
153
|
+
Response[Union[ComfyWorkflowDetail, HTTPValidationError]]
|
|
154
|
+
"""
|
|
155
|
+
|
|
156
|
+
kwargs = _get_kwargs(
|
|
157
|
+
user_id=user_id,
|
|
158
|
+
name=name,
|
|
159
|
+
client=client,
|
|
160
|
+
json_body=json_body,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
|
164
|
+
response = await _client.request(**kwargs)
|
|
165
|
+
|
|
166
|
+
return _build_response(client=client, response=response)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
async def asyncio(
|
|
170
|
+
user_id: str,
|
|
171
|
+
name: str,
|
|
172
|
+
*,
|
|
173
|
+
client: Client,
|
|
174
|
+
json_body: TypedComfyWorkflowUpdate,
|
|
175
|
+
) -> Optional[Union[ComfyWorkflowDetail, HTTPValidationError]]:
|
|
176
|
+
"""Update Workflow
|
|
177
|
+
|
|
178
|
+
Args:
|
|
179
|
+
user_id (str):
|
|
180
|
+
name (str):
|
|
181
|
+
json_body (TypedComfyWorkflowUpdate):
|
|
182
|
+
|
|
183
|
+
Raises:
|
|
184
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
185
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
186
|
+
|
|
187
|
+
Returns:
|
|
188
|
+
Union[ComfyWorkflowDetail, HTTPValidationError]
|
|
189
|
+
"""
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
await asyncio_detailed(
|
|
193
|
+
user_id=user_id,
|
|
194
|
+
name=name,
|
|
195
|
+
client=client,
|
|
196
|
+
json_body=json_body,
|
|
197
|
+
)
|
|
198
|
+
).parsed
|
|
File without changes
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import Client
|
|
8
|
+
from ...models.current_user import CurrentUser
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
client: Client,
|
|
16
|
+
) -> Dict[str, Any]:
|
|
17
|
+
url = "{}/users/current".format(client.base_url)
|
|
18
|
+
|
|
19
|
+
headers: Dict[str, str] = client.get_headers()
|
|
20
|
+
cookies: Dict[str, Any] = client.get_cookies()
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
"method": "get",
|
|
24
|
+
"url": url,
|
|
25
|
+
"headers": headers,
|
|
26
|
+
"cookies": cookies,
|
|
27
|
+
"timeout": client.get_timeout(),
|
|
28
|
+
"follow_redirects": client.follow_redirects,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[CurrentUser, HTTPValidationError]]:
|
|
33
|
+
if response.status_code == HTTPStatus.OK:
|
|
34
|
+
response_200 = CurrentUser.from_dict(response.json())
|
|
35
|
+
|
|
36
|
+
return response_200
|
|
37
|
+
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
|
|
38
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_422
|
|
41
|
+
if client.raise_on_unexpected_status:
|
|
42
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
43
|
+
else:
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[CurrentUser, HTTPValidationError]]:
|
|
48
|
+
return Response(
|
|
49
|
+
status_code=HTTPStatus(response.status_code),
|
|
50
|
+
content=response.content,
|
|
51
|
+
headers=response.headers,
|
|
52
|
+
parsed=_parse_response(client=client, response=response),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def sync_detailed(
|
|
57
|
+
*,
|
|
58
|
+
client: Client,
|
|
59
|
+
) -> Response[Union[CurrentUser, HTTPValidationError]]:
|
|
60
|
+
"""Get Current User
|
|
61
|
+
|
|
62
|
+
Raises:
|
|
63
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
64
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
Response[Union[CurrentUser, HTTPValidationError]]
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
kwargs = _get_kwargs(
|
|
71
|
+
client=client,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
response = httpx.request(
|
|
75
|
+
verify=client.verify_ssl,
|
|
76
|
+
**kwargs,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
return _build_response(client=client, response=response)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def sync(
|
|
83
|
+
*,
|
|
84
|
+
client: Client,
|
|
85
|
+
) -> Optional[Union[CurrentUser, HTTPValidationError]]:
|
|
86
|
+
"""Get Current User
|
|
87
|
+
|
|
88
|
+
Raises:
|
|
89
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
90
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
91
|
+
|
|
92
|
+
Returns:
|
|
93
|
+
Union[CurrentUser, HTTPValidationError]
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
return sync_detailed(
|
|
97
|
+
client=client,
|
|
98
|
+
).parsed
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
async def asyncio_detailed(
|
|
102
|
+
*,
|
|
103
|
+
client: Client,
|
|
104
|
+
) -> Response[Union[CurrentUser, HTTPValidationError]]:
|
|
105
|
+
"""Get Current User
|
|
106
|
+
|
|
107
|
+
Raises:
|
|
108
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
109
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
Response[Union[CurrentUser, HTTPValidationError]]
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
kwargs = _get_kwargs(
|
|
116
|
+
client=client,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
|
120
|
+
response = await _client.request(**kwargs)
|
|
121
|
+
|
|
122
|
+
return _build_response(client=client, response=response)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
async def asyncio(
|
|
126
|
+
*,
|
|
127
|
+
client: Client,
|
|
128
|
+
) -> Optional[Union[CurrentUser, HTTPValidationError]]:
|
|
129
|
+
"""Get Current User
|
|
130
|
+
|
|
131
|
+
Raises:
|
|
132
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
133
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
134
|
+
|
|
135
|
+
Returns:
|
|
136
|
+
Union[CurrentUser, HTTPValidationError]
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
await asyncio_detailed(
|
|
141
|
+
client=client,
|
|
142
|
+
)
|
|
143
|
+
).parsed
|
openapi_fal_rest/api/workflows/{create_or_update_workflow_workflows_post.py → create_workflow.py}
RENAMED
|
@@ -67,7 +67,7 @@ def sync_detailed(
|
|
|
67
67
|
client: Client,
|
|
68
68
|
json_body: TypedWorkflow,
|
|
69
69
|
) -> Response[Union[HTTPValidationError, WorkflowDetail]]:
|
|
70
|
-
"""Create
|
|
70
|
+
"""Create Workflow
|
|
71
71
|
|
|
72
72
|
Args:
|
|
73
73
|
json_body (TypedWorkflow):
|
|
@@ -98,7 +98,7 @@ def sync(
|
|
|
98
98
|
client: Client,
|
|
99
99
|
json_body: TypedWorkflow,
|
|
100
100
|
) -> Optional[Union[HTTPValidationError, WorkflowDetail]]:
|
|
101
|
-
"""Create
|
|
101
|
+
"""Create Workflow
|
|
102
102
|
|
|
103
103
|
Args:
|
|
104
104
|
json_body (TypedWorkflow):
|
|
@@ -122,7 +122,7 @@ async def asyncio_detailed(
|
|
|
122
122
|
client: Client,
|
|
123
123
|
json_body: TypedWorkflow,
|
|
124
124
|
) -> Response[Union[HTTPValidationError, WorkflowDetail]]:
|
|
125
|
-
"""Create
|
|
125
|
+
"""Create Workflow
|
|
126
126
|
|
|
127
127
|
Args:
|
|
128
128
|
json_body (TypedWorkflow):
|
|
@@ -151,7 +151,7 @@ async def asyncio(
|
|
|
151
151
|
client: Client,
|
|
152
152
|
json_body: TypedWorkflow,
|
|
153
153
|
) -> Optional[Union[HTTPValidationError, WorkflowDetail]]:
|
|
154
|
-
"""Create
|
|
154
|
+
"""Create Workflow
|
|
155
155
|
|
|
156
156
|
Args:
|
|
157
157
|
json_body (TypedWorkflow):
|
|
@@ -73,7 +73,7 @@ def sync_detailed(
|
|
|
73
73
|
page: Union[Unset, None, int] = 1,
|
|
74
74
|
size: Union[Unset, None, int] = 50,
|
|
75
75
|
) -> Response[Union[HTTPValidationError, PageWorkflowItem]]:
|
|
76
|
-
"""Get Workflows
|
|
76
|
+
"""Get User Workflows
|
|
77
77
|
|
|
78
78
|
Args:
|
|
79
79
|
page (Union[Unset, None, int]): Default: 1.
|
|
@@ -107,7 +107,7 @@ def sync(
|
|
|
107
107
|
page: Union[Unset, None, int] = 1,
|
|
108
108
|
size: Union[Unset, None, int] = 50,
|
|
109
109
|
) -> Optional[Union[HTTPValidationError, PageWorkflowItem]]:
|
|
110
|
-
"""Get Workflows
|
|
110
|
+
"""Get User Workflows
|
|
111
111
|
|
|
112
112
|
Args:
|
|
113
113
|
page (Union[Unset, None, int]): Default: 1.
|
|
@@ -134,7 +134,7 @@ async def asyncio_detailed(
|
|
|
134
134
|
page: Union[Unset, None, int] = 1,
|
|
135
135
|
size: Union[Unset, None, int] = 50,
|
|
136
136
|
) -> Response[Union[HTTPValidationError, PageWorkflowItem]]:
|
|
137
|
-
"""Get Workflows
|
|
137
|
+
"""Get User Workflows
|
|
138
138
|
|
|
139
139
|
Args:
|
|
140
140
|
page (Union[Unset, None, int]): Default: 1.
|
|
@@ -166,7 +166,7 @@ async def asyncio(
|
|
|
166
166
|
page: Union[Unset, None, int] = 1,
|
|
167
167
|
size: Union[Unset, None, int] = 50,
|
|
168
168
|
) -> Optional[Union[HTTPValidationError, PageWorkflowItem]]:
|
|
169
|
-
"""Get Workflows
|
|
169
|
+
"""Get User Workflows
|
|
170
170
|
|
|
171
171
|
Args:
|
|
172
172
|
page (Union[Unset, None, int]): Default: 1.
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import Client
|
|
8
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
9
|
+
from ...models.typed_workflow_update import TypedWorkflowUpdate
|
|
10
|
+
from ...models.workflow_detail import WorkflowDetail
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
user_id: str,
|
|
16
|
+
workflow_name: str,
|
|
17
|
+
*,
|
|
18
|
+
client: Client,
|
|
19
|
+
json_body: TypedWorkflowUpdate,
|
|
20
|
+
) -> Dict[str, Any]:
|
|
21
|
+
url = "{}/workflows/{user_id}/{workflow_name}".format(client.base_url, user_id=user_id, workflow_name=workflow_name)
|
|
22
|
+
|
|
23
|
+
headers: Dict[str, str] = client.get_headers()
|
|
24
|
+
cookies: Dict[str, Any] = client.get_cookies()
|
|
25
|
+
|
|
26
|
+
json_json_body = json_body.to_dict()
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
"method": "patch",
|
|
30
|
+
"url": url,
|
|
31
|
+
"headers": headers,
|
|
32
|
+
"cookies": cookies,
|
|
33
|
+
"timeout": client.get_timeout(),
|
|
34
|
+
"follow_redirects": client.follow_redirects,
|
|
35
|
+
"json": json_json_body,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _parse_response(
|
|
40
|
+
*, client: Client, response: httpx.Response
|
|
41
|
+
) -> Optional[Union[HTTPValidationError, WorkflowDetail]]:
|
|
42
|
+
if response.status_code == HTTPStatus.CREATED:
|
|
43
|
+
response_201 = WorkflowDetail.from_dict(response.json())
|
|
44
|
+
|
|
45
|
+
return response_201
|
|
46
|
+
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
|
|
47
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
48
|
+
|
|
49
|
+
return response_422
|
|
50
|
+
if client.raise_on_unexpected_status:
|
|
51
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
52
|
+
else:
|
|
53
|
+
return None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _build_response(
|
|
57
|
+
*, client: Client, response: httpx.Response
|
|
58
|
+
) -> Response[Union[HTTPValidationError, WorkflowDetail]]:
|
|
59
|
+
return Response(
|
|
60
|
+
status_code=HTTPStatus(response.status_code),
|
|
61
|
+
content=response.content,
|
|
62
|
+
headers=response.headers,
|
|
63
|
+
parsed=_parse_response(client=client, response=response),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def sync_detailed(
|
|
68
|
+
user_id: str,
|
|
69
|
+
workflow_name: str,
|
|
70
|
+
*,
|
|
71
|
+
client: Client,
|
|
72
|
+
json_body: TypedWorkflowUpdate,
|
|
73
|
+
) -> Response[Union[HTTPValidationError, WorkflowDetail]]:
|
|
74
|
+
"""Update Workflow
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
user_id (str):
|
|
78
|
+
workflow_name (str):
|
|
79
|
+
json_body (TypedWorkflowUpdate):
|
|
80
|
+
|
|
81
|
+
Raises:
|
|
82
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
83
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
Response[Union[HTTPValidationError, WorkflowDetail]]
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
kwargs = _get_kwargs(
|
|
90
|
+
user_id=user_id,
|
|
91
|
+
workflow_name=workflow_name,
|
|
92
|
+
client=client,
|
|
93
|
+
json_body=json_body,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
response = httpx.request(
|
|
97
|
+
verify=client.verify_ssl,
|
|
98
|
+
**kwargs,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
return _build_response(client=client, response=response)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def sync(
|
|
105
|
+
user_id: str,
|
|
106
|
+
workflow_name: str,
|
|
107
|
+
*,
|
|
108
|
+
client: Client,
|
|
109
|
+
json_body: TypedWorkflowUpdate,
|
|
110
|
+
) -> Optional[Union[HTTPValidationError, WorkflowDetail]]:
|
|
111
|
+
"""Update Workflow
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
user_id (str):
|
|
115
|
+
workflow_name (str):
|
|
116
|
+
json_body (TypedWorkflowUpdate):
|
|
117
|
+
|
|
118
|
+
Raises:
|
|
119
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
120
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
Union[HTTPValidationError, WorkflowDetail]
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
return sync_detailed(
|
|
127
|
+
user_id=user_id,
|
|
128
|
+
workflow_name=workflow_name,
|
|
129
|
+
client=client,
|
|
130
|
+
json_body=json_body,
|
|
131
|
+
).parsed
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
async def asyncio_detailed(
|
|
135
|
+
user_id: str,
|
|
136
|
+
workflow_name: str,
|
|
137
|
+
*,
|
|
138
|
+
client: Client,
|
|
139
|
+
json_body: TypedWorkflowUpdate,
|
|
140
|
+
) -> Response[Union[HTTPValidationError, WorkflowDetail]]:
|
|
141
|
+
"""Update Workflow
|
|
142
|
+
|
|
143
|
+
Args:
|
|
144
|
+
user_id (str):
|
|
145
|
+
workflow_name (str):
|
|
146
|
+
json_body (TypedWorkflowUpdate):
|
|
147
|
+
|
|
148
|
+
Raises:
|
|
149
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
150
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
151
|
+
|
|
152
|
+
Returns:
|
|
153
|
+
Response[Union[HTTPValidationError, WorkflowDetail]]
|
|
154
|
+
"""
|
|
155
|
+
|
|
156
|
+
kwargs = _get_kwargs(
|
|
157
|
+
user_id=user_id,
|
|
158
|
+
workflow_name=workflow_name,
|
|
159
|
+
client=client,
|
|
160
|
+
json_body=json_body,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
|
164
|
+
response = await _client.request(**kwargs)
|
|
165
|
+
|
|
166
|
+
return _build_response(client=client, response=response)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
async def asyncio(
|
|
170
|
+
user_id: str,
|
|
171
|
+
workflow_name: str,
|
|
172
|
+
*,
|
|
173
|
+
client: Client,
|
|
174
|
+
json_body: TypedWorkflowUpdate,
|
|
175
|
+
) -> Optional[Union[HTTPValidationError, WorkflowDetail]]:
|
|
176
|
+
"""Update Workflow
|
|
177
|
+
|
|
178
|
+
Args:
|
|
179
|
+
user_id (str):
|
|
180
|
+
workflow_name (str):
|
|
181
|
+
json_body (TypedWorkflowUpdate):
|
|
182
|
+
|
|
183
|
+
Raises:
|
|
184
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
185
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
186
|
+
|
|
187
|
+
Returns:
|
|
188
|
+
Union[HTTPValidationError, WorkflowDetail]
|
|
189
|
+
"""
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
await asyncio_detailed(
|
|
193
|
+
user_id=user_id,
|
|
194
|
+
workflow_name=workflow_name,
|
|
195
|
+
client=client,
|
|
196
|
+
json_body=json_body,
|
|
197
|
+
)
|
|
198
|
+
).parsed
|
|
@@ -2,24 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
from .app_metadata_response_app_metadata import AppMetadataResponseAppMetadata
|
|
4
4
|
from .body_upload_local_file import BodyUploadLocalFile
|
|
5
|
+
from .comfy_workflow_detail import ComfyWorkflowDetail
|
|
6
|
+
from .comfy_workflow_item import ComfyWorkflowItem
|
|
7
|
+
from .comfy_workflow_schema import ComfyWorkflowSchema
|
|
8
|
+
from .comfy_workflow_schema_extra_data import ComfyWorkflowSchemaExtraData
|
|
9
|
+
from .comfy_workflow_schema_fal_inputs import ComfyWorkflowSchemaFalInputs
|
|
10
|
+
from .comfy_workflow_schema_fal_inputs_dev_info import ComfyWorkflowSchemaFalInputsDevInfo
|
|
11
|
+
from .comfy_workflow_schema_prompt import ComfyWorkflowSchemaPrompt
|
|
12
|
+
from .current_user import CurrentUser
|
|
5
13
|
from .customer_details import CustomerDetails
|
|
6
|
-
from .execute_workflow_workflows_user_id_workflow_name_post_json_body_type_0 import (
|
|
7
|
-
ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0,
|
|
8
|
-
)
|
|
9
|
-
from .execute_workflow_workflows_user_id_workflow_name_post_response_200_type_0 import (
|
|
10
|
-
ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0,
|
|
11
|
-
)
|
|
12
14
|
from .hash_check import HashCheck
|
|
13
15
|
from .http_validation_error import HTTPValidationError
|
|
14
16
|
from .lock_reason import LockReason
|
|
17
|
+
from .page_comfy_workflow_item import PageComfyWorkflowItem
|
|
15
18
|
from .page_workflow_item import PageWorkflowItem
|
|
19
|
+
from .team_role import TeamRole
|
|
20
|
+
from .typed_comfy_workflow import TypedComfyWorkflow
|
|
21
|
+
from .typed_comfy_workflow_update import TypedComfyWorkflowUpdate
|
|
16
22
|
from .typed_workflow import TypedWorkflow
|
|
23
|
+
from .typed_workflow_update import TypedWorkflowUpdate
|
|
24
|
+
from .user_member import UserMember
|
|
17
25
|
from .validation_error import ValidationError
|
|
18
26
|
from .workflow_contents import WorkflowContents
|
|
27
|
+
from .workflow_contents_metadata import WorkflowContentsMetadata
|
|
19
28
|
from .workflow_contents_nodes import WorkflowContentsNodes
|
|
20
29
|
from .workflow_contents_output import WorkflowContentsOutput
|
|
21
30
|
from .workflow_detail import WorkflowDetail
|
|
22
|
-
from .
|
|
31
|
+
from .workflow_detail_contents import WorkflowDetailContents
|
|
23
32
|
from .workflow_item import WorkflowItem
|
|
24
33
|
from .workflow_node import WorkflowNode
|
|
25
34
|
from .workflow_node_type import WorkflowNodeType
|
|
@@ -30,20 +39,33 @@ from .workflow_schema_output import WorkflowSchemaOutput
|
|
|
30
39
|
__all__ = (
|
|
31
40
|
"AppMetadataResponseAppMetadata",
|
|
32
41
|
"BodyUploadLocalFile",
|
|
42
|
+
"ComfyWorkflowDetail",
|
|
43
|
+
"ComfyWorkflowItem",
|
|
44
|
+
"ComfyWorkflowSchema",
|
|
45
|
+
"ComfyWorkflowSchemaExtraData",
|
|
46
|
+
"ComfyWorkflowSchemaFalInputs",
|
|
47
|
+
"ComfyWorkflowSchemaFalInputsDevInfo",
|
|
48
|
+
"ComfyWorkflowSchemaPrompt",
|
|
49
|
+
"CurrentUser",
|
|
33
50
|
"CustomerDetails",
|
|
34
|
-
"ExecuteWorkflowWorkflowsUserIdWorkflowNamePostJsonBodyType0",
|
|
35
|
-
"ExecuteWorkflowWorkflowsUserIdWorkflowNamePostResponse200Type0",
|
|
36
51
|
"HashCheck",
|
|
37
52
|
"HTTPValidationError",
|
|
38
53
|
"LockReason",
|
|
54
|
+
"PageComfyWorkflowItem",
|
|
39
55
|
"PageWorkflowItem",
|
|
56
|
+
"TeamRole",
|
|
57
|
+
"TypedComfyWorkflow",
|
|
58
|
+
"TypedComfyWorkflowUpdate",
|
|
40
59
|
"TypedWorkflow",
|
|
60
|
+
"TypedWorkflowUpdate",
|
|
61
|
+
"UserMember",
|
|
41
62
|
"ValidationError",
|
|
42
63
|
"WorkflowContents",
|
|
64
|
+
"WorkflowContentsMetadata",
|
|
43
65
|
"WorkflowContentsNodes",
|
|
44
66
|
"WorkflowContentsOutput",
|
|
45
67
|
"WorkflowDetail",
|
|
46
|
-
"
|
|
68
|
+
"WorkflowDetailContents",
|
|
47
69
|
"WorkflowItem",
|
|
48
70
|
"WorkflowNode",
|
|
49
71
|
"WorkflowNodeType",
|