Skip to content

Commit aa8d328

Browse files
Merge pull request #6841 from segmentio/STRAT-3624
[STRAT-3624] | Remove hidden action fields from showing in public segment docs.
2 parents 3dca172 + 46db117 commit aa8d328

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

scripts/catalog/updateDestinations.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ require('dotenv').config();
1414

1515
const PAPI_URL = "https://api.segmentapis.com";
1616

17+
// Function to remove hidden fields from action
18+
const removeHiddenFields=function (actions) {
19+
return actions.map(action => ({
20+
...action,
21+
fields: action.fields.filter(field => !field.hidden)
22+
})
23+
);
24+
}
25+
1726

1827
const updateDestinations = async () => {
1928
let destinations = [];
@@ -88,9 +97,9 @@ const updateDestinations = async () => {
8897
settings.forEach(setting => {
8998
setting.description = sanitize(setting.description);
9099
});
91-
92-
let actions = destination.actions;
93-
let presets = destination.presets;
100+
101+
let actions = removeHiddenFields(destination.actions);
102+
let presets = destination.presets;
94103

95104
const clone = (obj) => Object.assign({}, obj);
96105
const renameKey = (object, key, newKey) => {

0 commit comments

Comments
 (0)