iureiure 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.editorconfig +21 -0
- package/.env.example +8 -0
- package/.eslintignore +19 -0
- package/.eslintrc.json +155 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +50 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- package/.github/dependabot.yml +6 -0
- package/.github/pull_request_template.md +23 -0
- package/.github/workflows/build-and-quality-checks-v3.yml +51 -0
- package/.github/workflows/check_pr_title.yml +17 -0
- package/.github/workflows/codeql-analysis.yml +70 -0
- package/.github/workflows/create-hotfix-branch-v3.yml +21 -0
- package/.github/workflows/deploy-beta-v3.yml +82 -0
- package/.github/workflows/deploy-dev-v3.yml +71 -0
- package/.github/workflows/deploy-npm-v3.yml +169 -0
- package/.github/workflows/deploy-prod-v3.yml +194 -0
- package/.github/workflows/deploy-sanity-suite.yml +80 -0
- package/.github/workflows/deploy-staging-v3.yml +99 -0
- package/.github/workflows/draft-new-release-v3.yml +103 -0
- package/.github/workflows/housekeeping.yaml +40 -0
- package/.github/workflows/publish-new-release-v3.yml +136 -0
- package/.github/workflows/rollback-v3.yml +190 -0
- package/.github/workflows/test-v3.yml +60 -0
- package/.husky/commit-msg +1 -0
- package/.husky/pre-commit +1 -0
- package/.jscpd.json +17 -0
- package/.nvmrc +1 -0
- package/.nxignore +3 -0
- package/.prettierignore +18 -0
- package/.prettierrc +13 -0
- package/.versionrc +8 -0
- package/CODEOWNERS +2 -0
- package/__mocks__/BraveBrowser.js +9 -0
- package/assets/integrations/AdobeAnalytics/adobe-analytics-js-heartbeat.js +193 -0
- package/assets/integrations/AdobeAnalytics/adobe-analytics-js.js +116 -0
- package/assets/rs-logo-full-light.jpg +0 -0
- package/babel.config.json +14 -0
- package/commitlint.config.js +27 -0
- package/examples/angular/sample-app/.editorconfig +16 -0
- package/examples/angular/sample-app/README.md +27 -0
- package/examples/angular/sample-app/angular.json +83 -0
- package/examples/angular/sample-app/package-lock.json +12552 -0
- package/examples/angular/sample-app/package.json +39 -0
- package/examples/angular/sample-app/src/app/app-routing.module.ts +10 -0
- package/examples/angular/sample-app/src/app/app.component.css +0 -0
- package/examples/angular/sample-app/src/app/app.component.html +508 -0
- package/examples/angular/sample-app/src/app/app.component.spec.ts +33 -0
- package/examples/angular/sample-app/src/app/app.component.ts +104 -0
- package/examples/angular/sample-app/src/app/app.module.ts +12 -0
- package/examples/angular/sample-app/src/assets/.gitkeep +0 -0
- package/examples/angular/sample-app/src/favicon.ico +0 -0
- package/examples/angular/sample-app/src/index.html +45 -0
- package/examples/angular/sample-app/src/main.ts +7 -0
- package/examples/angular/sample-app/src/styles.css +1 -0
- package/examples/angular/sample-app/tsconfig.app.json +10 -0
- package/examples/angular/sample-app/tsconfig.json +30 -0
- package/examples/angular/sample-app/tsconfig.spec.json +9 -0
- package/examples/chrome-extension/USAGE.md +140 -0
- package/examples/chrome-extension/background-script/LICENSE +21 -0
- package/examples/chrome-extension/background-script/README.md +105 -0
- package/examples/chrome-extension/background-script/foreground.js +7 -0
- package/examples/chrome-extension/background-script/logo/logo-128.png +0 -0
- package/examples/chrome-extension/background-script/logo/logo-16.png +0 -0
- package/examples/chrome-extension/background-script/logo/logo-48.png +0 -0
- package/examples/chrome-extension/background-script/logo/logo.svg +138 -0
- package/examples/chrome-extension/background-script/manifest.json +36 -0
- package/examples/chrome-extension/background-script/popup/popup.css +11 -0
- package/examples/chrome-extension/background-script/popup/popup.html +11 -0
- package/examples/chrome-extension/background-script/rudderAnalytics.js +5133 -0
- package/examples/chrome-extension/background-script/service-worker.js +28 -0
- package/examples/chrome-extension/background-script/settings/settings.css +8 -0
- package/examples/chrome-extension/background-script/settings/settings.html +12 -0
- package/examples/chrome-extension/background-script-websockets/LICENSE +21 -0
- package/examples/chrome-extension/background-script-websockets/README.md +101 -0
- package/examples/chrome-extension/background-script-websockets/foreground.js +7 -0
- package/examples/chrome-extension/background-script-websockets/logo/logo-128.png +0 -0
- package/examples/chrome-extension/background-script-websockets/logo/logo-16.png +0 -0
- package/examples/chrome-extension/background-script-websockets/logo/logo-48.png +0 -0
- package/examples/chrome-extension/background-script-websockets/logo/logo.svg +138 -0
- package/examples/chrome-extension/background-script-websockets/manifest.json +37 -0
- package/examples/chrome-extension/background-script-websockets/popup/popup.css +11 -0
- package/examples/chrome-extension/background-script-websockets/popup/popup.html +11 -0
- package/examples/chrome-extension/background-script-websockets/rudderAnalytics.js +5133 -0
- package/examples/chrome-extension/background-script-websockets/service-worker.js +60 -0
- package/examples/chrome-extension/background-script-websockets/settings/settings.css +8 -0
- package/examples/chrome-extension/background-script-websockets/settings/settings.html +12 -0
- package/examples/chrome-extension/content-script-v1.1/LICENSE +21 -0
- package/examples/chrome-extension/content-script-v1.1/README.md +105 -0
- package/examples/chrome-extension/content-script-v1.1/foreground.js +65 -0
- package/examples/chrome-extension/content-script-v1.1/logo/logo-128.png +0 -0
- package/examples/chrome-extension/content-script-v1.1/logo/logo-16.png +0 -0
- package/examples/chrome-extension/content-script-v1.1/logo/logo-48.png +0 -0
- package/examples/chrome-extension/content-script-v1.1/logo/logo.svg +138 -0
- package/examples/chrome-extension/content-script-v1.1/manifest.json +35 -0
- package/examples/chrome-extension/content-script-v1.1/popup/popup.css +11 -0
- package/examples/chrome-extension/content-script-v1.1/popup/popup.html +11 -0
- package/examples/chrome-extension/content-script-v1.1/service-worker-utils.js +17 -0
- package/examples/chrome-extension/content-script-v1.1/service-worker.js +12 -0
- package/examples/chrome-extension/content-script-v1.1/settings/settings.css +8 -0
- package/examples/chrome-extension/content-script-v1.1/settings/settings.html +12 -0
- package/examples/chrome-extension/content-script-v3/LICENSE +21 -0
- package/examples/chrome-extension/content-script-v3/README.md +105 -0
- package/examples/chrome-extension/content-script-v3/foreground.js +3875 -0
- package/examples/chrome-extension/content-script-v3/logo/logo-128.png +0 -0
- package/examples/chrome-extension/content-script-v3/logo/logo-16.png +0 -0
- package/examples/chrome-extension/content-script-v3/logo/logo-48.png +0 -0
- package/examples/chrome-extension/content-script-v3/logo/logo.svg +138 -0
- package/examples/chrome-extension/content-script-v3/manifest.json +35 -0
- package/examples/chrome-extension/content-script-v3/popup/popup.css +11 -0
- package/examples/chrome-extension/content-script-v3/popup/popup.html +11 -0
- package/examples/chrome-extension/content-script-v3/service-worker-utils.js +17 -0
- package/examples/chrome-extension/content-script-v3/service-worker.js +12 -0
- package/examples/chrome-extension/content-script-v3/settings/settings.css +8 -0
- package/examples/chrome-extension/content-script-v3/settings/settings.html +12 -0
- package/examples/chrome-extension/websocket-server/server.mjs +19 -0
- package/examples/gatsby/sample-gatsby-plugin-usage/README.md +49 -0
- package/examples/gatsby/sample-gatsby-plugin-usage/gatsby-config.ts +27 -0
- package/examples/gatsby/sample-gatsby-plugin-usage/package-lock.json +16070 -0
- package/examples/gatsby/sample-gatsby-plugin-usage/package.json +31 -0
- package/examples/gatsby/sample-gatsby-plugin-usage/src/images/icon.png +0 -0
- package/examples/gatsby/sample-gatsby-plugin-usage/src/pages/404.tsx +49 -0
- package/examples/gatsby/sample-gatsby-plugin-usage/src/pages/index.tsx +193 -0
- package/examples/gatsby/sample-gatsby-plugin-usage/tsconfig.json +105 -0
- package/examples/gatsby/sample-gatsby-site/README.md +49 -0
- package/examples/gatsby/sample-gatsby-site/gatsby-config.ts +15 -0
- package/examples/gatsby/sample-gatsby-site/package-lock.json +15916 -0
- package/examples/gatsby/sample-gatsby-site/package.json +37 -0
- package/examples/gatsby/sample-gatsby-site/src/images/icon.png +0 -0
- package/examples/gatsby/sample-gatsby-site/src/pages/404.tsx +49 -0
- package/examples/gatsby/sample-gatsby-site/src/pages/index.tsx +209 -0
- package/examples/gatsby/sample-gatsby-site/tsconfig.json +105 -0
- package/examples/html/autotrack-test.html +94 -0
- package/examples/html/ecomm_test.html +358 -0
- package/examples/html/script-test.html +968 -0
- package/examples/html/segment.html +177 -0
- package/examples/html/test_poster.jpg +0 -0
- package/examples/nextjs/hooks/sample-app/.eslintrc.json +3 -0
- package/examples/nextjs/hooks/sample-app/README.md +36 -0
- package/examples/nextjs/hooks/sample-app/next.config.js +4 -0
- package/examples/nextjs/hooks/sample-app/package-lock.json +4766 -0
- package/examples/nextjs/hooks/sample-app/package.json +28 -0
- package/examples/nextjs/hooks/sample-app/postcss.config.js +6 -0
- package/examples/nextjs/hooks/sample-app/public/next.svg +1 -0
- package/examples/nextjs/hooks/sample-app/public/vercel.svg +1 -0
- package/examples/nextjs/hooks/sample-app/src/app/favicon.ico +0 -0
- package/examples/nextjs/hooks/sample-app/src/app/globals.css +27 -0
- package/examples/nextjs/hooks/sample-app/src/app/layout.tsx +55 -0
- package/examples/nextjs/hooks/sample-app/src/app/page.tsx +137 -0
- package/examples/nextjs/hooks/sample-app/src/app/useRudderAnalytics.ts +29 -0
- package/examples/nextjs/hooks/sample-app/tailwind.config.ts +19 -0
- package/examples/nextjs/hooks/sample-app/tsconfig.json +27 -0
- package/examples/nextjs/js/sample-app/.eslintrc.json +3 -0
- package/examples/nextjs/js/sample-app/README.md +36 -0
- package/examples/nextjs/js/sample-app/jsconfig.json +7 -0
- package/examples/nextjs/js/sample-app/next.config.js +4 -0
- package/examples/nextjs/js/sample-app/package-lock.json +4710 -0
- package/examples/nextjs/js/sample-app/package.json +24 -0
- package/examples/nextjs/js/sample-app/postcss.config.js +6 -0
- package/examples/nextjs/js/sample-app/public/next.svg +1 -0
- package/examples/nextjs/js/sample-app/public/vercel.svg +1 -0
- package/examples/nextjs/js/sample-app/src/app/favicon.ico +0 -0
- package/examples/nextjs/js/sample-app/src/app/globals.css +27 -0
- package/examples/nextjs/js/sample-app/src/app/layout.js +54 -0
- package/examples/nextjs/js/sample-app/src/app/page.js +146 -0
- package/examples/nextjs/js/sample-app/tailwind.config.js +17 -0
- package/examples/nextjs/page-router/sample-app/.eslintrc.json +3 -0
- package/examples/nextjs/page-router/sample-app/README.md +40 -0
- package/examples/nextjs/page-router/sample-app/next.config.js +6 -0
- package/examples/nextjs/page-router/sample-app/package-lock.json +4270 -0
- package/examples/nextjs/page-router/sample-app/package.json +28 -0
- package/examples/nextjs/page-router/sample-app/postcss.config.js +6 -0
- package/examples/nextjs/page-router/sample-app/public/favicon.ico +0 -0
- package/examples/nextjs/page-router/sample-app/public/next.svg +1 -0
- package/examples/nextjs/page-router/sample-app/public/vercel.svg +1 -0
- package/examples/nextjs/page-router/sample-app/src/pages/_app.tsx +35 -0
- package/examples/nextjs/page-router/sample-app/src/pages/_document.tsx +49 -0
- package/examples/nextjs/page-router/sample-app/src/pages/api/hello.ts +10 -0
- package/examples/nextjs/page-router/sample-app/src/pages/index.tsx +138 -0
- package/examples/nextjs/page-router/sample-app/src/pages/page2.tsx +18 -0
- package/examples/nextjs/page-router/sample-app/src/styles/globals.css +27 -0
- package/examples/nextjs/page-router/sample-app/src/useRudderAnalytics.ts +29 -0
- package/examples/nextjs/page-router/sample-app/tailwind.config.ts +19 -0
- package/examples/nextjs/page-router/sample-app/tsconfig.json +22 -0
- package/examples/nextjs/ts/sample-app/.eslintrc.json +3 -0
- package/examples/nextjs/ts/sample-app/README.md +36 -0
- package/examples/nextjs/ts/sample-app/next.config.js +4 -0
- package/examples/nextjs/ts/sample-app/package-lock.json +4766 -0
- package/examples/nextjs/ts/sample-app/package.json +28 -0
- package/examples/nextjs/ts/sample-app/postcss.config.js +6 -0
- package/examples/nextjs/ts/sample-app/public/next.svg +1 -0
- package/examples/nextjs/ts/sample-app/public/vercel.svg +1 -0
- package/examples/nextjs/ts/sample-app/src/app/favicon.ico +0 -0
- package/examples/nextjs/ts/sample-app/src/app/globals.css +27 -0
- package/examples/nextjs/ts/sample-app/src/app/layout.tsx +55 -0
- package/examples/nextjs/ts/sample-app/src/app/page.tsx +147 -0
- package/examples/nextjs/ts/sample-app/tailwind.config.ts +19 -0
- package/examples/nextjs/ts/sample-app/tsconfig.json +27 -0
- package/examples/reactjs/hooks/sample-app/README.md +46 -0
- package/examples/reactjs/hooks/sample-app/package-lock.json +16203 -0
- package/examples/reactjs/hooks/sample-app/package.json +47 -0
- package/examples/reactjs/hooks/sample-app/public/favicon.ico +0 -0
- package/examples/reactjs/hooks/sample-app/public/index.html +75 -0
- package/examples/reactjs/hooks/sample-app/public/logo192.png +0 -0
- package/examples/reactjs/hooks/sample-app/public/logo512.png +0 -0
- package/examples/reactjs/hooks/sample-app/public/manifest.json +25 -0
- package/examples/reactjs/hooks/sample-app/public/robots.txt +3 -0
- package/examples/reactjs/hooks/sample-app/src/App.css +38 -0
- package/examples/reactjs/hooks/sample-app/src/App.test.tsx +9 -0
- package/examples/reactjs/hooks/sample-app/src/App.tsx +95 -0
- package/examples/reactjs/hooks/sample-app/src/index.css +32 -0
- package/examples/reactjs/hooks/sample-app/src/index.tsx +19 -0
- package/examples/reactjs/hooks/sample-app/src/logo.svg +1 -0
- package/examples/reactjs/hooks/sample-app/src/react-app-env.d.ts +1 -0
- package/examples/reactjs/hooks/sample-app/src/reportWebVitals.ts +15 -0
- package/examples/reactjs/hooks/sample-app/src/setupTests.ts +5 -0
- package/examples/reactjs/hooks/sample-app/src/useRudderAnalytics.ts +23 -0
- package/examples/reactjs/hooks/sample-app/tsconfig.json +20 -0
- package/examples/reactjs/js/sample-app/README.md +70 -0
- package/examples/reactjs/js/sample-app/package-lock.json +17665 -0
- package/examples/reactjs/js/sample-app/package.json +42 -0
- package/examples/reactjs/js/sample-app/public/favicon.ico +0 -0
- package/examples/reactjs/js/sample-app/public/index.html +75 -0
- package/examples/reactjs/js/sample-app/public/logo192.png +0 -0
- package/examples/reactjs/js/sample-app/public/logo512.png +0 -0
- package/examples/reactjs/js/sample-app/public/manifest.json +25 -0
- package/examples/reactjs/js/sample-app/public/robots.txt +3 -0
- package/examples/reactjs/js/sample-app/src/App.css +38 -0
- package/examples/reactjs/js/sample-app/src/App.js +101 -0
- package/examples/reactjs/js/sample-app/src/App.test.js +8 -0
- package/examples/reactjs/js/sample-app/src/index.css +34 -0
- package/examples/reactjs/js/sample-app/src/index.js +17 -0
- package/examples/reactjs/js/sample-app/src/logo.svg +1 -0
- package/examples/reactjs/js/sample-app/src/reportWebVitals.js +13 -0
- package/examples/reactjs/js/sample-app/src/setupTests.js +5 -0
- package/examples/reactjs/ts/sample-app/README.md +46 -0
- package/examples/reactjs/ts/sample-app/package-lock.json +17653 -0
- package/examples/reactjs/ts/sample-app/package.json +47 -0
- package/examples/reactjs/ts/sample-app/public/favicon.ico +0 -0
- package/examples/reactjs/ts/sample-app/public/index.html +75 -0
- package/examples/reactjs/ts/sample-app/public/logo192.png +0 -0
- package/examples/reactjs/ts/sample-app/public/logo512.png +0 -0
- package/examples/reactjs/ts/sample-app/public/manifest.json +25 -0
- package/examples/reactjs/ts/sample-app/public/robots.txt +3 -0
- package/examples/reactjs/ts/sample-app/src/App.css +38 -0
- package/examples/reactjs/ts/sample-app/src/App.test.tsx +9 -0
- package/examples/reactjs/ts/sample-app/src/App.tsx +101 -0
- package/examples/reactjs/ts/sample-app/src/index.css +34 -0
- package/examples/reactjs/ts/sample-app/src/index.tsx +19 -0
- package/examples/reactjs/ts/sample-app/src/logo.svg +1 -0
- package/examples/reactjs/ts/sample-app/src/react-app-env.d.ts +1 -0
- package/examples/reactjs/ts/sample-app/src/reportWebVitals.ts +15 -0
- package/examples/reactjs/ts/sample-app/src/setupTests.ts +5 -0
- package/examples/reactjs/ts/sample-app/tsconfig.json +20 -0
- package/examples/reactjs/vite/sample-app/.eslintrc.cjs +18 -0
- package/examples/reactjs/vite/sample-app/README.md +27 -0
- package/examples/reactjs/vite/sample-app/index.html +45 -0
- package/examples/reactjs/vite/sample-app/package-lock.json +3427 -0
- package/examples/reactjs/vite/sample-app/package.json +29 -0
- package/examples/reactjs/vite/sample-app/public/vite.svg +1 -0
- package/examples/reactjs/vite/sample-app/src/App.css +42 -0
- package/examples/reactjs/vite/sample-app/src/App.tsx +105 -0
- package/examples/reactjs/vite/sample-app/src/assets/react.svg +1 -0
- package/examples/reactjs/vite/sample-app/src/index.css +70 -0
- package/examples/reactjs/vite/sample-app/src/main.tsx +10 -0
- package/examples/reactjs/vite/sample-app/src/vite-env.d.ts +1 -0
- package/examples/reactjs/vite/sample-app/tsconfig.json +25 -0
- package/examples/reactjs/vite/sample-app/tsconfig.node.json +10 -0
- package/examples/reactjs/vite/sample-app/vite.config.ts +7 -0
- package/examples/serverless/USAGE.md +85 -0
- package/examples/serverless/cloudflare-worker/.editorconfig +13 -0
- package/examples/serverless/cloudflare-worker/.prettierrc +6 -0
- package/examples/serverless/cloudflare-worker/package-lock.json +2646 -0
- package/examples/serverless/cloudflare-worker/package.json +18 -0
- package/examples/serverless/cloudflare-worker/src/worker.js +54 -0
- package/examples/serverless/cloudflare-worker/wrangler.toml +52 -0
- package/examples/serverless/vercel-edge/.eslintrc.json +3 -0
- package/examples/serverless/vercel-edge/README.md +34 -0
- package/examples/serverless/vercel-edge/app/api/edge-function-example/route.ts +32 -0
- package/examples/serverless/vercel-edge/app/favicon.ico +0 -0
- package/examples/serverless/vercel-edge/app/globals.css +27 -0
- package/examples/serverless/vercel-edge/app/layout.tsx +22 -0
- package/examples/serverless/vercel-edge/app/page.tsx +113 -0
- package/examples/serverless/vercel-edge/next.config.js +4 -0
- package/examples/serverless/vercel-edge/package-lock.json +5351 -0
- package/examples/serverless/vercel-edge/package.json +26 -0
- package/examples/serverless/vercel-edge/postcss.config.js +6 -0
- package/examples/serverless/vercel-edge/public/next.svg +1 -0
- package/examples/serverless/vercel-edge/public/vercel.svg +1 -0
- package/examples/serverless/vercel-edge/tailwind.config.ts +19 -0
- package/examples/serverless/vercel-edge/tsconfig.json +27 -0
- package/examples/symfony/USAGE.md +57 -0
- package/examples/symfony/sample/.env.test +6 -0
- package/examples/symfony/sample/assets/app.js +15 -0
- package/examples/symfony/sample/assets/styles/app.css +3 -0
- package/examples/symfony/sample/compose.override.yaml +14 -0
- package/examples/symfony/sample/compose.yaml +21 -0
- package/examples/symfony/sample/composer.json +104 -0
- package/examples/symfony/sample/composer.lock +9921 -0
- package/examples/symfony/sample/config/bundles.php +15 -0
- package/examples/symfony/sample/config/packages/cache.yaml +19 -0
- package/examples/symfony/sample/config/packages/debug.yaml +5 -0
- package/examples/symfony/sample/config/packages/doctrine.yaml +43 -0
- package/examples/symfony/sample/config/packages/doctrine_migrations.yaml +6 -0
- package/examples/symfony/sample/config/packages/framework.yaml +24 -0
- package/examples/symfony/sample/config/packages/mailer.yaml +3 -0
- package/examples/symfony/sample/config/packages/messenger.yaml +24 -0
- package/examples/symfony/sample/config/packages/monolog.yaml +61 -0
- package/examples/symfony/sample/config/packages/notifier.yaml +12 -0
- package/examples/symfony/sample/config/packages/routing.yaml +12 -0
- package/examples/symfony/sample/config/packages/security.yaml +40 -0
- package/examples/symfony/sample/config/packages/translation.yaml +13 -0
- package/examples/symfony/sample/config/packages/twig.yaml +6 -0
- package/examples/symfony/sample/config/packages/validator.yaml +13 -0
- package/examples/symfony/sample/config/packages/web_profiler.yaml +15 -0
- package/examples/symfony/sample/config/packages/webpack_encore.yaml +45 -0
- package/examples/symfony/sample/config/preload.php +5 -0
- package/examples/symfony/sample/config/routes/framework.yaml +4 -0
- package/examples/symfony/sample/config/routes/web_profiler.yaml +8 -0
- package/examples/symfony/sample/config/routes.yaml +7 -0
- package/examples/symfony/sample/config/services.yaml +24 -0
- package/examples/symfony/sample/package-lock.json +8082 -0
- package/examples/symfony/sample/package.json +23 -0
- package/examples/symfony/sample/phpunit.xml.dist +38 -0
- package/examples/symfony/sample/public/index.php +9 -0
- package/examples/symfony/sample/src/Controller/LuckyController.php +18 -0
- package/examples/symfony/sample/src/Kernel.php +11 -0
- package/examples/symfony/sample/symfony.lock +277 -0
- package/examples/symfony/sample/templates/base.html.twig +19 -0
- package/examples/symfony/sample/templates/lucky/number.html.twig +20 -0
- package/examples/symfony/sample/tests/bootstrap.php +11 -0
- package/examples/symfony/sample/webpack.config.js +72 -0
- package/examples/v1/index.html +229 -0
- package/examples/v1.1/index.html +229 -0
- package/examples/v2-beacon/index.html +229 -0
- package/examples/v3/index.html +266 -0
- package/examples/v3-beacon/index.html +270 -0
- package/examples/v3-legacy/index.html +266 -0
- package/examples/v3-legacy-minimum-plugins/index.html +270 -0
- package/examples/v3-minimum-plugins/index.html +270 -0
- package/jest/jest.global-setup.js +3 -0
- package/jest/jest.polyfills.js +18 -0
- package/jest/jest.setup-dom.js +54 -0
- package/jest/jsdom-extended.js +26 -0
- package/jest.config.ts +5 -0
- package/jest.preset.js +83 -0
- package/migrations.json +34 -0
- package/nx.json +69 -0
- package/package.json +170 -0
- package/packages/analytics-js/.env.example +9 -0
- package/packages/analytics-js/.jscpd.json +17 -0
- package/packages/analytics-js/.size-limit.js +31 -0
- package/packages/analytics-js/CHANGELOG.md +283 -0
- package/packages/analytics-js/CHANGELOG_LATEST.md +2 -0
- package/packages/analytics-js/LICENSE +21 -0
- package/packages/analytics-js/README.md +100 -0
- package/packages/analytics-js/__fixtures__/fixtures.ts +765 -0
- package/packages/analytics-js/__fixtures__/msw.handlers.ts +82 -0
- package/packages/analytics-js/__fixtures__/msw.server.ts +6 -0
- package/packages/analytics-js/__mocks__/remotePlugins/BeaconQueue.ts +9 -0
- package/packages/analytics-js/__mocks__/remotePlugins/Bugsnag.ts +10 -0
- package/packages/analytics-js/__mocks__/remotePlugins/CustomConsentManager.ts +10 -0
- package/packages/analytics-js/__mocks__/remotePlugins/DeviceModeDestinations.ts +9 -0
- package/packages/analytics-js/__mocks__/remotePlugins/DeviceModeTransformation.ts +9 -0
- package/packages/analytics-js/__mocks__/remotePlugins/ErrorReporting.ts +10 -0
- package/packages/analytics-js/__mocks__/remotePlugins/ExternalAnonymousId.ts +10 -0
- package/packages/analytics-js/__mocks__/remotePlugins/GoogleLinker.ts +8 -0
- package/packages/analytics-js/__mocks__/remotePlugins/KetchConsentManager.ts +10 -0
- package/packages/analytics-js/__mocks__/remotePlugins/NativeDestinationQueue.ts +10 -0
- package/packages/analytics-js/__mocks__/remotePlugins/OneTrustConsentManager.ts +10 -0
- package/packages/analytics-js/__mocks__/remotePlugins/StorageEncryption.ts +9 -0
- package/packages/analytics-js/__mocks__/remotePlugins/StorageEncryptionLegacy.ts +9 -0
- package/packages/analytics-js/__mocks__/remotePlugins/StorageMigrator.ts +8 -0
- package/packages/analytics-js/__mocks__/remotePlugins/XhrQueue.ts +9 -0
- package/packages/analytics-js/__tests__/app/RudderAnalytics.test.ts +286 -0
- package/packages/analytics-js/__tests__/components/capabilitiesManager/detection/adBlockers.test.ts +78 -0
- package/packages/analytics-js/__tests__/components/capabilitiesManager/detection/browser.test.ts +24 -0
- package/packages/analytics-js/__tests__/components/capabilitiesManager/detection/clientHint.test.ts +87 -0
- package/packages/analytics-js/__tests__/components/capabilitiesManager/detection/dom.test.ts +13 -0
- package/packages/analytics-js/__tests__/components/capabilitiesManager/detection/screen.test.ts +13 -0
- package/packages/analytics-js/__tests__/components/capabilitiesManager/detection/storage.test.ts +27 -0
- package/packages/analytics-js/__tests__/components/configManager/ConfigManager.test.ts +222 -0
- package/packages/analytics-js/__tests__/components/configManager/cdnPaths.test.ts +70 -0
- package/packages/analytics-js/__tests__/components/configManager/commonUtil.test.ts +531 -0
- package/packages/analytics-js/__tests__/components/configManager/dataPlaneResolver.test.ts +163 -0
- package/packages/analytics-js/__tests__/components/configManager/validate.test.ts +31 -0
- package/packages/analytics-js/__tests__/components/core/Analytics.test.ts +628 -0
- package/packages/analytics-js/__tests__/components/eventManager/EventManager.test.ts +78 -0
- package/packages/analytics-js/__tests__/components/eventManager/RudderEventFactory.test.ts +514 -0
- package/packages/analytics-js/__tests__/components/eventManager/utilities.test.ts +1043 -0
- package/packages/analytics-js/__tests__/components/eventRepository/EventRepository.test.ts +324 -0
- package/packages/analytics-js/__tests__/components/pluginsManager/.gitkeep +0 -0
- package/packages/analytics-js/__tests__/components/preloadBuffer/index.test.ts +130 -0
- package/packages/analytics-js/__tests__/components/userSessionManager/UserSessionManager.test.ts +1386 -0
- package/packages/analytics-js/__tests__/components/userSessionManager/utils.test.ts +103 -0
- package/packages/analytics-js/__tests__/components/utilities/consent.test.ts +192 -0
- package/packages/analytics-js/__tests__/components/utilities/destinations.test.ts +201 -0
- package/packages/analytics-js/__tests__/components/utilities/event.test.ts +8 -0
- package/packages/analytics-js/__tests__/components/utilities/globals.test.ts +42 -0
- package/packages/analytics-js/__tests__/components/utilities/page.test.ts +235 -0
- package/packages/analytics-js/__tests__/components/utilities/sort.test.ts +17 -0
- package/packages/analytics-js/__tests__/components/utilities/statsCollection.test.ts +84 -0
- package/packages/analytics-js/__tests__/components/utilities/url.test.ts +51 -0
- package/packages/analytics-js/__tests__/services/ErrorHandler/ErrorHandler.test.ts +272 -0
- package/packages/analytics-js/__tests__/services/ErrorHandler/processError.test.ts +33 -0
- package/packages/analytics-js/__tests__/services/HttpClient/HttpClient.test.ts +255 -0
- package/packages/analytics-js/__tests__/services/Logger/Logger.test.ts +204 -0
- package/packages/analytics-js/__tests__/services/PluginEngine/PluginEngine.test.ts +206 -0
- package/packages/analytics-js/__tests__/services/StoreManager/Store.test.ts +152 -0
- package/packages/analytics-js/__tests__/services/StoreManager/StoreManager.test.ts +272 -0
- package/packages/analytics-js/__tests__/services/StoreManager/component-cookie/index.test.ts +65 -0
- package/packages/analytics-js/__tests__/services/StoreManager/storages/CookieStorage.test.ts +42 -0
- package/packages/analytics-js/__tests__/services/StoreManager/storages/InMemoryStorage.test.ts +26 -0
- package/packages/analytics-js/__tests__/services/StoreManager/storages/LocalStorage.test.ts +26 -0
- package/packages/analytics-js/__tests__/services/StoreManager/storages/sessionStorage.test.ts +26 -0
- package/packages/analytics-js/__tests__/services/StoreManager/top-domain/index.test.ts +60 -0
- package/packages/analytics-js/babel.config.json +15 -0
- package/packages/analytics-js/jest.config.mjs +14 -0
- package/packages/analytics-js/package.json +114 -0
- package/packages/analytics-js/project.json +138 -0
- package/packages/analytics-js/public/index-legacy-only.html +308 -0
- package/packages/analytics-js/public/index.html +324 -0
- package/packages/analytics-js/public/list_integration_sdks.html +408 -0
- package/packages/analytics-js/rollup.config.mjs +387 -0
- package/packages/analytics-js/src/app/IRudderStackGlobals.ts +21 -0
- package/packages/analytics-js/src/app/RudderAnalytics.ts +296 -0
- package/packages/analytics-js/src/browser.ts +55 -0
- package/packages/analytics-js/src/components/capabilitiesManager/CapabilitiesManager.ts +199 -0
- package/packages/analytics-js/src/components/capabilitiesManager/detection/adBlockers.ts +38 -0
- package/packages/analytics-js/src/components/capabilitiesManager/detection/browser.ts +24 -0
- package/packages/analytics-js/src/components/capabilitiesManager/detection/clientHint.ts +31 -0
- package/packages/analytics-js/src/components/capabilitiesManager/detection/dom.ts +54 -0
- package/packages/analytics-js/src/components/capabilitiesManager/detection/index.ts +6 -0
- package/packages/analytics-js/src/components/capabilitiesManager/detection/screen.ts +23 -0
- package/packages/analytics-js/src/components/capabilitiesManager/detection/storage.ts +77 -0
- package/packages/analytics-js/src/components/capabilitiesManager/index.ts +1 -0
- package/packages/analytics-js/src/components/capabilitiesManager/polyfill/index.ts +14 -0
- package/packages/analytics-js/src/components/capabilitiesManager/types.ts +14 -0
- package/packages/analytics-js/src/components/configManager/ConfigManager.ts +218 -0
- package/packages/analytics-js/src/components/configManager/constants.ts +21 -0
- package/packages/analytics-js/src/components/configManager/index.ts +1 -0
- package/packages/analytics-js/src/components/configManager/types.ts +90 -0
- package/packages/analytics-js/src/components/configManager/util/cdnPaths.ts +80 -0
- package/packages/analytics-js/src/components/configManager/util/commonUtil.ts +262 -0
- package/packages/analytics-js/src/components/configManager/util/dataPlaneResolver.ts +79 -0
- package/packages/analytics-js/src/components/configManager/util/validate.ts +46 -0
- package/packages/analytics-js/src/components/core/Analytics.ts +824 -0
- package/packages/analytics-js/src/components/core/IAnalytics.ts +218 -0
- package/packages/analytics-js/src/components/core/utilities.ts +12 -0
- package/packages/analytics-js/src/components/eventManager/EventManager.ts +80 -0
- package/packages/analytics-js/src/components/eventManager/RudderEventFactory.ts +171 -0
- package/packages/analytics-js/src/components/eventManager/constants.ts +29 -0
- package/packages/analytics-js/src/components/eventManager/index.ts +1 -0
- package/packages/analytics-js/src/components/eventManager/types.ts +7 -0
- package/packages/analytics-js/src/components/eventManager/utilities.ts +341 -0
- package/packages/analytics-js/src/components/eventRepository/EventRepository.ts +225 -0
- package/packages/analytics-js/src/components/eventRepository/constants.ts +9 -0
- package/packages/analytics-js/src/components/eventRepository/index.ts +1 -0
- package/packages/analytics-js/src/components/eventRepository/types.ts +10 -0
- package/packages/analytics-js/src/components/eventRepository/utils.ts +53 -0
- package/packages/analytics-js/src/components/pluginsManager/PluginsManager.ts +332 -0
- package/packages/analytics-js/src/components/pluginsManager/bundledBuildPluginImports.ts +39 -0
- package/packages/analytics-js/src/components/pluginsManager/defaultPluginsList.ts +24 -0
- package/packages/analytics-js/src/components/pluginsManager/federatedModulesBuildPluginImports.ts +68 -0
- package/packages/analytics-js/src/components/pluginsManager/index.ts +1 -0
- package/packages/analytics-js/src/components/pluginsManager/pluginNames.ts +29 -0
- package/packages/analytics-js/src/components/pluginsManager/pluginsInventory.ts +47 -0
- package/packages/analytics-js/src/components/pluginsManager/types.ts +4 -0
- package/packages/analytics-js/src/components/preloadBuffer/index.ts +187 -0
- package/packages/analytics-js/src/components/preloadBuffer/types.ts +5 -0
- package/packages/analytics-js/src/components/userSessionManager/UserSessionManager.ts +642 -0
- package/packages/analytics-js/src/components/userSessionManager/constants.ts +25 -0
- package/packages/analytics-js/src/components/userSessionManager/index.ts +1 -0
- package/packages/analytics-js/src/components/userSessionManager/types.ts +29 -0
- package/packages/analytics-js/src/components/userSessionManager/utils.ts +109 -0
- package/packages/analytics-js/src/components/utilities/consent.ts +163 -0
- package/packages/analytics-js/src/components/utilities/destinations.ts +31 -0
- package/packages/analytics-js/src/components/utilities/event.ts +3 -0
- package/packages/analytics-js/src/components/utilities/globals.ts +54 -0
- package/packages/analytics-js/src/components/utilities/loadOptions.ts +176 -0
- package/packages/analytics-js/src/components/utilities/number.ts +23 -0
- package/packages/analytics-js/src/components/utilities/page.ts +103 -0
- package/packages/analytics-js/src/components/utilities/sort.ts +15 -0
- package/packages/analytics-js/src/components/utilities/statsCollection.ts +16 -0
- package/packages/analytics-js/src/components/utilities/url.ts +90 -0
- package/packages/analytics-js/src/constants/app.ts +24 -0
- package/packages/analytics-js/src/constants/encryption.ts +6 -0
- package/packages/analytics-js/src/constants/errors.ts +4 -0
- package/packages/analytics-js/src/constants/logMessages.ts +282 -0
- package/packages/analytics-js/src/constants/queryParams.ts +13 -0
- package/packages/analytics-js/src/constants/storage.ts +40 -0
- package/packages/analytics-js/src/constants/timeouts.ts +15 -0
- package/packages/analytics-js/src/constants/urls.ts +21 -0
- package/packages/analytics-js/src/index.ts +40 -0
- package/packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts +204 -0
- package/packages/analytics-js/src/services/ErrorHandler/constant.ts +3 -0
- package/packages/analytics-js/src/services/ErrorHandler/index.ts +1 -0
- package/packages/analytics-js/src/services/ErrorHandler/processError.ts +61 -0
- package/packages/analytics-js/src/services/HttpClient/HttpClient.ts +112 -0
- package/packages/analytics-js/src/services/HttpClient/index.ts +7 -0
- package/packages/analytics-js/src/services/HttpClient/xhr/xhrRequestHandler.ts +140 -0
- package/packages/analytics-js/src/services/HttpClient/xhr/xhrResponseHandler.ts +25 -0
- package/packages/analytics-js/src/services/Logger/Logger.ts +123 -0
- package/packages/analytics-js/src/services/Logger/index.ts +1 -0
- package/packages/analytics-js/src/services/Logger/types.ts +6 -0
- package/packages/analytics-js/src/services/PluginEngine/PluginEngine.ts +200 -0
- package/packages/analytics-js/src/services/PluginEngine/README.md +152 -0
- package/packages/analytics-js/src/services/PluginEngine/index.ts +1 -0
- package/packages/analytics-js/src/services/StoreManager/Store.ts +218 -0
- package/packages/analytics-js/src/services/StoreManager/StoreManager.ts +231 -0
- package/packages/analytics-js/src/services/StoreManager/component-cookie/README.md +23 -0
- package/packages/analytics-js/src/services/StoreManager/component-cookie/index.ts +138 -0
- package/packages/analytics-js/src/services/StoreManager/index.ts +2 -0
- package/packages/analytics-js/src/services/StoreManager/storages/CookieStorage.ts +80 -0
- package/packages/analytics-js/src/services/StoreManager/storages/InMemoryStorage.ts +66 -0
- package/packages/analytics-js/src/services/StoreManager/storages/LocalStorage.ts +68 -0
- package/packages/analytics-js/src/services/StoreManager/storages/defaultOptions.ts +39 -0
- package/packages/analytics-js/src/services/StoreManager/storages/index.ts +18 -0
- package/packages/analytics-js/src/services/StoreManager/storages/sessionStorage.ts +64 -0
- package/packages/analytics-js/src/services/StoreManager/storages/storageEngine.ts +91 -0
- package/packages/analytics-js/src/services/StoreManager/top-domain/README.md +21 -0
- package/packages/analytics-js/src/services/StoreManager/top-domain/index.ts +83 -0
- package/packages/analytics-js/src/services/StoreManager/types.ts +32 -0
- package/packages/analytics-js/src/services/StoreManager/utils.ts +33 -0
- package/packages/analytics-js/src/state/index.ts +53 -0
- package/packages/analytics-js/src/state/slices/capabilities.ts +19 -0
- package/packages/analytics-js/src/state/slices/consents.ts +16 -0
- package/packages/analytics-js/src/state/slices/context.ts +36 -0
- package/packages/analytics-js/src/state/slices/eventBuffer.ts +9 -0
- package/packages/analytics-js/src/state/slices/lifecycle.ts +19 -0
- package/packages/analytics-js/src/state/slices/loadOptions.ts +44 -0
- package/packages/analytics-js/src/state/slices/metrics.ts +12 -0
- package/packages/analytics-js/src/state/slices/nativeDestinations.ts +15 -0
- package/packages/analytics-js/src/state/slices/plugins.ts +13 -0
- package/packages/analytics-js/src/state/slices/reporting.ts +11 -0
- package/packages/analytics-js/src/state/slices/session.ts +24 -0
- package/packages/analytics-js/src/state/slices/source.ts +6 -0
- package/packages/analytics-js/src/state/slices/storage.ts +13 -0
- package/packages/analytics-js/src/types/index.ts +1 -0
- package/packages/analytics-js/src/types/remote-plugins.d.ts +15 -0
- package/packages/analytics-js/src/types/rudderanalytics.d.ts +16 -0
- package/packages/analytics-js/tsconfig.json +14 -0
- package/packages/analytics-js/tsconfig.spec.json +26 -0
- package/packages/analytics-js-common/.jscpd.json +17 -0
- package/packages/analytics-js-common/.size-limit.js +11 -0
- package/packages/analytics-js-common/CHANGELOG.md +180 -0
- package/packages/analytics-js-common/CHANGELOG_LATEST.md +7 -0
- package/packages/analytics-js-common/LICENSE +21 -0
- package/packages/analytics-js-common/README.md +42 -0
- package/packages/analytics-js-common/__fixtures__/fixtures.ts +161 -0
- package/packages/analytics-js-common/__fixtures__/msw.handlers.ts +82 -0
- package/packages/analytics-js-common/__fixtures__/msw.server.ts +6 -0
- package/packages/analytics-js-common/__mocks__/.gitkeep +0 -0
- package/packages/analytics-js-common/__tests__/services/BufferQueue/BufferQueue.test.ts +55 -0
- package/packages/analytics-js-common/__tests__/services/ExternalSrcLoader/ExternalSrcLoader.test.ts +170 -0
- package/packages/analytics-js-common/__tests__/utilities/checks.test.ts +95 -0
- package/packages/analytics-js-common/__tests__/utilities/destinations.test.ts +44 -0
- package/packages/analytics-js-common/__tests__/utilities/detect.test.ts +22 -0
- package/packages/analytics-js-common/__tests__/utilities/eventMethodOverloads.test.ts +260 -0
- package/packages/analytics-js-common/__tests__/utilities/json.test.ts +155 -0
- package/packages/analytics-js-common/__tests__/utilities/object.test.ts +287 -0
- package/packages/analytics-js-common/__tests__/utilities/string.test.ts +104 -0
- package/packages/analytics-js-common/__tests__/utilities/timezone.test.ts +9 -0
- package/packages/analytics-js-common/__tests__/utilities/uuid.test.ts +35 -0
- package/packages/analytics-js-common/__tests__/v1.1/utils/ObjectUtils.test.js +113 -0
- package/packages/analytics-js-common/__tests__/v1.1/utils/errorHandler.test.js +60 -0
- package/packages/analytics-js-common/babel.config.json +14 -0
- package/packages/analytics-js-common/jest.config.mjs +14 -0
- package/packages/analytics-js-common/package.json +92 -0
- package/packages/analytics-js-common/project.json +107 -0
- package/packages/analytics-js-common/src/constants/QueueStatuses.ts +10 -0
- package/packages/analytics-js-common/src/constants/consent.ts +6 -0
- package/packages/analytics-js-common/src/constants/destDisplayNamesToFileNamesMap.ts +243 -0
- package/packages/analytics-js-common/src/constants/destinationNames.ts +312 -0
- package/packages/analytics-js-common/src/constants/htmlAttributes.ts +3 -0
- package/packages/analytics-js-common/src/constants/index.ts +11 -0
- package/packages/analytics-js-common/src/constants/integrations/ActiveCampaign/constants.js +18 -0
- package/packages/analytics-js-common/src/constants/integrations/AdobeAnalytics/constants.ts +18 -0
- package/packages/analytics-js-common/src/constants/integrations/Adroll/constants.ts +14 -0
- package/packages/analytics-js-common/src/constants/integrations/Amplitude/constants.ts +13 -0
- package/packages/analytics-js-common/src/constants/integrations/Appcues/constants.ts +13 -0
- package/packages/analytics-js-common/src/constants/integrations/Axeptio/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/BingAds/constants.ts +16 -0
- package/packages/analytics-js-common/src/constants/integrations/Braze/constants.ts +22 -0
- package/packages/analytics-js-common/src/constants/integrations/Bugsnag/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Chartbeat/constants.ts +14 -0
- package/packages/analytics-js-common/src/constants/integrations/Clevertap/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/CommandBar/constants.ts +21 -0
- package/packages/analytics-js-common/src/constants/integrations/CommonIntegrationsConstant/constants.ts +194 -0
- package/packages/analytics-js-common/src/constants/integrations/Comscore/constants.ts +15 -0
- package/packages/analytics-js-common/src/constants/integrations/ConvertFlow/constants.ts +19 -0
- package/packages/analytics-js-common/src/constants/integrations/Criteo/constants.ts +22 -0
- package/packages/analytics-js-common/src/constants/integrations/CustomerIO/constants.ts +14 -0
- package/packages/analytics-js-common/src/constants/integrations/DCMFloodlight/constants.ts +19 -0
- package/packages/analytics-js-common/src/constants/integrations/Drip/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Engage/constants.ts +27 -0
- package/packages/analytics-js-common/src/constants/integrations/FacebookPixel/constants.ts +89 -0
- package/packages/analytics-js-common/src/constants/integrations/Fullstory/constants.ts +17 -0
- package/packages/analytics-js-common/src/constants/integrations/GA/constants.ts +14 -0
- package/packages/analytics-js-common/src/constants/integrations/GA360/constants.ts +18 -0
- package/packages/analytics-js-common/src/constants/integrations/GA4/constants.ts +19 -0
- package/packages/analytics-js-common/src/constants/integrations/GoogleAds/constants.ts +15 -0
- package/packages/analytics-js-common/src/constants/integrations/GoogleOptimize/constants.ts +17 -0
- package/packages/analytics-js-common/src/constants/integrations/GoogleTagManager/constants.ts +14 -0
- package/packages/analytics-js-common/src/constants/integrations/Heap/constants.ts +13 -0
- package/packages/analytics-js-common/src/constants/integrations/Hotjar/constants.ts +14 -0
- package/packages/analytics-js-common/src/constants/integrations/HubSpot/constants.ts +15 -0
- package/packages/analytics-js-common/src/constants/integrations/INTERCOM/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Iterable/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/June/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Keen/constants.ts +14 -0
- package/packages/analytics-js-common/src/constants/integrations/Kissmetrics/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Klaviyo/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/LaunchDarkly/constants.ts +15 -0
- package/packages/analytics-js-common/src/constants/integrations/Lemnisk/constants.ts +17 -0
- package/packages/analytics-js-common/src/constants/integrations/LinkedInInsightTag/constants.ts +20 -0
- package/packages/analytics-js-common/src/constants/integrations/LiveChat/constants.ts +16 -0
- package/packages/analytics-js-common/src/constants/integrations/Lotame/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Lytics/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Matomo/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/MicrosoftClarity/constants.ts +18 -0
- package/packages/analytics-js-common/src/constants/integrations/Mixpanel/constants.ts +15 -0
- package/packages/analytics-js-common/src/constants/integrations/MoEngage/constants.ts +16 -0
- package/packages/analytics-js-common/src/constants/integrations/Mouseflow/constants.ts +18 -0
- package/packages/analytics-js-common/src/constants/integrations/Ninetailed/constants.ts +13 -0
- package/packages/analytics-js-common/src/constants/integrations/Olark/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Optimizely/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Pendo/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/PinterestTag/constants.ts +23 -0
- package/packages/analytics-js-common/src/constants/integrations/Podsights/constants.ts +24 -0
- package/packages/analytics-js-common/src/constants/integrations/PostAffiliatePro/constants.ts +17 -0
- package/packages/analytics-js-common/src/constants/integrations/Posthog/constants.ts +16 -0
- package/packages/analytics-js-common/src/constants/integrations/ProfitWell/constants.ts +16 -0
- package/packages/analytics-js-common/src/constants/integrations/Qualaroo/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Qualtrics/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/QuantumMetric/constants.ts +17 -0
- package/packages/analytics-js-common/src/constants/integrations/QuoraPixel/constants.ts +19 -0
- package/packages/analytics-js-common/src/constants/integrations/RedditPixel/constants.ts +17 -0
- package/packages/analytics-js-common/src/constants/integrations/Refiner/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Rockerbox/constants.ts +16 -0
- package/packages/analytics-js-common/src/constants/integrations/RollBar/constants.ts +17 -0
- package/packages/analytics-js-common/src/constants/integrations/Satismeter/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Sendinblue/constants.ts +37 -0
- package/packages/analytics-js-common/src/constants/integrations/Sentry/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Shynet/constants.ts +18 -0
- package/packages/analytics-js-common/src/constants/integrations/SnapEngage/constants.ts +16 -0
- package/packages/analytics-js-common/src/constants/integrations/SnapPixel/constants.ts +17 -0
- package/packages/analytics-js-common/src/constants/integrations/SpotifyPixel/constants.ts +20 -0
- package/packages/analytics-js-common/src/constants/integrations/Sprig/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/TVSquared/constants.ts +18 -0
- package/packages/analytics-js-common/src/constants/integrations/TiktokAds/constants.ts +97 -0
- package/packages/analytics-js-common/src/constants/integrations/VWO/constants.ts +17 -0
- package/packages/analytics-js-common/src/constants/integrations/Vero/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/Woopra/constants.ts +12 -0
- package/packages/analytics-js-common/src/constants/integrations/YandexMetrica/constants.ts +14 -0
- package/packages/analytics-js-common/src/constants/integrationsConfig.ts +5 -0
- package/packages/analytics-js-common/src/constants/logMessages.ts +24 -0
- package/packages/analytics-js-common/src/constants/loggerContexts.ts +33 -0
- package/packages/analytics-js-common/src/constants/storages.ts +9 -0
- package/packages/analytics-js-common/src/constants/timeouts.ts +3 -0
- package/packages/analytics-js-common/src/constants/urls.ts +4 -0
- package/packages/analytics-js-common/src/index.ts +4 -0
- package/packages/analytics-js-common/src/services/BufferQueue/BufferQueue.ts +37 -0
- package/packages/analytics-js-common/src/services/ExternalSrcLoader/ExternalSrcLoader.ts +63 -0
- package/packages/analytics-js-common/src/services/ExternalSrcLoader/index.ts +1 -0
- package/packages/analytics-js-common/src/services/ExternalSrcLoader/jsFileLoader.ts +124 -0
- package/packages/analytics-js-common/src/services/ExternalSrcLoader/types.ts +26 -0
- package/packages/analytics-js-common/src/types/ApiObject.ts +14 -0
- package/packages/analytics-js-common/src/types/ApplicationLifecycle.ts +12 -0
- package/packages/analytics-js-common/src/types/ApplicationState.ts +172 -0
- package/packages/analytics-js-common/src/types/Consent.ts +47 -0
- package/packages/analytics-js-common/src/types/DataResidency.ts +9 -0
- package/packages/analytics-js-common/src/types/Destination.ts +85 -0
- package/packages/analytics-js-common/src/types/ErrorHandler.ts +39 -0
- package/packages/analytics-js-common/src/types/Event.ts +54 -0
- package/packages/analytics-js-common/src/types/EventApi.ts +45 -0
- package/packages/analytics-js-common/src/types/EventContext.ts +26 -0
- package/packages/analytics-js-common/src/types/HttpClient.ts +63 -0
- package/packages/analytics-js-common/src/types/IRudderAnalytics.ts +204 -0
- package/packages/analytics-js-common/src/types/Integration.ts +18 -0
- package/packages/analytics-js-common/src/types/LoadOptions.ts +159 -0
- package/packages/analytics-js-common/src/types/Logger.ts +19 -0
- package/packages/analytics-js-common/src/types/Nullable.ts +1 -0
- package/packages/analytics-js-common/src/types/PluginEngine.ts +41 -0
- package/packages/analytics-js-common/src/types/PluginsManager.ts +29 -0
- package/packages/analytics-js-common/src/types/Session.ts +8 -0
- package/packages/analytics-js-common/src/types/Source.ts +21 -0
- package/packages/analytics-js-common/src/types/Storage.ts +49 -0
- package/packages/analytics-js-common/src/types/Store.ts +82 -0
- package/packages/analytics-js-common/src/types/UserSessionStorage.ts +10 -0
- package/packages/analytics-js-common/src/types/traits.ts +91 -0
- package/packages/analytics-js-common/src/utilities/checks.ts +77 -0
- package/packages/analytics-js-common/src/utilities/crypto.ts +6 -0
- package/packages/analytics-js-common/src/utilities/destinations.ts +31 -0
- package/packages/analytics-js-common/src/utilities/detect.ts +8 -0
- package/packages/analytics-js-common/src/utilities/errors.ts +20 -0
- package/packages/analytics-js-common/src/utilities/eventMethodOverloads.ts +407 -0
- package/packages/analytics-js-common/src/utilities/http.ts +13 -0
- package/packages/analytics-js-common/src/utilities/index.ts +14 -0
- package/packages/analytics-js-common/src/utilities/json.ts +69 -0
- package/packages/analytics-js-common/src/utilities/object.ts +119 -0
- package/packages/analytics-js-common/src/utilities/string.ts +64 -0
- package/packages/analytics-js-common/src/utilities/timestamp.ts +10 -0
- package/packages/analytics-js-common/src/utilities/timezone.ts +11 -0
- package/packages/analytics-js-common/src/utilities/url.ts +3 -0
- package/packages/analytics-js-common/src/utilities/uuId.ts +13 -0
- package/packages/analytics-js-common/src/v1.1/utils/ObjectUtils.js +54 -0
- package/packages/analytics-js-common/src/v1.1/utils/ScriptLoader.js +51 -0
- package/packages/analytics-js-common/src/v1.1/utils/client_server_name.js +82 -0
- package/packages/analytics-js-common/src/v1.1/utils/config_to_integration_names.js +83 -0
- package/packages/analytics-js-common/src/v1.1/utils/constants.js +15 -0
- package/packages/analytics-js-common/src/v1.1/utils/errorHandler.js +88 -0
- package/packages/analytics-js-common/src/v1.1/utils/index.ts +10 -0
- package/packages/analytics-js-common/src/v1.1/utils/integration_cname.js +164 -0
- package/packages/analytics-js-common/src/v1.1/utils/logUtil.js +51 -0
- package/packages/analytics-js-common/src/v1.1/utils/notifyError.js +16 -0
- package/packages/analytics-js-common/src/v1.1/utils/storage/cookie.js +98 -0
- package/packages/analytics-js-common/src/v1.1/utils/storage/index.js +5 -0
- package/packages/analytics-js-common/src/v1.1/utils/storage/storage.js +384 -0
- package/packages/analytics-js-common/src/v1.1/utils/storage/store.js +79 -0
- package/packages/analytics-js-common/src/v1.1/utils/storage/v3DecryptionUtils.js +19 -0
- package/packages/analytics-js-common/tsconfig.json +14 -0
- package/packages/analytics-js-common/tsconfig.spec.json +23 -0
- package/packages/analytics-js-common/types/rudderanalytics.d.ts +16 -0
- package/packages/analytics-js-integrations/.jscpd.json +17 -0
- package/packages/analytics-js-integrations/.size-limit.js +11 -0
- package/packages/analytics-js-integrations/CHANGELOG.md +241 -0
- package/packages/analytics-js-integrations/CHANGELOG_LATEST.md +12 -0
- package/packages/analytics-js-integrations/LICENSE +21 -0
- package/packages/analytics-js-integrations/README.md +35 -0
- package/packages/analytics-js-integrations/__fixtures__/.gitkeep +0 -0
- package/packages/analytics-js-integrations/__mocks__/.gitkeep +0 -0
- package/packages/analytics-js-integrations/__tests__/common/common.test.js +49 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Amplitude/browser.test.js +926 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Amplitude/util.test.js +190 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Appcues/appcues.test.js +163 -0
- package/packages/analytics-js-integrations/__tests__/integrations/BingAds/__fixtures__/data.js +17 -0
- package/packages/analytics-js-integrations/__tests__/integrations/BingAds/browser.test.js +166 -0
- package/packages/analytics-js-integrations/__tests__/integrations/BingAds/utils.test.js +138 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Braze/browser.test.js +1077 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Clevertap/browser.test.js +43 -0
- package/packages/analytics-js-integrations/__tests__/integrations/CommandBar/browser.test.js +115 -0
- package/packages/analytics-js-integrations/__tests__/integrations/FacebookPixel/browser.test.js +410 -0
- package/packages/analytics-js-integrations/__tests__/integrations/FacebookPixel/utils.test.js +775 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Fullstory/browser.test.js +173 -0
- package/packages/analytics-js-integrations/__tests__/integrations/GA/browser.test.js +179 -0
- package/packages/analytics-js-integrations/__tests__/integrations/GA4/__mocks__/data.js +1563 -0
- package/packages/analytics-js-integrations/__tests__/integrations/GA4/browser.test.js +212 -0
- package/packages/analytics-js-integrations/__tests__/integrations/GA4/utils.test.js +380 -0
- package/packages/analytics-js-integrations/__tests__/integrations/GoogleAds/__fixtures__/data.js +256 -0
- package/packages/analytics-js-integrations/__tests__/integrations/GoogleAds/browser.test.js +372 -0
- package/packages/analytics-js-integrations/__tests__/integrations/GoogleAds/utils.test.js +121 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Hotjar/browser.test.js +108 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Intercom/browser.test.js +135 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Intercom/util.test.js +69 -0
- package/packages/analytics-js-integrations/__tests__/integrations/LaunchDarkly/__fixtures__/data.js +61 -0
- package/packages/analytics-js-integrations/__tests__/integrations/LaunchDarkly/browser.test.js +151 -0
- package/packages/analytics-js-integrations/__tests__/integrations/LaunchDarkly/utils.test.js +36 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Lemnisk/browser.test.js +172 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Matomo/browser.test.js +208 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Mixpanel/browser.test.js +117 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Mixpanel/util.test.js +504 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Ninetailed/browser.test.js +148 -0
- package/packages/analytics-js-integrations/__tests__/integrations/PinterestTag/__fixtures__/data.js +24 -0
- package/packages/analytics-js-integrations/__tests__/integrations/PinterestTag/utils.test.js +19 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Podsights/utils.test.js +394 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Posthog/browser.test.js +420 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Posthog/utils.test.js +111 -0
- package/packages/analytics-js-integrations/__tests__/integrations/SpotifyPixel/browser.test.js +630 -0
- package/packages/analytics-js-integrations/__tests__/integrations/Sprig/browser.test.js +85 -0
- package/packages/analytics-js-integrations/__tests__/integrations/TikTokAds/browser.test.js +421 -0
- package/packages/analytics-js-integrations/__tests__/integrations/VWO/browser.test.js +143 -0
- package/packages/analytics-js-integrations/__tests__/integrations/VWO/utils.test.js +36 -0
- package/packages/analytics-js-integrations/__tests__/utils/camelcase.test.js +29 -0
- package/packages/analytics-js-integrations/__tests__/utils/commonUtils.test.js +347 -0
- package/packages/analytics-js-integrations/__tests__/utils/utils.test.js +337 -0
- package/packages/analytics-js-integrations/babel.config.json +14 -0
- package/packages/analytics-js-integrations/jest.config.mjs +21 -0
- package/packages/analytics-js-integrations/package.json +143 -0
- package/packages/analytics-js-integrations/project.json +106 -0
- package/packages/analytics-js-integrations/public/list_integration_sdks.html +408 -0
- package/packages/analytics-js-integrations/rollup.config.mjs +151 -0
- package/packages/analytics-js-integrations/scripts/integrationBuildScript.js +79 -0
- package/packages/analytics-js-integrations/src/integrations/ActiveCampaign/browser.js +53 -0
- package/packages/analytics-js-integrations/src/integrations/ActiveCampaign/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/ActiveCampaign/nativeSdkLoader.js +24 -0
- package/packages/analytics-js-integrations/src/integrations/AdobeAnalytics/browser.js +279 -0
- package/packages/analytics-js-integrations/src/integrations/AdobeAnalytics/eCommHandle.js +56 -0
- package/packages/analytics-js-integrations/src/integrations/AdobeAnalytics/heartbeatHandle.js +268 -0
- package/packages/analytics-js-integrations/src/integrations/AdobeAnalytics/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/AdobeAnalytics/util.js +681 -0
- package/packages/analytics-js-integrations/src/integrations/Adroll/browser.js +123 -0
- package/packages/analytics-js-integrations/src/integrations/Adroll/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Adroll/util.js +48 -0
- package/packages/analytics-js-integrations/src/integrations/Amplitude/browser.js +374 -0
- package/packages/analytics-js-integrations/src/integrations/Amplitude/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Amplitude/nativeSdkLoader.js +114 -0
- package/packages/analytics-js-integrations/src/integrations/Amplitude/test/test_amplitude.html +157 -0
- package/packages/analytics-js-integrations/src/integrations/Amplitude/utils.js +67 -0
- package/packages/analytics-js-integrations/src/integrations/Appcues/browser.js +89 -0
- package/packages/analytics-js-integrations/src/integrations/Appcues/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Axeptio/browser.js +61 -0
- package/packages/analytics-js-integrations/src/integrations/Axeptio/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Axeptio/nativeSdkLoader.js +14 -0
- package/packages/analytics-js-integrations/src/integrations/Axeptio/utils.js +16 -0
- package/packages/analytics-js-integrations/src/integrations/BingAds/browser.js +81 -0
- package/packages/analytics-js-integrations/src/integrations/BingAds/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/BingAds/nativeSdkLoader.js +30 -0
- package/packages/analytics-js-integrations/src/integrations/BingAds/utils.js +100 -0
- package/packages/analytics-js-integrations/src/integrations/Braze/browser.js +297 -0
- package/packages/analytics-js-integrations/src/integrations/Braze/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Braze/nativeSdkLoader.js +35 -0
- package/packages/analytics-js-integrations/src/integrations/Braze/utils.js +51 -0
- package/packages/analytics-js-integrations/src/integrations/Bugsnag/browser.js +62 -0
- package/packages/analytics-js-integrations/src/integrations/Bugsnag/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Chartbeat/browser.js +143 -0
- package/packages/analytics-js-integrations/src/integrations/Chartbeat/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Chartbeat/nativeSdkLoader.js +7 -0
- package/packages/analytics-js-integrations/src/integrations/Clevertap/browser.js +202 -0
- package/packages/analytics-js-integrations/src/integrations/Clevertap/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Clevertap/utils.js +17 -0
- package/packages/analytics-js-integrations/src/integrations/CommandBar/browser.js +78 -0
- package/packages/analytics-js-integrations/src/integrations/CommandBar/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/CommandBar/nativeSdkLoader.js +85 -0
- package/packages/analytics-js-integrations/src/integrations/Comscore/browser.js +126 -0
- package/packages/analytics-js-integrations/src/integrations/Comscore/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Comscore/nativeSdkLoader.js +10 -0
- package/packages/analytics-js-integrations/src/integrations/ConvertFlow/browser.js +60 -0
- package/packages/analytics-js-integrations/src/integrations/ConvertFlow/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/ConvertFlow/utils.js +107 -0
- package/packages/analytics-js-integrations/src/integrations/Criteo/browser.js +144 -0
- package/packages/analytics-js-integrations/src/integrations/Criteo/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Criteo/utils.js +346 -0
- package/packages/analytics-js-integrations/src/integrations/CustomerIO/browser.js +85 -0
- package/packages/analytics-js-integrations/src/integrations/CustomerIO/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/CustomerIO/nativeSdkLoader.js +33 -0
- package/packages/analytics-js-integrations/src/integrations/DCMFloodlight/browser.js +228 -0
- package/packages/analytics-js-integrations/src/integrations/DCMFloodlight/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/DCMFloodlight/utils.js +353 -0
- package/packages/analytics-js-integrations/src/integrations/Drip/browser.js +165 -0
- package/packages/analytics-js-integrations/src/integrations/Drip/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Drip/nativeSdkLoader.js +10 -0
- package/packages/analytics-js-integrations/src/integrations/Drip/utils.js +29 -0
- package/packages/analytics-js-integrations/src/integrations/Engage/browser.js +119 -0
- package/packages/analytics-js-integrations/src/integrations/Engage/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Engage/nativeSdkLoader.js +25 -0
- package/packages/analytics-js-integrations/src/integrations/Engage/utils.js +69 -0
- package/packages/analytics-js-integrations/src/integrations/FacebookPixel/browser.js +326 -0
- package/packages/analytics-js-integrations/src/integrations/FacebookPixel/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/FacebookPixel/utils.js +332 -0
- package/packages/analytics-js-integrations/src/integrations/Fullstory/browser.js +175 -0
- package/packages/analytics-js-integrations/src/integrations/Fullstory/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Fullstory/nativeSdkLoader.js +69 -0
- package/packages/analytics-js-integrations/src/integrations/Fullstory/utils.js +17 -0
- package/packages/analytics-js-integrations/src/integrations/GA/browser.js +817 -0
- package/packages/analytics-js-integrations/src/integrations/GA/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/GA360/browser.js +58 -0
- package/packages/analytics-js-integrations/src/integrations/GA360/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/GA4/browser.js +264 -0
- package/packages/analytics-js-integrations/src/integrations/GA4/config.js +296 -0
- package/packages/analytics-js-integrations/src/integrations/GA4/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/GA4/utils.js +374 -0
- package/packages/analytics-js-integrations/src/integrations/GoogleAds/browser.js +219 -0
- package/packages/analytics-js-integrations/src/integrations/GoogleAds/browser.test.js +16 -0
- package/packages/analytics-js-integrations/src/integrations/GoogleAds/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/GoogleAds/nativeSdkLoader.js +28 -0
- package/packages/analytics-js-integrations/src/integrations/GoogleAds/utils.js +135 -0
- package/packages/analytics-js-integrations/src/integrations/GoogleOptimize/browser.js +81 -0
- package/packages/analytics-js-integrations/src/integrations/GoogleOptimize/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/GoogleTagManager/browser.js +96 -0
- package/packages/analytics-js-integrations/src/integrations/GoogleTagManager/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/GoogleTagManager/nativeSdkLoader.js +21 -0
- package/packages/analytics-js-integrations/src/integrations/Heap/browser.js +64 -0
- package/packages/analytics-js-integrations/src/integrations/Heap/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Heap/nativeSdkLoader.js +40 -0
- package/packages/analytics-js-integrations/src/integrations/Heap/util.js +23 -0
- package/packages/analytics-js-integrations/src/integrations/Hotjar/browser.js +79 -0
- package/packages/analytics-js-integrations/src/integrations/Hotjar/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Hotjar/nativeSdkLoader.js +21 -0
- package/packages/analytics-js-integrations/src/integrations/HubSpot/browser.js +91 -0
- package/packages/analytics-js-integrations/src/integrations/HubSpot/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/INTERCOM/browser.js +112 -0
- package/packages/analytics-js-integrations/src/integrations/INTERCOM/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/INTERCOM/nativeSdkLoader.js +46 -0
- package/packages/analytics-js-integrations/src/integrations/INTERCOM/utils.js +68 -0
- package/packages/analytics-js-integrations/src/integrations/Iterable/browser.js +179 -0
- package/packages/analytics-js-integrations/src/integrations/Iterable/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Iterable/utils.js +127 -0
- package/packages/analytics-js-integrations/src/integrations/June/browser.js +96 -0
- package/packages/analytics-js-integrations/src/integrations/June/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Keen/browser.js +150 -0
- package/packages/analytics-js-integrations/src/integrations/Keen/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Kissmetrics/browser.js +245 -0
- package/packages/analytics-js-integrations/src/integrations/Kissmetrics/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Kissmetrics/nativeSdkLoader.js +23 -0
- package/packages/analytics-js-integrations/src/integrations/Klaviyo/browser.js +197 -0
- package/packages/analytics-js-integrations/src/integrations/Klaviyo/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Klaviyo/util.js +91 -0
- package/packages/analytics-js-integrations/src/integrations/LaunchDarkly/browser.js +75 -0
- package/packages/analytics-js-integrations/src/integrations/LaunchDarkly/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/LaunchDarkly/utils.js +40 -0
- package/packages/analytics-js-integrations/src/integrations/Lemnisk/browser.js +81 -0
- package/packages/analytics-js-integrations/src/integrations/Lemnisk/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Lemnisk/nativeSdkLoader.js +34 -0
- package/packages/analytics-js-integrations/src/integrations/LinkedInInsightTag/browser.js +79 -0
- package/packages/analytics-js-integrations/src/integrations/LinkedInInsightTag/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/LiveChat/browser.js +81 -0
- package/packages/analytics-js-integrations/src/integrations/LiveChat/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/LiveChat/nativeSdkLoader.js +40 -0
- package/packages/analytics-js-integrations/src/integrations/LiveChat/util.js +71 -0
- package/packages/analytics-js-integrations/src/integrations/Lotame/LotameStorage.js +21 -0
- package/packages/analytics-js-integrations/src/integrations/Lotame/browser.js +152 -0
- package/packages/analytics-js-integrations/src/integrations/Lotame/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Lytics/browser.js +103 -0
- package/packages/analytics-js-integrations/src/integrations/Lytics/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Lytics/nativeSdkLoader.js +77 -0
- package/packages/analytics-js-integrations/src/integrations/Lytics/test/script-test-lytics.html +250 -0
- package/packages/analytics-js-integrations/src/integrations/Matomo/browser.js +184 -0
- package/packages/analytics-js-integrations/src/integrations/Matomo/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Matomo/nativeSdkLoader.js +20 -0
- package/packages/analytics-js-integrations/src/integrations/Matomo/util.js +433 -0
- package/packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js +69 -0
- package/packages/analytics-js-integrations/src/integrations/MicrosoftClarity/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/MicrosoftClarity/nativeSdkLoader.js +22 -0
- package/packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js +353 -0
- package/packages/analytics-js-integrations/src/integrations/Mixpanel/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Mixpanel/nativeSdkLoader.js +71 -0
- package/packages/analytics-js-integrations/src/integrations/Mixpanel/util.js +288 -0
- package/packages/analytics-js-integrations/src/integrations/MoEngage/browser.js +131 -0
- package/packages/analytics-js-integrations/src/integrations/MoEngage/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/MoEngage/nativeSdkLoader.js +65 -0
- package/packages/analytics-js-integrations/src/integrations/MoEngage/test/script-test-moengage.html +216 -0
- package/packages/analytics-js-integrations/src/integrations/Mouseflow/browser.js +97 -0
- package/packages/analytics-js-integrations/src/integrations/Mouseflow/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Mouseflow/utils.js +41 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/browser.js +65 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/README.md +70 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/package-lock.json +17843 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/package.json +43 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/public/favicon.ico +0 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/public/index.html +75 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/public/logo192.png +0 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/public/logo512.png +0 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/public/manifest.json +25 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/public/robots.txt +3 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/src/App.css +38 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/src/App.js +108 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/src/index.css +34 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/src/index.js +17 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/src/logo.svg +1 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/src/reportWebVitals.js +13 -0
- package/packages/analytics-js-integrations/src/integrations/Ninetailed/sample-app/src/setupTests.js +5 -0
- package/packages/analytics-js-integrations/src/integrations/Olark/browser.js +92 -0
- package/packages/analytics-js-integrations/src/integrations/Olark/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Olark/nativeSdkLoader.js +31 -0
- package/packages/analytics-js-integrations/src/integrations/Olark/utils.js +51 -0
- package/packages/analytics-js-integrations/src/integrations/Optimizely/browser.js +244 -0
- package/packages/analytics-js-integrations/src/integrations/Optimizely/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Optimizely/utils.js +23 -0
- package/packages/analytics-js-integrations/src/integrations/Pendo/browser.js +123 -0
- package/packages/analytics-js-integrations/src/integrations/Pendo/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Pendo/nativeSdkLoader.js +32 -0
- package/packages/analytics-js-integrations/src/integrations/PinterestTag/browser.js +240 -0
- package/packages/analytics-js-integrations/src/integrations/PinterestTag/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/PinterestTag/nativeSdkLoader.js +19 -0
- package/packages/analytics-js-integrations/src/integrations/PinterestTag/propertyMappingConfig.js +57 -0
- package/packages/analytics-js-integrations/src/integrations/PinterestTag/test/input.js +180 -0
- package/packages/analytics-js-integrations/src/integrations/PinterestTag/test/output.js +129 -0
- package/packages/analytics-js-integrations/src/integrations/PinterestTag/utils.js +50 -0
- package/packages/analytics-js-integrations/src/integrations/Podsights/browser.js +179 -0
- package/packages/analytics-js-integrations/src/integrations/Podsights/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Podsights/utils.js +64 -0
- package/packages/analytics-js-integrations/src/integrations/PostAffiliatePro/browser.js +132 -0
- package/packages/analytics-js-integrations/src/integrations/PostAffiliatePro/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/PostAffiliatePro/utils.js +40 -0
- package/packages/analytics-js-integrations/src/integrations/Posthog/browser.js +147 -0
- package/packages/analytics-js-integrations/src/integrations/Posthog/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Posthog/nativeSdkLoader.js +48 -0
- package/packages/analytics-js-integrations/src/integrations/Posthog/test/test_posthog.html +77 -0
- package/packages/analytics-js-integrations/src/integrations/Posthog/utils.js +52 -0
- package/packages/analytics-js-integrations/src/integrations/ProfitWell/browser.js +71 -0
- package/packages/analytics-js-integrations/src/integrations/ProfitWell/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/ProfitWell/nativeSdkLoader.js +25 -0
- package/packages/analytics-js-integrations/src/integrations/Qualaroo/browser.js +116 -0
- package/packages/analytics-js-integrations/src/integrations/Qualaroo/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Qualaroo/utils.js +83 -0
- package/packages/analytics-js-integrations/src/integrations/Qualtrics/browser.js +92 -0
- package/packages/analytics-js-integrations/src/integrations/Qualtrics/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Qualtrics/nativeSdkLoader.js +79 -0
- package/packages/analytics-js-integrations/src/integrations/QuantumMetric/browser.js +54 -0
- package/packages/analytics-js-integrations/src/integrations/QuantumMetric/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/QuoraPixel/browser.js +77 -0
- package/packages/analytics-js-integrations/src/integrations/QuoraPixel/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/QuoraPixel/nativeSdkLoader.js +21 -0
- package/packages/analytics-js-integrations/src/integrations/RedditPixel/browser.js +103 -0
- package/packages/analytics-js-integrations/src/integrations/RedditPixel/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/RedditPixel/nativeSdkLoader.js +21 -0
- package/packages/analytics-js-integrations/src/integrations/Refiner/browser.js +117 -0
- package/packages/analytics-js-integrations/src/integrations/Refiner/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Refiner/nativeSdkLoader.js +20 -0
- package/packages/analytics-js-integrations/src/integrations/Refiner/utils.js +44 -0
- package/packages/analytics-js-integrations/src/integrations/Rockerbox/browser.js +90 -0
- package/packages/analytics-js-integrations/src/integrations/Rockerbox/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Rockerbox/nativeSdkLoader.js +32 -0
- package/packages/analytics-js-integrations/src/integrations/RollBar/browser.js +93 -0
- package/packages/analytics-js-integrations/src/integrations/RollBar/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/RollBar/nativeSdkLoader.js +383 -0
- package/packages/analytics-js-integrations/src/integrations/Satismeter/browser.js +92 -0
- package/packages/analytics-js-integrations/src/integrations/Satismeter/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Satismeter/nativeSdkLoader.js +23 -0
- package/packages/analytics-js-integrations/src/integrations/Satismeter/util.js +54 -0
- package/packages/analytics-js-integrations/src/integrations/Sendinblue/browser.js +111 -0
- package/packages/analytics-js-integrations/src/integrations/Sendinblue/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Sendinblue/nativeSdkLoader.js +36 -0
- package/packages/analytics-js-integrations/src/integrations/Sendinblue/utils.js +129 -0
- package/packages/analytics-js-integrations/src/integrations/Sentry/browser.js +120 -0
- package/packages/analytics-js-integrations/src/integrations/Sentry/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Sentry/utils.js +84 -0
- package/packages/analytics-js-integrations/src/integrations/Shynet/browser.js +99 -0
- package/packages/analytics-js-integrations/src/integrations/Shynet/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/SnapEngage/browser.js +74 -0
- package/packages/analytics-js-integrations/src/integrations/SnapEngage/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/SnapEngage/nativeSdkLoader.js +24 -0
- package/packages/analytics-js-integrations/src/integrations/SnapEngage/util.js +63 -0
- package/packages/analytics-js-integrations/src/integrations/SnapPixel/browser.js +226 -0
- package/packages/analytics-js-integrations/src/integrations/SnapPixel/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/SnapPixel/nativeSdkLoader.js +20 -0
- package/packages/analytics-js-integrations/src/integrations/SnapPixel/util.js +214 -0
- package/packages/analytics-js-integrations/src/integrations/SpotifyPixel/browser.js +180 -0
- package/packages/analytics-js-integrations/src/integrations/SpotifyPixel/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Sprig/browser.js +89 -0
- package/packages/analytics-js-integrations/src/integrations/Sprig/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Sprig/nativeSdkLoader.js +19 -0
- package/packages/analytics-js-integrations/src/integrations/TVSquared/browser.js +99 -0
- package/packages/analytics-js-integrations/src/integrations/TVSquared/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/TVSquared/utils.js +41 -0
- package/packages/analytics-js-integrations/src/integrations/TiktokAds/browser.js +111 -0
- package/packages/analytics-js-integrations/src/integrations/TiktokAds/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/TiktokAds/nativeSdkLoader.js +52 -0
- package/packages/analytics-js-integrations/src/integrations/TiktokAds/util.js +70 -0
- package/packages/analytics-js-integrations/src/integrations/VWO/browser.js +155 -0
- package/packages/analytics-js-integrations/src/integrations/VWO/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/VWO/nativeSdkLoader.js +64 -0
- package/packages/analytics-js-integrations/src/integrations/VWO/utils.js +42 -0
- package/packages/analytics-js-integrations/src/integrations/Vero/browser.js +166 -0
- package/packages/analytics-js-integrations/src/integrations/Vero/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Vero/utils.js +17 -0
- package/packages/analytics-js-integrations/src/integrations/Woopra/browser.js +82 -0
- package/packages/analytics-js-integrations/src/integrations/Woopra/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/Woopra/nativeSdkLoader.js +43 -0
- package/packages/analytics-js-integrations/src/integrations/YandexMetrica/browser.js +139 -0
- package/packages/analytics-js-integrations/src/integrations/YandexMetrica/index.js +1 -0
- package/packages/analytics-js-integrations/src/integrations/YandexMetrica/nativeSdkLoader.js +35 -0
- package/packages/analytics-js-integrations/src/integrations/YandexMetrica/utils.js +140 -0
- package/packages/analytics-js-integrations/src/integrations/index.js +163 -0
- package/packages/analytics-js-integrations/src/utils/camelcase.js +48 -0
- package/packages/analytics-js-integrations/src/utils/commonUtils.js +214 -0
- package/packages/analytics-js-integrations/src/utils/constants.js +4 -0
- package/packages/analytics-js-integrations/src/utils/logger.js +106 -0
- package/packages/analytics-js-integrations/src/utils/utils.js +585 -0
- package/packages/analytics-js-integrations/tsconfig.json +8 -0
- package/packages/analytics-js-integrations/tsconfig.spec.json +26 -0
- package/packages/analytics-js-plugins/.jscpd.json +17 -0
- package/packages/analytics-js-plugins/.size-limit.js +16 -0
- package/packages/analytics-js-plugins/CHANGELOG.md +212 -0
- package/packages/analytics-js-plugins/CHANGELOG_LATEST.md +7 -0
- package/packages/analytics-js-plugins/LICENSE +21 -0
- package/packages/analytics-js-plugins/README.md +57 -0
- package/packages/analytics-js-plugins/__fixtures__/.gitkeep +0 -0
- package/packages/analytics-js-plugins/__fixtures__/fixtures.ts +174 -0
- package/packages/analytics-js-plugins/__fixtures__/msw.handlers.js +45 -0
- package/packages/analytics-js-plugins/__fixtures__/msw.server.js +6 -0
- package/packages/analytics-js-plugins/__mocks__/.gitkeep +0 -0
- package/packages/analytics-js-plugins/__tests__/beaconQueue/.gitkeep +0 -0
- package/packages/analytics-js-plugins/__tests__/bugsnag/index.test.ts +116 -0
- package/packages/analytics-js-plugins/__tests__/bugsnag/utils.test.ts +555 -0
- package/packages/analytics-js-plugins/__tests__/customConsentManager/index.test.ts +264 -0
- package/packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts +260 -0
- package/packages/analytics-js-plugins/__tests__/deviceModeTransformation/.gitkeep +0 -0
- package/packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts +287 -0
- package/packages/analytics-js-plugins/__tests__/deviceModeTransformation/utilities.test.ts +22 -0
- package/packages/analytics-js-plugins/__tests__/errorReporting/index.test.ts +102 -0
- package/packages/analytics-js-plugins/__tests__/externalAnonymousId/.gitkeep +0 -0
- package/packages/analytics-js-plugins/__tests__/googleLinker/.gitkeep +0 -0
- package/packages/analytics-js-plugins/__tests__/ketchConsentManager/index.test.ts +498 -0
- package/packages/analytics-js-plugins/__tests__/ketchConsentManager/utils.test.ts +189 -0
- package/packages/analytics-js-plugins/__tests__/nativeDestinationQueue/utilities.test.ts +98 -0
- package/packages/analytics-js-plugins/__tests__/oneTrustConsentManager/index.test.ts +395 -0
- package/packages/analytics-js-plugins/__tests__/storageEncryption/index.test.ts +37 -0
- package/packages/analytics-js-plugins/__tests__/storageEncryptionLegacy/index.test.ts +41 -0
- package/packages/analytics-js-plugins/__tests__/storageMigrator/.gitkeep +0 -0
- package/packages/analytics-js-plugins/__tests__/storageMigrator/index.test.ts +144 -0
- package/packages/analytics-js-plugins/__tests__/utilities/destination.test.ts +133 -0
- package/packages/analytics-js-plugins/__tests__/utilities/queue.test.ts +327 -0
- package/packages/analytics-js-plugins/__tests__/utilities/retryQueue/RetryQueue.test.ts +1077 -0
- package/packages/analytics-js-plugins/__tests__/utilities/retryQueue/Schedule.test.ts +78 -0
- package/packages/analytics-js-plugins/__tests__/xhrQueue/index.test.ts +320 -0
- package/packages/analytics-js-plugins/__tests__/xhrQueue/utilities.test.ts +388 -0
- package/packages/analytics-js-plugins/babel.config.json +14 -0
- package/packages/analytics-js-plugins/jest.config.mjs +14 -0
- package/packages/analytics-js-plugins/package.json +106 -0
- package/packages/analytics-js-plugins/project.json +131 -0
- package/packages/analytics-js-plugins/public/.gitkeep +0 -0
- package/packages/analytics-js-plugins/rollup.config.mjs +245 -0
- package/packages/analytics-js-plugins/src/beaconQueue/constants.ts +27 -0
- package/packages/analytics-js-plugins/src/beaconQueue/index.ts +146 -0
- package/packages/analytics-js-plugins/src/beaconQueue/logMessages.ts +24 -0
- package/packages/analytics-js-plugins/src/beaconQueue/types.ts +12 -0
- package/packages/analytics-js-plugins/src/beaconQueue/utilities.ts +68 -0
- package/packages/analytics-js-plugins/src/bugsnag/constants.ts +52 -0
- package/packages/analytics-js-plugins/src/bugsnag/index.ts +65 -0
- package/packages/analytics-js-plugins/src/bugsnag/logMessages.ts +19 -0
- package/packages/analytics-js-plugins/src/bugsnag/utils.ts +214 -0
- package/packages/analytics-js-plugins/src/customConsentManager/constants.ts +3 -0
- package/packages/analytics-js-plugins/src/customConsentManager/index.ts +86 -0
- package/packages/analytics-js-plugins/src/customConsentManager/logMessages.ts +3 -0
- package/packages/analytics-js-plugins/src/deviceModeDestinations/constants.ts +6 -0
- package/packages/analytics-js-plugins/src/deviceModeDestinations/index.ts +138 -0
- package/packages/analytics-js-plugins/src/deviceModeDestinations/logMessages.ts +24 -0
- package/packages/analytics-js-plugins/src/deviceModeDestinations/types.ts +28 -0
- package/packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts +249 -0
- package/packages/analytics-js-plugins/src/deviceModeTransformation/constants.ts +12 -0
- package/packages/analytics-js-plugins/src/deviceModeTransformation/index.ts +111 -0
- package/packages/analytics-js-plugins/src/deviceModeTransformation/logMessages.ts +28 -0
- package/packages/analytics-js-plugins/src/deviceModeTransformation/types.ts +38 -0
- package/packages/analytics-js-plugins/src/deviceModeTransformation/utilities.ts +155 -0
- package/packages/analytics-js-plugins/src/errorReporting/index.ts +62 -0
- package/packages/analytics-js-plugins/src/errorReporting/logMessages.ts +3 -0
- package/packages/analytics-js-plugins/src/externalAnonymousId/constants.ts +5 -0
- package/packages/analytics-js-plugins/src/externalAnonymousId/index.ts +47 -0
- package/packages/analytics-js-plugins/src/externalAnonymousId/util.ts +25 -0
- package/packages/analytics-js-plugins/src/googleLinker/base64Decoder.ts +33 -0
- package/packages/analytics-js-plugins/src/googleLinker/constants.ts +1 -0
- package/packages/analytics-js-plugins/src/googleLinker/crc32.ts +44 -0
- package/packages/analytics-js-plugins/src/googleLinker/index.ts +30 -0
- package/packages/analytics-js-plugins/src/googleLinker/userLib.ts +16 -0
- package/packages/analytics-js-plugins/src/googleLinker/utils.ts +156 -0
- package/packages/analytics-js-plugins/src/index.ts +15 -0
- package/packages/analytics-js-plugins/src/ketchConsentManager/constants.ts +4 -0
- package/packages/analytics-js-plugins/src/ketchConsentManager/index.ts +120 -0
- package/packages/analytics-js-plugins/src/ketchConsentManager/logMessages.ts +15 -0
- package/packages/analytics-js-plugins/src/ketchConsentManager/types.ts +11 -0
- package/packages/analytics-js-plugins/src/ketchConsentManager/utils.ts +95 -0
- package/packages/analytics-js-plugins/src/nativeDestinationQueue/constants.ts +9 -0
- package/packages/analytics-js-plugins/src/nativeDestinationQueue/index.ts +159 -0
- package/packages/analytics-js-plugins/src/nativeDestinationQueue/logMessages.ts +14 -0
- package/packages/analytics-js-plugins/src/nativeDestinationQueue/utilities.ts +81 -0
- package/packages/analytics-js-plugins/src/oneTrustConsentManager/constants.ts +3 -0
- package/packages/analytics-js-plugins/src/oneTrustConsentManager/index.ts +131 -0
- package/packages/analytics-js-plugins/src/oneTrustConsentManager/logMessages.ts +8 -0
- package/packages/analytics-js-plugins/src/oneTrustConsentManager/types.ts +4 -0
- package/packages/analytics-js-plugins/src/shared-chunks/common.ts +13 -0
- package/packages/analytics-js-plugins/src/shared-chunks/deviceModeDestinations.ts +3 -0
- package/packages/analytics-js-plugins/src/storageEncryption/constants.ts +1 -0
- package/packages/analytics-js-plugins/src/storageEncryption/encryptionUtils.ts +14 -0
- package/packages/analytics-js-plugins/src/storageEncryption/index.ts +26 -0
- package/packages/analytics-js-plugins/src/storageEncryptionLegacy/constants.ts +2 -0
- package/packages/analytics-js-plugins/src/storageEncryptionLegacy/index.ts +26 -0
- package/packages/analytics-js-plugins/src/storageEncryptionLegacy/legacyEncryptionUtils.ts +18 -0
- package/packages/analytics-js-plugins/src/storageMigrator/constants.ts +3 -0
- package/packages/analytics-js-plugins/src/storageMigrator/index.ts +59 -0
- package/packages/analytics-js-plugins/src/storageMigrator/logMessages.ts +4 -0
- package/packages/analytics-js-plugins/src/types/plugins.ts +69 -0
- package/packages/analytics-js-plugins/src/utilities/constants.ts +3 -0
- package/packages/analytics-js-plugins/src/utilities/destination.ts +40 -0
- package/packages/analytics-js-plugins/src/utilities/eventsDelivery.ts +85 -0
- package/packages/analytics-js-plugins/src/utilities/retryQueue/README.md +135 -0
- package/packages/analytics-js-plugins/src/utilities/retryQueue/RetryQueue.ts +736 -0
- package/packages/analytics-js-plugins/src/utilities/retryQueue/Schedule.ts +101 -0
- package/packages/analytics-js-plugins/src/utilities/retryQueue/constants.ts +32 -0
- package/packages/analytics-js-plugins/src/utilities/retryQueue/logMessages.ts +9 -0
- package/packages/analytics-js-plugins/src/utilities/retryQueue/types.ts +21 -0
- package/packages/analytics-js-plugins/src/xhrQueue/constants.ts +23 -0
- package/packages/analytics-js-plugins/src/xhrQueue/index.ts +158 -0
- package/packages/analytics-js-plugins/src/xhrQueue/logMessages.ts +6 -0
- package/packages/analytics-js-plugins/src/xhrQueue/types.ts +16 -0
- package/packages/analytics-js-plugins/src/xhrQueue/utilities.ts +103 -0
- package/packages/analytics-js-plugins/tsconfig.json +14 -0
- package/packages/analytics-js-plugins/tsconfig.spec.json +24 -0
- package/packages/analytics-js-service-worker/.env.example +8 -0
- package/packages/analytics-js-service-worker/.jscpd.json +17 -0
- package/packages/analytics-js-service-worker/.size-limit.js +11 -0
- package/packages/analytics-js-service-worker/CHANGELOG.md +91 -0
- package/packages/analytics-js-service-worker/CHANGELOG_LATEST.md +7 -0
- package/packages/analytics-js-service-worker/LICENSE +21 -0
- package/packages/analytics-js-service-worker/README.md +74 -0
- package/packages/analytics-js-service-worker/__fixtures__/fixtures.ts +79 -0
- package/packages/analytics-js-service-worker/__fixtures__/msw.server.ts +13 -0
- package/packages/analytics-js-service-worker/__mocks__/.gitkeep +0 -0
- package/packages/analytics-js-service-worker/__tests__/Analytics.test.ts +120 -0
- package/packages/analytics-js-service-worker/__tests__/loosely-validate-event/index.test.ts +140 -0
- package/packages/analytics-js-service-worker/babel.config.json +15 -0
- package/packages/analytics-js-service-worker/jest.config.mjs +14 -0
- package/packages/analytics-js-service-worker/package.json +103 -0
- package/packages/analytics-js-service-worker/project.json +104 -0
- package/packages/analytics-js-service-worker/public/.gitkeep +0 -0
- package/packages/analytics-js-service-worker/rollup.config.mjs +140 -0
- package/packages/analytics-js-service-worker/src/Analytics.ts +564 -0
- package/packages/analytics-js-service-worker/src/IAnalytics.ts +141 -0
- package/packages/analytics-js-service-worker/src/index.ts +9 -0
- package/packages/analytics-js-service-worker/src/loosely-validate-event/index.ts +136 -0
- package/packages/analytics-js-service-worker/src/types.ts +67 -0
- package/packages/analytics-js-service-worker/tsconfig.json +8 -0
- package/packages/analytics-js-service-worker/tsconfig.spec.json +22 -0
- package/packages/analytics-v1.1/.env.example +8 -0
- package/packages/analytics-v1.1/.jscpd.json +17 -0
- package/packages/analytics-v1.1/.size-limit.js +16 -0
- package/packages/analytics-v1.1/.versionrc +12 -0
- package/packages/analytics-v1.1/CHANGELOG.md +3859 -0
- package/packages/analytics-v1.1/CHANGELOG_LATEST.md +5 -0
- package/packages/analytics-v1.1/LICENSE +21 -0
- package/packages/analytics-v1.1/README.md +321 -0
- package/packages/analytics-v1.1/__fixtures__/fixtures.js +130 -0
- package/packages/analytics-v1.1/__fixtures__/msw.handlers.js +51 -0
- package/packages/analytics-v1.1/__fixtures__/msw.server.js +6 -0
- package/packages/analytics-v1.1/__mocks__/.gitkeep +0 -0
- package/packages/analytics-v1.1/__tests__/data-residency.test.js +236 -0
- package/packages/analytics-v1.1/__tests__/features/core/metrics/errorReporting/ErrorReportingService.test.js +80 -0
- package/packages/analytics-v1.1/__tests__/ketchConsent.test.js +49 -0
- package/packages/analytics-v1.1/__tests__/oneTrustCookieConsent.test.js +89 -0
- package/packages/analytics-v1.1/__tests__/script.test.js +167 -0
- package/packages/analytics-v1.1/__tests__/transformationHandler.test.js +179 -0
- package/packages/analytics-v1.1/__tests__/utils/IntegrationsData.test.js +105 -0
- package/packages/analytics-v1.1/__tests__/utils/cdnPaths.test.js +63 -0
- package/packages/analytics-v1.1/__tests__/utils/clientHint.test.js +87 -0
- package/packages/analytics-v1.1/__tests__/utils/eventProcessorUtils.test.js +264 -0
- package/packages/analytics-v1.1/__tests__/utils/navigator.test.js +38 -0
- package/packages/analytics-v1.1/__tests__/utils/preProcessQueue.test.js +78 -0
- package/packages/analytics-v1.1/__tests__/utils/screenDetails.test.js +19 -0
- package/packages/analytics-v1.1/__tests__/utils/utils.test.js +69 -0
- package/packages/analytics-v1.1/babel.config.json +14 -0
- package/packages/analytics-v1.1/jest.config.mjs +14 -0
- package/packages/analytics-v1.1/package.json +115 -0
- package/packages/analytics-v1.1/project.json +119 -0
- package/packages/analytics-v1.1/public/index.html +137 -0
- package/packages/analytics-v1.1/rollup-configs/rollup.sdk.browser.mjs +32 -0
- package/packages/analytics-v1.1/rollup-configs/rollup.sdk.npm.mjs +53 -0
- package/packages/analytics-v1.1/rollup-configs/rollup.utilities.mjs +160 -0
- package/packages/analytics-v1.1/src/core/analytics.js +1669 -0
- package/packages/analytics-v1.1/src/features/core/cookieConsent/CookieConsentFactory.js +32 -0
- package/packages/analytics-v1.1/src/features/core/cookieConsent/OneTrust/browser.js +102 -0
- package/packages/analytics-v1.1/src/features/core/cookieConsent/OneTrust/index.js +1 -0
- package/packages/analytics-v1.1/src/features/core/cookieConsent/ketch/browser.js +114 -0
- package/packages/analytics-v1.1/src/features/core/cookieConsent/ketch/index.js +1 -0
- package/packages/analytics-v1.1/src/features/core/deviceModeTransformation/transformationHandler.js +196 -0
- package/packages/analytics-v1.1/src/features/core/deviceModeTransformation/util.js +23 -0
- package/packages/analytics-v1.1/src/features/core/metrics/errorReporting/ErrorReportingService.js +116 -0
- package/packages/analytics-v1.1/src/features/core/metrics/errorReporting/providers/Bugsnag.js +247 -0
- package/packages/analytics-v1.1/src/features/core/session/index.js +207 -0
- package/packages/analytics-v1.1/src/utils/EventRepository.js +79 -0
- package/packages/analytics-v1.1/src/utils/IntegrationsData.js +56 -0
- package/packages/analytics-v1.1/src/utils/JSFileLoader.js +66 -0
- package/packages/analytics-v1.1/src/utils/PreProcessQueue.js +66 -0
- package/packages/analytics-v1.1/src/utils/RudderApp.js +9 -0
- package/packages/analytics-v1.1/src/utils/RudderContext.js +23 -0
- package/packages/analytics-v1.1/src/utils/RudderElement.js +33 -0
- package/packages/analytics-v1.1/src/utils/RudderElementBuilder.js +29 -0
- package/packages/analytics-v1.1/src/utils/RudderInfo.js +41 -0
- package/packages/analytics-v1.1/src/utils/RudderMessage.js +28 -0
- package/packages/analytics-v1.1/src/utils/beaconQueue.js +140 -0
- package/packages/analytics-v1.1/src/utils/cdnPaths.js +43 -0
- package/packages/analytics-v1.1/src/utils/clientHint.js +28 -0
- package/packages/analytics-v1.1/src/utils/constants.js +70 -0
- package/packages/analytics-v1.1/src/utils/eventProcessorUtils.js +53 -0
- package/packages/analytics-v1.1/src/utils/linker/base64decoder.js +29 -0
- package/packages/analytics-v1.1/src/utils/linker/crc32.js +42 -0
- package/packages/analytics-v1.1/src/utils/linker/index.js +134 -0
- package/packages/analytics-v1.1/src/utils/linker/userLib.js +20 -0
- package/packages/analytics-v1.1/src/utils/navigator.js +32 -0
- package/packages/analytics-v1.1/src/utils/pageProperties.js +74 -0
- package/packages/analytics-v1.1/src/utils/screenDetails.js +23 -0
- package/packages/analytics-v1.1/src/utils/utils.js +423 -0
- package/packages/analytics-v1.1/src/utils/xhrModule.js +117 -0
- package/packages/analytics-v1.1/tsconfig.json +8 -0
- package/packages/analytics-v1.1/tsconfig.spec.json +26 -0
- package/packages/analytics-v1.1/types/index.d.ts +472 -0
- package/packages/analytics-v1.1/types/service-worker/index.d.ts +220 -0
- package/packages/loading-scripts/.env.example +11 -0
- package/packages/loading-scripts/.jscpd.json +17 -0
- package/packages/loading-scripts/CHANGELOG.md +130 -0
- package/packages/loading-scripts/CHANGELOG_LATEST.md +2 -0
- package/packages/loading-scripts/LICENSE +21 -0
- package/packages/loading-scripts/README.md +26 -0
- package/packages/loading-scripts/__fixtures__/.gitkeep +0 -0
- package/packages/loading-scripts/__mocks__/.gitkeep +0 -0
- package/packages/loading-scripts/__tests__/.gitkeep +0 -0
- package/packages/loading-scripts/babel.config.json +14 -0
- package/packages/loading-scripts/jest.config.mjs +14 -0
- package/packages/loading-scripts/package.json +62 -0
- package/packages/loading-scripts/project.json +101 -0
- package/packages/loading-scripts/public/index.html +180 -0
- package/packages/loading-scripts/rollup.config.mjs +112 -0
- package/packages/loading-scripts/src/index.ts +106 -0
- package/packages/loading-scripts/src/types/rudderanalytics.d.ts +16 -0
- package/packages/loading-scripts/tsconfig.json +15 -0
- package/packages/loading-scripts/tsconfig.spec.json +22 -0
- package/packages/sanity-suite/.env.example +39 -0
- package/packages/sanity-suite/.jscpd.json +17 -0
- package/packages/sanity-suite/CHANGELOG.md +154 -0
- package/packages/sanity-suite/LICENSE +21 -0
- package/packages/sanity-suite/README.md +37 -0
- package/packages/sanity-suite/__fixtures__/alias1.json +141 -0
- package/packages/sanity-suite/__fixtures__/alias2.json +101 -0
- package/packages/sanity-suite/__fixtures__/alias3.json +101 -0
- package/packages/sanity-suite/__fixtures__/alias4.json +101 -0
- package/packages/sanity-suite/__fixtures__/alias5.json +107 -0
- package/packages/sanity-suite/__fixtures__/alias6.json +141 -0
- package/packages/sanity-suite/__fixtures__/eventFiltering1.json +69 -0
- package/packages/sanity-suite/__fixtures__/eventFiltering2.json +69 -0
- package/packages/sanity-suite/__fixtures__/eventFiltering3.json +69 -0
- package/packages/sanity-suite/__fixtures__/group1.json +124 -0
- package/packages/sanity-suite/__fixtures__/group2.json +90 -0
- package/packages/sanity-suite/__fixtures__/group3.json +90 -0
- package/packages/sanity-suite/__fixtures__/group4.json +105 -0
- package/packages/sanity-suite/__fixtures__/group5.json +71 -0
- package/packages/sanity-suite/__fixtures__/group6.json +70 -0
- package/packages/sanity-suite/__fixtures__/identify1.json +140 -0
- package/packages/sanity-suite/__fixtures__/identify2.json +106 -0
- package/packages/sanity-suite/__fixtures__/identify3.json +103 -0
- package/packages/sanity-suite/__fixtures__/identify4.json +69 -0
- package/packages/sanity-suite/__fixtures__/identify5.json +106 -0
- package/packages/sanity-suite/__fixtures__/identify6.json +107 -0
- package/packages/sanity-suite/__fixtures__/identify7.json +106 -0
- package/packages/sanity-suite/__fixtures__/identify8.json +107 -0
- package/packages/sanity-suite/__fixtures__/page1.json +123 -0
- package/packages/sanity-suite/__fixtures__/page2.json +90 -0
- package/packages/sanity-suite/__fixtures__/page3.json +90 -0
- package/packages/sanity-suite/__fixtures__/page4.json +116 -0
- package/packages/sanity-suite/__fixtures__/page5.json +83 -0
- package/packages/sanity-suite/__fixtures__/page6.json +81 -0
- package/packages/sanity-suite/__fixtures__/page7.json +81 -0
- package/packages/sanity-suite/__fixtures__/page8.json +79 -0
- package/packages/sanity-suite/__fixtures__/sourceConfig1.json +1536 -0
- package/packages/sanity-suite/__fixtures__/sourceConfigDMT1.json +665 -0
- package/packages/sanity-suite/__fixtures__/sourceConfigDev1.json +892 -0
- package/packages/sanity-suite/__fixtures__/track1.json +154 -0
- package/packages/sanity-suite/__fixtures__/track2.json +122 -0
- package/packages/sanity-suite/__fixtures__/track3.json +122 -0
- package/packages/sanity-suite/__fixtures__/track4.json +138 -0
- package/packages/sanity-suite/__fixtures__/track5.json +106 -0
- package/packages/sanity-suite/__fixtures__/track6.json +85 -0
- package/packages/sanity-suite/__fixtures__/track7.json +85 -0
- package/packages/sanity-suite/babel.config.json +14 -0
- package/packages/sanity-suite/jest.config.mjs +14 -0
- package/packages/sanity-suite/package.json +83 -0
- package/packages/sanity-suite/project.json +55 -0
- package/packages/sanity-suite/public/v1.1/index-cdn.html +135 -0
- package/packages/sanity-suite/public/v1.1/index-local.html +141 -0
- package/packages/sanity-suite/public/v1.1/index-npm.html +107 -0
- package/packages/sanity-suite/public/v1.1/integrations/index-cdn.html +172 -0
- package/packages/sanity-suite/public/v1.1/integrations/index-local.html +171 -0
- package/packages/sanity-suite/public/v1.1/integrations/index-npm.html +140 -0
- package/packages/sanity-suite/public/v1.1/manualLoadCall/index-cdn.html +172 -0
- package/packages/sanity-suite/public/v1.1/manualLoadCall/index-local.html +171 -0
- package/packages/sanity-suite/public/v1.1/manualLoadCall/index-npm.html +140 -0
- package/packages/sanity-suite/public/v3/index-cdn.html +165 -0
- package/packages/sanity-suite/public/v3/index-local.html +169 -0
- package/packages/sanity-suite/public/v3/index-npm.html +99 -0
- package/packages/sanity-suite/public/v3/integrations/index-cdn.html +196 -0
- package/packages/sanity-suite/public/v3/integrations/index-local.html +198 -0
- package/packages/sanity-suite/public/v3/integrations/index-npm.html +138 -0
- package/packages/sanity-suite/public/v3/manualLoadCall/index-cdn.html +196 -0
- package/packages/sanity-suite/public/v3/manualLoadCall/index-local.html +198 -0
- package/packages/sanity-suite/public/v3/manualLoadCall/index-npm.html +138 -0
- package/packages/sanity-suite/rollup.config.mjs +247 -0
- package/packages/sanity-suite/serve.json +4 -0
- package/packages/sanity-suite/src/ignoredProperties/ignoredProperties.js +183 -0
- package/packages/sanity-suite/src/ignoredProperties/sourceConfigIgnoredProperties.js +144 -0
- package/packages/sanity-suite/src/index-npm-v1.1.ts +53 -0
- package/packages/sanity-suite/src/index-npm.ts +57 -0
- package/packages/sanity-suite/src/index.ts +6 -0
- package/packages/sanity-suite/src/testBook/ResultAssertions.js +77 -0
- package/packages/sanity-suite/src/testBook/TestBook.js +360 -0
- package/packages/sanity-suite/src/testBook/index.js +13 -0
- package/packages/sanity-suite/src/testBookSuites/alias.js +289 -0
- package/packages/sanity-suite/src/testBookSuites/eventFiltering.js +77 -0
- package/packages/sanity-suite/src/testBookSuites/group.js +241 -0
- package/packages/sanity-suite/src/testBookSuites/identify.js +455 -0
- package/packages/sanity-suite/src/testBookSuites/index.js +40 -0
- package/packages/sanity-suite/src/testBookSuites/page.js +259 -0
- package/packages/sanity-suite/src/testBookSuites/sourceConfig.js +89 -0
- package/packages/sanity-suite/src/testBookSuites/sourceConfigDev.js +20 -0
- package/packages/sanity-suite/src/testBookSuites/track.js +448 -0
- package/packages/sanity-suite/src/types/global.d.ts +2 -0
- package/packages/sanity-suite/src/types/rudderanalytics.d.ts +16 -0
- package/packages/sanity-suite/tsconfig.json +14 -0
- package/packages/sanity-suite/tsconfig.spec.json +22 -0
- package/patches/@originjs+vite-plugin-federation+1.3.5.patch +170 -0
- package/patches/@segment+localstorage-retry+1.3.0.patch +123 -0
- package/patches/@segment+top-domain+3.0.1.patch +34 -0
- package/patches/@vespaiach+axios-fetch-adapter+0.3.1.patch +43 -0
- package/patches/crypto-es+2.1.0.patch +103 -0
- package/patches/nx+18.0.5.patch +83 -0
- package/patches/rollup-plugin-generate-html-template+1.7.0.patch +46 -0
- package/scripts/commitizen.js +26 -0
- package/scripts/fix-reports-path-in-github-runner.sh +16 -0
- package/scripts/generate-last-release-changelog.sh +32 -0
- package/scripts/sync-tags-in-nx-projects.sh +24 -0
- package/sonar-project.properties +37 -0
- package/tsconfig.build.json +12 -0
- package/tsconfig.json +49 -0
- package/tsconfig.paths.json +27 -0
- package/types/clipboardJs.d.ts +1 -0
- package/types/component-querystring.d.ts +1 -0
- package/types/component-type.d.ts +1 -0
- package/types/global.d.ts +18 -0
- package/types/join-component.d.ts +1 -0
- package/types/localstorage-retry.d.ts +1 -0
- package/types/loosely-validate-event.d.ts +1 -0
- package/types/user-agent-data-types.d.ts +3 -0
@@ -0,0 +1,1043 @@
|
|
1
|
+
import * as R from 'ramda';
|
2
|
+
import { batch } from '@preact/signals-core';
|
3
|
+
import { ILogger } from '@rudderstack/analytics-js-common/types/Logger';
|
4
|
+
import { ApiObject } from '@rudderstack/analytics-js-common/types/ApiObject';
|
5
|
+
import { ApiOptions } from '@rudderstack/analytics-js-common/types/EventApi';
|
6
|
+
import {
|
7
|
+
AppInfo,
|
8
|
+
LibraryInfo,
|
9
|
+
OSInfo,
|
10
|
+
ScreenInfo,
|
11
|
+
} from '@rudderstack/analytics-js-common/types/EventContext';
|
12
|
+
import { SessionInfo } from '@rudderstack/analytics-js-common/types/Session';
|
13
|
+
import { RudderContext, RudderEvent } from '@rudderstack/analytics-js-common/types/Event';
|
14
|
+
import { state } from '../../../src/state';
|
15
|
+
import {
|
16
|
+
checkForReservedElements,
|
17
|
+
checkForReservedElementsInObject,
|
18
|
+
getContextPageProperties,
|
19
|
+
getMergedContext,
|
20
|
+
processOptions,
|
21
|
+
updateTopLevelEventElements,
|
22
|
+
getUpdatedPageProperties,
|
23
|
+
getEnrichedEvent,
|
24
|
+
} from '../../../src/components/eventManager/utilities';
|
25
|
+
import { PluginsManager } from '../../../src/components/pluginsManager';
|
26
|
+
import { defaultErrorHandler } from '../../../src/services/ErrorHandler';
|
27
|
+
import { defaultPluginEngine } from '../../../src/services/PluginEngine';
|
28
|
+
import { defaultLogger } from '../../../src/services/Logger';
|
29
|
+
|
30
|
+
jest.mock('@rudderstack/analytics-js-common/utilities/timestamp', () => ({
|
31
|
+
getCurrentTimeFormatted: jest.fn().mockReturnValue('2020-01-01T00:00:00.000Z'),
|
32
|
+
}));
|
33
|
+
|
34
|
+
jest.mock('@rudderstack/analytics-js-common/utilities/uuId', () => ({
|
35
|
+
generateUUID: jest.fn().mockReturnValue('test_uuid'),
|
36
|
+
}));
|
37
|
+
|
38
|
+
const defaultAnonId = 'default-anon-id';
|
39
|
+
const defaultIntegrations = { All: false, 'Default Integration': true };
|
40
|
+
const defaultOriginalTimestamp = 'default-timestamp';
|
41
|
+
|
42
|
+
const sampleAnonId = 'sample-anon-id';
|
43
|
+
const sampleIntegrations = { All: true, 'Sample Integration': true };
|
44
|
+
const sampleOriginalTimestamp = 'sample-timestamp';
|
45
|
+
|
46
|
+
// @ts-ignore
|
47
|
+
const defaultContext = {
|
48
|
+
library: {
|
49
|
+
name: 'test',
|
50
|
+
version: '1.0',
|
51
|
+
},
|
52
|
+
locale: 'en-US',
|
53
|
+
app: {
|
54
|
+
name: 'test',
|
55
|
+
version: '1.0',
|
56
|
+
},
|
57
|
+
campaign: {
|
58
|
+
name: 'test',
|
59
|
+
source: 'test',
|
60
|
+
},
|
61
|
+
screen: {
|
62
|
+
width: 1920,
|
63
|
+
height: 1080,
|
64
|
+
},
|
65
|
+
'ua-ch': {
|
66
|
+
brand: 'test',
|
67
|
+
model: 'test',
|
68
|
+
},
|
69
|
+
userAgent: 'defaultUA',
|
70
|
+
} as RudderContext;
|
71
|
+
|
72
|
+
const resetApplicationState = () => {
|
73
|
+
batch(() => {
|
74
|
+
state.session.initialReferrer.value = undefined;
|
75
|
+
state.session.initialReferringDomain.value = undefined;
|
76
|
+
});
|
77
|
+
};
|
78
|
+
|
79
|
+
describe('Event Manager - Utilities', () => {
|
80
|
+
class MockLogger implements ILogger {
|
81
|
+
warn = jest.fn();
|
82
|
+
log = jest.fn();
|
83
|
+
error = jest.fn();
|
84
|
+
info = jest.fn();
|
85
|
+
debug = jest.fn();
|
86
|
+
minLogLevel = 0;
|
87
|
+
scope = 'test scope';
|
88
|
+
setMinLogLevel = jest.fn();
|
89
|
+
setScope = jest.fn();
|
90
|
+
logProvider = console;
|
91
|
+
}
|
92
|
+
|
93
|
+
const mockLogger = new MockLogger();
|
94
|
+
|
95
|
+
const defaultEventType = 'test';
|
96
|
+
const defaultPluginsManager = new PluginsManager(
|
97
|
+
defaultPluginEngine,
|
98
|
+
defaultErrorHandler,
|
99
|
+
defaultLogger,
|
100
|
+
);
|
101
|
+
|
102
|
+
describe('getUpdatedPageProperties', () => {
|
103
|
+
let pageProperties: ApiObject;
|
104
|
+
beforeEach(() => {
|
105
|
+
pageProperties = {
|
106
|
+
path: '/test',
|
107
|
+
referrer: 'https://www.google.com/test',
|
108
|
+
search: '?test=true',
|
109
|
+
title: 'test page',
|
110
|
+
url: 'https://www.rudderlabs.com/test',
|
111
|
+
referring_domain: 'www.google.com',
|
112
|
+
tab_url: 'https://www.rudderlabs.com/test1',
|
113
|
+
initial_referrer: 'https://www.google.com/test1',
|
114
|
+
initial_referring_domain: 'www.google.com',
|
115
|
+
anonymousId: defaultAnonId,
|
116
|
+
} as ApiObject;
|
117
|
+
});
|
118
|
+
|
119
|
+
it('should return the input page properties if options is invalid', () => {
|
120
|
+
const updatedPageProperties = getUpdatedPageProperties(pageProperties, undefined);
|
121
|
+
|
122
|
+
expect(updatedPageProperties).toEqual(pageProperties);
|
123
|
+
});
|
124
|
+
|
125
|
+
it('should return the input page properties if the page properties provided in options is undefined', () => {
|
126
|
+
const apiOptions = {
|
127
|
+
tempKey: 'tempValue',
|
128
|
+
};
|
129
|
+
|
130
|
+
const updatedPageProperties = getUpdatedPageProperties(pageProperties, apiOptions);
|
131
|
+
|
132
|
+
expect(updatedPageProperties).toEqual(pageProperties);
|
133
|
+
});
|
134
|
+
|
135
|
+
it('should return the input page properties if the page properties provided in options is not a valid object', () => {
|
136
|
+
const apiOptions = {
|
137
|
+
page: 'some string',
|
138
|
+
};
|
139
|
+
|
140
|
+
const updatedPageProperties = getUpdatedPageProperties(pageProperties, apiOptions);
|
141
|
+
|
142
|
+
expect(updatedPageProperties).toEqual(pageProperties);
|
143
|
+
});
|
144
|
+
|
145
|
+
it('should return the input page properties if the all the default page properties are defined', () => {
|
146
|
+
// API options are irrelevant if all the default page properties are defined
|
147
|
+
const updatedPageProperties = getUpdatedPageProperties(pageProperties, {});
|
148
|
+
|
149
|
+
expect(updatedPageProperties).toEqual(pageProperties);
|
150
|
+
});
|
151
|
+
|
152
|
+
it('should return updated page properties if default page properties are overridden via options and input page parameters are not defined', () => {
|
153
|
+
const optionsPageProperties = {
|
154
|
+
path: '/test2',
|
155
|
+
referrer: 'https://www.google.com/test',
|
156
|
+
search: '?test=false',
|
157
|
+
title: 'test page 2',
|
158
|
+
url: 'https://www.rudderlabs.com/test2',
|
159
|
+
referring_domain: 'www.google.com',
|
160
|
+
tab_url: 'https://www.rudderlabs.com/test2',
|
161
|
+
initial_referrer: 'https://www.google.com/test2',
|
162
|
+
initial_referring_domain: 'www.google.com',
|
163
|
+
anonymousId: defaultAnonId,
|
164
|
+
};
|
165
|
+
|
166
|
+
const apiOptions: ApiOptions = {
|
167
|
+
page: optionsPageProperties,
|
168
|
+
};
|
169
|
+
|
170
|
+
// Reset the page properties
|
171
|
+
pageProperties = {} as ApiObject;
|
172
|
+
|
173
|
+
const updatedPageProperties = getUpdatedPageProperties(pageProperties, apiOptions);
|
174
|
+
|
175
|
+
expect(updatedPageProperties).toEqual({
|
176
|
+
path: optionsPageProperties.path,
|
177
|
+
referrer: optionsPageProperties.referrer,
|
178
|
+
search: optionsPageProperties.search,
|
179
|
+
title: optionsPageProperties.title,
|
180
|
+
url: optionsPageProperties.url,
|
181
|
+
referring_domain: optionsPageProperties.referring_domain,
|
182
|
+
tab_url: optionsPageProperties.tab_url,
|
183
|
+
initial_referrer: optionsPageProperties.initial_referrer,
|
184
|
+
initial_referring_domain: optionsPageProperties.initial_referring_domain,
|
185
|
+
});
|
186
|
+
});
|
187
|
+
|
188
|
+
it('should return updated page properties from state if some page properties are not defined in options and input page parameters are not defined', () => {
|
189
|
+
// Set some specific page properties in state
|
190
|
+
batch(() => {
|
191
|
+
state.session.initialReferrer.value = 'https://www.google.com/test3';
|
192
|
+
state.session.initialReferringDomain.value = 'www.google3.com';
|
193
|
+
});
|
194
|
+
|
195
|
+
// Reset the page properties
|
196
|
+
pageProperties.initial_referrer = undefined;
|
197
|
+
pageProperties.initial_referring_domain = undefined;
|
198
|
+
pageProperties.tab_url = undefined;
|
199
|
+
pageProperties.path = undefined;
|
200
|
+
pageProperties.referrer = undefined;
|
201
|
+
|
202
|
+
// Set page properties in options that are not defined in state and input page parameters
|
203
|
+
const optionsPageProperties = {
|
204
|
+
path: '/test2',
|
205
|
+
referrer: 'https://www.google.com/test',
|
206
|
+
};
|
207
|
+
|
208
|
+
const apiOptions: ApiOptions = {
|
209
|
+
page: optionsPageProperties,
|
210
|
+
};
|
211
|
+
|
212
|
+
const updatedPageProperties = getUpdatedPageProperties(pageProperties, apiOptions);
|
213
|
+
|
214
|
+
expect(updatedPageProperties).toEqual({
|
215
|
+
path: optionsPageProperties.path,
|
216
|
+
referrer: optionsPageProperties.referrer,
|
217
|
+
search: pageProperties.search,
|
218
|
+
title: pageProperties.title,
|
219
|
+
url: pageProperties.url,
|
220
|
+
referring_domain: pageProperties.referring_domain,
|
221
|
+
tab_url: 'http://www.test-host.com/',
|
222
|
+
initial_referrer: state.session.initialReferrer.value,
|
223
|
+
initial_referring_domain: state.session.initialReferringDomain.value,
|
224
|
+
anonymousId: pageProperties.anonymousId,
|
225
|
+
});
|
226
|
+
});
|
227
|
+
});
|
228
|
+
|
229
|
+
describe('getEnrichedEvent', () => {
|
230
|
+
beforeEach(() => {
|
231
|
+
resetApplicationState();
|
232
|
+
});
|
233
|
+
|
234
|
+
it('should return processed event if the event processor plugin is registered', () => {
|
235
|
+
defaultPluginsManager.registerLocalPlugins();
|
236
|
+
batch(() => {
|
237
|
+
state.session.anonymousId.value = 'anon_id';
|
238
|
+
state.session.userTraits.value = { test: 'test' };
|
239
|
+
state.session.userId.value = 'user_id';
|
240
|
+
state.session.sessionInfo.value = { sessionStart: true, id: 1234 } as SessionInfo;
|
241
|
+
state.session.groupId.value = 'group_id';
|
242
|
+
state.session.groupTraits.value = { test: 'test' };
|
243
|
+
state.session.initialReferrer.value = 'https://test.com/page';
|
244
|
+
state.session.initialReferringDomain.value = 'https://test.com';
|
245
|
+
|
246
|
+
state.consents.data.value.deniedConsentIds = ['id1', 'id2'];
|
247
|
+
|
248
|
+
state.context['ua-ch'].value = { mobile: true } as UADataValues;
|
249
|
+
state.context.app.value = { name: 'test', version: '1.0' } as AppInfo;
|
250
|
+
state.context.library.value = { name: 'test', version: '1.0' } as LibraryInfo;
|
251
|
+
state.context.locale.value = 'en-US';
|
252
|
+
state.context.userAgent.value = 'test';
|
253
|
+
state.context.screen.value = { width: 100, height: 100 } as ScreenInfo;
|
254
|
+
state.context.os.value = { name: 'test', version: '1.0' } as OSInfo;
|
255
|
+
state.context.timezone.value = 'GMT+0530';
|
256
|
+
});
|
257
|
+
|
258
|
+
// @ts-ignore
|
259
|
+
const event = {
|
260
|
+
name: 'test_name',
|
261
|
+
category: 'test_category',
|
262
|
+
properties: {
|
263
|
+
name: 'test_name',
|
264
|
+
category: 'test_category',
|
265
|
+
path: '/test',
|
266
|
+
referrer: 'https://www.google.com/test',
|
267
|
+
},
|
268
|
+
type: 'page',
|
269
|
+
} as RudderEvent;
|
270
|
+
|
271
|
+
const options = {
|
272
|
+
anonymousId: 'overridden_anonymous_id',
|
273
|
+
userId: 'overridden_user_id',
|
274
|
+
} as ApiOptions;
|
275
|
+
|
276
|
+
const pageProps = {
|
277
|
+
name: 'test_name',
|
278
|
+
category: 'test_category',
|
279
|
+
path: '/test',
|
280
|
+
referrer: 'https://www.google.com/test',
|
281
|
+
};
|
282
|
+
|
283
|
+
const enrichedEvent = getEnrichedEvent(event, options, pageProps);
|
284
|
+
|
285
|
+
expect(enrichedEvent).toEqual({
|
286
|
+
type: 'page',
|
287
|
+
name: 'test_name',
|
288
|
+
category: 'test_category',
|
289
|
+
anonymousId: 'overridden_anonymous_id',
|
290
|
+
channel: 'web',
|
291
|
+
context: {
|
292
|
+
sessionStart: true,
|
293
|
+
sessionId: 1234,
|
294
|
+
app: {
|
295
|
+
name: 'test',
|
296
|
+
version: '1.0',
|
297
|
+
},
|
298
|
+
campaign: {},
|
299
|
+
library: {
|
300
|
+
name: 'test',
|
301
|
+
version: '1.0',
|
302
|
+
},
|
303
|
+
locale: 'en-US',
|
304
|
+
os: {
|
305
|
+
name: 'test',
|
306
|
+
version: '1.0',
|
307
|
+
},
|
308
|
+
screen: {
|
309
|
+
height: 100,
|
310
|
+
width: 100,
|
311
|
+
},
|
312
|
+
traits: {
|
313
|
+
test: 'test',
|
314
|
+
},
|
315
|
+
'ua-ch': {
|
316
|
+
mobile: true,
|
317
|
+
},
|
318
|
+
userAgent: 'test',
|
319
|
+
timezone: 'GMT+0530',
|
320
|
+
page: {
|
321
|
+
path: '/test',
|
322
|
+
referrer: 'https://www.google.com/test',
|
323
|
+
referring_domain: '',
|
324
|
+
search: '',
|
325
|
+
title: '',
|
326
|
+
url: 'http://www.test-host.com/',
|
327
|
+
tab_url: 'http://www.test-host.com/',
|
328
|
+
initial_referrer: 'https://test.com/page',
|
329
|
+
initial_referring_domain: 'https://test.com',
|
330
|
+
},
|
331
|
+
userId: 'overridden_user_id',
|
332
|
+
},
|
333
|
+
originalTimestamp: '2020-01-01T00:00:00.000Z',
|
334
|
+
properties: {
|
335
|
+
name: 'test_name',
|
336
|
+
category: 'test_category',
|
337
|
+
path: '/test',
|
338
|
+
referrer: 'https://www.google.com/test',
|
339
|
+
},
|
340
|
+
messageId: 'test_uuid',
|
341
|
+
integrations: { All: true },
|
342
|
+
userId: 'user_id',
|
343
|
+
event: null,
|
344
|
+
});
|
345
|
+
|
346
|
+
defaultPluginsManager.unregisterLocalPlugins();
|
347
|
+
});
|
348
|
+
});
|
349
|
+
|
350
|
+
describe('checkForReservedElementsInObject', () => {
|
351
|
+
const defaultParentKeyPath = 'traits';
|
352
|
+
|
353
|
+
it('should log a warn message if the object contains reserved elements', () => {
|
354
|
+
const obj = {
|
355
|
+
anonymous_id: sampleAnonId,
|
356
|
+
original_timestamp: sampleOriginalTimestamp,
|
357
|
+
nonReservedKey: 123,
|
358
|
+
id: 'myMsgId',
|
359
|
+
} as ApiObject;
|
360
|
+
|
361
|
+
checkForReservedElementsInObject(obj, defaultParentKeyPath, mockLogger);
|
362
|
+
|
363
|
+
expect(mockLogger.warn).toHaveBeenNthCalledWith(
|
364
|
+
1,
|
365
|
+
`EventManager:: The "anonymous_id" property defined under "${defaultParentKeyPath}" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (id,anonymous_id,user_id,sent_at,timestamp,received_at,original_timestamp,event,event_text,channel,context_ip,context_request_ip,context_passed_ip,group_id,previous_id).`,
|
366
|
+
);
|
367
|
+
expect(mockLogger.warn).toHaveBeenNthCalledWith(
|
368
|
+
2,
|
369
|
+
`EventManager:: The "original_timestamp" property defined under "${defaultParentKeyPath}" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (id,anonymous_id,user_id,sent_at,timestamp,received_at,original_timestamp,event,event_text,channel,context_ip,context_request_ip,context_passed_ip,group_id,previous_id).`,
|
370
|
+
);
|
371
|
+
expect(mockLogger.warn).toHaveBeenNthCalledWith(
|
372
|
+
3,
|
373
|
+
`EventManager:: The "id" property defined under "${defaultParentKeyPath}" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (id,anonymous_id,user_id,sent_at,timestamp,received_at,original_timestamp,event,event_text,channel,context_ip,context_request_ip,context_passed_ip,group_id,previous_id).`,
|
374
|
+
);
|
375
|
+
});
|
376
|
+
|
377
|
+
it('should not log a warn message if the object does not contain reserved elements', () => {
|
378
|
+
const obj = {
|
379
|
+
nonReservedKey: 123,
|
380
|
+
nonReservedKey2: 'sample',
|
381
|
+
} as ApiObject;
|
382
|
+
|
383
|
+
checkForReservedElementsInObject(obj, defaultParentKeyPath, mockLogger);
|
384
|
+
|
385
|
+
expect(mockLogger.warn).not.toHaveBeenCalled();
|
386
|
+
});
|
387
|
+
|
388
|
+
it('should not log a warn message if the logger is not provided', () => {
|
389
|
+
const obj = {
|
390
|
+
anonymousId: sampleAnonId,
|
391
|
+
originalTimestamp: sampleOriginalTimestamp,
|
392
|
+
nonReservedKey: 123,
|
393
|
+
} as ApiObject;
|
394
|
+
|
395
|
+
checkForReservedElementsInObject(obj, defaultParentKeyPath);
|
396
|
+
|
397
|
+
expect(mockLogger.warn).not.toHaveBeenCalled();
|
398
|
+
});
|
399
|
+
|
400
|
+
it('should not log a warn message if the object is not provided', () => {
|
401
|
+
checkForReservedElementsInObject(undefined, defaultParentKeyPath, mockLogger);
|
402
|
+
|
403
|
+
expect(mockLogger.warn).not.toHaveBeenCalled();
|
404
|
+
});
|
405
|
+
|
406
|
+
it('should log a warn message if the object contains reserved elements but with different case', () => {
|
407
|
+
const obj = {
|
408
|
+
EVENT: 'test event',
|
409
|
+
nonReservedKey: 123,
|
410
|
+
original_timestamp: sampleOriginalTimestamp,
|
411
|
+
} as ApiObject;
|
412
|
+
|
413
|
+
checkForReservedElementsInObject(obj, defaultParentKeyPath, mockLogger);
|
414
|
+
|
415
|
+
expect(mockLogger.warn).toHaveBeenNthCalledWith(
|
416
|
+
1,
|
417
|
+
`EventManager:: The "EVENT" property defined under "${defaultParentKeyPath}" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (id,anonymous_id,user_id,sent_at,timestamp,received_at,original_timestamp,event,event_text,channel,context_ip,context_request_ip,context_passed_ip,group_id,previous_id).`,
|
418
|
+
);
|
419
|
+
expect(mockLogger.warn).toHaveBeenNthCalledWith(
|
420
|
+
2,
|
421
|
+
`EventManager:: The "original_timestamp" property defined under "${defaultParentKeyPath}" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (id,anonymous_id,user_id,sent_at,timestamp,received_at,original_timestamp,event,event_text,channel,context_ip,context_request_ip,context_passed_ip,group_id,previous_id).`,
|
422
|
+
);
|
423
|
+
});
|
424
|
+
});
|
425
|
+
|
426
|
+
describe('checkForReservedElements', () => {
|
427
|
+
it('should log a warn message if the event (properties, traits, and context traits) contains reserved elements', () => {
|
428
|
+
// @ts-ignore
|
429
|
+
const rudderEvent = {
|
430
|
+
type: defaultEventType,
|
431
|
+
properties: {
|
432
|
+
anonymous_id: sampleAnonId,
|
433
|
+
original_timestamp: sampleOriginalTimestamp,
|
434
|
+
},
|
435
|
+
traits: {
|
436
|
+
original_timestamp: sampleOriginalTimestamp,
|
437
|
+
event: 'test event',
|
438
|
+
},
|
439
|
+
// @ts-ignore
|
440
|
+
context: {
|
441
|
+
traits: {
|
442
|
+
anonymous_id: sampleAnonId,
|
443
|
+
},
|
444
|
+
locale: 'en-US',
|
445
|
+
} as RudderContext,
|
446
|
+
} as RudderEvent;
|
447
|
+
|
448
|
+
checkForReservedElements(rudderEvent, mockLogger);
|
449
|
+
|
450
|
+
expect(mockLogger.warn).toHaveBeenNthCalledWith(
|
451
|
+
1,
|
452
|
+
`EventManager:: The "anonymous_id" property defined under "properties" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (id,anonymous_id,user_id,sent_at,timestamp,received_at,original_timestamp,event,event_text,channel,context_ip,context_request_ip,context_passed_ip,group_id,previous_id).`,
|
453
|
+
);
|
454
|
+
expect(mockLogger.warn).toHaveBeenNthCalledWith(
|
455
|
+
2,
|
456
|
+
`EventManager:: The "original_timestamp" property defined under "properties" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (id,anonymous_id,user_id,sent_at,timestamp,received_at,original_timestamp,event,event_text,channel,context_ip,context_request_ip,context_passed_ip,group_id,previous_id).`,
|
457
|
+
);
|
458
|
+
expect(mockLogger.warn).toHaveBeenNthCalledWith(
|
459
|
+
3,
|
460
|
+
`EventManager:: The "original_timestamp" property defined under "traits" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (id,anonymous_id,user_id,sent_at,timestamp,received_at,original_timestamp,event,event_text,channel,context_ip,context_request_ip,context_passed_ip,group_id,previous_id).`,
|
461
|
+
);
|
462
|
+
expect(mockLogger.warn).toHaveBeenNthCalledWith(
|
463
|
+
4,
|
464
|
+
`EventManager:: The "event" property defined under "traits" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (id,anonymous_id,user_id,sent_at,timestamp,received_at,original_timestamp,event,event_text,channel,context_ip,context_request_ip,context_passed_ip,group_id,previous_id).`,
|
465
|
+
);
|
466
|
+
expect(mockLogger.warn).toHaveBeenNthCalledWith(
|
467
|
+
5,
|
468
|
+
`EventManager:: The "anonymous_id" property defined under "context.traits" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (id,anonymous_id,user_id,sent_at,timestamp,received_at,original_timestamp,event,event_text,channel,context_ip,context_request_ip,context_passed_ip,group_id,previous_id).`,
|
469
|
+
);
|
470
|
+
});
|
471
|
+
});
|
472
|
+
|
473
|
+
describe('processOptions', () => {
|
474
|
+
// @ts-ignore
|
475
|
+
const rudderEvent: RudderEvent = {
|
476
|
+
event: 'test_event',
|
477
|
+
properties: {
|
478
|
+
someKey: 'someValue',
|
479
|
+
},
|
480
|
+
anonymousId: defaultAnonId,
|
481
|
+
originalTimestamp: defaultOriginalTimestamp,
|
482
|
+
context: defaultContext,
|
483
|
+
} as RudderEvent;
|
484
|
+
|
485
|
+
it('should update event context with data from options', () => {
|
486
|
+
// Set specific contextual data in options to override
|
487
|
+
// Both top-level elements and context elements should be updated
|
488
|
+
const apiOptions = {
|
489
|
+
newContextKey1: 'newContextValue1',
|
490
|
+
originalTimestamp: '2020-01-01T00:00:00.000Z',
|
491
|
+
anonymousId: 'test_anon_id',
|
492
|
+
app: {
|
493
|
+
name: 'test1',
|
494
|
+
isNew: true,
|
495
|
+
},
|
496
|
+
context: {
|
497
|
+
campaign: {
|
498
|
+
name: 'test1',
|
499
|
+
isNew: true,
|
500
|
+
},
|
501
|
+
locale: 'en-UK',
|
502
|
+
},
|
503
|
+
};
|
504
|
+
|
505
|
+
processOptions(rudderEvent, apiOptions);
|
506
|
+
|
507
|
+
expect(rudderEvent).toEqual({
|
508
|
+
event: 'test_event',
|
509
|
+
properties: {
|
510
|
+
someKey: 'someValue',
|
511
|
+
},
|
512
|
+
anonymousId: 'test_anon_id',
|
513
|
+
originalTimestamp: '2020-01-01T00:00:00.000Z',
|
514
|
+
context: {
|
515
|
+
library: {
|
516
|
+
name: 'test',
|
517
|
+
version: '1.0',
|
518
|
+
},
|
519
|
+
locale: 'en-UK',
|
520
|
+
app: {
|
521
|
+
name: 'test1',
|
522
|
+
version: '1.0',
|
523
|
+
isNew: true,
|
524
|
+
},
|
525
|
+
campaign: {
|
526
|
+
name: 'test1',
|
527
|
+
isNew: true,
|
528
|
+
source: 'test',
|
529
|
+
},
|
530
|
+
newContextKey1: 'newContextValue1',
|
531
|
+
screen: {
|
532
|
+
width: 1920,
|
533
|
+
height: 1080,
|
534
|
+
},
|
535
|
+
'ua-ch': {
|
536
|
+
brand: 'test',
|
537
|
+
model: 'test',
|
538
|
+
},
|
539
|
+
userAgent: 'defaultUA',
|
540
|
+
},
|
541
|
+
});
|
542
|
+
});
|
543
|
+
|
544
|
+
it('should not update event if options is not a valid object', () => {
|
545
|
+
// @ts-ignore
|
546
|
+
processOptions(rudderEvent, 'test');
|
547
|
+
|
548
|
+
expect(rudderEvent).toEqual(rudderEvent);
|
549
|
+
});
|
550
|
+
|
551
|
+
it('should not update event if options is null', () => {
|
552
|
+
processOptions(rudderEvent, null);
|
553
|
+
|
554
|
+
expect(rudderEvent).toEqual(rudderEvent);
|
555
|
+
});
|
556
|
+
|
557
|
+
it('should not update event if options is undefined', () => {
|
558
|
+
processOptions(rudderEvent, undefined);
|
559
|
+
|
560
|
+
expect(rudderEvent).toEqual(rudderEvent);
|
561
|
+
});
|
562
|
+
});
|
563
|
+
|
564
|
+
describe('getContextPageProperties', () => {
|
565
|
+
let pageProperties: ApiObject;
|
566
|
+
beforeEach(() => {
|
567
|
+
pageProperties = {
|
568
|
+
path: '/test',
|
569
|
+
referrer: 'https://www.google.com/test',
|
570
|
+
search: '?test=true',
|
571
|
+
title: 'test page',
|
572
|
+
url: 'https://www.rudderlabs.com/test',
|
573
|
+
referring_domain: 'www.google.com',
|
574
|
+
tab_url: 'https://www.rudderlabs.com/test1',
|
575
|
+
initial_referrer: 'https://www.google.com/test1',
|
576
|
+
initial_referring_domain: 'www.google.com',
|
577
|
+
anonymousId: defaultAnonId,
|
578
|
+
} as ApiObject;
|
579
|
+
});
|
580
|
+
|
581
|
+
it('should return input page properties if input page properties are valid', () => {
|
582
|
+
const contextPageProperties = getContextPageProperties(pageProperties);
|
583
|
+
|
584
|
+
expect(contextPageProperties).toEqual({
|
585
|
+
path: pageProperties.path,
|
586
|
+
referrer: pageProperties.referrer,
|
587
|
+
search: pageProperties.search,
|
588
|
+
title: pageProperties.title,
|
589
|
+
url: pageProperties.url,
|
590
|
+
referring_domain: pageProperties.referring_domain,
|
591
|
+
tab_url: pageProperties.tab_url,
|
592
|
+
initial_referrer: pageProperties.initial_referrer,
|
593
|
+
initial_referring_domain: pageProperties.initial_referring_domain,
|
594
|
+
});
|
595
|
+
});
|
596
|
+
|
597
|
+
it('should return page properties from state if some input page parameters are not defined', () => {
|
598
|
+
// Reset the input page properties
|
599
|
+
pageProperties.path = undefined;
|
600
|
+
pageProperties.search = undefined;
|
601
|
+
|
602
|
+
const updatedPageProperties = getContextPageProperties(pageProperties);
|
603
|
+
|
604
|
+
expect(updatedPageProperties).toEqual({
|
605
|
+
path: '/',
|
606
|
+
referrer: pageProperties.referrer,
|
607
|
+
search: '',
|
608
|
+
title: pageProperties.title,
|
609
|
+
url: pageProperties.url,
|
610
|
+
referring_domain: pageProperties.referring_domain,
|
611
|
+
tab_url: pageProperties.tab_url,
|
612
|
+
initial_referrer: pageProperties.initial_referrer,
|
613
|
+
initial_referring_domain: pageProperties.initial_referring_domain,
|
614
|
+
});
|
615
|
+
});
|
616
|
+
});
|
617
|
+
|
618
|
+
describe('getMergedContext', () => {
|
619
|
+
it('should return context with data merged from options', () => {
|
620
|
+
// Set specific contextual data in options to override
|
621
|
+
const apiOptions = {
|
622
|
+
newContextKey1: 'newContextValue1',
|
623
|
+
app: {
|
624
|
+
name: 'test1',
|
625
|
+
isNew: true,
|
626
|
+
},
|
627
|
+
};
|
628
|
+
|
629
|
+
const mergedContext = getMergedContext(defaultContext, apiOptions);
|
630
|
+
|
631
|
+
expect(mergedContext).toEqual({
|
632
|
+
library: {
|
633
|
+
name: 'test',
|
634
|
+
version: '1.0',
|
635
|
+
},
|
636
|
+
locale: 'en-US',
|
637
|
+
app: {
|
638
|
+
name: 'test1',
|
639
|
+
isNew: true,
|
640
|
+
version: '1.0',
|
641
|
+
},
|
642
|
+
campaign: {
|
643
|
+
name: 'test',
|
644
|
+
source: 'test',
|
645
|
+
},
|
646
|
+
newContextKey1: 'newContextValue1',
|
647
|
+
screen: {
|
648
|
+
width: 1920,
|
649
|
+
height: 1080,
|
650
|
+
},
|
651
|
+
'ua-ch': {
|
652
|
+
brand: 'test',
|
653
|
+
model: 'test',
|
654
|
+
},
|
655
|
+
userAgent: 'defaultUA',
|
656
|
+
});
|
657
|
+
});
|
658
|
+
|
659
|
+
it('should return context with data the context object merged from options', () => {
|
660
|
+
// Set specific contextual data in options to override
|
661
|
+
// Moreover, directly specify the 'context' object itself
|
662
|
+
const apiOptions = {
|
663
|
+
newContextKey1: {
|
664
|
+
someKey: 'someValue',
|
665
|
+
},
|
666
|
+
context: {
|
667
|
+
campaign: {
|
668
|
+
name: 'test1',
|
669
|
+
isNew: true,
|
670
|
+
},
|
671
|
+
locale: 'en-UK',
|
672
|
+
app: {
|
673
|
+
name: 'test3',
|
674
|
+
version: '2.0',
|
675
|
+
},
|
676
|
+
},
|
677
|
+
};
|
678
|
+
|
679
|
+
const mergedContext = getMergedContext(defaultContext, apiOptions);
|
680
|
+
|
681
|
+
expect(mergedContext).toEqual({
|
682
|
+
library: {
|
683
|
+
name: 'test',
|
684
|
+
version: '1.0',
|
685
|
+
},
|
686
|
+
locale: 'en-UK',
|
687
|
+
app: {
|
688
|
+
name: 'test3',
|
689
|
+
version: '2.0',
|
690
|
+
},
|
691
|
+
campaign: {
|
692
|
+
name: 'test1',
|
693
|
+
isNew: true,
|
694
|
+
source: 'test',
|
695
|
+
},
|
696
|
+
newContextKey1: {
|
697
|
+
someKey: 'someValue',
|
698
|
+
},
|
699
|
+
screen: {
|
700
|
+
width: 1920,
|
701
|
+
height: 1080,
|
702
|
+
},
|
703
|
+
'ua-ch': {
|
704
|
+
brand: 'test',
|
705
|
+
model: 'test',
|
706
|
+
},
|
707
|
+
userAgent: 'defaultUA',
|
708
|
+
});
|
709
|
+
});
|
710
|
+
|
711
|
+
it('should skip merging into context if options contain either top-level or context reserved elements', () => {
|
712
|
+
// Set specific contextual data in options to override
|
713
|
+
// Include top-level elements and reserved elements in options and options context object
|
714
|
+
// which should be skipped
|
715
|
+
const apiOptions: ApiOptions = {
|
716
|
+
newContextKey1: 'newContextValue1',
|
717
|
+
anonymousId: 'test_anon_id',
|
718
|
+
originalTimestamp: '2020-01-01T00:00:00.000Z',
|
719
|
+
context: {
|
720
|
+
campaign: {
|
721
|
+
name: 'test1',
|
722
|
+
isNew: true,
|
723
|
+
},
|
724
|
+
locale: 'en-UK',
|
725
|
+
consentManagement: {
|
726
|
+
deniedConsentIds: ['id1', 'id2'],
|
727
|
+
},
|
728
|
+
userAgent: 'overridden ua',
|
729
|
+
screen: {
|
730
|
+
width: 100,
|
731
|
+
height: 200,
|
732
|
+
},
|
733
|
+
library: {
|
734
|
+
name: 'test1',
|
735
|
+
isNew: true,
|
736
|
+
},
|
737
|
+
'ua-ch': {},
|
738
|
+
},
|
739
|
+
};
|
740
|
+
|
741
|
+
const mergedContext = getMergedContext(defaultContext, apiOptions);
|
742
|
+
|
743
|
+
expect(mergedContext).toEqual({
|
744
|
+
library: {
|
745
|
+
name: 'test',
|
746
|
+
version: '1.0',
|
747
|
+
},
|
748
|
+
newContextKey1: 'newContextValue1',
|
749
|
+
locale: 'en-UK',
|
750
|
+
app: {
|
751
|
+
name: 'test',
|
752
|
+
version: '1.0',
|
753
|
+
},
|
754
|
+
campaign: {
|
755
|
+
name: 'test1',
|
756
|
+
isNew: true,
|
757
|
+
source: 'test',
|
758
|
+
},
|
759
|
+
screen: {
|
760
|
+
width: 1920,
|
761
|
+
height: 1080,
|
762
|
+
},
|
763
|
+
'ua-ch': {
|
764
|
+
brand: 'test',
|
765
|
+
model: 'test',
|
766
|
+
},
|
767
|
+
userAgent: 'defaultUA',
|
768
|
+
});
|
769
|
+
});
|
770
|
+
|
771
|
+
it('should log warning if the context inside the options is not a valid object', () => {
|
772
|
+
// Set specific contextual data in options to override
|
773
|
+
// Set the 'context' object to be a string
|
774
|
+
const apiOptions = {
|
775
|
+
newContextKey1: 'newContextValue1',
|
776
|
+
newContextKey2: 'newContextValue2',
|
777
|
+
context: 'test',
|
778
|
+
};
|
779
|
+
|
780
|
+
const mergedContext = getMergedContext(defaultContext, apiOptions, mockLogger);
|
781
|
+
|
782
|
+
expect(mergedContext).toEqual({
|
783
|
+
library: {
|
784
|
+
name: 'test',
|
785
|
+
version: '1.0',
|
786
|
+
},
|
787
|
+
locale: 'en-US',
|
788
|
+
app: {
|
789
|
+
name: 'test',
|
790
|
+
version: '1.0',
|
791
|
+
},
|
792
|
+
campaign: {
|
793
|
+
name: 'test',
|
794
|
+
source: 'test',
|
795
|
+
},
|
796
|
+
newContextKey1: 'newContextValue1',
|
797
|
+
newContextKey2: 'newContextValue2',
|
798
|
+
screen: {
|
799
|
+
width: 1920,
|
800
|
+
height: 1080,
|
801
|
+
},
|
802
|
+
'ua-ch': {
|
803
|
+
brand: 'test',
|
804
|
+
model: 'test',
|
805
|
+
},
|
806
|
+
userAgent: 'defaultUA',
|
807
|
+
});
|
808
|
+
expect(mockLogger.warn).toHaveBeenCalledWith(
|
809
|
+
`EventManager:: Please make sure that the \"context\" property in the event API's \"options\" argument is a valid object literal with key-value pairs.`,
|
810
|
+
);
|
811
|
+
});
|
812
|
+
|
813
|
+
it('should log warning if the context inside the options is null', () => {
|
814
|
+
// Set specific contextual data in options to override
|
815
|
+
// Set the 'context' object to be a null
|
816
|
+
const apiOptions: ApiOptions = {
|
817
|
+
newContextKey1: 'newContextValue1',
|
818
|
+
context: null,
|
819
|
+
};
|
820
|
+
|
821
|
+
const mergedContext = getMergedContext(defaultContext, apiOptions, mockLogger);
|
822
|
+
|
823
|
+
expect(mergedContext).toEqual({
|
824
|
+
library: {
|
825
|
+
name: 'test',
|
826
|
+
version: '1.0',
|
827
|
+
},
|
828
|
+
locale: 'en-US',
|
829
|
+
app: {
|
830
|
+
name: 'test',
|
831
|
+
version: '1.0',
|
832
|
+
},
|
833
|
+
campaign: {
|
834
|
+
name: 'test',
|
835
|
+
source: 'test',
|
836
|
+
},
|
837
|
+
newContextKey1: 'newContextValue1',
|
838
|
+
screen: {
|
839
|
+
width: 1920,
|
840
|
+
height: 1080,
|
841
|
+
},
|
842
|
+
'ua-ch': {
|
843
|
+
brand: 'test',
|
844
|
+
model: 'test',
|
845
|
+
},
|
846
|
+
userAgent: 'defaultUA',
|
847
|
+
});
|
848
|
+
expect(mockLogger.warn).toHaveBeenCalledWith(
|
849
|
+
`EventManager:: Please make sure that the \"context\" property in the event API's \"options\" argument is a valid object literal with key-value pairs.`,
|
850
|
+
);
|
851
|
+
});
|
852
|
+
|
853
|
+
it('should log warning if the context inside the options is undefined', () => {
|
854
|
+
// Set specific contextual data in options to override
|
855
|
+
// Set the 'context' object to be undefined
|
856
|
+
const apiOptions = {
|
857
|
+
newContextKey1: 'newContextValue1',
|
858
|
+
context: undefined,
|
859
|
+
};
|
860
|
+
|
861
|
+
const mergedContext = getMergedContext(defaultContext, apiOptions, mockLogger);
|
862
|
+
|
863
|
+
expect(mergedContext).toEqual({
|
864
|
+
library: {
|
865
|
+
name: 'test',
|
866
|
+
version: '1.0',
|
867
|
+
},
|
868
|
+
locale: 'en-US',
|
869
|
+
app: {
|
870
|
+
name: 'test',
|
871
|
+
version: '1.0',
|
872
|
+
},
|
873
|
+
campaign: {
|
874
|
+
name: 'test',
|
875
|
+
source: 'test',
|
876
|
+
},
|
877
|
+
newContextKey1: 'newContextValue1',
|
878
|
+
screen: {
|
879
|
+
width: 1920,
|
880
|
+
height: 1080,
|
881
|
+
},
|
882
|
+
'ua-ch': {
|
883
|
+
brand: 'test',
|
884
|
+
model: 'test',
|
885
|
+
},
|
886
|
+
userAgent: 'defaultUA',
|
887
|
+
});
|
888
|
+
expect(mockLogger.warn).toHaveBeenCalledWith(
|
889
|
+
`EventManager:: Please make sure that the \"context\" property in the event API's \"options\" argument is a valid object literal with key-value pairs.`,
|
890
|
+
);
|
891
|
+
});
|
892
|
+
});
|
893
|
+
|
894
|
+
describe('updateTopLevelEventElements', () => {
|
895
|
+
const rudderEvent: RudderEvent = {} as RudderEvent;
|
896
|
+
|
897
|
+
beforeEach(() => {
|
898
|
+
rudderEvent.anonymousId = defaultAnonId;
|
899
|
+
rudderEvent.integrations = R.clone(defaultIntegrations);
|
900
|
+
rudderEvent.originalTimestamp = defaultOriginalTimestamp;
|
901
|
+
});
|
902
|
+
|
903
|
+
it('should update top level event elements from options', () => {
|
904
|
+
const apiOptions: ApiOptions = {
|
905
|
+
anonymousId: sampleAnonId,
|
906
|
+
integrations: R.clone(sampleIntegrations),
|
907
|
+
originalTimestamp: sampleOriginalTimestamp,
|
908
|
+
};
|
909
|
+
updateTopLevelEventElements(rudderEvent, apiOptions);
|
910
|
+
expect(rudderEvent.anonymousId).toEqual(apiOptions.anonymousId);
|
911
|
+
expect(rudderEvent.integrations).toEqual(apiOptions.integrations);
|
912
|
+
expect(rudderEvent.originalTimestamp).toEqual(apiOptions.originalTimestamp);
|
913
|
+
});
|
914
|
+
|
915
|
+
it('should not update the top level event elements from options that are not valid', () => {
|
916
|
+
const apiOptions: ApiOptions = {
|
917
|
+
integrations: sampleIntegrations,
|
918
|
+
};
|
919
|
+
|
920
|
+
updateTopLevelEventElements(rudderEvent, apiOptions);
|
921
|
+
expect(rudderEvent.anonymousId).toEqual(defaultAnonId);
|
922
|
+
expect(rudderEvent.integrations).toEqual(apiOptions.integrations);
|
923
|
+
expect(rudderEvent.originalTimestamp).toEqual(defaultOriginalTimestamp);
|
924
|
+
});
|
925
|
+
|
926
|
+
it('should not update the top level event elements from options that are not valid type', () => {
|
927
|
+
// Intentionally use invalid types to test the type check
|
928
|
+
// @ts-ignore
|
929
|
+
const apiOptions = {
|
930
|
+
anonymousId: 123,
|
931
|
+
integrations: 'sample-integrations',
|
932
|
+
originalTimestamp: {},
|
933
|
+
} as ApiOptions;
|
934
|
+
|
935
|
+
updateTopLevelEventElements(rudderEvent, apiOptions);
|
936
|
+
expect(rudderEvent.anonymousId).toEqual(defaultAnonId);
|
937
|
+
expect(rudderEvent.integrations).toEqual(defaultIntegrations);
|
938
|
+
expect(rudderEvent.originalTimestamp).toEqual(defaultOriginalTimestamp);
|
939
|
+
});
|
940
|
+
});
|
941
|
+
|
942
|
+
describe('getEnrichedEvent', () => {
|
943
|
+
const pageProperties: ApiObject = {
|
944
|
+
path: '/test',
|
945
|
+
referrer: 'https://www.google.com/test',
|
946
|
+
search: '?test=true',
|
947
|
+
title: 'test page',
|
948
|
+
url: 'https://www.rudderlabs.com/test',
|
949
|
+
referring_domain: 'www.google.com',
|
950
|
+
tab_url: 'https://www.rudderlabs.com/test1',
|
951
|
+
initial_referrer: 'https://www.google.com/test1',
|
952
|
+
initial_referring_domain: 'www.google.com',
|
953
|
+
} as ApiObject;
|
954
|
+
|
955
|
+
beforeEach(() => {
|
956
|
+
resetApplicationState();
|
957
|
+
});
|
958
|
+
|
959
|
+
it('should return common event data using the data in state', () => {
|
960
|
+
batch(() => {
|
961
|
+
state.session.anonymousId.value = 'anon_id';
|
962
|
+
state.session.userTraits.value = { test: 'test' };
|
963
|
+
state.session.userId.value = 'user_id';
|
964
|
+
state.session.sessionInfo.value = { sessionStart: true, id: 1234 } as SessionInfo;
|
965
|
+
state.session.initialReferrer.value = 'initial_referrer';
|
966
|
+
state.session.initialReferringDomain.value = 'initial_referring_domain';
|
967
|
+
|
968
|
+
state.consents.data.value.deniedConsentIds = ['id1', 'id2'];
|
969
|
+
|
970
|
+
state.context['ua-ch'].value = { mobile: true } as UADataValues;
|
971
|
+
state.context.app.value = { name: 'test', version: '1.0' } as AppInfo;
|
972
|
+
state.context.library.value = { name: 'test', version: '1.0' } as LibraryInfo;
|
973
|
+
state.context.locale.value = 'en-US';
|
974
|
+
state.context.userAgent.value = 'test';
|
975
|
+
state.context.screen.value = { width: 100, height: 100 } as ScreenInfo;
|
976
|
+
state.context.os.value = { name: 'test', version: '1.0' } as OSInfo;
|
977
|
+
state.context.timezone.value = 'GMT+0530';
|
978
|
+
});
|
979
|
+
|
980
|
+
const rudderEvent = {
|
981
|
+
type: 'track',
|
982
|
+
event: 'test_event',
|
983
|
+
} as RudderEvent;
|
984
|
+
|
985
|
+
const options = {
|
986
|
+
anonymousId: 'modified_anon_id',
|
987
|
+
};
|
988
|
+
|
989
|
+
const enrichedEvent = getEnrichedEvent(rudderEvent, options, pageProperties);
|
990
|
+
|
991
|
+
expect(enrichedEvent).toEqual({
|
992
|
+
event: 'test_event',
|
993
|
+
type: 'track',
|
994
|
+
anonymousId: 'modified_anon_id',
|
995
|
+
channel: 'web',
|
996
|
+
context: {
|
997
|
+
page: {
|
998
|
+
path: pageProperties.path,
|
999
|
+
referrer: pageProperties.referrer,
|
1000
|
+
search: pageProperties.search,
|
1001
|
+
title: pageProperties.title,
|
1002
|
+
url: pageProperties.url,
|
1003
|
+
referring_domain: pageProperties.referring_domain,
|
1004
|
+
tab_url: pageProperties.tab_url,
|
1005
|
+
initial_referrer: pageProperties.initial_referrer,
|
1006
|
+
initial_referring_domain: pageProperties.initial_referring_domain,
|
1007
|
+
},
|
1008
|
+
traits: { test: 'test' },
|
1009
|
+
sessionId: 1234,
|
1010
|
+
sessionStart: true,
|
1011
|
+
campaign: {},
|
1012
|
+
library: {
|
1013
|
+
name: 'test',
|
1014
|
+
version: '1.0',
|
1015
|
+
},
|
1016
|
+
locale: 'en-US',
|
1017
|
+
userAgent: 'test',
|
1018
|
+
screen: {
|
1019
|
+
height: 100,
|
1020
|
+
width: 100,
|
1021
|
+
},
|
1022
|
+
os: {
|
1023
|
+
name: 'test',
|
1024
|
+
version: '1.0',
|
1025
|
+
},
|
1026
|
+
app: {
|
1027
|
+
name: 'test',
|
1028
|
+
version: '1.0',
|
1029
|
+
},
|
1030
|
+
'ua-ch': {
|
1031
|
+
mobile: true,
|
1032
|
+
},
|
1033
|
+
timezone: 'GMT+0530',
|
1034
|
+
},
|
1035
|
+
properties: null,
|
1036
|
+
originalTimestamp: '2020-01-01T00:00:00.000Z',
|
1037
|
+
integrations: { All: true },
|
1038
|
+
messageId: 'test_uuid',
|
1039
|
+
userId: 'user_id',
|
1040
|
+
});
|
1041
|
+
});
|
1042
|
+
});
|
1043
|
+
});
|