fal 0.12.1__py3-none-any.whl → 0.12.3__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/__init__.py +12 -3
- fal/_serialization.py +18 -0
- fal/api.py +140 -59
- fal/app.py +309 -86
- fal/apps.py +92 -8
- fal/auth/__init__.py +20 -1
- fal/auth/auth0.py +32 -22
- fal/cli.py +34 -52
- fal/env.py +0 -4
- fal/exceptions/handlers.py +3 -2
- fal/flags.py +5 -0
- fal/logging/__init__.py +0 -2
- fal/logging/trace.py +8 -1
- fal/logging/user.py +2 -1
- fal/rest_client.py +2 -2
- fal/sdk.py +46 -31
- fal/sync.py +3 -3
- fal/toolkit/__init__.py +18 -1
- fal/toolkit/file/file.py +98 -11
- fal/toolkit/file/providers/fal.py +43 -2
- fal/toolkit/file/types.py +1 -1
- fal/toolkit/image/image.py +26 -4
- fal/toolkit/optimize.py +50 -0
- fal/toolkit/utils/download_utils.py +59 -13
- {fal-0.12.1.dist-info → fal-0.12.3.dist-info}/METADATA +7 -7
- fal-0.12.3.dist-info/RECORD +66 -0
- openapi_fal_rest/models/__init__.py +2 -70
- openapi_fal_rest/models/customer_details.py +26 -0
- openapi_fal_rest/models/lock_reason.py +16 -0
- fal/logging/datadog.py +0 -77
- fal-0.12.1.dist-info/RECORD +0 -147
- openapi_fal_rest/api/admin/get_invoice_users.py +0 -142
- openapi_fal_rest/api/admin/get_usage_per_user.py +0 -199
- openapi_fal_rest/api/admin/handle_user_lock.py +0 -191
- openapi_fal_rest/api/admin/set_billing_type.py +0 -186
- openapi_fal_rest/api/applications/get_status_applications_app_user_id_app_alias_or_id_status_get.py +0 -179
- openapi_fal_rest/api/billing/delete_payment_method.py +0 -162
- openapi_fal_rest/api/billing/get_checkout_page.py +0 -198
- openapi_fal_rest/api/billing/get_setup_intent_key.py +0 -141
- openapi_fal_rest/api/billing/get_user_invoices.py +0 -152
- openapi_fal_rest/api/billing/get_user_payment_methods.py +0 -152
- openapi_fal_rest/api/billing/get_user_price.py +0 -186
- openapi_fal_rest/api/billing/get_user_spending.py +0 -192
- openapi_fal_rest/api/billing/handle_stripe_webhook.py +0 -173
- openapi_fal_rest/api/billing/upcoming_invoice.py +0 -143
- openapi_fal_rest/api/billing/update_customer_budget.py +0 -183
- openapi_fal_rest/api/files/delete.py +0 -162
- openapi_fal_rest/api/files/download.py +0 -162
- openapi_fal_rest/api/files/file_exists.py +0 -183
- openapi_fal_rest/api/files/list_directory.py +0 -173
- openapi_fal_rest/api/files/list_root.py +0 -152
- openapi_fal_rest/api/files/upload_from_url.py +0 -179
- openapi_fal_rest/api/health/__init__.py +0 -0
- openapi_fal_rest/api/health/check.py +0 -136
- openapi_fal_rest/api/keys/__init__.py +0 -0
- openapi_fal_rest/api/keys/create_key.py +0 -188
- openapi_fal_rest/api/keys/delete_key.py +0 -162
- openapi_fal_rest/api/keys/list_keys.py +0 -152
- openapi_fal_rest/api/logs/__init__.py +0 -0
- openapi_fal_rest/api/logs/list_since.py +0 -224
- openapi_fal_rest/api/requests/__init__.py +0 -0
- openapi_fal_rest/api/requests/requests.py +0 -247
- openapi_fal_rest/api/storage/__init__.py +0 -0
- openapi_fal_rest/api/storage/get_file_link.py +0 -200
- openapi_fal_rest/api/storage/initiate_upload.py +0 -172
- openapi_fal_rest/api/storage/upload_file.py +0 -172
- openapi_fal_rest/api/tokens/__init__.py +0 -0
- openapi_fal_rest/api/tokens/create_token.py +0 -166
- openapi_fal_rest/api/usage/__init__.py +0 -0
- openapi_fal_rest/api/usage/get_custom_usage_per_machine.py +0 -203
- openapi_fal_rest/api/usage/get_gateway_request_stats.py +0 -247
- openapi_fal_rest/api/usage/get_gateway_request_stats_by_time.py +0 -236
- openapi_fal_rest/api/usage/get_gateway_stats_for_yesterday.py +0 -152
- openapi_fal_rest/api/usage/get_shared_usage_per_app.py +0 -203
- openapi_fal_rest/api/usage/get_usage_records.py +0 -253
- openapi_fal_rest/api/usage/per_machine_usage.py +0 -218
- openapi_fal_rest/api/usage/per_machine_usage_details.py +0 -173
- openapi_fal_rest/api/users/__init__.py +0 -0
- openapi_fal_rest/api/users/handle_user_registration.py +0 -228
- openapi_fal_rest/models/billing_type.py +0 -9
- openapi_fal_rest/models/body_create_token.py +0 -68
- openapi_fal_rest/models/body_upload_file.py +0 -75
- openapi_fal_rest/models/file_spec.py +0 -110
- openapi_fal_rest/models/gateway_stats_by_time.py +0 -115
- openapi_fal_rest/models/gateway_usage_stats.py +0 -147
- openapi_fal_rest/models/get_gateway_request_stats_by_time_response_get_gateway_request_stats_by_time.py +0 -70
- openapi_fal_rest/models/grouped_usage_detail.py +0 -85
- openapi_fal_rest/models/handle_stripe_webhook_response_handle_stripe_webhook.py +0 -43
- openapi_fal_rest/models/initiate_upload_info.py +0 -64
- openapi_fal_rest/models/invoice.py +0 -129
- openapi_fal_rest/models/invoice_item.py +0 -85
- openapi_fal_rest/models/key_scope.py +0 -9
- openapi_fal_rest/models/log_entry.py +0 -104
- openapi_fal_rest/models/log_entry_labels.py +0 -43
- openapi_fal_rest/models/new_user_key.py +0 -64
- openapi_fal_rest/models/payment_method.py +0 -96
- openapi_fal_rest/models/per_app_usage_detail.py +0 -88
- openapi_fal_rest/models/persisted_usage_record.py +0 -118
- openapi_fal_rest/models/persisted_usage_record_meta.py +0 -43
- openapi_fal_rest/models/presigned_upload_url.py +0 -64
- openapi_fal_rest/models/request_io.py +0 -112
- openapi_fal_rest/models/request_io_json_input.py +0 -43
- openapi_fal_rest/models/request_io_json_output.py +0 -43
- openapi_fal_rest/models/run_type.py +0 -9
- openapi_fal_rest/models/stats_timeframe.py +0 -12
- openapi_fal_rest/models/status.py +0 -82
- openapi_fal_rest/models/status_health.py +0 -10
- openapi_fal_rest/models/uploaded_file_result.py +0 -64
- openapi_fal_rest/models/url_file_upload.py +0 -57
- openapi_fal_rest/models/usage_per_machine_type.py +0 -115
- openapi_fal_rest/models/usage_per_user.py +0 -71
- openapi_fal_rest/models/usage_run_detail.py +0 -73
- openapi_fal_rest/models/user_key_info.py +0 -84
- /openapi_fal_rest/api/admin/__init__.py → /fal/py.typed +0 -0
- {fal-0.12.1.dist-info → fal-0.12.3.dist-info}/WHEEL +0 -0
- {fal-0.12.1.dist-info → fal-0.12.3.dist-info}/entry_points.txt +0 -0
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import datetime
|
|
2
|
-
from typing import Any, Dict, List, Type, TypeVar
|
|
3
|
-
|
|
4
|
-
import attr
|
|
5
|
-
from dateutil.parser import isoparse
|
|
6
|
-
|
|
7
|
-
T = TypeVar("T", bound="UsagePerMachineType")
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@attr.s(auto_attribs=True)
|
|
11
|
-
class UsagePerMachineType:
|
|
12
|
-
"""
|
|
13
|
-
Attributes:
|
|
14
|
-
machine_type (str):
|
|
15
|
-
day (datetime.date):
|
|
16
|
-
num_workers (int):
|
|
17
|
-
num_runs (int):
|
|
18
|
-
run_call_seconds (int):
|
|
19
|
-
run_execution_seconds (int):
|
|
20
|
-
run_queue_seconds (int):
|
|
21
|
-
worker_uptime_seconds (int):
|
|
22
|
-
worker_idle_seconds (int):
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
machine_type: str
|
|
26
|
-
day: datetime.date
|
|
27
|
-
num_workers: int
|
|
28
|
-
num_runs: int
|
|
29
|
-
run_call_seconds: int
|
|
30
|
-
run_execution_seconds: int
|
|
31
|
-
run_queue_seconds: int
|
|
32
|
-
worker_uptime_seconds: int
|
|
33
|
-
worker_idle_seconds: int
|
|
34
|
-
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
35
|
-
|
|
36
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
37
|
-
machine_type = self.machine_type
|
|
38
|
-
day = self.day.isoformat()
|
|
39
|
-
num_workers = self.num_workers
|
|
40
|
-
num_runs = self.num_runs
|
|
41
|
-
run_call_seconds = self.run_call_seconds
|
|
42
|
-
run_execution_seconds = self.run_execution_seconds
|
|
43
|
-
run_queue_seconds = self.run_queue_seconds
|
|
44
|
-
worker_uptime_seconds = self.worker_uptime_seconds
|
|
45
|
-
worker_idle_seconds = self.worker_idle_seconds
|
|
46
|
-
|
|
47
|
-
field_dict: Dict[str, Any] = {}
|
|
48
|
-
field_dict.update(self.additional_properties)
|
|
49
|
-
field_dict.update(
|
|
50
|
-
{
|
|
51
|
-
"machine_type": machine_type,
|
|
52
|
-
"day": day,
|
|
53
|
-
"num_workers": num_workers,
|
|
54
|
-
"num_runs": num_runs,
|
|
55
|
-
"run_call_seconds": run_call_seconds,
|
|
56
|
-
"run_execution_seconds": run_execution_seconds,
|
|
57
|
-
"run_queue_seconds": run_queue_seconds,
|
|
58
|
-
"worker_uptime_seconds": worker_uptime_seconds,
|
|
59
|
-
"worker_idle_seconds": worker_idle_seconds,
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
return field_dict
|
|
64
|
-
|
|
65
|
-
@classmethod
|
|
66
|
-
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
67
|
-
d = src_dict.copy()
|
|
68
|
-
machine_type = d.pop("machine_type")
|
|
69
|
-
|
|
70
|
-
day = isoparse(d.pop("day")).date()
|
|
71
|
-
|
|
72
|
-
num_workers = d.pop("num_workers")
|
|
73
|
-
|
|
74
|
-
num_runs = d.pop("num_runs")
|
|
75
|
-
|
|
76
|
-
run_call_seconds = d.pop("run_call_seconds")
|
|
77
|
-
|
|
78
|
-
run_execution_seconds = d.pop("run_execution_seconds")
|
|
79
|
-
|
|
80
|
-
run_queue_seconds = d.pop("run_queue_seconds")
|
|
81
|
-
|
|
82
|
-
worker_uptime_seconds = d.pop("worker_uptime_seconds")
|
|
83
|
-
|
|
84
|
-
worker_idle_seconds = d.pop("worker_idle_seconds")
|
|
85
|
-
|
|
86
|
-
usage_per_machine_type = cls(
|
|
87
|
-
machine_type=machine_type,
|
|
88
|
-
day=day,
|
|
89
|
-
num_workers=num_workers,
|
|
90
|
-
num_runs=num_runs,
|
|
91
|
-
run_call_seconds=run_call_seconds,
|
|
92
|
-
run_execution_seconds=run_execution_seconds,
|
|
93
|
-
run_queue_seconds=run_queue_seconds,
|
|
94
|
-
worker_uptime_seconds=worker_uptime_seconds,
|
|
95
|
-
worker_idle_seconds=worker_idle_seconds,
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
usage_per_machine_type.additional_properties = d
|
|
99
|
-
return usage_per_machine_type
|
|
100
|
-
|
|
101
|
-
@property
|
|
102
|
-
def additional_keys(self) -> List[str]:
|
|
103
|
-
return list(self.additional_properties.keys())
|
|
104
|
-
|
|
105
|
-
def __getitem__(self, key: str) -> Any:
|
|
106
|
-
return self.additional_properties[key]
|
|
107
|
-
|
|
108
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
|
109
|
-
self.additional_properties[key] = value
|
|
110
|
-
|
|
111
|
-
def __delitem__(self, key: str) -> None:
|
|
112
|
-
del self.additional_properties[key]
|
|
113
|
-
|
|
114
|
-
def __contains__(self, key: str) -> bool:
|
|
115
|
-
return key in self.additional_properties
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
from typing import Any, Dict, List, Type, TypeVar
|
|
2
|
-
|
|
3
|
-
import attr
|
|
4
|
-
|
|
5
|
-
T = TypeVar("T", bound="UsagePerUser")
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@attr.s(auto_attribs=True)
|
|
9
|
-
class UsagePerUser:
|
|
10
|
-
"""
|
|
11
|
-
Attributes:
|
|
12
|
-
user_id (str):
|
|
13
|
-
machine_type (str):
|
|
14
|
-
total_billable_duration (int):
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
user_id: str
|
|
18
|
-
machine_type: str
|
|
19
|
-
total_billable_duration: int
|
|
20
|
-
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
21
|
-
|
|
22
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
23
|
-
user_id = self.user_id
|
|
24
|
-
machine_type = self.machine_type
|
|
25
|
-
total_billable_duration = self.total_billable_duration
|
|
26
|
-
|
|
27
|
-
field_dict: Dict[str, Any] = {}
|
|
28
|
-
field_dict.update(self.additional_properties)
|
|
29
|
-
field_dict.update(
|
|
30
|
-
{
|
|
31
|
-
"user_id": user_id,
|
|
32
|
-
"machine_type": machine_type,
|
|
33
|
-
"total_billable_duration": total_billable_duration,
|
|
34
|
-
}
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
return field_dict
|
|
38
|
-
|
|
39
|
-
@classmethod
|
|
40
|
-
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
41
|
-
d = src_dict.copy()
|
|
42
|
-
user_id = d.pop("user_id")
|
|
43
|
-
|
|
44
|
-
machine_type = d.pop("machine_type")
|
|
45
|
-
|
|
46
|
-
total_billable_duration = d.pop("total_billable_duration")
|
|
47
|
-
|
|
48
|
-
usage_per_user = cls(
|
|
49
|
-
user_id=user_id,
|
|
50
|
-
machine_type=machine_type,
|
|
51
|
-
total_billable_duration=total_billable_duration,
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
usage_per_user.additional_properties = d
|
|
55
|
-
return usage_per_user
|
|
56
|
-
|
|
57
|
-
@property
|
|
58
|
-
def additional_keys(self) -> List[str]:
|
|
59
|
-
return list(self.additional_properties.keys())
|
|
60
|
-
|
|
61
|
-
def __getitem__(self, key: str) -> Any:
|
|
62
|
-
return self.additional_properties[key]
|
|
63
|
-
|
|
64
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
|
65
|
-
self.additional_properties[key] = value
|
|
66
|
-
|
|
67
|
-
def __delitem__(self, key: str) -> None:
|
|
68
|
-
del self.additional_properties[key]
|
|
69
|
-
|
|
70
|
-
def __contains__(self, key: str) -> bool:
|
|
71
|
-
return key in self.additional_properties
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import datetime
|
|
2
|
-
from typing import Any, Dict, List, Type, TypeVar
|
|
3
|
-
|
|
4
|
-
import attr
|
|
5
|
-
from dateutil.parser import isoparse
|
|
6
|
-
|
|
7
|
-
T = TypeVar("T", bound="UsageRunDetail")
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@attr.s(auto_attribs=True)
|
|
11
|
-
class UsageRunDetail:
|
|
12
|
-
"""
|
|
13
|
-
Attributes:
|
|
14
|
-
id (str):
|
|
15
|
-
duration_seconds (int):
|
|
16
|
-
start_time (datetime.date):
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
id: str
|
|
20
|
-
duration_seconds: int
|
|
21
|
-
start_time: datetime.date
|
|
22
|
-
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
23
|
-
|
|
24
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
25
|
-
id = self.id
|
|
26
|
-
duration_seconds = self.duration_seconds
|
|
27
|
-
start_time = self.start_time.isoformat()
|
|
28
|
-
|
|
29
|
-
field_dict: Dict[str, Any] = {}
|
|
30
|
-
field_dict.update(self.additional_properties)
|
|
31
|
-
field_dict.update(
|
|
32
|
-
{
|
|
33
|
-
"id": id,
|
|
34
|
-
"duration_seconds": duration_seconds,
|
|
35
|
-
"start_time": start_time,
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
return field_dict
|
|
40
|
-
|
|
41
|
-
@classmethod
|
|
42
|
-
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
43
|
-
d = src_dict.copy()
|
|
44
|
-
id = d.pop("id")
|
|
45
|
-
|
|
46
|
-
duration_seconds = d.pop("duration_seconds")
|
|
47
|
-
|
|
48
|
-
start_time = isoparse(d.pop("start_time")).date()
|
|
49
|
-
|
|
50
|
-
usage_run_detail = cls(
|
|
51
|
-
id=id,
|
|
52
|
-
duration_seconds=duration_seconds,
|
|
53
|
-
start_time=start_time,
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
usage_run_detail.additional_properties = d
|
|
57
|
-
return usage_run_detail
|
|
58
|
-
|
|
59
|
-
@property
|
|
60
|
-
def additional_keys(self) -> List[str]:
|
|
61
|
-
return list(self.additional_properties.keys())
|
|
62
|
-
|
|
63
|
-
def __getitem__(self, key: str) -> Any:
|
|
64
|
-
return self.additional_properties[key]
|
|
65
|
-
|
|
66
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
|
67
|
-
self.additional_properties[key] = value
|
|
68
|
-
|
|
69
|
-
def __delitem__(self, key: str) -> None:
|
|
70
|
-
del self.additional_properties[key]
|
|
71
|
-
|
|
72
|
-
def __contains__(self, key: str) -> bool:
|
|
73
|
-
return key in self.additional_properties
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import datetime
|
|
2
|
-
from typing import Any, Dict, List, Type, TypeVar
|
|
3
|
-
|
|
4
|
-
import attr
|
|
5
|
-
from dateutil.parser import isoparse
|
|
6
|
-
|
|
7
|
-
from ..models.key_scope import KeyScope
|
|
8
|
-
|
|
9
|
-
T = TypeVar("T", bound="UserKeyInfo")
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@attr.s(auto_attribs=True)
|
|
13
|
-
class UserKeyInfo:
|
|
14
|
-
"""
|
|
15
|
-
Attributes:
|
|
16
|
-
key_id (str):
|
|
17
|
-
created_at (datetime.datetime):
|
|
18
|
-
scope (KeyScope): An enumeration.
|
|
19
|
-
alias (str):
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
key_id: str
|
|
23
|
-
created_at: datetime.datetime
|
|
24
|
-
scope: KeyScope
|
|
25
|
-
alias: str
|
|
26
|
-
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
27
|
-
|
|
28
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
29
|
-
key_id = self.key_id
|
|
30
|
-
created_at = self.created_at.isoformat()
|
|
31
|
-
|
|
32
|
-
scope = self.scope.value
|
|
33
|
-
|
|
34
|
-
alias = self.alias
|
|
35
|
-
|
|
36
|
-
field_dict: Dict[str, Any] = {}
|
|
37
|
-
field_dict.update(self.additional_properties)
|
|
38
|
-
field_dict.update(
|
|
39
|
-
{
|
|
40
|
-
"key_id": key_id,
|
|
41
|
-
"created_at": created_at,
|
|
42
|
-
"scope": scope,
|
|
43
|
-
"alias": alias,
|
|
44
|
-
}
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
return field_dict
|
|
48
|
-
|
|
49
|
-
@classmethod
|
|
50
|
-
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
51
|
-
d = src_dict.copy()
|
|
52
|
-
key_id = d.pop("key_id")
|
|
53
|
-
|
|
54
|
-
created_at = isoparse(d.pop("created_at"))
|
|
55
|
-
|
|
56
|
-
scope = KeyScope(d.pop("scope"))
|
|
57
|
-
|
|
58
|
-
alias = d.pop("alias")
|
|
59
|
-
|
|
60
|
-
user_key_info = cls(
|
|
61
|
-
key_id=key_id,
|
|
62
|
-
created_at=created_at,
|
|
63
|
-
scope=scope,
|
|
64
|
-
alias=alias,
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
user_key_info.additional_properties = d
|
|
68
|
-
return user_key_info
|
|
69
|
-
|
|
70
|
-
@property
|
|
71
|
-
def additional_keys(self) -> List[str]:
|
|
72
|
-
return list(self.additional_properties.keys())
|
|
73
|
-
|
|
74
|
-
def __getitem__(self, key: str) -> Any:
|
|
75
|
-
return self.additional_properties[key]
|
|
76
|
-
|
|
77
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
|
78
|
-
self.additional_properties[key] = value
|
|
79
|
-
|
|
80
|
-
def __delitem__(self, key: str) -> None:
|
|
81
|
-
del self.additional_properties[key]
|
|
82
|
-
|
|
83
|
-
def __contains__(self, key: str) -> bool:
|
|
84
|
-
return key in self.additional_properties
|
|
File without changes
|
|
File without changes
|
|
File without changes
|