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

Commit 06d6e81

Browse files
committed
Return file instead of MessageBatch, explain export file format
1 parent abbe00d commit 06d6e81

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

api/src/core/routes/migration.tsp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,18 @@ namespace Migration {
243243
* Export all of your data for safekeeping or for importing it to another server
244244
* @returns - `202` and a key trial, if one still needs to be passed
245245
* - `200` and the appropriate data if the key trial has been passed and is not yet expired.
246+
* The data is a gzipped tarball (.tar.gz) named `export1234567890-user@subdomain.example.com`, where
247+
* - `export[numbers]` is the word `export` with 20 random digits appended to it
248+
* - `user` is the actors' name
249+
* - `subdomain.example.com` is the FQDN of the server the actor is
250+
* This file archive contains a file `messages.json` which is a JSON `MessageBatch` of all
251+
* messages sent by the user. Note the [definition of the word "message" in polyproto](https://docs.polyphony.chat/Protocol%20Specifications/core/#:~:text=software%20for%20clients.-,message%2C%20messages,-%3A%20In%20the%20context).
252+
* If the server where the data export was requested from has [RawR](https://docs.polyphony.chat/Protocol%20Specifications/core/#731-resource-addressing-with-relative-roots)
253+
* enabled, the file archive will contain a folder named `rawr`. This folder contains all
254+
* RawR-content uploaded by the actor to that server. The files in this folder are named after
255+
* the resource ID. File extensions are only added if they were known to the server. An
256+
* example file name might be `2c851bfb6daffa944fa1723c7bd4d362ffbc9defe292f2daaf05e895989d179b.jxl`,
257+
* referencing the file which was hosted at `<server_url>/.p2/core/resource/2c851bfb6daffa944fa1723c7bd4d362ffbc9defe292f2daaf05e895989d179b.jxl`.
246258
* - `204` if the server needs time to gather the data. A `Retry-After` header is included in
247259
* the response, indicating to the actor the point in time at which they should query this
248260
* endpoint again. If this point in time is after the expiry timestamp of the completed key trial,
@@ -254,7 +266,7 @@ namespace Migration {
254266
@body body: polyproto.core.models.KeyTrial;
255267
} | {
256268
@statusCode statusCode: 200;
257-
@body body: polyproto.core.models.MessageBatch<string>[];
269+
@body body: File;
258270
} | {
259271
@statusCode statusCode: 204;
260272
@header({name: "Retry-After"}) retryAfter: uint64;
@@ -263,5 +275,6 @@ namespace Migration {
263275
}
264276

265277
/* TODO things that are missing:
266-
* - CawR routes
278+
* - RawR routes
279+
- The description of the RawR .tar.gz file format could be added into the p2 spec
267280
*/

0 commit comments

Comments
 (0)