From e351fe271fae1070fa3bb830a08394af1345fd3c Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 16 Sep 2021 12:25:37 +0200 Subject: [PATCH] CL into PL refactoring --- Platform/Client/githubServer.js | 48 ++++++++-------- Platform/Client/httpInterface.js | 45 ++++++++------- Platform/Client/taskManagerServer.js | 2 +- Platform/Client/web3Server.js | 2 +- Platform/Client/webSocketsInterface.js | 2 +- Platform/PlatformApp.js | 56 +++++++++---------- PlatformRoot.js | 10 ++-- .../{CL => PL}/Utilities/AsyncFunctions.js | 0 .../{CL => PL}/Utilities/WebAccess.js | 0 .../project-schema-file.json | 2 +- ...ject-CL.json => Education-Project-PL.json} | 6 +- ...oject-CL.json => Ethereum-Project-PL.json} | 6 +- ...ct-CL.json => Foundations-Project-PL.json} | 6 +- ...{Superalgos-CL.json => Superalgos-PL.json} | 4 +- .../Governance/Plugins/Assets/Superalgos.json | 6 +- .../User-Profiles/Luis-Fernando-Molina.json | 4 +- .../Plugins/User-Profiles/PLuv.json | 4 +- .../Plugins/User-Profiles/Smidy13.json | 2 +- .../Token-Distribution-Education-Project.json | 4 +- .../Token-Distribution-Ethereum-Project.json | 4 +- ...oken-Distribution-Foundations-Project.json | 4 +- .../Token-Distribution-Superalgos.json | 4 +- Projects/ProjectsSchema.json | 8 +-- 23 files changed, 117 insertions(+), 112 deletions(-) rename Projects/Foundations/{CL => PL}/Utilities/AsyncFunctions.js (100%) rename Projects/Foundations/{CL => PL}/Utilities/WebAccess.js (100%) rename Projects/Governance/Plugins/Assets/{Education-Project-CL.json => Education-Project-PL.json} (90%) rename Projects/Governance/Plugins/Assets/{Ethereum-Project-CL.json => Ethereum-Project-PL.json} (90%) rename Projects/Governance/Plugins/Assets/{Foundations-Project-CL.json => Foundations-Project-PL.json} (91%) rename Projects/Governance/Plugins/Assets/{Superalgos-CL.json => Superalgos-PL.json} (99%) diff --git a/Platform/Client/githubServer.js b/Platform/Client/githubServer.js index 32debc9da..4c0521a8b 100644 --- a/Platform/Client/githubServer.js +++ b/Platform/Client/githubServer.js @@ -93,7 +93,7 @@ exports.newGithubServer = function newGithubServer() { while (lastPage === false) { try { page++ - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) let listResponse = await octokit[endpoint][method]({ owner, repo, @@ -223,7 +223,7 @@ exports.newGithubServer = function newGithubServer() { try { page++ - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) let listResponse = await octokit.rest.pulls.list({ owner: owner, @@ -284,7 +284,7 @@ exports.newGithubServer = function newGithubServer() { /* Lets get the files changed at this Pull Request. */ - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) let listResponse = await octokit.rest.pulls.listFiles({ owner: owner, repo: repo, @@ -309,7 +309,7 @@ exports.newGithubServer = function newGithubServer() { console.log('[WARN] Github Server -> mergeGithubPullRequests -> Merge Failed -> Pull Request "' + pullRequest.title + '" not merged because Github could not merge it. -> mergeResponse.message = ' + mergeResponse.data.message) } else { console.log('[INFO] Github Server -> mergeGithubPullRequests -> Merge Succed -> Pull Request "' + pullRequest.title + '" successfully merged. -> mergeResponse.message = ' + mergeResponse.data.message) - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.issues.createComment({ owner: owner, repo: repo, @@ -333,7 +333,7 @@ exports.newGithubServer = function newGithubServer() { let pullRequestFile = filesChanged[j] let fileContentUrl = pullRequestFile.raw_url if (fileContentUrl.indexOf('Governance/Plugins/User-Profiles') >= 0) { - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.issues.createComment({ owner: owner, repo: repo, @@ -341,7 +341,7 @@ exports.newGithubServer = function newGithubServer() { body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that a User Profile file... \n\n' + fileContentUrl + '\n\n...was submitted together with ' + (filesChanged.length - 1) + ' other file/s. User Profiles files as per the Governance System rules, must be the only file present at a Pull Request in order to pass all the validations and be automatically merged.' }); - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.pulls.update({ owner: owner, repo: repo, @@ -379,7 +379,7 @@ exports.newGithubServer = function newGithubServer() { if (githubUsername !== fileName) { console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #2 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the File Name. -> Github Username = ' + githubUsername + '-> fileName = ' + fileName) - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.issues.createComment({ owner: owner, repo: repo, @@ -387,7 +387,7 @@ exports.newGithubServer = function newGithubServer() { body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that the Github User "' + githubUsername + '" who submitted it, is not equal to the name of the User Profile Plugin File.\n\n File Name = "' + fileName + '"' }); - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.pulls.update({ owner: owner, repo: repo, @@ -402,8 +402,8 @@ exports.newGithubServer = function newGithubServer() { /* Validation #3: The file changed at the PR is a User Profile. */ - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) - fileContent = await CL.projects.foundations.utilities.webAccess.fetchAPIDataFile(fileContentUrl) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + fileContent = await PL.projects.foundations.utilities.webAccess.fetchAPIDataFile(fileContentUrl) userProfile = JSON.parse(fileContent) if (userProfile.type !== 'User Profile') { @@ -421,7 +421,7 @@ exports.newGithubServer = function newGithubServer() { if (messageSigned !== githubUsername) { console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #4 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the Message Signed at the User Profile. -> Github Username = ' + githubUsername + '-> messageSigned = ' + messageSigned) - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.issues.createComment({ owner: owner, repo: repo, @@ -429,7 +429,7 @@ exports.newGithubServer = function newGithubServer() { body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that the Github User "' + githubUsername + '" who submitted it, is not equal to the Message Signed at the User Profile.\n\n Message Signed = "' + messageSigned + '"' }); - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.pulls.update({ owner: owner, repo: repo, @@ -447,7 +447,7 @@ exports.newGithubServer = function newGithubServer() { if (userProfile.name !== githubUsername) { console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #5 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the User Profile node\'s name. -> Github Username = ' + githubUsername + '-> userProfile.name = ' + userProfile.name) - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.issues.createComment({ owner: owner, repo: repo, @@ -455,7 +455,7 @@ exports.newGithubServer = function newGithubServer() { body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that the Github User "' + githubUsername + '" who submitted it, is not equal to the User Profile node\'s name.\n\n User Profile Name = "' + userProfile.name + '"' }); - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.pulls.update({ owner: owner, repo: repo, @@ -495,7 +495,7 @@ exports.newGithubServer = function newGithubServer() { console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #6 Failed -> Pull Request "' + pullRequest.title + '" not merged because the User Profile Id already exists and belongs to another User Profile on record. -> Profile Id = ' + userProfile.id + '-> User Profile with the same Id = ' + testUserProfile) - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.issues.createComment({ owner: owner, repo: repo, @@ -503,7 +503,7 @@ exports.newGithubServer = function newGithubServer() { body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because the User Profile Id already exists and belongs to another User Profile on record. \n\nUser Profile Id = "' + userProfile.id + '" \n\n User Profile with the same Id = "' + testUserProfile + '"' }); - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.pulls.update({ owner: owner, repo: repo, @@ -538,7 +538,7 @@ exports.newGithubServer = function newGithubServer() { let config = JSON.parse(otherUserProfile.config) let messageSigned = JSON.stringify(config.signature) - let serverResponse = await CL.servers.WEB3_SERVER.recoverAddress( + let serverResponse = await PL.servers.WEB3_SERVER.recoverAddress( messageSigned ) userProfileIdMap.set(serverResponse.address, otherUserProfile.name) @@ -546,7 +546,7 @@ exports.newGithubServer = function newGithubServer() { let config = JSON.parse(userProfile.config) let messageSigned = JSON.stringify(config.signature) - let serverResponse = await CL.servers.WEB3_SERVER.recoverAddress( + let serverResponse = await PL.servers.WEB3_SERVER.recoverAddress( messageSigned ) @@ -556,7 +556,7 @@ exports.newGithubServer = function newGithubServer() { console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #7 Failed -> Pull Request "' + pullRequest.title + '" not merged because the User Profile Blockchain Account already exists and belongs to another User Profile on record. -> Profile Blockchain Account = ' + serverResponse.address + '-> User Profile with the same Blockchain Account = ' + testUserProfile) - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.issues.createComment({ owner: owner, repo: repo, @@ -564,7 +564,7 @@ exports.newGithubServer = function newGithubServer() { body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because the User Profile Blockchain Account already exists and belongs to another User Profile on record. \n\nUser Profile Blockchain Account = "' + serverResponse.address + '" \n\n User Profile with the same Blockchain Account = "' + testUserProfile + '"' }); - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.pulls.update({ owner: owner, repo: repo, @@ -582,7 +582,7 @@ exports.newGithubServer = function newGithubServer() { /* All validations passed, we will proceed an merge this Pull Request. */ - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) mergeResponse = await octokit.rest.pulls.merge({ owner: owner, repo: repo, @@ -603,7 +603,7 @@ exports.newGithubServer = function newGithubServer() { try { page++ - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) let listResponse = await octokit.rest.pulls.list({ owner: owner, @@ -631,7 +631,7 @@ exports.newGithubServer = function newGithubServer() { for (let i = 0; i < githubPrListMaster.length; i++) { let pullRequest = githubPrListMaster[i] - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.issues.createComment({ owner: owner, repo: repo, @@ -639,7 +639,7 @@ exports.newGithubServer = function newGithubServer() { body: 'Hi, this is the Superalgos Governance System taking notice that you have submitted a pull request directly to the master branch.\n\nThanks for submitting a PR to the Superalgos Project. We value every contribution and everyone is welcome to send PRs. Unfortunatelly we are not merging pull requests directly into the master branch. Consider resubmitting to the develop branch intstead. For your convinienve, you can swithch branches from within the app, at the footer of the Docs tab. \n\n I will close this pull request now and look forward for your next contribution either to the develop branch or any other branch available for this purpose.' }); - await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) + await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.pulls.update({ owner: owner, repo: repo, diff --git a/Platform/Client/httpInterface.js b/Platform/Client/httpInterface.js index de684eb6f..0932d6e4a 100644 --- a/Platform/Client/httpInterface.js +++ b/Platform/Client/httpInterface.js @@ -24,13 +24,13 @@ exports.newHttpInterface = function newHttpInterface() { /* We will create an HTTP Server and leave it running forever. */ - SA.nodeModules.http.createServer(onHttpRequest).listen(global.env.CLIENT_HTTP_INTERFACE_PORT) - /* Starting the browser now is optional */ - if (process.argv.includes("noBrowser")) { - //Running Client only with no UI. - } else { - SA.nodeModules.open('http://localhost:' + global.env.CLIENT_HTTP_INTERFACE_PORT) - } + SA.nodeModules.http.createServer(onHttpRequest).listen(global.env.CLIENT_HTTP_INTERFACE_PORT) + /* Starting the browser now is optional */ + if (process.argv.includes("noBrowser")) { + //Running Client only with no UI. + } else { + SA.nodeModules.open('http://localhost:' + global.env.CLIENT_HTTP_INTERFACE_PORT) + } } function onHttpRequest(httpRequest, httpResponse) { @@ -52,7 +52,7 @@ exports.newHttpInterface = function newHttpInterface() { switch (params.method) { case 'getNetworkClientStatus': { - let serverResponse = await CL.servers.WEB3_SERVER.getNetworkClientStatus( + let serverResponse = await PL.servers.WEB3_SERVER.getNetworkClientStatus( params.host, params.port, params.interface @@ -63,7 +63,7 @@ exports.newHttpInterface = function newHttpInterface() { } case 'createWalletAccount': { - let serverResponse = await CL.servers.WEB3_SERVER.createWalletAccount( + let serverResponse = await PL.servers.WEB3_SERVER.createWalletAccount( params.entropy ) @@ -72,7 +72,7 @@ exports.newHttpInterface = function newHttpInterface() { } case 'getWalletBalances': { - let serverResponse = await CL.servers.WEB3_SERVER.getWalletBalances( + let serverResponse = await PL.servers.WEB3_SERVER.getWalletBalances( params.host, params.port, params.interface, @@ -84,7 +84,7 @@ exports.newHttpInterface = function newHttpInterface() { } case 'signData': { - let serverResponse = await CL.servers.WEB3_SERVER.signData( + let serverResponse = await PL.servers.WEB3_SERVER.signData( params.privateKey, params.data ) @@ -94,7 +94,7 @@ exports.newHttpInterface = function newHttpInterface() { } case 'recoverAddress': { - let serverResponse = await CL.servers.WEB3_SERVER.recoverAddress( + let serverResponse = await PL.servers.WEB3_SERVER.recoverAddress( params.signature ) @@ -103,7 +103,7 @@ exports.newHttpInterface = function newHttpInterface() { } case 'mnemonicToPrivateKey': { - let serverResponse = await CL.servers.WEB3_SERVER.mnemonicToPrivateKey( + let serverResponse = await PL.servers.WEB3_SERVER.mnemonicToPrivateKey( params.mnemonic ) @@ -625,7 +625,7 @@ exports.newHttpInterface = function newHttpInterface() { contribute() async function contribute() { - const { lookpath } = SA.nodeModules.lookpath + const { lookpath } = SA.nodeModules.lookpath const gitpath = await lookpath('git') if (gitpath === undefined) { console.log('[ERROR] `git` not installed.') @@ -1000,7 +1000,7 @@ exports.newHttpInterface = function newHttpInterface() { switch (params.method) { case 'getGithubStars': { - let serverResponse = await CL.servers.GITHUB_SERVER.getGithubStars( + let serverResponse = await PL.servers.GITHUB_SERVER.getGithubStars( params.repository, params.username, params.token @@ -1011,7 +1011,7 @@ exports.newHttpInterface = function newHttpInterface() { } case 'getGithubWatchers': { - let serverResponse = await CL.servers.GITHUB_SERVER.getGithubWatchers( + let serverResponse = await PL.servers.GITHUB_SERVER.getGithubWatchers( params.repository, params.username, params.token @@ -1022,7 +1022,7 @@ exports.newHttpInterface = function newHttpInterface() { } case 'getGithubForks': { - let serverResponse = await CL.servers.GITHUB_SERVER.getGithubForks( + let serverResponse = await PL.servers.GITHUB_SERVER.getGithubForks( params.repository, params.username, params.token @@ -1033,7 +1033,7 @@ exports.newHttpInterface = function newHttpInterface() { } case 'mergePullRequests': { - let serverResponse = await CL.servers.GITHUB_SERVER.mergePullRequests( + let serverResponse = await PL.servers.GITHUB_SERVER.mergePullRequests( params.commitMessage, params.username, params.token @@ -1044,7 +1044,7 @@ exports.newHttpInterface = function newHttpInterface() { } case 'payContributors': { - let serverResponse = await CL.servers.WEB3_SERVER.payContributors( + let serverResponse = await PL.servers.WEB3_SERVER.payContributors( params.contractAddress, params.contractAbi, params.paymentsArray, @@ -1375,6 +1375,11 @@ exports.newHttpInterface = function newHttpInterface() { let folder = unescape(requestPath[3]) let fileName = unescape(requestPath[4]) + /*Beta 12 Refactoring Code: Remove this before realeasing beta 12.*/ + if (fileName === 'Superalgos-CL.json') { + fileName = 'Superalgos-PL.json' + } + let response = await SA.projects.foundations.utilities.plugins.getPluginFileContent( project, folder, @@ -1693,7 +1698,7 @@ exports.newHttpInterface = function newHttpInterface() { break default: { - SA.projects.foundations.utilities.httpResponses.respondWithWebFile(httpResponse, endpointOrFile, global.env.PATH_TO_CLIENT) + SA.projects.foundations.utilities.httpResponses.respondWithWebFile(httpResponse, endpointOrFile, global.env.PATH_TO_CLIENT) } } } catch (err) { diff --git a/Platform/Client/taskManagerServer.js b/Platform/Client/taskManagerServer.js index da0cc381b..b0e3b6161 100644 --- a/Platform/Client/taskManagerServer.js +++ b/Platform/Client/taskManagerServer.js @@ -263,7 +263,7 @@ responseWaiters.set(command.callerId, responseCallBack) } - CL.servers.EVENT_SERVER.onMessage(JSON.stringify(command), thisObject.onMessage) + PL.servers.EVENT_SERVER.onMessage(JSON.stringify(command), thisObject.onMessage) } catch (err) { console.log('[ERROR] Client -> Task Manager Server -> sendCommand -> Error Sending Command to Events Server -> command = ' + JSON.stringify(command)) console.log('[ERROR] Client -> Task Manager Server -> sendCommand -> Error Sending Command to Events Server -> error = ' + err.stack) diff --git a/Platform/Client/web3Server.js b/Platform/Client/web3Server.js index c1cf61683..321c2c10b 100644 --- a/Platform/Client/web3Server.js +++ b/Platform/Client/web3Server.js @@ -269,7 +269,7 @@ exports.newWeb3Server = function newWeb3Server() { let privateKey = response.privateKey for (let i = 0; i < paymentsArray.length; i++) { - await CL.projects.foundations.utilities.asyncFunctions.sleep(10000) + await PL.projects.foundations.utilities.asyncFunctions.sleep(10000) let payment = paymentsArray[i] sendTokens( i + 1, diff --git a/Platform/Client/webSocketsInterface.js b/Platform/Client/webSocketsInterface.js index b8e6ccca1..084bdea76 100644 --- a/Platform/Client/webSocketsInterface.js +++ b/Platform/Client/webSocketsInterface.js @@ -86,7 +86,7 @@ } - CL.servers.EVENT_SERVER.onMessage(messageToEventServer, onResponse) + PL.servers.EVENT_SERVER.onMessage(messageToEventServer, onResponse) function onResponse(message) { socket.send(message) diff --git a/Platform/PlatformApp.js b/Platform/PlatformApp.js index 56f39180f..6c1795f19 100644 --- a/Platform/PlatformApp.js +++ b/Platform/PlatformApp.js @@ -76,38 +76,38 @@ exports.newPlatformApp = function newPlatformApp() { /* Setting up servers running inside this Client. */ - CL.servers = {} + PL.servers = {} console.log('SUPERALGOS PLATFORM CLIENT SERVERS:') console.log('') - CL.servers.WEB_SERVER = WEB_SERVER.newWebServer() - CL.servers.WEB_SERVER.initialize() - CL.servers.WEB_SERVER.run() + PL.servers.WEB_SERVER = WEB_SERVER.newWebServer() + PL.servers.WEB_SERVER.initialize() + PL.servers.WEB_SERVER.run() console.log('Web Server .................................................. Started') - CL.servers.UI_FILE_SERVER = UI_FILE_SERVER.newUIFileServer() - CL.servers.UI_FILE_SERVER.initialize() - CL.servers.UI_FILE_SERVER.run() + PL.servers.UI_FILE_SERVER = UI_FILE_SERVER.newUIFileServer() + PL.servers.UI_FILE_SERVER.initialize() + PL.servers.UI_FILE_SERVER.run() console.log('UI File Server .............................................. Started') - CL.servers.PROJECT_FILE_SERVER = PROJECT_FILE_SERVER.newProjectFileServer() - CL.servers.PROJECT_FILE_SERVER.initialize() - CL.servers.PROJECT_FILE_SERVER.run() + PL.servers.PROJECT_FILE_SERVER = PROJECT_FILE_SERVER.newProjectFileServer() + PL.servers.PROJECT_FILE_SERVER.initialize() + PL.servers.PROJECT_FILE_SERVER.run() console.log('Project File Server ......................................... Started') - CL.servers.PLUGIN_SERVER = PLUGIN_SERVER.newPluginServer() - CL.servers.PLUGIN_SERVER.initialize() - CL.servers.PLUGIN_SERVER.run() + PL.servers.PLUGIN_SERVER = PLUGIN_SERVER.newPluginServer() + PL.servers.PLUGIN_SERVER.initialize() + PL.servers.PLUGIN_SERVER.run() console.log('Plugin Server ............................................... Started') - CL.servers.DATA_FILE_SERVER = DATA_FILE_SERVER.newDataFileServer() - CL.servers.DATA_FILE_SERVER.initialize() - CL.servers.DATA_FILE_SERVER.run() + PL.servers.DATA_FILE_SERVER = DATA_FILE_SERVER.newDataFileServer() + PL.servers.DATA_FILE_SERVER.initialize() + PL.servers.DATA_FILE_SERVER.run() console.log('Data File Server ............................................ Started') - CL.servers.EVENT_SERVER = EVENT_SERVER.newEventServer() - CL.servers.EVENT_SERVER.initialize() - CL.servers.EVENT_SERVER.run() + PL.servers.EVENT_SERVER = EVENT_SERVER.newEventServer() + PL.servers.EVENT_SERVER.initialize() + PL.servers.EVENT_SERVER.run() console.log('Events Server ............................................... Started') TASK_MANAGER_SERVER = TASK_MANAGER_SERVER.newTaskManagerServer() @@ -115,19 +115,19 @@ exports.newPlatformApp = function newPlatformApp() { TASK_MANAGER_SERVER.run() console.log('Task Manager Server ......................................... Started') - CL.servers.CCXT_SERVER = CCXT_SERVER.newCCXTServer() - CL.servers.CCXT_SERVER.initialize() - CL.servers.CCXT_SERVER.run() + PL.servers.CCXT_SERVER = CCXT_SERVER.newCCXTServer() + PL.servers.CCXT_SERVER.initialize() + PL.servers.CCXT_SERVER.run() console.log('CCXT Server ................................................. Started') - CL.servers.WEB3_SERVER = WEB3_SERVER.newWeb3Server() - CL.servers.WEB3_SERVER.initialize() - CL.servers.WEB3_SERVER.run() + PL.servers.WEB3_SERVER = WEB3_SERVER.newWeb3Server() + PL.servers.WEB3_SERVER.initialize() + PL.servers.WEB3_SERVER.run() console.log('WEB3 Server ................................................. Started') - CL.servers.GITHUB_SERVER = GITHUB_SERVER.newGithubServer() - CL.servers.GITHUB_SERVER.initialize() - CL.servers.GITHUB_SERVER.run() + PL.servers.GITHUB_SERVER = GITHUB_SERVER.newGithubServer() + PL.servers.GITHUB_SERVER.initialize() + PL.servers.GITHUB_SERVER.run() console.log('Github Server ............................................... Started') console.log('') diff --git a/PlatformRoot.js b/PlatformRoot.js index 814f5c756..396a1c727 100644 --- a/PlatformRoot.js +++ b/PlatformRoot.js @@ -6,10 +6,10 @@ load all node dependencies and get them ready to the actual App. */ /* -The CL object is accesible everywhere at the Superalgos Platform Client. +The PL object is accesible everywhere at the Superalgos Platform Client. It provides access to all modules built for this Client. */ -global.CL = {} +global.PL = {} /* The SA object is accesible everywhere at the Superalgos Desktop App. It provides access to all modules built for Superalgos in general. @@ -28,7 +28,7 @@ Setting up the modules that will be available, defined at the Project Schema fil */ let MULTI_PROJECT = require('./MultiProject.js'); let MULTI_PROJECT_MODULE = MULTI_PROJECT.newMultiProject() -MULTI_PROJECT_MODULE.initialize(CL, 'CL') +MULTI_PROJECT_MODULE.initialize(PL, 'PL') MULTI_PROJECT_MODULE.initialize(SA, 'SA') /* Setting up external dependencies. @@ -54,7 +54,7 @@ SA.nodeModules = { run() async function run() { - CL.app = require('./Platform/PlatformApp.js').newPlatformApp() - await CL.app.run() + PL.app = require('./Platform/PlatformApp.js').newPlatformApp() + await PL.app.run() console.log('Superalgos Platform App is Running!') } diff --git a/Projects/Foundations/CL/Utilities/AsyncFunctions.js b/Projects/Foundations/PL/Utilities/AsyncFunctions.js similarity index 100% rename from Projects/Foundations/CL/Utilities/AsyncFunctions.js rename to Projects/Foundations/PL/Utilities/AsyncFunctions.js diff --git a/Projects/Foundations/CL/Utilities/WebAccess.js b/Projects/Foundations/PL/Utilities/WebAccess.js similarity index 100% rename from Projects/Foundations/CL/Utilities/WebAccess.js rename to Projects/Foundations/PL/Utilities/WebAccess.js diff --git a/Projects/Foundations/Schemas/Docs-Concepts/P/Project/Project-Schema-File/project-schema-file.json b/Projects/Foundations/Schemas/Docs-Concepts/P/Project/Project-Schema-File/project-schema-file.json index b9a6cbcf0..49bdd10c0 100644 --- a/Projects/Foundations/Schemas/Docs-Concepts/P/Project/Project-Schema-File/project-schema-file.json +++ b/Projects/Foundations/Schemas/Docs-Concepts/P/Project/Project-Schema-File/project-schema-file.json @@ -1,7 +1,7 @@ { "type": "Project Schema File", "definition": { - "text": "It is the most basic and low level system-wide configuration file. You will find it at the Projects folder. It contains a list of all integrated projects and for each one the list of javascript modules organized in different categories, like Function Libraries, Utilities, Spaces, Globals, etc; in turn organized into the broather categories UI, TS and CL.", + "text": "It is the most basic and low level system-wide configuration file. You will find it at the Projects folder. It contains a list of all integrated projects and for each one the list of javascript modules organized in different categories, like Function Libraries, Utilities, Spaces, Globals, etc; in turn organized into the broather categories UI, TS and PL.", "updated": 1614939492529 }, "paragraphs": [ diff --git a/Projects/Governance/Plugins/Assets/Education-Project-CL.json b/Projects/Governance/Plugins/Assets/Education-Project-PL.json similarity index 90% rename from Projects/Governance/Plugins/Assets/Education-Project-CL.json rename to Projects/Governance/Plugins/Assets/Education-Project-PL.json index e4315bddf..f691d460b 100644 --- a/Projects/Governance/Plugins/Assets/Education-Project-CL.json +++ b/Projects/Governance/Plugins/Assets/Education-Project-PL.json @@ -1,13 +1,13 @@ { "type": "Assets", - "name": "Education-Project-CL", - "config": "{\"codeName\":\"Education-Project-CL\"}", + "name": "Education-Project-PL", + "config": "{\"codeName\":\"Education-Project-PL\"}", "project": "Governance", "assetClasses": [ { "type": "Asset Class", "name": "Client", - "config": "{\n \"folderPath\": \"Education/CL\"\n}", + "config": "{\n \"folderPath\": \"Education/PL\"\n}", "project": "Governance", "assetClasses": [], "assets": [], diff --git a/Projects/Governance/Plugins/Assets/Ethereum-Project-CL.json b/Projects/Governance/Plugins/Assets/Ethereum-Project-PL.json similarity index 90% rename from Projects/Governance/Plugins/Assets/Ethereum-Project-CL.json rename to Projects/Governance/Plugins/Assets/Ethereum-Project-PL.json index 370df2ecb..6e824e5b0 100644 --- a/Projects/Governance/Plugins/Assets/Ethereum-Project-CL.json +++ b/Projects/Governance/Plugins/Assets/Ethereum-Project-PL.json @@ -1,13 +1,13 @@ { "type": "Assets", - "name": "Ethereum-Project-CL", - "config": "{\"codeName\":\"Ethereum-Project-CL\"}", + "name": "Ethereum-Project-PL", + "config": "{\"codeName\":\"Ethereum-Project-PL\"}", "project": "Governance", "assetClasses": [ { "type": "Asset Class", "name": "Client", - "config": "{\n \"folderPath\": \"Ethereum/CL\"\n}", + "config": "{\n \"folderPath\": \"Ethereum/PL\"\n}", "project": "Governance", "assetClasses": [], "assets": [], diff --git a/Projects/Governance/Plugins/Assets/Foundations-Project-CL.json b/Projects/Governance/Plugins/Assets/Foundations-Project-PL.json similarity index 91% rename from Projects/Governance/Plugins/Assets/Foundations-Project-CL.json rename to Projects/Governance/Plugins/Assets/Foundations-Project-PL.json index e18642603..5f7a3f350 100644 --- a/Projects/Governance/Plugins/Assets/Foundations-Project-CL.json +++ b/Projects/Governance/Plugins/Assets/Foundations-Project-PL.json @@ -1,13 +1,13 @@ { "type": "Assets", - "name": "Foundations-Project-CL", - "config": "{\"codeName\":\"Foundations-Project-CL\"}", + "name": "Foundations-Project-PL", + "config": "{\"codeName\":\"Foundations-Project-PL\"}", "project": "Governance", "assetClasses": [ { "type": "Asset Class", "name": "Client", - "config": "{\n \"folderPath\": \"Foundations/CL\"\n}", + "config": "{\n \"folderPath\": \"Foundations/PL\"\n}", "project": "Governance", "assetClasses": [], "assets": [], diff --git a/Projects/Governance/Plugins/Assets/Superalgos-CL.json b/Projects/Governance/Plugins/Assets/Superalgos-PL.json similarity index 99% rename from Projects/Governance/Plugins/Assets/Superalgos-CL.json rename to Projects/Governance/Plugins/Assets/Superalgos-PL.json index 8ac24dce5..671a34637 100644 --- a/Projects/Governance/Plugins/Assets/Superalgos-CL.json +++ b/Projects/Governance/Plugins/Assets/Superalgos-PL.json @@ -1,7 +1,7 @@ { "type": "Assets", - "name": "Superalgos-CL", - "config": "{\"codeName\":\"Superalgos-CL\"}", + "name": "Superalgos-PL", + "config": "{\"codeName\":\"Superalgos-PL\"}", "project": "Governance", "assetClasses": [ { diff --git a/Projects/Governance/Plugins/Assets/Superalgos.json b/Projects/Governance/Plugins/Assets/Superalgos.json index 2caffa09e..789c9679d 100644 --- a/Projects/Governance/Plugins/Assets/Superalgos.json +++ b/Projects/Governance/Plugins/Assets/Superalgos.json @@ -12,7 +12,7 @@ "assetClasses": [ { "type": "Asset Class", - "name": "Superalgos-CL", + "name": "Superalgos-PL", "config": "{\n \"description\": \"\", \"relativeWeight\": 0 \n}", "project": "Governance", "assetClasses": [], @@ -40,12 +40,12 @@ }, "referenceParent": { "type": "Assets", - "name": "Superalgos-CL", + "name": "Superalgos-PL", "id": "4a693d1b-c9cc-4ab6-aa56-e1e1e1e18854" }, "referenceParentCombinedNodePath": [ [ - "Superalgos-CL", + "Superalgos-PL", "Assets", "Governance", "4a693d1b-c9cc-4ab6-aa56-e1e1e1e18854" diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index b43a8e433..04bbd1a5f 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -7792,7 +7792,7 @@ }, "referenceParent": { "type": "Asset Class", - "name": "Superalgos-CL", + "name": "Superalgos-PL", "id": "5d13e350-4267-4d2f-a3fa-a1fabd5df10d" }, "referenceParentCombinedNodePath": [ @@ -7809,7 +7809,7 @@ "d6e22645-35ee-443e-9349-01d2e8362d79" ], [ - "Superalgos-CL", + "Superalgos-PL", "Asset Class", "Governance", "5d13e350-4267-4d2f-a3fa-a1fabd5df10d" diff --git a/Projects/Governance/Plugins/User-Profiles/PLuv.json b/Projects/Governance/Plugins/User-Profiles/PLuv.json index d97b9e7ec..d6cf7e47c 100644 --- a/Projects/Governance/Plugins/User-Profiles/PLuv.json +++ b/Projects/Governance/Plugins/User-Profiles/PLuv.json @@ -6305,7 +6305,7 @@ }, "referenceParent": { "type": "Asset Class", - "name": "Superalgos-CL", + "name": "Superalgos-PL", "id": "5d13e350-4267-4d2f-a3fa-a1fabd5df10d" }, "referenceParentCombinedNodePath": [ @@ -6322,7 +6322,7 @@ "d6e22645-35ee-443e-9349-01d2e8362d79" ], [ - "Superalgos-CL", + "Superalgos-PL", "Asset Class", "Governance", "5d13e350-4267-4d2f-a3fa-a1fabd5df10d" diff --git a/Projects/Governance/Plugins/User-Profiles/Smidy13.json b/Projects/Governance/Plugins/User-Profiles/Smidy13.json index dc6a70868..816f16f0d 100644 --- a/Projects/Governance/Plugins/User-Profiles/Smidy13.json +++ b/Projects/Governance/Plugins/User-Profiles/Smidy13.json @@ -10681,7 +10681,7 @@ }, "referenceParentCombinedNodePath": [ [ - "Superalgos-CL", + "Superalgos-PL", "Assets", "Governance", "4a693d1b-c9cc-4ab6-aa56-e1e1e1e18854" diff --git a/Projects/Governance/Plugins/Workspaces/Token-Distribution-Education-Project.json b/Projects/Governance/Plugins/Workspaces/Token-Distribution-Education-Project.json index 49108089b..92808b277 100644 --- a/Projects/Governance/Plugins/Workspaces/Token-Distribution-Education-Project.json +++ b/Projects/Governance/Plugins/Workspaces/Token-Distribution-Education-Project.json @@ -1082,8 +1082,8 @@ }, { "type": "Plugin File", - "name": "Education-Project-CL", - "config": "{\"project\":\"Governance\",\"fileName\":\"Education-Project-CL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}", + "name": "Education-Project-PL", + "config": "{\"project\":\"Governance\",\"fileName\":\"Education-Project-PL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}", "project": "Foundations", "id": "eefc0ae6-0364-4c0e-84ba-138ba30e6ce8", "savedPayload": { diff --git a/Projects/Governance/Plugins/Workspaces/Token-Distribution-Ethereum-Project.json b/Projects/Governance/Plugins/Workspaces/Token-Distribution-Ethereum-Project.json index 473b16ca2..d06af6c43 100644 --- a/Projects/Governance/Plugins/Workspaces/Token-Distribution-Ethereum-Project.json +++ b/Projects/Governance/Plugins/Workspaces/Token-Distribution-Ethereum-Project.json @@ -1082,8 +1082,8 @@ }, { "type": "Plugin File", - "name": "Ethereum-Project-CL", - "config": "{\"project\":\"Governance\",\"fileName\":\"Ethereum-Project-CL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}", + "name": "Ethereum-Project-PL", + "config": "{\"project\":\"Governance\",\"fileName\":\"Ethereum-Project-PL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}", "project": "Foundations", "id": "6a48da6b-88ae-4ae0-8638-2473d66abe58", "savedPayload": { diff --git a/Projects/Governance/Plugins/Workspaces/Token-Distribution-Foundations-Project.json b/Projects/Governance/Plugins/Workspaces/Token-Distribution-Foundations-Project.json index cee8937fa..5cbe317d2 100644 --- a/Projects/Governance/Plugins/Workspaces/Token-Distribution-Foundations-Project.json +++ b/Projects/Governance/Plugins/Workspaces/Token-Distribution-Foundations-Project.json @@ -1082,8 +1082,8 @@ }, { "type": "Plugin File", - "name": "Foundations-Project-CL", - "config": "{\"project\":\"Governance\",\"fileName\":\"Foundations-Project-CL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}", + "name": "Foundations-Project-PL", + "config": "{\"project\":\"Governance\",\"fileName\":\"Foundations-Project-PL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}", "project": "Foundations", "id": "81f1afb2-c08c-4f98-88d9-be0790002c09", "savedPayload": { diff --git a/Projects/Governance/Plugins/Workspaces/Token-Distribution-Superalgos.json b/Projects/Governance/Plugins/Workspaces/Token-Distribution-Superalgos.json index 9c9b6f182..6eda7f5be 100644 --- a/Projects/Governance/Plugins/Workspaces/Token-Distribution-Superalgos.json +++ b/Projects/Governance/Plugins/Workspaces/Token-Distribution-Superalgos.json @@ -1193,8 +1193,8 @@ "pluginFiles": [ { "type": "Plugin File", - "name": "Superalgos-CL", - "config": "{\"project\":\"Governance\",\"fileName\":\"Superalgos-CL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}", + "name": "Superalgos-PL", + "config": "{\"project\":\"Governance\",\"fileName\":\"Superalgos-PL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}", "project": "Foundations", "id": "92ef88cd-4921-4a11-ab45-3ae57c6c903c", "savedPayload": { diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index b49b681e4..3eec6d184 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -866,7 +866,7 @@ } ] }, - "CL": { + "PL": { "utilities": [ { "name": "Async Functions", @@ -983,7 +983,7 @@ ] }, "TS": {}, - "CL": {} + "PL": {} }, { "name": "TensorFlow", @@ -1091,7 +1091,7 @@ "processModules": [], "botModules": [] }, - "CL": {} + "PL": {} }, { "name": "Governance", @@ -1283,7 +1283,7 @@ ] }, "TS": {}, - "CL": {}, + "PL": {}, "plugins": [ "User Profiles", "Pools",