This repository was archived by the owner on Oct 12, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ const request = require ( "requestretry" ) ;
3+ const async = require ( 'async' ) ;
4+ const fs = require ( 'fs-extra' ) ;
5+ const moment = require ( 'moment' ) ;
6+ const path = require ( "path" ) ;
7+
8+ const backupFile = require ( "./backup.json" ) ;
9+
10+ const findHierarchicalEntities = ( value ) => {
11+
12+ const hierarchicalEntityObjects = value . entities . filter ( entity => {
13+ if ( entity . children ) {
14+ return entity . name ;
15+ }
16+ } ) ;
17+
18+ return hierarchicalEntityObjects . map ( x => x . name ) ;
19+ }
20+
21+ const findCompositeEntities = ( value ) => {
22+
23+ return value . composites . map ( composite => {
24+ return composite . name ;
25+ } ) ;
26+ }
27+
28+ // find all apps with heirarchical entities
29+ backupFile . apps . forEach ( app => {
30+
31+ app . properties . forEach ( property => {
32+
33+ if ( property . route == 'versionExports' ) {
34+
35+ // get version name
36+ property . values . forEach ( value => {
37+
38+ // check version for deprecated items
39+ const name = value . name ;
40+ const version = value . versionId ;
41+
42+ const hierarchicalEntities = findHierarchicalEntities ( value ) ;
43+ hierarchicalEntities . length > 0 ? console . log ( `'${ name } ' '${ version } ' 'HIER=${ hierarchicalEntities . join ( "," ) } '` ) : null ;
44+
45+ const compositeEntities = findCompositeEntities ( value ) ;
46+ compositeEntities . length > 0 ? console . log ( `'${ name } ' '${ version } ' 'COMP=${ compositeEntities . join ( "," ) } '` ) : null ;
47+ } )
48+ }
49+ } ) ;
50+ } ) ;
You can’t perform that action at this time.
0 commit comments