2026-10-05 11:25:41 +02:00
|
|
|
# retoor <retoor@molodetz.nl>
|
|
|
|
|
from molodetz.docs_api.registry import endpoint, field
|
|
|
|
|
|
|
|
|
|
GROUP = {
|
|
|
|
|
"slug": "join",
|
|
|
|
|
"title": "Join",
|
|
|
|
|
"description": "Sign up to write along. Stored for administrators, never public.",
|
|
|
|
|
"endpoints": [
|
|
|
|
|
endpoint("GET", "/join", "Join form", sample={"submitted": False}),
|
|
|
|
|
endpoint(
|
|
|
|
|
"POST",
|
|
|
|
|
"/join",
|
|
|
|
|
"I'm in",
|
|
|
|
|
"Stores a join request: name, contact and an optional repo link.",
|
|
|
|
|
fields=[
|
|
|
|
|
field("name", required=True, example="Ada"),
|
|
|
|
|
field("contact", required=True, example="ada@example.com"),
|
|
|
|
|
field("repo_url", example="https://git.example.com/ada"),
|
|
|
|
|
field("message", example="I write about finishing things."),
|
|
|
|
|
],
|
|
|
|
|
sample={"ok": True, "redirect": "/join?ok=1", "data": {"uid": "0190..."}},
|
|
|
|
|
probe_body={"name": "Probe", "contact": "probe@example.com"},
|
|
|
|
|
),
|
2026-10-06 02:56:08 +02:00
|
|
|
endpoint(
|
|
|
|
|
"GET",
|
|
|
|
|
"/invite/{token}",
|
|
|
|
|
"Invite claim form",
|
|
|
|
|
"Shows the claim form for a live invite; unknown, used and expired links answer 404 with the same message.",
|
|
|
|
|
fields=[field("token", required=True, location="path", example="unknown-token")],
|
|
|
|
|
sample={"valid": True, "username": "ada", "email": "ada@example.com", "email_locked": True},
|
|
|
|
|
probe_path="/invite/unknown-token",
|
|
|
|
|
),
|
|
|
|
|
endpoint(
|
|
|
|
|
"POST",
|
|
|
|
|
"/invite/{token}",
|
|
|
|
|
"Claim invite",
|
|
|
|
|
"Creates the Member account, logs in and marks the join request accepted. Single use.",
|
|
|
|
|
fields=[
|
|
|
|
|
field("token", required=True, location="path", example="unknown-token"),
|
|
|
|
|
field("username", required=True, example="ada"),
|
|
|
|
|
field("email", required=True, example="ada@example.com"),
|
|
|
|
|
field("password", required=True, example="correct horse battery staple"),
|
|
|
|
|
field("password_confirm", required=True, example="correct horse battery staple"),
|
|
|
|
|
field("terms", required=True, type="boolean", example=True),
|
|
|
|
|
],
|
|
|
|
|
sample={"ok": True, "redirect": "/", "data": {"username": "ada"}},
|
|
|
|
|
probe_path="/invite/unknown-token",
|
|
|
|
|
probe_body={"username": "Probe", "email": "probe@example.com", "password": "probe-pass-1", "password_confirm": "probe-pass-1", "terms": True},
|
|
|
|
|
),
|
2026-10-05 11:25:41 +02:00
|
|
|
],
|
|
|
|
|
}
|