a692024b4e
The Profile now carries dict_versions (game variant -> current dictionary version), populated from the dictionary registry at the profileResponse choke point, so an installed PWA can preload the matching dawg per enabled variant off the existing cold-start profile request instead of adding a round-trip for a rare feature. Wire path: FBS DictVersion table + Profile.dict_versions (additive, backward-compatible trailing field) -> backend dto/registry -> gateway ProfileResp + FBS encoder -> client codec decode into a per-variant map on model.Profile. Empty in a degenerate no-dictionary deployment; the mock serves v1.3.0 for all three variants. Codec decode covered by a bite-tested round-trip unit test.
240 lines
8.3 KiB
TypeScript
240 lines
8.3 KiB
TypeScript
// automatically generated by the FlatBuffers compiler, do not modify
|
|
|
|
import * as flatbuffers from 'flatbuffers';
|
|
|
|
import { BannerInfo } from '../scrabblefb/banner-info.js';
|
|
import { DictVersion } from '../scrabblefb/dict-version.js';
|
|
|
|
|
|
export class Profile {
|
|
bb: flatbuffers.ByteBuffer|null = null;
|
|
bb_pos = 0;
|
|
__init(i:number, bb:flatbuffers.ByteBuffer):Profile {
|
|
this.bb_pos = i;
|
|
this.bb = bb;
|
|
return this;
|
|
}
|
|
|
|
static getRootAsProfile(bb:flatbuffers.ByteBuffer, obj?:Profile):Profile {
|
|
return (obj || new Profile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
}
|
|
|
|
static getSizePrefixedRootAsProfile(bb:flatbuffers.ByteBuffer, obj?:Profile):Profile {
|
|
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
return (obj || new Profile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
}
|
|
|
|
userId():string|null
|
|
userId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
userId(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;
|
|
}
|
|
|
|
displayName():string|null
|
|
displayName(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
displayName(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
preferredLanguage():string|null
|
|
preferredLanguage(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
preferredLanguage(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 8);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
timeZone():string|null
|
|
timeZone(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
timeZone(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 10);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
hintBalance():number {
|
|
const offset = this.bb!.__offset(this.bb_pos, 12);
|
|
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
|
}
|
|
|
|
blockChat():boolean {
|
|
const offset = this.bb!.__offset(this.bb_pos, 14);
|
|
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
|
}
|
|
|
|
blockFriendRequests():boolean {
|
|
const offset = this.bb!.__offset(this.bb_pos, 16);
|
|
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
|
}
|
|
|
|
isGuest():boolean {
|
|
const offset = this.bb!.__offset(this.bb_pos, 18);
|
|
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
|
}
|
|
|
|
awayStart():string|null
|
|
awayStart(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
awayStart(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 20);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
awayEnd():string|null
|
|
awayEnd(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
awayEnd(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 22);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
notificationsInAppOnly():boolean {
|
|
const offset = this.bb!.__offset(this.bb_pos, 24);
|
|
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : true;
|
|
}
|
|
|
|
banner(obj?:BannerInfo):BannerInfo|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 26);
|
|
return offset ? (obj || new BannerInfo()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
|
}
|
|
|
|
variantPreferences(index: number):string
|
|
variantPreferences(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
|
|
variantPreferences(index: number,optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 28);
|
|
return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
|
}
|
|
|
|
variantPreferencesLength():number {
|
|
const offset = this.bb!.__offset(this.bb_pos, 28);
|
|
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
}
|
|
|
|
email():string|null
|
|
email(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
email(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 30);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
telegramLinked():boolean {
|
|
const offset = this.bb!.__offset(this.bb_pos, 32);
|
|
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
|
}
|
|
|
|
vkLinked():boolean {
|
|
const offset = this.bb!.__offset(this.bb_pos, 34);
|
|
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
|
}
|
|
|
|
dictVersions(index: number, obj?:DictVersion):DictVersion|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 36);
|
|
return offset ? (obj || new DictVersion()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
|
}
|
|
|
|
dictVersionsLength():number {
|
|
const offset = this.bb!.__offset(this.bb_pos, 36);
|
|
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
}
|
|
|
|
static startProfile(builder:flatbuffers.Builder) {
|
|
builder.startObject(17);
|
|
}
|
|
|
|
static addUserId(builder:flatbuffers.Builder, userIdOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(0, userIdOffset, 0);
|
|
}
|
|
|
|
static addDisplayName(builder:flatbuffers.Builder, displayNameOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(1, displayNameOffset, 0);
|
|
}
|
|
|
|
static addPreferredLanguage(builder:flatbuffers.Builder, preferredLanguageOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(2, preferredLanguageOffset, 0);
|
|
}
|
|
|
|
static addTimeZone(builder:flatbuffers.Builder, timeZoneOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(3, timeZoneOffset, 0);
|
|
}
|
|
|
|
static addHintBalance(builder:flatbuffers.Builder, hintBalance:number) {
|
|
builder.addFieldInt32(4, hintBalance, 0);
|
|
}
|
|
|
|
static addBlockChat(builder:flatbuffers.Builder, blockChat:boolean) {
|
|
builder.addFieldInt8(5, +blockChat, +false);
|
|
}
|
|
|
|
static addBlockFriendRequests(builder:flatbuffers.Builder, blockFriendRequests:boolean) {
|
|
builder.addFieldInt8(6, +blockFriendRequests, +false);
|
|
}
|
|
|
|
static addIsGuest(builder:flatbuffers.Builder, isGuest:boolean) {
|
|
builder.addFieldInt8(7, +isGuest, +false);
|
|
}
|
|
|
|
static addAwayStart(builder:flatbuffers.Builder, awayStartOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(8, awayStartOffset, 0);
|
|
}
|
|
|
|
static addAwayEnd(builder:flatbuffers.Builder, awayEndOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(9, awayEndOffset, 0);
|
|
}
|
|
|
|
static addNotificationsInAppOnly(builder:flatbuffers.Builder, notificationsInAppOnly:boolean) {
|
|
builder.addFieldInt8(10, +notificationsInAppOnly, +true);
|
|
}
|
|
|
|
static addBanner(builder:flatbuffers.Builder, bannerOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(11, bannerOffset, 0);
|
|
}
|
|
|
|
static addVariantPreferences(builder:flatbuffers.Builder, variantPreferencesOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(12, variantPreferencesOffset, 0);
|
|
}
|
|
|
|
static createVariantPreferencesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
|
|
builder.startVector(4, data.length, 4);
|
|
for (let i = data.length - 1; i >= 0; i--) {
|
|
builder.addOffset(data[i]!);
|
|
}
|
|
return builder.endVector();
|
|
}
|
|
|
|
static startVariantPreferencesVector(builder:flatbuffers.Builder, numElems:number) {
|
|
builder.startVector(4, numElems, 4);
|
|
}
|
|
|
|
static addEmail(builder:flatbuffers.Builder, emailOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(13, emailOffset, 0);
|
|
}
|
|
|
|
static addTelegramLinked(builder:flatbuffers.Builder, telegramLinked:boolean) {
|
|
builder.addFieldInt8(14, +telegramLinked, +false);
|
|
}
|
|
|
|
static addVkLinked(builder:flatbuffers.Builder, vkLinked:boolean) {
|
|
builder.addFieldInt8(15, +vkLinked, +false);
|
|
}
|
|
|
|
static addDictVersions(builder:flatbuffers.Builder, dictVersionsOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(16, dictVersionsOffset, 0);
|
|
}
|
|
|
|
static createDictVersionsVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
|
|
builder.startVector(4, data.length, 4);
|
|
for (let i = data.length - 1; i >= 0; i--) {
|
|
builder.addOffset(data[i]!);
|
|
}
|
|
return builder.endVector();
|
|
}
|
|
|
|
static startDictVersionsVector(builder:flatbuffers.Builder, numElems:number) {
|
|
builder.startVector(4, numElems, 4);
|
|
}
|
|
|
|
static endProfile(builder:flatbuffers.Builder):flatbuffers.Offset {
|
|
const offset = builder.endObject();
|
|
return offset;
|
|
}
|
|
|
|
}
|