updated script to include different base path for each collection

This commit is contained in:
Philip Ellis
2023-08-31 15:59:15 -05:00
parent 3e8e1e6441
commit d20926eb7c
8 changed files with 1768 additions and 1718 deletions

View File

@@ -9,6 +9,11 @@ const deleteAuthKey = (obj) => {
if (key === 'auth') {
delete obj[key];
}
if (key === 'disabled') {
if (obj[key] === false) {
obj[key] = true
}
}
}
};
@@ -31,7 +36,16 @@ fs.readFile(args[2], 'utf8', (err, data) => {
deleteAuthKey(jsonObject);
jsonObject.auth = JSON.parse(fs.readFileSync('postman-script/base-auth.json', 'utf8'));
jsonObject.event = JSON.parse(fs.readFileSync('postman-script/pre-script.json', 'utf8'));
jsonObject.variable = JSON.parse(fs.readFileSync('postman-script/variable.json', 'utf8'));
if (args[2].includes("beta")) {
jsonObject.variable = JSON.parse(fs.readFileSync('postman-script/variable-beta.json', 'utf8'));
} else if (args[2].includes("v3")) {
jsonObject.variable = JSON.parse(fs.readFileSync('postman-script/variable-v3.json', 'utf8'));
} else if (args[2].includes("v2")) {
jsonObject.variable = JSON.parse(fs.readFileSync('postman-script/variable-v2.json', 'utf8'));
} else if (args[2].includes("cc")) {
jsonObject.variable = JSON.parse(fs.readFileSync('postman-script/variable-cc.json', 'utf8'));
}
// Write the modified JSON content back to the file

View File

@@ -0,0 +1,12 @@
[
{
"key": "domain",
"value": "identitynow",
"type": "string"
},
{
"key": "baseUrl",
"value": "https://{{tenant}}.api.{{domain}}.com/beta",
"type": "string"
}
]

View File

@@ -0,0 +1,12 @@
[
{
"key": "domain",
"value": "identitynow",
"type": "string"
},
{
"key": "baseUrl",
"value": "https://{{tenant}}.api.{{domain}}.com/v2",
"type": "string"
}
]

View File

@@ -0,0 +1,12 @@
[
{
"key": "domain",
"value": "identitynow",
"type": "string"
},
{
"key": "baseUrl",
"value": "https://{{tenant}}.api.{{domain}}.com/v3",
"type": "string"
}
]