ui/phase-14: rename planet end-to-end + order read-back
Wires the first end-to-end command through the full pipeline:
inspector rename action → local order draft → user.games.order
submit → optimistic overlay on map / inspector → server hydration
on cache miss via the new user.games.order.get message type.
Backend: GET /api/v1/user/games/{id}/orders forwards to engine
GET /api/v1/order. Gateway parses the engine PUT response into the
extended UserGamesOrderResponse FBS envelope and adds
executeUserGamesOrderGet for the read-back path. Frontend ports
ValidateTypeName to TS, lands the inline rename editor + Submit
button, and exposes a renderedReport context so consumers see the
overlay-applied snapshot.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,170 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { CommandFleetMerge, CommandFleetMergeT } from './command-fleet-merge.js';
|
||||
import { CommandFleetSend, CommandFleetSendT } from './command-fleet-send.js';
|
||||
import { CommandPayload, unionToCommandPayload, unionListToCommandPayload } from './command-payload.js';
|
||||
import { CommandPlanetProduce, CommandPlanetProduceT } from './command-planet-produce.js';
|
||||
import { CommandPlanetRename, CommandPlanetRenameT } from './command-planet-rename.js';
|
||||
import { CommandPlanetRouteRemove, CommandPlanetRouteRemoveT } from './command-planet-route-remove.js';
|
||||
import { CommandPlanetRouteSet, CommandPlanetRouteSetT } from './command-planet-route-set.js';
|
||||
import { CommandRaceQuit, CommandRaceQuitT } from './command-race-quit.js';
|
||||
import { CommandRaceRelation, CommandRaceRelationT } from './command-race-relation.js';
|
||||
import { CommandRaceVote, CommandRaceVoteT } from './command-race-vote.js';
|
||||
import { CommandScienceCreate, CommandScienceCreateT } from './command-science-create.js';
|
||||
import { CommandScienceRemove, CommandScienceRemoveT } from './command-science-remove.js';
|
||||
import { CommandShipClassCreate, CommandShipClassCreateT } from './command-ship-class-create.js';
|
||||
import { CommandShipClassMerge, CommandShipClassMergeT } from './command-ship-class-merge.js';
|
||||
import { CommandShipClassRemove, CommandShipClassRemoveT } from './command-ship-class-remove.js';
|
||||
import { CommandShipGroupBreak, CommandShipGroupBreakT } from './command-ship-group-break.js';
|
||||
import { CommandShipGroupDismantle, CommandShipGroupDismantleT } from './command-ship-group-dismantle.js';
|
||||
import { CommandShipGroupJoinFleet, CommandShipGroupJoinFleetT } from './command-ship-group-join-fleet.js';
|
||||
import { CommandShipGroupLoad, CommandShipGroupLoadT } from './command-ship-group-load.js';
|
||||
import { CommandShipGroupMerge, CommandShipGroupMergeT } from './command-ship-group-merge.js';
|
||||
import { CommandShipGroupSend, CommandShipGroupSendT } from './command-ship-group-send.js';
|
||||
import { CommandShipGroupTransfer, CommandShipGroupTransferT } from './command-ship-group-transfer.js';
|
||||
import { CommandShipGroupUnload, CommandShipGroupUnloadT } from './command-ship-group-unload.js';
|
||||
import { CommandShipGroupUpgrade, CommandShipGroupUpgradeT } from './command-ship-group-upgrade.js';
|
||||
|
||||
|
||||
export class CommandItem implements flatbuffers.IUnpackableObject<CommandItemT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):CommandItem {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsCommandItem(bb:flatbuffers.ByteBuffer, obj?:CommandItem):CommandItem {
|
||||
return (obj || new CommandItem()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsCommandItem(bb:flatbuffers.ByteBuffer, obj?:CommandItem):CommandItem {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new CommandItem()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
cmdId():string|null
|
||||
cmdId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
cmdId(optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
|
||||
cmdApplied():boolean|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : null;
|
||||
}
|
||||
|
||||
cmdErrorCode():bigint|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.readInt64(this.bb_pos + offset) : null;
|
||||
}
|
||||
|
||||
payloadType():CommandPayload {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.readUint8(this.bb_pos + offset) : CommandPayload.NONE;
|
||||
}
|
||||
|
||||
payload<T extends flatbuffers.Table>(obj:any):any|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;
|
||||
}
|
||||
|
||||
static startCommandItem(builder:flatbuffers.Builder) {
|
||||
builder.startObject(5);
|
||||
}
|
||||
|
||||
static addCmdId(builder:flatbuffers.Builder, cmdIdOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, cmdIdOffset, 0);
|
||||
}
|
||||
|
||||
static addCmdApplied(builder:flatbuffers.Builder, cmdApplied:boolean) {
|
||||
builder.addFieldInt8(1, +cmdApplied, null);
|
||||
}
|
||||
|
||||
static addCmdErrorCode(builder:flatbuffers.Builder, cmdErrorCode:bigint) {
|
||||
builder.addFieldInt64(2, cmdErrorCode, null);
|
||||
}
|
||||
|
||||
static addPayloadType(builder:flatbuffers.Builder, payloadType:CommandPayload) {
|
||||
builder.addFieldInt8(3, payloadType, CommandPayload.NONE);
|
||||
}
|
||||
|
||||
static addPayload(builder:flatbuffers.Builder, payloadOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(4, payloadOffset, 0);
|
||||
}
|
||||
|
||||
static endCommandItem(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 12) // payload
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createCommandItem(builder:flatbuffers.Builder, cmdIdOffset:flatbuffers.Offset, cmdApplied:boolean|null, cmdErrorCode:bigint|null, payloadType:CommandPayload, payloadOffset:flatbuffers.Offset):flatbuffers.Offset {
|
||||
CommandItem.startCommandItem(builder);
|
||||
CommandItem.addCmdId(builder, cmdIdOffset);
|
||||
if (cmdApplied !== null)
|
||||
CommandItem.addCmdApplied(builder, cmdApplied);
|
||||
if (cmdErrorCode !== null)
|
||||
CommandItem.addCmdErrorCode(builder, cmdErrorCode);
|
||||
CommandItem.addPayloadType(builder, payloadType);
|
||||
CommandItem.addPayload(builder, payloadOffset);
|
||||
return CommandItem.endCommandItem(builder);
|
||||
}
|
||||
|
||||
unpack(): CommandItemT {
|
||||
return new CommandItemT(
|
||||
this.cmdId(),
|
||||
this.cmdApplied(),
|
||||
this.cmdErrorCode(),
|
||||
this.payloadType(),
|
||||
(() => {
|
||||
const temp = unionToCommandPayload(this.payloadType(), this.payload.bind(this));
|
||||
if(temp === null) { return null; }
|
||||
return temp.unpack()
|
||||
})()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
unpackTo(_o: CommandItemT): void {
|
||||
_o.cmdId = this.cmdId();
|
||||
_o.cmdApplied = this.cmdApplied();
|
||||
_o.cmdErrorCode = this.cmdErrorCode();
|
||||
_o.payloadType = this.payloadType();
|
||||
_o.payload = (() => {
|
||||
const temp = unionToCommandPayload(this.payloadType(), this.payload.bind(this));
|
||||
if(temp === null) { return null; }
|
||||
return temp.unpack()
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
export class CommandItemT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public cmdId: string|Uint8Array|null = null,
|
||||
public cmdApplied: boolean|null = null,
|
||||
public cmdErrorCode: bigint|null = null,
|
||||
public payloadType: CommandPayload = CommandPayload.NONE,
|
||||
public payload: CommandFleetMergeT|CommandFleetSendT|CommandPlanetProduceT|CommandPlanetRenameT|CommandPlanetRouteRemoveT|CommandPlanetRouteSetT|CommandRaceQuitT|CommandRaceRelationT|CommandRaceVoteT|CommandScienceCreateT|CommandScienceRemoveT|CommandShipClassCreateT|CommandShipClassMergeT|CommandShipClassRemoveT|CommandShipGroupBreakT|CommandShipGroupDismantleT|CommandShipGroupJoinFleetT|CommandShipGroupLoadT|CommandShipGroupMergeT|CommandShipGroupSendT|CommandShipGroupTransferT|CommandShipGroupUnloadT|CommandShipGroupUpgradeT|null = null
|
||||
){}
|
||||
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const cmdId = (this.cmdId !== null ? builder.createString(this.cmdId!) : 0);
|
||||
const payload = builder.createObjectOffset(this.payload);
|
||||
|
||||
return CommandItem.createCommandItem(builder,
|
||||
cmdId,
|
||||
this.cmdApplied,
|
||||
this.cmdErrorCode,
|
||||
this.payloadType,
|
||||
payload
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user