Skip to content
This repository was archived by the owner on Jul 13, 2025. It is now read-only.
This repository was archived by the owner on Jul 13, 2025. It is now read-only.

Better Report return Params.  #642

@kingkong404

Description

@kingkong404

Is there a way to get better type support based on requested params on a report .

BaseReportOperation.downloadReport<string>(reportId: string): Promise<Partial<Record<string, "string" | "number">>[]>

So that if the following params were used the report type would come back as an array of objects with the keys used in params.

    const params: SponsoredProductsReportParams = {
      recordType: "keywords",
      metrics: [
        "adGroupId",
        "adGroupName",
        "campaignId",
        "campaignName",
        "clicks",
        "cost",
        "impressions",
        "keywordId",
        "keywordText",
        "matchType",
        "attributedSales1d",
        "attributedUnitsOrdered1d",
      ],
      reportDate: amazonDate.toString(),
    };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions