Skip to content

Commit ff341e0

Browse files
author
markzegarelli
authored
Merge pull request #1980 from segmentio/hide-intercom-settings
Remove unexposed settings from settings tables
2 parents 8ed2f66 + 6a5a354 commit ff341e0

6 files changed

+30
-589
lines changed

scripts/catalog_papi.js

+21
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const path = require('path');
33
const fs = require('fs');
44
const fm = require('front-matter');
55
const yaml = require('js-yaml');
6+
const { type } = require('os');
67

78
require('dotenv').config();
89

@@ -393,11 +394,31 @@ const updateDestinations = async () => {
393394
})
394395

395396
let settings = destination.options
397+
396398
settings.sort((a, b) => {
397399
if(a.name.toLowerCase() < b.name.toLowerCase()) { return -1; }
398400
if(a.name.toLowerCase() > b.name.toLowerCase()) { return 1; }
399401
return 0;
400402
})
403+
404+
405+
// Here we are dealing with settings that should not be exposed
406+
settings.forEach(setting => {
407+
if (setting.name == 'directChannels' || setting.name == 'endpoint' || setting.name == 'batchApiLocation') {
408+
delete setting.name
409+
delete setting.type
410+
delete setting.defaultValue
411+
delete setting.description
412+
delete setting.required
413+
delete setting.label
414+
delete setting
415+
416+
}
417+
});
418+
419+
settings = settings.filter(value => JSON.stringify(value) !== '{}')
420+
421+
// end settings removal block
401422

402423
const clone = (obj) => Object.assign({}, obj)
403424
const renameKey = (object, key, newKey) => {

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 2021-10-05
2+
# destination categories last updated 2021-10-08
33
items:
44
- display_name: A/B Testing
55
slug: a-b-testing

0 commit comments

Comments
 (0)