Skip to content

Commit 0cb4287

Browse files
author
Gaurav Kochar
committed
Worked on removing hidden fields from public docs
1 parent 9c21a4c commit 0cb4287

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

scripts/catalog/updateDestinations.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,16 @@ const {
1212

1313
require('dotenv').config();
1414

15-
const PAPI_URL = "https://api.segmentapis.com";
15+
const PAPI_URL = "https://api.segmentapis.build";
16+
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+
}
1625

1726

1827
const updateDestinations = async () => {
@@ -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)