-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yml
More file actions
217 lines (205 loc) · 6.18 KB
/
openapi.yml
File metadata and controls
217 lines (205 loc) · 6.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
openapi: 3.1.0
info:
title: Tunecamp REST API
version: 1.0.0
description: |
The Tunecamp API provides programmatic access to the platform's music library, artists, albums, and tracks.
It supports querying the catalog, fetching metadata, and interacting with the decentralized ecosystem.
## Authentication
Many endpoints are public (e.g., browsing the catalog). Administrative endpoints require a Bearer token in the `Authorization` header.
## Subsonic API
This specification covers the native Tunecamp REST API (typically mapped under `/api/v1/`).
For Subsonic compatibility, use the `/rest` endpoint. See [SUBSONIC_API.md](./SUBSONIC_API.md) for details.
paths:
/api/auth/login:
post:
summary: User Login
description: |
Authenticates a user. Supports decentralized proof-of-possession (roaming) via GunDB.
If the user is known on the GunDB peer network but not locally, the backend lazily creates a local profile.
operationId: login
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [username, password]
properties:
username:
type: string
password:
type: string
pubKey:
type: string
description: Optional GunDB public key for decentralized roaming.
proof:
type: string
description: Cryptographic signature of the username proving ownership of the pubKey.
responses:
'200':
description: Successful authentication. Returns JWT and GunDB pair.
'401':
description: Invalid credentials or signature.
/api/users/register:
post:
summary: User Registration
description: |
Registers a new user on the platform. Prioritizes GunDB identity linking.
operationId: register
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [username, password]
properties:
username:
type: string
password:
type: string
pubKey:
type: string
description: The user's GunDB SEA public key.
signature:
type: string
description: A proof-of-possession signature to verify the identity link.
responses:
'200':
description: Registration successful.
'409':
description: Username already taken.
/api/artists:
get:
summary: List Artists
description: Retrieves a list of all public artists in the Tunecamp catalog.
operationId: getArtists
responses:
'200':
description: A list of artists.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Artist'
/api/artists/{slug}:
get:
summary: Get Artist Details
description: Retrieves detailed information for a specific artist, including their profile and description.
operationId: getArtistBySlug
parameters:
- name: slug
in: path
required: true
schema:
type: string
description: The URL-friendly slug of the artist.
responses:
'200':
description: The artist details.
content:
application/json:
schema:
$ref: '#/components/schemas/Artist'
'404':
description: Artist not found.
/api/albums:
get:
summary: List Albums
description: Retrieves a list of all public albums across all artists.
operationId: getAlbums
responses:
'200':
description: A list of albums.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Album'
/api/tracks:
get:
summary: List Tracks
description: Retrieves a list of all public tracks.
operationId: getTracks
responses:
'200':
description: A list of tracks.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Track'
components:
schemas:
Artist:
type: object
properties:
id:
type: string
description: The unique identifier for the artist.
name:
type: string
description: The display name of the artist.
slug:
type: string
description: URL-friendly identifier.
description:
type: string
description: Markdown-formatted biography or description.
coverImage:
type: string
description: URL to the artist's profile image.
walletAddress:
type: string
description: Blockchain wallet address for tips or purchases.
Album:
type: object
properties:
id:
type: string
title:
type: string
artistId:
type: string
artistName:
type: string
releaseDate:
type: string
format: date
coverImage:
type: string
price:
type: number
format: float
Track:
type: object
properties:
id:
type: string
title:
type: string
artistId:
type: string
albumId:
type: string
duration:
type: number
description: Duration in seconds.
playCount:
type: integer
streamUrl:
type: string
description: The URL to stream the audio file.
Error:
type: object
properties:
error:
type: string
description: A brief error code or description.
message:
type: string
description: Detailed error explanation.