Add developer API, Prometheus metrics, and community links

This commit is contained in:
2026-10-12 19:59:37 +05:00
parent 3cc3136762
commit 018be5049e
50 changed files with 4087 additions and 31 deletions

86
shared/developer-docs.ts Normal file
View File

@@ -0,0 +1,86 @@
export const developerScopes = [
{
id: "maps:read",
name: ["Public maps", "Общие карты"],
description: [
"Read the published map catalog and map details.",
"Читать каталог опубликованных карт и сведения о картах.",
],
},
{
id: "account:read",
name: ["My profile", "Мой профиль"],
description: [
"Read your account profile and username appearance.",
"Читать профиль вашего аккаунта и оформление имени.",
],
},
{
id: "account:maps:read",
name: ["My maps, including private maps", "Мои карты, включая личные"],
description: [
"Read your own map records, including unpublished maps.",
"Читать ваши карты, в том числе неопубликованные.",
],
},
{
id: "account:games:read",
name: ["My game history", "Моя история игр"],
description: ["Read your game history.", "Читать вашу историю игр."],
},
] as const;
export const developerEndpoints = [
{
path: "/maps",
scope: "maps:read",
description: [
"Published maps. Supports q, limit and offset.",
"Опубликованные карты. Поддерживает q, limit и offset.",
],
},
{
path: "/maps/{id}",
scope: "maps:read",
description: [
"Details of one published map.",
"Сведения об одной опубликованной карте.",
],
},
{
path: "/me",
scope: "account:read",
description: [
"The key owner's profile and username appearance.",
"Профиль и оформление имени владельца ключа.",
],
},
{
path: "/me/maps",
scope: "account:maps:read",
description: [
"Your own maps, including private maps. Supports limit and offset.",
"Ваши карты, включая личные. Поддерживает limit и offset.",
],
},
{
path: "/me/games",
scope: "account:games:read",
description: [
"Your game history. Supports limit and offset.",
"Ваша история игр. Поддерживает limit и offset.",
],
},
] as const;
export const developerPythonExample = `import os
import requests
response = requests.get(
"https://minegeo.vercel.app/api/dev/v1/maps",
headers={"Authorization": f"Bearer {os.environ['MINEGEO_API_KEY']}"},
params={"limit": 20, "offset": 0},
timeout=20,
)
response.raise_for_status()
print(response.json())`;