From 3d1bccc3a06d70c5052347c51e4bb34865529727 Mon Sep 17 00:00:00 2001 From: mihir-4116 Date: Tue, 1 Aug 2023 15:11:55 +0530 Subject: [PATCH 1/2] fix(ga4): firebaseAppId config field issue --- .../destinations/ga4/schema.json | 151 +++++++++++++++--- .../destinations/ga4/ui-config.json | 2 +- test/data/validation/destinations/ga4.json | 5 +- 3 files changed, 134 insertions(+), 24 deletions(-) diff --git a/src/configurations/destinations/ga4/schema.json b/src/configurations/destinations/ga4/schema.json index 3bca645fc..d9dd232a9 100644 --- a/src/configurations/destinations/ga4/schema.json +++ b/src/configurations/destinations/ga4/schema.json @@ -1,26 +1,35 @@ { "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "required": ["apiSecret", "typesOfClient", "measurementId", "firebaseAppId"], + "required": [ + "apiSecret", + "typesOfClient" + ], "type": "object", "properties": { "apiSecret": { "type": "string", "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" }, - "typesOfClient": { "type": "string", "enum": ["gtag", "firebase"], "default": "gtag" }, - "measurementId": { + "typesOfClient": { "type": "string", - "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(G-.{1,100})$|^$" + "enum": [ + "gtag", + "firebase" + ], + "default": "gtag" }, - "firebaseAppId": { - "type": "string", - "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + "debugMode": { + "type": "boolean", + "default": false }, - "debugMode": { "type": "boolean", "default": false }, "eventFilteringOption": { "type": "string", - "enum": ["disable", "whitelistedEvents", "blacklistedEvents"], + "enum": [ + "disable", + "whitelistedEvents", + "blacklistedEvents" + ], "default": "disable" }, "whitelistedEvents": { @@ -61,30 +70,130 @@ }, "capturePageView": { "type": "object", - "properties": { "web": { "type": "string", "enum": ["rs", "gtag"], "default": "rs" } } + "properties": { + "web": { + "type": "string", + "enum": [ + "rs", + "gtag" + ], + "default": "rs" + } + } + }, + "debugView": { + "type": "object", + "properties": { + "web": { + "type": "boolean" + } + } + }, + "extendPageViewParams": { + "type": "object", + "properties": { + "web": { + "type": "boolean" + } + } }, - "debugView": { "type": "object", "properties": { "web": { "type": "boolean" } } }, - "extendPageViewParams": { "type": "object", "properties": { "web": { "type": "boolean" } } }, "overrideClientAndSessionId": { "type": "object", - "properties": { "web": { "type": "boolean" } } + "properties": { + "web": { + "type": "boolean" + } + } }, "useNativeSDK": { "type": "object", "properties": { - "android": { "type": "boolean" }, - "ios": { "type": "boolean" }, - "web": { "type": "boolean" } + "android": { + "type": "boolean" + }, + "ios": { + "type": "boolean" + }, + "web": { + "type": "boolean" + } } }, "connectionMode": { "type": "object", "properties": { - "android": { "type": "string", "enum": ["cloud", "device"] }, - "ios": { "type": "string", "enum": ["cloud", "device"] }, - "web": { "type": "string", "enum": ["cloud", "device", "hybrid"] } + "android": { + "type": "string", + "enum": [ + "cloud", + "device" + ] + }, + "ios": { + "type": "string", + "enum": [ + "cloud", + "device" + ] + }, + "web": { + "type": "string", + "enum": [ + "cloud", + "device", + "hybrid" + ] + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "typesOfClient": { + "const": "gtag" + } + }, + "required": [ + "typesOfClient" + ] + }, + "then": { + "properties": { + "measurementId": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(G-.{1,100})$|^$" + } + }, + "required": [ + "measurementId" + ] + } + }, + { + "if": { + "properties": { + "typesOfClient": { + "const": "firebase" + } + }, + "required": [ + "typesOfClient" + ] + }, + "then": { + "properties": { + "firebaseAppId": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" + } + }, + "required": [ + "firebaseAppId" + ] } } - } + ] } -} +} \ No newline at end of file diff --git a/src/configurations/destinations/ga4/ui-config.json b/src/configurations/destinations/ga4/ui-config.json index da8f4bb49..e28a34143 100644 --- a/src/configurations/destinations/ga4/ui-config.json +++ b/src/configurations/destinations/ga4/ui-config.json @@ -68,7 +68,7 @@ }, "label": "Firebase App Id", "configKey": "firebaseAppId", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", "regexErrorMessage": "Invalid Firebase App Id", "note": "Enter the ID associated with your stream. Find this under Admin > Data Streams > choose your stream > Firebase App ID", "placeholder": "e.g: 2:637908496727:web:a4284b4c99e329d5", diff --git a/test/data/validation/destinations/ga4.json b/test/data/validation/destinations/ga4.json index d2f0c3594..f92425151 100644 --- a/test/data/validation/destinations/ga4.json +++ b/test/data/validation/destinations/ga4.json @@ -81,7 +81,8 @@ }, "result": false, "err": [ - "measurementId must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(G-.{1,100})$|^$\"" + "measurementId must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(G-.{1,100})$|^$\"", + " must match \"then\" schema" ] }, { @@ -294,4 +295,4 @@ }, "result": true } -] +] \ No newline at end of file From 8331975bef214295c130713f2e7f7743ecf5ef10 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 1 Aug 2023 10:38:05 +0000 Subject: [PATCH 2/2] chore(release): 1.43.2 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bffc903f..e2c6e6b8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [1.43.2](https://github.com/rudderlabs/rudder-config-schema/compare/v1.43.1...v1.43.2) (2023-08-01) + + +### Bug Fixes + +* **ga4:** firebaseAppId config field issue ([3d1bccc](https://github.com/rudderlabs/rudder-config-schema/commit/3d1bccc3a06d70c5052347c51e4bb34865529727)) + ### [1.43.1](https://github.com/rudderlabs/rudder-config-schema/compare/v1.43.0...v1.43.1) (2023-07-28) ## [1.43.0](https://github.com/rudderlabs/rudder-config-schema/compare/v1.42.2...v1.43.0) (2023-07-24) diff --git a/package-lock.json b/package-lock.json index 22b73123f..61e00364f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-config-schema", - "version": "1.43.1", + "version": "1.43.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-config-schema", - "version": "1.43.1", + "version": "1.43.2", "license": "MIT", "dependencies": { "ajv": "^8.12.0", diff --git a/package.json b/package.json index 98312b657..870b018b8 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-config-schema", - "version": "1.43.1", + "version": "1.43.2", "description": "", "main": "src/index.ts", "private": true,