Skip to content

Commit 6a5d78a

Browse files
author
markzegarelli
committed
Merge branch 'develop' into ENTCX-668_DOC-613
2 parents a2dc61e + 0cb8f3c commit 6a5d78a

File tree

44 files changed

+3459
-1810
lines changed

Some content is hidden

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

44 files changed

+3459
-1810
lines changed

.github/styles/Vocab/Docs/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Javascript
8181
Jebbit
8282
Jimo
8383
Jivox
84+
jQuery
8485
Kable
8586
Kameleoon
8687
Kissmetrics
Binary file not shown.
Binary file not shown.

scripts/private-destination.js

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ const yaml = require('js-yaml');
66
const {
77
prompt
88
} = require('enquirer');
9+
const {
10+
type
11+
} = require('os');
912

1013
require('dotenv').config();
1114

@@ -37,9 +40,15 @@ const getCatalog = async (url, page_token = "MA==") => {
3740
}
3841
}
3942

43+
44+
const checkDestinationStatus = async (id) => {
45+
const res = await getCatalog(`${PAPI_URL}/catalog/destinations/${id}`)
46+
let destination = res.data.destinationMetadata
47+
return destination
48+
}
4049
const getDestinationData = async (id) => {
4150
const res = await getCatalog(`${PAPI_URL}/catalog/destinations/${id}`)
42-
destination = res.data.destinationMetadata
51+
let destination = res.data.destinationMetadata
4352
let settings = destination.options
4453
settings.sort((a, b) => {
4554
if (a.name.toLowerCase() < b.name.toLowerCase()) {
@@ -101,30 +110,60 @@ const getDestinationData = async (id) => {
101110
}
102111

103112

113+
const checkExistingStatus = async () => {
114+
let existingIds = []
115+
let newIds = []
116+
for (let [key] of Object.entries(privateDests)) {
117+
existingIds.push(privateDests[key].id)
118+
}
119+
120+
existingIds.sort()
104121

122+
for (i in existingIds) {
123+
let id = existingIds[i]
124+
let destination = await checkDestinationStatus(id)
125+
let status = destination.status
105126

127+
if (status === "PRIVATE_BETA") {
128+
// console.log(`${destination.name} is private`)
129+
newIds.push(id)
130+
} else {
131+
// console.log(`${destination.name}is public`)
132+
}
133+
}
134+
return newIds
135+
}
106136
const addPrivateDestination = async () => {
137+
let ids = await checkExistingStatus()
138+
ids.sort();
107139
const DEST_ID = await prompt({
108140
type: 'input',
109141
name: 'id',
110142
message: 'Enter the destination ID'
111143
})
112144

113-
const privateIds = []
114-
for (let [key] of Object.entries(privateDests)) {
115-
privateIds.push(privateDests[key].id)
116-
}
117-
118-
if (privateIds.includes(DEST_ID.id)) {
119-
console.log("This destination is already captured.")
120-
return
145+
if (DEST_ID.id == '0') {
146+
for (const element in ids) {
147+
let currentId = ids[element]
148+
await getDestinationData(currentId)
149+
}
150+
console.log("Updating exsting Private Beta destinations.")
121151
} else {
122-
privateIds.push(DEST_ID.id)
123-
}
124-
privateIds.sort();
125-
for (const element in privateIds) {
126-
let currentId = privateIds[element]
127-
getDestinationData(currentId)
152+
if (ids.includes(DEST_ID.id)) {
153+
console.log("This destination is already captured.")
154+
return
155+
} else {
156+
ids.push(DEST_ID.id)
157+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/destinations_private.yml`), '');
158+
159+
}
160+
ids.sort();
161+
162+
163+
for (const element in ids) {
164+
let currentId = ids[element]
165+
await getDestinationData(currentId)
166+
}
128167
}
129168

130169
}

src/_data/catalog/destination_categories.yml

Lines changed: 1 addition & 1 deletion
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 2022-12-01
2+
# destination categories last updated 2022-12-08
33
items:
44
- display_name: A/B Testing
55
slug: a-b-testing

0 commit comments

Comments
 (0)