@@ -26,19 +26,27 @@ function parseService(task) {
26
26
throw new Error ( model . errors [ 0 ] . message ) ;
27
27
}
28
28
29
- return argsUtil . encode ( model . services . values ( ) . map ( service => {
30
- return {
31
- //TODO: temporary commented due to server unpreparedness
32
- // name : service.name,
33
- // version : service.version,
34
- // description : service.description,
35
- config : service . configItems . map ( item => Object . assign ( {
36
- ___jsonclass : 'com.backendless.marketplace.model.BlConfigurationItemDescription' ,
37
- options : item . options && item . options . join ( ',' )
38
- } , item ) ) ,
39
- xml : service . xml ( )
40
- } ;
41
- } ) ) ;
29
+ function transformConfigItem ( item ) {
30
+ return Object . assign ( { } , item , {
31
+ ___jsonclass : 'com.backendless.marketplace.model.BlConfigurationItemDescription' ,
32
+ options : item . options && item . options . join ( ',' )
33
+ } ) ;
34
+ }
35
+
36
+ const result = {
37
+ model : JSON . stringify ( model ) ,
38
+ services : model . services . values ( ) . map ( service => {
39
+ return {
40
+ name : service . name ,
41
+ version : service . version ,
42
+ description : service . description ,
43
+ config : service . configItems . map ( transformConfigItem ) ,
44
+ xml : service . xml ( )
45
+ } ;
46
+ } )
47
+ } ;
48
+
49
+ return argsUtil . encode ( result ) ;
42
50
}
43
51
44
52
module . exports = parseService ;
0 commit comments