feat: add schema

This commit is contained in:
Kevin Franklin Kim 2024-11-05 13:45:35 +01:00
parent c251bcf83d
commit c8c93dbfbe
No known key found for this signature in database
7 changed files with 593 additions and 529 deletions

View File

@ -1,6 +1,10 @@
.DEFAULT_GOAL:=help .DEFAULT_GOAL:=help
-include .makerc -include .makerc
# --- Config -----------------------------------------------------------------
export PATH := bin:$(PATH)
# --- Targets ----------------------------------------------------------------- # --- Targets -----------------------------------------------------------------
# This allows us to accept extra arguments # This allows us to accept extra arguments
@ -12,16 +16,16 @@
.husky: .husky:
@if ! command -v husky &> /dev/null; then \ @if ! command -v husky &> /dev/null; then \
echo "ERROR: missing executeable 'husky', please run:"; \ 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 fi
@git config core.hooksPath .husky @git config core.hooksPath .husky
## === Tasks === ## === Tasks ===
.PHONY: schema .PHONY: brew
## Open go schemas ## Install project binaries
schema: brew:
@helm schema-gen sesamy.yaml > sesamy.schema.json @ownbrew install
.PHONY: doc .PHONY: doc
## Open go docs ## Open go docs

5
go.mod
View File

@ -7,6 +7,7 @@ require (
github.com/foomo/go v0.0.3 github.com/foomo/go v0.0.3
github.com/foomo/gocontemplate v0.1.4 github.com/foomo/gocontemplate v0.1.4
github.com/foomo/sesamy-go v0.4.0 github.com/foomo/sesamy-go v0.4.0
github.com/invopop/jsonschema v0.12.0
github.com/joho/godotenv v1.5.1 github.com/joho/godotenv v1.5.1
github.com/mitchellh/hashstructure/v2 v2.0.2 github.com/mitchellh/hashstructure/v2 v2.0.2
github.com/mitchellh/mapstructure v1.5.0 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 v0.9.8 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/compute/metadata v0.5.2 // 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/containerd/console v1.0.3 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect
@ -45,6 +48,7 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/lithammer/fuzzysearch v1.1.8 // indirect github.com/lithammer/fuzzysearch v1.1.8 // indirect
github.com/magiconair/properties v1.8.7 // 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/mattn/go-runewidth v0.0.15 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // 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/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // 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 github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
go.opencensus.io v0.24.0 // indirect go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect

11
go.sum
View File

@ -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 h1:53KDo64C1z/h/d/stCYCPY69bt/OSwjq5KpFNwi+zB4=
github.com/MarvinJWendt/testza v0.5.2/go.mod h1:xu53QFE5sCdjtMCKk8YMQ2MnymimEctc4n3EjyIYvEY= 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/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/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 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= 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/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 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 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 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= 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.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.10/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
github.com/klauspost/cpuid/v2 v2.0.12/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/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 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= 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.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= 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/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 h1:lB0zcJkTA1O4Eb2qSTJmyapla/LihQt6NpJLghwWSb0=
github.com/wissance/stringFormatter v1.2.0/go.mod h1:H7Mz15+5i8ypmv6bLknM/uD+U1teUW99PlW0DNCNscA= 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-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 h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=

39
main_test.go Normal file
View File

@ -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))
}
}

16
ownbrew.yaml Normal file
View File

@ -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

View File

@ -1,18 +1,30 @@
package config package config
type Config struct { type Config struct {
Version string `json:"version" yaml:"version"` // Config version
Version string `json:"version" yaml:"version" jsonschema:"required"`
// Globally redact visitor ip
RedactVisitorIP bool `json:"redactVisitorIp" yaml:"redactVisitorIp"` RedactVisitorIP bool `json:"redactVisitorIp" yaml:"redactVisitorIp"`
// Google Tag settings
GoogleTag GoogleTag `json:"googleTag" yaml:"googleTag"` GoogleTag GoogleTag `json:"googleTag" yaml:"googleTag"`
GoogleAPI GoogleAPI `json:"googleAPI" yaml:"googleAPI"` // Google API settings
GoogleAPI GoogleAPI `json:"googleApi" yaml:"googleApi"`
// Google Tag Manager settings
GoogleTagManager GoogleTagManager `json:"googleTagManager" yaml:"googleTagManager"` GoogleTagManager GoogleTagManager `json:"googleTagManager" yaml:"googleTagManager"`
// Providers // Google Ads provider settings
GoogleAds GoogleAds `json:"googleAds" yaml:"googleAds"` GoogleAds GoogleAds `json:"googleAds" yaml:"googleAds"`
// CookieBot provider settings
Cookiebot Cookiebot `json:"cookiebot" yaml:"cookiebot"` Cookiebot Cookiebot `json:"cookiebot" yaml:"cookiebot"`
// Google Analytics provider settings
GoogleAnalytics GoogleAnalytics `json:"googleAnalytics" yaml:"googleAnalytics"` GoogleAnalytics GoogleAnalytics `json:"googleAnalytics" yaml:"googleAnalytics"`
// Conversion Linker provider settings
ConversionLinker ConversionLinker `json:"conversionLinker" yaml:"conversionLinker"` ConversionLinker ConversionLinker `json:"conversionLinker" yaml:"conversionLinker"`
// Facebook provider settings
Facebook Facebook `json:"facebook" yaml:"facebook"` Facebook Facebook `json:"facebook" yaml:"facebook"`
// Emarsys provider settings
Emarsys Emarsys `json:"emarsys" yaml:"emarsys"` Emarsys Emarsys `json:"emarsys" yaml:"emarsys"`
// Tracify provider settings
Tracify Tracify `json:"tracify" yaml:"tracify"` Tracify Tracify `json:"tracify" yaml:"tracify"`
// Umami provider settings
Umami Umami `json:"umami" yaml:"umami"` Umami Umami `json:"umami" yaml:"umami"`
} }

