Skip to content

ugcDiscovery.getMap/getUgcGameVariant typed AuthoringAsset but discovery returns AssetBase shape #33

@localden

Description

@localden

Version: 1.0.14

UgcDiscoveryModule.getMap, getMapWithoutVersion, getUgcGameVariant, getUgcGameVariantWithoutVersion are all typed Promise<HaloApiResult<AuthoringAsset>>, but the discovery endpoint (https://discovery-infiniteugc.svc.halowaypoint.com/hi/{kind}/{id}[/versions/{ver}]) returns the AssetBase shape — PublicName, Files.{Prefix, FileRelativePaths}, AssetId, VersionId, etc.

AuthoringAsset is the authoring API response (https://authoring-infiniteugc.svc.halowaypoint.com/...) — different fields (CustomData, AssetHome, IsCurrentlyBeingEdited, ...) and no PublicName/Files.

Repro:

const c = new HaloInfiniteClient({ spartanToken });
const r = await c.ugcDiscovery.getMapWithoutVersion('e859cf75-9b8a-429a-91be-2376681c8537');
r.result.PublicName;  // TS2339 — but the runtime object has it
r.result.Files;       // TS2339 — same

Fix: change the return types to HaloApiResult<MapAsset> / HaloApiResult<GameVariantAsset> (or AssetBase).

Found while wiring grunt into filmshell's worker — the cast is contained there for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions