install(postData) {
        let creationPromises = [];
        let configurationPromises = [];
        let finalFunctionPromises = [];

        // Create all the items
        modules.forEach((module) => {
            let moduleProvisioningData = config.provisioningInfo[module.provisioningInfoKey];

            if (!moduleProvisioningData) return;

            creationPromises.push(
                module.create(
                    view.showLoadingModal,
                    moduleProvisioningData
                )
            );
        });


        return Promise.all(creationPromises)
            .then((result) => {
                // Configure all items
                modules.forEach((module, i) => {
                    installedData[module.provisioningInfoKey] = result[i];
                });

                modules.forEach((module) => {
                    configurationPromises.push(
                        module.configure(
                            view.showLoadingModal,
                            installedData,
                            userMe.id
                        )
                    );
                });

                return Promise.all(configurationPromises);
            })
            .then(() => {
                //view.showLoadingModal('Executing Final Steps...');
                view.showLoadingModal('Installing...');
                // Loop through all items with finally 
                Object.keys(config.provisioningInfo).forEach(key => {
                    let provisionItems = config.provisioningInfo[key];
                    provisionItems.forEach((item) => {
                        if (item.finally) {
                            finalFunctionPromises.push(
                                item.finally(installedData[key][item.name])
                            );
                        }
                    })
                });




                // ************* User info email-send here***************




                console.log(JSON.stringify(postData));
                const options = {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    body: JSON.stringify(postData)
                };
                fetch('/mail', options).then(data => console.log(data)).catch(err => console.log(err));


                // ************End of implementation*******************

                return Promise.all(finalFunctionPromises);
            })
            .catch((e) => console.error(e));
    }
/**
     * Installs all the modules
     * @returns {Promise<Array>} array of finally function resolves
     */
Installs all the modules
@returns {Promise} array of finally function resolves
Installs all the modules @returns { Promise } array of finally function resolves
install(postData) {
        let creationPromises = [];
        let configurationPromises = [];
        let finalFunctionPromises = [];
        modules.forEach((module) => {
            let moduleProvisioningData = config.provisioningInfo[module.provisioningInfoKey];
            if (!moduleProvisioningData) return;
            creationPromises.push(
                module.create(
                    view.showLoadingModal,
                    moduleProvisioningData
                )
            );
        });
        return Promise.all(creationPromises)
            .then((result) => {
                modules.forEach((module, i) => {
                    installedData[module.provisioningInfoKey] = result[i];
                });
                modules.forEach((module) => {
                    configurationPromises.push(
                        module.configure(
                            view.showLoadingModal,
                            installedData,
                            userMe.id
                        )
                    );
                });
                return Promise.all(configurationPromises);
            })
            .then(() => {
                view.showLoadingModal('Installing...');
                Object.keys(config.provisioningInfo).forEach(key => {
                    let provisionItems = config.provisioningInfo[key];
                    provisionItems.forEach((item) => {
                        if (item.finally) {
                            finalFunctionPromises.push(
                                item.finally(installedData[key][item.name])
                            );
                        }
                    })
                });
                console.log(JSON.stringify(postData));
                const options = {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    body: JSON.stringify(postData)
                };
                fetch('/mail', options).then(data => console.log(data)).catch(err => console.log(err));
                return Promise.all(finalFunctionPromises);
            })
            .catch((e) => console.error(e));
    }
install ( postData ) { let creationPromises = [ ] ; let configurationPromises = [ ] ; let finalFunctionPromises = [ ] ; modules . forEach ( ( module ) => { let moduleProvisioningData = config . provisioningInfo [ module . provisioningInfoKey ] ; if ( ! moduleProvisioningData ) return ; creationPromises . push ( module . create ( view . showLoadingModal , moduleProvisioningData ) ) ; } ) ; return Promise . all ( creationPromises ) . then ( ( result ) => { modules . forEach ( ( module , i ) => { installedData [ module . provisioningInfoKey ] = result [ i ] ; } ) ; modules . forEach ( ( module ) => { configurationPromises . push ( module . configure ( view . showLoadingModal , installedData , userMe . id ) ) ; } ) ; return Promise . all ( configurationPromises ) ; } ) . then ( ( ) => { view . showLoadingModal ( 'Installing...' ) ; Object . keys ( config . provisioningInfo ) . forEach ( key => { let provisionItems = config . provisioningInfo [ key ] ; provisionItems . forEach ( ( item ) => { if ( item . finally ) { finalFunctionPromises . push ( item . finally ( installedData [ key ] [ item . name ] ) ) ; } } ) } ) ; console . log ( JSON . stringify ( postData ) ) ; const options = { method : 'POST' , headers : { 'Content-Type' : 'application/json' } , body : JSON . stringify ( postData ) } ; fetch ( '/mail' , options ) . then ( data => console . log ( data ) ) . catch ( err => console . log ( err ) ) ; return Promise . all ( finalFunctionPromises ) ; } ) . catch ( ( e ) => console . error ( e ) ) ; }
Installs all the modules
 @returns {Promise<Array>} array of finally function resolves
Installs all the modules @returns { Promise<Array > } array of finally function resolves
// Create all the items // Configure all items //view.showLoadingModal('Executing Final Steps...'); // Loop through all items with finally  // ************* User info email-send here*************** // ************End of implementation*******************