Surface regulation and user agent across consent record API layers

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-07 14:59:00 +04:00
parent 806bd672ed
commit 5f4fd3c427
9 changed files with 74 additions and 26 deletions

View File

@@ -54,8 +54,8 @@ type viewResponse struct {
ConsentData string `json:"consentData"`
Action string `json:"action"`
SdkVersion string `json:"sdkVersion"`
Regulation string `json:"regulation"`
CountryCode string `json:"countryCode"`
Regulation *string `json:"regulation"`
CountryCode *string `json:"countryCode"`
CreatedAt string `json:"createdAt"`
} `json:"node"`
}
@@ -119,8 +119,12 @@ func NewCmdView(f *cmdutil.Factory) *cobra.Command {
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Visitor ID:"), v.VisitorID)
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Action:"), v.Action)
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("SDK Version:"), v.SdkVersion)
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Regulation:"), v.Regulation)
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Country Code:"), v.CountryCode)
if v.Regulation != nil {
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Regulation:"), *v.Regulation)
}
if v.CountryCode != nil {
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Country Code:"), *v.CountryCode)
}
if v.IPAddress != nil && *v.IPAddress != "" {
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("IP Address:"), *v.IPAddress)
}