View File

@ -1,288 +1,190 @@
{ {
"$schema": "http://json-schema.org/schema#", "$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object", "$id": "https://github.com/foomo/sesamy-cli/pkg/config/config",
"$ref": "#/$defs/Config",
"$defs": {
"Config": {
"properties": { "properties": {
"version": {
"type": "string",
"description": "Config version"
},
"redactVisitorIp": {
"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": { "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": {
"$ref": "#/$defs/Tracify",
"description": "Tracify provider settings"
},
"umami": {
"$ref": "#/$defs/Umami",
"description": "Umami provider settings"
}
},
"additionalProperties": false,
"type": "object", "type": "object",
"required": [
"version",
"redactVisitorIp",
"googleTag",
"googleApi",
"googleTagManager",
"googleAds",
"cookiebot",
"googleAnalytics",
"conversionLinker",
"facebook",
"emarsys",
"tracify",
"umami"
]
},
"ConversionLinker": {
"properties": { "properties": {
"enabled": { "enabled": {
"type": "boolean" "type": "boolean"
}, },
"googleConsent": { "googleConsent": {
"$ref": "#/$defs/GoogleConsent"
}
},
"additionalProperties": false,
"type": "object", "type": "object",
"required": [
"enabled",
"googleConsent"
]
},
"Cookiebot": {
"properties": { "properties": {
"enabled": {
"type": "boolean"
},
"mode": {
"type": "string"
}
}
}
}
},
"cookiebot": {
"type": "object",
"properties": {
"advertiserConsentModeEnabled": {
"type": "boolean"
},
"cdnRegion": {
"type": "string"
},
"cookiebotId": {
"type": "string"
},
"enabled": { "enabled": {
"type": "boolean" "type": "boolean"
}, },
"templateName": { "templateName": {
"type": "string" "type": "string"
}, },
"cookiebotId": {
"type": "string"
},
"cdnRegion": {
"type": "string"
},
"urlPassthrough": { "urlPassthrough": {
"type": "boolean" "type": "boolean"
} },
"advertiserConsentModeEnabled": {
"type": "boolean"
} }
}, },
"emarsys": { "additionalProperties": false,
"type": "object", "type": "object",
"required": [
"enabled",
"templateName",
"cookiebotId",
"cdnRegion",
"urlPassthrough",
"advertiserConsentModeEnabled"
]
},
"Emarsys": {
"properties": { "properties": {
"enabled": { "enabled": {
"type": "boolean" "type": "boolean"
}, },
"googleConsent": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"mode": {
"type": "string"
}
}
},
"merchantId": { "merchantId": {
"type": "string" "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": { "googleConsent": {
"$ref": "#/$defs/GoogleConsent"
},
"webContainer": {
"$ref": "#/$defs/Config"
},
"serverContainer": {
"$ref": "#/$defs/Config"
}
},
"additionalProperties": false,
"type": "object", "type": "object",
"required": [
"enabled",
"merchantId",
"googleConsent",
"webContainer",
"serverContainer"
]
},
"Facebook": {
"properties": { "properties": {
"enabled": { "enabled": {
"type": "boolean" "type": "boolean"
}, },
"mode": {
"type": "string"
}
}
},
"pixelId": { "pixelId": {
"type": "string" "type": "string"
}, },
"serverContainer": { "apiAccessToken": {
"type": "object",
"properties": {
"packages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string" "type": "string"
}, },
"types": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"testEventToken": { "testEventToken": {
"type": "string" "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": { "googleConsent": {
"type": "object", "$ref": "#/$defs/GoogleConsent"
"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": { "serverContainer": {
"type": "object", "$ref": "#/$defs/Config"
"properties": {
"packages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"types": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
} }
}, },
"webContainer": { "additionalProperties": false,
"type": "object", "type": "object",
"properties": { "required": [
"packages": { "enabled",
"type": "array", "pixelId",
"items": { "apiAccessToken",
"type": "object", "testEventToken",
"properties": { "googleConsent",
"path": { "serverContainer"
"type": "string" ]
}, },
"types": { "GoogleAPI": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
}
},
"googleApi": {
"type": "object",
"properties": { "properties": {
"credentials": { "credentials": {
"type": "string" "type": "string"
@ -293,229 +195,304 @@
"requestQuota": { "requestQuota": {
"type": "integer" "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"
} }
}, },
"googleTag": { "additionalProperties": false,
"type": "object", "type": "object",
"required": [
"enabled",
"googleConsent",
"conversionId",
"conversion",
"remarketing"
]
},
"GoogleAdsConversion": {
"properties": { "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": { "debugMode": {
"type": "boolean" "type": "boolean"
}, },
"sendPageView": { "sendPageView": {
"type": "boolean" "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": { "typeScript": {
"type": "object", "$ref": "#/$defs/TypeScript"
"properties": {
"outputPath": {
"type": "string"
},
"packages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"types": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
} }
}, },
"webContainer": { "additionalProperties": false,
"type": "object", "type": "object",
"properties": { "required": [
"packages": { "tagId",
"type": "array", "debugMode",
"items": { "sendPageView",
"type": "object", "typeScript"
"properties": { ]
"path": {
"type": "string"
}, },
"types": { "GoogleTagManager": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
}
},
"googleTagManager": {
"type": "object",
"properties": { "properties": {
"accountId": { "accountId": {
"type": "integer"
},
"serverContainer": {
"type": "object",
"properties": {
"containerId": {
"type": "integer"
},
"tagId": {
"type": "string" "type": "string"
}, },
"workspaceId": {
"type": "integer"
}
}
},
"webContainer": { "webContainer": {
"type": "object", "$ref": "#/$defs/GoogleTagManagerContainer"
"properties": {
"containerId": {
"type": "integer"
}, },
"serverContainer": {
"$ref": "#/$defs/GoogleTagManagerContainer"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"accountId",
"webContainer",
"serverContainer"
]
},
"GoogleTagManagerContainer": {
"properties": {
"tagId": { "tagId": {
"type": "string" "type": "string"
}, },
"containerId": {
"type": "string"
},
"workspaceId": { "workspaceId": {
"type": "integer"
}
}
}
}
},
"redactVisitorIp": {
"type": "boolean"
},
"tracify": {
"type": "object",
"properties": {
"customerSiteId": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"googleConsent": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"mode": {
"type": "string" "type": "string"
} }
}
}, },
"serverContainer": { "additionalProperties": false,
"type": "object",
"properties": {
"packages": {
"type": "array",
"items": {
"type": "object", "type": "object",
"required": [
"tagId",
"containerId",
"workspaceId"
]
},
"PackageConfig": {
"properties": { "properties": {
"path": { "path": {
"type": "string" "type": "string"
}, },
"types": { "types": {
"type": "array",
"items": { "items": {
"type": "string" "type": "string"
},
"type": "array"
} }
} },
} "additionalProperties": false,
} "type": "object",
} "required": [
} "path",
"types"
]
},
"Tracify": {
"properties": {
"enabled": {
"type": "boolean"
}, },
"token": { "token": {
"type": "string" "type": "string"
} },
"customerSiteId": {
"type": "string"
},
"googleConsent": {
"$ref": "#/$defs/GoogleConsent"
},
"serverContainer": {
"$ref": "#/$defs/Config"
} }
}, },
"umami": { "additionalProperties": false,
"type": "object", "type": "object",
"required": [
"enabled",
"token",
"customerSiteId",
"googleConsent",
"serverContainer"
]
},
"TypeScript": {
"properties": { "properties": {
"packages": {
"items": {
"$ref": "#/$defs/PackageConfig"
},
"type": "array"
},
"outputPath": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"packages",
"outputPath"
]
},
"Umami": {
"properties": {
"enabled": {
"type": "boolean"
},
"domain": { "domain": {
"type": "string" "type": "string"
}, },
"enabled": { "websiteId": {
"type": "boolean" "type": "string"
}, },
"endpointUrl": { "endpointUrl": {
"type": "string" "type": "string"
}, },
"googleConsent": { "googleConsent": {
"type": "object", "$ref": "#/$defs/GoogleConsent"
"properties": {
"enabled": {
"type": "boolean"
},
"mode": {
"type": "string"
}
}
}, },
"serverContainer": { "serverContainer": {
"$ref": "#/$defs/Config"
}
},
"additionalProperties": false,
"type": "object", "type": "object",
"properties": { "required": [
"packages": { "enabled",
"type": "array", "domain",
"items": { "websiteId",
"type": "object", "endpointUrl",
"properties": { "googleConsent",
"path": { "serverContainer"
"type": "string" ]
},
"types": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"websiteId": {
"type": "string"
}
}
},
"version": {
"type": "string"
} }
} }
} }