Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit c44915f

Browse files
committed
draft RawR routes
1 parent 244e71d commit c44915f

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

api/src/core/routes/rawr.tsp

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,45 @@ using Routes;
1313

1414
namespace Routes;
1515

16-
namespace ResourceAdressingWithRelativeRoots {
17-
16+
@route("/resource/")
17+
namespace ResourceAddressingWithRelativeRoots {
18+
19+
@tag("Resource addressing with relative roots - Registration not required")
20+
namespace Unregistered {
21+
@route("/{rid}")
22+
@get
23+
@added(Version.`v1.0-alpha.1`)
24+
@summary("Get resource by resource ID")
25+
/**
26+
* Retrieve a [RawR](https://docs.polyphony.chat/Protocol%20Specifications/core/#731-resource-addressing-with-relative-roots)
27+
* resource by specifying the ID of the resource.
28+
* @param rid: Resource Identifier - unique identifier for a resource.
29+
* @returns
30+
* - `200`: File found and retrieved.
31+
* - `401`: Server or resource requires authentication to access this endpoint.
32+
* - `403`: Server or resource not accessible for the actor making this request.
33+
* - `404`: Resource not found.
34+
*/
35+
op getResource(@path rid: string): {
36+
@statusCode _ : 403 | 401 | 404;
37+
} | {
38+
@statusCode _ : 200;
39+
@body body: File;
40+
};
41+
}
42+
43+
@tag("Resource addressing with relative roots - Registration required")
44+
@useAuth(BearerAuth)
45+
namespace Registered {
46+
@route("/{rid}")
47+
@post
48+
@added(Version.`v1.0-alpha.1`)
49+
@summary("Upload RawR resource")
50+
op postResource(@path rid: string, @header({name: "Content-Length"}) contentLength: uint64): {
51+
// TODO
52+
};
53+
}
54+
1855
}
1956

2057
// rawr x3

0 commit comments

Comments
 (0)