Add trackerType to GraphQL schema and detection UI

- Add TrackerType enum to GraphQL schema with all 6 values
- Add trackerType field to CookiePattern type (nullable source)
- Add optional trackerType to CreateCookiePatternInput
- Add Type column to detection page table
- Add NewTrackerPattern helper in types package
- Regenerate gqlgen + Relay artifacts

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-05 15:54:42 +04:00
parent 2275558d82
commit c853d59fe5
4 changed files with 81 additions and 4 deletions

View File

@@ -34,6 +34,34 @@ enum CookieSource
)
}
enum TrackerType
@goModel(model: "go.probo.inc/probo/pkg/coredata.TrackerType") {
COOKIE
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeCookie"
)
LOCAL_STORAGE
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeLocalStorage"
)
SESSION_STORAGE
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeSessionStorage"
)
INDEXED_DB
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeIndexedDB"
)
SCRIPT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeScript"
)
IFRAME
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeIframe"
)
}
enum CookieBannerOrderField
@goModel(
model: "go.probo.inc/probo/pkg/coredata.CookieBannerOrderField"
@@ -227,12 +255,13 @@ input CookiePatternFilter {
type CookiePattern implements Node {
id: ID!
cookieCategory: CookieCategory @goField(forceResolver: true)
trackerType: TrackerType!
pattern: String!
matchType: CookiePatternMatchType!
displayName: String!
maxAgeSeconds: Int
description: String!
source: CookieSource!
source: CookieSource
excluded: Boolean!
cookieCount: Int! @goField(forceResolver: true)
lastMatchedAt: Datetime
@@ -463,6 +492,7 @@ type ReorderCookieCategoryPayload {
input CreateCookiePatternInput {
cookieCategoryId: ID!
trackerType: TrackerType
pattern: String!
matchType: CookiePatternMatchType!
displayName: String!

View File

@@ -81,15 +81,39 @@ func NewCookiePattern(cp *coredata.CookiePattern) *CookiePattern {
ID: cp.CookieBannerID,
},
},
TrackerType: coredata.TrackerTypeCookie,
Pattern: cp.Pattern,
MatchType: cp.MatchType,
DisplayName: cp.DisplayName,
MaxAgeSeconds: cp.MaxAgeSeconds,
Description: cp.Description,
Source: cp.Source,
Source: &cp.Source,
Excluded: cp.Excluded,
LastMatchedAt: cp.LastMatchedAt,
CreatedAt: cp.CreatedAt,
UpdatedAt: cp.UpdatedAt,
}
}
func NewTrackerPattern(tp *coredata.TrackerPattern) *CookiePattern {
return &CookiePattern{
ID: tp.ID,
CookieCategory: &CookieCategory{
ID: tp.CookieCategoryID,
CookieBanner: &CookieBanner{
ID: tp.CookieBannerID,
},
},
TrackerType: tp.TrackerType,
Pattern: tp.Pattern,
MatchType: tp.MatchType,
DisplayName: tp.DisplayName,
MaxAgeSeconds: tp.MaxAgeSeconds,
Description: tp.Description,
Source: tp.Source,
Excluded: tp.Excluded,
LastMatchedAt: tp.LastMatchedAt,
CreatedAt: tp.CreatedAt,
UpdatedAt: tp.UpdatedAt,
}
}