mirror of
https://github.com/LukeHagar/api-specs.git
synced 2025-12-06 12:27:48 +00:00
updated script to include different base path for each collection
This commit is contained in:
@@ -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
|
||||
|
||||
12
postman-script/variable-beta.json
Normal file
12
postman-script/variable-beta.json
Normal file
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"key": "domain",
|
||||
"value": "identitynow",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"key": "baseUrl",
|
||||
"value": "https://{{tenant}}.api.{{domain}}.com/beta",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
12
postman-script/variable-v2.json
Normal file
12
postman-script/variable-v2.json
Normal file
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"key": "domain",
|
||||
"value": "identitynow",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"key": "baseUrl",
|
||||
"value": "https://{{tenant}}.api.{{domain}}.com/v2",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
12
postman-script/variable-v3.json
Normal file
12
postman-script/variable-v3.json
Normal file
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"key": "domain",
|
||||
"value": "identitynow",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"key": "baseUrl",
|
||||
"value": "https://{{tenant}}.api.{{domain}}.com/v3",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
@@ -176451,7 +176451,7 @@
|
||||
},
|
||||
{
|
||||
"key": "baseUrl",
|
||||
"value": "https://{{tenant}}.api.{{domain}}.com",
|
||||
"value": "https://{{tenant}}.api.{{domain}}.com/beta",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -1310,7 +1310,7 @@
|
||||
},
|
||||
{
|
||||
"key": "baseUrl",
|
||||
"value": "https://{{tenant}}.api.{{domain}}.com",
|
||||
"value": "https://{{tenant}}.api.{{domain}}.com/v2",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user