The console now manages CookiePattern entities instead of raw Cookie rows. The frontend queries cookiePatterns on each category and uses createCookiePattern, updateCookiePattern, deleteCookiePattern, and moveCookiePatternToCategory mutations. The entire Cookie GraphQL surface (type, connection, mutations, inputs, payloads, resolvers, Go types) is removed since the backing struct already lost description and cookieCategoryID. Signed-off-by: Émile Ré <emile@getprobo.com>
487 lines
12 KiB
GraphQL
487 lines
12 KiB
GraphQL
enum CookieBannerState
|
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.CookieBannerState") {
|
|
ACTIVE
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookieBannerStateActive"
|
|
)
|
|
INACTIVE
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookieBannerStateInactive"
|
|
)
|
|
}
|
|
|
|
enum CookieConsentMode
|
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.CookieConsentMode") {
|
|
OPT_IN
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookieConsentModeOptIn"
|
|
)
|
|
OPT_OUT
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookieConsentModeOptOut"
|
|
)
|
|
}
|
|
|
|
enum CookieSource
|
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.CookieSource") {
|
|
SCRIPT
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookieSourceScript"
|
|
)
|
|
PRE_EXISTING
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookieSourcePreExisting"
|
|
)
|
|
}
|
|
|
|
enum CookieBannerOrderField
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/coredata.CookieBannerOrderField"
|
|
) {
|
|
CREATED_AT
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookieBannerOrderFieldCreatedAt"
|
|
)
|
|
}
|
|
|
|
enum CookieCategoryOrderField
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/coredata.CookieCategoryOrderField"
|
|
) {
|
|
RANK
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookieCategoryOrderFieldRank"
|
|
)
|
|
}
|
|
|
|
enum CookieCategoryKind
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/coredata.CookieCategoryKind"
|
|
) {
|
|
NORMAL
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookieCategoryKindNormal"
|
|
)
|
|
NECESSARY
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookieCategoryKindNecessary"
|
|
)
|
|
UNCATEGORISED
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookieCategoryKindUncategorised"
|
|
)
|
|
}
|
|
|
|
input CookieBannerOrder
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CookieBannerOrderBy"
|
|
) {
|
|
direction: OrderDirection!
|
|
field: CookieBannerOrderField!
|
|
}
|
|
|
|
input CookieCategoryOrder
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CookieCategoryOrderBy"
|
|
) {
|
|
direction: OrderDirection!
|
|
field: CookieCategoryOrderField!
|
|
}
|
|
|
|
type CookieBanner implements Node {
|
|
id: ID!
|
|
name: String!
|
|
origin: String!
|
|
state: CookieBannerState!
|
|
privacyPolicyUrl: String
|
|
cookiePolicyUrl: String!
|
|
consentExpiryDays: Int!
|
|
consentMode: CookieConsentMode!
|
|
showBranding: Boolean!
|
|
defaultLanguage: String!
|
|
|
|
organization: Organization @goField(forceResolver: true)
|
|
|
|
categories(
|
|
first: Int
|
|
after: CursorKey
|
|
last: Int
|
|
before: CursorKey
|
|
orderBy: CookieCategoryOrder
|
|
): CookieCategoryConnection @goField(forceResolver: true)
|
|
|
|
translations: [CookieBannerTranslation!]! @goField(forceResolver: true)
|
|
|
|
latestVersion: CookieBannerVersion @goField(forceResolver: true)
|
|
|
|
consentRecords(
|
|
first: Int
|
|
after: CursorKey
|
|
last: Int
|
|
before: CursorKey
|
|
orderBy: CookieConsentRecordOrder
|
|
filter: CookieConsentRecordFilter
|
|
): CookieConsentRecordConnection @goField(forceResolver: true)
|
|
|
|
createdAt: Datetime!
|
|
updatedAt: Datetime!
|
|
|
|
permission(action: String!): Boolean! @goField(forceResolver: true)
|
|
}
|
|
|
|
type CookieBannerTranslation implements Node {
|
|
id: ID!
|
|
language: String!
|
|
translations: String!
|
|
createdAt: Datetime!
|
|
updatedAt: Datetime!
|
|
}
|
|
|
|
type CookieCategory implements Node {
|
|
id: ID!
|
|
cookieBanner: CookieBanner @goField(forceResolver: true)
|
|
name: String!
|
|
slug: String!
|
|
description: String!
|
|
kind: CookieCategoryKind!
|
|
rank: Int!
|
|
gcmConsentTypes: [String!]!
|
|
posthogConsent: Boolean!
|
|
|
|
cookiePatterns(
|
|
first: Int
|
|
after: CursorKey
|
|
last: Int
|
|
before: CursorKey
|
|
orderBy: CookiePatternOrder
|
|
): CookiePatternConnection @goField(forceResolver: true)
|
|
|
|
createdAt: Datetime!
|
|
updatedAt: Datetime!
|
|
|
|
permission(action: String!): Boolean! @goField(forceResolver: true)
|
|
}
|
|
|
|
enum CookiePatternMatchType
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/coredata.CookiePatternMatchType"
|
|
) {
|
|
EXACT
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookiePatternMatchTypeExact"
|
|
)
|
|
PREFIX
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookiePatternMatchTypePrefix"
|
|
)
|
|
}
|
|
|
|
enum CookiePatternOrderField
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/coredata.CookiePatternOrderField"
|
|
) {
|
|
CREATED_AT
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.CookiePatternOrderFieldCreatedAt"
|
|
)
|
|
}
|
|
|
|
input CookiePatternOrder
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CookiePatternOrderBy"
|
|
) {
|
|
direction: OrderDirection!
|
|
field: CookiePatternOrderField!
|
|
}
|
|
|
|
type CookiePattern implements Node {
|
|
id: ID!
|
|
cookieCategory: CookieCategory @goField(forceResolver: true)
|
|
pattern: String!
|
|
matchType: CookiePatternMatchType!
|
|
displayName: String!
|
|
duration: String!
|
|
description: String!
|
|
source: CookieSource!
|
|
cookieCount: Int! @goField(forceResolver: true)
|
|
createdAt: Datetime!
|
|
updatedAt: Datetime!
|
|
|
|
permission(action: String!): Boolean! @goField(forceResolver: true)
|
|
}
|
|
|
|
type CookiePatternConnection
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CookiePatternConnection"
|
|
) {
|
|
totalCount: Int! @goField(forceResolver: true)
|
|
edges: [CookiePatternEdge!]!
|
|
pageInfo: PageInfo!
|
|
}
|
|
|
|
type CookiePatternEdge {
|
|
cursor: CursorKey!
|
|
node: CookiePattern!
|
|
}
|
|
|
|
type CookieBannerVersion implements Node {
|
|
id: ID!
|
|
version: Int!
|
|
state: String!
|
|
categories: [CookieBannerVersionCategory!]! @goField(forceResolver: true)
|
|
createdAt: Datetime!
|
|
updatedAt: Datetime!
|
|
}
|
|
|
|
type CookieBannerVersionCategory {
|
|
name: String!
|
|
slug: String!
|
|
description: String!
|
|
kind: CookieCategoryKind!
|
|
cookies: [CookieBannerVersionCookie!]!
|
|
}
|
|
|
|
type CookieBannerVersionCookie {
|
|
name: String!
|
|
duration: String!
|
|
description: String!
|
|
}
|
|
|
|
type CookieBannerConnection
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CookieBannerConnection"
|
|
) {
|
|
totalCount: Int! @goField(forceResolver: true)
|
|
edges: [CookieBannerEdge!]!
|
|
pageInfo: PageInfo!
|
|
}
|
|
|
|
type CookieBannerEdge {
|
|
cursor: CursorKey!
|
|
node: CookieBanner!
|
|
}
|
|
|
|
type CookieCategoryConnection
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CookieCategoryConnection"
|
|
) {
|
|
totalCount: Int! @goField(forceResolver: true)
|
|
edges: [CookieCategoryEdge!]!
|
|
pageInfo: PageInfo!
|
|
}
|
|
|
|
type CookieCategoryEdge {
|
|
cursor: CursorKey!
|
|
node: CookieCategory!
|
|
}
|
|
|
|
extend type Mutation {
|
|
createCookieBanner(
|
|
input: CreateCookieBannerInput!
|
|
): CreateCookieBannerPayload!
|
|
updateCookieBanner(
|
|
input: UpdateCookieBannerInput!
|
|
): UpdateCookieBannerPayload!
|
|
deleteCookieBanner(
|
|
input: DeleteCookieBannerInput!
|
|
): DeleteCookieBannerPayload!
|
|
activateCookieBanner(
|
|
input: ActivateCookieBannerInput!
|
|
): ActivateCookieBannerPayload!
|
|
deactivateCookieBanner(
|
|
input: DeactivateCookieBannerInput!
|
|
): DeactivateCookieBannerPayload!
|
|
publishCookieBannerVersion(
|
|
input: PublishCookieBannerVersionInput!
|
|
): PublishCookieBannerVersionPayload!
|
|
createCookieCategory(
|
|
input: CreateCookieCategoryInput!
|
|
): CreateCookieCategoryPayload!
|
|
updateCookieCategory(
|
|
input: UpdateCookieCategoryInput!
|
|
): UpdateCookieCategoryPayload!
|
|
deleteCookieCategory(
|
|
input: DeleteCookieCategoryInput!
|
|
): DeleteCookieCategoryPayload!
|
|
reorderCookieCategory(
|
|
input: ReorderCookieCategoryInput!
|
|
): ReorderCookieCategoryPayload!
|
|
createCookiePattern(
|
|
input: CreateCookiePatternInput!
|
|
): CreateCookiePatternPayload!
|
|
updateCookiePattern(
|
|
input: UpdateCookiePatternInput!
|
|
): UpdateCookiePatternPayload!
|
|
deleteCookiePattern(
|
|
input: DeleteCookiePatternInput!
|
|
): DeleteCookiePatternPayload!
|
|
moveCookiePatternToCategory(
|
|
input: MoveCookiePatternToCategoryInput!
|
|
): MoveCookiePatternToCategoryPayload!
|
|
upsertCookieBannerTranslation(
|
|
input: UpsertCookieBannerTranslationInput!
|
|
): UpsertCookieBannerTranslationPayload!
|
|
}
|
|
|
|
input CreateCookieBannerInput {
|
|
organizationId: ID!
|
|
name: String!
|
|
origin: String!
|
|
privacyPolicyUrl: String
|
|
cookiePolicyUrl: String!
|
|
consentExpiryDays: Int!
|
|
consentMode: CookieConsentMode!
|
|
}
|
|
|
|
input UpdateCookieBannerInput {
|
|
cookieBannerId: ID!
|
|
name: String
|
|
privacyPolicyUrl: String
|
|
cookiePolicyUrl: String
|
|
consentExpiryDays: Int
|
|
consentMode: CookieConsentMode
|
|
defaultLanguage: String
|
|
}
|
|
|
|
input DeleteCookieBannerInput {
|
|
cookieBannerId: ID!
|
|
}
|
|
|
|
input ActivateCookieBannerInput {
|
|
cookieBannerId: ID!
|
|
}
|
|
|
|
input DeactivateCookieBannerInput {
|
|
cookieBannerId: ID!
|
|
}
|
|
|
|
input PublishCookieBannerVersionInput {
|
|
cookieBannerId: ID!
|
|
}
|
|
|
|
input CreateCookieCategoryInput {
|
|
cookieBannerId: ID!
|
|
name: String!
|
|
slug: String!
|
|
description: String!
|
|
rank: Int!
|
|
}
|
|
|
|
input UpdateCookieCategoryInput {
|
|
cookieCategoryId: ID!
|
|
name: String
|
|
slug: String
|
|
description: String
|
|
gcmConsentTypes: [String!]
|
|
posthogConsent: Boolean
|
|
}
|
|
|
|
input DeleteCookieCategoryInput {
|
|
cookieCategoryId: ID!
|
|
}
|
|
|
|
input ReorderCookieCategoryInput {
|
|
cookieCategoryId: ID!
|
|
rank: Int!
|
|
}
|
|
|
|
type CreateCookieBannerPayload {
|
|
cookieBannerEdge: CookieBannerEdge!
|
|
}
|
|
|
|
type UpdateCookieBannerPayload {
|
|
cookieBanner: CookieBanner!
|
|
}
|
|
|
|
type DeleteCookieBannerPayload {
|
|
deletedCookieBannerId: ID!
|
|
}
|
|
|
|
type ActivateCookieBannerPayload {
|
|
cookieBanner: CookieBanner!
|
|
}
|
|
|
|
type DeactivateCookieBannerPayload {
|
|
cookieBanner: CookieBanner!
|
|
}
|
|
|
|
type PublishCookieBannerVersionPayload {
|
|
cookieBannerVersion: CookieBannerVersion!
|
|
cookieBanner: CookieBanner!
|
|
}
|
|
|
|
type CreateCookieCategoryPayload {
|
|
cookieCategoryEdge: CookieCategoryEdge!
|
|
cookieBanner: CookieBanner!
|
|
}
|
|
|
|
type UpdateCookieCategoryPayload {
|
|
cookieCategory: CookieCategory!
|
|
cookieBanner: CookieBanner!
|
|
}
|
|
|
|
type DeleteCookieCategoryPayload {
|
|
deletedCookieCategoryId: ID!
|
|
cookieBanner: CookieBanner!
|
|
}
|
|
|
|
type ReorderCookieCategoryPayload {
|
|
cookieBanner: CookieBanner!
|
|
}
|
|
|
|
input CreateCookiePatternInput {
|
|
cookieCategoryId: ID!
|
|
pattern: String!
|
|
matchType: CookiePatternMatchType!
|
|
displayName: String!
|
|
duration: String!
|
|
description: String!
|
|
}
|
|
|
|
input UpdateCookiePatternInput {
|
|
cookiePatternId: ID!
|
|
displayName: String
|
|
duration: String
|
|
description: String
|
|
}
|
|
|
|
input DeleteCookiePatternInput {
|
|
cookiePatternId: ID!
|
|
}
|
|
|
|
input MoveCookiePatternToCategoryInput {
|
|
cookiePatternId: ID!
|
|
targetCookieCategoryId: ID!
|
|
}
|
|
|
|
type CreateCookiePatternPayload {
|
|
cookiePatternEdge: CookiePatternEdge!
|
|
cookieBanner: CookieBanner!
|
|
}
|
|
|
|
type UpdateCookiePatternPayload {
|
|
cookiePattern: CookiePattern!
|
|
cookieBanner: CookieBanner!
|
|
}
|
|
|
|
type DeleteCookiePatternPayload {
|
|
deletedCookiePatternId: ID!
|
|
cookieBanner: CookieBanner!
|
|
}
|
|
|
|
type MoveCookiePatternToCategoryPayload {
|
|
cookiePattern: CookiePattern!
|
|
cookieBanner: CookieBanner!
|
|
}
|
|
|
|
input UpsertCookieBannerTranslationInput {
|
|
cookieBannerId: ID!
|
|
language: String!
|
|
translations: String!
|
|
}
|
|
|
|
type UpsertCookieBannerTranslationPayload {
|
|
cookieBannerTranslation: CookieBannerTranslation!
|
|
cookieBanner: CookieBanner!
|
|
}
|