chromium/third_party/blink/renderer/modules/ad_auction/auction_ad_config.idl

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Configuration that is passed to navigator.runAdAuction().
// https://github.com/WICG/turtledove/blob/main/FLEDGE.md#21-initiating-an-on-device-auction

// USVString is used instead of the enum type, since enums don't allow unknown
// values, making forward compatibility difficult.
// See https://github.com/whatwg/webidl/issues/893

dictionary AuctionReportBuyersConfig {
  required bigint bucket;
  required double scale;
};

dictionary AuctionAdditionalBidSignature {
  Uint8Array key;
  Uint8Array signature;
};

dictionary ProtectedAudiencePrivateAggregationConfig {
  USVString aggregationCoordinatorOrigin;
};

dictionary AuctionReportBuyerDebugModeConfig {
  boolean enabled = false;

  // Must only be provided if `enabled` is true.
  bigint? debugKey;
};

dictionary AuctionRealTimeReportingConfig {
  required DOMString type;
};

dictionary AuctionAdConfig {
  required USVString seller;

  // Used for B&A auctions. If present we only look at the seller and
  // interestGroupBuyers.
  Promise<Uint8Array> serverResponse;
  USVString requestId;

  USVString decisionLogicURL;
  [ImplementedAs=decisionLogicUrlDeprecated]
  USVString decisionLogicUrl;
  USVString trustedScoringSignalsURL;
  [ImplementedAs=trustedScoringSignalsUrlDeprecated]
  USVString trustedScoringSignalsUrl;
  long maxTrustedScoringSignalsURLLength;
  [RuntimeEnabled=FledgeTrustedSignalsKVv2Support]
  USVString trustedScoringSignalsCoordinator;
  sequence<USVString> interestGroupBuyers;
  Promise<any> auctionSignals;
  Promise<any> sellerSignals;

  Promise<USVString> directFromSellerSignals;
  [RuntimeEnabled=FledgeDirectFromSellerSignalsHeaderAdSlot]
  Promise<DOMString> directFromSellerSignalsHeaderAdSlot;

  [RuntimeEnabled=FledgeDeprecatedRenderURLReplacements]
  Promise<record<USVString, USVString>> deprecatedRenderURLReplacements;

  unsigned long long sellerTimeout;
  unsigned short sellerExperimentGroupId;

  Promise<record<USVString, any>> perBuyerSignals;
  Promise<record<USVString, unsigned long long>> perBuyerTimeouts;
  Promise<record<USVString, unsigned long long>> perBuyerCumulativeTimeouts;

  [RuntimeEnabled=FledgeReportingTimeout]
  unsigned long long reportingTimeout;

  USVString sellerCurrency;
  Promise<record<USVString, USVString>> perBuyerCurrencies;

  record<USVString, unsigned short> perBuyerGroupLimits;
  record<USVString, unsigned short> perBuyerExperimentGroupIds;
  record<USVString, record<USVString, double>> perBuyerPrioritySignals;

  [RuntimeEnabled=FledgeMultiBid]
  record<USVString, unsigned short> perBuyerMultiBidLimits;

  // `auctionReportBuyerKeys`, `auctionReportBuyers`, and
  // `requiredSellerCapabilities` are described in:
  // https://github.com/WICG/turtledove/blob/main/FLEDGE_extended_PA_reporting.md
  sequence<bigint> auctionReportBuyerKeys;
  record<DOMString, AuctionReportBuyersConfig> auctionReportBuyers;
  [RuntimeEnabled=PrivateAggregationAuctionReportBuyerDebugModeConfig]
  AuctionReportBuyerDebugModeConfig auctionReportBuyerDebugModeConfig;
  sequence<DOMString> requiredSellerCapabilities;

  AuctionAdInterestGroupSize requestedSize;
  sequence<AuctionAdInterestGroupSize> allSlotsRequestedSizes;

  Promise<undefined> additionalBids;

  DOMString auctionNonce;

  ProtectedAudiencePrivateAggregationConfig privateAggregationConfig;

  [RuntimeEnabled=FledgeRealTimeReporting]
  AuctionRealTimeReportingConfig sellerRealTimeReportingConfig;
  [RuntimeEnabled=FledgeRealTimeReporting]
  record<USVString, AuctionRealTimeReportingConfig> perBuyerRealTimeReportingConfig;

  sequence<AuctionAdConfig> componentAuctions;
  AbortSignal? signal;

  Promise<boolean> resolveToConfig;
};