tinybird 0.0.1.dev76__py3-none-any.whl → 0.0.1.dev77__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 tinybird might be problematic. Click here for more details.
- tinybird/client.py +16 -1
- tinybird/feedback_manager.py +11 -0
- tinybird/tb/__cli__.py +2 -2
- tinybird/tb/modules/build.py +0 -1
- tinybird/tb/modules/cicd.py +1 -1
- tinybird/tb/modules/cli.py +5 -1
- tinybird/tb/modules/create.py +18 -5
- tinybird/tb/modules/local_common.py +5 -2
- tinybird/tb_cli_modules/common.py +131 -7
- tinybird/tb_cli_modules/config.py +3 -0
- {tinybird-0.0.1.dev76.dist-info → tinybird-0.0.1.dev77.dist-info}/METADATA +3 -3
- {tinybird-0.0.1.dev76.dist-info → tinybird-0.0.1.dev77.dist-info}/RECORD +15 -15
- {tinybird-0.0.1.dev76.dist-info → tinybird-0.0.1.dev77.dist-info}/WHEEL +0 -0
- {tinybird-0.0.1.dev76.dist-info → tinybird-0.0.1.dev77.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev76.dist-info → tinybird-0.0.1.dev77.dist-info}/top_level.txt +0 -0
tinybird/client.py
CHANGED
|
@@ -709,6 +709,11 @@ class TinyB:
|
|
|
709
709
|
async def user_workspaces_and_branches(self):
|
|
710
710
|
return await self._req("/v0/user/workspaces/?with_environments=true")
|
|
711
711
|
|
|
712
|
+
async def user_workspaces_with_organization(self):
|
|
713
|
+
return await self._req(
|
|
714
|
+
"/v0/user/workspaces/?with_environments=false&with_organization=true&with_members_and_owner=false"
|
|
715
|
+
)
|
|
716
|
+
|
|
712
717
|
async def user_workspace_branches(self):
|
|
713
718
|
return await self._req("/v0/user/workspaces/?with_environments=true&only_environments=true")
|
|
714
719
|
|
|
@@ -718,10 +723,17 @@ class TinyB:
|
|
|
718
723
|
async def releases(self, workspace_id):
|
|
719
724
|
return await self._req(f"/v0/workspaces/{workspace_id}/releases")
|
|
720
725
|
|
|
721
|
-
async def create_workspace(
|
|
726
|
+
async def create_workspace(
|
|
727
|
+
self,
|
|
728
|
+
name: str,
|
|
729
|
+
template: Optional[str],
|
|
730
|
+
assign_to_organization_id: Optional[str] = None,
|
|
731
|
+
):
|
|
722
732
|
url = f"/v0/workspaces?name={name}"
|
|
723
733
|
if template:
|
|
724
734
|
url += f"&starter_kit={template}"
|
|
735
|
+
if assign_to_organization_id:
|
|
736
|
+
url += f"&assign_to_organization_id={assign_to_organization_id}"
|
|
725
737
|
return await self._req(url, method="POST", data=b"")
|
|
726
738
|
|
|
727
739
|
async def create_workspace_branch(
|
|
@@ -856,6 +868,9 @@ class TinyB:
|
|
|
856
868
|
async def workspace_info(self) -> Dict[str, Any]:
|
|
857
869
|
return await self._req("/v0/workspace")
|
|
858
870
|
|
|
871
|
+
async def organization(self, organization_id: str):
|
|
872
|
+
return await self._req(f"/v0/organizations/{organization_id}")
|
|
873
|
+
|
|
859
874
|
async def wait_for_job(
|
|
860
875
|
self,
|
|
861
876
|
job_id: str,
|
tinybird/feedback_manager.py
CHANGED
|
@@ -247,6 +247,14 @@ class FeedbackManager:
|
|
|
247
247
|
error_connection_invalid_ca_pem = error_message("Invalid CA certificate in PEM format")
|
|
248
248
|
error_connection_ca_pem_not_found = error_message("CA certificate in PEM format not found at {ca_pem}")
|
|
249
249
|
error_workspace = error_message("Workspace {workspace} not found. use 'tb workspace ls' to list your workspaces")
|
|
250
|
+
error_organization_not_found = error_message("Organization with id '{organization_id}' not found")
|
|
251
|
+
error_organization_index = error_message(
|
|
252
|
+
"Error selecting organization '{organization_index}'. Select a valid index or 0 to cancel"
|
|
253
|
+
)
|
|
254
|
+
warning_none_organization = warning_message(
|
|
255
|
+
"Tinybird is now based on organizations. Please, go to the UI ({ui_host}) to follow the migration process. \nYour workspace will be created any way."
|
|
256
|
+
)
|
|
257
|
+
error_while_fetching_orgs = error_message("Error while fetching organizations: {error}")
|
|
250
258
|
error_deleted_include = error_message(
|
|
251
259
|
"Related include file {include_file} was deleted and it's used in {filename}. Delete or remove dependency from {filename}."
|
|
252
260
|
)
|
|
@@ -981,6 +989,9 @@ Ready? """
|
|
|
981
989
|
success_connection_using = success_message("** Using connection '{connection_name}'")
|
|
982
990
|
success_using_host = success_message("** Using host: {host} ({name})")
|
|
983
991
|
success_workspace_created = success_message("** Workspace '{workspace_name}' has been created")
|
|
992
|
+
success_workspace_created_with_organization = success_message(
|
|
993
|
+
"** Workspace '{workspace_name}' has been created in Organization '{organization_name}' (id: '{organization_id}')"
|
|
994
|
+
)
|
|
984
995
|
success_workspace_branch_created = success_message(
|
|
985
996
|
"** Branch '{branch_name}' from '{workspace_name}' has been created"
|
|
986
997
|
)
|
tinybird/tb/__cli__.py
CHANGED
|
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
|
|
|
4
4
|
__url__ = 'https://www.tinybird.co/docs/cli/introduction.html'
|
|
5
5
|
__author__ = 'Tinybird'
|
|
6
6
|
__author_email__ = 'support@tinybird.co'
|
|
7
|
-
__version__ = '0.0.1.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev77'
|
|
8
|
+
__revision__ = '44da91f'
|
tinybird/tb/modules/build.py
CHANGED
|
@@ -132,7 +132,6 @@ def build_project(project: Project, tb_client: TinyB, file_changed: Optional[str
|
|
|
132
132
|
click.echo(
|
|
133
133
|
FeedbackManager.warning(message=f"△ {f.get('level')}: {f.get('resource')}: {f.get('message')}")
|
|
134
134
|
)
|
|
135
|
-
|
|
136
135
|
elif build_result == "failed":
|
|
137
136
|
build_errors = result.get("errors")
|
|
138
137
|
error_msg = None
|
tinybird/tb/modules/cicd.py
CHANGED
|
@@ -25,7 +25,7 @@ on:
|
|
|
25
25
|
branches:
|
|
26
26
|
- main
|
|
27
27
|
- master
|
|
28
|
-
types: [opened, reopened, labeled, unlabeled, synchronize
|
|
28
|
+
types: [opened, reopened, labeled, unlabeled, synchronize]{% if data_project_dir != '.' %}
|
|
29
29
|
paths:
|
|
30
30
|
- '{{ data_project_dir }}/**'{% end %}
|
|
31
31
|
|
tinybird/tb/modules/cli.py
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import json
|
|
7
7
|
import logging
|
|
8
8
|
import os
|
|
9
|
+
import sys
|
|
9
10
|
from os import getcwd
|
|
10
11
|
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
|
11
12
|
|
|
@@ -123,6 +124,9 @@ async def cli(
|
|
|
123
124
|
|
|
124
125
|
logging.debug("debug enabled")
|
|
125
126
|
|
|
127
|
+
if "--help" in sys.argv or "-h" in sys.argv:
|
|
128
|
+
return
|
|
129
|
+
|
|
126
130
|
client = await create_ctx_client(ctx, config, cloud, build, staging)
|
|
127
131
|
|
|
128
132
|
if client:
|
|
@@ -399,8 +403,8 @@ async def create_ctx_client(ctx: Context, config: Dict[str, Any], cloud: bool, b
|
|
|
399
403
|
commands_always_local = ["create"]
|
|
400
404
|
if (
|
|
401
405
|
(cloud or command in commands_always_cloud)
|
|
402
|
-
and command not in commands_always_build
|
|
403
406
|
and command not in commands_always_local
|
|
407
|
+
and command not in commands_always_build
|
|
404
408
|
):
|
|
405
409
|
click.echo(
|
|
406
410
|
FeedbackManager.gray(message=f"Running against Tinybird Cloud: Workspace {config.get('name', 'default')}")
|
tinybird/tb/modules/create.py
CHANGED
|
@@ -50,6 +50,7 @@ async def create(ctx: click.Context, data: Optional[str], prompt: Optional[str],
|
|
|
50
50
|
config = CLIConfig.get_project_config(str(project.path))
|
|
51
51
|
tb_client = config.get_client()
|
|
52
52
|
user_token: Optional[str] = None
|
|
53
|
+
created = False
|
|
53
54
|
if prompt:
|
|
54
55
|
try:
|
|
55
56
|
user_token = config.get_user_token()
|
|
@@ -68,24 +69,24 @@ async def create(ctx: click.Context, data: Optional[str], prompt: Optional[str],
|
|
|
68
69
|
click.echo(FeedbackManager.highlight(message="\n» Creating new project structure..."))
|
|
69
70
|
create_project_structure(folder)
|
|
70
71
|
click.echo(FeedbackManager.success(message="✓ Scaffolding completed!\n"))
|
|
71
|
-
|
|
72
|
+
created = True
|
|
72
73
|
result = ""
|
|
73
74
|
if data or prompt:
|
|
74
75
|
click.echo(FeedbackManager.highlight(message="\n» Creating resources..."))
|
|
75
76
|
result = await create_resources(local_client, tb_client, user_token, data, prompt, folder)
|
|
76
77
|
click.echo(FeedbackManager.success(message="✓ Done!\n"))
|
|
77
|
-
|
|
78
|
+
created = True
|
|
78
79
|
if not already_has_cicd(folder):
|
|
79
80
|
click.echo(FeedbackManager.highlight(message="\n» Creating CI/CD files for GitHub and GitLab..."))
|
|
80
81
|
init_git(folder)
|
|
81
82
|
await init_cicd(data_project_dir=os.path.relpath(folder))
|
|
82
83
|
click.echo(FeedbackManager.success(message="✓ Done!\n"))
|
|
83
|
-
|
|
84
|
+
created = True
|
|
84
85
|
if not already_has_cursor_rules(folder):
|
|
85
86
|
click.echo(FeedbackManager.highlight(message="\n» Creating .cursorrules..."))
|
|
86
87
|
create_rules(folder, source, "cursor")
|
|
87
88
|
click.echo(FeedbackManager.success(message="✓ Done!\n"))
|
|
88
|
-
|
|
89
|
+
created = True
|
|
89
90
|
if should_generate_fixtures(result):
|
|
90
91
|
click.echo(FeedbackManager.highlight(message="\n» Generating fixtures..."))
|
|
91
92
|
|
|
@@ -95,6 +96,7 @@ async def create(ctx: click.Context, data: Optional[str], prompt: Optional[str],
|
|
|
95
96
|
datasource_path = Path(folder) / "datasources" / f"{ds_name}.datasource"
|
|
96
97
|
click.echo(FeedbackManager.info(message=f"✓ /fixtures/{ds_name}"))
|
|
97
98
|
persist_fixture(ds_name, data_content, folder)
|
|
99
|
+
created = True
|
|
98
100
|
elif prompt and user_token:
|
|
99
101
|
datasource_files = [f for f in os.listdir(Path(folder) / "datasources") if f.endswith(".datasource")]
|
|
100
102
|
for datasource_file in datasource_files:
|
|
@@ -113,6 +115,9 @@ async def create(ctx: click.Context, data: Optional[str], prompt: Optional[str],
|
|
|
113
115
|
if data:
|
|
114
116
|
persist_fixture(datasource_name, data, folder)
|
|
115
117
|
click.echo(FeedbackManager.info(message=f"✓ /fixtures/{datasource_name}"))
|
|
118
|
+
created = True
|
|
119
|
+
if not created:
|
|
120
|
+
click.echo(FeedbackManager.warning(message="△ No resources created\n"))
|
|
116
121
|
except Exception as e:
|
|
117
122
|
click.echo(FeedbackManager.error(message=f"Error: {str(e)}"))
|
|
118
123
|
|
|
@@ -121,7 +126,15 @@ PROJECT_PATHS = ("datasources", "endpoints", "materializations", "copies", "pipe
|
|
|
121
126
|
|
|
122
127
|
|
|
123
128
|
def validate_project_structure(folder: str) -> bool:
|
|
124
|
-
|
|
129
|
+
some_folder_created = any((Path(folder) / path).exists() for path in PROJECT_PATHS)
|
|
130
|
+
if some_folder_created:
|
|
131
|
+
return True
|
|
132
|
+
|
|
133
|
+
folder_path = Path(folder)
|
|
134
|
+
datasources = list(folder_path.glob("**/*.datasource"))
|
|
135
|
+
pipes = list(folder_path.glob("**/*.pipe"))
|
|
136
|
+
|
|
137
|
+
return len(datasources) > 0 or len(pipes) > 0
|
|
125
138
|
|
|
126
139
|
|
|
127
140
|
def should_generate_fixtures(result: str) -> bool:
|
|
@@ -48,13 +48,16 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any], build: bool = Fa
|
|
|
48
48
|
|
|
49
49
|
logging.debug(f"Workspace used for build: {ws_name}")
|
|
50
50
|
|
|
51
|
-
user_workspaces = requests.get(
|
|
51
|
+
user_workspaces = requests.get(
|
|
52
|
+
f"{TB_LOCAL_HOST}/v0/user/workspaces?with_organization=true&token={admin_token}"
|
|
53
|
+
).json()
|
|
54
|
+
user_org_id = user_workspaces.get("organization_id", {})
|
|
52
55
|
local_workspaces = user_workspaces.get("workspaces", [])
|
|
53
56
|
|
|
54
57
|
ws = next((ws for ws in local_workspaces if ws["name"] == ws_name), None)
|
|
55
58
|
|
|
56
59
|
if not ws:
|
|
57
|
-
await user_client.create_workspace(ws_name, template=None)
|
|
60
|
+
await user_client.create_workspace(ws_name, template=None, assign_to_organization_id=user_org_id)
|
|
58
61
|
user_workspaces = requests.get(f"{TB_LOCAL_HOST}/v0/user/workspaces?token={admin_token}").json()
|
|
59
62
|
ws = next((ws for ws in user_workspaces["workspaces"] if ws["name"] == ws_name), None)
|
|
60
63
|
if not ws:
|
|
@@ -18,7 +18,7 @@ from enum import Enum
|
|
|
18
18
|
from functools import wraps
|
|
19
19
|
from os import chmod, environ, getcwd, getenv
|
|
20
20
|
from pathlib import Path
|
|
21
|
-
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Union
|
|
21
|
+
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Literal, Optional, Set, Tuple, TypedDict, Union
|
|
22
22
|
from urllib.parse import urlparse
|
|
23
23
|
|
|
24
24
|
import aiofiles
|
|
@@ -707,7 +707,13 @@ async def fork_workspace(client: TinyB, user_client: TinyB, created_workspace):
|
|
|
707
707
|
|
|
708
708
|
|
|
709
709
|
async def create_workspace_non_interactive(
|
|
710
|
-
ctx: Context,
|
|
710
|
+
ctx: Context,
|
|
711
|
+
workspace_name: str,
|
|
712
|
+
starterkit: Optional[str],
|
|
713
|
+
user_token: str,
|
|
714
|
+
fork: bool,
|
|
715
|
+
organization_id: Optional[str],
|
|
716
|
+
organization_name: Optional[str],
|
|
711
717
|
):
|
|
712
718
|
"""Creates a workspace using the provided name and starterkit"""
|
|
713
719
|
client: TinyB = ctx.ensure_object(dict)["client"]
|
|
@@ -716,8 +722,15 @@ async def create_workspace_non_interactive(
|
|
|
716
722
|
user_client: TinyB = deepcopy(client)
|
|
717
723
|
user_client.token = user_token
|
|
718
724
|
|
|
719
|
-
created_workspace = await user_client.create_workspace(workspace_name, starterkit)
|
|
720
|
-
|
|
725
|
+
created_workspace = await user_client.create_workspace(workspace_name, starterkit, organization_id)
|
|
726
|
+
if organization_id and organization_name:
|
|
727
|
+
click.echo(
|
|
728
|
+
FeedbackManager.success_workspace_created_with_organization(
|
|
729
|
+
workspace_name=workspace_name, organization_name=organization_name, organization_id=organization_id
|
|
730
|
+
)
|
|
731
|
+
)
|
|
732
|
+
else:
|
|
733
|
+
click.echo(FeedbackManager.success_workspace_created(workspace_name=workspace_name))
|
|
721
734
|
|
|
722
735
|
if fork:
|
|
723
736
|
await fork_workspace(client, user_client, created_workspace)
|
|
@@ -727,7 +740,13 @@ async def create_workspace_non_interactive(
|
|
|
727
740
|
|
|
728
741
|
|
|
729
742
|
async def create_workspace_interactive(
|
|
730
|
-
ctx: Context,
|
|
743
|
+
ctx: Context,
|
|
744
|
+
workspace_name: Optional[str],
|
|
745
|
+
starterkit: Optional[str],
|
|
746
|
+
user_token: str,
|
|
747
|
+
fork: bool,
|
|
748
|
+
organization_id: Optional[str],
|
|
749
|
+
organization_name: Optional[str],
|
|
731
750
|
):
|
|
732
751
|
if not starterkit and not is_ci_environment():
|
|
733
752
|
click.echo("\n")
|
|
@@ -744,8 +763,17 @@ async def create_workspace_interactive(
|
|
|
744
763
|
click.echo(FeedbackManager.info_workspace_create_greeting())
|
|
745
764
|
default_name = f"new_workspace_{uuid.uuid4().hex[0:4]}"
|
|
746
765
|
workspace_name = click.prompt("\nWorkspace name", default=default_name, err=True, type=str)
|
|
747
|
-
|
|
748
|
-
|
|
766
|
+
assert isinstance(workspace_name, str)
|
|
767
|
+
|
|
768
|
+
await create_workspace_non_interactive(
|
|
769
|
+
ctx,
|
|
770
|
+
workspace_name,
|
|
771
|
+
starterkit,
|
|
772
|
+
user_token,
|
|
773
|
+
fork,
|
|
774
|
+
organization_id=organization_id,
|
|
775
|
+
organization_name=organization_name,
|
|
776
|
+
)
|
|
749
777
|
|
|
750
778
|
|
|
751
779
|
async def create_workspace_branch(
|
|
@@ -2080,3 +2108,99 @@ def get_ca_pem_content(ca_pem: Optional[str], filename: Optional[str] = None) ->
|
|
|
2080
2108
|
raise CLIConnectionException(FeedbackManager.error_connection_invalid_ca_pem())
|
|
2081
2109
|
|
|
2082
2110
|
return ca_pem_content
|
|
2111
|
+
|
|
2112
|
+
|
|
2113
|
+
async def get_organizations_by_user(ctx: Context, user_token: str) -> List[Dict[str, Any]]:
|
|
2114
|
+
"""Fetches all organizations by user using the provided user token"""
|
|
2115
|
+
client: TinyB = ctx.ensure_object(dict)["client"]
|
|
2116
|
+
organizations = []
|
|
2117
|
+
|
|
2118
|
+
try:
|
|
2119
|
+
user_client: TinyB = deepcopy(client)
|
|
2120
|
+
user_client.token = user_token
|
|
2121
|
+
user_workspaces = await user_client.user_workspaces_with_organization()
|
|
2122
|
+
admin_org_id = user_workspaces.get("organization_id")
|
|
2123
|
+
seen_org_ids = set()
|
|
2124
|
+
|
|
2125
|
+
for workspace in user_workspaces.get("workspaces"):
|
|
2126
|
+
org = workspace.get("organization")
|
|
2127
|
+
if org and org.get("id") not in seen_org_ids:
|
|
2128
|
+
org["is_admin"] = org.get("id") == admin_org_id
|
|
2129
|
+
organizations.append(org)
|
|
2130
|
+
seen_org_ids.add(org.get("id"))
|
|
2131
|
+
|
|
2132
|
+
# Case: user is admin of an organization but not a member of any workspace in it
|
|
2133
|
+
if admin_org_id and admin_org_id not in seen_org_ids:
|
|
2134
|
+
org = await user_client.organization(admin_org_id)
|
|
2135
|
+
org["id"] = admin_org_id
|
|
2136
|
+
org["is_admin"] = True
|
|
2137
|
+
organizations.append(org)
|
|
2138
|
+
|
|
2139
|
+
except Exception as e:
|
|
2140
|
+
raise CLIWorkspaceException(FeedbackManager.error_while_fetching_orgs(error=str(e)))
|
|
2141
|
+
return organizations
|
|
2142
|
+
|
|
2143
|
+
|
|
2144
|
+
OrgType = Literal["tinybird", "domain", "admin", "member"]
|
|
2145
|
+
|
|
2146
|
+
|
|
2147
|
+
class Organization(TypedDict):
|
|
2148
|
+
id: str
|
|
2149
|
+
name: str
|
|
2150
|
+
role: str
|
|
2151
|
+
domains: Optional[List[str]]
|
|
2152
|
+
type: OrgType
|
|
2153
|
+
|
|
2154
|
+
|
|
2155
|
+
def sort_organizations_by_user(organizations: List[Dict[str, Any]], user_email: Optional[str]) -> List[Organization]:
|
|
2156
|
+
"""Sort organizations based on type: tinybird > domain > admin > member"""
|
|
2157
|
+
sorted_organizations: List[Organization] = []
|
|
2158
|
+
user_domain = user_email.split("@")[1] if user_email else None
|
|
2159
|
+
is_tinybird_user = user_domain == "tinybird.co"
|
|
2160
|
+
|
|
2161
|
+
for org in organizations:
|
|
2162
|
+
domain = org.get("domain") or ""
|
|
2163
|
+
domains = domain.split(",") if domain else None
|
|
2164
|
+
role: OrgType = "admin" if org.get("is_admin") else "member"
|
|
2165
|
+
type = role
|
|
2166
|
+
if domains and user_domain and user_domain in domains:
|
|
2167
|
+
type = "domain"
|
|
2168
|
+
if org.get("name") == "Tinybird" and is_tinybird_user:
|
|
2169
|
+
type = "tinybird"
|
|
2170
|
+
|
|
2171
|
+
sorted_organizations.append(
|
|
2172
|
+
{
|
|
2173
|
+
"id": org.get("id") or "",
|
|
2174
|
+
"name": org.get("name") or "",
|
|
2175
|
+
"role": role,
|
|
2176
|
+
"domains": [domain.strip() for domain in domains] if domains else None,
|
|
2177
|
+
"type": type,
|
|
2178
|
+
}
|
|
2179
|
+
)
|
|
2180
|
+
|
|
2181
|
+
type_priority: Dict[OrgType, int] = {"tinybird": 0, "domain": 1, "admin": 2, "member": 3}
|
|
2182
|
+
|
|
2183
|
+
sorted_organizations.sort(key=lambda x: type_priority[x["type"]])
|
|
2184
|
+
|
|
2185
|
+
return sorted_organizations
|
|
2186
|
+
|
|
2187
|
+
|
|
2188
|
+
async def ask_for_organization_interactively(organizations: List[Organization]) -> Optional[Organization]:
|
|
2189
|
+
rows = [(index + 1, org["name"], org["role"], org["id"]) for index, org in enumerate(organizations)]
|
|
2190
|
+
|
|
2191
|
+
echo_safe_humanfriendly_tables_format_smart_table(rows, column_names=["Idx", "Name", "Role", "Id"])
|
|
2192
|
+
click.echo("")
|
|
2193
|
+
click.echo(" [0] to cancel")
|
|
2194
|
+
|
|
2195
|
+
org_index = -1
|
|
2196
|
+
while org_index == -1:
|
|
2197
|
+
org_index = click.prompt("\nSelect an organization to include the workspace in", default=1)
|
|
2198
|
+
if org_index < 0 or org_index > len(organizations):
|
|
2199
|
+
click.echo(FeedbackManager.error_organization_index(organization_index=org_index))
|
|
2200
|
+
org_index = -1
|
|
2201
|
+
|
|
2202
|
+
if org_index == 0:
|
|
2203
|
+
click.echo(FeedbackManager.info_cancelled_by_user())
|
|
2204
|
+
return None
|
|
2205
|
+
|
|
2206
|
+
return organizations[org_index - 1]
|
|
@@ -259,6 +259,9 @@ class CLIConfig:
|
|
|
259
259
|
def get_user_client(self, host: Optional[str] = None) -> tbc.TinyB:
|
|
260
260
|
return self.get_client(self.get_user_token(), host)
|
|
261
261
|
|
|
262
|
+
def get_user_email(self) -> Optional[str]:
|
|
263
|
+
return self["user_email"]
|
|
264
|
+
|
|
262
265
|
def set_workspace_token(self, workspace_id: str, token: str) -> None:
|
|
263
266
|
pass
|
|
264
267
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: tinybird
|
|
3
|
-
Version: 0.0.1.
|
|
3
|
+
Version: 0.0.1.dev77
|
|
4
4
|
Summary: Tinybird Command Line Tool
|
|
5
5
|
Home-page: https://www.tinybird.co/docs/cli/introduction.html
|
|
6
6
|
Author: Tinybird
|
|
7
7
|
Author-email: support@tinybird.co
|
|
8
|
-
Requires-Python: >=3.9, <3.
|
|
8
|
+
Requires-Python: >=3.9, <3.14
|
|
9
9
|
Description-Content-Type: text/x-rst
|
|
10
10
|
Requires-Dist: aiofiles==24.1.0
|
|
11
11
|
Requires-Dist: anthropic==0.42.0
|
|
12
12
|
Requires-Dist: click<8.2,>=8.1.6
|
|
13
|
-
Requires-Dist: clickhouse-toolset==0.
|
|
13
|
+
Requires-Dist: clickhouse-toolset==0.34.dev0
|
|
14
14
|
Requires-Dist: colorama==0.4.6
|
|
15
15
|
Requires-Dist: cryptography~=41.0.0
|
|
16
16
|
Requires-Dist: croniter==1.3.8
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
tinybird/__cli__.py,sha256=esPl5QDTzuQgHe5FuxWLm-fURFigGGwjnYLh9GuWUw4,232
|
|
2
|
-
tinybird/client.py,sha256=
|
|
2
|
+
tinybird/client.py,sha256=ZRskFcS5Or-ELl_uaGfoTfioY_S2pwc_GyMQ6qIKqgM,52798
|
|
3
3
|
tinybird/config.py,sha256=cd_RH7ZjqGjpWwu0efPkhS8VxD9K6Jix4QY2W3w1Pvs,5811
|
|
4
4
|
tinybird/connectors.py,sha256=7Gjms7b5MAaBFGi3xytsJurCylprONpFcYrzp4Fw2Rc,15241
|
|
5
5
|
tinybird/context.py,sha256=VaMhyHruH-uyMypPDfxtuo4scS18b7rxCCdeUVm6ysg,1301
|
|
6
6
|
tinybird/datatypes.py,sha256=XNypumfqNjsvLJ5iNXnbVHRvAJe0aQwI3lS6Cxox-e0,10979
|
|
7
|
-
tinybird/feedback_manager.py,sha256=
|
|
7
|
+
tinybird/feedback_manager.py,sha256=YSjtFDJvc8y66j2J0iIkb3SVzDdYAJbzFL-JPQ26pak,68761
|
|
8
8
|
tinybird/git_settings.py,sha256=Sw_8rGmribEFJ4Z_6idrVytxpFYk7ez8ei0qHULzs3E,3934
|
|
9
9
|
tinybird/prompts.py,sha256=rDIrkK5S1NJ0bIFjULsCYnGApv9Vc0jmR4tdRuJhM8c,32953
|
|
10
10
|
tinybird/sql.py,sha256=LBi74GxhNAYTb6m2-KNGpAkguSKh7rcvBbERbE7nalA,46195
|
|
@@ -15,16 +15,16 @@ tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
|
|
|
15
15
|
tinybird/tornado_template.py,sha256=KmW_VD7y-NVqrc8YZKwIaxoJB0XpCcB2izdmxmtmApM,41944
|
|
16
16
|
tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
|
|
17
17
|
tinybird/ch_utils/engine.py,sha256=AUAww-KjGOZg9h0IBlKA3FeacJYB4rOtqcTGJhFM-g8,40392
|
|
18
|
-
tinybird/tb/__cli__.py,sha256=
|
|
18
|
+
tinybird/tb/__cli__.py,sha256=0pHhkz_N8FF6vSRkRtH_FfAhMwwjmhmoKCujrRTZGTo,251
|
|
19
19
|
tinybird/tb/cli.py,sha256=KpJ_-V6xVEzcdPRPnHhEdh2EgRPCyhZnfJVqeqMsftI,964
|
|
20
20
|
tinybird/tb/modules/auth.py,sha256=vBA-KsrjAp77kFunGSM-4o7AFdfO7ac4dnrHKrx0alI,9020
|
|
21
|
-
tinybird/tb/modules/build.py,sha256=
|
|
22
|
-
tinybird/tb/modules/cicd.py,sha256=
|
|
23
|
-
tinybird/tb/modules/cli.py,sha256=
|
|
21
|
+
tinybird/tb/modules/build.py,sha256=Vi3QytuQ50EILkzBjs5mkljRcnH_6k0CQUxxITnaGww,10372
|
|
22
|
+
tinybird/tb/modules/cicd.py,sha256=T0lb9u_bDdTUVe8TwNNb1qQ5KnSPHMVjqPfKF4BBNBw,5347
|
|
23
|
+
tinybird/tb/modules/cli.py,sha256=7nnKc7IuqmsjW5BeVkXZQgmRgR3bVUH2G3bnnbylIfQ,16316
|
|
24
24
|
tinybird/tb/modules/common.py,sha256=f5yKjb1dgUzR-SrC4UHnpHXYIu6INcTHwNO96jW8A9w,73201
|
|
25
25
|
tinybird/tb/modules/config.py,sha256=mxUMLWnELkxgpWJAbAS6o0PXsL2fpG0ogdaZgr3xjvU,11038
|
|
26
26
|
tinybird/tb/modules/copy.py,sha256=MAVqKip8_QhOYq99U_XuqSO6hCLJEh5sFtbhcXtI3SI,5802
|
|
27
|
-
tinybird/tb/modules/create.py,sha256
|
|
27
|
+
tinybird/tb/modules/create.py,sha256=-WR1zwfDFqncW1SInZE81iD1-ZXUm0z4VOEny4dvWVY,12868
|
|
28
28
|
tinybird/tb/modules/datasource.py,sha256=dNCK9iCR2xPLfwqqwg2ixyE6NuoVEiJU2mBZBmOYrVY,16906
|
|
29
29
|
tinybird/tb/modules/deployment.py,sha256=umfWZA95WPRPUsJh8wSBj7Av_PevphWF6skJ1-lvnW8,16556
|
|
30
30
|
tinybird/tb/modules/endpoint.py,sha256=EhVoGAXsFz-83Fiwj1gI-I73iRRvL49d0W81un7hvPE,12080
|
|
@@ -35,7 +35,7 @@ tinybird/tb/modules/job.py,sha256=956Pj8BEEsiD2GZsV9RKKVM3I_CveOLgS82lykO5ukk,29
|
|
|
35
35
|
tinybird/tb/modules/llm.py,sha256=AC0VSphTOM2t-v1_3NLvNN_FIbgMo4dTyMqIv5nniPo,835
|
|
36
36
|
tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
|
|
37
37
|
tinybird/tb/modules/local.py,sha256=9SZa-59eYROuwFNjJAHD0dRKLK5Reozh9WdchvfSsmQ,5680
|
|
38
|
-
tinybird/tb/modules/local_common.py,sha256=
|
|
38
|
+
tinybird/tb/modules/local_common.py,sha256=_3k9lhSKTAwALmDNwlCXsVjPiwX9OoCiRIaaKruz74I,3059
|
|
39
39
|
tinybird/tb/modules/login.py,sha256=EGxwVRmMX1Y7ZeCRyA8fqaCWpYYk7NvnZ3x_1g0NlYA,6063
|
|
40
40
|
tinybird/tb/modules/materialization.py,sha256=r8Q9HXcYEmfrEzP4WpiasCKDJdSkTPaAKJtZMoJKhi8,5749
|
|
41
41
|
tinybird/tb/modules/mock.py,sha256=ASJTm4p11vkevGXCvU0h57aw7Inx03CTdxd5o2uzd8k,3870
|
|
@@ -71,13 +71,13 @@ tinybird/tb/modules/datafile/pull.py,sha256=vcjMUbjnZ9XQMGmL33J3ElpbXBTat8Yzp-ha
|
|
|
71
71
|
tinybird/tb/modules/tinyunit/tinyunit.py,sha256=GlDgEXc6TDO3ODxgfATAL2fvbKy-b_CzqoeDrApRm0g,11715
|
|
72
72
|
tinybird/tb/modules/tinyunit/tinyunit_lib.py,sha256=hGh1ZaXC1af7rKnX7222urkj0QJMhMWclqMy59dOqwE,1922
|
|
73
73
|
tinybird/tb_cli_modules/cicd.py,sha256=0lMkb6CVOFZl5HOwgY8mK4T4mgI7O8335UngLXtCc-c,13851
|
|
74
|
-
tinybird/tb_cli_modules/common.py,sha256=
|
|
75
|
-
tinybird/tb_cli_modules/config.py,sha256=
|
|
74
|
+
tinybird/tb_cli_modules/common.py,sha256=G08f1_x5YSB6n-ncRj4tB2jhtjAjlWN-QD4xMWbTNQU,83033
|
|
75
|
+
tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4ewgA,11546
|
|
76
76
|
tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
|
|
77
77
|
tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
78
78
|
tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
|
|
79
|
-
tinybird-0.0.1.
|
|
80
|
-
tinybird-0.0.1.
|
|
81
|
-
tinybird-0.0.1.
|
|
82
|
-
tinybird-0.0.1.
|
|
83
|
-
tinybird-0.0.1.
|
|
79
|
+
tinybird-0.0.1.dev77.dist-info/METADATA,sha256=PWBFazzBSj1fzAIVhfbY5VnVyVC6tEZ-8n5kqUxVays,2585
|
|
80
|
+
tinybird-0.0.1.dev77.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
81
|
+
tinybird-0.0.1.dev77.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
|
|
82
|
+
tinybird-0.0.1.dev77.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
|
|
83
|
+
tinybird-0.0.1.dev77.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|