diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/consent-records/CookieBannerConsentRecordPage.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/consent-records/CookieBannerConsentRecordPage.tsx index 1aa7cdd7b..e0b574ee2 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/consent-records/CookieBannerConsentRecordPage.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/consent-records/CookieBannerConsentRecordPage.tsx @@ -58,6 +58,7 @@ export const cookieBannerConsentRecordPageQuery = graphql` userAgent sdkVersion regulation + countryCode consentData createdAt } @@ -158,6 +159,11 @@ export default function CookieBannerConsentRecordPage({ {record.regulation || "-"} + + + {record.countryCode || "-"} + + {formatDate(record.createdAt)} diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/consent-records/CookieBannerConsentRecordsPage.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/consent-records/CookieBannerConsentRecordsPage.tsx index 029c37418..8a7693c4f 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/consent-records/CookieBannerConsentRecordsPage.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/consent-records/CookieBannerConsentRecordsPage.tsx @@ -217,6 +217,7 @@ export default function CookieBannerConsentRecordsPage({ {__("IP Address")} {__("SDK Version")} {__("Regulation")} + {__("Country")} {__("Date")} diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/consent-records/_components/ConsentRecordRow.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/consent-records/_components/ConsentRecordRow.tsx index 6399156e3..9034fd98d 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/consent-records/_components/ConsentRecordRow.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/consent-records/_components/ConsentRecordRow.tsx @@ -36,6 +36,7 @@ const consentRecordFragment = graphql` ipAddress sdkVersion regulation + countryCode createdAt } `; @@ -80,6 +81,11 @@ export function ConsentRecordRow({ recordKey }: ConsentRecordRowProps) { {record.regulation || "-"} + + + {record.countryCode || "-"} + + {formatDate(record.createdAt)} diff --git a/packages/n8n-node/nodes/Probo/actions/cookieConsentRecord/get.operation.ts b/packages/n8n-node/nodes/Probo/actions/cookieConsentRecord/get.operation.ts index cc5ecdced..38cd2cb58 100644 --- a/packages/n8n-node/nodes/Probo/actions/cookieConsentRecord/get.operation.ts +++ b/packages/n8n-node/nodes/Probo/actions/cookieConsentRecord/get.operation.ts @@ -49,6 +49,8 @@ export async function execute( consentData action sdkVersion + regulation + countryCode createdAt } } diff --git a/packages/n8n-node/nodes/Probo/actions/cookieConsentRecord/getAll.operation.ts b/packages/n8n-node/nodes/Probo/actions/cookieConsentRecord/getAll.operation.ts index 20442206e..9e78619bb 100644 --- a/packages/n8n-node/nodes/Probo/actions/cookieConsentRecord/getAll.operation.ts +++ b/packages/n8n-node/nodes/Probo/actions/cookieConsentRecord/getAll.operation.ts @@ -152,6 +152,8 @@ export async function execute( consentData action sdkVersion + regulation + countryCode createdAt } } diff --git a/pkg/cmd/consent-record/list/list.go b/pkg/cmd/consent-record/list/list.go index d88f7df74..eb490d856 100644 --- a/pkg/cmd/consent-record/list/list.go +++ b/pkg/cmd/consent-record/list/list.go @@ -36,6 +36,8 @@ query($id: ID!, $first: Int, $after: CursorKey, $filter: CookieConsentRecordFilt visitorId action sdkVersion + regulation + countryCode createdAt } } @@ -50,11 +52,13 @@ query($id: ID!, $first: Int, $after: CursorKey, $filter: CookieConsentRecordFilt ` type consentRecord struct { - ID string `json:"id"` - VisitorID string `json:"visitorId"` - Action string `json:"action"` - SDKVersion string `json:"sdkVersion"` - CreatedAt string `json:"createdAt"` + ID string `json:"id"` + VisitorID string `json:"visitorId"` + Action string `json:"action"` + SDKVersion string `json:"sdkVersion"` + Regulation string `json:"regulation"` + CountryCode string `json:"countryCode"` + CreatedAt string `json:"createdAt"` } func NewCmdList(f *cmdutil.Factory) *cobra.Command { @@ -150,10 +154,10 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command { rows := make([][]string, 0, len(records)) for _, r := range records { - rows = append(rows, []string{r.ID, r.VisitorID, r.Action, r.SDKVersion, r.CreatedAt}) + rows = append(rows, []string{r.ID, r.VisitorID, r.Action, r.SDKVersion, r.Regulation, r.CountryCode, r.CreatedAt}) } - t := cmdutil.NewTable("ID", "VISITOR ID", "ACTION", "SDK VERSION", "CREATED AT").Rows(rows...) + t := cmdutil.NewTable("ID", "VISITOR ID", "ACTION", "SDK VERSION", "REGULATION", "COUNTRY", "CREATED AT").Rows(rows...) _, _ = fmt.Fprintln(f.IOStreams.Out, t) if totalCount > len(records) { diff --git a/pkg/cmd/consent-record/view/view.go b/pkg/cmd/consent-record/view/view.go index b17517d75..2b24b0622 100644 --- a/pkg/cmd/consent-record/view/view.go +++ b/pkg/cmd/consent-record/view/view.go @@ -36,6 +36,8 @@ query($id: ID!) { consentData action sdkVersion + regulation + countryCode createdAt } } @@ -52,6 +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"` CreatedAt string `json:"createdAt"` } `json:"node"` } @@ -115,6 +119,8 @@ 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.IPAddress != nil && *v.IPAddress != "" { _, _ = fmt.Fprintf(out, "%s%s\n", label.Render("IP Address:"), *v.IPAddress) } diff --git a/pkg/server/api/console/v1/graphql/cookie_consent_record.graphql b/pkg/server/api/console/v1/graphql/cookie_consent_record.graphql index 11b584c29..6b82bdd2f 100644 --- a/pkg/server/api/console/v1/graphql/cookie_consent_record.graphql +++ b/pkg/server/api/console/v1/graphql/cookie_consent_record.graphql @@ -32,6 +32,70 @@ enum CookieConsentAction ) } +enum Regulation + @goModel(model: "go.probo.inc/probo/pkg/coredata.Regulation") { + NONE + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationNone" + ) + GDPR + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationGDPR" + ) + UK_GDPR + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationUKGDPR" + ) + FADP + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationFADP" + ) + CCPA + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationCCPA" + ) + PIPEDA + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationPIPEDA" + ) + LGPD + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationLGPD" + ) + LFPDPPP + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationLFPDPPP" + ) + POPIA + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationPOPIA" + ) + PDPA + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationPDPA" + ) + PIPL + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationPIPL" + ) + PIPA + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationPIPA" + ) + APPI + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationAPPI" + ) + DPDP + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationDPDP" + ) + PDPL + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.RegulationPDPL" + ) +} + enum CookieConsentRecordOrderField @goModel( model: "go.probo.inc/probo/pkg/coredata.CookieConsentRecordOrderField" @@ -66,7 +130,8 @@ type CookieConsentRecord implements Node { consentData: String! action: CookieConsentAction! sdkVersion: String! - regulation: String! + regulation: Regulation! + countryCode: CountryCode! createdAt: Datetime! } diff --git a/pkg/server/api/console/v1/types/cookie_consent_record.go b/pkg/server/api/console/v1/types/cookie_consent_record.go index 8dc0170a5..030feeb4b 100644 --- a/pkg/server/api/console/v1/types/cookie_consent_record.go +++ b/pkg/server/api/console/v1/types/cookie_consent_record.go @@ -81,7 +81,8 @@ func NewCookieConsentRecord(r *coredata.CookieConsentRecord) *CookieConsentRecor ConsentData: string(r.ConsentData), Action: r.Action, SdkVersion: r.SdkVersion, - Regulation: r.Regulation.String(), + Regulation: r.Regulation, + CountryCode: r.CountryCode, CreatedAt: r.CreatedAt, } } diff --git a/pkg/server/api/mcp/v1/specification.yaml b/pkg/server/api/mcp/v1/specification.yaml index 97a108c79..8419874b6 100644 --- a/pkg/server/api/mcp/v1/specification.yaml +++ b/pkg/server/api/mcp/v1/specification.yaml @@ -187,6 +187,280 @@ components: - INACTIVE go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.ProfileState + Regulation: + type: string + enum: + - NONE + - GDPR + - UK_GDPR + - FADP + - CCPA + - PIPEDA + - LGPD + - LFPDPPP + - POPIA + - PDPA + - PIPL + - PIPA + - APPI + - DPDP + - PDPL + go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.Regulation + + CountryCode: + type: string + enum: + - AD + - AE + - AF + - AG + - AI + - AL + - AM + - AO + - AQ + - AR + - AS + - AT + - AU + - AW + - AX + - AZ + - BA + - BB + - BD + - BE + - BF + - BG + - BH + - BI + - BJ + - BL + - BM + - BN + - BO + - BQ + - BR + - BS + - BT + - BV + - BW + - BY + - BZ + - CA + - CC + - CD + - CF + - CG + - CH + - CI + - CK + - CL + - CM + - CN + - CO + - CR + - CU + - CV + - CW + - CX + - CY + - CZ + - DE + - DJ + - DK + - DM + - DO + - DZ + - EC + - EE + - EG + - EH + - ER + - ES + - ET + - EU + - FI + - FJ + - FK + - FM + - FO + - FR + - GA + - GB + - GD + - GE + - GF + - GG + - GH + - GI + - GL + - GM + - GN + - GP + - GQ + - GR + - GT + - GU + - GW + - GY + - HK + - HM + - HN + - HR + - HT + - HU + - ID + - IE + - IL + - IM + - IN + - IO + - IQ + - IR + - IS + - IT + - JE + - JM + - JO + - JP + - KE + - KG + - KH + - KI + - KM + - KN + - KP + - KR + - KW + - KY + - KZ + - LA + - LB + - LC + - LI + - LK + - LR + - LS + - LT + - LU + - LV + - LY + - MA + - MC + - MD + - ME + - MF + - MG + - MH + - MK + - ML + - MM + - MN + - MO + - MP + - MQ + - MR + - MS + - MT + - MU + - MV + - MW + - MX + - MY + - MZ + - NA + - NC + - NE + - NF + - NG + - NI + - NL + - NO + - NP + - NR + - NU + - NZ + - OM + - PA + - PE + - PF + - PG + - PH + - PK + - PL + - PM + - PN + - PR + - PS + - PT + - PW + - PY + - QA + - RE + - RO + - RS + - RU + - RW + - SA + - SB + - SC + - SD + - SE + - SG + - SH + - SI + - SJ + - SK + - SL + - SM + - SN + - SO + - SR + - SS + - ST + - SV + - SX + - SY + - SZ + - TC + - TD + - TF + - TG + - TH + - TJ + - TK + - TL + - TM + - TN + - TO + - TR + - TT + - TV + - TW + - TZ + - UA + - UG + - UM + - US + - UY + - UZ + - VA + - VC + - VE + - VG + - VI + - VN + - VU + - WF + - WS + - YE + - YT + - ZA + - ZM + - ZW + go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.CountryCode + Profile: type: object required: @@ -9291,6 +9565,8 @@ components: - consent_data - action - sdk_version + - regulation + - country_code - created_at properties: id: @@ -9325,6 +9601,12 @@ components: sdk_version: type: string description: SDK version + regulation: + $ref: "#/components/schemas/Regulation" + description: Applicable regulation + country_code: + $ref: "#/components/schemas/CountryCode" + description: Visitor country code (ISO 3166-1 alpha-2) created_at: type: string format: date-time diff --git a/pkg/server/api/mcp/v1/types/cookie_consent_record.go b/pkg/server/api/mcp/v1/types/cookie_consent_record.go index e914fdcb9..c47b2a5dc 100644 --- a/pkg/server/api/mcp/v1/types/cookie_consent_record.go +++ b/pkg/server/api/mcp/v1/types/cookie_consent_record.go @@ -35,6 +35,8 @@ func NewCookieConsentRecord(r *coredata.CookieConsentRecord) *CookieConsentRecor ConsentData: consentData, Action: CookieConsentRecordAction(r.Action), SdkVersion: r.SdkVersion, + Regulation: r.Regulation, + CountryCode: r.CountryCode, CreatedAt: r.CreatedAt, } }