scalekit-sdk-python 2.3.3__tar.gz → 2.4.1__tar.gz
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.
- {scalekit_sdk_python-2.3.3/scalekit_sdk_python.egg-info → scalekit_sdk_python-2.4.1}/PKG-INFO +4 -3
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/connect.py +128 -5
- scalekit_sdk_python-2.4.1/scalekit/connect/frameworks/langchain.py +125 -0
- scalekit_sdk_python-2.4.1/scalekit/connect/models/requests/create_connected_account_request.py +60 -0
- scalekit_sdk_python-2.4.1/scalekit/connect/models/responses/create_connected_account_response.py +48 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/models/responses/get_connected_account_auth_response.py +10 -10
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/types.py +4 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/core.py +2 -2
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/domain.py +49 -2
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/passwordless.py +2 -2
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/tools.py +32 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/auditlogs/auditlogs_pb2.py +6 -6
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/auditlogs/auditlogs_pb2.pyi +4 -2
- scalekit_sdk_python-2.4.1/scalekit/v1/auth/auth_pb2.py +154 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/auth/auth_pb2.pyi +6 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/auth/auth_pb2_grpc.py +3 -3
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/auth/passwordless_pb2.py +5 -5
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/connected_accounts/connected_accounts_pb2.py +5 -5
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/connected_accounts/connected_accounts_pb2.pyi +2 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/connections/connections_pb2.py +68 -62
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/connections/connections_pb2.pyi +8 -2
- scalekit_sdk_python-2.4.1/scalekit/v1/domains/domains_pb2.py +180 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/domains/domains_pb2.pyi +8 -4
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/events/events_pb2.py +14 -14
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/events/events_pb2.pyi +6 -4
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/organizations/organizations_pb2.py +5 -5
- scalekit_sdk_python-2.4.1/scalekit/v1/roles/roles_pb2.py +403 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/roles/roles_pb2.pyi +43 -3
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/roles/roles_pb2_grpc.py +66 -0
- scalekit_sdk_python-2.4.1/scalekit/v1/sessions/sessions_pb2.py +58 -0
- scalekit_sdk_python-2.4.1/scalekit/v1/sessions/sessions_pb2.pyi +117 -0
- scalekit_sdk_python-2.4.1/scalekit/v1/sessions/sessions_pb2_grpc.py +132 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/tools/tools_pb2.py +47 -23
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/tools/tools_pb2.pyi +44 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/tools/tools_pb2_grpc.py +33 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/users/users_pb2.py +108 -105
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/users/users_pb2.pyi +9 -6
- scalekit_sdk_python-2.4.1/scalekit/v1/webhooks/__init__.py +0 -0
- scalekit_sdk_python-2.4.1/scalekit/v1/workspaces/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1/scalekit_sdk_python.egg-info}/PKG-INFO +4 -3
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit_sdk_python.egg-info/SOURCES.txt +8 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit_sdk_python.egg-info/requires.txt +3 -2
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/setup.py +6 -5
- scalekit_sdk_python-2.3.3/scalekit/v1/auth/auth_pb2.py +0 -152
- scalekit_sdk_python-2.3.3/scalekit/v1/domains/domains_pb2.py +0 -110
- scalekit_sdk_python-2.3.3/scalekit/v1/roles/roles_pb2.py +0 -371
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/LICENSE +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/README.md +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/buf/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/buf/validate/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/buf/validate/expression_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/buf/validate/expression_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/buf/validate/expression_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/buf/validate/priv/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/buf/validate/priv/private_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/buf/validate/priv/private_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/buf/validate/priv/private_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/buf/validate/validate_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/buf/validate/validate_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/buf/validate/validate_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/client.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/common/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/common/exceptions.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/common/scalekit.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/common/user.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/connect/models → scalekit_sdk_python-2.4.1/scalekit/connect/frameworks}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/connect/models/requests → scalekit_sdk_python-2.4.1/scalekit/connect/models}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/connect/models/responses → scalekit_sdk_python-2.4.1/scalekit/connect/models/requests}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/models/requests/mcp_request.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/models/requests/tool_request.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/constants → scalekit_sdk_python-2.4.1/scalekit/connect/models/responses}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/models/responses/create_mcp_response.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/models/responses/delete_connected_account_response.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/models/responses/execute_tool_response.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/models/responses/get_mcp_response.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/models/responses/list_connected_accounts_response.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/models/responses/magic_link_response.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/models/tool_input_output.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/models/tool_mapping.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connect/modifier.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connected_accounts.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/connection.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/utils → scalekit_sdk_python-2.4.1/scalekit/constants}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/constants/user.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/directory.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/m2m_client.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/mcp.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/organization.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/role.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/users.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1 → scalekit_sdk_python-2.4.1/scalekit/utils}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/utils/directory.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/auditlogs → scalekit_sdk_python-2.4.1/scalekit/v1}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/auth → scalekit_sdk_python-2.4.1/scalekit/v1/auditlogs}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/auditlogs/auditlogs_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/clients → scalekit_sdk_python-2.4.1/scalekit/v1/auth}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/auth/passwordless_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/auth/passwordless_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/auth/totp_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/auth/totp_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/auth/totp_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/commons → scalekit_sdk_python-2.4.1/scalekit/v1/clients}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/clients/clients_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/clients/clients_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/clients/clients_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/connected_accounts → scalekit_sdk_python-2.4.1/scalekit/v1/commons}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/commons/commons_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/commons/commons_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/commons/commons_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/connections → scalekit_sdk_python-2.4.1/scalekit/v1/connected_accounts}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/connected_accounts/connected_accounts_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/directories → scalekit_sdk_python-2.4.1/scalekit/v1/connections}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/connections/connections_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/domains → scalekit_sdk_python-2.4.1/scalekit/v1/directories}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/directories/directories_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/directories/directories_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/directories/directories_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/emails → scalekit_sdk_python-2.4.1/scalekit/v1/domains}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/domains/domains_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/environments → scalekit_sdk_python-2.4.1/scalekit/v1/emails}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/emails/emails_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/emails/emails_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/emails/emails_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/errdetails → scalekit_sdk_python-2.4.1/scalekit/v1/environments}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/environments/environments_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/environments/environments_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/environments/environments_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/events → scalekit_sdk_python-2.4.1/scalekit/v1/errdetails}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/errdetails/errdetails_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/errdetails/errdetails_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/errdetails/errdetails_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/mcp → scalekit_sdk_python-2.4.1/scalekit/v1/events}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/events/events_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/members → scalekit_sdk_python-2.4.1/scalekit/v1/mcp}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/mcp/mcp_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/mcp/mcp_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/mcp/mcp_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/migrations → scalekit_sdk_python-2.4.1/scalekit/v1/members}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/members/members_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/members/members_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/members/members_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/options → scalekit_sdk_python-2.4.1/scalekit/v1/migrations}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/migrations/migrations_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/migrations/migrations_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/migrations/migrations_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/organizations → scalekit_sdk_python-2.4.1/scalekit/v1/options}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/options/options_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/options/options_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/options/options_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/providers → scalekit_sdk_python-2.4.1/scalekit/v1/organizations}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/organizations/organizations_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/organizations/organizations_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/roles → scalekit_sdk_python-2.4.1/scalekit/v1/providers}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/providers/providers_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/providers/providers_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/providers/providers_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/tools → scalekit_sdk_python-2.4.1/scalekit/v1/roles}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/user_attributes → scalekit_sdk_python-2.4.1/scalekit/v1/sessions}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/users → scalekit_sdk_python-2.4.1/scalekit/v1/tools}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/webhooks → scalekit_sdk_python-2.4.1/scalekit/v1/user_attributes}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/user_attributes/user_attributes_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/user_attributes/user_attributes_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/user_attributes/user_attributes_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3/scalekit/v1/workspaces → scalekit_sdk_python-2.4.1/scalekit/v1/users}/__init__.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/users/users_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/webhooks/webhooks_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/webhooks/webhooks_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/webhooks/webhooks_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/workspaces/workspaces_pb2.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/workspaces/workspaces_pb2.pyi +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit/v1/workspaces/workspaces_pb2_grpc.py +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit_sdk_python.egg-info/dependency_links.txt +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/scalekit_sdk_python.egg-info/top_level.txt +0 -0
- {scalekit_sdk_python-2.3.3 → scalekit_sdk_python-2.4.1}/setup.cfg +0 -0
{scalekit_sdk_python-2.3.3/scalekit_sdk_python.egg-info → scalekit_sdk_python-2.4.1}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scalekit-sdk-python
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.1
|
|
4
4
|
Summary: Scalekit official Python SDK
|
|
5
5
|
Home-page: https://github.com/scalekit-inc/scalekit-sdk-python
|
|
6
6
|
Author: Team Scalekit
|
|
@@ -17,15 +17,16 @@ Requires-Dist: google>=3.0
|
|
|
17
17
|
Requires-Dist: requests>=2.32.3
|
|
18
18
|
Requires-Dist: PyJWT<2.10,>=2.8
|
|
19
19
|
Requires-Dist: cffi>=1.15.1
|
|
20
|
-
Requires-Dist: cryptography==
|
|
20
|
+
Requires-Dist: cryptography==45.0.6
|
|
21
21
|
Requires-Dist: setuptools>=78.1.1
|
|
22
22
|
Requires-Dist: grpcio-status<1.67,>=1.64
|
|
23
23
|
Requires-Dist: protoc-gen-openapiv2>=0.0.1
|
|
24
24
|
Requires-Dist: googleapis-common-protos<1.66.0,>=1.56.1
|
|
25
25
|
Requires-Dist: deprecation>=2.1.0
|
|
26
|
-
Requires-Dist: python-dotenv
|
|
26
|
+
Requires-Dist: python-dotenv>=1.1.0
|
|
27
27
|
Requires-Dist: Faker~=25.8.0
|
|
28
28
|
Requires-Dist: pydantic~=2.10.6
|
|
29
|
+
Requires-Dist: langchain-core<0.4,>=0.3.36
|
|
29
30
|
Dynamic: author
|
|
30
31
|
Dynamic: author-email
|
|
31
32
|
Dynamic: classifier
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
from typing import Optional,
|
|
1
|
+
from typing import Optional, Any, List, Dict
|
|
2
2
|
from scalekit.v1.mcp.mcp_pb2 import Mcp
|
|
3
3
|
from scalekit.v1.mcp.mcp_pb2 import ToolMapping as ProtoToolMapping
|
|
4
4
|
|
|
5
5
|
from scalekit.connect.models.tool_mapping import ToolMapping
|
|
6
|
-
from scalekit.connect.types import ToolRequest,ExecuteToolResponse,MagicLinkResponse,ListConnectedAccountsResponse,DeleteConnectedAccountResponse,GetConnectedAccountAuthResponse,ToolInput,
|
|
6
|
+
from scalekit.connect.types import ToolRequest,ExecuteToolResponse,MagicLinkResponse,ListConnectedAccountsResponse,DeleteConnectedAccountResponse,GetConnectedAccountAuthResponse,ToolInput, \
|
|
7
|
+
McpRequest,CreateMcpResponse,GetMcpResponse
|
|
8
|
+
from scalekit.connect.models.responses.create_connected_account_response import CreateConnectedAccountResponse
|
|
9
|
+
from scalekit.connect.models.requests.create_connected_account_request import CreateConnectedAccountRequest
|
|
7
10
|
from scalekit.connect.modifier import (
|
|
8
11
|
Modifier, ModifierType, ToolNames,
|
|
9
12
|
apply_pre_modifiers, apply_post_modifiers
|
|
10
13
|
)
|
|
14
|
+
from scalekit.connect.frameworks.langchain import LangChain
|
|
15
|
+
from scalekit.common.exceptions import ScalekitNotFoundException
|
|
11
16
|
|
|
12
17
|
|
|
13
18
|
|
|
@@ -34,6 +39,9 @@ class ConnectClient:
|
|
|
34
39
|
self.connected_accounts = connected_accounts_client
|
|
35
40
|
self.mcp = mcp_client
|
|
36
41
|
self._modifiers: List[Modifier] = []
|
|
42
|
+
|
|
43
|
+
# Initialize LangChain with tools client and execute callback
|
|
44
|
+
self.langchain = LangChain(tools_client, execute_callback=self.execute_tool)
|
|
37
45
|
|
|
38
46
|
def execute_tool(
|
|
39
47
|
self,
|
|
@@ -59,8 +67,6 @@ class ConnectClient:
|
|
|
59
67
|
ExecuteToolResponse containing execution results
|
|
60
68
|
"""
|
|
61
69
|
# Validate required parameters
|
|
62
|
-
if not tool_input:
|
|
63
|
-
raise ValueError("tool_input is required")
|
|
64
70
|
if not tool_name:
|
|
65
71
|
raise ValueError("tool_name is required")
|
|
66
72
|
|
|
@@ -358,4 +364,121 @@ class ConnectClient:
|
|
|
358
364
|
proto_response = result_tuple[0]
|
|
359
365
|
|
|
360
366
|
# Convert proto to our CreateMcpResponse class
|
|
361
|
-
return CreateMcpResponse.from_proto(proto_response)
|
|
367
|
+
return CreateMcpResponse.from_proto(proto_response)
|
|
368
|
+
|
|
369
|
+
def create_connected_account(
|
|
370
|
+
self,
|
|
371
|
+
connection_name: str,
|
|
372
|
+
identifier: str,
|
|
373
|
+
authorization_details: Dict[str, Any],
|
|
374
|
+
organization_id: Optional[str] = None,
|
|
375
|
+
user_id: Optional[str] = None,
|
|
376
|
+
**kwargs
|
|
377
|
+
) -> CreateConnectedAccountResponse:
|
|
378
|
+
"""
|
|
379
|
+
Create a new connected account
|
|
380
|
+
|
|
381
|
+
:param connection_name: Connector identifier (required)
|
|
382
|
+
:type: str
|
|
383
|
+
:param identifier: Connected account identifier (required)
|
|
384
|
+
:type: str
|
|
385
|
+
:param authorization_details: Authorization details (OAuth token or static auth) (required)
|
|
386
|
+
:type: Dict[str, Any]
|
|
387
|
+
:param organization_id: Organization ID (optional)
|
|
388
|
+
:type: str
|
|
389
|
+
:param user_id: User ID (optional)
|
|
390
|
+
:type: str
|
|
391
|
+
|
|
392
|
+
:returns:
|
|
393
|
+
CreateConnectedAccountResponse containing created connected account details
|
|
394
|
+
"""
|
|
395
|
+
# Validate required parameters
|
|
396
|
+
if not connection_name:
|
|
397
|
+
raise ValueError("connection_name is required")
|
|
398
|
+
if not identifier:
|
|
399
|
+
raise ValueError("identifier is required")
|
|
400
|
+
if not authorization_details:
|
|
401
|
+
raise ValueError("authorization_details is required")
|
|
402
|
+
|
|
403
|
+
# Create request model
|
|
404
|
+
request = CreateConnectedAccountRequest(
|
|
405
|
+
connection_name=connection_name,
|
|
406
|
+
identifier=identifier,
|
|
407
|
+
authorization_details=authorization_details,
|
|
408
|
+
organization_id=organization_id,
|
|
409
|
+
user_id=user_id
|
|
410
|
+
)
|
|
411
|
+
|
|
412
|
+
# Convert to protobuf
|
|
413
|
+
connected_account_proto = request.to_proto()
|
|
414
|
+
|
|
415
|
+
# Call the existing connected_accounts method which returns (response, metadata) tuple
|
|
416
|
+
result_tuple = self.connected_accounts.create_connected_account(
|
|
417
|
+
connector=connection_name,
|
|
418
|
+
identifier=identifier,
|
|
419
|
+
connected_account=connected_account_proto,
|
|
420
|
+
organization_id=organization_id,
|
|
421
|
+
user_id=user_id
|
|
422
|
+
)
|
|
423
|
+
|
|
424
|
+
# Extract the response[0] (the actual CreateConnectedAccountResponse proto object)
|
|
425
|
+
proto_response = result_tuple[0]
|
|
426
|
+
|
|
427
|
+
# Convert proto to our CreateConnectedAccountResponse class
|
|
428
|
+
return CreateConnectedAccountResponse.from_proto(proto_response)
|
|
429
|
+
|
|
430
|
+
def get_or_create_connected_account(
|
|
431
|
+
self,
|
|
432
|
+
connection_name: str,
|
|
433
|
+
identifier: str,
|
|
434
|
+
authorization_details: Optional[Dict[str, Any]] = None,
|
|
435
|
+
organization_id: Optional[str] = None,
|
|
436
|
+
user_id: Optional[str] = None,
|
|
437
|
+
**kwargs
|
|
438
|
+
) -> CreateConnectedAccountResponse:
|
|
439
|
+
"""
|
|
440
|
+
Get an existing connected account or create a new one if it doesn't exist
|
|
441
|
+
|
|
442
|
+
:param connection_name: Connector identifier (required)
|
|
443
|
+
:type: str
|
|
444
|
+
:param identifier: Connected account identifier (required)
|
|
445
|
+
:type: str
|
|
446
|
+
:param authorization_details: Authorization details (OAuth token or static auth) (optional, empty auth will be used if not provided)
|
|
447
|
+
:type: Optional[Dict[str, Any]]
|
|
448
|
+
:param organization_id: Organization ID (optional)
|
|
449
|
+
:type: str
|
|
450
|
+
:param user_id: User ID (optional)
|
|
451
|
+
:type: str
|
|
452
|
+
|
|
453
|
+
:returns:
|
|
454
|
+
CreateConnectedAccountResponse containing connected account details (either existing or newly created)
|
|
455
|
+
"""
|
|
456
|
+
if not connection_name:
|
|
457
|
+
raise ValueError("connection_name is required")
|
|
458
|
+
if not identifier:
|
|
459
|
+
raise ValueError("identifier is required")
|
|
460
|
+
|
|
461
|
+
try:
|
|
462
|
+
# First, try to get the existing connected account
|
|
463
|
+
existing_response = self.get_connected_account(
|
|
464
|
+
connection_name=connection_name,
|
|
465
|
+
identifier=identifier,
|
|
466
|
+
organization_id=organization_id,
|
|
467
|
+
user_id=user_id
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
# If we found it, convert the GetConnectedAccountAuthResponse to CreateConnectedAccountResponse format
|
|
471
|
+
return CreateConnectedAccountResponse(connected_account=existing_response.connected_account)
|
|
472
|
+
|
|
473
|
+
except ScalekitNotFoundException:
|
|
474
|
+
# Connected account doesn't exist, create a new one
|
|
475
|
+
# Use empty authorization details if none provided
|
|
476
|
+
auth_details = authorization_details if authorization_details is not None else {}
|
|
477
|
+
|
|
478
|
+
return self.create_connected_account(
|
|
479
|
+
connection_name=connection_name,
|
|
480
|
+
identifier=identifier,
|
|
481
|
+
authorization_details=auth_details,
|
|
482
|
+
organization_id=organization_id,
|
|
483
|
+
user_id=user_id
|
|
484
|
+
)
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
from typing import Optional, Any, Dict, List, Callable
|
|
2
|
+
from langchain_core.tools import StructuredTool
|
|
3
|
+
from scalekit.tools import ToolsClient
|
|
4
|
+
from scalekit.v1.tools.tools_pb2 import Filter, ScopedToolFilter
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class LangChain:
|
|
8
|
+
def __init__(self, tools_client: ToolsClient, execute_callback: Callable):
|
|
9
|
+
if not execute_callback:
|
|
10
|
+
raise ValueError("execute_callback is required. LangChain must be initialized with ConnectClient's execute_tool method.")
|
|
11
|
+
|
|
12
|
+
self.tools = tools_client
|
|
13
|
+
self.execute_callback = execute_callback
|
|
14
|
+
|
|
15
|
+
def get_tools(
|
|
16
|
+
self,
|
|
17
|
+
identifier: str,
|
|
18
|
+
providers: Optional[List[str]] = None,
|
|
19
|
+
tool_names: Optional[List[str]] = None,
|
|
20
|
+
connection_names: Optional[List[str]] = None,
|
|
21
|
+
page_size: Optional[int] = None,
|
|
22
|
+
page_token: Optional[str] = None
|
|
23
|
+
) -> List[StructuredTool]:
|
|
24
|
+
"""
|
|
25
|
+
Get scoped tools from Scalekit and convert them to LangChain StructuredTools
|
|
26
|
+
|
|
27
|
+
:param identifier: Identifier to scope the tools list
|
|
28
|
+
:param providers: List of provider names to filter by
|
|
29
|
+
:param tool_names: List of tool names to filter by
|
|
30
|
+
:param connection_names: List of connection names to filter by
|
|
31
|
+
:param page_size: Maximum number of tools to return per page
|
|
32
|
+
:param page_token: Token from a previous response for pagination
|
|
33
|
+
:returns: List of LangChain StructuredTools
|
|
34
|
+
"""
|
|
35
|
+
if identifier is None or identifier == "":
|
|
36
|
+
raise ValueError("Identifier must be provided to get tools")
|
|
37
|
+
|
|
38
|
+
# Create ScopedToolFilter if any filter parameters are provided
|
|
39
|
+
scoped_filter = None
|
|
40
|
+
if providers or tool_names or connection_names:
|
|
41
|
+
scoped_filter = ScopedToolFilter(
|
|
42
|
+
providers=providers or [],
|
|
43
|
+
tool_names=tool_names or [],
|
|
44
|
+
connection_names=connection_names or []
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
# Call list_scoped_tools which returns (response, metadata) tuple
|
|
48
|
+
result_tuple = self.tools.list_scoped_tools(identifier, scoped_filter, page_size, page_token)
|
|
49
|
+
|
|
50
|
+
# Extract the response[0] (the actual ListScopedToolsResponse proto object)
|
|
51
|
+
response = result_tuple[0]
|
|
52
|
+
|
|
53
|
+
structured_tools = []
|
|
54
|
+
for scoped_tool in response.tools:
|
|
55
|
+
structured_tool = self._convert_tool_to_structured_tool(
|
|
56
|
+
scoped_tool.tool,
|
|
57
|
+
scoped_tool.connected_account_id
|
|
58
|
+
)
|
|
59
|
+
structured_tools.append(structured_tool)
|
|
60
|
+
|
|
61
|
+
return structured_tools
|
|
62
|
+
|
|
63
|
+
def _convert_tool_to_structured_tool(self, tool, connected_account_id: str) -> StructuredTool:
|
|
64
|
+
"""Convert a Scalekit Tool to LangChain StructuredTool"""
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
definition_dict = self._struct_to_dict(tool.definition) if hasattr(tool, 'definition') and tool.definition else {}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
tool_name = definition_dict.get('name', getattr(tool, 'provider', 'unknown') + '_tool')
|
|
71
|
+
tool_description = definition_dict.get('description', 'Scalekit tool')
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
args_schema = definition_dict.get("input_schema", {})
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def _call(**arguments: Dict[str, Any]) -> str:
|
|
78
|
+
try:
|
|
79
|
+
# Import here to avoid circular imports
|
|
80
|
+
from scalekit.connect.types import ToolInput
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
# Call connect.execute_tool via callback (includes modifiers and enhanced handling)
|
|
84
|
+
response = self.execute_callback(
|
|
85
|
+
tool_input=arguments,
|
|
86
|
+
tool_name=tool_name,
|
|
87
|
+
connected_account_id=connected_account_id
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
result_data = response.data if hasattr(response, 'data') else {}
|
|
92
|
+
|
|
93
|
+
execution_id = response.execution_id if hasattr(response, 'execution_id') else None
|
|
94
|
+
|
|
95
|
+
# Format the response
|
|
96
|
+
result_dict = dict(result_data) if result_data else {}
|
|
97
|
+
if execution_id:
|
|
98
|
+
result_dict['execution_id'] = execution_id
|
|
99
|
+
|
|
100
|
+
return str(result_dict) if result_dict else f"Tool {tool_name} executed successfully"
|
|
101
|
+
|
|
102
|
+
except Exception as e:
|
|
103
|
+
return f"Error executing tool {tool_name}: {str(e)}"
|
|
104
|
+
|
|
105
|
+
# Sync wrapper
|
|
106
|
+
def call_tool_sync(**arguments: Dict[str, Any]) -> str:
|
|
107
|
+
return _call(**arguments)
|
|
108
|
+
|
|
109
|
+
# Async wrapper
|
|
110
|
+
async def call_tool_async(**arguments: Dict[str, Any]) -> str:
|
|
111
|
+
return _call(**arguments)
|
|
112
|
+
|
|
113
|
+
# TODO add metadata to the tool if available
|
|
114
|
+
return StructuredTool(
|
|
115
|
+
name=tool_name,
|
|
116
|
+
description=tool_description,
|
|
117
|
+
args_schema=args_schema,
|
|
118
|
+
func=call_tool_sync,
|
|
119
|
+
coroutine=call_tool_async,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
def _struct_to_dict(self, struct) -> Dict[str, Any]:
|
|
123
|
+
"""Convert protobuf Struct to Python dict"""
|
|
124
|
+
from google.protobuf.json_format import MessageToDict
|
|
125
|
+
return MessageToDict(struct)
|
scalekit_sdk_python-2.4.1/scalekit/connect/models/requests/create_connected_account_request.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
from typing import Optional, Dict, Any, List
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from scalekit.v1.connected_accounts.connected_accounts_pb2 import (
|
|
4
|
+
CreateConnectedAccount,
|
|
5
|
+
AuthorizationDetails,
|
|
6
|
+
OauthToken,
|
|
7
|
+
StaticAuth
|
|
8
|
+
)
|
|
9
|
+
from google.protobuf import struct_pb2
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CreateConnectedAccountRequest(BaseModel):
|
|
13
|
+
"""Create connected account request model"""
|
|
14
|
+
|
|
15
|
+
connection_name: str = Field(..., description="Connector identifier")
|
|
16
|
+
identifier: str = Field(..., description="Connected account identifier")
|
|
17
|
+
authorization_details: Dict[str, Any] = Field(default_factory=dict, description="Authorization details (OAuth token or static auth)")
|
|
18
|
+
organization_id: Optional[str] = Field(None, description="Organization ID")
|
|
19
|
+
user_id: Optional[str] = Field(None, description="User ID")
|
|
20
|
+
|
|
21
|
+
def to_proto(self) -> CreateConnectedAccount:
|
|
22
|
+
"""
|
|
23
|
+
Convert to protobuf CreateConnectedAccount object
|
|
24
|
+
|
|
25
|
+
:returns:
|
|
26
|
+
CreateConnectedAccount protobuf object
|
|
27
|
+
"""
|
|
28
|
+
auth_details = None
|
|
29
|
+
|
|
30
|
+
if self.authorization_details and "oauth_token" in self.authorization_details:
|
|
31
|
+
oauth_data = self.authorization_details["oauth_token"]
|
|
32
|
+
oauth_token = OauthToken(
|
|
33
|
+
access_token=oauth_data.get("access_token", ""),
|
|
34
|
+
refresh_token=oauth_data.get("refresh_token", ""),
|
|
35
|
+
scopes=oauth_data.get("scopes", [])
|
|
36
|
+
)
|
|
37
|
+
auth_details = AuthorizationDetails(oauth_token=oauth_token)
|
|
38
|
+
|
|
39
|
+
elif self.authorization_details and "static_auth" in self.authorization_details:
|
|
40
|
+
static_data = self.authorization_details["static_auth"]
|
|
41
|
+
# Convert dict to protobuf Struct
|
|
42
|
+
struct_details = struct_pb2.Struct()
|
|
43
|
+
struct_details.update(static_data)
|
|
44
|
+
static_auth = StaticAuth(details=struct_details)
|
|
45
|
+
auth_details = AuthorizationDetails(static_auth=static_auth)
|
|
46
|
+
|
|
47
|
+
elif not self.authorization_details:
|
|
48
|
+
# Create empty OAuth token for empty authorization details
|
|
49
|
+
oauth_token = OauthToken(
|
|
50
|
+
access_token="",
|
|
51
|
+
refresh_token="",
|
|
52
|
+
scopes=[]
|
|
53
|
+
)
|
|
54
|
+
auth_details = AuthorizationDetails(oauth_token=oauth_token)
|
|
55
|
+
|
|
56
|
+
return CreateConnectedAccount(authorization_details=auth_details)
|
|
57
|
+
|
|
58
|
+
class Config:
|
|
59
|
+
"""Pydantic configuration"""
|
|
60
|
+
validate_assignment = True
|
scalekit_sdk_python-2.4.1/scalekit/connect/models/responses/create_connected_account_response.py
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
from .get_connected_account_auth_response import ConnectedAccount
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class CreateConnectedAccountResponse(BaseModel):
|
|
8
|
+
"""Create connected account response with one-to-one mapping to proto CreateConnectedAccountResponse"""
|
|
9
|
+
|
|
10
|
+
connected_account: Optional[ConnectedAccount] = Field(
|
|
11
|
+
None,
|
|
12
|
+
description="Created connected account details"
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
@classmethod
|
|
16
|
+
def from_proto(cls, proto_response) -> 'CreateConnectedAccountResponse':
|
|
17
|
+
"""
|
|
18
|
+
Create CreateConnectedAccountResponse from protobuf CreateConnectedAccountResponse
|
|
19
|
+
|
|
20
|
+
:param proto_response: The protobuf CreateConnectedAccountResponse object
|
|
21
|
+
:type proto_response: CreateConnectedAccountResponse (from connected_accounts_pb2)
|
|
22
|
+
|
|
23
|
+
:returns:
|
|
24
|
+
CreateConnectedAccountResponse instance
|
|
25
|
+
"""
|
|
26
|
+
connected_account = None
|
|
27
|
+
if proto_response.connected_account:
|
|
28
|
+
connected_account = ConnectedAccount.from_proto(proto_response.connected_account)
|
|
29
|
+
|
|
30
|
+
return cls(connected_account=connected_account)
|
|
31
|
+
|
|
32
|
+
def to_dict(self) -> dict:
|
|
33
|
+
"""
|
|
34
|
+
Convert to dictionary representation
|
|
35
|
+
|
|
36
|
+
:returns:
|
|
37
|
+
Dictionary representation of the response
|
|
38
|
+
"""
|
|
39
|
+
return {
|
|
40
|
+
"connected_account": self.connected_account.model_dump() if self.connected_account else None
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
class Config:
|
|
44
|
+
"""Pydantic configuration"""
|
|
45
|
+
validate_assignment = True
|
|
46
|
+
json_encoders = {
|
|
47
|
+
datetime: lambda v: v.isoformat() if v else None
|
|
48
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from typing import Optional, Dict, Any
|
|
2
2
|
from datetime import datetime
|
|
3
3
|
from pydantic import BaseModel, Field
|
|
4
|
-
from scalekit.v1.connected_accounts.connected_accounts_pb2 import ConnectedAccount, ConnectorStatus, ConnectorType
|
|
4
|
+
from scalekit.v1.connected_accounts.connected_accounts_pb2 import ConnectedAccount as ProtoConnectedAccount, ConnectorStatus, ConnectorType
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class
|
|
7
|
+
class ConnectedAccount(BaseModel):
|
|
8
8
|
"""Connected account information"""
|
|
9
9
|
|
|
10
10
|
id: Optional[str] = Field(None, description="Unique connected account ID")
|
|
@@ -19,15 +19,15 @@ class ConnectedAccountInfo(BaseModel):
|
|
|
19
19
|
last_used_at: Optional[datetime] = Field(None, description="Last used time")
|
|
20
20
|
|
|
21
21
|
@classmethod
|
|
22
|
-
def from_proto(cls, proto_account:
|
|
22
|
+
def from_proto(cls, proto_account: ProtoConnectedAccount) -> 'ConnectedAccount':
|
|
23
23
|
"""
|
|
24
|
-
Create
|
|
24
|
+
Create ConnectedAccount from protobuf ConnectedAccount
|
|
25
25
|
|
|
26
26
|
:param proto_account: The protobuf ConnectedAccount object
|
|
27
|
-
:type proto_account:
|
|
27
|
+
:type proto_account: ProtoConnectedAccount
|
|
28
28
|
|
|
29
29
|
:returns:
|
|
30
|
-
|
|
30
|
+
ConnectedAccount instance
|
|
31
31
|
"""
|
|
32
32
|
# Convert protobuf timestamps to datetime
|
|
33
33
|
token_expires_at = None
|
|
@@ -46,14 +46,14 @@ class ConnectedAccountInfo(BaseModel):
|
|
|
46
46
|
authorization_details = None
|
|
47
47
|
if proto_account.authorization_details:
|
|
48
48
|
authorization_details = {}
|
|
49
|
-
if proto_account.
|
|
49
|
+
if proto_account.authorization_type == ConnectorType.OAUTH :
|
|
50
50
|
oauth_token = proto_account.authorization_details.oauth_token
|
|
51
51
|
authorization_details["oauth_token"] = {
|
|
52
52
|
"access_token": oauth_token.access_token,
|
|
53
53
|
"refresh_token": oauth_token.refresh_token,
|
|
54
54
|
"scopes": list(oauth_token.scopes)
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
else:
|
|
57
57
|
static_auth = proto_account.authorization_details.static_auth
|
|
58
58
|
# Convert protobuf Struct to dict
|
|
59
59
|
from google.protobuf.json_format import MessageToDict
|
|
@@ -76,7 +76,7 @@ class ConnectedAccountInfo(BaseModel):
|
|
|
76
76
|
class GetConnectedAccountAuthResponse(BaseModel):
|
|
77
77
|
"""Get connected account auth response with one-to-one mapping to proto GetConnectedAccountByIdentifierResponse"""
|
|
78
78
|
|
|
79
|
-
connected_account: Optional[
|
|
79
|
+
connected_account: Optional[ConnectedAccount] = Field(
|
|
80
80
|
None,
|
|
81
81
|
description="Connected account details"
|
|
82
82
|
)
|
|
@@ -94,7 +94,7 @@ class GetConnectedAccountAuthResponse(BaseModel):
|
|
|
94
94
|
"""
|
|
95
95
|
connected_account = None
|
|
96
96
|
if proto_response.connected_account:
|
|
97
|
-
connected_account =
|
|
97
|
+
connected_account = ConnectedAccount.from_proto(proto_response.connected_account)
|
|
98
98
|
|
|
99
99
|
return cls(connected_account=connected_account)
|
|
100
100
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
from .models.requests.tool_request import ToolRequest
|
|
2
2
|
from .models.requests.mcp_request import McpRequest
|
|
3
|
+
from .models.requests.create_connected_account_request import CreateConnectedAccountRequest
|
|
3
4
|
from .models.responses.execute_tool_response import ExecuteToolResponse
|
|
4
5
|
from .models.responses.magic_link_response import MagicLinkResponse
|
|
5
6
|
from .models.responses.list_connected_accounts_response import ListConnectedAccountsResponse
|
|
6
7
|
from .models.responses.delete_connected_account_response import DeleteConnectedAccountResponse
|
|
7
8
|
from .models.responses.get_connected_account_auth_response import GetConnectedAccountAuthResponse
|
|
9
|
+
from .models.responses.create_connected_account_response import CreateConnectedAccountResponse
|
|
8
10
|
from .models.responses.create_mcp_response import CreateMcpResponse
|
|
9
11
|
from .models.responses.get_mcp_response import GetMcpResponse
|
|
10
12
|
from .models.tool_input_output import ToolInput, ToolOutput
|
|
@@ -14,11 +16,13 @@ from .models.tool_mapping import ToolMapping
|
|
|
14
16
|
__all__ = [
|
|
15
17
|
'ToolRequest',
|
|
16
18
|
'McpRequest',
|
|
19
|
+
'CreateConnectedAccountRequest',
|
|
17
20
|
'ExecuteToolResponse',
|
|
18
21
|
'MagicLinkResponse',
|
|
19
22
|
'ListConnectedAccountsResponse',
|
|
20
23
|
'DeleteConnectedAccountResponse',
|
|
21
24
|
'GetConnectedAccountAuthResponse',
|
|
25
|
+
'CreateConnectedAccountResponse',
|
|
22
26
|
'CreateMcpResponse',
|
|
23
27
|
'GetMcpResponse',
|
|
24
28
|
'ToolInput',
|
|
@@ -26,8 +26,8 @@ class WithCall(Protocol):
|
|
|
26
26
|
class CoreClient:
|
|
27
27
|
"""Class definition for Core Client"""
|
|
28
28
|
|
|
29
|
-
sdk_version = "Scalekit-Python/2.
|
|
30
|
-
api_version = "
|
|
29
|
+
sdk_version = "Scalekit-Python/2.4.1"
|
|
30
|
+
api_version = "20250901"
|
|
31
31
|
user_agent = f"{sdk_version} Python/{platform.python_version()} ({platform.system()}; {platform.architecture()}"
|
|
32
32
|
|
|
33
33
|
def __init__(self, env_url, client_id, client_secret):
|
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
|
|
2
|
+
from typing import Optional, Union
|
|
3
|
+
|
|
2
4
|
from scalekit.core import CoreClient
|
|
3
5
|
from scalekit.v1.domains.domains_pb2 import *
|
|
4
6
|
from scalekit.v1.domains.domains_pb2_grpc import DomainServiceStub
|
|
5
7
|
|
|
6
8
|
|
|
9
|
+
# String to enum mapping for domain types
|
|
10
|
+
_DOMAIN_TYPE_MAP = {
|
|
11
|
+
"UNSPECIFIED": DomainType.DOMAIN_TYPE_UNSPECIFIED,
|
|
12
|
+
"ALLOWED_EMAIL_DOMAIN": DomainType.ALLOWED_EMAIL_DOMAIN,
|
|
13
|
+
"ORGANIZATION_DOMAIN": DomainType.ORGANIZATION_DOMAIN,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
def _convert_domain_type(domain_type: Union[str, "DomainType", None]) -> Optional["DomainType"]:
|
|
17
|
+
"""Convert string or enum to DomainType enum"""
|
|
18
|
+
if domain_type is None:
|
|
19
|
+
return None
|
|
20
|
+
if isinstance(domain_type, str):
|
|
21
|
+
domain_type_upper = domain_type.upper()
|
|
22
|
+
if domain_type_upper in _DOMAIN_TYPE_MAP:
|
|
23
|
+
return _DOMAIN_TYPE_MAP[domain_type_upper]
|
|
24
|
+
else:
|
|
25
|
+
raise ValueError(f"Invalid domain type: {domain_type}. Valid options are: {list(_DOMAIN_TYPE_MAP.keys())}")
|
|
26
|
+
return domain_type
|
|
27
|
+
|
|
28
|
+
|
|
7
29
|
class DomainClient:
|
|
8
30
|
"""Class definition for Domain Client"""
|
|
9
31
|
|
|
@@ -22,7 +44,7 @@ class DomainClient:
|
|
|
22
44
|
)
|
|
23
45
|
|
|
24
46
|
def create_domain(
|
|
25
|
-
self, organization_id: str, domain_name: str
|
|
47
|
+
self, organization_id: str, domain_name: str, domain_type: Optional[Union[str, "DomainType"]] = None
|
|
26
48
|
) -> CreateDomainResponse:
|
|
27
49
|
"""
|
|
28
50
|
Method to create domain
|
|
@@ -31,14 +53,23 @@ class DomainClient:
|
|
|
31
53
|
:type : ``` str ```
|
|
32
54
|
:param domain_name : Domain name for new creation
|
|
33
55
|
:type : ``` str ```
|
|
56
|
+
:param domain_type : Type of domain ("ALLOWED_EMAIL_DOMAIN", "ORGANIZATION_DOMAIN", or "UNSPECIFIED")
|
|
57
|
+
:type : ``` str or DomainType ```
|
|
58
|
+
|
|
34
59
|
:returns
|
|
35
60
|
Domain Response
|
|
36
61
|
"""
|
|
62
|
+
# Convert domain_type string to enum if needed
|
|
63
|
+
domain_type_enum = _convert_domain_type(domain_type)
|
|
64
|
+
|
|
37
65
|
return self.core_client.grpc_exec(
|
|
38
66
|
self.domain_service.CreateDomain.with_call,
|
|
39
67
|
CreateDomainRequest(
|
|
40
68
|
organization_id=organization_id,
|
|
41
|
-
domain=CreateDomain(
|
|
69
|
+
domain=CreateDomain(
|
|
70
|
+
domain=domain_name,
|
|
71
|
+
domain_type=domain_type_enum
|
|
72
|
+
),
|
|
42
73
|
),
|
|
43
74
|
)
|
|
44
75
|
|
|
@@ -71,3 +102,19 @@ class DomainClient:
|
|
|
71
102
|
self.domain_service.GetDomain.with_call,
|
|
72
103
|
GetDomainRequest(organization_id=organization_id, id=domain_id),
|
|
73
104
|
)
|
|
105
|
+
|
|
106
|
+
def delete_domain(self, organization_id: str, domain_id: str):
|
|
107
|
+
"""
|
|
108
|
+
Method to delete domain
|
|
109
|
+
|
|
110
|
+
:param organization_id : Organization id to delete domain for
|
|
111
|
+
:type : ``` str ```
|
|
112
|
+
:param domain_id : Domain id to delete
|
|
113
|
+
:type : ``` str ```
|
|
114
|
+
:returns
|
|
115
|
+
None
|
|
116
|
+
"""
|
|
117
|
+
return self.core_client.grpc_exec(
|
|
118
|
+
self.domain_service.DeleteDomain.with_call,
|
|
119
|
+
DeleteDomainRequest(organization_id=organization_id, id=domain_id),
|
|
120
|
+
)
|
|
@@ -13,7 +13,7 @@ _TEMPLATE_TYPE_MAP = {
|
|
|
13
13
|
"SIGNUP": TemplateType.SIGNUP,
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
def _convert_template_type(template: Union[str, TemplateType, None]) -> Optional[TemplateType]:
|
|
16
|
+
def _convert_template_type(template: Union[str, "TemplateType", None]) -> Optional["TemplateType"]:
|
|
17
17
|
"""Convert string or enum to TemplateType enum"""
|
|
18
18
|
if template is None:
|
|
19
19
|
return None
|
|
@@ -46,7 +46,7 @@ class PasswordlessClient:
|
|
|
46
46
|
def send_passwordless_email(
|
|
47
47
|
self,
|
|
48
48
|
email: str,
|
|
49
|
-
template: Optional[Union[str, TemplateType]] = None,
|
|
49
|
+
template: Optional[Union[str, "TemplateType"]] = None,
|
|
50
50
|
magiclink_auth_uri: Optional[str] = None,
|
|
51
51
|
state: Optional[str] = None,
|
|
52
52
|
expires_in: Optional[int] = None,
|
|
@@ -57,6 +57,38 @@ class ToolsClient:
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
|
|
60
|
+
def list_scoped_tools(
|
|
61
|
+
self,
|
|
62
|
+
identifier: str,
|
|
63
|
+
filter: Optional[ScopedToolFilter] = None,
|
|
64
|
+
page_size: Optional[int] = None,
|
|
65
|
+
page_token: Optional[str] = None
|
|
66
|
+
) -> ListScopedToolsResponse:
|
|
67
|
+
"""
|
|
68
|
+
Method to list scoped tools for a specific identifier
|
|
69
|
+
|
|
70
|
+
:param identifier : Identifier to scope the tools list
|
|
71
|
+
:type : ``` str ```
|
|
72
|
+
:param filter : Filter parameters for scoped tools
|
|
73
|
+
:type : ``` ScopedToolFilter ```
|
|
74
|
+
:param page_size : Maximum number of tools to return per page
|
|
75
|
+
:type : ``` int ```
|
|
76
|
+
:param page_token : Token from a previous response for pagination
|
|
77
|
+
:type : ``` str ```
|
|
78
|
+
|
|
79
|
+
:returns:
|
|
80
|
+
List Scoped Tools Response
|
|
81
|
+
"""
|
|
82
|
+
return self.core_client.grpc_exec(
|
|
83
|
+
self.tool_service.ListScopedTools.with_call,
|
|
84
|
+
ListScopedToolsRequest(
|
|
85
|
+
identifier=identifier,
|
|
86
|
+
filter=filter,
|
|
87
|
+
page_size=page_size,
|
|
88
|
+
page_token=page_token
|
|
89
|
+
),
|
|
90
|
+
)
|
|
91
|
+
|
|
60
92
|
def execute_tool(
|
|
61
93
|
self,
|
|
62
94
|
tool_name: str,
|