Skip to content

[STRAT-3624] | Remove hidden action fields from showing in public segment docs. #6841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions scripts/catalog/updateDestinations.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ require('dotenv').config();

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

// Function to remove hidden fields from action
const removeHiddenFields=function (actions) {
return actions.map(action => ({
...action,
fields: action.fields.filter(field => !field.hidden)
})
);
}


const updateDestinations = async () => {
let destinations = [];
Expand Down Expand Up @@ -88,9 +97,9 @@ const updateDestinations = async () => {
settings.forEach(setting => {
setting.description = sanitize(setting.description);
});
let actions = destination.actions;
let presets = destination.presets;

let actions = removeHiddenFields(destination.actions);
let presets = destination.presets;

const clone = (obj) => Object.assign({}, obj);
const renameKey = (object, key, newKey) => {
Expand Down
Loading