Skip to content

Commit 2de34f2

Browse files
authored
Merge pull request #275 from segmentio/repo-sync
repo sync
2 parents c4b2d6a + e557845 commit 2de34f2

File tree

9 files changed

+4699
-1843
lines changed

9 files changed

+4699
-1843
lines changed

scripts/catalog_papi.js

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,15 @@ const updateSources = async () => {
183183
'twilio-event-streams-beta'
184184
]
185185

186-
const regionalSources = regionalSupport.sources
186+
const regionalSourceEndpoint = regionalSupport.sources.endpoint
187+
const regionalSourceRegion = regionalSupport.sources.region
187188

188189
sources.forEach(source => {
189190
let slug = slugify(source.name)
190191
let settings = source.options
191192
let hidden = false
192-
let regional = ['us-west']
193+
let regions = ['us']
194+
let endpoints = ['us']
193195
let mainCategory = source.categories[0] ? source.categories[0].toLowerCase() : ''
194196

195197
// determine the doc url based on the source's main category
@@ -216,8 +218,12 @@ const updateSources = async () => {
216218
hidden = true
217219
}
218220

219-
if (regionalSources.includes(slug)) {
220-
regional.push('eu-west')
221+
if (regionalSourceEndpoint.includes(slug)) {
222+
endpoints.push('eu')
223+
}
224+
225+
if (regionalSourceRegion.includes(slug)) {
226+
regions.push('eu')
221227
}
222228

223229
// create the catalog metadata
@@ -227,7 +233,8 @@ const updateSources = async () => {
227233
slug,
228234
url,
229235
hidden,
230-
regional,
236+
regions,
237+
endpoints,
231238
source_type: mainCategory,
232239
description: source.description,
233240
logo: {
@@ -247,7 +254,8 @@ const updateSources = async () => {
247254
display_name: source.name,
248255
slug,
249256
url,
250-
regional
257+
regions,
258+
endpoints
251259
}
252260
regionalSourcesUpdated.push(updatedRegional)
253261

@@ -327,18 +335,24 @@ const updateDestinations = async () => {
327335
return 0;
328336
})
329337

330-
const regionalDestinations = regionalSupport.destinations
338+
const regionalDestinationEndpoints= regionalSupport.destinations.endpoint
339+
const regionalDestinationRegions= regionalSupport.destinations.region
331340

332341

333342
destinations.forEach(destination => {
334-
let regional = ['us-west']
343+
let endpoints = ['us']
344+
let regions = ['us']
335345

336346
let slug = slugify(destination.name)
337347

338-
if (regionalDestinations.includes(slug)) {
339-
regional.push('eu-west')
348+
if (regionalDestinationEndpoints.includes(slug)) {
349+
endpoints.push('eu')
340350
}
341351

352+
if (regionalDestinationRegions.includes(slug)) {
353+
regions.push('eu')
354+
}
355+
342356

343357
let url = `connections/destinations/catalog/${slug}`
344358

@@ -386,7 +400,8 @@ const updateDestinations = async () => {
386400
name: destination.name,
387401
slug,
388402
hidden: isCatalogItemHidden(url),
389-
regional,
403+
endpoints,
404+
regions,
390405
url,
391406
previous_names: destination.previousNames,
392407
website: destination.website,
@@ -418,7 +433,8 @@ const updateDestinations = async () => {
418433
display_name: destination.name,
419434
slug,
420435
url,
421-
regional
436+
regions,
437+
endpoints
422438
}
423439

424440
regionalDestinationsUpdated.push(updatedRegionalDestination)
@@ -495,16 +511,22 @@ const updateWarehouses = async () => {
495511
return 0;
496512
})
497513

498-
const regionalWarehouses = regionalSupport.warehouses
514+
const regionalWarehouseEndpoints = regionalSupport.warehouses.endpoint
515+
const regionalWarehouseRegions = regionalSupport.warehouses.region
499516

500517

501518
warehouses.forEach(warehouse => {
502519
let slug = slugify(warehouse.slug)
503-
let regional = ['us-west']
520+
let endpoints = ['us']
521+
let regions = ['us']
504522
let url = `connections/storage/catalog/${slug}`
505523

506-
if (regionalWarehouses.includes(slug)) {
507-
regional.push('eu-west')
524+
if (regionalWarehouseEndpoints.includes(slug)) {
525+
endpoints.push('eu')
526+
}
527+
528+
if (regionalWarehouseRegions.includes(slug)) {
529+
regions.push('eu')
508530
}
509531

510532
let settings = warehouse.options
@@ -523,7 +545,8 @@ const updateWarehouses = async () => {
523545
display_name: warehouse.name,
524546
url,
525547
slug,
526-
regional,
548+
endpoints,
549+
regions
527550

528551
}
529552
warehousesUpdated.push(updatedWarehouse)

src/_data/catalog/destination_categories.yml

Lines changed: 1 addition & 1 deletion
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-03-17
2+
# destination categories last updated 2022-03-18
33
items:
44
- display_name: A/B Testing
55
slug: a-b-testing

0 commit comments

Comments
 (0)