generated from VLADIMIR/template_frontend
up
This commit is contained in:
+21
-5
@@ -626,6 +626,14 @@ service EveningDetectiveServer {
|
||||
};
|
||||
}
|
||||
|
||||
// HTTP uploads are streamed by a dedicated handler, bypassing gRPC message limits.
|
||||
rpc ImportGame(google.api.HttpBody) returns (GameImportRsp) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/games/import"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
rpc StartGameExport(StartGameExportReq) returns (GameExportRsp) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/games/{ID}/export"
|
||||
@@ -1645,16 +1653,24 @@ message Game {
|
||||
// Download ready ZIP through the authenticated streaming HTTP route:
|
||||
// GET /api/games/{ID}/export/download (not an HttpBody RPC).
|
||||
message GameExport {
|
||||
string ID = 1;
|
||||
string state = 2; // preparing, ready or failed; preparing/ready lock game writes.
|
||||
string ID = 1;
|
||||
string state = 2; // preparing, ready or failed; preparing/ready lock game writes.
|
||||
string packageID = 3;
|
||||
int64 size = 4;
|
||||
string sha256 = 5;
|
||||
string failure = 6;
|
||||
int64 size = 4;
|
||||
string sha256 = 5;
|
||||
string failure = 6;
|
||||
}
|
||||
|
||||
message GameImportRsp {
|
||||
int32 gameID = 1;
|
||||
string packageID = 2;
|
||||
bool repeated = 3;
|
||||
}
|
||||
|
||||
message StartGameExportReq { int32 ID = 1; }
|
||||
|
||||
message GetGameExportReq { int32 ID = 1; }
|
||||
|
||||
message GameExportRsp { GameExport export = 1; }
|
||||
|
||||
enum ScreenMode {
|
||||
|
||||
@@ -574,6 +574,12 @@ export type GameExport = {
|
||||
failure: string | undefined;
|
||||
};
|
||||
|
||||
export type GameImportRsp = {
|
||||
gameID: number | undefined;
|
||||
packageID: string | undefined;
|
||||
repeated: boolean | undefined;
|
||||
};
|
||||
|
||||
export type StartGameExportReq = {
|
||||
ID: number | undefined;
|
||||
};
|
||||
@@ -1272,6 +1278,8 @@ export interface EveningDetectiveServer {
|
||||
AddGame(request: AddGameReq): Promise<AddGameRsp>;
|
||||
GetGames(request: GetGamesReq): Promise<GetGamesRsp>;
|
||||
GetGame(request: GetGameReq): Promise<GetGameRsp>;
|
||||
// HTTP uploads are streamed by a dedicated handler, bypassing gRPC message limits.
|
||||
ImportGame(request: googleapi_HttpBody): Promise<GameImportRsp>;
|
||||
StartGameExport(request: StartGameExportReq): Promise<GameExportRsp>;
|
||||
GetGameExport(request: GetGameExportReq): Promise<GameExportRsp>;
|
||||
IssueGameTickets(request: IssueGameTicketsReq): Promise<IssueGameTicketsRsp>;
|
||||
@@ -2418,6 +2426,23 @@ export function createEveningDetectiveServerClient(
|
||||
method: "GetGame",
|
||||
}) as Promise<GetGameRsp>;
|
||||
},
|
||||
ImportGame(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const path = `api/games/import`; // eslint-disable-line quotes
|
||||
const body = JSON.stringify(request);
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
if (queryParams.length > 0) {
|
||||
uri += `?${queryParams.join("&")}`
|
||||
}
|
||||
return handler({
|
||||
path: uri,
|
||||
method: "POST",
|
||||
body,
|
||||
}, {
|
||||
service: "EveningDetectiveServer",
|
||||
method: "ImportGame",
|
||||
}) as Promise<GameImportRsp>;
|
||||
},
|
||||
StartGameExport(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
if (!request.ID) {
|
||||
throw new Error("missing required field request.ID");
|
||||
|
||||
Reference in New Issue
Block a user