@@ -41,10 +41,10 @@ export class FabrixApp extends EventEmitter {
41
41
private _spools : { [ key : string ] : Spool | ServerSpool | ExtensionSpool | DatastoreSpool | SystemSpool | ToolSpool | MiscSpool }
42
42
private _resources : string [ ] = [ ]
43
43
44
- public controllers : { [ key : string ] : any } // FabrixController }
45
- public services : { [ key : string ] : any } // FabrixService }
46
- public policies : { [ key : string ] : any } // FabrixPolicy }
47
- public models : { [ key : string ] : any } // FabrixModel }
44
+ public controllers : { [ key : string ] : FabrixGeneric } // FabrixController }
45
+ public services : { [ key : string ] : FabrixGeneric } // FabrixService }
46
+ public policies : { [ key : string ] : FabrixGeneric } // FabrixPolicy }
47
+ public models : { [ key : string ] : FabrixGeneric } // FabrixModel }
48
48
public resolvers : { [ key : string ] : any } // FabrixResolver }
49
49
50
50
/**
@@ -79,14 +79,49 @@ export class FabrixApp extends EventEmitter {
79
79
80
80
const processEnv = Object . freeze ( Object . assign ( { } , JSON . parse ( JSON . stringify ( process . env ) ) ) )
81
81
82
- this . _logger = new LoggerProxy ( this )
83
- this . _env = processEnv
84
- this . _pkg = app . pkg
85
- this . _versions = process . versions
86
- this . _config = new Configuration ( app . config , processEnv )
87
- this . _spools = { }
88
- this . _api = app . api
89
- this . _fabrix = pkg
82
+ Object . defineProperties ( this , {
83
+ _logger : {
84
+ value : new LoggerProxy ( this ) ,
85
+ enumerable : false
86
+ } ,
87
+ _env : {
88
+ value : processEnv ,
89
+ enumerable : false
90
+ } ,
91
+ _pkg : {
92
+ value : app . pkg ,
93
+ enumerable : false
94
+ } ,
95
+ _versions : {
96
+ value : process . versions ,
97
+ enumerable : false
98
+ } ,
99
+ _config : {
100
+ value : new Configuration ( app . config , processEnv ) ,
101
+ enumerable : false
102
+ } ,
103
+ _spools : {
104
+ value : { } ,
105
+ enumerable : false
106
+ } ,
107
+ _api : {
108
+ value : app . api ,
109
+ enumerable : false
110
+ } ,
111
+ _fabrix : {
112
+ value : pkg ,
113
+ enumerable : false
114
+ }
115
+ } )
116
+
117
+ // this._logger = new LoggerProxy(this)
118
+ // this._env = processEnv
119
+ // this._pkg = app.pkg
120
+ // this._versions = process.versions
121
+ // this._config = new Configuration(app.config, processEnv)
122
+ // this._spools = {}
123
+ // this._api = app.api
124
+ // this._fabrix = pkg
90
125
91
126
// Set the max listeners from the config
92
127
this . setMaxListeners ( this . config . get ( 'main.maxListeners' ) )
0 commit comments