Release v0.2.0 archive and space API update

This commit is contained in:
2026-04-11 01:56:47 +08:00
parent e07a9086b1
commit 07fc690e67
42 changed files with 3391 additions and 1316 deletions

View File

@@ -350,13 +350,149 @@ components:
score:
type: integer
format: int64
SpaceUpdateRequest:
SpaceContentUploadRequest:
type: object
required: [payload_json]
required: [file]
properties:
payload_json:
type: object
additionalProperties: true
base_version:
type: integer
format: int64
description: Optimistic lock base version. Use 0 for the first upload.
content_type:
type: string
description: Optional MIME type. Defaults to application/octet-stream when omitted.
checksum:
type: string
description: Optional SHA-256 hex checksum. When provided, the server validates it before saving.
file:
type: string
format: binary
SpaceMetadata:
type: object
properties:
project_account_id:
type: string
player_id:
type: string
login_provider:
type: string
login_user_id:
type: string
nickname:
type: string
avatar_url:
type: string
content_exists:
type: boolean
content_version:
type: integer
format: int64
content_type:
type: string
content_size_bytes:
type: integer
format: int64
content_checksum:
type: string
like_count:
type: integer
format: int64
visit_count:
type: integer
format: int64
liked_by_me:
type: boolean
updated_at:
type: string
format: date-time
nullable: true
SpaceStats:
type: object
properties:
project_account_id:
type: string
player_id:
type: string
login_provider:
type: string
login_user_id:
type: string
nickname:
type: string
avatar_url:
type: string
content_exists:
type: boolean
content_version:
type: integer
format: int64
content_type:
type: string
content_size_bytes:
type: integer
format: int64
content_checksum:
type: string
like_count:
type: integer
format: int64
visit_count:
type: integer
format: int64
updated_at:
type: string
format: date-time
nullable: true
SpaceContentUpdateResult:
type: object
properties:
player_id:
type: string
content_version:
type: integer
format: int64
content_type:
type: string
content_size_bytes:
type: integer
format: int64
content_checksum:
type: string
updated_at:
type: string
format: date-time
SpaceLikeResult:
type: object
properties:
liked:
type: boolean
like_count:
type: integer
format: int64
SpaceVisitItem:
type: object
properties:
visitor_player_id:
type: string
nickname:
type: string
avatar_url:
type: string
visited_at:
type: string
format: date-time
SpaceLikeItem:
type: object
properties:
player_id:
type: string
nickname:
type: string
avatar_url:
type: string
created_at:
type: string
format: date-time
paths:
/client/bootstrap:
get:
@@ -644,7 +780,7 @@ paths:
get:
tags: [spaces]
security: [{ bearerAuth: [] }]
summary: Get player space
summary: Get player space metadata
parameters:
- in: path
name: player_id
@@ -659,7 +795,46 @@ paths:
schema: { type: string }
description: Optional target login user id used with login provider lookup.
responses:
'200': { description: Space payload }
'200':
description: Space metadata
content:
application/json:
schema:
$ref: '#/components/schemas/SpaceMetadata'
/spaces/{player_id}/content:
get:
tags: [spaces]
security: [{ bearerAuth: [] }]
summary: Download player space content
parameters:
- in: path
name: player_id
required: true
schema: { type: string }
- in: query
name: login_provider
schema: { type: string }
description: Optional target login provider. When present, login_user_id is also required and overrides player_id lookup.
- in: query
name: login_user_id
schema: { type: string }
description: Optional target login user id used with login provider lookup.
responses:
'200':
description: Binary space content stream
headers:
X-Space-Version:
schema:
type: integer
format: int64
X-Space-Checksum:
schema:
type: string
content:
application/octet-stream:
schema:
type: string
format: binary
/spaces/{player_id}/stats:
get:
tags: [spaces]
@@ -677,7 +852,12 @@ paths:
name: login_user_id
schema: { type: string }
responses:
'200': { description: Space stats }
'200':
description: Space stats
content:
application/json:
schema:
$ref: '#/components/schemas/SpaceStats'
/spaces/{player_id}/likes:
get:
tags: [spaces]
@@ -698,20 +878,33 @@ paths:
name: limit
schema: { type: integer }
responses:
'200': { description: Space likes }
/spaces/me:
'200':
description: Space likes
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SpaceLikeItem'
/spaces/me/content:
put:
tags: [spaces]
security: [{ bearerAuth: [] }]
summary: Update my space
summary: Upload my space content
requestBody:
required: true
content:
application/json:
multipart/form-data:
schema:
$ref: '#/components/schemas/SpaceUpdateRequest'
$ref: '#/components/schemas/SpaceContentUploadRequest'
responses:
'200': { description: Space updated }
'200':
description: Space content updated
content:
application/json:
schema:
$ref: '#/components/schemas/SpaceContentUpdateResult'
'409': { description: Version conflict }
/spaces/{player_id}/like:
post:
tags: [spaces]
@@ -729,7 +922,12 @@ paths:
name: login_user_id
schema: { type: string }
responses:
'200': { description: Liked }
'200':
description: Liked
content:
application/json:
schema:
$ref: '#/components/schemas/SpaceLikeResult'
'429': { description: Rate limited }
delete:
tags: [spaces]
@@ -747,13 +945,18 @@ paths:
name: login_user_id
schema: { type: string }
responses:
'200': { description: Unliked }
'200':
description: Unliked
content:
application/json:
schema:
$ref: '#/components/schemas/SpaceLikeResult'
'429': { description: Rate limited }
/spaces/by-login:
get:
tags: [spaces]
security: [{ bearerAuth: [] }]
summary: Get player space by login identity
summary: Get player space metadata by login identity
parameters:
- in: query
name: login_provider
@@ -764,7 +967,42 @@ paths:
required: true
schema: { type: string }
responses:
'200': { description: Space payload }
'200':
description: Space metadata
content:
application/json:
schema:
$ref: '#/components/schemas/SpaceMetadata'
/spaces/by-login/content:
get:
tags: [spaces]
security: [{ bearerAuth: [] }]
summary: Download player space content by login identity
parameters:
- in: query
name: login_provider
required: true
schema: { type: string }
- in: query
name: login_user_id
required: true
schema: { type: string }
responses:
'200':
description: Binary space content stream
headers:
X-Space-Version:
schema:
type: integer
format: int64
X-Space-Checksum:
schema:
type: string
content:
application/octet-stream:
schema:
type: string
format: binary
/spaces/by-login/stats:
get:
tags: [spaces]
@@ -780,7 +1018,12 @@ paths:
required: true
schema: { type: string }
responses:
'200': { description: Space stats }
'200':
description: Space stats
content:
application/json:
schema:
$ref: '#/components/schemas/SpaceStats'
/spaces/by-login/likes:
get:
tags: [spaces]
@@ -799,7 +1042,14 @@ paths:
name: limit
schema: { type: integer }
responses:
'200': { description: Space likes }
'200':
description: Space likes
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SpaceLikeItem'
/spaces/by-login/like:
post:
tags: [spaces]
@@ -815,7 +1065,12 @@ paths:
required: true
schema: { type: string }
responses:
'200': { description: Liked }
'200':
description: Liked
content:
application/json:
schema:
$ref: '#/components/schemas/SpaceLikeResult'
'429': { description: Rate limited }
delete:
tags: [spaces]
@@ -831,7 +1086,12 @@ paths:
required: true
schema: { type: string }
responses:
'200': { description: Unliked }
'200':
description: Unliked
content:
application/json:
schema:
$ref: '#/components/schemas/SpaceLikeResult'
'429': { description: Rate limited }
/spaces/me/visits:
get:
@@ -843,7 +1103,14 @@ paths:
name: limit
schema: { type: integer }
responses:
'200': { description: Visitor list }
'200':
description: Visitor list
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SpaceVisitItem'
/admin/auth/login:
post:
tags: [admin-auth]
@@ -1499,7 +1766,7 @@ paths:
get:
tags: [admin-spaces]
security: [{ bearerAuth: [] }]
summary: Get player space detail
summary: Get player space metadata detail
parameters:
- in: path
name: player_id
@@ -1511,6 +1778,36 @@ paths:
schema: { type: integer, format: int64 }
responses:
'200': { description: Space detail }
/admin/spaces/{player_id}/content:
get:
tags: [admin-spaces]
security: [{ bearerAuth: [] }]
summary: Download player space content
parameters:
- in: path
name: player_id
required: true
schema: { type: string }
- in: query
name: project_id
required: true
schema: { type: integer, format: int64 }
responses:
'200':
description: Binary space content stream
headers:
X-Space-Version:
schema:
type: integer
format: int64
X-Space-Checksum:
schema:
type: string
content:
application/octet-stream:
schema:
type: string
format: binary
/admin/spaces/{player_id}/likes:
get:
tags: [admin-spaces]