feat(cdp): fetch segment destinations (#34404)

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Marcus Hof
2025-07-01 14:30:47 +02:00
committed by GitHub
parent 0d16c5a578
commit 5511f06a11
62 changed files with 139 additions and 232 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -30,7 +30,8 @@
"services:clean": "cd .. && docker compose -f docker-compose.dev.yml rm -v",
"services": "pnpm services:stop && pnpm services:clean && pnpm services:start",
"build:cyclotron": "pnpm --filter=@posthog/cyclotron package",
"update-ai-costs": "ts-node src/ingestion/ai-costs/scripts/update-ai-costs.ts"
"update-ai-costs": "ts-node src/ingestion/ai-costs/scripts/update-ai-costs.ts",
"sync-segment-icons": "DATABASE_URL=something ts-node src/cdp/segment/sync-segment-icons.ts"
},
"bin": {
"posthog-plugin-server": "bin/posthog-plugin-server"
@@ -153,7 +154,8 @@
"prettier": "^2.8.8",
"supertest": "^7.0.0",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.16"
"tsc-alias": "^1.8.16",
"tsconfig-paths": "^4.2.0"
},
"cyclotron": {
"//This is a short term workaround to ensure that cyclotron changes trigger a rebuild": true,

View File

@@ -6,7 +6,7 @@ exports[`segment templates template segment-actions-absmartly matches expected r
"description": "Send event data to ABsmartly",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=absmartly.com",
"icon_url": "/static/services/absmartly.com",
"id": "segment-actions-absmartly",
"inputs_schema": [
{
@@ -360,7 +360,7 @@ exports[`segment templates template segment-actions-accoil-analytics matches exp
"description": "Send event data to Accoil Analytics",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=accoil.com",
"icon_url": "/static/services/accoil.com",
"id": "segment-actions-accoil-analytics",
"inputs_schema": [
{
@@ -806,7 +806,7 @@ exports[`segment templates template segment-actions-acoustic matches expected re
"description": "Send event data to Acoustic",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=acoustic.com",
"icon_url": "/static/services/acoustic.com",
"id": "segment-actions-acoustic",
"inputs_schema": [
{
@@ -1099,7 +1099,7 @@ exports[`segment templates template segment-actions-acoustic-campaign matches ex
"description": "Send event data to Acoustic Campaign",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=acoustic.com",
"icon_url": "/static/services/acoustic.com",
"id": "segment-actions-acoustic-campaign",
"inputs_schema": [
{
@@ -1435,7 +1435,7 @@ exports[`segment templates template segment-actions-airship matches expected res
"description": "Send event data to Airship",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=airship.com",
"icon_url": "/static/services/airship.com",
"id": "segment-actions-airship",
"inputs_schema": [
{
@@ -1652,7 +1652,7 @@ exports[`segment templates template segment-actions-algolia-insights matches exp
"description": "Send event data to Algolia Insights",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=algolia.com",
"icon_url": "/static/services/algolia.com",
"id": "segment-actions-algolia-insights",
"inputs_schema": [
{
@@ -2383,7 +2383,7 @@ exports[`segment templates template segment-actions-amplitude matches expected r
"description": "Send event data to Amplitude",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=amplitude.com",
"icon_url": "/static/services/amplitude.com",
"id": "segment-actions-amplitude",
"inputs_schema": [
{
@@ -4569,7 +4569,7 @@ exports[`segment templates template segment-actions-angler-ai matches expected r
"description": "Send event data to Angler AI",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=getangler.ai",
"icon_url": "/static/services/getangler.ai",
"id": "segment-actions-angler-ai",
"inputs_schema": [
{
@@ -7905,7 +7905,7 @@ exports[`segment templates template segment-actions-attentive matches expected r
"description": "Send event data to Attentive",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=attentive.com",
"icon_url": "/static/services/attentive.com",
"id": "segment-actions-attentive",
"inputs_schema": [
{
@@ -8023,7 +8023,7 @@ exports[`segment templates template segment-actions-blend-ai matches expected re
"description": "Send event data to Blend Ai",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=blend.com",
"icon_url": "/static/services/blend.com",
"id": "segment-actions-blend-ai",
"inputs_schema": [
{
@@ -8140,7 +8140,7 @@ exports[`segment templates template segment-actions-canny matches expected resul
"description": "Send event data to Canny",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=canny.io",
"icon_url": "/static/services/canny.io",
"id": "segment-actions-canny",
"inputs_schema": [
{
@@ -8312,7 +8312,7 @@ exports[`segment templates template segment-actions-canvas matches expected resu
"description": "Send event data to Canvas",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=supernova.ai",
"icon_url": "/static/services/supernova.ai",
"id": "segment-actions-canvas",
"inputs_schema": [
{
@@ -8927,7 +8927,7 @@ exports[`segment templates template segment-actions-clevertap matches expected r
"description": "Send event data to CleverTap",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=clevertap.com",
"icon_url": "/static/services/clevertap.com",
"id": "segment-actions-clevertap",
"inputs_schema": [
{
@@ -9105,7 +9105,7 @@ exports[`segment templates template segment-actions-cloud-gwen matches expected
"description": "Send event data to GWEN",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=gwenplatform.com",
"icon_url": "/static/services/gwenplatform.com",
"id": "segment-actions-cloud-gwen",
"inputs_schema": [
{
@@ -9261,7 +9261,7 @@ exports[`segment templates template segment-actions-drip matches expected result
"description": "Send event data to Drip",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=drip.com",
"icon_url": "/static/services/drip.com",
"id": "segment-actions-drip",
"inputs_schema": [
{
@@ -9482,7 +9482,7 @@ exports[`segment templates template segment-actions-fullstory-cloud matches expe
"description": "Send event data to Fullstory Cloud Mode",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=fullstory.com",
"icon_url": "/static/services/fullstory.com",
"id": "segment-actions-fullstory-cloud",
"inputs_schema": [
{
@@ -9685,7 +9685,7 @@ exports[`segment templates template segment-actions-gameball matches expected re
"description": "Send event data to Gameball",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=gameball.co",
"icon_url": "/static/services/gameball.co",
"id": "segment-actions-gameball",
"inputs_schema": [
{
@@ -10283,7 +10283,7 @@ exports[`segment templates template segment-actions-hilo matches expected result
"description": "Send event data to Hilo",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=hilo.com",
"icon_url": "/static/services/hilo.com",
"id": "segment-actions-hilo",
"inputs_schema": [
{
@@ -10708,7 +10708,7 @@ exports[`segment templates template segment-actions-hyperengage matches expected
"description": "Send event data to Hyperengage",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=hyperengage.io",
"icon_url": "/static/services/hyperengage.io",
"id": "segment-actions-hyperengage",
"inputs_schema": [
{
@@ -11444,7 +11444,7 @@ exports[`segment templates template segment-actions-insider-cloud matches expect
"description": "Send event data to Insider Cloud Mode",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=insider.com",
"icon_url": "/static/services/insider.com",
"id": "segment-actions-insider-cloud",
"inputs_schema": [
{
@@ -11709,7 +11709,7 @@ exports[`segment templates template segment-actions-iterable matches expected re
"description": "Send event data to Iterable",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=iterable.com",
"icon_url": "/static/services/iterable.com",
"id": "segment-actions-iterable",
"inputs_schema": [
{
@@ -12119,7 +12119,7 @@ exports[`segment templates template segment-actions-kameleoon matches expected r
"description": "Send event data to Kameleoon",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=kameleoon.com",
"icon_url": "/static/services/kameleoon.com",
"id": "segment-actions-kameleoon",
"inputs_schema": [
{
@@ -12601,7 +12601,7 @@ exports[`segment templates template segment-actions-koala-cloud matches expected
"description": "Send event data to Koala (Cloud)",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=koala.com",
"icon_url": "/static/services/koala.com",
"id": "segment-actions-koala-cloud",
"inputs_schema": [
{
@@ -12837,7 +12837,7 @@ exports[`segment templates template segment-actions-launchdarkly matches expecte
"description": "Send event data to LaunchDarkly",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=launchdarkly.com",
"icon_url": "/static/services/launchdarkly.com",
"id": "segment-actions-launchdarkly",
"inputs_schema": [
{
@@ -13038,7 +13038,7 @@ exports[`segment templates template segment-actions-launchpad matches expected r
"description": "Send event data to Launchpad",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=launchpad.com",
"icon_url": "/static/services/launchpad.com",
"id": "segment-actions-launchpad",
"inputs_schema": [
{
@@ -13605,7 +13605,7 @@ exports[`segment templates template segment-actions-livelike-cloud matches expec
"description": "Send event data to LiveLike",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=livelike.com",
"icon_url": "/static/services/livelike.com",
"id": "segment-actions-livelike-cloud",
"inputs_schema": [
{
@@ -13969,7 +13969,7 @@ exports[`segment templates template segment-actions-m3ter matches expected resul
"description": "Send event data to m3ter",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=m3ter.com",
"icon_url": "/static/services/m3ter.com",
"id": "segment-actions-m3ter",
"inputs_schema": [
{
@@ -14171,7 +14171,7 @@ exports[`segment templates template segment-actions-mixpanel matches expected re
"description": "Send event data to Mixpanel",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=mixpanel.com",
"icon_url": "/static/services/mixpanel.com",
"id": "segment-actions-mixpanel",
"inputs_schema": [
{
@@ -16208,7 +16208,7 @@ exports[`segment templates template segment-actions-moloco-rmp matches expected
"description": "Send event data to Moloco MCM",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=moloco.com",
"icon_url": "/static/services/moloco.com",
"id": "segment-actions-moloco-rmp",
"inputs_schema": [
{
@@ -18119,7 +18119,7 @@ exports[`segment templates template segment-actions-optimizely-data-platform mat
"description": "Send event data to Optimizely Data Platform",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=optimizely.com",
"icon_url": "/static/services/optimizely.com",
"id": "segment-actions-optimizely-data-platform",
"inputs_schema": [
{
@@ -19058,7 +19058,7 @@ exports[`segment templates template segment-actions-pinterest-conversions-api ma
"description": "Send event data to Pinterest Conversions API",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=pinterest.com",
"icon_url": "/static/services/pinterest.com",
"id": "segment-actions-pinterest-conversions-api",
"inputs_schema": [
{
@@ -21317,7 +21317,7 @@ exports[`segment templates template segment-actions-pipedrive matches expected r
"description": "Send event data to Pipedrive",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=pipedrive.com",
"icon_url": "/static/services/pipedrive.com",
"id": "segment-actions-pipedrive",
"inputs_schema": [
{
@@ -21783,7 +21783,7 @@ exports[`segment templates template segment-actions-playerzero-cloud matches exp
"description": "Send event data to PlayerZero Cloud",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=playerzero.ai",
"icon_url": "/static/services/playerzero.ai",
"id": "segment-actions-playerzero-cloud",
"inputs_schema": [
{
@@ -21883,7 +21883,7 @@ exports[`segment templates template segment-actions-podscribe matches expected r
"description": "Send event data to Podscribe",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=podscribe.com",
"icon_url": "/static/services/podscribe.com",
"id": "segment-actions-podscribe",
"inputs_schema": [
{
@@ -22290,7 +22290,7 @@ exports[`segment templates template segment-actions-prodeology matches expected
"description": "Send event data to Prodeology",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=prodeology.com",
"icon_url": "/static/services/prodeology.com",
"id": "segment-actions-prodeology",
"inputs_schema": [
{
@@ -22693,7 +22693,7 @@ exports[`segment templates template segment-actions-pushwoosh matches expected r
"description": "Send event data to Pushwoosh",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=pushwoosh.com",
"icon_url": "/static/services/pushwoosh.com",
"id": "segment-actions-pushwoosh",
"inputs_schema": [
{
@@ -22998,7 +22998,7 @@ exports[`segment templates template segment-actions-recombee matches expected re
"description": "Send event data to Recombee",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=recombee.com",
"icon_url": "/static/services/recombee.com",
"id": "segment-actions-recombee",
"inputs_schema": [
{
@@ -24219,7 +24219,7 @@ exports[`segment templates template segment-actions-revx matches expected result
"description": "Send event data to RevX Cloud",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=revx.io",
"icon_url": "/static/services/revx.io",
"id": "segment-actions-revx",
"inputs_schema": [
{
@@ -24519,7 +24519,7 @@ exports[`segment templates template segment-actions-ripe-cloud matches expected
"description": "Send event data to Ripe Cloud Mode",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=ripe.com",
"icon_url": "/static/services/ripe.com",
"id": "segment-actions-ripe-cloud",
"inputs_schema": [
{
@@ -24998,7 +24998,7 @@ exports[`segment templates template segment-actions-saleswings matches expected
"description": "Send event data to Saleswings",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=saleswingsapp.com",
"icon_url": "/static/services/saleswingsapp.com",
"id": "segment-actions-saleswings",
"inputs_schema": [
{
@@ -25513,7 +25513,7 @@ exports[`segment templates template segment-actions-schematic matches expected r
"description": "Send event data to Schematic",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=schematichq.com",
"icon_url": "/static/services/schematichq.com",
"id": "segment-actions-schematic",
"inputs_schema": [
{
@@ -25723,7 +25723,7 @@ exports[`segment templates template segment-actions-sprig matches expected resul
"description": "Send event data to Sprig Cloud",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=sprig.com",
"icon_url": "/static/services/sprig.com",
"id": "segment-actions-sprig",
"inputs_schema": [
{
@@ -25930,7 +25930,7 @@ exports[`segment templates template segment-actions-stackadapt-cloud matches exp
"description": "Send event data to StackAdapt",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=stackadapt.com",
"icon_url": "/static/services/stackadapt.com",
"id": "segment-actions-stackadapt-cloud",
"inputs_schema": [
{
@@ -26140,7 +26140,7 @@ exports[`segment templates template segment-actions-topsort matches expected res
"description": "Send event data to Topsort",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=topsort.com",
"icon_url": "/static/services/topsort.com",
"id": "segment-actions-topsort",
"inputs_schema": [
{
@@ -26563,7 +26563,7 @@ exports[`segment templates template segment-actions-usermaven matches expected r
"description": "Send event data to Usermaven",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=usermaven.com",
"icon_url": "/static/services/usermaven.com",
"id": "segment-actions-usermaven",
"inputs_schema": [
{
@@ -27504,7 +27504,7 @@ exports[`segment templates template segment-actions-usermotion matches expected
"description": "Send event data to UserMotion",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=usermotion.com",
"icon_url": "/static/services/usermotion.com",
"id": "segment-actions-usermotion",
"inputs_schema": [
{
@@ -27762,7 +27762,7 @@ exports[`segment templates template segment-actions-userpilot-cloud matches expe
"description": "Send event data to Userpilot Cloud",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=userpilot.com",
"icon_url": "/static/services/userpilot.com",
"id": "segment-actions-userpilot-cloud",
"inputs_schema": [
{
@@ -27991,7 +27991,7 @@ exports[`segment templates template segment-actions-voyage matches expected resu
"description": "Send event data to Voyage",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=voyagesms.com",
"icon_url": "/static/services/voyagesms.com",
"id": "segment-actions-voyage",
"inputs_schema": [
{
@@ -28211,7 +28211,7 @@ exports[`segment templates template segment-actions-vwo-cloud matches expected r
"description": "Send event data to VWO Cloud Mode",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=vwo.com",
"icon_url": "/static/services/vwo.com",
"id": "segment-actions-vwo-cloud",
"inputs_schema": [
{
@@ -28626,7 +28626,7 @@ exports[`segment templates template segment-actions-xtremepush matches expected
"description": "Send event data to Xtremepush",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=xtremepush.com",
"icon_url": "/static/services/xtremepush.com",
"id": "segment-actions-xtremepush",
"inputs_schema": [
{
@@ -28848,7 +28848,7 @@ exports[`segment templates template segment-calliper-cloud-actions matches expec
"description": "Send event data to Calliper Cloud",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=cloud.com",
"icon_url": "/static/services/cloud.com",
"id": "segment-calliper-cloud-actions",
"inputs_schema": [
{
@@ -29365,7 +29365,7 @@ exports[`segment templates template segment-encharge-cloud-actions matches expec
"description": "Send event data to Encharge",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=encharge.io",
"icon_url": "/static/services/encharge.io",
"id": "segment-encharge-cloud-actions",
"inputs_schema": [
{
@@ -30092,7 +30092,7 @@ exports[`segment templates template segment-inleads-ai matches expected result 1
"description": "Send event data to Inleads AI",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=inleads.ai",
"icon_url": "/static/services/inleads.ai",
"id": "segment-inleads-ai",
"inputs_schema": [
{
@@ -30770,7 +30770,7 @@ exports[`segment templates template segment-metronome-actions matches expected r
"description": "Send event data to Metronome",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=metronome.com",
"icon_url": "/static/services/metronome.com",
"id": "segment-metronome-actions",
"inputs_schema": [
{
@@ -30884,7 +30884,7 @@ exports[`segment templates template segment-outfunnel matches expected result 1`
"description": "Send event data to Outfunnel",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=outfunnel.com",
"icon_url": "/static/services/outfunnel.com",
"id": "segment-outfunnel",
"inputs_schema": [
{
@@ -31254,7 +31254,7 @@ exports[`segment templates template segment-voucherify-actions matches expected
"description": "Send event data to Voucherify",
"free": false,
"hog": "return event",
"icon_url": "/api/environments/@current/hog_functions/icon/?id=voucherify.io",
"icon_url": "/static/services/voucherify.io",
"id": "segment-voucherify-actions",
"inputs_schema": [
{

View File

@@ -1,8 +1,9 @@
import * as fs from 'fs'
import * as path from 'path'
import { SEGMENT_DESTINATIONS } from './segment-templates'
const destinationEntries = Object.entries(SEGMENT_DESTINATIONS).filter(([_, destination]) => destination.template)
const testCases = destinationEntries.map(([_, destination]) => ({
const testCases = SEGMENT_DESTINATIONS.filter((destination) => destination.template).map((destination) => ({
id: destination.template?.id,
destination,
}))
@@ -11,4 +12,34 @@ describe('segment templates', () => {
test.each(testCases)('template $id matches expected result', ({ destination }) => {
expect(destination.template).toMatchSnapshot()
})
test.each(testCases)('icon for template $id exists in frontend/public/services/', ({ destination }) => {
const servicesDir = path.join(__dirname, '../../../.././frontend/public/services')
if (!fs.existsSync(servicesDir)) {
throw new Error(`Services directory not found: ${servicesDir}`)
}
const existingFiles = fs.readdirSync(servicesDir)
const existingIcons = new Set(existingFiles.map((file) => file.toLowerCase()))
const template = destination.template
if (!template) {
return
}
const iconUrl = template.icon_url
if (!iconUrl || iconUrl === '/static/posthog-icon.svg') {
return
}
const iconId = iconUrl.replace('/static/services/', '')
const iconExists = existingIcons.has(`${iconId}.png`.toLowerCase())
if (!iconExists) {
throw new Error(`Missing icon: ${iconId} for template ${template.id}`)
}
})
})

View File

@@ -402,7 +402,7 @@ const getIconUrl = (id: string, slug: string | undefined) => {
return '/static/posthog-icon.svg'
}
return `/api/environments/@current/hog_functions/icon/?id=${
return `/static/services/${
id in icon_overrides ? icon_overrides[id as keyof typeof icon_overrides] : `${slug}.com`
}`
}

View File

@@ -0,0 +1,22 @@
import { mkdirSync, writeFileSync } from 'fs'
import { join } from 'path'
import { SEGMENT_DESTINATIONS } from './segment-templates'
// Script to store the segment icons in the static folder
void SEGMENT_DESTINATIONS.map(async ({ template }) => {
const iconId = template.icon_url?.replace('/static/services/', '')
const res = await fetch(`https://img.logo.dev/${iconId}?token=${process.env.LOGO_DEV_TOKEN}`)
const buffer = await res.arrayBuffer()
// Ensure directory exists
const servicesDir = join(process.cwd(), '..', 'frontend', 'public', 'services')
mkdirSync(servicesDir, { recursive: true })
// Save image with iconId as filename and .png extension
const filePath = join(servicesDir, `${iconId}.png`)
writeFileSync(filePath, new Uint8Array(buffer))
console.log(`Saved ${iconId}.png to ${filePath}`)
})

View File

@@ -23,5 +23,8 @@
"skipLibCheck": true
},
"include": ["src", "tests"],
"exclude": ["node_modules", "dist", "bin"]
"exclude": ["node_modules", "dist", "bin"],
"ts-node": {
"require": ["tsconfig-paths/register"]
}
}

187
pnpm-lock.yaml generated
View File

@@ -1561,6 +1561,9 @@ importers:
tsc-alias:
specifier: ^1.8.16
version: 1.8.16
tsconfig-paths:
specifier: ^4.2.0
version: 4.2.0
products/actions:
dependencies:
@@ -1902,7 +1905,7 @@ importers:
version: 8.57.0
jest:
specifier: '*'
version: 29.7.0(@types/node@22.15.17)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2))
version: 29.7.0(@types/node@18.18.4)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@18.18.4)(typescript@5.2.2))
kea:
specifier: '*'
version: 3.1.5(react@18.2.0)
@@ -1956,7 +1959,7 @@ importers:
version: 3.1.3
jest:
specifier: '*'
version: 29.7.0(@types/node@22.15.17)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2))
version: 29.7.0(@types/node@18.18.4)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@18.18.4)(typescript@5.2.2))
kea:
specifier: '*'
version: 3.1.5(react@18.2.0)
@@ -16301,6 +16304,10 @@ packages:
tsconfig-paths@3.14.2:
resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==}
tsconfig-paths@4.2.0:
resolution: {integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==}
engines: {node: '>=6'}
tslib@1.14.1:
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
@@ -19806,41 +19813,6 @@ snapshots:
- supports-color
- ts-node
'@jest/core@29.7.0(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2))':
dependencies:
'@jest/console': 29.7.0
'@jest/reporters': 29.7.0
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 18.18.4
ansi-escapes: 4.3.2
chalk: 4.1.2
ci-info: 3.8.0
exit: 0.1.2
graceful-fs: 4.2.11
jest-changed-files: 29.7.0
jest-config: 29.7.0(@types/node@18.18.4)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2))
jest-haste-map: 29.7.0
jest-message-util: 29.7.0
jest-regex-util: 29.6.3
jest-resolve: 29.7.0
jest-resolve-dependencies: 29.7.0
jest-runner: 29.7.0
jest-runtime: 29.7.0
jest-snapshot: 29.7.0
jest-util: 29.7.0
jest-validate: 29.7.0
jest-watcher: 29.7.0
micromatch: 4.0.8
pretty-format: 29.7.0
slash: 3.0.0
strip-ansi: 6.0.1
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
- ts-node
'@jest/create-cache-key-function@29.7.0':
dependencies:
'@jest/types': 29.6.3
@@ -23579,7 +23551,7 @@ snapshots:
commander: 9.4.1
expect-playwright: 0.8.0
glob: 10.4.5
jest: 29.7.0(@types/node@18.18.4)(ts-node@10.9.1(@swc/core@1.10.14(@swc/helpers@0.5.15))(@types/node@18.18.4)(typescript@5.2.2))
jest: 29.7.0(@types/node@18.18.4)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@18.18.4)(typescript@5.2.2))
jest-circus: 29.7.0
jest-environment-node: 29.7.0
jest-junit: 16.0.0
@@ -26574,21 +26546,6 @@ snapshots:
- supports-color
- ts-node
create-jest@29.7.0(@types/node@22.15.17)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2)):
dependencies:
'@jest/types': 29.6.3
chalk: 4.1.2
exit: 0.1.2
graceful-fs: 4.2.11
jest-config: 29.7.0(@types/node@22.15.17)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2))
jest-util: 29.7.0
prompts: 2.4.2
transitivePeerDependencies:
- '@types/node'
- babel-plugin-macros
- supports-color
- ts-node
create-require@1.1.1: {}
crelt@1.0.5: {}
@@ -29693,25 +29650,6 @@ snapshots:
- supports-color
- ts-node
jest-cli@29.7.0(@types/node@22.15.17)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2)):
dependencies:
'@jest/core': 29.7.0(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2))
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
chalk: 4.1.2
create-jest: 29.7.0(@types/node@22.15.17)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2))
exit: 0.1.2
import-local: 3.1.0
jest-config: 29.7.0(@types/node@22.15.17)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2))
jest-util: 29.7.0
jest-validate: 29.7.0
yargs: 17.7.1
transitivePeerDependencies:
- '@types/node'
- babel-plugin-macros
- supports-color
- ts-node
jest-config@29.7.0(@types/node@18.18.4)(ts-node@10.9.1(@swc/core@1.10.14(@swc/helpers@0.5.15))(@types/node@18.18.4)(typescript@5.2.2)):
dependencies:
'@babel/core': 7.26.0
@@ -29774,68 +29712,6 @@ snapshots:
- babel-plugin-macros
- supports-color
jest-config@29.7.0(@types/node@18.18.4)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2)):
dependencies:
'@babel/core': 7.26.0
'@jest/test-sequencer': 29.7.0
'@jest/types': 29.6.3
babel-jest: 29.7.0(@babel/core@7.26.0)
chalk: 4.1.2
ci-info: 3.8.0
deepmerge: 4.3.1
glob: 7.2.3
graceful-fs: 4.2.11
jest-circus: 29.7.0
jest-environment-node: 29.7.0
jest-get-type: 29.6.3
jest-regex-util: 29.6.3
jest-resolve: 29.7.0
jest-runner: 29.7.0
jest-util: 29.7.0
jest-validate: 29.7.0
micromatch: 4.0.8
parse-json: 5.2.0
pretty-format: 29.7.0
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 18.18.4
ts-node: 10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2)
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
jest-config@29.7.0(@types/node@22.15.17)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2)):
dependencies:
'@babel/core': 7.26.0
'@jest/test-sequencer': 29.7.0
'@jest/types': 29.6.3
babel-jest: 29.7.0(@babel/core@7.26.0)
chalk: 4.1.2
ci-info: 3.8.0
deepmerge: 4.3.1
glob: 7.2.3
graceful-fs: 4.2.11
jest-circus: 29.7.0
jest-environment-node: 29.7.0
jest-get-type: 29.6.3
jest-regex-util: 29.6.3
jest-resolve: 29.7.0
jest-runner: 29.7.0
jest-util: 29.7.0
jest-validate: 29.7.0
micromatch: 4.0.8
parse-json: 5.2.0
pretty-format: 29.7.0
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 22.15.17
ts-node: 10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2)
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
jest-diff@29.7.0:
dependencies:
chalk: 4.1.2
@@ -29950,7 +29826,7 @@ snapshots:
jest-playwright-preset@4.0.0(jest-circus@29.7.0)(jest-environment-node@29.7.0)(jest-runner@29.7.0)(jest@29.7.0):
dependencies:
expect-playwright: 0.8.0
jest: 29.7.0(@types/node@18.18.4)(ts-node@10.9.1(@swc/core@1.10.14(@swc/helpers@0.5.15))(@types/node@18.18.4)(typescript@5.2.2))
jest: 29.7.0(@types/node@18.18.4)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@18.18.4)(typescript@5.2.2))
jest-circus: 29.7.0
jest-environment-node: 29.7.0
jest-process-manager: 0.4.0
@@ -30108,7 +29984,7 @@ snapshots:
dependencies:
ansi-escapes: 6.0.0
chalk: 5.4.1
jest: 29.7.0(@types/node@18.18.4)(ts-node@10.9.1(@swc/core@1.10.14(@swc/helpers@0.5.15))(@types/node@18.18.4)(typescript@5.2.2))
jest: 29.7.0(@types/node@18.18.4)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@18.18.4)(typescript@5.2.2))
jest-regex-util: 29.6.3
jest-watcher: 29.7.0
slash: 5.1.0
@@ -30163,18 +30039,6 @@ snapshots:
- supports-color
- ts-node
jest@29.7.0(@types/node@22.15.17)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2)):
dependencies:
'@jest/core': 29.7.0(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2))
'@jest/types': 29.6.3
import-local: 3.1.0
jest-cli: 29.7.0(@types/node@22.15.17)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2))
transitivePeerDependencies:
- '@types/node'
- babel-plugin-macros
- supports-color
- ts-node
jiti@2.4.2: {}
jmespath@0.16.0: {}
@@ -35409,27 +35273,6 @@ snapshots:
optionalDependencies:
'@swc/core': 1.11.4(@swc/helpers@0.5.15)
ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@22.15.17)(typescript@5.2.2):
dependencies:
'@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.9
'@tsconfig/node12': 1.0.11
'@tsconfig/node14': 1.0.3
'@tsconfig/node16': 1.0.3
'@types/node': 22.15.17
acorn: 8.10.0
acorn-walk: 8.2.0
arg: 4.1.3
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
typescript: 5.2.2
v8-compile-cache-lib: 3.0.1
yn: 3.1.1
optionalDependencies:
'@swc/core': 1.11.4(@swc/helpers@0.5.15)
optional: true
ts-pattern@4.3.0: {}
ts-toolbelt@9.6.0: {}
@@ -35451,6 +35294,12 @@ snapshots:
minimist: 1.2.8
strip-bom: 3.0.0
tsconfig-paths@4.2.0:
dependencies:
json5: 2.2.3
minimist: 1.2.8
strip-bom: 3.0.0
tslib@1.14.1: {}
tslib@2.8.1: {}