feat: migrate platform login scenes and native login flows

This commit is contained in:
2026-09-06 09:06:00 +08:00
parent f2a948f059
commit 695d3be25c
140 changed files with 7599 additions and 4397 deletions
@@ -17,6 +17,19 @@ function legacy(raw: unknown, name: string, selected = identity) {
GameData: { AgentId: selected.agentid, GameId: selected.gameid, ChannelId: selected.channelid, marketID: selected.marketid },
});
}
test('get_paravalue is the shared legacy-compatible reader, including an absent data wrapper', () => {
assert.equal(typeof api.get_paravalue, 'function');
const raw = {showVisitor:1,agentlist:[
{agentid:11,showVisitor:0,gamelist:[{gameid:22,deviceLogin:true}]},
{agentid:11,showVisitor:2},
]};
for(const name of ['showVisitor','deviceLogin','missing']) {
assert.deepEqual(api.get_paravalue({data:raw},name,identity),legacy(raw,name));
assert.deepEqual(view(raw).getValue(name),api.get_paravalue({data:raw},name,identity));
}
assert.equal(api.get_paravalue({},'showVisitor',identity),legacy(undefined,'showVisitor'));
});
test('memory view agrees with actual legacy function across all five scopes and preserves raw objects', () => {
const scopes: Record<string, unknown>[] = [
{ hall_config: { root: true }, rootOnly: 'root', falsy: 'inherited' },