Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35,704 changes: 24,512 additions & 11,192 deletions specs/platform-openapi.json

Large diffs are not rendered by default.

84 changes: 83 additions & 1 deletion src/archastro/platform/auth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: c6bacc8fe3b7
# Content hash: e1c481420189

from __future__ import annotations

Expand All @@ -20,6 +20,13 @@ class AuthClient:
def __init__(self, http: HttpClient):
self._http = http

async def allowed_auth_methods(self) -> dict:
data = await self._http.request(
"/api/v1/auth/allowed_auth_methods",
method="GET",
)
return data

async def login(self, email: str, password: str) -> AuthTokens:
body: dict[str, object] = {}
body["email"] = email
Expand All @@ -36,6 +43,22 @@ async def login(self, email: str, password: str) -> AuthTokens:
access_token=data.get("token"),
)

async def request_login_magic_link(
self, email: str | None = None, redirect_uri: str | None = None
) -> dict:
body: dict[str, object] = {}
if email is not None:
body["email"] = email
if redirect_uri is not None:
body["redirect_uri"] = redirect_uri

data = await self._http.request(
"/api/v1/auth/login/link",
method="POST",
body=body,
)
return data

async def refresh(self, refresh_token: str) -> AuthTokens:
body: dict[str, object] = {}
body["refresh_token"] = refresh_token
Expand Down Expand Up @@ -87,6 +110,49 @@ async def register(
access_token=data.get("token"),
)

async def request_register_magic_link(
self,
alias: str | None = None,
email: str | None = None,
full_name: str | None = None,
redirect_uri: str | None = None,
timezone: str | None = None,
) -> dict:
body: dict[str, object] = {}
if alias is not None:
body["alias"] = alias
if email is not None:
body["email"] = email
if full_name is not None:
body["full_name"] = full_name
if redirect_uri is not None:
body["redirect_uri"] = redirect_uri
if timezone is not None:
body["timezone"] = timezone

data = await self._http.request(
"/api/v1/auth/register/link",
method="POST",
body=body,
)
return data

async def request_magic_link(
self, email: str | None = None, redirect_uri: str | None = None
) -> dict:
body: dict[str, object] = {}
if email is not None:
body["email"] = email
if redirect_uri is not None:
body["redirect_uri"] = redirect_uri

data = await self._http.request(
"/api/v1/auth/request/link",
method="POST",
body=body,
)
return data

async def exchange_login_token(self, token: str, timezone: str | None = None) -> AuthTokens:
body: dict[str, object] = {}
body["token"] = token
Expand All @@ -103,3 +169,19 @@ async def exchange_login_token(self, token: str, timezone: str | None = None) ->
refresh_token=data.get("refresh_token"),
access_token=data.get("token"),
)

async def verify_magic_link(self, token: str | None = None) -> AuthTokens:
body: dict[str, object] = {}
if token is not None:
body["token"] = token

data = await self._http.request(
"/api/v1/auth/verify/link",
method="POST",
body=body,
)
return AuthTokens(
token_expiry=data.get("expires_in"),
refresh_token=data.get("refresh_token"),
access_token=data.get("token"),
)
2 changes: 1 addition & 1 deletion src/archastro/platform/channels/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: 707e0d843182
# Content hash: faf7321571f8

from .api_activity_feed_channel import ApiActivityFeedChannel # noqa: F401
from .api_chat_channel import ApiChatChannel # noqa: F401
Expand Down
22 changes: 18 additions & 4 deletions src/archastro/platform/channels/api_activity_feed_channel.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
# This file is auto-generated by @archastro/sdk-generator. Do not edit.
# Content hash: dd35ef8c137c
# Content hash: 12874ed2facb

from typing import TYPE_CHECKING
from collections.abc import Callable
from typing import TYPE_CHECKING, TypedDict

if TYPE_CHECKING:
from archastro.phx_channel.socket import Socket


# List activity feed entries with cursor-based pagination
class ListEntriesInput(TypedDict, total=False):
after_cursor: str
before_cursor: str
kind: str
level: str
limit: int


class NewEntryPayload(TypedDict, total=False):
entry: dict[str, object] | None


# Phoenix channel for real-time activity feed updates.
# Clients join a topic scoped to an agent or org and receive
# `new_entry` events as feed entries are created.
Expand Down Expand Up @@ -50,8 +64,8 @@ async def leave(self):
await self._channel.leave()

# List activity feed entries with cursor-based pagination
async def list_entries(self, payload: dict) -> dict:
async def list_entries(self, payload: ListEntriesInput) -> dict[str, object]:
return await self._channel.push("list_entries", payload)

def on_new_entry(self, callback):
def on_new_entry(self, callback: Callable[[NewEntryPayload], None]) -> Callable[[], None]:
return self._channel.on("new_entry", callback)
Loading
Loading