SimTX API/Packets/CatalogUpload: Difference between revisions
Appearance
Clanker moved page SimTX API/Packets/CatalogUpload to SimTX API v24/Packets/CatalogUpload: Archive the v24 protocol reference Tag: New redirect |
Protocol v25 reference: CatalogUpload Tag: Removed redirect |
||
| Line 1: | Line 1: | ||
# | {{SimTX API navigation}} | ||
{{SimTX packet | |||
| name = CatalogUpload | |||
| frame = ClientFrame | |||
| field = 38 | |||
| member = catalog_upload | |||
| direction = c2s | |||
| session = [[SimTX API/Extension catalog protocol|Control (catalog)]] | |||
| roles = <code>ROLE_CONTROL</code>, authenticated. | |||
| permission = <code>catalog.publish</code> | |||
| reply = [[SimTX API/Packets/CatalogUploadResult|CatalogUploadResult]] or [[SimTX API/Packets/Error|Error]] | |||
| group = catalog | |||
| file = control.proto | |||
}} | |||
'''CatalogUpload''' publishes an extension or preset to the server's [[SimTX API/Extension catalog protocol|extension catalog]], or a new revision of an entry the account already owns. | |||
== Definition == | |||
<syntaxhighlight lang="protobuf"> | |||
message CatalogUpload { | |||
int64 request_id = 1; | |||
string kind = 2; | |||
string name = 3; | |||
string description = 4; | |||
repeated string categories = 5; | |||
repeated CatalogFile files = 6; | |||
} | |||
</syntaxhighlight> | |||
== Fields == | |||
{| class="wikitable" | |||
! # !! Field !! Type !! Description | |||
|- | |||
| 1 || <code>request_id</code> || <code>int64</code> || Nonzero; echoed in the [[SimTX API/Packets/CatalogUploadResult|CatalogUploadResult]] or [[SimTX API/Packets/Error|Error]]. | |||
|- | |||
| 2 || <code>kind</code> || <code>string</code> || <code>extension</code> or <code>preset</code>. At most 16 characters. | |||
|- | |||
| 3 || <code>name</code> || <code>string</code> || Entry name, 1 to 64 characters after trimming. Unique per server, compared without regard to case. | |||
|- | |||
| 4 || <code>description</code> || <code>string</code> || At most 500 characters. | |||
|- | |||
| 5 || <code>categories</code> || <code>repeated string</code> || 0 to 12 categories, each 1 to 32 characters, no commas or control characters. | |||
|- | |||
| 6 || <code>files</code> || <code>repeated</code> [[SimTX API/Data types#CatalogFile|CatalogFile]] || 1 to 64 files; a preset is exactly one <code>.stxpreset</code> file. | |||
|} | |||
== Validation == | |||
The server checks the upload against the [[SimTX API/Extension catalog protocol#Upload rules|upload rules]]. A refused upload is answered with [[SimTX API/Packets/Error|Error]] whose <code>message</code> names the first problem found: | |||
* <code>FORBIDDEN</code>: <i>Publishing requires catalog.publish</i>, or the name belongs to another account (<i>An item named 'X' already exists (by Author)</i>). | |||
* <code>INVALID_REQUEST</code>: an unknown kind, a preset that is not exactly one <code>.stxpreset</code> file, an invalid path, name, category or manifest. Manifest errors are passed through verbatim. | |||
* <code>LIMIT_REACHED</code>: <i>Catalog entry quota reached (32)</i>, <i>Catalog storage quota reached</i>, <i>Server catalog storage is full</i>. | |||
* <code>UNAVAILABLE</code>: <i>This server has no catalog</i>, <i>The catalog is temporarily unavailable</i>. | |||
* <code>INTERNAL</code>: <i>Could not store the item</i>. | |||
Show the message to the user; it says what to fix. | |||
== Revisions == | |||
Uploading an entry with the name of an entry the same account already owns replaces it: the ID stays, the revision increases, and the result has <code>updated = true</code>. Names are compared without regard to case. | |||
== See also == | |||
* [[SimTX API/Extension catalog protocol]] | |||
* [[SimTX API/Packets/CatalogUploadResult|CatalogUploadResult]] | |||
{{SimTX API navbox}} | |||
[[Category:SimTX API]] | |||
Latest revision as of 16:44, 24 October 2026
| Frame | ClientFrame, field 38
|
|---|---|
| Member | catalog_upload
|
| Direction | Client → server |
| Session | Control (catalog) |
| Roles | ROLE_CONTROL, authenticated.
|
| Permission | catalog.publish
|
| Answered by | CatalogUploadResult or Error |
| Defined in | control.proto
|
CatalogUpload publishes an extension or preset to the server's extension catalog, or a new revision of an entry the account already owns.
Definition[edit | edit source]
message CatalogUpload {
int64 request_id = 1;
string kind = 2;
string name = 3;
string description = 4;
repeated string categories = 5;
repeated CatalogFile files = 6;
}
Fields[edit | edit source]
| # | Field | Type | Description |
|---|---|---|---|
| 1 | request_id |
int64 |
Nonzero; echoed in the CatalogUploadResult or Error. |
| 2 | kind |
string |
extension or preset. At most 16 characters.
|
| 3 | name |
string |
Entry name, 1 to 64 characters after trimming. Unique per server, compared without regard to case. |
| 4 | description |
string |
At most 500 characters. |
| 5 | categories |
repeated string |
0 to 12 categories, each 1 to 32 characters, no commas or control characters. |
| 6 | files |
repeated CatalogFile |
1 to 64 files; a preset is exactly one .stxpreset file.
|
Validation[edit | edit source]
The server checks the upload against the upload rules. A refused upload is answered with Error whose message names the first problem found:
FORBIDDEN: Publishing requires catalog.publish, or the name belongs to another account (An item named 'X' already exists (by Author)).INVALID_REQUEST: an unknown kind, a preset that is not exactly one.stxpresetfile, an invalid path, name, category or manifest. Manifest errors are passed through verbatim.LIMIT_REACHED: Catalog entry quota reached (32), Catalog storage quota reached, Server catalog storage is full.UNAVAILABLE: This server has no catalog, The catalog is temporarily unavailable.INTERNAL: Could not store the item.
Show the message to the user; it says what to fix.
Revisions[edit | edit source]
Uploading an entry with the name of an entry the same account already owns replaces it: the ID stays, the revision increases, and the result has updated = true. Names are compared without regard to case.