import { EVENTS } from '../../src/constants.js'; import type { Identifier, BidderCode } from '../../src/types/common.d.ts'; import type { Metrics } from "../../src/utils/perfMetrics.ts"; import type { ORTBResponse } from "../../src/types/ortb/response.d.ts"; import type { NativeRequest } from '../../src/types/ortb/native.d.ts'; import type { SyncType } from "../../src/userSync.ts"; type Endpoint = string | { /** * Defines the auction endpoint or the cookie_sync endpoint for the Prebid Server cluster for non-consent requests or users who grant consent. */ p1Consent: string; /** * Defines the auction endpoint or the cookie_sync endpoint for the Prebid Server cluster for users who do not grant consent. * (This is useful for a server configured to not accept any cookies to ensure compliance regulations.) */ noP1Consent: string; }; type S2SConfig = { /** * Your Prebid Server account ID. This is obtained from whoever’s hosting your Prebid Server. */ accountId: string; /** * A handle for this configuration, used to reference a specific server (when multiple are present) from ad unit configuration */ name?: string; /** * Which bidders auctions should take place on the server side */ bidders?: BidderCode[]; /** * Allow Prebid Server to bid on behalf of bidders that are not explicitly listed in the adUnit. * Defaults to false. */ allowUnknownBidderCodes?: boolean; /** * Enables this s2sConfig block - defaults to false */ enabled?: boolean; /** * Number of milliseconds allowed for the server-side auctions. * This should be approximately 200ms-300ms less than your Prebid.js timeout to allow for all bids to be returned * in a timely manner. Defaults to 75% of bidderTimeout or `maxTimeout`, whichever is lesser. */ timeout?: number; /** * Upper limit on the default timeout. Defaults to 1500. */ maxTimeout?: number; /** * Adapter to use to connect to Prebid Server. Defaults to ‘prebidServer’ */ adapter?: string; /** * Defines the auction endpoint for the Prebid Server cluster. */ endpoint: Endpoint; /** * Defines the cookie_sync endpoint for the Prebid Server cluster. */ syncEndpoint: Endpoint; /** * Max number of userSync URLs that can be executed by Prebid Server cookie_sync per request. * If not defined, PBS will execute all userSync URLs included in the request. */ userSyncLimit?: number; /** * Maximum number of milliseconds allowed for each server-side userSync to load. Default is 1000. */ syncTimeout?: number; /** * Functions to modify a bidder’s sync url before the actual call to the sync endpoint. * Bidder must be enabled for s2sConfig. */ syncUrlModifier?: { [bidder: BidderCode]: (type: SyncType, url: string, bidder: BidderCode) => string; }; /** * Whether or not PBS is allowed to perform “cooperative syncing” for bidders not on this page. * Publishers help each other improve match rates by allowing this. Default is true. */ coopSync?: boolean; /** * Configures the default TTL in the Prebid Server adapter to use when Prebid Server does not return a bid TTL. * Defaults to 60. */ defaultTTL?: number; /** * Arguments will be added to resulting OpenRTB payload to Prebid Server in every impression object at request.imp[].ext.BIDDER */ adapterOptions?: { [bidder: BidderCode]: Record; }; /** * Arguments will be added to resulting OpenRTB payload to Prebid Server in request.ext.prebid. */ extPrebid?: Record; /** * Base value for imp.native.request */ ortbNative?: Partial; /** * If true, enable gzip compression of outgoing requests. */ endpointCompression?: boolean; /** * If true, exclude ad units that have no bidders defined. */ filterBidderlessCalls?: boolean; }; export declare const s2sDefaultConfig: Partial; declare module '../../src/config' { interface Config { s2sConfig?: S2SConfig | S2SConfig[]; } } export declare function validateConfig(options: S2SConfig[]): S2SConfig[]; /** * resets the _synced variable back to false, primiarily used for testing purposes */ export declare function resetSyncedStatus(): void; export type SeatNonBid = { /** * Auction ID associated with the PBS response. */ auctionId: Identifier; /** * The PBS response's `ext.seatnonbid`. */ seatnonbid: unknown; /** * Bidders that were included in the request to PBS. */ requestedBidders: BidderCode[]; /** * PBS response data. */ response: ORTBResponse; adapterMetrics: Metrics; }; export type PbsAnalytics = SeatNonBid & { /** * The PBS response's `ext.prebid.analytics.tags`. */ atag: unknown; }; declare module '../../src/events' { interface Events { [EVENTS.SEAT_NON_BID]: [SeatNonBid]; [EVENTS.PBS_ANALYTICS]: [PbsAnalytics]; [EVENTS.BEFORE_PBS_HTTP]: [PbsRequestData]; } } /** * Bidder adapter for Prebid Server */ export declare function PrebidServer(): void; type PbsRequestData = { endpointUrl: string; requestJson: string; customHeaders: Record; }; /** * Build and send the appropriate HTTP request over the network, then interpret the response. * @param s2sBidRequest * @param bidRequests * @param ajax * @param onResponse {function(boolean, Array[String])} invoked on a successful HTTP response - with a flag indicating whether it was successful, * and a list of the unique bidder codes that were sent in the request * @param onError {function(String, {})} invoked on HTTP failure - with status message and XHR error * @param onBid {function({})} invoked once for each bid in the response - with the bid as returned by interpretResponse */ export declare const processPBSRequest: import("../../src/hook.js").Hookable<"async", (s2sBidRequest: any, bidRequests: any, ajax: any, { onResponse, onError, onBid, onFledge }: any) => void>; export {};