feat(plugin): gate pages on companion features
This commit is contained in:
@@ -69,7 +69,8 @@ export function parseSafeGameClientBridgeStatus(value: unknown): GameClientBridg
|
||||
pluginId: string(record.pluginId, "pluginId"),
|
||||
available: boolean(record.available, "available"),
|
||||
reason: optionalString(record.reason, "reason"),
|
||||
profiles: array(record.profiles, "profiles").map(parseProfile)
|
||||
profiles: array(record.profiles, "profiles").map(parseProfile),
|
||||
features: array(record.features ?? [], "features").map(parseFeature)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -136,10 +137,17 @@ function parseProfile(value: unknown): GameClientBridgeProfileDeclarationRespons
|
||||
reason: optionalString(record.reason, "profile.reason"),
|
||||
commandTypes: stringArray(record.commandTypes, "profile.commandTypes"),
|
||||
snapshotTypes: stringArray(record.snapshotTypes, "profile.snapshotTypes"),
|
||||
queryTemplateKeys: stringArray(record.queryTemplateKeys, "profile.queryTemplateKeys")
|
||||
queryTemplateKeys: stringArray(record.queryTemplateKeys, "profile.queryTemplateKeys"),
|
||||
handlerTypes: stringArray(record.handlerTypes ?? [], "profile.handlerTypes"),
|
||||
eventProducerTypes: stringArray(record.eventProducerTypes ?? [], "profile.eventProducerTypes")
|
||||
};
|
||||
}
|
||||
|
||||
function parseFeature(value: unknown): { key: string; available: boolean; reason?: string } {
|
||||
const record = safeObject(value, "Game Client Bridge feature");
|
||||
return { key: string(record.key, "feature.key"), available: boolean(record.available, "feature.available"), reason: optionalString(record.reason, "feature.reason") };
|
||||
}
|
||||
|
||||
function parseResult(value: unknown): GameClientBridgeCommandResultResponse {
|
||||
const record = safeObject(value, "Game Client Bridge command result");
|
||||
const result: GameClientBridgeCommandResultResponse = {
|
||||
|
||||
Reference in New Issue
Block a user