This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
const request = require("requestretry"); | ||
const async = require('async'); | ||
const fs = require('fs-extra'); | ||
const moment = require('moment'); | ||
const path = require("path"); | ||
|
||
const backupFile = require("./backup.json"); | ||
|
||
const findHierarchicalEntities = (value) =>{ | ||
|
||
const hierarchicalEntityObjects = value.entities.filter(entity => { | ||
if (entity.children) { | ||
return entity.name; | ||
} | ||
}); | ||
|
||
return hierarchicalEntityObjects.map(x => x.name); | ||
} | ||
|
||
const findCompositeEntities = (value) =>{ | ||
|
||
return value.composites.map(composite => { | ||
return composite.name; | ||
}); | ||
} | ||
|
||
// find all apps with heirarchical entities | ||
backupFile.apps.forEach(app => { | ||
|
||
app.properties.forEach(property => { | ||
|
||
if(property.route == 'versionExports'){ | ||
|
||
// get version name | ||
property.values.forEach(value => { | ||
|
||
// check version for deprecated items | ||
const name = value.name; | ||
const version = value.versionId; | ||
|
||
const hierarchicalEntities = findHierarchicalEntities(value); | ||
hierarchicalEntities.length>0? console.log(`'${name}' '${version}' 'HIER=${hierarchicalEntities.join(",")}'`) : null; | ||
|
||
const compositeEntities = findCompositeEntities(value); | ||
compositeEntities.length>0? console.log(`'${name}' '${version}' 'COMP=${compositeEntities.join(",")}'`) : null; | ||
}) | ||
} | ||
}); | ||
}); |