From c8c93dbfbe1e81a3005667b6ebdb9f0811ec72e0 Mon Sep 17 00:00:00 2001 From: Kevin Franklin Kim Date: Tue, 5 Nov 2024 13:45:35 +0100 Subject: [PATCH] feat: add schema --- Makefile | 14 +- go.mod | 5 + go.sum | 11 + main_test.go | 39 ++ ownbrew.yaml | 16 + pkg/config/config.go | 36 +- sesamy.schema.json | 1001 +++++++++++++++++++++--------------------- 7 files changed, 593 insertions(+), 529 deletions(-) create mode 100644 main_test.go create mode 100644 ownbrew.yaml diff --git a/Makefile b/Makefile index f6f843d..5a7bec4 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,10 @@ .DEFAULT_GOAL:=help -include .makerc +# --- Config ----------------------------------------------------------------- + +export PATH := bin:$(PATH) + # --- Targets ----------------------------------------------------------------- # This allows us to accept extra arguments @@ -12,16 +16,16 @@ .husky: @if ! command -v husky &> /dev/null; then \ echo "ERROR: missing executeable 'husky', please run:"; \ - echo "\n$ go install github.com/go-courier/husky/cmd/husky@latest\n"; \ + echo "\n$ make brew\n"; \ fi @git config core.hooksPath .husky ## === Tasks === -.PHONY: schema -## Open go schemas -schema: - @helm schema-gen sesamy.yaml > sesamy.schema.json +.PHONY: brew +## Install project binaries +brew: + @ownbrew install .PHONY: doc ## Open go docs diff --git a/go.mod b/go.mod index 041d353..90820a0 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/foomo/go v0.0.3 github.com/foomo/gocontemplate v0.1.4 github.com/foomo/sesamy-go v0.4.0 + github.com/invopop/jsonschema v0.12.0 github.com/joho/godotenv v1.5.1 github.com/mitchellh/hashstructure/v2 v2.0.2 github.com/mitchellh/mapstructure v1.5.0 @@ -28,6 +29,8 @@ require ( cloud.google.com/go/auth v0.9.8 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect cloud.google.com/go/compute/metadata v0.5.2 // indirect + github.com/bahlo/generic-list-go v0.2.0 // indirect + github.com/buger/jsonparser v1.1.1 // indirect github.com/containerd/console v1.0.3 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -45,6 +48,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/lithammer/fuzzysearch v1.1.8 // indirect github.com/magiconair/properties v1.8.7 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -56,6 +60,7 @@ require ( github.com/spf13/cast v1.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.6.0 // indirect + github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect diff --git a/go.sum b/go.sum index dc1d2b8..fb18d54 100644 --- a/go.sum +++ b/go.sum @@ -24,6 +24,10 @@ github.com/MarvinJWendt/testza v0.4.2/go.mod h1:mSdhXiKH8sg/gQehJ63bINcCKp7RtYew github.com/MarvinJWendt/testza v0.5.2 h1:53KDo64C1z/h/d/stCYCPY69bt/OSwjq5KpFNwi+zB4= github.com/MarvinJWendt/testza v0.5.2/go.mod h1:xu53QFE5sCdjtMCKk8YMQ2MnymimEctc4n3EjyIYvEY= github.com/atomicgo/cursor v0.0.1/go.mod h1:cBON2QmmrysudxNBFthvMtN32r3jxVRIvzkUiF/RuIk= +github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= +github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -98,8 +102,11 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= +github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.10/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= @@ -116,6 +123,8 @@ github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8 github.com/lithammer/fuzzysearch v1.1.8/go.mod h1:IdqeyBClc3FFqSzYq/MXESsS4S0FsZ5ajtkr5xPLts4= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= @@ -183,6 +192,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/wissance/stringFormatter v1.2.0 h1:lB0zcJkTA1O4Eb2qSTJmyapla/LihQt6NpJLghwWSb0= github.com/wissance/stringFormatter v1.2.0/go.mod h1:H7Mz15+5i8ypmv6bLknM/uD+U1teUW99PlW0DNCNscA= +github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= +github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000..94287de --- /dev/null +++ b/main_test.go @@ -0,0 +1,39 @@ +package main_test + +import ( + "encoding/json" + "errors" + "os" + "path" + "testing" + + testingx "github.com/foomo/go/testing" + tagx "github.com/foomo/go/testing/tag" + "github.com/foomo/sesamy-cli/pkg/config" + "github.com/invopop/jsonschema" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestConfig(t *testing.T) { + testingx.Tags(t, tagx.Short) + + cwd, err := os.Getwd() + require.NoError(t, err) + + reflector := new(jsonschema.Reflector) + require.NoError(t, reflector.AddGoComments("github.com/foomo/sesamy-cli", "./")) + schema := reflector.Reflect(&config.Config{}) + actual, err := json.MarshalIndent(schema, "", " ") + require.NoError(t, err) + + filename := path.Join(cwd, "sesamy.schema.json") + expected, err := os.ReadFile(filename) + if !errors.Is(err, os.ErrNotExist) { + require.NoError(t, err) + } + + if !assert.Equal(t, string(expected), string(actual)) { + require.NoError(t, os.WriteFile(filename, actual, 0600)) + } +} diff --git a/ownbrew.yaml b/ownbrew.yaml new file mode 100644 index 0000000..53803b7 --- /dev/null +++ b/ownbrew.yaml @@ -0,0 +1,16 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/foomo/ownbrew/refs/tags/v0.1.0/ownbrew.schema.json +version: '1.0' + +binDir: "bin" +tapDir: ".ownbrew/tap" +tempDir: ".ownbrew/tmp" +cellarDir: ".ownbrew/bin" +packages: + ## https://github.com/golangci/golangci-lint/releases + - name: golangci-lint + tap: foomo/tap/golangci/golangci-lint + version: 1.61.0 + ## https://github.com/go-courier/husky/releases + - name: husky + tap: foomo/tap/go-courier/husky + version: 1.8.1 diff --git a/pkg/config/config.go b/pkg/config/config.go index 24ebe80..2321020 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -1,18 +1,30 @@ package config type Config struct { - Version string `json:"version" yaml:"version"` - RedactVisitorIP bool `json:"redactVisitorIp" yaml:"redactVisitorIp"` - GoogleTag GoogleTag `json:"googleTag" yaml:"googleTag"` - GoogleAPI GoogleAPI `json:"googleAPI" yaml:"googleAPI"` + // Config version + Version string `json:"version" yaml:"version" jsonschema:"required"` + // Globally redact visitor ip + RedactVisitorIP bool `json:"redactVisitorIp" yaml:"redactVisitorIp"` + // Google Tag settings + GoogleTag GoogleTag `json:"googleTag" yaml:"googleTag"` + // Google API settings + GoogleAPI GoogleAPI `json:"googleApi" yaml:"googleApi"` + // Google Tag Manager settings GoogleTagManager GoogleTagManager `json:"googleTagManager" yaml:"googleTagManager"` - // Providers - GoogleAds GoogleAds `json:"googleAds" yaml:"googleAds"` - Cookiebot Cookiebot `json:"cookiebot" yaml:"cookiebot"` - GoogleAnalytics GoogleAnalytics `json:"googleAnalytics" yaml:"googleAnalytics"` + // Google Ads provider settings + GoogleAds GoogleAds `json:"googleAds" yaml:"googleAds"` + // CookieBot provider settings + Cookiebot Cookiebot `json:"cookiebot" yaml:"cookiebot"` + // Google Analytics provider settings + GoogleAnalytics GoogleAnalytics `json:"googleAnalytics" yaml:"googleAnalytics"` + // Conversion Linker provider settings ConversionLinker ConversionLinker `json:"conversionLinker" yaml:"conversionLinker"` - Facebook Facebook `json:"facebook" yaml:"facebook"` - Emarsys Emarsys `json:"emarsys" yaml:"emarsys"` - Tracify Tracify `json:"tracify" yaml:"tracify"` - Umami Umami `json:"umami" yaml:"umami"` + // Facebook provider settings + Facebook Facebook `json:"facebook" yaml:"facebook"` + // Emarsys provider settings + Emarsys Emarsys `json:"emarsys" yaml:"emarsys"` + // Tracify provider settings + Tracify Tracify `json:"tracify" yaml:"tracify"` + // Umami provider settings + Umami Umami `json:"umami" yaml:"umami"` } diff --git a/sesamy.schema.json b/sesamy.schema.json index 9cf8683..024b651 100644 --- a/sesamy.schema.json +++ b/sesamy.schema.json @@ -1,521 +1,498 @@ { - "$schema": "http://json-schema.org/schema#", - "type": "object", - "properties": { - "conversionLinker": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "googleConsent": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "mode": { - "type": "string" - } - } - } - } - }, - "cookiebot": { - "type": "object", - "properties": { - "advertiserConsentModeEnabled": { - "type": "boolean" - }, - "cdnRegion": { - "type": "string" - }, - "cookiebotId": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "templateName": { - "type": "string" - }, - "urlPassthrough": { - "type": "boolean" - } - } - }, - "emarsys": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "googleConsent": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "mode": { - "type": "string" - } - } - }, - "merchantId": { - "type": "string" - }, - "serverContainer": { - "type": "object", - "properties": { - "packages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "types": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "facebook": { - "type": "object", - "properties": { - "apiAccessToken": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "googleConsent": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "mode": { - "type": "string" - } - } - }, - "pixelId": { - "type": "string" - }, - "serverContainer": { - "type": "object", - "properties": { - "packages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "types": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - }, - "testEventToken": { - "type": "string" - } - } - }, - "googleAds": { - "type": "object", - "properties": { - "conversion": { - "type": "object", - "properties": { - "conversionLabel": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "serverContainer": { - "type": "object", - "properties": { - "packages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "types": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "conversionId": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "googleConsent": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "mode": { - "type": "string" - } - } - }, - "remarketing": { - "type": "object", - "properties": { - "enableConversionLinker": { - "type": "boolean" - }, - "enabled": { - "type": "boolean" - } - } - } - } - }, - "googleAnalytics": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "googleConsent": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "mode": { - "type": "string" - } - } - }, - "googleGTag": { - "type": "object", - "properties": { - "ecommerceItems": { - "type": "boolean" - }, - "enabled": { - "type": "boolean" - }, - "priority": { - "type": "integer" - } - } - }, - "serverContainer": { - "type": "object", - "properties": { - "packages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "types": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - }, - "webContainer": { - "type": "object", - "properties": { - "packages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "types": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "googleApi": { - "type": "object", - "properties": { - "credentials": { - "type": "string" - }, - "credentialsFile": { - "type": "string" - }, - "requestQuota": { - "type": "integer" - } - } - }, - "googleTag": { - "type": "object", - "properties": { - "debugMode": { - "type": "boolean" - }, - "sendPageView": { - "type": "boolean" - }, - "serverContainer": { - "type": "object", - "properties": { - "packages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "types": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - }, - "tagId": { - "type": "string" - }, - "typeScript": { - "type": "object", - "properties": { - "outputPath": { - "type": "string" - }, - "packages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "types": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - }, - "webContainer": { - "type": "object", - "properties": { - "packages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "types": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "googleTagManager": { - "type": "object", - "properties": { - "accountId": { - "type": "integer" - }, - "serverContainer": { - "type": "object", - "properties": { - "containerId": { - "type": "integer" - }, - "tagId": { - "type": "string" - }, - "workspaceId": { - "type": "integer" - } - } - }, - "webContainer": { - "type": "object", - "properties": { - "containerId": { - "type": "integer" - }, - "tagId": { - "type": "string" - }, - "workspaceId": { - "type": "integer" - } - } - } - } + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/foomo/sesamy-cli/pkg/config/config", + "$ref": "#/$defs/Config", + "$defs": { + "Config": { + "properties": { + "version": { + "type": "string", + "description": "Config version" }, "redactVisitorIp": { - "type": "boolean" + "type": "boolean", + "description": "Globally redact visitor ip" + }, + "googleTag": { + "$ref": "#/$defs/GoogleTag", + "description": "Google Tag settings" + }, + "googleApi": { + "$ref": "#/$defs/GoogleAPI", + "description": "Google API settings" + }, + "googleTagManager": { + "$ref": "#/$defs/GoogleTagManager", + "description": "Google Tag Manager settings" + }, + "googleAds": { + "$ref": "#/$defs/GoogleAds", + "description": "Google Ads provider settings" + }, + "cookiebot": { + "$ref": "#/$defs/Cookiebot", + "description": "CookieBot provider settings" + }, + "googleAnalytics": { + "$ref": "#/$defs/GoogleAnalytics", + "description": "Google Analytics provider settings" + }, + "conversionLinker": { + "$ref": "#/$defs/ConversionLinker", + "description": "Conversion Linker provider settings" + }, + "facebook": { + "$ref": "#/$defs/Facebook", + "description": "Facebook provider settings" + }, + "emarsys": { + "$ref": "#/$defs/Emarsys", + "description": "Emarsys provider settings" }, "tracify": { - "type": "object", - "properties": { - "customerSiteId": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "googleConsent": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "mode": { - "type": "string" - } - } - }, - "serverContainer": { - "type": "object", - "properties": { - "packages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "types": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - }, - "token": { - "type": "string" - } - } + "$ref": "#/$defs/Tracify", + "description": "Tracify provider settings" }, "umami": { - "type": "object", - "properties": { - "domain": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "endpointUrl": { - "type": "string" - }, - "googleConsent": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "mode": { - "type": "string" - } - } - }, - "serverContainer": { - "type": "object", - "properties": { - "packages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "types": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - }, - "websiteId": { - "type": "string" - } - } - }, - "version": { - "type": "string" + "$ref": "#/$defs/Umami", + "description": "Umami provider settings" } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "version", + "redactVisitorIp", + "googleTag", + "googleApi", + "googleTagManager", + "googleAds", + "cookiebot", + "googleAnalytics", + "conversionLinker", + "facebook", + "emarsys", + "tracify", + "umami" + ] + }, + "ConversionLinker": { + "properties": { + "enabled": { + "type": "boolean" + }, + "googleConsent": { + "$ref": "#/$defs/GoogleConsent" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "enabled", + "googleConsent" + ] + }, + "Cookiebot": { + "properties": { + "enabled": { + "type": "boolean" + }, + "templateName": { + "type": "string" + }, + "cookiebotId": { + "type": "string" + }, + "cdnRegion": { + "type": "string" + }, + "urlPassthrough": { + "type": "boolean" + }, + "advertiserConsentModeEnabled": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "enabled", + "templateName", + "cookiebotId", + "cdnRegion", + "urlPassthrough", + "advertiserConsentModeEnabled" + ] + }, + "Emarsys": { + "properties": { + "enabled": { + "type": "boolean" + }, + "merchantId": { + "type": "string" + }, + "googleConsent": { + "$ref": "#/$defs/GoogleConsent" + }, + "webContainer": { + "$ref": "#/$defs/Config" + }, + "serverContainer": { + "$ref": "#/$defs/Config" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "enabled", + "merchantId", + "googleConsent", + "webContainer", + "serverContainer" + ] + }, + "Facebook": { + "properties": { + "enabled": { + "type": "boolean" + }, + "pixelId": { + "type": "string" + }, + "apiAccessToken": { + "type": "string" + }, + "testEventToken": { + "type": "string" + }, + "googleConsent": { + "$ref": "#/$defs/GoogleConsent" + }, + "serverContainer": { + "$ref": "#/$defs/Config" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "enabled", + "pixelId", + "apiAccessToken", + "testEventToken", + "googleConsent", + "serverContainer" + ] + }, + "GoogleAPI": { + "properties": { + "credentials": { + "type": "string" + }, + "credentialsFile": { + "type": "string" + }, + "requestQuota": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "credentials", + "credentialsFile", + "requestQuota" + ] + }, + "GoogleAds": { + "properties": { + "enabled": { + "type": "boolean" + }, + "googleConsent": { + "$ref": "#/$defs/GoogleConsent" + }, + "conversionId": { + "type": "string" + }, + "conversion": { + "$ref": "#/$defs/GoogleAdsConversion" + }, + "remarketing": { + "$ref": "#/$defs/GoogleAdsRemarketing" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "enabled", + "googleConsent", + "conversionId", + "conversion", + "remarketing" + ] + }, + "GoogleAdsConversion": { + "properties": { + "enabled": { + "type": "boolean" + }, + "conversionLabel": { + "type": "string" + }, + "serverContainer": { + "$ref": "#/$defs/Config" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "enabled", + "conversionLabel", + "serverContainer" + ] + }, + "GoogleAdsRemarketing": { + "properties": { + "enabled": { + "type": "boolean" + }, + "enableConversionLinker": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "enabled", + "enableConversionLinker" + ] + }, + "GoogleAnalytics": { + "properties": { + "enabled": { + "type": "boolean" + }, + "googleGTag": { + "$ref": "#/$defs/GoogleGTag" + }, + "googleConsent": { + "$ref": "#/$defs/GoogleConsent" + }, + "webContainer": { + "$ref": "#/$defs/Config" + }, + "serverContainer": { + "$ref": "#/$defs/Config" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "enabled", + "googleGTag", + "googleConsent", + "webContainer", + "serverContainer" + ] + }, + "GoogleConsent": { + "properties": { + "enabled": { + "type": "boolean" + }, + "mode": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "enabled", + "mode" + ] + }, + "GoogleGTag": { + "properties": { + "enabled": { + "type": "boolean" + }, + "priority": { + "type": "integer" + }, + "ecommerceItems": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "enabled", + "priority", + "ecommerceItems" + ] + }, + "GoogleTag": { + "properties": { + "tagId": { + "type": "string" + }, + "debugMode": { + "type": "boolean" + }, + "sendPageView": { + "type": "boolean" + }, + "typeScript": { + "$ref": "#/$defs/TypeScript" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "tagId", + "debugMode", + "sendPageView", + "typeScript" + ] + }, + "GoogleTagManager": { + "properties": { + "accountId": { + "type": "string" + }, + "webContainer": { + "$ref": "#/$defs/GoogleTagManagerContainer" + }, + "serverContainer": { + "$ref": "#/$defs/GoogleTagManagerContainer" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "accountId", + "webContainer", + "serverContainer" + ] + }, + "GoogleTagManagerContainer": { + "properties": { + "tagId": { + "type": "string" + }, + "containerId": { + "type": "string" + }, + "workspaceId": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "tagId", + "containerId", + "workspaceId" + ] + }, + "PackageConfig": { + "properties": { + "path": { + "type": "string" + }, + "types": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "path", + "types" + ] + }, + "Tracify": { + "properties": { + "enabled": { + "type": "boolean" + }, + "token": { + "type": "string" + }, + "customerSiteId": { + "type": "string" + }, + "googleConsent": { + "$ref": "#/$defs/GoogleConsent" + }, + "serverContainer": { + "$ref": "#/$defs/Config" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "enabled", + "token", + "customerSiteId", + "googleConsent", + "serverContainer" + ] + }, + "TypeScript": { + "properties": { + "packages": { + "items": { + "$ref": "#/$defs/PackageConfig" + }, + "type": "array" + }, + "outputPath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "packages", + "outputPath" + ] + }, + "Umami": { + "properties": { + "enabled": { + "type": "boolean" + }, + "domain": { + "type": "string" + }, + "websiteId": { + "type": "string" + }, + "endpointUrl": { + "type": "string" + }, + "googleConsent": { + "$ref": "#/$defs/GoogleConsent" + }, + "serverContainer": { + "$ref": "#/$defs/Config" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "enabled", + "domain", + "websiteId", + "endpointUrl", + "googleConsent", + "serverContainer" + ] } -} + } +} \ No newline at end of file