Skip to content

Commit

Permalink
Merge branch 'main' into sabrina/tds-override
Browse files Browse the repository at this point in the history
  • Loading branch information
SabrinaTardio committed Jan 15, 2025
2 parents 0212797 + 3cedd46 commit 934a56d
Show file tree
Hide file tree
Showing 20 changed files with 868 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"branch" : "sabrina/tds-override",
"revision" : "70f5a0a29d3a5909def923702ed071778a72040d"
"revision" : "13f1c270f0392b6b7b970e69380f1f901d408393"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/DataBrokerProtection/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let package = Package(
targets: ["DataBrokerProtection"])
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "224.6.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "224.6.1"),
.package(path: "../SwiftUIExtensions"),
.package(path: "../AppKitExtensions"),
.package(path: "../XPCHelper"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,73 @@

import Foundation

struct Condition: Codable, Sendable {
let left: String
let operation: String
let right: String
}

struct Choice: Codable, Sendable {
let condition: Condition
let elements: [PageElement]
}

struct ClickAction: Action {
let id: String
let actionType: ActionType
let elements: [PageElement]
let elements: [PageElement]?
let dataSource: DataSource?
let choices: [Choice]?
let `default`: Default?

let hasDefault: Bool

struct Default: Codable {
let elements: [PageElement]?
}

init(id: String, actionType: ActionType, elements: [PageElement]? = nil, dataSource: DataSource? = nil, choices: [Choice]? = nil, `default`: Default? = nil, hasDefault: Bool = false) {
self.id = id
self.actionType = actionType
self.elements = elements
self.dataSource = dataSource
self.choices = choices
self.default = `default`
self.hasDefault = `default` != nil
}

init(from decoder: any Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.id = try container.decode(String.self, forKey: .id)
self.actionType = try container.decode(ActionType.self, forKey: .actionType)
self.elements = try container.decodeIfPresent([PageElement].self, forKey: .elements)
self.dataSource = try container.decodeIfPresent(DataSource.self, forKey: .dataSource)
self.choices = try container.decodeIfPresent([Choice].self, forKey: .choices)
self.default = try container.decodeIfPresent(Default.self, forKey: .default)
self.hasDefault = container.contains(.default)
}

enum CodingKeys: String, CodingKey {
case id
case actionType
case elements
case dataSource
case choices
case `default`
}

func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.id, forKey: .id)
try container.encode(self.actionType, forKey: .actionType)
try container.encodeIfPresent(self.elements, forKey: .elements)
try container.encodeIfPresent(self.dataSource, forKey: .dataSource)
try container.encodeIfPresent(self.choices, forKey: .choices)

if self.hasDefault {
try container.encode(self.default, forKey: .default)
} else {
try container.encodeNil(forKey: .default)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "backgroundcheck.run",
"url": "backgroundcheck.run",
"version": "0.4.0",
"parent": "verecor.com",
"version": "0.5.0",
"addedDatetime": 1677736800000,
"optOutUrl": "https://backgroundcheck.run/ng/control/privacy",
"steps": [
Expand Down Expand Up @@ -51,8 +50,70 @@
},
{
"stepType": "optOut",
"optOutType": "parentSiteOptOut",
"actions": []
"optOutType": "formOptOut",
"actions": [
{
"actionType": "navigate",
"url": "https://backgroundcheck.run/ng/control/privacy",
"id": "fa29793c-3f85-4f01-a5fe-4ffcc26c197c"
},
{
"actionType": "fillForm",
"selector": ".ahm",
"elements": [
{
"type": "fullName",
"selector": "#name"
},
{
"type": "email",
"selector": "#email"
},
{
"type": "profileUrl",
"selector": "#url"
}
],
"id": "71be571c-ce0c-43cb-afad-ae6547d44726"
},
{
"actionType": "click",
"elements": [
{
"type": "button",
"selector": ".//button[@type='submit']"
}
],
"id": "e8794659-162d-4de7-9845-bbd140c54a00"
},
{
"actionType": "expectation",
"expectations": [
{
"type": "text",
"selector": "body",
"expect": "Your removal request has been received"
}
],
"id": "6ab596e2-3642-4dba-97f0-1270d8feefd1"
},
{
"actionType": "emailConfirmation",
"pollingTime": 30,
"id": "9431f4e4-140a-4ade-8e74-3b7917b6ab2b"
},
{
"actionType": "expectation",
"expectations": [
{
"type": "text",
"selector": "body",
"expect": "Your information control request has been confirmed."
}
],
"id": "92e1c4ff-4466-42e7-b2dd-70a319af48da"
}
]
}
],
"schedulingConfig": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "Clubset",
"url": "clubset.com",
"version": "0.4.0",
"parent": "verecor.com",
"version": "0.5.0",
"addedDatetime": 1702965600000,
"optOutUrl": "https://clubset.com/private/control/privacy",
"steps": [
Expand Down Expand Up @@ -63,8 +62,80 @@
},
{
"stepType": "optOut",
"optOutType": "parentSiteOptOut",
"actions": []
"optOutType": "formOptOut",
"actions": [
{
"actionType": "navigate",
"url": "https://clubset.com/private/control/privacy",
"id": "87fb7e0b-87ea-413d-847a-e88b3d023776"
},
{
"actionType": "fillForm",
"selector": ".ahm",
"elements": [
{
"type": "fullName",
"selector": "#user_name"
},
{
"type": "email",
"selector": "#user_email"
},
{
"type": "profileUrl",
"selector": "#url"
}
],
"id": "48c3acd8-61fc-4680-9811-77dc5ba9c9a6"
},
{
"actionType": "getCaptchaInfo",
"selector": ".g-recaptcha",
"id": "47d8cf16-354f-4359-ac37-05c617d5f03e"
},
{
"actionType": "solveCaptcha",
"selector": ".g-recaptcha",
"id": "eb5e43df-d4dd-45e8-8192-bfcb3e814ed5"
},
{
"actionType": "click",
"elements": [
{
"type": "button",
"selector": ".//button[@type='submit']"
}
],
"id": "2521002e-f825-4a93-aa6e-966f499096d1"
},
{
"actionType": "expectation",
"expectations": [
{
"type": "text",
"selector": "body",
"expect": "Your removal request has been received"
}
],
"id": "f72634ca-60c3-450f-9656-52d924d8361f"
},
{
"actionType": "emailConfirmation",
"pollingTime": 30,
"id": "075640a6-f010-4135-9b46-25655e5eadd1"
},
{
"actionType": "expectation",
"expectations": [
{
"type": "text",
"selector": "body",
"expect": "Your information control request has been confirmed."
}
],
"id": "96a083a1-f84b-42df-89bd-b5d0601468b2"
}
]
}
],
"schedulingConfig": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "Councilon",
"url": "councilon.com",
"version": "0.4.0",
"parent": "verecor.com",
"version": "0.5.0",
"addedDatetime": 1702965600000,
"optOutUrl": "https://councilon.com/ex/control/privacy",
"steps": [
Expand Down Expand Up @@ -63,8 +62,80 @@
},
{
"stepType": "optOut",
"optOutType": "parentSiteOptOut",
"actions": []
"optOutType": "formOptOut",
"actions": [
{
"actionType": "navigate",
"url": "https://councilon.com/ex/control/privacy",
"id": "9f4ef020-811e-4d02-8622-ebe7a714a0d0"
},
{
"actionType": "fillForm",
"selector": ".ahm",
"elements": [
{
"type": "fullName",
"selector": "#user_name"
},
{
"type": "email",
"selector": "#user_email"
},
{
"type": "profileUrl",
"selector": "#url"
}
],
"id": "8e7adf0a-58fb-4e57-b3b3-79cd99eeb395"
},
{
"actionType": "getCaptchaInfo",
"selector": ".g-recaptcha",
"id": "c80c3e5c-fa66-45c8-816b-bb320a247777"
},
{
"actionType": "solveCaptcha",
"selector": ".g-recaptcha",
"id": "30cfa92e-627c-4b00-9fd1-032952338468"
},
{
"actionType": "click",
"elements": [
{
"type": "button",
"selector": ".//button[@type='submit']"
}
],
"id": "1d3fe64a-d23d-448c-bf34-aeccf32beb87"
},
{
"actionType": "expectation",
"expectations": [
{
"type": "text",
"selector": "body",
"expect": "Your removal request has been received"
}
],
"id": "e6840eae-b334-431d-bbb8-94189e09023d"
},
{
"actionType": "emailConfirmation",
"pollingTime": 30,
"id": "8983034c-211a-4d98-8f31-bdf28a4e5011"
},
{
"actionType": "expectation",
"expectations": [
{
"type": "text",
"selector": "body",
"expect": "Your information control request has been confirmed."
}
],
"id": "ffb143e1-a408-456b-9e27-d5b199cd0b52"
}
]
}
],
"schedulingConfig": {
Expand Down
Loading

0 comments on commit 934a56d

Please sign in to comment.