Skip to content

Commit dda6936

Browse files
authored
Merge branch 'develop' into Panandhan22-patch-5
2 parents 16eb993 + db0b907 commit dda6936

File tree

829 files changed

+76130
-35668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

829 files changed

+76130
-35668
lines changed

.bundle/config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_PATH: "vendor/bundle"

CONTRIBUTING.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Sources pages check if the source is a cloud-app, then include information about
7575

7676
## Edit pages
7777

78-
Content with in each `.md` file is markdown. For information about styling, and available extensions, see `_src/utils/formatguide.md` or the live version [here](https://segment.com/docs/utils/formatguide).
78+
Content with in each `.md` file is markdown. For information about styling, and available extensions, see `_src/utils/formatguide.md` or the live version in the [utils section of the docs](/docs/utils/formatguide).
7979

8080
## Building a preview
8181

@@ -109,6 +109,7 @@ Front matter variables have unique functions, including the following:
109109
- `hide-boilerplate`: defaults to false. When true, none of the content from `destination-footer.md` is appended to the destination page.
110110
- `hide-cmodes`: defaults to false. A renaming of "rewrite" for more clarity, hides the connection modes table in the boilerplate.
111111
- `hide-personas-partial`: defaults to false. When true, hides the section of content from `destination-footer.md` that talks about being able to receive personas data.
112+
- `hide_actions`: used to hide individual actions. Requires the `id` and `name` of each action.
112113
- `integration_type`: This is set in the `_config.yml` on three paths to add a noun (Source, Destination, or Warehouse) to the end of the title, and the end of the title tag in the html layout. It also controls the layout and icon for some of these.
113114
- `source-type`: These are only used to supplement when a Cloud App in the sources path doesn't appear in the Config API list, and needs its type explicitly set. It runs some logic in the `cloud-app-note.md` to explain which cloud-apps are object vs event sources.
114115
- `private`: Used to indicate that a destination is not publicly available (Private Beta or Pilot status), and is not available in the public catalog. When `private: true`, the build pulls integration metadata from `src/_data/catalog/destinations_private.yml`. To update the list of private destinations, use the `make private_destination` command, and enter the integration's ID when prompted.
@@ -122,3 +123,4 @@ Front matter variables have unique functions, including the following:
122123
- `redirect_from`: Defaults to null. Takes an array of URLs from the front matter in a file, and generates a "stub" page at each URL at build-time. Each stub file redirects to the original file. Use the path from the root of the content directory, for example `/connections/destinations/catalog/` rather than `/docs/connections/destinations/catalog/`. **Note** We are mostly using NGINX redirects for SEO purposes. Approximately quarterly, we'll collect these and add them to NGINX.
123124
- `seo-changefreq`: default: `weekly `. Use the values [in the sitemap spec](https://www.sitemaps.org/protocol.html#xmlTagDefinitions). - sets the `changefreq` tag in the sitemap.xml generator, which tells search crawlers how often to check back.
124125
- `seo-priority`: values from `1.0` to `0.1`, default: `0.5 `. Sets the `Priority` tag in the sitemap
126+
- `engage`: defaults to false. Hides the connection modes table and adds a note in the Destination Info box that reads "This destination is **only** compatible with [Twilio Engage](https://segment.com/docs/engage/)."

docker-compose.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@ services:
55
command: make dev
66
image: jekyll/jekyll:latest
77
volumes:
8-
- '.:/srv/jekyll'
9-
- './vendor/bundle:/usr/local/bundle'
8+
- '.:/srv/jekyll'
9+
- './vendor/bundle:/usr/local/bundle'
1010
ports:
11-
- 4000:4000
11+
- 4000:4000
1212
container_name: jekyll
13+
# If you are on arm64 and experiencing issues with the tests (hangs,
14+
# connection reset) then try the following in order:
15+
16+
# - stopping and removing all downloaded container images
17+
# - ensuring you have the latest Docker Desktop version
18+
# - factory reset your Docker Desktop settings
19+
20+
# If you are still running into issues please post in #help-infra-seg.
21+
platform: linux/amd64

scripts/catalog/updateDestinations.js

+12-3
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) => {

scripts/catalog/updateSources.js

+32-30
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,28 @@ const PAPI_URL = "https://api.segmentapis.com";
1414

1515
const regionalSupport = yaml.load(fs.readFileSync(path.resolve(__dirname, `../../src/_data/regional-support.yml`)));
1616

17-
// This file keeps a list of known test sources that show up in the system.
17+
// This file keeps a list of known test sources that show up in the system.
1818
// Because we don't have a status value for sources, they end up showing in our catalog.
1919
// We use this below to prevent them from being written to yaml.
2020
const testSources = yaml.load(fs.readFileSync(path.resolve(__dirname, `../../src/_data/catalog/test_sources.yml`)));
2121

2222

2323
const updateSources = async () => {
24-
let sources = []; // Initialize an empty array to hold all sources
25-
let sourcesUpdated = []; // Initialize an empty array to hold all sources that have been updated
26-
let regionalSourcesUpdated = []; // Initialize an empty array to hold updated source regional information
27-
let nextPageToken = "MA=="; // Set the initial page token to the first page
28-
let categories = new Set(); // Initialize an empty set to hold all categories
29-
let sourceCategories = []; // Initialize an empty array to hold all source categories
30-
31-
24+
let sources = []; // Initialize an empty array to hold all sources
25+
let sourcesUpdated = []; // Initialize an empty array to hold all sources that have been updated
26+
let regionalSourcesUpdated = []; // Initialize an empty array to hold updated source regional information
27+
let nextPageToken = "MA=="; // Set the initial page token to the first page
28+
let categories = new Set(); // Initialize an empty set to hold all categories
29+
let sourceCategories = []; // Initialize an empty array to hold all source categories
30+
31+
3232
// Get all sources from the catalog
3333
while (nextPageToken !== undefined) {
3434
const res = await getCatalog(`${PAPI_URL}/catalog/sources/`, nextPageToken);
3535
sources = sources.concat(res.data.sourcesCatalog);
3636
nextPageToken = res.data.pagination.next;
3737
}
38-
38+
3939
// Sort the sources alphabetically
4040
sources.sort((a, b) => {
4141
if (a.name.toLowerCase() < b.name.toLowerCase()) {
@@ -46,7 +46,7 @@ const updateSources = async () => {
4646
}
4747
return 0;
4848
});
49-
49+
5050
// Set the list of categories for libraries
5151
const libraryCategories = [
5252
'server',
@@ -55,20 +55,20 @@ const updateSources = async () => {
5555
'roku',
5656
'website'
5757
];
58-
58+
5959
// Here, define some sources that are real, but that we want to hide.
6060
const hiddenSources = [
6161
'amp',
6262
'factual-engine',
6363
'twilio-event-streams-beta',
6464
'ibm-watson-assistant'
6565
];
66-
66+
6767
// More regional stuff
6868
const regionalSourceEndpoint = regionalSupport.sources.endpoint;
6969
const regionalSourceRegion = regionalSupport.sources.region;
70-
71-
70+
71+
7272
// Loop through all sources and create a new object with the data we want
7373
sources.forEach(source => {
7474
let slug = slugify(source.name, "sources");
@@ -77,14 +77,14 @@ const updateSources = async () => {
7777
let regions = ['us'];
7878
let endpoints = ['us'];
7979
let mainCategory = source.categories[0] ? source.categories[0].toLowerCase() : '';
80-
80+
8181
if (libraryCategories.includes(mainCategory)) {
8282
url = `connections/sources/catalog/libraries/${mainCategory}/${slug}`;
8383
} else {
8484
url = `connections/sources/catalog/cloud-apps/${slug}`;
8585
mainCategory = 'cloud-app';
8686
}
87-
87+
8888
// Sort the settings alphabetically
8989
settings.sort((a, b) => {
9090
if (a.name.toLowerCase() < b.name.toLowerCase()) {
@@ -95,19 +95,19 @@ const updateSources = async () => {
9595
}
9696
return 0;
9797
});
98-
98+
9999
if (hiddenSources.includes(slug)) {
100100
hidden = true;
101101
}
102-
102+
103103
if (regionalSourceEndpoint.includes(slug)) {
104104
endpoints.push('eu');
105105
}
106-
106+
107107
if (regionalSourceRegion.includes(slug)) {
108108
regions.push('eu');
109109
}
110-
110+
111111
// If the source ID is in the list of test sources, skip it.
112112
// If it's not, add it to the list of sources to be written to yaml.
113113
if (testSources.includes(source.id)) {
@@ -128,13 +128,15 @@ const updateSources = async () => {
128128
url: source.logos.default
129129
},
130130
categories: source.categories,
131+
status: source.status,
132+
partnerOwned: source.partnerOwned
131133
};
132134
sourcesUpdated.push(updatedSource);
133135
doesCatalogItemExist(updatedSource);
134136
}
135-
137+
136138
source.categories.reduce((s, e) => s.add(e), categories);
137-
139+
138140
// Sources don't yet have regional information in the Public API, so we write that info here.
139141
let updatedRegional = {
140142
id: source.id,
@@ -147,7 +149,7 @@ const updateSources = async () => {
147149
};
148150
regionalSourcesUpdated.push(updatedRegional);
149151
});
150-
152+
151153
const sourceArray = Array.from(categories);
152154
sourceArray.forEach(category => {
153155
sourceCategories.push({
@@ -164,36 +166,36 @@ const updateSources = async () => {
164166
return 0;
165167
});
166168
});
167-
169+
168170
const options = {
169171
noArrayIndent: false
170172
};
171173
const todayDate = new Date().toISOString().slice(0, 10);
172-
174+
173175
// Create source catalog YAML file
174176
let output = "# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT\n";
175177
output += "# sources last updated " + todayDate + " \n";
176178
output += yaml.dump({
177179
items: sourcesUpdated
178180
}, options);
179181
fs.writeFileSync(path.resolve(__dirname, `../../src/_data/catalog/sources.yml`), output);
180-
182+
181183
// Create source-category mapping YAML file
182184
output = "# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT\n";
183185
output += "# source categories last updated " + todayDate + " \n";
184186
output += yaml.dump({
185187
items: sourceCategories
186188
}, options);
187189
fs.writeFileSync(path.resolve(__dirname, `../../src/_data/catalog/source_categories.yml`), output);
188-
190+
189191
// Create regional support YAML file
190192
output = yaml.dump({
191193
sources: regionalSourcesUpdated
192194
}, options);
193195
fs.writeFileSync(path.resolve(__dirname, `../../src/_data/catalog/regional-supported.yml`), output);
194-
196+
195197
console.log("sources done");
196198
};
197199

198200

199-
exports.updateSources = updateSources;
201+
exports.updateSources = updateSources;

scripts/catalog/utilities.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,7 @@ const doesCatalogItemExist = (item) => {
133133
let content = `---\ntitle: '${item.display_name} Source'\nhidden: true\n---`;
134134

135135
if (!docsPath.includes('/sources/')) {
136-
let betaFlag = '';
137-
if (item.status === 'PUBLIC_BETA') {
138-
betaFlag = 'beta: true\n';
139-
}
140-
content = `---\ntitle: '${item.display_name} Destination'\nhidden: true\nid: ${item.id}\npublished: false\n${betaFlag}---\n`;
136+
content = `---\ntitle: '${item.display_name} Destination'\nhidden: true\nid: ${item.id}\npublished: false\n`;
141137
}
142138

143139
fs.mkdirSync(docsPath);

src/_data/catalog/beta_sources.yml

-26
This file was deleted.

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 2024-04-25
2+
# destination categories last updated 2025-02-20
33
items:
44
- display_name: A/B Testing
55
slug: a-b-testing

0 commit comments

Comments
 (0)