2014-07-04 14:43:03 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								'use strict' ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								const  fs  =  require ( 'fs' ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								const  path  =  require ( 'path' ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								const  async  =  require ( 'async' ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								const  winston  =  require ( 'winston' ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								const  semver  =  require ( 'semver' ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								const  nconf  =  require ( 'nconf' ) ;  
						 
					
						
							
								
									
										
										
										
											2020-09-28 19:53:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								const  request  =  require ( 'request-promise-native' ) ;  
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-08-02 12:57:02 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								const  user  =  require ( '../user' ) ;  
						 
					
						
							
								
									
										
										
										
											2019-08-30 14:40:11 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								const  posts  =  require ( '../posts' ) ;  
						 
					
						
							
								
									
										
										
										
											2019-08-02 12:57:02 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-09 14:53:32 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								var  app ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								var  middleware ;  
						 
					
						
							
								
									
										
										
										
											2013-12-02 16:19:30 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								const  Plugins  =  module . exports ;  
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-23 15:03:32 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								require ( './install' ) ( Plugins ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								require ( './load' ) ( Plugins ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								require ( './hooks' ) ( Plugins ) ;  
						 
					
						
							
								
									
										
										
										
											2019-06-07 14:10:44 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								require ( './usage' ) ( Plugins ) ;  
						 
					
						
							
								
									
										
										
										
											2018-10-23 15:03:32 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Plugins . data  =  require ( './data' ) ;  
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . getPluginPaths  =  Plugins . data . getPluginPaths ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . loadPluginInfo  =  Plugins . data . loadPluginInfo ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . pluginsData  =  { } ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . libraries  =  { } ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . loadedHooks  =  { } ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . staticDirs  =  { } ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . cssFiles  =  [ ] ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . lessFiles  =  [ ] ;  
						 
					
						
							
								
									
										
										
										
											2017-08-21 17:48:58 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Plugins . acpLessFiles  =  [ ] ;  
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Plugins . clientScripts  =  [ ] ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . acpScripts  =  [ ] ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . libraryPaths  =  [ ] ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . versionWarning  =  [ ] ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . languageData  =  { } ;  
						 
					
						
							
								
									
										
										
										
											2019-06-07 14:10:44 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Plugins . loadedPlugins  =  [ ] ;  
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . initialized  =  false ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Plugins . requireLibrary  =  function  ( pluginID ,  libraryPath )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Plugins . libraries [ pluginID ]  =  require ( libraryPath ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Plugins . libraryPaths . push ( libraryPath ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Plugins . init  =  async  function  ( nbbApp ,  nbbMiddleware )  {  
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( Plugins . initialized )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( nbbApp )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										app  =  nbbApp ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										middleware  =  nbbMiddleware ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( global . env  ===  'development' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										winston . verbose ( '[plugins] Initializing plugins system' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									await  Plugins . reload ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( global . env  ===  'development' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										winston . info ( '[plugins] Plugins OK' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2013-12-03 13:36:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Plugins . initialized  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
									
										
										
										
											2013-12-03 13:36:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Plugins . reload  =  async  function  ( )  {  
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									// Resetting all local plugin data
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Plugins . libraries  =  { } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Plugins . loadedHooks  =  { } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Plugins . staticDirs  =  { } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Plugins . versionWarning  =  [ ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Plugins . cssFiles . length  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Plugins . lessFiles . length  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-21 17:48:58 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Plugins . acpLessFiles . length  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Plugins . clientScripts . length  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Plugins . acpScripts . length  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Plugins . libraryPaths . length  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 14:10:44 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Plugins . loadedPlugins . length  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-08-02 12:57:02 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									await  user . addInterstitials ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									const  paths  =  await  Plugins . getPluginPaths ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for  ( const  path  of  paths )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* eslint-disable no-await-in-loop */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										await  Plugins . loadPlugin ( path ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2013-12-03 13:36:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									// If some plugins are incompatible, throw the warning here
 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-07 20:13:14 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( Plugins . versionWarning . length  &&  nconf . get ( 'isPrimary' ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										console . log ( '' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										winston . warn ( '[plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run `./nodebb reset -p PLUGINNAME` to disable it.' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										for  ( var  x  =  0 ,  numPlugins  =  Plugins . versionWarning . length ;  x  <  numPlugins ;  x  +=  1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											console . log ( '  * ' . yellow  +  Plugins . versionWarning [ x ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										console . log ( '' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-16 14:26:58 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-08-30 14:40:11 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Plugins . registerHook ( 'core' ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										hook :  'filter:parse.post' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										method :  async  ( data )  =>  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											data . postData . content  =  posts . sanitize ( data . postData . content ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Plugins . registerHook ( 'core' ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										hook :  'filter:parse.raw' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										method :  async  content  =>  posts . sanitize ( content ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Plugins . registerHook ( 'core' ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										hook :  'filter:parse.aboutme' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										method :  async  content  =>  posts . sanitize ( content ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Plugins . registerHook ( 'core' ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										hook :  'filter:parse.signature' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										method :  async  ( data )  =>  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											data . userData . signature  =  posts . sanitize ( data . userData . signature ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									// Lower priority runs earlier
 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Object . keys ( Plugins . loadedHooks ) . forEach ( function  ( hook )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Plugins . loadedHooks [ hook ] . sort ( ( a ,  b )  =>  a . priority  -  b . priority ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-04 11:42:49 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									// Post-reload actions
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									await  posts . configureSanitize ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
									
										
										
										
											2014-08-24 12:30:49 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 18:16:18 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Plugins . reloadRoutes  =  async  function  ( params )  {  
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									var  controllers  =  require ( '../controllers' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 18:16:18 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									await  Plugins . fireHook ( 'static:app.load' ,  {  app :  app ,  router :  params . router ,  middleware :  middleware ,  controllers :  controllers  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									winston . verbose ( '[plugins] All plugins reloaded and rerouted' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
									
										
										
										
											2015-07-08 17:04:21 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Plugins . get  =  async  function  ( id )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									const  url  =  ( nconf . get ( 'registry' )  ||  'https://packages.nodebb.org' )  +  '/api/v1/plugins/'  +  id ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-28 19:53:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									const  body  =  await  request ( url ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										json :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									let  normalised  =  await  Plugins . normalise ( [ body  ?  body . payload  :  { } ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									normalised  =  normalised . filter ( plugin  =>  plugin . id  ===  id ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  normalised . length  ?  normalised [ 0 ]  :  undefined ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Plugins . list  =  async  function  ( matching )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( matching  ===  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										matching  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									const  version  =  require ( path . join ( nconf . get ( 'base_dir' ) ,  'package.json' ) ) . version ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									const  url  =  ( nconf . get ( 'registry' )  ||  'https://packages.nodebb.org' )  +  '/api/v1/plugins'  +  ( matching  !==  false  ?  '?version='  +  version  :  '' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									try  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-28 19:53:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										const  body  =  await  request ( url ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											json :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  await  Plugins . normalise ( body ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  catch  ( err )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										winston . error ( 'Error loading '  +  url ,  err ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  await  Plugins . normalise ( [ ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-28 19:53:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Plugins . listTrending  =  async  ( )  =>  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									const  url  =  ` ${ nconf . get ( 'registry' )  ||  'https://packages.nodebb.org' } /api/v1/analytics/top/week ` ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  await  request ( url ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										json :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Plugins . normalise  =  async  function  ( apiReturn )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									const  themeNamePattern  =  /^(@.*?\/)?nodebb-theme-.*$/ ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									const  pluginMap  =  { } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									const  dependencies  =  require ( path . join ( nconf . get ( 'base_dir' ) ,  'package.json' ) ) . dependencies ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-04 10:48:08 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									apiReturn  =  Array . isArray ( apiReturn )  ?  apiReturn  :  [ ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									apiReturn . forEach ( function  ( packageData )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										packageData . id  =  packageData . name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										packageData . installed  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										packageData . active  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										packageData . url  =  packageData . url  ||  ( packageData . repository  ?  packageData . repository . url  :  '' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pluginMap [ packageData . name ]  =  packageData ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-04-22 21:02:58 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									let  installedPlugins  =  await  Plugins . showInstalled ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									installedPlugins  =  installedPlugins . filter ( plugin  =>  plugin  &&  ! plugin . system ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-08 17:04:21 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									installedPlugins . forEach ( function  ( plugin )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										// If it errored out because a package.json or plugin.json couldn't be read, no need to do this stuff
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( plugin . error )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											pluginMap [ plugin . id ]  =  pluginMap [ plugin . id ]  ||  { } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pluginMap [ plugin . id ] . installed  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											pluginMap [ plugin . id ] . error  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2014-04-23 21:23:03 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										pluginMap [ plugin . id ]  =  pluginMap [ plugin . id ]  ||  { } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pluginMap [ plugin . id ] . id  =  pluginMap [ plugin . id ] . id  ||  plugin . id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pluginMap [ plugin . id ] . name  =  plugin . name  ||  pluginMap [ plugin . id ] . name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pluginMap [ plugin . id ] . description  =  plugin . description ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pluginMap [ plugin . id ] . url  =  pluginMap [ plugin . id ] . url  ||  plugin . url ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pluginMap [ plugin . id ] . installed  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pluginMap [ plugin . id ] . isTheme  =  themeNamePattern . test ( plugin . id ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pluginMap [ plugin . id ] . error  =  plugin . error  ||  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pluginMap [ plugin . id ] . active  =  plugin . active ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pluginMap [ plugin . id ] . version  =  plugin . version ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pluginMap [ plugin . id ] . settingsRoute  =  plugin . settingsRoute ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pluginMap [ plugin . id ] . license  =  plugin . license ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										// If package.json defines a version to use, stick to that
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( dependencies . hasOwnProperty ( plugin . id )  &&  semver . valid ( dependencies [ plugin . id ] ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pluginMap [ plugin . id ] . latest  =  dependencies [ plugin . id ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pluginMap [ plugin . id ] . latest  =  pluginMap [ plugin . id ] . latest  ||  plugin . version ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pluginMap [ plugin . id ] . outdated  =  semver . gt ( pluginMap [ plugin . id ] . latest ,  pluginMap [ plugin . id ] . version ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-13 12:33:24 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									const  pluginArray  =  [ ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for  ( var  key  in  pluginMap )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( pluginMap . hasOwnProperty ( key ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pluginArray . push ( pluginMap [ key ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2014-04-22 21:02:58 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									pluginArray . sort ( function  ( a ,  b )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( a . name  >  b . name )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  if  ( a . name  <  b . name )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  pluginArray ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-23 15:03:32 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Plugins . nodeModulesPath  =  path . join ( _ _dirname ,  '../../node_modules' ) ;  
						 
					
						
							
								
									
										
										
										
											2017-07-19 11:38:51 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Plugins . showInstalled  =  async  function  ( )  {  
						 
					
						
							
								
									
										
										
										
											2020-08-14 00:05:03 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									const  dirs  =  await  fs . promises . readdir ( Plugins . nodeModulesPath ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									let  pluginPaths  =  await  findNodeBBModules ( dirs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									pluginPaths  =  pluginPaths . map ( dir  =>  path . join ( Plugins . nodeModulesPath ,  dir ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									async  function  load ( file )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										try  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											const  pluginData  =  await  Plugins . loadPluginInfo ( file ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											const  isActive  =  await  Plugins . isActive ( pluginData . name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											delete  pluginData . hooks ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											delete  pluginData . library ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pluginData . active  =  isActive ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pluginData . installed  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pluginData . error  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  pluginData ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  catch  ( err )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-20 23:32:12 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											winston . error ( err . stack ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									const  plugins  =  await  Promise . all ( pluginPaths . map ( file  =>  load ( file ) ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  plugins . filter ( Boolean ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								async  function  findNodeBBModules ( dirs )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									const  pluginNamePattern  =  /^(@.*?\/)?nodebb-(theme|plugin|widget|rewards)-.*$/ ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									const  pluginPaths  =  [ ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									await  async . each ( dirs ,  function  ( dirname ,  next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										var  dirPath  =  path . join ( Plugins . nodeModulesPath ,  dirname ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										async . waterfall ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											function  ( cb )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												fs . stat ( dirPath ,  function  ( err ,  stats )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													if  ( err  &&  err . code  !==  'ENOENT' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														return  cb ( err ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													if  ( err  ||  ! stats . isDirectory ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														return  next ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													if  ( pluginNamePattern . test ( dirname ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														pluginPaths . push ( dirname ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														return  next ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-27 01:44:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-28 01:16:21 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													if  ( dirname [ 0 ]  !==  '@' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														return  next ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													fs . readdir ( dirPath ,  cb ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2013-12-03 13:36:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-22 00:30:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											function  ( subdirs ,  cb )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												async . each ( subdirs ,  function  ( subdir ,  next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													if  ( ! pluginNamePattern . test ( subdir ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														return  next ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													var  subdirPath  =  path . join ( dirPath ,  subdir ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													fs . stat ( subdirPath ,  function  ( err ,  stats )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														if  ( err  &&  err . code  !==  'ENOENT' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															return  next ( err ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														if  ( err  ||  ! stats . isDirectory ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															return  next ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														pluginPaths . push ( dirname  +  '/'  +  subdir ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														next ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} ,  cb ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										] ,  next ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  pluginPaths ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2018-11-19 13:03:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-24 12:02:16 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								require ( '../promisify' ) ( Plugins ) ;