-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Protected audience analysis in PSAT (#811)
* Add PA analysis in service worker. Improve attach CDP function. * Add storage.interestGroupAccessed method to service worker. * Add bid value to the auction events. * Split syncCookieStore into dataStore, CookieStore and PAStore. Change its references. * Export interface from dataStore. * Change some more references. * Add protected audience provider to the devtools. * Convert bid to null. * Add last mile connection to the devtools * Add method to incorporate multiple auction ID. * Handle multiSeller auctions. Console.log data in app.tsx. * Descructure details in the extension. * Refactor service worker. Move service worker PA methods to PAStore. * Fix errors in the refactor. * Fix lint errors * Fix tests. * Move PA types to common package. * Update devtools protocol package to latest version * Move InterestGroup and auctionEvents to common package * Add support to hear globalEvents. * Add comment to explain auctionEvents structure. Refactor PA store to fix some bug when it was made to accomodate global events. * Use globalEvents instead of interestGroupEvents. * compute received Bids and noBids. * Fix noBids in the protected audience provider. * Fix nobids value. Add object diff in state update. Remove console.log. Add adUnit code to the data being provided in the bids and noBids. * Add ads and Bidders in protectedAudience API provider. * Add adUnitCode optional chaining. Fix set spread of bidders. * Fix data being displayed on the panel. * Fix data refresh on tab reload. * Reduce state updates. Refactor code move udeCallback to separate functions. * Fix error of not updating. * Fix undefined error. * Remove logic to reset interest group data on page load or navigation. * Fix failing tests. * Fix merge conflicts. * Fix failing build. * Fix failing tests * Fix initial sync override. * Fix failing tests. * Fix tab reload data refresh. --------- Co-authored-by: sayedtaqui <[email protected]>
- Loading branch information
Showing
42 changed files
with
2,047 additions
and
664 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* Copyright 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/** | ||
* External dependencies | ||
*/ | ||
import type { Protocol } from 'devtools-protocol'; | ||
|
||
export interface singleAuctionEvent { | ||
bidCurrency?: string; | ||
uniqueAuctionId?: Protocol.Storage.InterestGroupAuctionId; | ||
bid?: number; | ||
name?: string; | ||
ownerOrigin?: string; | ||
type: string; | ||
formattedTime: string | Date; | ||
componentSellerOrigin?: string; | ||
time: number; | ||
auctionConfig?: object; | ||
interestGroupConfig?: Protocol.Storage.InterestGroupAccessedEvent; | ||
parentAuctionId?: Protocol.Storage.InterestGroupAuctionId; | ||
eventType: | ||
| 'interestGroupAuctionEventOccurred' | ||
| 'interestGroupAuctionNetworkRequestCompleted' | ||
| 'interestGroupAuctionNetworkRequestCreated' | ||
| 'interestGroupAccessed'; | ||
} | ||
|
||
export interface auctionData { | ||
[uniqueAuctionId: Protocol.Storage.InterestGroupAuctionId]: { | ||
auctionTime: Protocol.Network.TimeSinceEpoch; | ||
auctionConfig?: any; | ||
parentAuctionId?: Protocol.Storage.InterestGroupAuctionId; | ||
}; | ||
} | ||
|
||
export type InterestGroups = singleAuctionEvent & { | ||
details: any; | ||
}; | ||
|
||
export type MultiSellerAuction = { | ||
[parentAuctionId: string]: { | ||
[uniqueAuctionId: string]: singleAuctionEvent[]; | ||
}; | ||
}; | ||
|
||
export type SingleSellerAuction = { | ||
[parentAuctionId: string]: singleAuctionEvent[]; | ||
}; | ||
|
||
export type NoBidsType = { | ||
[auctionId: string]: { | ||
ownerOrigin: string; | ||
name: string; | ||
uniqueAuctionId: string; | ||
adUnitCode?: string; | ||
mediaContainerSize?: number[][]; | ||
}; | ||
}; | ||
|
||
export type AdsAndBiddersType = { | ||
[adUnitCode: string]: { | ||
adUnitCode: string; | ||
bidders: string[]; | ||
mediaContainerSize: number[][]; | ||
}; | ||
}; | ||
|
||
export type ReceivedBids = singleAuctionEvent & { | ||
adUnitCode?: string; | ||
mediaContainerSize?: number[]; | ||
}; | ||
|
||
export type AuctionEventsType = SingleSellerAuction | MultiSellerAuction | null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.