Surface last_matched_at on all API surfaces
Add lastMatchedAt to the CookiePattern GraphQL type, MCP schema, CLI view/list commands, and n8n get/getAll operations. Run codegen to regenerate gqlgen models and MCP types. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -50,6 +50,7 @@ export async function execute(
|
|||||||
description
|
description
|
||||||
source
|
source
|
||||||
excluded
|
excluded
|
||||||
|
lastMatchedAt
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ export async function execute(
|
|||||||
description
|
description
|
||||||
source
|
source
|
||||||
excluded
|
excluded
|
||||||
|
lastMatchedAt
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ query($id: ID!, $first: Int, $after: CursorKey) {
|
|||||||
displayName
|
displayName
|
||||||
source
|
source
|
||||||
excluded
|
excluded
|
||||||
|
lastMatchedAt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pageInfo {
|
pageInfo {
|
||||||
@@ -57,6 +58,7 @@ type cookiePattern struct {
|
|||||||
DisplayName string `json:"displayName"`
|
DisplayName string `json:"displayName"`
|
||||||
Source string `json:"source"`
|
Source string `json:"source"`
|
||||||
Excluded bool `json:"excluded"`
|
Excluded bool `json:"excluded"`
|
||||||
|
LastMatchedAt *string `json:"lastMatchedAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||||
@@ -139,10 +141,14 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
|||||||
if p.Excluded {
|
if p.Excluded {
|
||||||
excluded = "yes"
|
excluded = "yes"
|
||||||
}
|
}
|
||||||
rows = append(rows, []string{p.ID, p.Pattern, p.MatchType, p.DisplayName, p.Source, excluded})
|
lastMatched := ""
|
||||||
|
if p.LastMatchedAt != nil {
|
||||||
|
lastMatched = cmdutil.FormatTime(*p.LastMatchedAt)
|
||||||
|
}
|
||||||
|
rows = append(rows, []string{p.ID, p.Pattern, p.MatchType, p.DisplayName, p.Source, excluded, lastMatched})
|
||||||
}
|
}
|
||||||
|
|
||||||
t := cmdutil.NewTable("ID", "PATTERN", "MATCH TYPE", "DISPLAY NAME", "SOURCE", "EXCLUDED").Rows(rows...)
|
t := cmdutil.NewTable("ID", "PATTERN", "MATCH TYPE", "DISPLAY NAME", "SOURCE", "EXCLUDED", "LAST MATCHED").Rows(rows...)
|
||||||
_, _ = fmt.Fprintln(f.IOStreams.Out, t)
|
_, _ = fmt.Fprintln(f.IOStreams.Out, t)
|
||||||
|
|
||||||
if totalCount > len(patterns) {
|
if totalCount > len(patterns) {
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ query($id: ID!) {
|
|||||||
description
|
description
|
||||||
source
|
source
|
||||||
excluded
|
excluded
|
||||||
|
lastMatchedAt
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
}
|
}
|
||||||
@@ -55,6 +56,7 @@ type viewResponse struct {
|
|||||||
Description *string `json:"description"`
|
Description *string `json:"description"`
|
||||||
Source string `json:"source"`
|
Source string `json:"source"`
|
||||||
Excluded bool `json:"excluded"`
|
Excluded bool `json:"excluded"`
|
||||||
|
LastMatchedAt *string `json:"lastMatchedAt"`
|
||||||
CreatedAt string `json:"createdAt"`
|
CreatedAt string `json:"createdAt"`
|
||||||
UpdatedAt string `json:"updatedAt"`
|
UpdatedAt string `json:"updatedAt"`
|
||||||
} `json:"node"`
|
} `json:"node"`
|
||||||
@@ -126,6 +128,9 @@ func NewCmdView(f *cmdutil.Factory) *cobra.Command {
|
|||||||
if v.Description != nil && *v.Description != "" {
|
if v.Description != nil && *v.Description != "" {
|
||||||
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Description:"), *v.Description)
|
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Description:"), *v.Description)
|
||||||
}
|
}
|
||||||
|
if v.LastMatchedAt != nil {
|
||||||
|
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Last Matched:"), cmdutil.FormatTime(*v.LastMatchedAt))
|
||||||
|
}
|
||||||
_, _ = fmt.Fprintln(out)
|
_, _ = fmt.Fprintln(out)
|
||||||
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Created:"), cmdutil.FormatTime(v.CreatedAt))
|
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Created:"), cmdutil.FormatTime(v.CreatedAt))
|
||||||
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Updated:"), cmdutil.FormatTime(v.UpdatedAt))
|
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Updated:"), cmdutil.FormatTime(v.UpdatedAt))
|
||||||
|
|||||||
@@ -205,6 +205,7 @@ type CookiePattern implements Node {
|
|||||||
source: CookieSource!
|
source: CookieSource!
|
||||||
excluded: Boolean!
|
excluded: Boolean!
|
||||||
cookieCount: Int! @goField(forceResolver: true)
|
cookieCount: Int! @goField(forceResolver: true)
|
||||||
|
lastMatchedAt: Datetime
|
||||||
createdAt: Datetime!
|
createdAt: Datetime!
|
||||||
updatedAt: Datetime!
|
updatedAt: Datetime!
|
||||||
|
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ func NewCookiePattern(cp *coredata.CookiePattern) *CookiePattern {
|
|||||||
Description: cp.Description,
|
Description: cp.Description,
|
||||||
Source: cp.Source,
|
Source: cp.Source,
|
||||||
Excluded: cp.Excluded,
|
Excluded: cp.Excluded,
|
||||||
|
LastMatchedAt: cp.LastMatchedAt,
|
||||||
CreatedAt: cp.CreatedAt,
|
CreatedAt: cp.CreatedAt,
|
||||||
UpdatedAt: cp.UpdatedAt,
|
UpdatedAt: cp.UpdatedAt,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9185,6 +9185,12 @@ components:
|
|||||||
excluded:
|
excluded:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: Whether this pattern is excluded from the consent banner
|
description: Whether this pattern is excluded from the consent banner
|
||||||
|
last_matched_at:
|
||||||
|
type:
|
||||||
|
- string
|
||||||
|
- "null"
|
||||||
|
format: date-time
|
||||||
|
description: Timestamp when a cookie last matched this pattern
|
||||||
created_at:
|
created_at:
|
||||||
type: string
|
type: string
|
||||||
format: date-time
|
format: date-time
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ func NewCookiePattern(p *coredata.CookiePattern) *CookiePattern {
|
|||||||
Description: p.Description,
|
Description: p.Description,
|
||||||
Source: CookiePatternSource(p.Source),
|
Source: CookiePatternSource(p.Source),
|
||||||
Excluded: p.Excluded,
|
Excluded: p.Excluded,
|
||||||
|
LastMatchedAt: p.LastMatchedAt,
|
||||||
CreatedAt: p.CreatedAt,
|
CreatedAt: p.CreatedAt,
|
||||||
UpdatedAt: p.UpdatedAt,
|
UpdatedAt: p.UpdatedAt,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user