Skip to content

Commit ab37734

Browse files
author
markzegarelli
authored
Added yaml file for integration slug overrides (#2502)
1 parent 41c0848 commit ab37734

7 files changed

+50
-31
lines changed

scripts/catalog_papi.js

+12-25
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ require('dotenv').config();
1212
PAPI_URL = "https://api.segmentapis.com"
1313

1414
const regionalSupport = yaml.load(fs.readFileSync(path.resolve(__dirname, `../src/_data/regional-support.yml`)))
15+
const slugOverrides = yaml.load(fs.readFileSync(path.resolve(__dirname, `../src/_data/catalog/slugs.yml`)))
1516

1617

1718
const slugify = (displayName) => {
@@ -23,13 +24,16 @@ const slugify = (displayName) => {
2324
.replace(/[\(\)]/g, '')
2425
.replace('.', '-')
2526

26-
if (slug === '-net') slug = 'net'
27-
if (slug === 'talon-one') slug = 'talonone'
28-
if (slug === 'roku-alpha') slug = 'roku'
29-
if (slug === 'shopify-by-littledata') slug = 'shopify-littledata'
30-
if (slug === 'talon-one') slug = 'talonone'
31-
if (slug == 'google-adwords-remarketing-lists-customer-match') slug = 'adwords-remarketing-lists'
32-
if (slug == 'canny-classic') slug = 'canny'
27+
for (key in slugOverrides) {
28+
let original = slugOverrides[key].original
29+
let override = slugOverrides[key].override
30+
31+
if (slug == original) {
32+
console.log(original+" -> "+override)
33+
slug = override
34+
}
35+
}
36+
3337
return slug
3438
}
3539

@@ -329,26 +333,8 @@ const updateDestinations = async () => {
329333
destinations.forEach(destination => {
330334
let regional = ['us-west']
331335

332-
// We need to be able to keep the system slug in some cases.
333-
const slugOverrides = ['actions-google-enhanced-conversions', 'actions-google-analytics-4', 'actions-facebook-conversions-api', 'actions-friendbuy-cloud', 'sprig-web', 'google-analytics']
334336
let slug = slugify(destination.name)
335-
if (slugOverrides.includes(destination.slug)) {
336-
slug = destination.slug
337-
}
338337

339-
340-
// Flip the slug of Actions destinations
341-
const actionsDests = [
342-
'amplitude-actions',
343-
'slack-actions',
344-
'fullstory-actions',
345-
'friendbuy-actions'
346-
]
347-
348-
if (actionsDests.includes(slug)) {
349-
const newSlug = slug.split('-')
350-
slug = newSlug[1] + '-' + newSlug[0]
351-
}
352338
if (regionalDestinations.includes(slug)) {
353339
regional.push('eu-west')
354340
}
@@ -569,3 +555,4 @@ const updateWarehouses = async () => {
569555
updateSources()
570556
updateWarehouses()
571557
updateDestinations()
558+

src/_data/catalog/destination_categories.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# destination categories last updated 2022-02-14
2+
# destination categories last updated 2022-02-15
33
items:
44
- display_name: A/B Testing
55
slug: a-b-testing

src/_data/catalog/destinations.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# destination data last updated 2022-02-14
2+
# destination data last updated 2022-02-15
33
items:
44
- destination_id: 60b5d0a01f3726b85dc05aab
55
display_name: 2mee

src/_data/catalog/regional-supported.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED LIST OF CONNECTIONS THAT SUPPORT REGIONAL
2-
# Last updated 2022-02-14
2+
# Last updated 2022-02-15
33
warehouses:
44
- id: WcjBCzUGff
55
display_name: Azure SQL Data Warehouse
@@ -51,7 +51,7 @@ warehouses:
5151
- us-west
5252
- eu-west
5353
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
54-
# source cateogries last updated 2022-02-14
54+
# source cateogries last updated 2022-02-15
5555
items:
5656
- display_name: A/B Testing
5757
slug: a-b-testing

src/_data/catalog/slugs.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Manual overrides of our catalog slug generation function
2+
3+
- original: "-net"
4+
override: "net"
5+
- original: "talon-one"
6+
override: "talonone"
7+
- original: "roku-alpha"
8+
override: "roku"
9+
- original: "shopify-by-littledata"
10+
override: "shopify-littledata"
11+
- original: "google-adwords-remarketing-lists-customer-match"
12+
override: "adwords-remarketing-lists"
13+
- original: "canny-classic"
14+
override: "canny"
15+
- original: "amplitude-actions"
16+
override: "actions-amplitude"
17+
- original: "slack-actions"
18+
override: "actions-slack"
19+
- original: "fullstory-actions"
20+
override: "actions-fullstory"
21+
- original: "google-enhanced-conversions"
22+
override: "actions-google-enhanced-conversions"
23+
- original: "google-analytics-4"
24+
override: "actions-google-analytics-4"
25+
- original: "facebook-conversions-api-actions"
26+
override: "actions-facebook-conversions-api"
27+
- original: "friendbuy-cloud-destination"
28+
override: "actions-friendbuy-cloud"
29+
- original: "sprig-actions"
30+
override: "sprig-web"
31+
- original: "google-universal-analytics"
32+
override: "google-analytics"

src/_data/catalog/source_categories.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# source cateogries last updated 2022-02-14
2+
# source cateogries last updated 2022-02-15
33
items:
44
- display_name: A/B Testing
55
slug: a-b-testing

src/_data/catalog/sources.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# sources last updated 2022-02-14
2+
# sources last updated 2022-02-15
33
items:
44
- id: 8HWbgPTt3k
55
display_name: .NET

0 commit comments

Comments
 (0)