From ee173796574a30e18d6b04a2ca23a65c9e16275d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 01:22:56 +0000 Subject: [PATCH 01/12] chore: release main --- .release-please-manifest.json | 10 +++++----- packages/api/CHANGELOG.md | 7 +++++++ packages/api/package.json | 2 +- packages/data/CHANGELOG.md | 7 +++++++ packages/data/package.json | 2 +- packages/rules/CHANGELOG.md | 8 ++++++++ packages/rules/package.json | 2 +- packages/types/CHANGELOG.md | 8 ++++++++ packages/types/package.json | 2 +- packages/utils/CHANGELOG.md | 7 +++++++ packages/utils/package.json | 2 +- 11 files changed, 47 insertions(+), 10 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e28ba426..0474625c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,14 +1,14 @@ { "packages/js-sdk": "4.3.0", "packages/enums": "2.2.0", - "packages/types": "3.7.0", - "packages/utils": "2.2.0", + "packages/types": "3.8.0", + "packages/utils": "2.2.1", "packages/event": "2.1.1", "packages/bucketing": "3.1.0", "packages/logger": "2.1.0", - "packages/rules": "2.1.0", + "packages/rules": "2.1.1", "packages/segments": "2.1.0", - "packages/api": "2.1.1", - "packages/data": "3.3.0", + "packages/api": "2.1.2", + "packages/data": "3.3.1", "packages/experience": "2.3.0" } diff --git a/packages/api/CHANGELOG.md b/packages/api/CHANGELOG.md index 6d64a0cc..af63cca7 100644 --- a/packages/api/CHANGELOG.md +++ b/packages/api/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.1.2](https://github.com/convertcom/javascript-sdk/compare/js-sdk-api-v2.1.1...js-sdk-api-v2.1.2) (2025-03-26) + + +### Bug Fixes + +* allow smaller batch size in api manager ([07e9563](https://github.com/convertcom/javascript-sdk/commit/07e95630a8ebd9fcc63f896a881e62a2f4f0a682)) + ## [2.1.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-api-v2.1.0...js-sdk-api-v2.1.1) (2024-11-06) diff --git a/packages/api/package.json b/packages/api/package.json index 099be78e..3059b390 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -69,7 +69,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "2.1.1", + "version": "2.1.2", "peerDependencies": { "@convertcom/js-sdk-enums": ">=2.2.0", "@convertcom/js-sdk-event": ">=2.1.0", diff --git a/packages/data/CHANGELOG.md b/packages/data/CHANGELOG.md index 1a03c23c..12c52022 100644 --- a/packages/data/CHANGELOG.md +++ b/packages/data/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.3.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-data-v3.3.0...js-sdk-data-v3.3.1) (2025-03-26) + + +### Bug Fixes + +* set visitor default segments when using custom interface for "visitorProperties" ([abe94f4](https://github.com/convertcom/javascript-sdk/commit/abe94f4f4f185cd5af091c0fb48ec04a6a2f8434)) + ## [3.3.0](https://github.com/convertcom/javascript-sdk/compare/js-sdk-data-v3.2.1...js-sdk-data-v3.3.0) (2024-11-26) diff --git a/packages/data/package.json b/packages/data/package.json index bb514035..c79f1dc9 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -69,7 +69,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "3.3.0", + "version": "3.3.1", "peerDependencies": { "@convertcom/js-sdk-api": ">=2.1.1", "@convertcom/js-sdk-bucketing": ">=3.1.0", diff --git a/packages/rules/CHANGELOG.md b/packages/rules/CHANGELOG.md index 9eefb19f..a5abb1e6 100644 --- a/packages/rules/CHANGELOG.md +++ b/packages/rules/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.1.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-rules-v2.1.0...js-sdk-rules-v2.1.1) (2025-03-26) + + +### Bug Fixes + +* properly evaluate OR rules for ensuring matched conditions positioned later in the list ([673cb63](https://github.com/convertcom/javascript-sdk/commit/673cb631bc396167e3599ddbe5412d43bdd832a6)) +* set visitor default segments when using custom interface for "visitorProperties" ([abe94f4](https://github.com/convertcom/javascript-sdk/commit/abe94f4f4f185cd5af091c0fb48ec04a6a2f8434)) + ## [2.1.0](https://github.com/convertcom/javascript-sdk/compare/js-sdk-rules-v2.0.0...js-sdk-rules-v2.1.0) (2024-07-16) diff --git a/packages/rules/package.json b/packages/rules/package.json index 91ec235f..11415024 100644 --- a/packages/rules/package.json +++ b/packages/rules/package.json @@ -69,7 +69,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "2.1.0", + "version": "2.1.1", "peerDependencies": { "@convertcom/js-sdk-enums": ">=2.2.0", "@convertcom/js-sdk-logger": ">=2.1.0", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index ddeca620..86f7c570 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [3.8.0](https://github.com/convertcom/javascript-sdk/compare/js-sdk-types-v3.7.0...js-sdk-types-v3.8.0) (2025-03-26) + + +### Features + +* automated TS Serving API update ([46b98b9](https://github.com/convertcom/javascript-sdk/commit/46b98b9f13156d53ccbf53f67ed1c9433fc033b3)) +* automated TS Serving API update ([78857bf](https://github.com/convertcom/javascript-sdk/commit/78857bf1a6544126a97c740d72727ea464b185bb)) + ## [3.7.0](https://github.com/convertcom/javascript-sdk/compare/js-sdk-types-v3.6.0...js-sdk-types-v3.7.0) (2024-11-26) diff --git a/packages/types/package.json b/packages/types/package.json index f91d156b..ece83382 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -49,7 +49,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "3.7.0", + "version": "3.8.0", "peerDependencies": { "@convertcom/js-sdk-enums": ">=2.2.0" } diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 4efd5ebc..7c100399 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.2.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-utils-v2.2.0...js-sdk-utils-v2.2.1) (2025-03-26) + + +### Bug Fixes + +* handle numeric strings in comparison rules ([cbca105](https://github.com/convertcom/javascript-sdk/commit/cbca1051a314bf22d40fb95ba035474632f7018d)) + ## [2.2.0](https://github.com/convertcom/javascript-sdk/compare/js-sdk-utils-v2.1.0...js-sdk-utils-v2.2.0) (2024-09-26) diff --git a/packages/utils/package.json b/packages/utils/package.json index c0af106b..569d6249 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -70,7 +70,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "2.2.0", + "version": "2.2.1", "peerDependencies": { "@convertcom/js-sdk-enums": ">=2.2.0" } From b37595a66c76b26f5bc6b2a341a0488cfc14f304 Mon Sep 17 00:00:00 2001 From: Ahmed Abbas Date: Wed, 26 Mar 2025 03:37:47 +0200 Subject: [PATCH 02/12] chore: expose "data" property --- packages/js-sdk/README.md | 1 + packages/js-sdk/src/interfaces/core.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/js-sdk/README.md b/packages/js-sdk/README.md index b523f2f6..8f715647 100644 --- a/packages/js-sdk/README.md +++ b/packages/js-sdk/README.md @@ -225,6 +225,7 @@ const convertSDK: ConvertInterface = new ConvertSDK({ environment: 'staging' // can also be "live"; this is configured in the Convert UI. } as ConvertConfig); convertSDK.onReady().then(() => { + console.log('SDK Data:', convertSDK.data); // create user context // run experience(s) // ... diff --git a/packages/js-sdk/src/interfaces/core.ts b/packages/js-sdk/src/interfaces/core.ts index 5be08cf2..9565d327 100644 --- a/packages/js-sdk/src/interfaces/core.ts +++ b/packages/js-sdk/src/interfaces/core.ts @@ -6,8 +6,10 @@ */ import {SystemEvents} from '@convertcom/js-sdk-enums'; import {ContextInterface} from './context'; +import {ConfigResponseData} from '@convertcom/js-sdk-types'; export interface CoreInterface { + data: ConfigResponseData; createContext( visitorId: string, visitorAttributes?: Record From 5df9d295af348485a2f8a1aff8c5440ef1552681 Mon Sep 17 00:00:00 2001 From: Ahmed Abbas Date: Wed, 26 Mar 2025 03:42:18 +0200 Subject: [PATCH 03/12] fix: expose "data" property From 7be8b9a90cc5e29ad642faf68a3a9c69677e9bf1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 01:45:59 +0000 Subject: [PATCH 04/12] chore: release main --- .release-please-manifest.json | 24 ++++++++++++------------ packages/api/CHANGELOG.md | 7 +++++++ packages/api/package.json | 2 +- packages/bucketing/CHANGELOG.md | 7 +++++++ packages/bucketing/package.json | 2 +- packages/data/CHANGELOG.md | 7 +++++++ packages/data/package.json | 2 +- packages/enums/CHANGELOG.md | 7 +++++++ packages/enums/package.json | 2 +- packages/event/CHANGELOG.md | 7 +++++++ packages/event/package.json | 2 +- packages/experience/CHANGELOG.md | 7 +++++++ packages/experience/package.json | 2 +- packages/js-sdk/CHANGELOG.md | 7 +++++++ packages/js-sdk/package.json | 2 +- packages/logger/CHANGELOG.md | 7 +++++++ packages/logger/package.json | 2 +- packages/rules/CHANGELOG.md | 7 +++++++ packages/rules/package.json | 2 +- packages/segments/CHANGELOG.md | 7 +++++++ packages/segments/package.json | 2 +- packages/types/CHANGELOG.md | 7 +++++++ packages/types/package.json | 2 +- packages/utils/CHANGELOG.md | 7 +++++++ packages/utils/package.json | 2 +- 25 files changed, 108 insertions(+), 24 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0474625c..92e5009a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,14 +1,14 @@ { - "packages/js-sdk": "4.3.0", - "packages/enums": "2.2.0", - "packages/types": "3.8.0", - "packages/utils": "2.2.1", - "packages/event": "2.1.1", - "packages/bucketing": "3.1.0", - "packages/logger": "2.1.0", - "packages/rules": "2.1.1", - "packages/segments": "2.1.0", - "packages/api": "2.1.2", - "packages/data": "3.3.1", - "packages/experience": "2.3.0" + "packages/js-sdk": "4.3.1", + "packages/enums": "2.2.1", + "packages/types": "3.8.1", + "packages/utils": "2.2.2", + "packages/event": "2.1.2", + "packages/bucketing": "3.1.1", + "packages/logger": "2.1.1", + "packages/rules": "2.1.2", + "packages/segments": "2.1.1", + "packages/api": "2.1.3", + "packages/data": "3.3.2", + "packages/experience": "2.3.1" } diff --git a/packages/api/CHANGELOG.md b/packages/api/CHANGELOG.md index af63cca7..30095f52 100644 --- a/packages/api/CHANGELOG.md +++ b/packages/api/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.1.3](https://github.com/convertcom/javascript-sdk/compare/js-sdk-api-v2.1.2...js-sdk-api-v2.1.3) (2025-03-26) + + +### Bug Fixes + +* expose "data" property ([9c5528d](https://github.com/convertcom/javascript-sdk/commit/9c5528d8989bbca80c7c4b56fa8fb1b4e1d2826d)) + ## [2.1.2](https://github.com/convertcom/javascript-sdk/compare/js-sdk-api-v2.1.1...js-sdk-api-v2.1.2) (2025-03-26) diff --git a/packages/api/package.json b/packages/api/package.json index 3059b390..9d38d230 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -69,7 +69,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "2.1.2", + "version": "2.1.3", "peerDependencies": { "@convertcom/js-sdk-enums": ">=2.2.0", "@convertcom/js-sdk-event": ">=2.1.0", diff --git a/packages/bucketing/CHANGELOG.md b/packages/bucketing/CHANGELOG.md index b68656e9..6ce47eaf 100644 --- a/packages/bucketing/CHANGELOG.md +++ b/packages/bucketing/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.1.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-bucketing-v3.1.0...js-sdk-bucketing-v3.1.1) (2025-03-26) + + +### Bug Fixes + +* expose "data" property ([9c5528d](https://github.com/convertcom/javascript-sdk/commit/9c5528d8989bbca80c7c4b56fa8fb1b4e1d2826d)) + ## [3.1.0](https://github.com/convertcom/javascript-sdk/compare/js-sdk-bucketing-v3.0.0...js-sdk-bucketing-v3.1.0) (2024-07-16) diff --git a/packages/bucketing/package.json b/packages/bucketing/package.json index 0e91cffb..11a7e1bd 100644 --- a/packages/bucketing/package.json +++ b/packages/bucketing/package.json @@ -69,7 +69,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "3.1.0", + "version": "3.1.1", "peerDependencies": { "@convertcom/js-sdk-enums": ">=2.2.0", "@convertcom/js-sdk-logger": ">=2.1.0", diff --git a/packages/data/CHANGELOG.md b/packages/data/CHANGELOG.md index 12c52022..98a553fe 100644 --- a/packages/data/CHANGELOG.md +++ b/packages/data/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.3.2](https://github.com/convertcom/javascript-sdk/compare/js-sdk-data-v3.3.1...js-sdk-data-v3.3.2) (2025-03-26) + + +### Bug Fixes + +* expose "data" property ([9c5528d](https://github.com/convertcom/javascript-sdk/commit/9c5528d8989bbca80c7c4b56fa8fb1b4e1d2826d)) + ## [3.3.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-data-v3.3.0...js-sdk-data-v3.3.1) (2025-03-26) diff --git a/packages/data/package.json b/packages/data/package.json index c79f1dc9..8ba493a9 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -69,7 +69,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "3.3.1", + "version": "3.3.2", "peerDependencies": { "@convertcom/js-sdk-api": ">=2.1.1", "@convertcom/js-sdk-bucketing": ">=3.1.0", diff --git a/packages/enums/CHANGELOG.md b/packages/enums/CHANGELOG.md index cbe50fcb..a3cd66f8 100644 --- a/packages/enums/CHANGELOG.md +++ b/packages/enums/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.2.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-enums-v2.2.0...js-sdk-enums-v2.2.1) (2025-03-26) + + +### Bug Fixes + +* expose "data" property ([9c5528d](https://github.com/convertcom/javascript-sdk/commit/9c5528d8989bbca80c7c4b56fa8fb1b4e1d2826d)) + ## [2.2.0](https://github.com/convertcom/javascript-sdk/compare/js-sdk-enums-v2.1.0...js-sdk-enums-v2.2.0) (2024-07-16) diff --git a/packages/enums/package.json b/packages/enums/package.json index d2fcc54e..ccb67df6 100644 --- a/packages/enums/package.json +++ b/packages/enums/package.json @@ -49,5 +49,5 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "2.2.0" + "version": "2.2.1" } diff --git a/packages/event/CHANGELOG.md b/packages/event/CHANGELOG.md index 80bb7f15..7e672a2c 100644 --- a/packages/event/CHANGELOG.md +++ b/packages/event/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.1.2](https://github.com/convertcom/javascript-sdk/compare/js-sdk-event-v2.1.1...js-sdk-event-v2.1.2) (2025-03-26) + + +### Bug Fixes + +* expose "data" property ([9c5528d](https://github.com/convertcom/javascript-sdk/commit/9c5528d8989bbca80c7c4b56fa8fb1b4e1d2826d)) + ## [2.1.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-event-v2.1.0...js-sdk-event-v2.1.1) (2024-11-26) diff --git a/packages/event/package.json b/packages/event/package.json index 44ace351..6a52379e 100644 --- a/packages/event/package.json +++ b/packages/event/package.json @@ -69,7 +69,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "2.1.1", + "version": "2.1.2", "peerDependencies": { "@convertcom/js-sdk-enums": ">=2.2.0", "@convertcom/js-sdk-logger": ">=2.1.0", diff --git a/packages/experience/CHANGELOG.md b/packages/experience/CHANGELOG.md index 96cfe4e1..a9ca7710 100644 --- a/packages/experience/CHANGELOG.md +++ b/packages/experience/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.3.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-experience-v2.3.0...js-sdk-experience-v2.3.1) (2025-03-26) + + +### Bug Fixes + +* expose "data" property ([9c5528d](https://github.com/convertcom/javascript-sdk/commit/9c5528d8989bbca80c7c4b56fa8fb1b4e1d2826d)) + ## [2.3.0](https://github.com/convertcom/javascript-sdk/compare/js-sdk-experience-v2.2.0...js-sdk-experience-v2.3.0) (2024-11-26) diff --git a/packages/experience/package.json b/packages/experience/package.json index b13161eb..17a866d0 100644 --- a/packages/experience/package.json +++ b/packages/experience/package.json @@ -69,7 +69,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "2.3.0", + "version": "2.3.1", "peerDependencies": { "@convertcom/js-sdk-data": ">=3.2.1", "@convertcom/js-sdk-enums": ">=2.2.0", diff --git a/packages/js-sdk/CHANGELOG.md b/packages/js-sdk/CHANGELOG.md index 24ba7cb8..5da9fc66 100644 --- a/packages/js-sdk/CHANGELOG.md +++ b/packages/js-sdk/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [4.3.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-v4.3.0...js-sdk-v4.3.1) (2025-03-26) + + +### Bug Fixes + +* expose "data" property ([9c5528d](https://github.com/convertcom/javascript-sdk/commit/9c5528d8989bbca80c7c4b56fa8fb1b4e1d2826d)) + ## [4.3.0](https://github.com/convertcom/javascript-sdk/compare/js-sdk-v4.2.2...js-sdk-v4.3.0) (2024-11-26) diff --git a/packages/js-sdk/package.json b/packages/js-sdk/package.json index 713eaf47..ef8ab3b3 100644 --- a/packages/js-sdk/package.json +++ b/packages/js-sdk/package.json @@ -106,7 +106,7 @@ "browserstack-local": "1.5.5" } }, - "version": "4.3.0", + "version": "4.3.1", "peerDependencies": { "@convertcom/js-sdk-api": ">=2.1.1", "@convertcom/js-sdk-bucketing": ">=3.1.0", diff --git a/packages/logger/CHANGELOG.md b/packages/logger/CHANGELOG.md index 140bdf7a..fc790f93 100644 --- a/packages/logger/CHANGELOG.md +++ b/packages/logger/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.1.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-logger-v2.1.0...js-sdk-logger-v2.1.1) (2025-03-26) + + +### Bug Fixes + +* expose "data" property ([9c5528d](https://github.com/convertcom/javascript-sdk/commit/9c5528d8989bbca80c7c4b56fa8fb1b4e1d2826d)) + ## [2.1.0](https://github.com/convertcom/javascript-sdk/compare/js-sdk-logger-v2.0.0...js-sdk-logger-v2.1.0) (2024-07-16) diff --git a/packages/logger/package.json b/packages/logger/package.json index 4bca6f5b..50968055 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -66,7 +66,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "2.1.0", + "version": "2.1.1", "peerDependencies": { "@convertcom/js-sdk-enums": ">=2.2.0" } diff --git a/packages/rules/CHANGELOG.md b/packages/rules/CHANGELOG.md index a5abb1e6..e34ed8a2 100644 --- a/packages/rules/CHANGELOG.md +++ b/packages/rules/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.1.2](https://github.com/convertcom/javascript-sdk/compare/js-sdk-rules-v2.1.1...js-sdk-rules-v2.1.2) (2025-03-26) + + +### Bug Fixes + +* expose "data" property ([9c5528d](https://github.com/convertcom/javascript-sdk/commit/9c5528d8989bbca80c7c4b56fa8fb1b4e1d2826d)) + ## [2.1.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-rules-v2.1.0...js-sdk-rules-v2.1.1) (2025-03-26) diff --git a/packages/rules/package.json b/packages/rules/package.json index 11415024..d435598b 100644 --- a/packages/rules/package.json +++ b/packages/rules/package.json @@ -69,7 +69,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "2.1.1", + "version": "2.1.2", "peerDependencies": { "@convertcom/js-sdk-enums": ">=2.2.0", "@convertcom/js-sdk-logger": ">=2.1.0", diff --git a/packages/segments/CHANGELOG.md b/packages/segments/CHANGELOG.md index a4fe92b3..b0b64f38 100644 --- a/packages/segments/CHANGELOG.md +++ b/packages/segments/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.1.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-segments-v2.1.0...js-sdk-segments-v2.1.1) (2025-03-26) + + +### Bug Fixes + +* expose "data" property ([9c5528d](https://github.com/convertcom/javascript-sdk/commit/9c5528d8989bbca80c7c4b56fa8fb1b4e1d2826d)) + ## [2.1.0](https://github.com/convertcom/javascript-sdk/compare/js-sdk-segments-v2.0.1...js-sdk-segments-v2.1.0) (2024-07-16) diff --git a/packages/segments/package.json b/packages/segments/package.json index 65cf0ea3..76385d00 100644 --- a/packages/segments/package.json +++ b/packages/segments/package.json @@ -69,7 +69,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "2.1.0", + "version": "2.1.1", "peerDependencies": { "@convertcom/js-sdk-data": ">=3.2.1", "@convertcom/js-sdk-enums": ">=2.2.0", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 86f7c570..b92ba8e1 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.8.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-types-v3.8.0...js-sdk-types-v3.8.1) (2025-03-26) + + +### Bug Fixes + +* expose "data" property ([9c5528d](https://github.com/convertcom/javascript-sdk/commit/9c5528d8989bbca80c7c4b56fa8fb1b4e1d2826d)) + ## [3.8.0](https://github.com/convertcom/javascript-sdk/compare/js-sdk-types-v3.7.0...js-sdk-types-v3.8.0) (2025-03-26) diff --git a/packages/types/package.json b/packages/types/package.json index ece83382..fc6a06f9 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -49,7 +49,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "3.8.0", + "version": "3.8.1", "peerDependencies": { "@convertcom/js-sdk-enums": ">=2.2.0" } diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 7c100399..4569e037 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.2.2](https://github.com/convertcom/javascript-sdk/compare/js-sdk-utils-v2.2.1...js-sdk-utils-v2.2.2) (2025-03-26) + + +### Bug Fixes + +* expose "data" property ([9c5528d](https://github.com/convertcom/javascript-sdk/commit/9c5528d8989bbca80c7c4b56fa8fb1b4e1d2826d)) + ## [2.2.1](https://github.com/convertcom/javascript-sdk/compare/js-sdk-utils-v2.2.0...js-sdk-utils-v2.2.1) (2025-03-26) diff --git a/packages/utils/package.json b/packages/utils/package.json index 569d6249..0cee508b 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -70,7 +70,7 @@ "typescript-eslint": "^7.13.1", "webpack": "^5.92.0" }, - "version": "2.2.1", + "version": "2.2.2", "peerDependencies": { "@convertcom/js-sdk-enums": ">=2.2.0" } From dc49c20f4237b63ecda1ed5d230d228e8b35d2a7 Mon Sep 17 00:00:00 2001 From: Ahmed Abbas Date: Mon, 28 Apr 2025 21:15:20 +0300 Subject: [PATCH 05/12] fix: Improve numeric check utility --- packages/utils/src/string-utils.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/utils/src/string-utils.ts b/packages/utils/src/string-utils.ts index 1066bde0..aa7e9eb7 100644 --- a/packages/utils/src/string-utils.ts +++ b/packages/utils/src/string-utils.ts @@ -66,11 +66,11 @@ export function generateHash(value: string, seed = 9999): number { * @returns {boolean} */ export function isNumeric(value: string | number): boolean { - if (typeof value === 'number') { - return true; - } - const number = parseFloat(String(value)); - return Number.isFinite(number) && !isNaN(number); + const regex = /^-?(?:(?:\d{1,3}(?:,\d{3})+|\d+)(?:\.\d+)?|\.\d+)$/; + if (typeof value === 'number') return Number.isFinite(value); + if (typeof value !== 'string' || !regex.test(value)) return false; + const num = parseFloat(value.replace(/,/g, '')); + return Number.isFinite(num); } /** From 112017fa49a4c94ce3ff963e1c98ea4411ebde19 Mon Sep 17 00:00:00 2001 From: DmytroConvert Date: Sat, 24 May 2025 10:27:17 +0000 Subject: [PATCH 06/12] feat: automated TS Serving API update --- packages/types/src/config/types.gen.ts | 3330 +++++++++++------------- 1 file changed, 1569 insertions(+), 1761 deletions(-) diff --git a/packages/types/src/config/types.gen.ts b/packages/types/src/config/types.gen.ts index e81716e3..c0b5468c 100644 --- a/packages/types/src/config/types.gen.ts +++ b/packages/types/src/config/types.gen.ts @@ -4,20 +4,20 @@ * Base Audience object */ export type ConfigAudience = { - /** - * Audience ID - */ - id?: string; - /** - * Audience unique key - */ - key?: string; - /** - * Audience Name - */ - name?: string; - type?: ConfigAudienceTypes; - rules?: RuleObject | null; + /** + * Audience ID + */ + id?: string; + /** + * Audience unique key + */ + key?: string; + /** + * Audience Name + */ + name?: string; + type?: ConfigAudienceTypes; + rules?: ((RuleObject) | null); }; /** @@ -35,58 +35,58 @@ export type ConfigAudienceTypes = 'permanent' | 'transient'; * */ export const ConfigAudienceTypes = { - PERMANENT: 'permanent', - TRANSIENT: 'transient' + PERMANENT: 'permanent', + TRANSIENT: 'transient' } as const; export type PageNumber = { - /** - * Describes the page number of the fetched results. "results_per_page" results are gonna be returned for each page - * - * Defaults to 1 when not sent - * - */ - page?: number; + /** + * Describes the page number of the fetched results. "results_per_page" results are gonna be returned for each page + * + * Defaults to 1 when not sent + * + */ + page?: number; }; export type Pagination = { - /** - * Current page number - */ - current_page?: number; - /** - * Total number of records - */ - items_count?: number; - /** - * Number of records per page - */ - items_per_page?: number; - /** - * Limitation number of records per page - */ - pages_count?: number; + /** + * Current page number + */ + current_page?: number; + /** + * Total number of records + */ + items_count?: number; + /** + * Number of records per page + */ + items_per_page?: number; + /** + * Limitation number of records per page + */ + pages_count?: number; }; export type ResultsPerPage = { - /** - * A value that would be used for setting the number of records that - * would be returned per page. - * - * Defaults to 30 when not sent - * - */ - results_per_page?: number | null; + /** + * A value that would be used for setting the number of records that + * would be returned per page. + * + * Defaults to 30 when not sent + * + */ + results_per_page?: (number) | null; }; export type SortDirection = { - /** - * Data sorting direction using "sort_by" field. "asc" for ascending direction, "desc" for descending direction - * - * Defaults to **desc** when not sent in a request - * - */ - sort_direction?: ('asc' | 'desc') | null; + /** + * Data sorting direction using "sort_by" field. "asc" for ascending direction, "desc" for descending direction + * + * Defaults to **desc** when not sent in a request + * + */ + sort_direction?: ('asc' | 'desc') | null; }; /** @@ -104,85 +104,85 @@ export type sort_direction = 'asc' | 'desc'; * */ export const sort_direction = { - ASC: 'asc', - DESC: 'desc' + ASC: 'asc', + DESC: 'desc' } as const; export type OnlyCount = { - /** - * When provided in requests that allow it, the response would only contain count of records and no real records' data - * - */ - onlyCount?: boolean; + /** + * When provided in requests that allow it, the response would only contain count of records and no real records' data + * + */ + onlyCount?: boolean; }; export type Extra = { - pagination?: Pagination; + pagination?: Pagination; }; export type BaseRule = { - /** - * It defines the type of the rule - */ - rule_type: string; + /** + * It defines the type of the rule + */ + rule_type: string; }; export type BaseRuleWithStringValue = BaseRule & { - /** - * The value used to match against 'rule_type' using 'matching' - */ - value?: string; + /** + * The value used to match against 'rule_type' using 'matching' + */ + value?: string; }; export type BaseRuleWithJsCodeValue = BaseRule & { - /** - * The JS code that would be executed when rule is checked. The return value of this JS code is what is gonna be matched - * against **true**(or **false** if **matching.negated = true** is provided) - * - */ - value?: string; + /** + * The JS code that would be executed when rule is checked. The return value of this JS code is what is gonna be matched + * against **true**(or **false** if **matching.negated = true** is provided) + * + */ + value?: string; }; export type BaseRuleWithBooleanValue = BaseRule & { - /** - * The value used to match against 'rule_type' using 'matching' - */ - value?: boolean; + /** + * The value used to match against 'rule_type' using 'matching' + */ + value?: boolean; }; export type BaseRuleWithNumericValue = BaseRule & { - /** - * The value used to match against 'rule_type' using 'matching' - */ - value?: number; + /** + * The value used to match against 'rule_type' using 'matching' + */ + value?: number; }; export type BaseRuleWithCountryCodeValue = BaseRule & { - /** - * The 2 letter ISO country code used for matching - */ - value?: string; + /** + * The 2 letter ISO country code used for matching + */ + value?: string; }; export type BaseRuleWithLanguageCodeValue = BaseRule & { - /** - * The 2 letter ISO language code used for matching - */ - value?: string; + /** + * The 2 letter ISO language code used for matching + */ + value?: string; }; export type BaseRuleWithGoalTriggeredValue = BaseRule & { - /** - * ID of the goal used for matching - */ - value?: number; + /** + * ID of the goal used for matching + */ + value?: number; }; export type BaseRuleWithVisitorTypeValue = BaseRule & { - /** - * Type of the visitors - */ - value?: 'new' | 'returning'; + /** + * Type of the visitors + */ + value?: 'new' | 'returning'; }; /** @@ -194,775 +194,624 @@ export type value = 'new' | 'returning'; * Type of the visitors */ export const value = { - NEW: 'new', - RETURNING: 'returning' + NEW: 'new', + RETURNING: 'returning' } as const; export type BaseRuleWithExperienceBucketedValue = BaseRule & { - /** - * ID of the experience used for matching - */ - value?: number; + /** + * ID of the experience used for matching + */ + value?: number; }; export type BaseRuleWithSegmentBucketedValue = BaseRule & { - /** - * ID of the segment used for matching - */ - value?: number; + /** + * ID of the segment used for matching + */ + value?: number; }; export type BaseRuleWithDayOfWeekValue = BaseRule & { - /** - * Day of week used for matching - */ - value?: number; + /** + * Day of week used for matching + */ + value?: number; }; export type BaseRuleWithHourOfDayValue = BaseRule & { - /** - * Hour of day used for matching - */ - value?: number; + /** + * Hour of day used for matching + */ + value?: number; }; export type BaseRuleWithMinuteOfHourValue = BaseRule & { - /** - * Minute of hour used for matching - */ - value?: number; + /** + * Minute of hour used for matching + */ + value?: number; }; export type BaseRuleWithBrowserNameValue = BaseRule & { - /** - * Browser name used for matching - */ - value?: - | 'chrome' - | 'microsoft_ie' - | 'firefox' - | 'microsoft_edge' - | 'mozilla' - | 'opera' - | 'safari'; + /** + * Browser name used for matching + */ + value?: 'chrome' | 'microsoft_ie' | 'firefox' | 'microsoft_edge' | 'mozilla' | 'opera' | 'safari'; }; /** * Browser name used for matching */ -export type value2 = - | 'chrome' - | 'microsoft_ie' - | 'firefox' - | 'microsoft_edge' - | 'mozilla' - | 'opera' - | 'safari'; +export type value2 = 'chrome' | 'microsoft_ie' | 'firefox' | 'microsoft_edge' | 'mozilla' | 'opera' | 'safari'; /** * Browser name used for matching */ export const value2 = { - CHROME: 'chrome', - MICROSOFT_IE: 'microsoft_ie', - FIREFOX: 'firefox', - MICROSOFT_EDGE: 'microsoft_edge', - MOZILLA: 'mozilla', - OPERA: 'opera', - SAFARI: 'safari' + CHROME: 'chrome', + MICROSOFT_IE: 'microsoft_ie', + FIREFOX: 'firefox', + MICROSOFT_EDGE: 'microsoft_edge', + MOZILLA: 'mozilla', + OPERA: 'opera', + SAFARI: 'safari' } as const; export type BaseRuleWithOsValue = BaseRule & { - /** - * Operating System name used for matching - */ - value?: - | 'android' - | 'iphone' - | 'ipod' - | 'ipad' - | 'windows' - | 'macos' - | 'linux'; + /** + * Operating System name used for matching + */ + value?: 'android' | 'iphone' | 'ipod' | 'ipad' | 'windows' | 'macos' | 'linux'; }; /** * Operating System name used for matching */ -export type value3 = - | 'android' - | 'iphone' - | 'ipod' - | 'ipad' - | 'windows' - | 'macos' - | 'linux'; +export type value3 = 'android' | 'iphone' | 'ipod' | 'ipad' | 'windows' | 'macos' | 'linux'; /** * Operating System name used for matching */ export const value3 = { - ANDROID: 'android', - IPHONE: 'iphone', - IPOD: 'ipod', - IPAD: 'ipad', - WINDOWS: 'windows', - MACOS: 'macos', - LINUX: 'linux' + ANDROID: 'android', + IPHONE: 'iphone', + IPOD: 'ipod', + IPAD: 'ipad', + WINDOWS: 'windows', + MACOS: 'macos', + LINUX: 'linux' } as const; export type BaseRuleWithWeatherConditionValue = BaseRule & { - /** - * Weather Condition name used for matching. Full or partial condition. - * The weather provider used by Convert detects the following conditions: - * - Blizzard - * - Blowing snow - * - Cloudy - * - Fog - * - Freezing drizzle - * - Freezing fog - * - Heavy freezing drizzle - * - Heavy rain - * - Heavy rain at times - * - Light drizzle - * - Light freezing rain - * - Light rain - * - Mist - * - Moderate rain - * - Moderate rain at times - * - Overcast - * - Partly cloudy - * - Patchy freezing drizzle possible - * - Patchy light drizzle - * - Patchy light rain - * - Patchy rain possible - * - Patchy sleet possible - * - Patchy snow possible - * - Sunny - * - Thundery outbreaks possible - * - */ - value?: string; + /** + * Weather Condition name used for matching. Full or partial condition. + * The weather provider used by Convert detects the following conditions: + * - Blizzard + * - Blowing snow + * - Cloudy + * - Fog + * - Freezing drizzle + * - Freezing fog + * - Heavy freezing drizzle + * - Heavy rain + * - Heavy rain at times + * - Light drizzle + * - Light freezing rain + * - Light rain + * - Mist + * - Moderate rain + * - Moderate rain at times + * - Overcast + * - Partly cloudy + * - Patchy freezing drizzle possible + * - Patchy light drizzle + * - Patchy light rain + * - Patchy rain possible + * - Patchy sleet possible + * - Patchy snow possible + * - Sunny + * - Thundery outbreaks possible + * + */ + value?: string; }; /** * Weather Conditions */ -export type WeatherConditions = - | 'Blizzard' - | 'Blowing snow' - | 'Cloudy' - | 'Fog' - | 'Freezing drizzle' - | 'Freezing fog' - | 'Heavy freezing drizzle' - | 'Heavy rain' - | 'Heavy rain at times' - | 'Light drizzle' - | 'Light freezing rain' - | 'Light rain' - | 'Mist' - | 'Moderate rain' - | 'Moderate rain at times' - | 'Overcast' - | 'Partly cloudy' - | 'Patchy freezing drizzle possible' - | 'Patchy light drizzle' - | 'Patchy light rain' - | 'Patchy rain possible' - | 'Patchy sleet possible' - | 'Patchy snow possible' - | 'Sunny' - | 'Thundery outbreaks possible'; +export type WeatherConditions = 'Blizzard' | 'Blowing snow' | 'Cloudy' | 'Fog' | 'Freezing drizzle' | 'Freezing fog' | 'Heavy freezing drizzle' | 'Heavy rain' | 'Heavy rain at times' | 'Light drizzle' | 'Light freezing rain' | 'Light rain' | 'Mist' | 'Moderate rain' | 'Moderate rain at times' | 'Overcast' | 'Partly cloudy' | 'Patchy freezing drizzle possible' | 'Patchy light drizzle' | 'Patchy light rain' | 'Patchy rain possible' | 'Patchy sleet possible' | 'Patchy snow possible' | 'Sunny' | 'Thundery outbreaks possible'; /** * Weather Conditions */ export const WeatherConditions = { - BLIZZARD: 'Blizzard', - BLOWING_SNOW: 'Blowing snow', - CLOUDY: 'Cloudy', - FOG: 'Fog', - FREEZING_DRIZZLE: 'Freezing drizzle', - FREEZING_FOG: 'Freezing fog', - HEAVY_FREEZING_DRIZZLE: 'Heavy freezing drizzle', - HEAVY_RAIN: 'Heavy rain', - HEAVY_RAIN_AT_TIMES: 'Heavy rain at times', - LIGHT_DRIZZLE: 'Light drizzle', - LIGHT_FREEZING_RAIN: 'Light freezing rain', - LIGHT_RAIN: 'Light rain', - MIST: 'Mist', - MODERATE_RAIN: 'Moderate rain', - MODERATE_RAIN_AT_TIMES: 'Moderate rain at times', - OVERCAST: 'Overcast', - PARTLY_CLOUDY: 'Partly cloudy', - PATCHY_FREEZING_DRIZZLE_POSSIBLE: 'Patchy freezing drizzle possible', - PATCHY_LIGHT_DRIZZLE: 'Patchy light drizzle', - PATCHY_LIGHT_RAIN: 'Patchy light rain', - PATCHY_RAIN_POSSIBLE: 'Patchy rain possible', - PATCHY_SLEET_POSSIBLE: 'Patchy sleet possible', - PATCHY_SNOW_POSSIBLE: 'Patchy snow possible', - SUNNY: 'Sunny', - THUNDERY_OUTBREAKS_POSSIBLE: 'Thundery outbreaks possible' + BLIZZARD: 'Blizzard', + BLOWING_SNOW: 'Blowing snow', + CLOUDY: 'Cloudy', + FOG: 'Fog', + FREEZING_DRIZZLE: 'Freezing drizzle', + FREEZING_FOG: 'Freezing fog', + HEAVY_FREEZING_DRIZZLE: 'Heavy freezing drizzle', + HEAVY_RAIN: 'Heavy rain', + HEAVY_RAIN_AT_TIMES: 'Heavy rain at times', + LIGHT_DRIZZLE: 'Light drizzle', + LIGHT_FREEZING_RAIN: 'Light freezing rain', + LIGHT_RAIN: 'Light rain', + MIST: 'Mist', + MODERATE_RAIN: 'Moderate rain', + MODERATE_RAIN_AT_TIMES: 'Moderate rain at times', + OVERCAST: 'Overcast', + PARTLY_CLOUDY: 'Partly cloudy', + PATCHY_FREEZING_DRIZZLE_POSSIBLE: 'Patchy freezing drizzle possible', + PATCHY_LIGHT_DRIZZLE: 'Patchy light drizzle', + PATCHY_LIGHT_RAIN: 'Patchy light rain', + PATCHY_RAIN_POSSIBLE: 'Patchy rain possible', + PATCHY_SLEET_POSSIBLE: 'Patchy sleet possible', + PATCHY_SNOW_POSSIBLE: 'Patchy snow possible', + SUNNY: 'Sunny', + THUNDERY_OUTBREAKS_POSSIBLE: 'Thundery outbreaks possible' } as const; export type BaseMatch = { - /** - * When true, the rule result is gonna be negated. - * example: `url contains "test"` with *negated* = true becomes `url does not contain "test"` - * - */ - negated?: boolean; -}; - -export type TextMatchRulesTypes = - | 'url' - | 'url_with_query' - | 'query_string' - | 'campaign' - | 'keyword' - | 'medium' - | 'source_name' - | 'city' - | 'region' - | 'browser_version' - | 'user_agent' - | 'page_tag_page_type' - | 'page_tag_category_id' - | 'page_tag_category_name' - | 'page_tag_product_sku' - | 'page_tag_product_name' - | 'page_tag_customer_id' - | 'page_tag_custom_1' - | 'page_tag_custom_2' - | 'page_tag_custom_3' - | 'page_tag_custom_4'; + /** + * When true, the rule result is gonna be negated. + * example: `url contains "test"` with *negated* = true becomes `url does not contain "test"` + * + */ + negated?: boolean; +}; + +export type TextMatchRulesTypes = 'url' | 'url_with_query' | 'query_string' | 'campaign' | 'keyword' | 'medium' | 'source_name' | 'city' | 'region' | 'browser_version' | 'user_agent' | 'page_tag_page_type' | 'page_tag_category_id' | 'page_tag_category_name' | 'page_tag_product_sku' | 'page_tag_product_name' | 'page_tag_customer_id' | 'page_tag_custom_1' | 'page_tag_custom_2' | 'page_tag_custom_3' | 'page_tag_custom_4'; export const TextMatchRulesTypes = { - URL: 'url', - URL_WITH_QUERY: 'url_with_query', - QUERY_STRING: 'query_string', - CAMPAIGN: 'campaign', - KEYWORD: 'keyword', - MEDIUM: 'medium', - SOURCE_NAME: 'source_name', - CITY: 'city', - REGION: 'region', - BROWSER_VERSION: 'browser_version', - USER_AGENT: 'user_agent', - PAGE_TAG_PAGE_TYPE: 'page_tag_page_type', - PAGE_TAG_CATEGORY_ID: 'page_tag_category_id', - PAGE_TAG_CATEGORY_NAME: 'page_tag_category_name', - PAGE_TAG_PRODUCT_SKU: 'page_tag_product_sku', - PAGE_TAG_PRODUCT_NAME: 'page_tag_product_name', - PAGE_TAG_CUSTOMER_ID: 'page_tag_customer_id', - PAGE_TAG_CUSTOM_1: 'page_tag_custom_1', - PAGE_TAG_CUSTOM_2: 'page_tag_custom_2', - PAGE_TAG_CUSTOM_3: 'page_tag_custom_3', - PAGE_TAG_CUSTOM_4: 'page_tag_custom_4' -} as const; - -export type NumericMatchRulesTypes = - | 'avg_time_page' - | 'days_since_last_visit' - | 'pages_visited_count' - | 'visit_duration' - | 'visits_count' - | 'page_tag_product_price'; + URL: 'url', + URL_WITH_QUERY: 'url_with_query', + QUERY_STRING: 'query_string', + CAMPAIGN: 'campaign', + KEYWORD: 'keyword', + MEDIUM: 'medium', + SOURCE_NAME: 'source_name', + CITY: 'city', + REGION: 'region', + BROWSER_VERSION: 'browser_version', + USER_AGENT: 'user_agent', + PAGE_TAG_PAGE_TYPE: 'page_tag_page_type', + PAGE_TAG_CATEGORY_ID: 'page_tag_category_id', + PAGE_TAG_CATEGORY_NAME: 'page_tag_category_name', + PAGE_TAG_PRODUCT_SKU: 'page_tag_product_sku', + PAGE_TAG_PRODUCT_NAME: 'page_tag_product_name', + PAGE_TAG_CUSTOMER_ID: 'page_tag_customer_id', + PAGE_TAG_CUSTOM_1: 'page_tag_custom_1', + PAGE_TAG_CUSTOM_2: 'page_tag_custom_2', + PAGE_TAG_CUSTOM_3: 'page_tag_custom_3', + PAGE_TAG_CUSTOM_4: 'page_tag_custom_4' +} as const; + +export type NumericMatchRulesTypes = 'avg_time_page' | 'days_since_last_visit' | 'pages_visited_count' | 'visit_duration' | 'visits_count' | 'page_tag_product_price'; export const NumericMatchRulesTypes = { - AVG_TIME_PAGE: 'avg_time_page', - DAYS_SINCE_LAST_VISIT: 'days_since_last_visit', - PAGES_VISITED_COUNT: 'pages_visited_count', - VISIT_DURATION: 'visit_duration', - VISITS_COUNT: 'visits_count', - PAGE_TAG_PRODUCT_PRICE: 'page_tag_product_price' + AVG_TIME_PAGE: 'avg_time_page', + DAYS_SINCE_LAST_VISIT: 'days_since_last_visit', + PAGES_VISITED_COUNT: 'pages_visited_count', + VISIT_DURATION: 'visit_duration', + VISITS_COUNT: 'visits_count', + PAGE_TAG_PRODUCT_PRICE: 'page_tag_product_price' } as const; -export type BoolMatchRulesTypes = - | 'bucketed_into_experience' - | 'is_desktop' - | 'is_mobile' - | 'is_tablet'; +export type BoolMatchRulesTypes = 'bucketed_into_experience' | 'is_desktop' | 'is_mobile' | 'is_tablet'; export const BoolMatchRulesTypes = { - BUCKETED_INTO_EXPERIENCE: 'bucketed_into_experience', - IS_DESKTOP: 'is_desktop', - IS_MOBILE: 'is_mobile', - IS_TABLET: 'is_tablet' + BUCKETED_INTO_EXPERIENCE: 'bucketed_into_experience', + IS_DESKTOP: 'is_desktop', + IS_MOBILE: 'is_mobile', + IS_TABLET: 'is_tablet' } as const; export type GenericTextKeyValueMatchRulesTypes = 'generic_text_key_value'; export const GenericTextKeyValueMatchRulesTypes = { - GENERIC_TEXT_KEY_VALUE: 'generic_text_key_value' + GENERIC_TEXT_KEY_VALUE: 'generic_text_key_value' } as const; export type GenericNumericKeyValueMatchRulesTypes = 'generic_numeric_key_value'; export const GenericNumericKeyValueMatchRulesTypes = { - GENERIC_NUMERIC_KEY_VALUE: 'generic_numeric_key_value' + GENERIC_NUMERIC_KEY_VALUE: 'generic_numeric_key_value' } as const; export type GenericBoolKeyValueMatchRulesTypes = 'generic_bool_key_value'; export const GenericBoolKeyValueMatchRulesTypes = { - GENERIC_BOOL_KEY_VALUE: 'generic_bool_key_value' + GENERIC_BOOL_KEY_VALUE: 'generic_bool_key_value' } as const; export type JsConditionMatchRulesTypes = 'js_condition'; export const JsConditionMatchRulesTypes = { - JS_CONDITION: 'js_condition' + JS_CONDITION: 'js_condition' } as const; -export type KeyValueMatchRulesTypes = GenericTextKeyValueMatchRulesTypes & - GenericNumericKeyValueMatchRulesTypes & - GenericBoolKeyValueMatchRulesTypes; +export type KeyValueMatchRulesTypes = GenericTextKeyValueMatchRulesTypes & GenericNumericKeyValueMatchRulesTypes & GenericBoolKeyValueMatchRulesTypes; export type CookieMatchRulesTypes = 'cookie'; export const CookieMatchRulesTypes = { - COOKIE: 'cookie' + COOKIE: 'cookie' } as const; export type CountryMatchRulesTypes = 'country'; export const CountryMatchRulesTypes = { - COUNTRY: 'country' + COUNTRY: 'country' } as const; export type VisitorTypeMatchRulesTypes = 'visitor_type'; export const VisitorTypeMatchRulesTypes = { - VISITOR_TYPE: 'visitor_type' + VISITOR_TYPE: 'visitor_type' } as const; export type LanguageMatchRulesTypes = 'language'; export const LanguageMatchRulesTypes = { - LANGUAGE: 'language' + LANGUAGE: 'language' } as const; export type GoalTriggeredMatchRulesTypes = 'goal_triggered'; export const GoalTriggeredMatchRulesTypes = { - GOAL_TRIGGERED: 'goal_triggered' + GOAL_TRIGGERED: 'goal_triggered' } as const; export type SegmentBucketedMatchRulesTypes = 'bucketed_into_segment'; export const SegmentBucketedMatchRulesTypes = { - BUCKETED_INTO_SEGMENT: 'bucketed_into_segment' + BUCKETED_INTO_SEGMENT: 'bucketed_into_segment' } as const; -export type DayOfWeekMatchRulesTypes = - | 'local_time_day_of_week' - | 'project_time_day_of_week'; +export type DayOfWeekMatchRulesTypes = 'local_time_day_of_week' | 'project_time_day_of_week'; export const DayOfWeekMatchRulesTypes = { - LOCAL_TIME_DAY_OF_WEEK: 'local_time_day_of_week', - PROJECT_TIME_DAY_OF_WEEK: 'project_time_day_of_week' + LOCAL_TIME_DAY_OF_WEEK: 'local_time_day_of_week', + PROJECT_TIME_DAY_OF_WEEK: 'project_time_day_of_week' } as const; -export type HourOfDayMatchRulesTypes = - | 'local_time_hour_of_day' - | 'project_time_hour_of_day'; +export type HourOfDayMatchRulesTypes = 'local_time_hour_of_day' | 'project_time_hour_of_day'; export const HourOfDayMatchRulesTypes = { - LOCAL_TIME_HOUR_OF_DAY: 'local_time_hour_of_day', - PROJECT_TIME_HOUR_OF_DAY: 'project_time_hour_of_day' + LOCAL_TIME_HOUR_OF_DAY: 'local_time_hour_of_day', + PROJECT_TIME_HOUR_OF_DAY: 'project_time_hour_of_day' } as const; -export type MinuteOfHourMatchRulesTypes = - | 'local_time_minute_of_hour' - | 'project_time_minute_of_hour'; +export type MinuteOfHourMatchRulesTypes = 'local_time_minute_of_hour' | 'project_time_minute_of_hour'; export const MinuteOfHourMatchRulesTypes = { - LOCAL_TIME_MINUTE_OF_HOUR: 'local_time_minute_of_hour', - PROJECT_TIME_MINUTE_OF_HOUR: 'project_time_minute_of_hour' + LOCAL_TIME_MINUTE_OF_HOUR: 'local_time_minute_of_hour', + PROJECT_TIME_MINUTE_OF_HOUR: 'project_time_minute_of_hour' } as const; export type BrowserNameMatchRulesTypes = 'browser_name'; export const BrowserNameMatchRulesTypes = { - BROWSER_NAME: 'browser_name' + BROWSER_NAME: 'browser_name' } as const; export type OsMatchRulesTypes = 'os'; export const OsMatchRulesTypes = { - OS: 'os' + OS: 'os' } as const; export type WeatherConditionMatchRulesTypes = 'weather_condition'; export const WeatherConditionMatchRulesTypes = { - WEATHER_CONDITION: 'weather_condition' -} as const; - -export type RulesTypes = TextMatchRulesTypes & - NumericMatchRulesTypes & - BoolMatchRulesTypes & - KeyValueMatchRulesTypes & - CookieMatchRulesTypes & - CountryMatchRulesTypes & - VisitorTypeMatchRulesTypes & - LanguageMatchRulesTypes & - GoalTriggeredMatchRulesTypes & - SegmentBucketedMatchRulesTypes & - DayOfWeekMatchRulesTypes & - HourOfDayMatchRulesTypes & - MinuteOfHourMatchRulesTypes & - BrowserNameMatchRulesTypes & - OsMatchRulesTypes & - WeatherConditionMatchRulesTypes; + WEATHER_CONDITION: 'weather_condition' +} as const; + +export type RulesTypes = TextMatchRulesTypes & NumericMatchRulesTypes & BoolMatchRulesTypes & KeyValueMatchRulesTypes & CookieMatchRulesTypes & CountryMatchRulesTypes & VisitorTypeMatchRulesTypes & LanguageMatchRulesTypes & GoalTriggeredMatchRulesTypes & SegmentBucketedMatchRulesTypes & DayOfWeekMatchRulesTypes & HourOfDayMatchRulesTypes & MinuteOfHourMatchRulesTypes & BrowserNameMatchRulesTypes & OsMatchRulesTypes & WeatherConditionMatchRulesTypes; export type GenericTextMatchRule = BaseRuleWithStringValue & { - rule_type: TextMatchRulesTypes; - matching?: BaseMatch & { + rule_type: TextMatchRulesTypes; + matching?: (BaseMatch & { match_type?: TextMatchingOptions; - }; +}); }; export type GenericNumericMatchRule = BaseRuleWithNumericValue & { - rule_type: NumericMatchRulesTypes; - matching?: BaseMatch & { + rule_type: NumericMatchRulesTypes; + matching?: (BaseMatch & { match_type?: NumericMatchingOptions; - }; +}); }; export type GenericBoolMatchRule = BaseRuleWithBooleanValue & { - rule_type: BoolMatchRulesTypes; - matching?: BaseMatch & { + rule_type: BoolMatchRulesTypes; + matching?: (BaseMatch & { match_type?: ChoiceMatchingOptions; - }; +}); }; export type GenericSetMatchRule = BaseRuleWithStringValue & { - rule_type: string; - matching?: BaseMatch & { + rule_type: string; + matching?: (BaseMatch & { match_type?: SetMatchingOptions; - }; +}); }; export type GenericKey = { - /** - * The key used to identify the data that would be matched against rule **value** - */ - key?: string; + /** + * The key used to identify the data that would be matched against rule **value** + */ + key?: string; }; export type GenericTextKeyValueMatchRule = BaseRuleWithStringValue & { - rule_type: GenericTextKeyValueMatchRulesTypes; - matching?: BaseMatch & { + rule_type: GenericTextKeyValueMatchRulesTypes; + matching?: (BaseMatch & { match_type?: TextMatchingOptions; - }; +}); } & GenericKey; export type GenericNumericKeyValueMatchRule = BaseRuleWithNumericValue & { - rule_type: GenericNumericKeyValueMatchRulesTypes; - matching?: BaseMatch & { + rule_type: GenericNumericKeyValueMatchRulesTypes; + matching?: (BaseMatch & { match_type?: NumericMatchingOptions; - }; +}); } & GenericKey; export type GenericBoolKeyValueMatchRule = BaseRuleWithBooleanValue & { - rule_type: GenericBoolKeyValueMatchRulesTypes; - matching?: BaseMatch & { + rule_type: GenericBoolKeyValueMatchRulesTypes; + matching?: (BaseMatch & { match_type?: ChoiceMatchingOptions; - }; +}); } & GenericKey; export type CookieMatchRule = BaseRuleWithStringValue & { - rule_type: CookieMatchRulesTypes; - matching?: BaseMatch & { + rule_type: CookieMatchRulesTypes; + matching?: (BaseMatch & { match_type?: TextMatchingOptions; - }; - /** - * The name of the cookie which value is compared to the given rule value - */ - key?: string; +}); + /** + * The name of the cookie which value is compared to the given rule value + */ + key?: string; }; export type CountryMatchRule = BaseRuleWithCountryCodeValue & { - rule_type: CountryMatchRulesTypes; - matching?: BaseMatch & { + rule_type: CountryMatchRulesTypes; + matching?: (BaseMatch & { match_type?: ChoiceMatchingOptions; - }; +}); }; export type JsConditionMatchRule = BaseRuleWithJsCodeValue & { - rule_type: JsConditionMatchRulesTypes; - matching?: BaseMatch & { + rule_type: JsConditionMatchRulesTypes; + matching?: (BaseMatch & { match_type?: ChoiceMatchingOptions; - }; +}); }; export type VisitorTypeMatchRule = BaseRuleWithVisitorTypeValue & { - rule_type: VisitorTypeMatchRulesTypes; - matching?: BaseMatch & { + rule_type: VisitorTypeMatchRulesTypes; + matching?: (BaseMatch & { match_type?: ChoiceMatchingOptions; - }; +}); }; export type LanguageMatchRule = BaseRuleWithLanguageCodeValue & { - rule_type: LanguageMatchRulesTypes; - matching?: BaseMatch & { + rule_type: LanguageMatchRulesTypes; + matching?: (BaseMatch & { match_type?: ChoiceMatchingOptions; - }; +}); }; export type GoalTriggeredMatchRule = BaseRuleWithGoalTriggeredValue & { - rule_type: GoalTriggeredMatchRulesTypes; - matching?: BaseMatch & { + rule_type: GoalTriggeredMatchRulesTypes; + matching?: (BaseMatch & { match_type?: ChoiceMatchingOptions; - }; +}); }; export type SegmentBucketedMatchRule = BaseRuleWithSegmentBucketedValue & { - rule_type: SegmentBucketedMatchRulesTypes; - matching?: BaseMatch & { + rule_type: SegmentBucketedMatchRulesTypes; + matching?: (BaseMatch & { match_type?: ChoiceMatchingOptions; - }; +}); }; -export type ExperienceBucketedMatchRule = - BaseRuleWithExperienceBucketedValue & { +export type ExperienceBucketedMatchRule = BaseRuleWithExperienceBucketedValue & { rule_type: string; - matching?: BaseMatch & { - match_type?: ChoiceMatchingOptions; - }; - }; + matching?: (BaseMatch & { + match_type?: ChoiceMatchingOptions; +}); +}; export type DayOfWeekMatchRule = BaseRuleWithDayOfWeekValue & { - rule_type: DayOfWeekMatchRulesTypes; - matching?: BaseMatch & { + rule_type: DayOfWeekMatchRulesTypes; + matching?: (BaseMatch & { match_type?: NumericMatchingOptions; - }; +}); }; export type HourOfDayMatchRule = BaseRuleWithHourOfDayValue & { - rule_type: HourOfDayMatchRulesTypes; - matching?: BaseMatch & { + rule_type: HourOfDayMatchRulesTypes; + matching?: (BaseMatch & { match_type?: NumericMatchingOptions; - }; +}); }; export type MinuteOfHourMatchRule = BaseRuleWithMinuteOfHourValue & { - rule_type: MinuteOfHourMatchRulesTypes; - matching?: BaseMatch & { + rule_type: MinuteOfHourMatchRulesTypes; + matching?: (BaseMatch & { match_type?: NumericMatchingOptions; - }; +}); }; export type BrowserNameMatchRule = BaseRuleWithBrowserNameValue & { - rule_type: BrowserNameMatchRulesTypes; - matching?: BaseMatch & { + rule_type: BrowserNameMatchRulesTypes; + matching?: (BaseMatch & { match_type?: ChoiceMatchingOptions; - }; +}); }; export type OsMatchRule = BaseRuleWithOsValue & { - rule_type: OsMatchRulesTypes; - matching?: BaseMatch & { + rule_type: OsMatchRulesTypes; + matching?: (BaseMatch & { match_type?: ChoiceMatchingOptions; - }; +}); }; export type WeatherConditionMatchRule = BaseRuleWithWeatherConditionValue & { - rule_type: WeatherConditionMatchRulesTypes; - matching?: BaseMatch & { + rule_type: WeatherConditionMatchRulesTypes; + matching?: (BaseMatch & { match_type?: TextMatchingOptions; - }; -}; - -export type RuleElementNoUrl = - | GenericTextMatchRule - | GenericNumericMatchRule - | GenericBoolMatchRule - | CookieMatchRule - | GenericTextKeyValueMatchRule - | GenericNumericKeyValueMatchRule - | GenericBoolKeyValueMatchRule - | CountryMatchRule - | LanguageMatchRule - | GoalTriggeredMatchRule - | SegmentBucketedMatchRule - | DayOfWeekMatchRule - | HourOfDayMatchRule - | MinuteOfHourMatchRule - | BrowserNameMatchRule - | OsMatchRule - | WeatherConditionMatchRule - | VisitorTypeMatchRule - | JsConditionMatchRule; - -export type RuleElement = - | GenericTextMatchRule - | GenericNumericMatchRule - | GenericBoolMatchRule - | GenericTextKeyValueMatchRule - | GenericNumericKeyValueMatchRule - | GenericBoolKeyValueMatchRule - | CookieMatchRule - | CountryMatchRule - | LanguageMatchRule - | GoalTriggeredMatchRule - | SegmentBucketedMatchRule - | DayOfWeekMatchRule - | HourOfDayMatchRule - | MinuteOfHourMatchRule - | BrowserNameMatchRule - | OsMatchRule - | WeatherConditionMatchRule - | VisitorTypeMatchRule - | JsConditionMatchRule; - -export type TextMatchingOptions = - | 'matches' - | 'regexMatches' - | 'contains' - | 'endsWith' - | 'startsWith'; +}); +}; + +export type RuleElementNoUrl = GenericTextMatchRule | GenericNumericMatchRule | GenericBoolMatchRule | CookieMatchRule | GenericTextKeyValueMatchRule | GenericNumericKeyValueMatchRule | GenericBoolKeyValueMatchRule | CountryMatchRule | LanguageMatchRule | GoalTriggeredMatchRule | SegmentBucketedMatchRule | DayOfWeekMatchRule | HourOfDayMatchRule | MinuteOfHourMatchRule | BrowserNameMatchRule | OsMatchRule | WeatherConditionMatchRule | VisitorTypeMatchRule | JsConditionMatchRule; + +export type RuleElement = GenericTextMatchRule | GenericNumericMatchRule | GenericBoolMatchRule | GenericTextKeyValueMatchRule | GenericNumericKeyValueMatchRule | GenericBoolKeyValueMatchRule | CookieMatchRule | CountryMatchRule | LanguageMatchRule | GoalTriggeredMatchRule | SegmentBucketedMatchRule | DayOfWeekMatchRule | HourOfDayMatchRule | MinuteOfHourMatchRule | BrowserNameMatchRule | OsMatchRule | WeatherConditionMatchRule | VisitorTypeMatchRule | JsConditionMatchRule; + +export type TextMatchingOptions = 'matches' | 'regexMatches' | 'contains' | 'endsWith' | 'startsWith'; export const TextMatchingOptions = { - MATCHES: 'matches', - REGEX_MATCHES: 'regexMatches', - CONTAINS: 'contains', - ENDS_WITH: 'endsWith', - STARTS_WITH: 'startsWith' + MATCHES: 'matches', + REGEX_MATCHES: 'regexMatches', + CONTAINS: 'contains', + ENDS_WITH: 'endsWith', + STARTS_WITH: 'startsWith' } as const; export type NumericMatchingOptions = 'equalsNumber' | 'less' | 'lessEqual'; export const NumericMatchingOptions = { - EQUALS_NUMBER: 'equalsNumber', - LESS: 'less', - LESS_EQUAL: 'lessEqual' + EQUALS_NUMBER: 'equalsNumber', + LESS: 'less', + LESS_EQUAL: 'lessEqual' } as const; export type ChoiceMatchingOptions = 'equals'; export const ChoiceMatchingOptions = { - EQUALS: 'equals' + EQUALS: 'equals' } as const; export type ChoiceContainsOptions = 'contains'; export const ChoiceContainsOptions = { - CONTAINS: 'contains' + CONTAINS: 'contains' } as const; export type SetMatchingOptions = 'isIn'; export const SetMatchingOptions = { - IS_IN: 'isIn' + IS_IN: 'isIn' } as const; /** * This one describes a logical rule that is being used inside the app for triggering goals, matching audiences etc */ export type RuleObject = { - /** - * This describes an outer set of blocks which are evaluated using OR's between them - */ - OR?: Array<{ - /** - * This describes a colections of logical blocks which are evaluated using AND's between them - */ - AND?: Array<{ - /** - * This describes a colections of logical blocks which are evaluated using OR's between them - */ - OR_WHEN?: Array; + /** + * This describes an outer set of blocks which are evaluated using OR's between them + */ + OR?: Array<{ + /** + * This describes a colections of logical blocks which are evaluated using AND's between them + */ + AND?: Array<{ + /** + * This describes a colections of logical blocks which are evaluated using OR's between them + */ + OR_WHEN?: Array; + }>; }>; - }>; } | null; /** * This one describes a logical rule that is being used inside the app for triggering goals, matching audiences etc */ export type RuleObjectNoUrl = { - /** - * This describes an outer set of blocks which are evaluated using OR's between them - */ - OR?: Array<{ - /** - * This describes a colections of logical blocks which are evaluated using AND's between them - */ - AND?: Array<{ - /** - * This describes a colections of logical blocks which are evaluated using OR's between them - */ - OR_WHEN?: Array; + /** + * This describes an outer set of blocks which are evaluated using OR's between them + */ + OR?: Array<{ + /** + * This describes a colections of logical blocks which are evaluated using AND's between them + */ + AND?: Array<{ + /** + * This describes a colections of logical blocks which are evaluated using OR's between them + */ + OR_WHEN?: Array; + }>; }>; - }>; } | null; export type Base64Image = { - /** - * Image's content, base64 encoded - */ - data?: string; + /** + * Image's content, base64 encoded + */ + data?: string; }; export type ErrorData = { - code?: number; - message?: string; - fields?: string; + code?: number; + message?: string; + fields?: string; }; export type SuccessData = { - code?: number; - message?: string; + code?: number; + message?: string; }; export type ImportProjectDataSuccess = SuccessData & { - /** - * List of imported objects - */ - imported?: { - /** - * List of created experiences. Empty if nothing imported - */ - experiences?: Array; - /** - * List of created audiences. Empty if nothing imported - */ - audiences?: Array; - /** - * List of created locations. Empty if nothing imported - */ - locations?: Array; - /** - * List of created goals. Empty if nothing imported - */ - goals?: Array; /** - * List of created hypothesis. Empty if nothing imported + * List of imported objects */ - hypothesis?: Array; - }; + imported?: { + /** + * List of created experiences. Empty if nothing imported + */ + experiences?: Array<(number)>; + /** + * List of created audiences. Empty if nothing imported + */ + audiences?: Array<(number)>; + /** + * List of created locations. Empty if nothing imported + */ + locations?: Array<(number)>; + /** + * List of created goals. Empty if nothing imported + */ + goals?: Array<(number)>; + /** + * List of created hypothesis. Empty if nothing imported + */ + hypothesis?: Array<(number)>; + }; }; export type BulkSuccessData = SuccessData & { - code?: number; - /** - * List of unprocessed entities. Would be empty, if all passed entities processed - */ - errors?: Array; + code?: number; + /** + * List of unprocessed entities. Would be empty, if all passed entities processed + */ + errors?: Array; }; export type BulkEntityError = { - /** - * ID of entity which has not been processed - */ - id?: number; - /** - * A reason explaining why entity has not been processed - */ - message?: string; + /** + * ID of entity which has not been processed + */ + id?: number; + /** + * A reason explaining why entity has not been processed + */ + message?: string; }; /** @@ -971,45 +820,45 @@ export type BulkEntityError = { export type UTC_Offset = number; export type GA_SettingsBase = { - /** - * Flag indicating whether Google Analytics integration is enabled or not. - */ - enabled?: boolean; + /** + * Flag indicating whether Google Analytics integration is enabled or not. + */ + enabled?: boolean; }; export type IntegrationGA3 = { - type?: 'ga3'; - /** - * Universal Analytics property to be used for tracking - */ - property_UA?: string | null; + type?: 'ga3'; + /** + * Universal Analytics property to be used for tracking + */ + property_UA?: (string) | null; }; export type type = 'ga3'; export const type = { - GA3: 'ga3' + GA3: 'ga3' } as const; export type IntegrationGA4Base = { - type?: 'ga4'; - /** - * ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics - */ - measurementId?: string; + type?: 'ga4'; + /** + * ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics + */ + measurementId?: string; }; export type type2 = 'ga4'; export const type2 = { - GA4: 'ga4' + GA4: 'ga4' } as const; export type IntegrationGA4 = IntegrationGA4Base & { - /** - * ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics - */ - propertyId?: string; + /** + * ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics + */ + propertyId?: string; }; /** @@ -1025,10 +874,17 @@ export type GenericListMatchingOptions = 'any' | 'all'; * */ export const GenericListMatchingOptions = { - ANY: 'any', - ALL: 'all' + ANY: 'any', + ALL: 'all' } as const; +export type VisitorInsightsBase = { + /** + * Flag indicating whether Visitor Insights is enabled or not. + */ + enabled?: boolean; +}; + /** * Type of the outlier detection mechanism */ @@ -1038,59 +894,56 @@ export type NumericOutlierTypes = 'none' | 'min_max' | 'percentile'; * Type of the outlier detection mechanism */ export const NumericOutlierTypes = { - NONE: 'none', - MIN_MAX: 'min_max', - PERCENTILE: 'percentile' + NONE: 'none', + MIN_MAX: 'min_max', + PERCENTILE: 'percentile' } as const; export type NumericOutlierBase = { - detection_type: NumericOutlierTypes; + detection_type: NumericOutlierTypes; }; export type NumericOutlierNone = NumericOutlierBase & { - detection_type?: 'none'; + detection_type?: 'none'; }; export type detection_type = 'none'; export const detection_type = { - NONE: 'none' + NONE: 'none' } as const; export type NumericOutlierMinMax = NumericOutlierBase & { - detection_type?: 'min_max'; - /** - * Minimum value for the outlier detection, under which, the value is considered an outlier - */ - min?: number; - /** - * Maximum value for the outlier detection, over which, the value is considered an outlier - */ - max?: number; + detection_type?: 'min_max'; + /** + * Minimum value for the outlier detection, under which, the value is considered an outlier + */ + min?: number; + /** + * Maximum value for the outlier detection, over which, the value is considered an outlier + */ + max?: number; }; export type detection_type2 = 'min_max'; export const detection_type2 = { - MIN_MAX: 'min_max' + MIN_MAX: 'min_max' } as const; export type NumericOutlierPercentile = NumericOutlierBase & { - detection_type?: 'percentile'; - min?: unknown & Percentiles; - max?: unknown & Percentiles; + detection_type?: 'percentile'; + min?: (unknown & Percentiles); + max?: (unknown & Percentiles); }; export type detection_type3 = 'percentile'; export const detection_type3 = { - PERCENTILE: 'percentile' + PERCENTILE: 'percentile' } as const; -export type NumericOutlier = - | NumericOutlierNone - | NumericOutlierMinMax - | NumericOutlierPercentile; +export type NumericOutlier = NumericOutlierNone | NumericOutlierMinMax | NumericOutlierPercentile; /** * List of supported percentiles @@ -1101,592 +954,535 @@ export type Percentiles = 1 | 5 | 10 | 25 | 50 | 75 | 90 | 95 | 99; * List of supported percentiles */ export const Percentiles = { - _1: 1, - _5: 5, - _10: 10, - _25: 25, - _50: 50, - _75: 75, - _90: 90, - _95: 95, - _99: 99 -} as const; + '_1': 1, + '_5': 5, + '_10': 10, + '_25': 25, + '_50': 50, + '_75': 75, + '_90': 90, + '_95': 95, + '_99': 99 +} as const; + +export type TimeRange = { + /** + * Unix timestamp when reporting period should start, provided in the given **utc_time_offset** + */ + start_time?: (number) | null; + /** + * Unix timestamp when reporting period should end, provided in the given **utc_time_offset** + */ + end_time?: (number) | null; + utc_offset?: UTC_Offset; +}; /** * Response containing project's config data needed in order to serve experiences */ export type ConfigResponseData = { - /** - * Account ID under which the project exists - */ - account_id?: string; - project?: ConfigProject; - /** - * List of goals to be tracked in the project - */ - goals?: Array; - /** - * List of locations that are used inside this project - */ - locations?: Array; - /** - * List of audiences that are used inside this project - */ - audiences?: Array; - /** - * List of custom that are devined inside this project - */ - segments?: Array; - /** - * List of active experiences inside this project - */ - experiences?: Array; - /** - * List of archived experiences inside this project, which were archived within the last 8 months - */ - archived_experiences?: Array; - /** - * List of features inside this project. Presented only for fullstack projects - */ - features?: Array; - /** - * Flag indicating if the returned config is in debug mode - */ - is_debug?: boolean; + /** + * Account ID under which the project exists + */ + account_id?: string; + project?: ConfigProject; + /** + * List of goals to be tracked in the project + */ + goals?: Array; + /** + * List of locations that are used inside this project + */ + locations?: Array; + /** + * List of audiences that are used inside this project + */ + audiences?: Array; + /** + * List of custom that are devined inside this project + */ + segments?: Array; + /** + * List of active experiences inside this project + */ + experiences?: Array; + /** + * List of archived experiences inside this project, which were archived within the last 8 months + */ + archived_experiences?: Array<(string)>; + /** + * List of features inside this project. Presented only for fullstack projects + */ + features?: Array; + /** + * Flag indicating if the returned config is in debug mode + */ + is_debug?: boolean; }; export type ConfigMinimalResponseData = { - /** - * Account ID - */ - account_id?: string; - /** - * Project ID - */ - project_id?: string; + /** + * Account ID + */ + account_id?: string; + /** + * Project ID + */ + project_id?: string; } & ConfigProjectMinimalSettings; +/** + * Limited data containing optional properties required for decision-making when assembling and + * tracking various bundles (e.g., tracking scripts). + * + */ +export type ConfigOptionalResponseData = { + /** + * Account ID + */ + account_id?: string; + /** + * Project ID + */ + project_id?: string; + visitor_insights?: VisitorInsightsData; +}; + /** * Object that represents the change done inside an experience */ export type ExperienceChangeBase = { - type?: - | 'richStructure' - | 'customCode' - | 'defaultCode' - | 'defaultCodeMultipage' - | 'defaultRedirect' - | 'fullStackFeature'; - /** - * This contains all data of this change, any code, settings etc - * - * This is sent by default in the following requests responses: **getExperienceChange**; - * - * All other responses that return this field, will only return it if "include" request parameter contains its name - * - * Data object structure will correspond to the "type" field - * - */ - data?: { - [key: string]: unknown; - }; -}; - -export type type3 = - | 'richStructure' - | 'customCode' - | 'defaultCode' - | 'defaultCodeMultipage' - | 'defaultRedirect' - | 'fullStackFeature'; + type?: 'richStructure' | 'customCode' | 'defaultCode' | 'defaultCodeMultipage' | 'defaultRedirect' | 'fullStackFeature'; + /** + * This contains all data of this change, any code, settings etc + * + * This is sent by default in the following requests responses: **getExperienceChange**; + * + * All other responses that return this field, will only return it if "include" request parameter contains its name + * + * Data object structure will correspond to the "type" field + * + */ + data?: { + [key: string]: unknown; + }; +}; + +export type type3 = 'richStructure' | 'customCode' | 'defaultCode' | 'defaultCodeMultipage' | 'defaultRedirect' | 'fullStackFeature'; export const type3 = { - RICH_STRUCTURE: 'richStructure', - CUSTOM_CODE: 'customCode', - DEFAULT_CODE: 'defaultCode', - DEFAULT_CODE_MULTIPAGE: 'defaultCodeMultipage', - DEFAULT_REDIRECT: 'defaultRedirect', - FULL_STACK_FEATURE: 'fullStackFeature' + RICH_STRUCTURE: 'richStructure', + CUSTOM_CODE: 'customCode', + DEFAULT_CODE: 'defaultCode', + DEFAULT_CODE_MULTIPAGE: 'defaultCodeMultipage', + DEFAULT_REDIRECT: 'defaultRedirect', + FULL_STACK_FEATURE: 'fullStackFeature' } as const; /** * Object that represents id of the change done inside an experience */ export type ExperienceChangeId = { - /** - * The ID of the experience change - */ - id: number; + /** + * The ID of the experience change + */ + id: number; }; /** * Object that represents id of the change done inside an experience */ export type ExperienceChangeIdReadOnly = { - /** - * The ID of the experience change - */ - readonly id?: number; + /** + * The ID of the experience change + */ + readonly id?: number; }; /** * Object that represents one change done inside an experience */ -export type ExperienceChange = - | ExperienceChangeDefaultCodeData - | ExperienceChangeDefaultCodeMultipageData - | ExperienceChangeDefaultRedirectData - | ExperienceChangeCustomCodeData - | ExperienceChangeRichStructureData - | ExperienceChangeFullStackFeature; +export type ExperienceChange = ExperienceChangeDefaultCodeData | ExperienceChangeDefaultCodeMultipageData | ExperienceChangeDefaultRedirectData | ExperienceChangeCustomCodeData | ExperienceChangeRichStructureData | ExperienceChangeFullStackFeature; /** * Object that represents one change done inside an experience, used when adding changes */ -export type ExperienceChangeAdd = - | ExperienceChangeDefaultCodeDataAdd - | ExperienceChangeDefaultCodeMultipageDataAdd - | ExperienceChangeDefaultRedirectDataAdd - | ExperienceChangeCustomCodeDataAdd - | ExperienceChangeRichStructureDataAdd - | ExperienceChangeFullStackFeatureAdd; +export type ExperienceChangeAdd = ExperienceChangeDefaultCodeDataAdd | ExperienceChangeDefaultCodeMultipageDataAdd | ExperienceChangeDefaultRedirectDataAdd | ExperienceChangeCustomCodeDataAdd | ExperienceChangeRichStructureDataAdd | ExperienceChangeFullStackFeatureAdd; /** * Object that represents one change done inside an experience */ -export type ExperienceChangeUpdate = - | ExperienceChangeDefaultCodeDataUpdate - | ExperienceChangeDefaultCodeMultipageDataUpdate - | ExperienceChangeDefaultRedirectDataUpdate - | ExperienceChangeRichStructureDataUpdate - | ExperienceChangeCustomCodeDataUpdate - | ExperienceChangeFullStackFeatureUpdate; +export type ExperienceChangeUpdate = ExperienceChangeDefaultCodeDataUpdate | ExperienceChangeDefaultCodeMultipageDataUpdate | ExperienceChangeDefaultRedirectDataUpdate | ExperienceChangeRichStructureDataUpdate | ExperienceChangeCustomCodeDataUpdate | ExperienceChangeFullStackFeatureUpdate; /** * Object that represents one change done inside an experience */ -export type ExperienceChangeUpdateNoId = - | ExperienceChangeDefaultCodeDataUpdateNoId - | ExperienceChangeDefaultCodeMultipageDataUpdateNoId - | ExperienceChangeDefaultRedirectDataUpdateNoId - | ExperienceChangeRichStructureDataUpdateNoId - | ExperienceChangeCustomCodeDataUpdateNoId - | ExperienceChangeFullStackFeatureUpdateNoId; +export type ExperienceChangeUpdateNoId = ExperienceChangeDefaultCodeDataUpdateNoId | ExperienceChangeDefaultCodeMultipageDataUpdateNoId | ExperienceChangeDefaultRedirectDataUpdateNoId | ExperienceChangeRichStructureDataUpdateNoId | ExperienceChangeCustomCodeDataUpdateNoId | ExperienceChangeFullStackFeatureUpdateNoId; /** * Describes structure for "defaultCode" type of experience change */ export type ExperienceChangeDefaultCodeDataBase = ExperienceChangeBase & { - type?: 'defaultCode'; - /** - * Describes structure for "defaultCode" type of experience change - */ - data?: { - /** - * CSS code to be applied by this change - */ - css?: string | null; - /** - * Javascript code generated by the visual editor or written in the same structure, to be applied by this experience change - */ - js?: string | null; + type?: 'defaultCode'; /** - * Custom javascript code to be applied by this change + * Describes structure for "defaultCode" type of experience change */ - custom_js?: string | null; - }; + data?: { + /** + * CSS code to be applied by this change + */ + css?: (string) | null; + /** + * Javascript code generated by the visual editor or written in the same structure, to be applied by this experience change + */ + js?: (string) | null; + /** + * Custom javascript code to be applied by this change + */ + custom_js?: (string) | null; + }; }; export type type4 = 'defaultCode'; export const type4 = { - DEFAULT_CODE: 'defaultCode' + DEFAULT_CODE: 'defaultCode' } as const; /** * Describes structure for "defaultCode" type of experience change */ -export type ExperienceChangeDefaultCodeData = ExperienceChangeIdReadOnly & - ExperienceChangeDefaultCodeDataBase; +export type ExperienceChangeDefaultCodeData = ExperienceChangeIdReadOnly & ExperienceChangeDefaultCodeDataBase; /** * Describes structure for adding a "defaultCode" type of experience change */ -export type ExperienceChangeDefaultCodeDataAdd = ExperienceChangeIdReadOnly & - ExperienceChangeDefaultCodeDataBase & { +export type ExperienceChangeDefaultCodeDataAdd = ExperienceChangeIdReadOnly & ExperienceChangeDefaultCodeDataBase & { data: unknown; - }; +}; /** * Describes structure for "defaultCode" type of experience change */ -export type ExperienceChangeDefaultCodeDataUpdateNoId = - ExperienceChangeDefaultCodeDataBase & unknown; +export type ExperienceChangeDefaultCodeDataUpdateNoId = ExperienceChangeDefaultCodeDataBase & unknown; /** * Describes structure for "defaultCode" type of experience change */ -export type ExperienceChangeDefaultCodeDataUpdate = ExperienceChangeId & - ExperienceChangeDefaultCodeDataBase & - unknown; +export type ExperienceChangeDefaultCodeDataUpdate = ExperienceChangeId & ExperienceChangeDefaultCodeDataBase & unknown; /** * Describes structure for "defaultRedirect" type of experience change */ export type ExperienceChangeDefaultRedirectDataBase = ExperienceChangeBase & { - type?: 'defaultRedirect'; - /** - * Describes structure for "defaultRedirect" type of experience change - */ - data?: { + type?: 'defaultRedirect'; /** - * Defines whether the URL matching is case sensitive or not + * Describes structure for "defaultRedirect" type of experience change */ - case_sensitive?: boolean; - /** - * Pattern for matching the Original URL in order to construct the redirect URL - */ - original_pattern?: string; - /** - * String used to construct the variation redirect URL. This string can contain matches from original_url or it can be a standard URL - */ - variation_pattern?: string; - }; + data?: { + /** + * Defines whether the URL matching is case sensitive or not + */ + case_sensitive?: boolean; + /** + * Pattern for matching the Original URL in order to construct the redirect URL + */ + original_pattern?: string; + /** + * String used to construct the variation redirect URL. This string can contain matches from original_url or it can be a standard URL + */ + variation_pattern?: string; + }; }; export type type5 = 'defaultRedirect'; export const type5 = { - DEFAULT_REDIRECT: 'defaultRedirect' + DEFAULT_REDIRECT: 'defaultRedirect' } as const; /** * Describes structure for "defaultRedirect" type of experience change */ -export type ExperienceChangeDefaultRedirectData = ExperienceChangeIdReadOnly & - ExperienceChangeDefaultRedirectDataBase; +export type ExperienceChangeDefaultRedirectData = ExperienceChangeIdReadOnly & ExperienceChangeDefaultRedirectDataBase; /** * Describes structure for "defaultRedirect" type of experience change */ -export type ExperienceChangeDefaultRedirectDataAdd = - ExperienceChangeIdReadOnly & - ExperienceChangeDefaultRedirectDataBase & { - data: unknown; - }; +export type ExperienceChangeDefaultRedirectDataAdd = ExperienceChangeIdReadOnly & ExperienceChangeDefaultRedirectDataBase & { + data: unknown; +}; /** * Describes structure for "defaultRedirect" type of experience change */ -export type ExperienceChangeDefaultRedirectDataUpdateNoId = - ExperienceChangeDefaultRedirectDataBase & unknown; +export type ExperienceChangeDefaultRedirectDataUpdateNoId = ExperienceChangeDefaultRedirectDataBase & unknown; /** * Describes structure for "defaultRedirect" type of experience change */ -export type ExperienceChangeDefaultRedirectDataUpdate = ExperienceChangeId & - ExperienceChangeDefaultRedirectDataBase & - unknown; +export type ExperienceChangeDefaultRedirectDataUpdate = ExperienceChangeId & ExperienceChangeDefaultRedirectDataBase & unknown; /** * Describes structure for "defaultCodeMultipage" type of experience change */ -export type ExperienceChangeDefaultCodeMultipageDataBase = - ExperienceChangeBase & { +export type ExperienceChangeDefaultCodeMultipageDataBase = ExperienceChangeBase & { type?: 'defaultCodeMultipage'; /** * Describes structure for "defaultCodeMultipage" type of experience change */ data?: { - /** - * CSS code to be applied by this change - */ - css?: string | null; - /** - * Javascript code generated by the visual editor or written in the same structure, to be applied by this experience change - */ - js?: string | null; - /** - * Custom javascript code to be applied by this change - */ - custom_js?: string | null; - /** - * The **id** of the page connected to this change. - */ - page_id?: string; + /** + * CSS code to be applied by this change + */ + css?: (string) | null; + /** + * Javascript code generated by the visual editor or written in the same structure, to be applied by this experience change + */ + js?: (string) | null; + /** + * Custom javascript code to be applied by this change + */ + custom_js?: (string) | null; + /** + * The **id** of the page connected to this change. + */ + page_id?: string; }; - }; +}; export type type6 = 'defaultCodeMultipage'; export const type6 = { - DEFAULT_CODE_MULTIPAGE: 'defaultCodeMultipage' + DEFAULT_CODE_MULTIPAGE: 'defaultCodeMultipage' } as const; /** * Describes structure for "defaultCodeMultipage" type of experience change */ -export type ExperienceChangeDefaultCodeMultipageData = - ExperienceChangeIdReadOnly & ExperienceChangeDefaultCodeMultipageDataBase; +export type ExperienceChangeDefaultCodeMultipageData = ExperienceChangeIdReadOnly & ExperienceChangeDefaultCodeMultipageDataBase; /** * Describes structure for "defaultCodeMultipage" type of experience change */ -export type ExperienceChangeDefaultCodeMultipageDataAdd = - ExperienceChangeIdReadOnly & - ExperienceChangeDefaultCodeMultipageDataBase & { - data: unknown; - }; +export type ExperienceChangeDefaultCodeMultipageDataAdd = ExperienceChangeIdReadOnly & ExperienceChangeDefaultCodeMultipageDataBase & { + data: unknown; +}; /** * Describes structure for "defaultCodeMultipage" type of experience change */ -export type ExperienceChangeDefaultCodeMultipageDataUpdateNoId = - ExperienceChangeDefaultCodeMultipageDataBase & unknown; +export type ExperienceChangeDefaultCodeMultipageDataUpdateNoId = ExperienceChangeDefaultCodeMultipageDataBase & unknown; /** * Describes structure for "defaultCodeMultipage" type of experience change */ -export type ExperienceChangeDefaultCodeMultipageDataUpdate = - ExperienceChangeId & ExperienceChangeDefaultCodeMultipageDataBase & unknown; +export type ExperienceChangeDefaultCodeMultipageDataUpdate = ExperienceChangeId & ExperienceChangeDefaultCodeMultipageDataBase & unknown; /** * Describes structure for "defaultCode" type of experience change */ export type ExperienceChangeRichStructureDataBase = ExperienceChangeBase & { - type?: 'richStructure'; - /** - * Describes structure for "defaultCode" type of experience change - */ - data?: { - /** - * Javascript code generated by the visual editor or written in the same structure, to be applied by this experience change - */ - js?: string | null; - /** - * CSS selector of the element to which the change refers to, if this is a change concerning one DOM element - */ - selector?: string; - /** - * The **id** of the page connected to this change, in case this is a **multi-page** experiment - */ - page_id?: string; + type?: 'richStructure'; /** - * Various key - value data + * Describes structure for "defaultCode" type of experience change */ - [key: string]: string | undefined; - }; + data?: { + /** + * Javascript code generated by the visual editor or written in the same structure, to be applied by this experience change + */ + js?: (string) | null; + /** + * CSS selector of the element to which the change refers to, if this is a change concerning one DOM element + */ + selector?: string; + /** + * The **id** of the page connected to this change, in case this is a **multi-page** experiment + */ + page_id?: string; + /** + * Various key - value data + */ + [key: string]: (string) | undefined; + }; }; export type type7 = 'richStructure'; export const type7 = { - RICH_STRUCTURE: 'richStructure' + RICH_STRUCTURE: 'richStructure' } as const; /** * Describes structure for "defaultCode" type of experience change */ -export type ExperienceChangeRichStructureData = ExperienceChangeIdReadOnly & - ExperienceChangeRichStructureDataBase; +export type ExperienceChangeRichStructureData = ExperienceChangeIdReadOnly & ExperienceChangeRichStructureDataBase; /** * Describes structure for "defaultCode" type of experience change */ -export type ExperienceChangeRichStructureDataAdd = ExperienceChangeIdReadOnly & - ExperienceChangeRichStructureDataBase & { +export type ExperienceChangeRichStructureDataAdd = ExperienceChangeIdReadOnly & ExperienceChangeRichStructureDataBase & { data: unknown; - }; +}; /** * Describes structure for "defaultCode" type of experience change */ -export type ExperienceChangeRichStructureDataUpdateNoId = - ExperienceChangeRichStructureDataBase & unknown; +export type ExperienceChangeRichStructureDataUpdateNoId = ExperienceChangeRichStructureDataBase & unknown; /** * Describes structure for "defaultCode" type of experience change */ -export type ExperienceChangeRichStructureDataUpdate = ExperienceChangeId & - ExperienceChangeRichStructureDataBase & - unknown; +export type ExperienceChangeRichStructureDataUpdate = ExperienceChangeId & ExperienceChangeRichStructureDataBase & unknown; /** * Describes structure for "defaultCode" type of experience change */ export type ExperienceChangeCustomCodeDataBase = ExperienceChangeBase & { - type?: 'customCode'; - /** - * Describes structure for "defaultCode" type of experience change - */ - data?: { - /** - * CSS code to be applied by this change - */ - css?: string | null; - /** - * Custom javascript code to be applied by this change - */ - js?: string | null; + type?: 'customCode'; /** - * The **id** of the page connected to this change, in case this is a **multi-page** experiment + * Describes structure for "defaultCode" type of experience change */ - page_id?: string; - }; + data?: { + /** + * CSS code to be applied by this change + */ + css?: (string) | null; + /** + * Custom javascript code to be applied by this change + */ + js?: (string) | null; + /** + * The **id** of the page connected to this change, in case this is a **multi-page** experiment + */ + page_id?: string; + }; }; export type type8 = 'customCode'; export const type8 = { - CUSTOM_CODE: 'customCode' + CUSTOM_CODE: 'customCode' } as const; /** * Describes structure for "defaultCode" type of experience change */ -export type ExperienceChangeCustomCodeData = ExperienceChangeIdReadOnly & - ExperienceChangeCustomCodeDataBase; +export type ExperienceChangeCustomCodeData = ExperienceChangeIdReadOnly & ExperienceChangeCustomCodeDataBase; /** * Describes structure for "defaultCode" type of experience change */ -export type ExperienceChangeCustomCodeDataAdd = ExperienceChangeIdReadOnly & - ExperienceChangeCustomCodeDataBase & { +export type ExperienceChangeCustomCodeDataAdd = ExperienceChangeIdReadOnly & ExperienceChangeCustomCodeDataBase & { data: unknown; - }; +}; /** * Describes structure for "customCode" type of experience change */ -export type ExperienceChangeCustomCodeDataUpdateNoId = - ExperienceChangeCustomCodeDataBase & unknown; +export type ExperienceChangeCustomCodeDataUpdateNoId = ExperienceChangeCustomCodeDataBase & unknown; /** * Describes structure for "customCode" type of experience change */ -export type ExperienceChangeCustomCodeDataUpdate = ExperienceChangeId & - ExperienceChangeCustomCodeDataBase & - unknown; +export type ExperienceChangeCustomCodeDataUpdate = ExperienceChangeId & ExperienceChangeCustomCodeDataBase & unknown; /** * Describes structure for "fullStackFeature" type of experience change */ export type ExperienceChangeFullStackFeatureBase = ExperienceChangeBase & { - type?: 'fullStackFeature'; - /** - * Describes structure for "fullStackFeature" type of experience change - */ - data?: { - /** - * The **id** of the feature connected to this change - */ - feature_id?: number; + type?: 'fullStackFeature'; /** - * A key-value object defined by user which describes the variables values. Where the key is variable name defined in connected feature and value is a variable's value with corresponding type + * Describes structure for "fullStackFeature" type of experience change */ - variables_data?: { - [key: string]: unknown; + data?: { + /** + * The **id** of the feature connected to this change + */ + feature_id?: number; + /** + * A key-value object defined by user which describes the variables values. Where the key is variable name defined in connected feature and value is a variable's value with corresponding type + */ + variables_data?: { + [key: string]: unknown; + }; }; - }; }; export type type9 = 'fullStackFeature'; export const type9 = { - FULL_STACK_FEATURE: 'fullStackFeature' + FULL_STACK_FEATURE: 'fullStackFeature' } as const; /** * Describes structure for "fullStackFeature" type of experience change */ -export type ExperienceChangeFullStackFeature = ExperienceChangeIdReadOnly & - ExperienceChangeFullStackFeatureBase; +export type ExperienceChangeFullStackFeature = ExperienceChangeIdReadOnly & ExperienceChangeFullStackFeatureBase; /** * Describes structure for "fullStackFeature" type of experience change */ -export type ExperienceChangeFullStackFeatureAdd = ExperienceChangeIdReadOnly & - ExperienceChangeFullStackFeatureBase & { +export type ExperienceChangeFullStackFeatureAdd = ExperienceChangeIdReadOnly & ExperienceChangeFullStackFeatureBase & { data: unknown; - }; +}; /** * Describes structure for "fullStackFeature" type of experience change */ -export type ExperienceChangeFullStackFeatureUpdate = ExperienceChangeId & - ExperienceChangeFullStackFeatureBase & - unknown; +export type ExperienceChangeFullStackFeatureUpdate = ExperienceChangeId & ExperienceChangeFullStackFeatureBase & unknown; /** * Describes structure for "fullStackFeature" type of experience change */ -export type ExperienceChangeFullStackFeatureUpdateNoId = - ExperienceChangeFullStackFeatureBase & unknown; +export type ExperienceChangeFullStackFeatureUpdateNoId = ExperienceChangeFullStackFeatureBase & unknown; export type UpdateExperienceChangeRequestData = ExperienceChangeAdd; /** * Describes the provider with which Convert integrates to send experience data */ -export type IntegrationProvider = - | 'baidu' - | 'clicktale' - | 'clicky' - | 'cnzz' - | 'crazyegg' - | 'econda' - | 'eulerian' - | 'google_analytics' - | 'gosquared' - | 'heapanalytics' - | 'hotjar' - | 'mixpanel' - | 'mouseflow' - | 'piwik' - | 'segmentio' - | 'sitecatalyst' - | 'woopra' - | 'ysance'; +export type IntegrationProvider = 'baidu' | 'clicktale' | 'clicky' | 'cnzz' | 'crazyegg' | 'econda' | 'eulerian' | 'google_analytics' | 'gosquared' | 'heapanalytics' | 'hotjar' | 'mixpanel' | 'mouseflow' | 'piwik' | 'segmentio' | 'sitecatalyst' | 'woopra' | 'ysance'; /** * Describes the provider with which Convert integrates to send experience data */ export const IntegrationProvider = { - BAIDU: 'baidu', - CLICKTALE: 'clicktale', - CLICKY: 'clicky', - CNZZ: 'cnzz', - CRAZYEGG: 'crazyegg', - ECONDA: 'econda', - EULERIAN: 'eulerian', - GOOGLE_ANALYTICS: 'google_analytics', - GOSQUARED: 'gosquared', - HEAPANALYTICS: 'heapanalytics', - HOTJAR: 'hotjar', - MIXPANEL: 'mixpanel', - MOUSEFLOW: 'mouseflow', - PIWIK: 'piwik', - SEGMENTIO: 'segmentio', - SITECATALYST: 'sitecatalyst', - WOOPRA: 'woopra', - YSANCE: 'ysance' + BAIDU: 'baidu', + CLICKTALE: 'clicktale', + CLICKY: 'clicky', + CNZZ: 'cnzz', + CRAZYEGG: 'crazyegg', + ECONDA: 'econda', + EULERIAN: 'eulerian', + GOOGLE_ANALYTICS: 'google_analytics', + GOSQUARED: 'gosquared', + HEAPANALYTICS: 'heapanalytics', + HOTJAR: 'hotjar', + MIXPANEL: 'mixpanel', + MOUSEFLOW: 'mouseflow', + PIWIK: 'piwik', + SEGMENTIO: 'segmentio', + SITECATALYST: 'sitecatalyst', + WOOPRA: 'woopra', + YSANCE: 'ysance' } as const; export type ExperienceIntegrationBase = { - provider: IntegrationProvider; - /** - * Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, - * to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** - * - */ - enabled?: boolean | null; + provider: IntegrationProvider; + /** + * Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, + * to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + */ + enabled?: (boolean) | null; }; export type ExperienceIntegrationBaidu = ExperienceIntegrationBase & { - /** - * Custom dimension where experience data should be sent to. - */ - custom_dimension: string; + /** + * Custom dimension where experience data should be sent to. + */ + custom_dimension: string; }; export type ExperienceIntegrationClicktale = ExperienceIntegrationBase; @@ -1694,10 +1490,10 @@ export type ExperienceIntegrationClicktale = ExperienceIntegrationBase; export type ExperienceIntegrationClicky = ExperienceIntegrationBase; export type ExperienceIntegrationCnzz = ExperienceIntegrationBase & { - /** - * Custom dimension where experience data should be sent to. - */ - custom_dimension: string; + /** + * Custom dimension where experience data should be sent to. + */ + custom_dimension: string; }; /** @@ -1713,32 +1509,25 @@ export type ExperienceIntegrationEconda = ExperienceIntegrationBase; export type ExperienceIntegrationEulerian = ExperienceIntegrationBase; -export type ExperienceIntegrationGA3 = GA_SettingsBase & - ExperienceIntegrationBase & - IntegrationGA3 & { +export type ExperienceIntegrationGA3 = GA_SettingsBase & ExperienceIntegrationBase & IntegrationGA3 & { /** * Custom dimension where experience data should be sent to. */ custom_dimension?: string; - }; +}; -export type ExperienceIntegrationGA4Base = GA_SettingsBase & - ExperienceIntegrationBase & - IntegrationGA4Base; +export type ExperienceIntegrationGA4Base = GA_SettingsBase & ExperienceIntegrationBase & IntegrationGA4Base; -export type ExperienceIntegrationGA4 = ExperienceIntegrationGA4Base & - IntegrationGA4 & { +export type ExperienceIntegrationGA4 = ExperienceIntegrationGA4Base & IntegrationGA4 & { /** * List of GA audiences created for each of this experience's variations */ audiences?: { - [key: string]: string; + [key: string]: (string); }; - }; +}; -export type ExperienceIntegrationGoogleAnalytics = - | ExperienceIntegrationGA3 - | ExperienceIntegrationGA4; +export type ExperienceIntegrationGoogleAnalytics = ExperienceIntegrationGA3 | ExperienceIntegrationGA4; export type ExperienceIntegrationGosquared = ExperienceIntegrationBase; @@ -1751,209 +1540,213 @@ export type ExperienceIntegrationMixpanel = ExperienceIntegrationBase; export type ExperienceIntegrationMouseflow = ExperienceIntegrationBase; export type ExperienceIntegrationPiwik = ExperienceIntegrationBase & { - /** - * Custom dimension where experience data should be sent to. - */ - custom_dimension: string; + /** + * Custom dimension where experience data should be sent to. + */ + custom_dimension: string; }; export type ExperienceIntegrationSegmentio = ExperienceIntegrationBase; export type ExperienceIntegrationSitecatalyst = ExperienceIntegrationBase & { - /** - * Custom dimension where experience data should be sent to. - */ - evar: string; + /** + * Custom dimension where experience data should be sent to. + */ + evar: string; }; export type ExperienceIntegrationWoopra = ExperienceIntegrationBase; export type ExperienceIntegrationYsance = ExperienceIntegrationBase & { - /** - * Custom dimension where experience data should be sent to. - */ - custom_dimension: string; + /** + * Custom dimension where experience data should be sent to. + */ + custom_dimension: string; }; export type ConfigExperience = { - /** - * Experience ID - */ - id?: string; - /** - * Experience Name - */ - name?: string; - /** - * Experience readable key that uniquely identifies this experience - */ - key?: string; - /** - * List of locations IDs on which this experience is presented. Either this or **site_area** is given but should not be both. - */ - locations?: Array | null; - /** - * Rules that define where the experience is gonna run. Either this or **locations** is given but should not be both. - */ - site_area?: RuleObject | null; - /** - * List of audiences IDs to which this experience is presented to - */ - audiences?: Array | null; - /** - * List of goals IDs to which will be tracked for this experience - */ - goals?: Array; - status?: ExperienceStatuses; - /** - * Global Experience's JavaScript that will run for this experience before its changes are applied - * - */ - global_js?: string; - /** - * Global Experience's StyleSheet that will run for this experience before its changes are applied - * - */ - global_css?: string; - type?: ExperienceTypes; - /** - * Experience's version number - */ - version?: number; - /** - * Experience's variations list - */ - variations?: Array; - /** - * List of integrations that this experience's data is sent to - */ - integrations?: Array< - | ExperienceIntegrationBaidu - | ExperienceIntegrationClicktale - | ExperienceIntegrationClicky - | ExperienceIntegrationCnzz - | ExperienceIntegrationCrazyegg - | ExperienceIntegrationEconda - | ExperienceIntegrationEulerian - | ExperienceIntegrationGAServing - | ExperienceIntegrationGosquared - | ExperienceIntegrationHeapanalytics - | ExperienceIntegrationHotjar - | ExperienceIntegrationMixpanel - | ExperienceIntegrationMouseflow - | ExperienceIntegrationPiwik - | ExperienceIntegrationSegmentio - | ExperienceIntegrationSitecatalyst - | ExperienceIntegrationWoopra - | ExperienceIntegrationYsance - >; - /** - * List of environments that this experience is supposed to run on. The full list of available environments is defined at - * project level. If this list is empty, the experience will run on all environments. - * - * @deprecated - */ - environments?: Array; - /** - * The environment where this experience will run. It has to be one of the environments defined at the project level - */ - environment?: string; - /** - * Various experience's settings - */ - settings?: { /** - * Minimum order value for transactions outliers - * @deprecated + * Experience ID */ - min_order_value?: number; + id?: string; /** - * Maximum order value for transactions outliers + * Experience Name + */ + name?: string; + /** + * Experience readable key that uniquely identifies this experience + */ + key?: string; + /** + * List of locations IDs on which this experience is presented. Either this or **site_area** is given but should not be both. + */ + locations?: Array<(string)> | null; + /** + * Rules that define where the experience is gonna run. Either this or **locations** is given but should not be both. + */ + site_area?: ((RuleObject) | null); + /** + * List of audiences IDs to which this experience is presented to + */ + audiences?: Array<(string)> | null; + /** + * List of goals IDs to which will be tracked for this experience + */ + goals?: Array<(string)>; + /** + * Only for multipage experience type + */ + multipage_pages?: Array; + status?: ExperienceStatuses; + /** + * Global Experience's JavaScript that will run for this experience before its changes are applied + * + */ + global_js?: string; + /** + * Global Experience's StyleSheet that will run for this experience before its changes are applied + * + */ + global_css?: string; + type?: ExperienceTypes; + /** + * Experience's version number + */ + version?: number; + /** + * Experience's variations list + */ + variations?: Array; + /** + * List of integrations that this experience's data is sent to + */ + integrations?: Array<(ExperienceIntegrationBaidu | ExperienceIntegrationClicktale | ExperienceIntegrationClicky | ExperienceIntegrationCnzz | ExperienceIntegrationCrazyegg | ExperienceIntegrationEconda | ExperienceIntegrationEulerian | ExperienceIntegrationGAServing | ExperienceIntegrationGosquared | ExperienceIntegrationHeapanalytics | ExperienceIntegrationHotjar | ExperienceIntegrationMixpanel | ExperienceIntegrationMouseflow | ExperienceIntegrationPiwik | ExperienceIntegrationSegmentio | ExperienceIntegrationSitecatalyst | ExperienceIntegrationWoopra | ExperienceIntegrationYsance)>; + /** + * List of environments that this experience is supposed to run on. The full list of available environments is defined at + * project level. If this list is empty, the experience will run on all environments. + * * @deprecated */ - max_order_value?: number; + environments?: Array<(string)>; /** - * Various settings used by the stats engine to detect outliers + * The environment where this experience will run. It has to be one of the environments defined at the project level */ - outliers?: { - /** - * Order value outlier settings - */ - order_value?: NumericOutlier; - /** - * Products Ordered count outlier settings - */ - products_ordered_count?: NumericOutlier; - }; + environment?: string; /** - * Various settings used for matching the list of Audiences and Locations + * Various experience's settings */ - matching_options?: { - audiences?: GenericListMatchingOptions; - locations?: GenericListMatchingOptions; + settings?: { + /** + * Minimum order value for transactions outliers + * @deprecated + */ + min_order_value?: number; + /** + * Maximum order value for transactions outliers + * @deprecated + */ + max_order_value?: number; + /** + * Various settings used by the stats engine to detect outliers + */ + outliers?: { + /** + * Order value outlier settings + */ + order_value?: (NumericOutlier); + /** + * Products Ordered count outlier settings + */ + products_ordered_count?: (NumericOutlier); + }; + /** + * A couple of settings only applicable to Split URL experiments + */ + split_url_settings?: { + /** + * Whether regular expressions are supported in original/variation URLs of a split URL experiment or not. + * + * It only applies to **experience_type** - **split_url** + * + */ + split_regex_support?: boolean; + }; + /** + * Various settings used for matching the list of Audiences and Locations + */ + matching_options?: { + audiences?: GenericListMatchingOptions; + locations?: GenericListMatchingOptions; + }; }; - }; +}; + +/** + * Multipage Experience Page object + */ +export type MultipageExperiencePage = { + /** + * The ID of the page. + */ + id?: string; + /** + * Name of the page + */ + name?: string; + /** + * The url of page to load + */ + url?: string; }; /** * Variation Object */ export type ExperienceVariationConfig = { - /** - * Variation ID - */ - id?: string; - /** - * Variation name - */ - name?: string; - /** - * Variation Key - */ - key?: string; - /** - * Percentage of traffic allocation for this variation, as a number from 0 to 10000. - * For an experience, the sum of the traffic allocations for all variations cannot be greater than 10000. - * - */ - traffic_allocation?: number; - status?: VariationStatuses; - /** - * List of changes that this variation is exposing. - */ - changes?: Array; -}; - -export type ExperienceStatuses = - | 'draft' - | 'active' - | 'paused' - | 'completed' - | 'scheduled'; + /** + * Variation ID + */ + id?: string; + /** + * Variation name + */ + name?: string; + /** + * Variation Key + */ + key?: string; + /** + * Percentage of traffic allocation for this variation, as a number from 0 to 10000. + * For an experience, the sum of the traffic allocations for all variations cannot be greater than 10000. + * + */ + traffic_allocation?: number; + status?: VariationStatuses; + /** + * List of changes that this variation is exposing. + */ + changes?: Array; +}; + +export type ExperienceStatuses = 'draft' | 'active' | 'paused' | 'completed' | 'scheduled'; export const ExperienceStatuses = { - DRAFT: 'draft', - ACTIVE: 'active', - PAUSED: 'paused', - COMPLETED: 'completed', - SCHEDULED: 'scheduled' + DRAFT: 'draft', + ACTIVE: 'active', + PAUSED: 'paused', + COMPLETED: 'completed', + SCHEDULED: 'scheduled' } as const; -export type ExperienceTypes = - | 'a/b' - | 'a/a' - | 'mvt' - | 'split_url' - | 'multipage' - | 'deploy'; +export type ExperienceTypes = 'a/b' | 'a/a' | 'mvt' | 'split_url' | 'multipage' | 'deploy'; export const ExperienceTypes = { - A_B: 'a/b', - A_A: 'a/a', - MVT: 'mvt', - SPLIT_URL: 'split_url', - MULTIPAGE: 'multipage', - DEPLOY: 'deploy' + A_B: 'a/b', + A_A: 'a/a', + MVT: 'mvt', + SPLIT_URL: 'split_url', + MULTIPAGE: 'multipage', + DEPLOY: 'deploy' } as const; /** @@ -1965,48 +1758,46 @@ export type VariationStatuses = 'stopped' | 'running'; * Variation status */ export const VariationStatuses = { - STOPPED: 'stopped', - RUNNING: 'running' + STOPPED: 'stopped', + RUNNING: 'running' } as const; -export type ExperienceIntegrationGAServing = - | ExperienceIntegrationGA3 - | ExperienceIntegrationGA4Base; +export type ExperienceIntegrationGAServing = ExperienceIntegrationGA3 | ExperienceIntegrationGA4Base; /** * Base Feature Object */ export type ConfigFeature = { - /** - * Feature ID - */ - id?: string; - /** - * A name given to the feature to identify it easily - */ - name?: string; - /** - * A unique per project level identifier - */ - key?: string; - /** - * An array of user-defined variables of a feature. - */ - variables?: Array; + /** + * Feature ID + */ + id?: string; + /** + * A name given to the feature to identify it easily + */ + name?: string; + /** + * A unique per project level identifier + */ + key?: string; + /** + * An array of user-defined variables of a feature. + */ + variables?: Array; }; /** * An object which describes the variable of a feature. Where key is variable name and value is one of the possible types [boolean, float, json, integer, string] */ export type FeatureVariableItemData = { - /** - * A user-defined variable name - */ - key?: string; - /** - * A variable's type - */ - type?: 'boolean' | 'float' | 'json' | 'integer' | 'string'; + /** + * A user-defined variable name + */ + key?: string; + /** + * A variable's type + */ + type?: 'boolean' | 'float' | 'json' | 'integer' | 'string'; }; /** @@ -2018,175 +1809,167 @@ export type type10 = 'boolean' | 'float' | 'json' | 'integer' | 'string'; * A variable's type */ export const type10 = { - BOOLEAN: 'boolean', - FLOAT: 'float', - JSON: 'json', - INTEGER: 'integer', - STRING: 'string' + BOOLEAN: 'boolean', + FLOAT: 'float', + JSON: 'json', + INTEGER: 'integer', + STRING: 'string' } as const; /** * Goal item to be tracked inside a project */ export type ConfigGoalBase = { - /** - * Goal ID - */ - id?: string; - /** - * Goal Name. - */ - name?: string; - /** - * Goal Key - */ - key?: string; - /** - * List of goal types to be returned - */ - type?: Array; - rules?: RuleObject | null; -}; - -export type ConfigGoal = - | DomInteractionGoal - | ScrollPercentageGoal - | RevenueGoal - | NoSettingsGoal - | GaGoal - | SubmitsFormGoal - | ClicksLinkGoal - | ClicksElementGoal; + /** + * Goal ID + */ + id?: string; + /** + * Goal Name. + */ + name?: string; + /** + * Goal Key + */ + key?: string; + /** + * List of goal types to be returned + */ + type?: Array; + rules?: ((RuleObject) | null); +}; + +export type ConfigGoal = DomInteractionGoal | ScrollPercentageGoal | RevenueGoal | NoSettingsGoal | GaGoal | SubmitsFormGoal | ClicksLinkGoal | ClicksElementGoal; export type DomInteractionGoal = ConfigGoalBase & { - type?: 'dom_interaction'; - settings?: DomInteractionGoalSettings; + type?: 'dom_interaction'; + settings?: DomInteractionGoalSettings; }; export type type11 = 'dom_interaction'; export const type11 = { - DOM_INTERACTION: 'dom_interaction' + DOM_INTERACTION: 'dom_interaction' } as const; export type ScrollPercentageGoal = ConfigGoalBase & { - type?: 'scroll_percentage'; - settings?: ScrollPercentageGoalSettings; + type?: 'scroll_percentage'; + settings?: ScrollPercentageGoalSettings; }; export type type12 = 'scroll_percentage'; export const type12 = { - SCROLL_PERCENTAGE: 'scroll_percentage' + SCROLL_PERCENTAGE: 'scroll_percentage' } as const; export type RevenueGoal = ConfigGoalBase & { - type?: 'revenue'; - settings?: RevenueGoalSettings; + type?: 'revenue'; + settings?: RevenueGoalSettings; }; export type type13 = 'revenue'; export const type13 = { - REVENUE: 'revenue' + REVENUE: 'revenue' } as const; export type NoSettingsGoal = ConfigGoalBase & { - type?: 'advanced' | 'visits_page' | 'code_trigger'; + type?: 'advanced' | 'visits_page' | 'code_trigger'; }; export type type14 = 'advanced' | 'visits_page' | 'code_trigger'; export const type14 = { - ADVANCED: 'advanced', - VISITS_PAGE: 'visits_page', - CODE_TRIGGER: 'code_trigger' + ADVANCED: 'advanced', + VISITS_PAGE: 'visits_page', + CODE_TRIGGER: 'code_trigger' } as const; export type GaGoal = ConfigGoalBase & { - type?: 'ga_import'; - settings?: GaGoalSettings; + type?: 'ga_import'; + settings?: GaGoalSettings; }; export type type15 = 'ga_import'; export const type15 = { - GA_IMPORT: 'ga_import' + GA_IMPORT: 'ga_import' } as const; export type SubmitsFormGoal = ConfigGoalBase & { - type?: 'submits_form'; - settings?: SubmitsFormGoalSettings; + type?: 'submits_form'; + settings?: SubmitsFormGoalSettings; }; export type type16 = 'submits_form'; export const type16 = { - SUBMITS_FORM: 'submits_form' + SUBMITS_FORM: 'submits_form' } as const; export type ClicksLinkGoal = ConfigGoalBase & { - type?: 'clicks_link'; - settings?: ClicksLinkGoalSettings; + type?: 'clicks_link'; + settings?: ClicksLinkGoalSettings; }; export type type17 = 'clicks_link'; export const type17 = { - CLICKS_LINK: 'clicks_link' + CLICKS_LINK: 'clicks_link' } as const; export type ClicksElementGoal = ConfigGoalBase & { - type?: 'clicks_element'; - settings?: ClicksElementGoalSettings; + type?: 'clicks_element'; + settings?: ClicksElementGoalSettings; }; export type type18 = 'clicks_element'; export const type18 = { - CLICKS_ELEMENT: 'clicks_element' + CLICKS_ELEMENT: 'clicks_element' } as const; export type DomInteractionGoalSettings = { - /** - * Array of Events to be tracked by this goal - */ - tracked_items: Array<{ /** - * Css selector that identifies the DOM element(s) on which 'event' is to be monitored in order to fire the goal. + * Array of Events to be tracked by this goal */ - selector?: string; - /** - * The event to monitor in order to fire the goal. - */ - event?: string; - }>; + tracked_items: Array<{ + /** + * Css selector that identifies the DOM element(s) on which 'event' is to be monitored in order to fire the goal. + */ + selector?: string; + /** + * The event to monitor in order to fire the goal. + */ + event?: string; + }>; }; export type ScrollPercentageGoalSettings = { - /** - * The percentage of scrolling after which the goal will be fired - */ - percentage: number; + /** + * The percentage of scrolling after which the goal will be fired + */ + percentage: number; }; export type GaGoalSettings = { - /** - * GA4 event name - */ - ga_event?: string; + /** + * GA4 event name + */ + ga_event?: string; }; export type RevenueGoalSettings = { - /** - * Type of the revenue goal tracking, one of the below. - * * "manual" - goal will be triggered through the given revenue tracking code; - * An empty **triggering_rule** has to be provided as that takes priority over manual triggering - * * "ga" - Convert will attempt to pick revenue from GA revenue tracking code and attach it to this goal, - * when on page where this goal is triggered via "triggering_rule" - * - */ - triggering_type: 'manual' | 'ga'; + /** + * Type of the revenue goal tracking, one of the below. + * * "manual" - goal will be triggered through the given revenue tracking code; + * An empty **triggering_rule** has to be provided as that takes priority over manual triggering + * * "ga" - Convert will attempt to pick revenue from GA revenue tracking code and attach it to this goal, + * when on page where this goal is triggered via "triggering_rule" + * + */ + triggering_type: 'manual' | 'ga'; }; /** @@ -2208,71 +1991,58 @@ export type triggering_type = 'manual' | 'ga'; * */ export const triggering_type = { - MANUAL: 'manual', - GA: 'ga' + MANUAL: 'manual', + GA: 'ga' } as const; export type SubmitsFormGoalSettings = { - /** - * Url representing form's action attribute used to identify forms which will be tracked for submit event. - */ - action: string; + /** + * Url representing form's action attribute used to identify forms which will be tracked for submit event. + */ + action: string; }; export type ClicksLinkGoalSettings = { - /** - * Url representing link's href attribute used to identify links which will be tracked for click event - */ - href: string; + /** + * Url representing link's href attribute used to identify links which will be tracked for click event + */ + href: string; }; export type ClicksElementGoalSettings = { - /** - * Css selector that identifies the DOM element(s) on which will track clicks in order to fire the goal. - */ - selector: string; + /** + * Css selector that identifies the DOM element(s) on which will track clicks in order to fire the goal. + */ + selector: string; }; /** * Goals type, one of below. */ -export type GoalTypes = - | 'advanced' - | 'dom_interaction' - | 'scroll_percentage' - | 'code_trigger' - | 'revenue'; +export type GoalTypes = 'advanced' | 'dom_interaction' | 'scroll_percentage' | 'code_trigger' | 'revenue'; /** * Goals type, one of below. */ export const GoalTypes = { - ADVANCED: 'advanced', - DOM_INTERACTION: 'dom_interaction', - SCROLL_PERCENTAGE: 'scroll_percentage', - CODE_TRIGGER: 'code_trigger', - REVENUE: 'revenue' + ADVANCED: 'advanced', + DOM_INTERACTION: 'dom_interaction', + SCROLL_PERCENTAGE: 'scroll_percentage', + CODE_TRIGGER: 'code_trigger', + REVENUE: 'revenue' } as const; /** * This one describes a logical triggering rule that is being used inside the app */ -export type LocationTrigger = - | LocationTriggerDomElement - | LocationTriggerCallback - | LocationTriggerManual - | LocationTriggerUponRun; +export type LocationTrigger = LocationTriggerDomElement | LocationTriggerCallback | LocationTriggerManual | LocationTriggerUponRun; /** * Describes possible location trigger types. * Note that `upon_run` is always the case for **fullstack** projects. * */ -export type LocationTriggerTypes = - | 'upon_run' - | 'manual' - | 'dom_element' - | 'callback'; +export type LocationTriggerTypes = 'upon_run' | 'manual' | 'dom_element' | 'callback'; /** * Describes possible location trigger types. @@ -2280,34 +2050,34 @@ export type LocationTriggerTypes = * */ export const LocationTriggerTypes = { - UPON_RUN: 'upon_run', - MANUAL: 'manual', - DOM_ELEMENT: 'dom_element', - CALLBACK: 'callback' + UPON_RUN: 'upon_run', + MANUAL: 'manual', + DOM_ELEMENT: 'dom_element', + CALLBACK: 'callback' } as const; export type LocationTriggerBase = { - type: LocationTriggerTypes; + type: LocationTriggerTypes; }; export type LocationTriggerUponRun = LocationTriggerBase & { - type?: 'upon_run'; + type?: 'upon_run'; }; export type type19 = 'upon_run'; export const type19 = { - UPON_RUN: 'upon_run' + UPON_RUN: 'upon_run' } as const; export type LocationTriggerManual = LocationTriggerBase & { - type?: 'manual'; + type?: 'manual'; }; export type type20 = 'manual'; export const type20 = { - MANUAL: 'manual' + MANUAL: 'manual' } as const; /** @@ -2319,153 +2089,153 @@ export type LocationDomTriggerEvents = 'click' | 'hover' | 'in_view' | 'change'; * Allowed events for LocationTriggerDomElement */ export const LocationDomTriggerEvents = { - CLICK: 'click', - HOVER: 'hover', - IN_VIEW: 'in_view', - CHANGE: 'change' + CLICK: 'click', + HOVER: 'hover', + IN_VIEW: 'in_view', + CHANGE: 'change' } as const; export type LocationTriggerDomElement = LocationTriggerBase & { - type?: 'dom_element'; - /** - * Describes html selector - */ - selector: string; - /** - * Events for LocationTriggerDomElement - */ - events: Array; + type?: 'dom_element'; + /** + * Describes html selector + */ + selector: string; + /** + * Events for LocationTriggerDomElement + */ + events: Array; }; export type type21 = 'dom_element'; export const type21 = { - DOM_ELEMENT: 'dom_element' + DOM_ELEMENT: 'dom_element' } as const; export type LocationTriggerCallback = LocationTriggerBase & { - type?: 'callback'; - /** - * Describes the js callback that will be executed in order to fire the experience. - * It is called with two arguments: - * - `activate` - a function that should be called when the experience should be activated - * - `options` - an object with the following properties: - * - `locationId` - id of the location that is being activated - * - `isActive` - boolean flag that indicates if the location is active - * - * Example: - * ``` - * function(activate, options) { - * if (options.isActive) { - * setTimeout(function() { - * * it activates the experiences 1 second after the - * location trigger is initialized - at the load of the tracking script* - * activate(); - * }, 1000); - * } - * } - * ``` - * - */ - js: string; + type?: 'callback'; + /** + * Describes the js callback that will be executed in order to fire the experience. + * It is called with two arguments: + * - `activate` - a function that should be called when the experience should be activated + * - `options` - an object with the following properties: + * - `locationId` - id of the location that is being activated + * - `isActive` - boolean flag that indicates if the location is active + * + * Example: + * ``` + * function(activate, options) { + * if (options.isActive) { + * setTimeout(function() { + * * it activates the experiences 1 second after the + * location trigger is initialized - at the load of the tracking script* + * activate(); + * }, 1000); + * } + * } + * ``` + * + */ + js: string; }; export type type22 = 'callback'; export const type22 = { - CALLBACK: 'callback' + CALLBACK: 'callback' } as const; /** * Base Location object */ export type ConfigLocation = { - /** - * Location ID - */ - id?: string; - /** - * Location unique key - */ - key?: string; - /** - * Location Name - */ - name?: string; - trigger?: LocationTrigger; - rules?: RuleObject | null; + /** + * Location ID + */ + id?: string; + /** + * Location unique key + */ + key?: string; + /** + * Location Name + */ + name?: string; + trigger?: LocationTrigger; + rules?: ((RuleObject) | null); }; export type ConfigProjectMinimalSettings = { - /** - * Whether to include jQuery library or not into the javascript tracking file served by Convert and loaded via the tracking snippet. If jQuery is not included, it has to be loaded on page, before Convert's tracking code - */ - include_jquery?: boolean; - /** - * Whether to include jQuery library or not into the v1 javascript tracking file served by Convert and loaded via the tracking snippet. - */ - include_jquery_v1?: boolean; - /** - * Whether to disable the SPA (Single Page Application) related functionalities from the tracking scripts V1. Most websites work fine without disabling SPA functionality regardless of the fact they are Single Page Apps or not. In edge situation, this setting might prove handy - */ - disable_spa_functionality?: boolean; - /** - * Tracks the project's version, updated with each change done inside the project, which would affect the config of that project. The format is [ISO_datetime]-[incremental_number]. - * - */ - readonly version?: string | null; - tracking_script?: TrackingScriptReleaseBase; + /** + * Whether to include jQuery library or not into the javascript tracking file served by Convert and loaded via the tracking snippet. If jQuery is not included, it has to be loaded on page, before Convert's tracking code + */ + include_jquery?: boolean; + /** + * Whether to include jQuery library or not into the v1 javascript tracking file served by Convert and loaded via the tracking snippet. + */ + include_jquery_v1?: boolean; + /** + * Whether to disable the SPA (Single Page Application) related functionalities from the tracking scripts V1. Most websites work fine without disabling SPA functionality regardless of the fact they are Single Page Apps or not. In edge situation, this setting might prove handy + */ + disable_spa_functionality?: boolean; + /** + * Tracks the project's version, updated with each change done inside the project, which would affect the config of that project. The format is [ISO_datetime]-[incremental_number]. + * + */ + readonly version?: (string) | null; + tracking_script?: TrackingScriptReleaseBase; }; /** * Project Object under which experiences would get created */ export type ConfigProject = { - /** - * Project ID - */ - id?: string; - /** - * Project Name. If **settings.data_anonymization** is turned on, the name will be generated from **id** field - */ - name?: string; - /** - * Value which describes project product type - */ - type?: 'fullstack' | 'web'; - utc_offset?: UTC_Offset; - /** - * Object representing the custom domain that is used for loading the tracking scripts and - * sending tracking requests to Convert servers instead of the standard Convert domain - * - */ - custom_domain?: { - /** - * Custom domain to be used instead of standard Convert's one - */ - domain?: string; - } | null; - /** - * List of domains allowed to be tracked under this project - */ - domains?: Array<{ - /** - * Top level domain, used for setting cookies where applicable - */ - tld?: string; - /** - * List of host names under **tld** which are allowed to be tracked under this project - */ - hosts?: unknown; - }>; - /** - * The global javascript code that will be loaded on all pages where - * the tracking script is installed, prior do processing any of - * experiences, goals, audiences etc. - * - */ - global_javascript?: string | null; - settings?: { + /** + * Project ID + */ + id?: string; + /** + * Project Name. If **settings.data_anonymization** is turned on, the name will be generated from **id** field + */ + name?: string; + /** + * Value which describes project product type + */ + type?: 'fullstack' | 'web'; + utc_offset?: UTC_Offset; + /** + * Object representing the custom domain that is used for loading the tracking scripts and + * sending tracking requests to Convert servers instead of the standard Convert domain + * + */ + custom_domain?: { + /** + * Custom domain to be used instead of standard Convert's one + */ + domain?: string; + } | null; + /** + * List of domains allowed to be tracked under this project + */ + domains?: Array<{ + /** + * Top level domain, used for setting cookies where applicable + */ + tld?: string; + /** + * List of host names under **tld** which are allowed to be tracked under this project + */ + hosts?: unknown; + }>; + /** + * The global javascript code that will be loaded on all pages where + * the tracking script is installed, prior do processing any of + * experiences, goals, audiences etc. + * + */ + global_javascript?: (string) | null; + settings?: ({ /** * Flag indicating whether decoration of outgoing links (appending tracking cookies inside the link URL in order to * make cross domain tracking possible) is done automatically on page @@ -2497,13 +2267,16 @@ export type ConfigProject = { * This holds project wide settings used by integrations */ integrations?: { - google_analytics?: GA_Settings; - kissmetrics?: { - /** - * Flag indicating whether Kissmetrics integration is enabled or not for this project - */ - enabled?: boolean; - }; + google_analytics?: GA_Settings; + visitor_insights?: { + tracking_id?: VisitorInsightsTrackingId; + }; + kissmetrics?: { + /** + * Flag indicating whether Kissmetrics integration is enabled or not for this project + */ + enabled?: boolean; + }; }; /** * Minimum order value for transactions outliers @@ -2519,31 +2292,31 @@ export type ConfigProject = { * Various settings used by the stats engine to detect outliers */ outliers?: { - /** - * Order value outlier settings - */ - order_value?: NumericOutlier; - /** - * Products Ordered count outlier settings - */ - products_ordered_count?: NumericOutlier; + /** + * Order value outlier settings + */ + order_value?: (NumericOutlier); + /** + * Products Ordered count outlier settings + */ + products_ordered_count?: (NumericOutlier); }; - } & ConfigProjectMinimalSettings; - /** - * A user-defined key-value object which describes environments available for the project. The number of environments a user can add depends on their plan, by default only one environment is allowed. - */ - environments?: { - [key: string]: { - /** - * The display name of the environment. - */ - label: string; - /** - * Specifies whether this environment is set as the default environment for the project. - */ - is_default: boolean; +} & ConfigProjectMinimalSettings); + /** + * A user-defined key-value object which describes environments available for the project. The number of environments a user can add depends on their plan, by default only one environment is allowed. + */ + environments?: { + [key: string]: { + /** + * The display name of the environment. + */ + label: string; + /** + * Specifies whether this environment is set as the default environment for the project. + */ + is_default: boolean; + }; }; - }; }; /** @@ -2555,8 +2328,8 @@ export type type23 = 'fullstack' | 'web'; * Value which describes project product type */ export const type23 = { - FULLSTACK: 'fullstack', - WEB: 'web' + FULLSTACK: 'fullstack', + WEB: 'web' } as const; /** @@ -2568,10 +2341,10 @@ export type do_not_track = 'OFF' | 'EU ONLY' | 'EEA ONLY' | 'Worldwide'; * Follow the 'Do not track' browser settings for users in the mentioned area of the world. */ export const do_not_track = { - OFF: 'OFF', - EU_ONLY: 'EU ONLY', - EEA_ONLY: 'EEA ONLY', - WORLDWIDE: 'Worldwide' + OFF: 'OFF', + EU_ONLY: 'EU ONLY', + EEA_ONLY: 'EEA ONLY', + WORLDWIDE: 'Worldwide' } as const; /** @@ -2582,11 +2355,7 @@ export const do_not_track = { * - Worldwide: Follow GPC signals for users worldwide. * */ -export type global_privacy_control = - | 'OFF' - | 'EU ONLY' - | 'EEA ONLY' - | 'Worldwide'; +export type global_privacy_control = 'OFF' | 'EU ONLY' | 'EEA ONLY' | 'Worldwide'; /** * Follow Global Privacy Control (GPC) signals for users in the mentioned area of the world. @@ -2597,42 +2366,54 @@ export type global_privacy_control = * */ export const global_privacy_control = { - OFF: 'OFF', - EU_ONLY: 'EU ONLY', - EEA_ONLY: 'EEA ONLY', - WORLDWIDE: 'Worldwide' + OFF: 'OFF', + EU_ONLY: 'EU ONLY', + EEA_ONLY: 'EEA ONLY', + WORLDWIDE: 'Worldwide' } as const; /** * Settings to identify which tracking script version will be applied to the project. */ export type TrackingScriptReleaseBase = { - /** - * Current version of the tracking script bundle - */ - readonly current_version?: string; - /** - * Latest available version of the tracking script bundle. - */ - readonly latest_version?: string | null; + /** + * Current version of the tracking script bundle + */ + readonly current_version?: string; + /** + * Latest available version of the tracking script bundle. + */ + readonly latest_version?: (string) | null; } | null; +/** + * The tracking ID for Visitor Insights. + */ +export type VisitorInsightsTrackingId = string; + +export type VisitorInsightsData = VisitorInsightsBase & { + tracking_id?: VisitorInsightsTrackingId; + /** + * The sampling rate for tracking events. + */ + sampling_rate?: number; +}; + export type ProjectGASettingsBase = GA_SettingsBase & { - /** - * Attempt to pull revenue data from Google Analytics Revenue Tracking code. - */ - auto_revenue_tracking?: boolean; + /** + * Attempt to pull revenue data from Google Analytics Revenue Tracking code. + */ + auto_revenue_tracking?: boolean; }; export type ProjectIntegrationGA3 = ProjectGASettingsBase & IntegrationGA3; -export type ProjectIntegrationGA4 = ProjectGASettingsBase & - IntegrationGA4Base & { +export type ProjectIntegrationGA4 = ProjectGASettingsBase & IntegrationGA4Base & { /** * Boolean indicating whether to wait for the page view event to complete before sending other events. */ no_wait_pageview?: boolean; - }; +}; export type GA_Settings = ProjectIntegrationGA3 | ProjectIntegrationGA4; @@ -2640,68 +2421,68 @@ export type GA_Settings = ProjectIntegrationGA3 | ProjectIntegrationGA4; * Base Segment object */ export type ConfigSegment = { - /** - * Segment ID - */ - id?: string; - /** - * Segment unique key - */ - key?: string; - /** - * Segment Name - */ - name?: string; - rules?: RuleObject | null; + /** + * Segment ID + */ + id?: string; + /** + * Segment unique key + */ + key?: string; + /** + * Segment Name + */ + name?: string; + rules?: ((RuleObject) | null); }; /** * Tracking Request's data */ export type SendTrackingEventsRequestData = { - /** - * ID of the account under which the project is setup - */ - accountId?: string; - /** - * ID of the project under which the tracking occurs - */ - projectId?: string; - /** - * Flag to determine whether the data is gonna be enriched before the events are stored for reporting. - * For example, in case of a conversion event, if this flag is on and bucketing is not provided, the bucketing stored on the backend datastore for the given visitor - * ID would be used. Same applies for segments. - * - * *Note*: this flag is only available for some plans - * - */ - enrichData?: boolean; - /** - * List of visitors tracked. Each visitor can have multiple events. - * - */ - visitors?: Array<{ - segments?: VisitorSegments; - /** - * Id of the visitor tracked - */ - visitorId?: string; - /** - * List of events fired for the given visitor - */ - events?: Array; - }>; + /** + * ID of the account under which the project is setup + */ + accountId?: string; + /** + * ID of the project under which the tracking occurs + */ + projectId?: string; + /** + * Flag to determine whether the data is gonna be enriched before the events are stored for reporting. + * For example, in case of a conversion event, if this flag is on and bucketing is not provided, the bucketing stored on the backend datastore for the given visitor + * ID would be used. Same applies for segments. + * + * *Note*: this flag is only available for some plans + * + */ + enrichData?: boolean; + /** + * List of visitors tracked. Each visitor can have multiple events. + * + */ + visitors?: Array<{ + segments?: VisitorSegments; + /** + * Id of the visitor tracked + */ + visitorId?: string; + /** + * List of events fired for the given visitor + */ + events?: Array; + }>; }; /** * Tracking events related to the same user ID */ export type VisitorTrackingEvents = { - /** - * Type of the event. It can be a bucketing or a conversion event - */ - eventType?: 'bucketing' | 'conversion'; - data?: BucketingEvent | ConversionEvent; + /** + * Type of the event. It can be a bucketing or a conversion event + */ + eventType?: 'bucketing' | 'conversion'; + data?: (BucketingEvent | ConversionEvent); }; /** @@ -2713,57 +2494,57 @@ export type eventType = 'bucketing' | 'conversion'; * Type of the event. It can be a bucketing or a conversion event */ export const eventType = { - BUCKETING: 'bucketing', - CONVERSION: 'conversion' + BUCKETING: 'bucketing', + CONVERSION: 'conversion' } as const; /** * Bucketing event data */ export type BucketingEvent = { - /** - * Experience ID to which the visitor is bucketed. In case that **enrichData=true** flag is being sent, only unique events are gonna be recorded. Otherwise, it's - * up to the client to ensure that duplicates of the same event for the same visitor do not get sent to the tracking endpoint. - * - */ - experienceId: string; - /** - * Variation ID corresponding to the experience identified by experienceID, that is assigned to the visitor. - */ - variationId: string; + /** + * Experience ID to which the visitor is bucketed. In case that **enrichData=true** flag is being sent, only unique events are gonna be recorded. Otherwise, it's + * up to the client to ensure that duplicates of the same event for the same visitor do not get sent to the tracking endpoint. + * + */ + experienceId: string; + /** + * Variation ID corresponding to the experience identified by experienceID, that is assigned to the visitor. + */ + variationId: string; }; /** * Conversion event data */ export type ConversionEvent = { - /** - * Id of the conversion goal to be fired - */ - goalId: string; - /** - * Data connected to this conversion, for non binomial metrics, eg revenue - */ - goalData?: Array<{ /** - * Key of the metric + * Id of the conversion goal to be fired */ - key?: 'amount' | 'productsCount' | 'transactionId'; + goalId: string; /** - * Value of the metric + * Data connected to this conversion, for non binomial metrics, eg revenue */ - value?: number | string; - }>; - /** - * Bucketing data (experiences that this visitor is currently part of) for the visitor. In case that **enrichData=true** flag is being sent and - * this attribute is not provided, the bucketing stored on the backend datastore for the given visitor is gonna be used. If both **enrichData=true** and - * **bucketingData**, the **bucketingData** is gonna be merged with the stored data inside the backend data source, the request provided data having the - * biggest overwriting bucketing for the same experience which might exist on the backend - * - */ - bucketingData?: { - [key: string]: string; - }; + goalData?: Array<{ + /** + * Key of the metric + */ + key?: 'amount' | 'productsCount' | 'transactionId'; + /** + * Value of the metric + */ + value?: (number | string); + }>; + /** + * Bucketing data (experiences that this visitor is currently part of) for the visitor. In case that **enrichData=true** flag is being sent and + * this attribute is not provided, the bucketing stored on the backend datastore for the given visitor is gonna be used. If both **enrichData=true** and + * **bucketingData**, the **bucketingData** is gonna be merged with the stored data inside the backend data source, the request provided data having the + * biggest overwriting bucketing for the same experience which might exist on the backend + * + */ + bucketingData?: { + [key: string]: (string); + }; }; /** @@ -2772,43 +2553,41 @@ export type ConversionEvent = { * */ export type VisitorSegments = { - /** - * Browser used: - * IE - Internet Explorer - * CH - Chrome - * FF - Firefox - * OP - Opera - * SF - Safari - * OTH - Other - * - */ - browser?: 'IE' | 'CH' | 'FF' | 'OP' | 'SF' | 'OTH'; - /** - * List of device classes that the visitor device falls into - */ - devices?: Array< - 'ALLPH' | 'IPH' | 'OTHPH' | 'ALLTAB' | 'IPAD' | 'OTHTAB' | 'DESK' | 'OTHDEV' - >; - /** - * Traffic source - */ - source?: 'campaign' | 'search' | 'referral' | 'direct'; - /** - * Campaign string - */ - campaign?: string; - /** - * Type of the visitor - */ - visitorType?: 'new' | 'returning'; - /** - * Two ISO country code for visitor's country - */ - country?: string; - /** - * Custom Segments as defined inside Convert app. This will be the list of segments' IDs - */ - customSegments?: Array; + /** + * Browser used: + * IE - Internet Explorer + * CH - Chrome + * FF - Firefox + * OP - Opera + * SF - Safari + * OTH - Other + * + */ + browser?: 'IE' | 'CH' | 'FF' | 'OP' | 'SF' | 'OTH'; + /** + * List of device classes that the visitor device falls into + */ + devices?: Array<('ALLPH' | 'IPH' | 'OTHPH' | 'ALLTAB' | 'IPAD' | 'OTHTAB' | 'DESK' | 'OTHDEV')>; + /** + * Traffic source + */ + source?: 'campaign' | 'search' | 'referral' | 'direct'; + /** + * Campaign string + */ + campaign?: string; + /** + * Type of the visitor + */ + visitorType?: 'new' | 'returning'; + /** + * Two ISO country code for visitor's country + */ + country?: string; + /** + * Custom Segments as defined inside Convert app. This will be the list of segments' IDs + */ + customSegments?: Array<(string)>; }; /** @@ -2834,12 +2613,12 @@ export type browser = 'IE' | 'CH' | 'FF' | 'OP' | 'SF' | 'OTH'; * */ export const browser = { - IE: 'IE', - CH: 'CH', - FF: 'FF', - OP: 'OP', - SF: 'SF', - OTH: 'OTH' + IE: 'IE', + CH: 'CH', + FF: 'FF', + OP: 'OP', + SF: 'SF', + OTH: 'OTH' } as const; /** @@ -2851,10 +2630,10 @@ export type source = 'campaign' | 'search' | 'referral' | 'direct'; * Traffic source */ export const source = { - CAMPAIGN: 'campaign', - SEARCH: 'search', - REFERRAL: 'referral', - DIRECT: 'direct' + CAMPAIGN: 'campaign', + SEARCH: 'search', + REFERRAL: 'referral', + DIRECT: 'direct' } as const; /** @@ -2866,160 +2645,189 @@ export type visitorType = 'new' | 'returning'; * Type of the visitor */ export const visitorType = { - NEW: 'new', - RETURNING: 'returning' + NEW: 'new', + RETURNING: 'returning' } as const; export type GetProjectConfigData = { - /** - * ID of the account that owns the retrieved/saved data - */ - accountId: number; - /** - * Filter experiences based on environment. - */ - environment?: string; - /** - * ID of the project to be retrieved - */ - projectId: number; -}; - -export type GetProjectConfigResponse = ConfigResponseData; + /** + * ID of the account that owns the retrieved/saved data + */ + accountId: number; + /** + * Filter experiences based on environment. + */ + environment?: string; + /** + * ID of the project to be retrieved + */ + projectId: number; +}; + +export type GetProjectConfigResponse = (ConfigResponseData); export type GetProjectConfigBySdkKeyData = { - /** - * Filter experiences based on environment. - */ - environment?: string; - /** - * The SDK key used to retrieve the project's config - */ - sdkKey: string; + /** + * Filter experiences based on environment. + */ + environment?: string; + /** + * The SDK key used to retrieve the project's config + */ + sdkKey: string; }; -export type GetProjectConfigBySdkKeyResponse = ConfigResponseData; +export type GetProjectConfigBySdkKeyResponse = (ConfigResponseData); export type GetProjectSettingsData = { - /** - * ID of the account that owns the retrieved/saved data - */ - accountId: number; - /** - * ID of the project to be retrieved - */ - projectId: number; + /** + * ID of the account that owns the retrieved/saved data + */ + accountId: number; + /** + * ID of the project to be retrieved + */ + projectId: number; +}; + +export type GetProjectSettingsResponse = (ConfigMinimalResponseData); + +export type GetProjectOptionalSettingsData = { + /** + * ID of the account that owns the retrieved/saved data + */ + accountId: number; + /** + * ID of the project to be retrieved + */ + projectId: number; }; -export type GetProjectSettingsResponse = ConfigMinimalResponseData; +export type GetProjectOptionalSettingsResponse = (ConfigOptionalResponseData); export type SendTrackingEventsSdkKeyData = { - /** - * A JSON object containing the tracking events sent to the Convert tracking servers. - */ - requestBody: SendTrackingEventsRequestData; - /** - * The SDK key used to identify the project where that the data belongs to - */ - sdkKey: string; + /** + * A JSON object containing the tracking events sent to the Convert tracking servers. + */ + requestBody: SendTrackingEventsRequestData; + /** + * The SDK key used to identify the project where that the data belongs to + */ + sdkKey: string; }; -export type SendTrackingEventsSdkKeyResponse = SuccessData; +export type SendTrackingEventsSdkKeyResponse = (SuccessData); export type SendTrackingEventsData = { - /** - * ID of the account that owns the given project - */ - accountId: number; - /** - * ID of the project to which the events belong to - */ - projectId: number; - /** - * A JSON object containing the tracking events sent to the Convert tracking servers. - */ - requestBody: SendTrackingEventsRequestData; -}; - -export type SendTrackingEventsResponse = SuccessData; + /** + * ID of the account that owns the given project + */ + accountId: number; + /** + * ID of the project to which the events belong to + */ + projectId: number; + /** + * A JSON object containing the tracking events sent to the Convert tracking servers. + */ + requestBody: SendTrackingEventsRequestData; +}; + +export type SendTrackingEventsResponse = (SuccessData); export type $OpenApiTs = { - '/config/{account_id}/{project_id}': { - get: { - req: GetProjectConfigData; - res: { - /** - * Object consumed by SDKs - * - */ - 200: ConfigResponseData; - /** - * A response signaling an error - */ - default: ErrorData; - }; + '/config/{account_id}/{project_id}': { + get: { + req: GetProjectConfigData; + res: { + /** + * Object consumed by SDKs + * + */ + 200: ConfigResponseData; + /** + * A response signaling an error + */ + default: ErrorData; + }; + }; }; - }; - '/config/{sdk_key}': { - get: { - req: GetProjectConfigBySdkKeyData; - res: { - /** - * Object consumed by SDKs - * - */ - 200: ConfigResponseData; - /** - * A response signaling an error - */ - default: ErrorData; - }; + '/config/{sdk_key}': { + get: { + req: GetProjectConfigBySdkKeyData; + res: { + /** + * Object consumed by SDKs + * + */ + 200: ConfigResponseData; + /** + * A response signaling an error + */ + default: ErrorData; + }; + }; }; - }; - '/project-settings/{account_id}/{project_id}': { - get: { - req: GetProjectSettingsData; - res: { - /** - * Object consumed by SDKs - * - */ - 200: ConfigMinimalResponseData; - /** - * A response signaling an error - */ - default: ErrorData; - }; + '/project-settings/{account_id}/{project_id}': { + get: { + req: GetProjectSettingsData; + res: { + /** + * Object consumed by SDKs + * + */ + 200: ConfigMinimalResponseData; + /** + * A response signaling an error + */ + default: ErrorData; + }; + }; }; - }; - '/track/{sdkKey}': { - post: { - req: SendTrackingEventsSdkKeyData; - res: { - /** - * A response signaling a generic success - */ - 200: SuccessData; - /** - * A response signaling an error - */ - default: ErrorData; - }; + '/project-optional-settings/{account_id}/{project_id}': { + get: { + req: GetProjectOptionalSettingsData; + res: { + /** + * Object consumed by SDKs + * + */ + 200: ConfigOptionalResponseData; + /** + * A response signaling an error + */ + default: ErrorData; + }; + }; }; - }; - '/track/{account_id}/{project_id}': { - post: { - req: SendTrackingEventsData; - res: { - /** - * A response signaling a generic success - */ - 200: SuccessData; - /** - * A response signaling an error - */ - default: ErrorData; - }; + '/track/{sdk_key}': { + post: { + req: SendTrackingEventsSdkKeyData; + res: { + /** + * A response signaling a generic success + */ + 200: SuccessData; + /** + * A response signaling an error + */ + default: ErrorData; + }; + }; }; - }; -}; + '/track/{account_id}/{project_id}': { + post: { + req: SendTrackingEventsData; + res: { + /** + * A response signaling a generic success + */ + 200: SuccessData; + /** + * A response signaling an error + */ + default: ErrorData; + }; + }; + }; +}; \ No newline at end of file From 35dba11880b3bad30bec0e15d2e9853148075ae6 Mon Sep 17 00:00:00 2001 From: Ahmed Abbas Date: Sat, 26 Jul 2025 13:30:41 +0300 Subject: [PATCH 07/12] feat: Add support for custom dimensions when tracking conversions --- packages/enums/src/goal-data-key.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/enums/src/goal-data-key.ts b/packages/enums/src/goal-data-key.ts index 5f724f60..5d330bdf 100644 --- a/packages/enums/src/goal-data-key.ts +++ b/packages/enums/src/goal-data-key.ts @@ -7,5 +7,10 @@ export enum GoalDataKey { AMOUNT = 'amount', PRODUCTS_COUNT = 'productsCount', - TRANSACTION_ID = 'transactionId' + TRANSACTION_ID = 'transactionId', + CUSTOM_DIMENSION_1 = 'customDimension1', + CUSTOM_DIMENSION_2 = 'customDimension2', + CUSTOM_DIMENSION_3 = 'customDimension3', + CUSTOM_DIMENSION_4 = 'customDimension4', + CUSTOM_DIMENSION_5 = 'customDimension5' } From a77e7bc2bd5990a7ef20ee39caad1dadc0ae7291 Mon Sep 17 00:00:00 2001 From: Ahmed Abbas Date: Sat, 26 Jul 2025 15:39:56 +0300 Subject: [PATCH 08/12] chore: update generated config types --- .prettierignore | 1 + packages/types/src/config/types.gen.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.prettierignore b/.prettierignore index e7becf85..d194c538 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ node_modules CHANGELOG.md +packages/types/src/config diff --git a/packages/types/src/config/types.gen.ts b/packages/types/src/config/types.gen.ts index c0b5468c..99ebe253 100644 --- a/packages/types/src/config/types.gen.ts +++ b/packages/types/src/config/types.gen.ts @@ -2529,7 +2529,7 @@ export type ConversionEvent = { /** * Key of the metric */ - key?: 'amount' | 'productsCount' | 'transactionId'; + key?: 'amount' | 'productsCount' | 'transactionId' | 'customDimension1' | 'customDimension2' | 'customDimension3' | 'customDimension4' | 'customDimension5'; /** * Value of the metric */ @@ -2830,4 +2830,4 @@ export type $OpenApiTs = { }; }; }; -}; \ No newline at end of file +}; From db5538646f7ce471bd20cee9418de29b7007376d Mon Sep 17 00:00:00 2001 From: Ahmed Abbas Date: Mon, 28 Jul 2025 19:12:19 +0300 Subject: [PATCH 09/12] chore: update config types for custom dimensions --- packages/types/src/config/types.gen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/src/config/types.gen.ts b/packages/types/src/config/types.gen.ts index 99ebe253..54487301 100644 --- a/packages/types/src/config/types.gen.ts +++ b/packages/types/src/config/types.gen.ts @@ -2533,7 +2533,7 @@ export type ConversionEvent = { /** * Value of the metric */ - value?: (number | string); + value?: (number | string | Array); }>; /** * Bucketing data (experiences that this visitor is currently part of) for the visitor. In case that **enrichData=true** flag is being sent and From d35b1f520333fb11fca715c39f70f43e1a9f00bd Mon Sep 17 00:00:00 2001 From: Ahmed Abbas Date: Fri, 1 Aug 2025 17:53:34 +0300 Subject: [PATCH 10/12] docs: Document using an authenticated SDK key --- packages/js-sdk/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/js-sdk/README.md b/packages/js-sdk/README.md index abdbdd8a..0e3bd463 100644 --- a/packages/js-sdk/README.md +++ b/packages/js-sdk/README.md @@ -215,12 +215,15 @@ The SDK instance can be initialized by either providing an `sdkKey` or a full pr Include `sdkKey` as a string property in the options object you pass to the constructor instance. The SDK will fetch the project configuration from Convert's CDN and will then refresh it every `dataRefreshInterval` milliseconds. +> Note: if you use an authenticated key, then you need to include `seksdkKeySecret` as a string property. + ```typescript import type {ConvertInterface, ConvertConfig} from '@convertcom/js-sdk'; import ConvertSDK from '@convertcom/js-sdk'; const convertSDK: ConvertInterface = new ConvertSDK({ sdkKey: 'xxx', + seksdkKeySecret: 'xxx', // required when using an authenticated SDK key dataRefreshInterval: 300000, // in milliseconds (5 minutes) environment: 'staging' // can also be "live"; this is configured in the Convert UI. } as ConvertConfig); From 6e9375ffab98530027aff31b95b4c948c02f2b7f Mon Sep 17 00:00:00 2001 From: Ahmed Abbas Date: Fri, 1 Aug 2025 18:07:30 +0300 Subject: [PATCH 11/12] docs: type --- packages/js-sdk/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/js-sdk/README.md b/packages/js-sdk/README.md index 0e3bd463..92410fea 100644 --- a/packages/js-sdk/README.md +++ b/packages/js-sdk/README.md @@ -215,7 +215,7 @@ The SDK instance can be initialized by either providing an `sdkKey` or a full pr Include `sdkKey` as a string property in the options object you pass to the constructor instance. The SDK will fetch the project configuration from Convert's CDN and will then refresh it every `dataRefreshInterval` milliseconds. -> Note: if you use an authenticated key, then you need to include `seksdkKeySecret` as a string property. +> Note: if you use an authenticated key, then you need to include `sdkKeySecret` as a string property. ```typescript import type {ConvertInterface, ConvertConfig} from '@convertcom/js-sdk'; @@ -223,7 +223,7 @@ import ConvertSDK from '@convertcom/js-sdk'; const convertSDK: ConvertInterface = new ConvertSDK({ sdkKey: 'xxx', - seksdkKeySecret: 'xxx', // required when using an authenticated SDK key + sdkKeySecret: 'xxx', // required when using an authenticated SDK key dataRefreshInterval: 300000, // in milliseconds (5 minutes) environment: 'staging' // can also be "live"; this is configured in the Convert UI. } as ConvertConfig); From 56da0fcb80cdac70225d4dfbf116773f73ca847e Mon Sep 17 00:00:00 2001 From: Ahmed Abbas Date: Fri, 1 Aug 2025 18:08:53 +0300 Subject: [PATCH 12/12] docs: update configuration options --- packages/js-sdk/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/js-sdk/README.md b/packages/js-sdk/README.md index 92410fea..2beeb366 100644 --- a/packages/js-sdk/README.md +++ b/packages/js-sdk/README.md @@ -270,6 +270,7 @@ import {LogLevel} from '@convertcom/js-sdk'; const config = { sdkKey: '', // either this or 'data' has to be provided + sdkKeySecret: '', // required when using an authenticated SDK key environment: 'staging', logger: { logLevel: LogLevel.DEBUG,