diff --git a/.gitignore b/.gitignore index 0ec8e557c..c7aaa09d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ Data-Storage Log-Files My-Workspaces +My-Social-Trading-Data debug.log .DS_Store *.db diff --git a/.vscode/settings.json b/.vscode/settings.json index e94f27f6f..43e1dd87f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,14 +4,16 @@ "**/Documentation": true, "**/Log-Files": true, "**/node_modules": true, - "**/Deprecated-Code": true + "**/Deprecated-Code": true, + "**/My-Social-Trading-Data": true, }, "search.exclude": { "**/Data-Storage": true, "**/Documentation": true, "**/Log-Files": true, "**/node_modules": true, - "**/Deprecated-Code": true + "**/Deprecated-Code": true, + "**/My-Social-Trading-Data": true }, "search.maintainFileSearchCache": true } \ No newline at end of file diff --git a/Desktop/UI/WebApp.js b/Desktop/UI/WebApp.js index f2f771d94..5e7aaa244 100644 --- a/Desktop/UI/WebApp.js +++ b/Desktop/UI/WebApp.js @@ -146,8 +146,21 @@ function newWebApp() { if (event.target && event.target.nodeName === "BUTTON") { switch (event.target.name) { + case 'New Post': { + let textArea = document.getElementById("new-post-text-area") + await sendNewPostEvent( + textArea.value + ) + .then(updateTextArea) + .catch(onError) + + function updateTextArea() { + textArea.value = "" + } + break + } case 'Follow Profile': { - await sendUserTargetProfileEvent( + await sendTargetUserProfileEvent( event.target.userProfileId, SA.projects.socialTrading.globals.eventTypes.FOLLOW_USER_PROFILE ) @@ -164,7 +177,7 @@ function newWebApp() { break } case 'Unfollow Profile': { - await sendUserTargetProfileEvent( + await sendTargetUserProfileEvent( event.target.userProfileId, SA.projects.socialTrading.globals.eventTypes.UNFOLLOW_USER_PROFILE ) @@ -264,7 +277,7 @@ function newWebApp() { table.setAttribute("class", "profile-to-follow-table") } - async function sendUserTargetProfileEvent( + async function sendTargetUserProfileEvent( userProfileId, eventType ) { @@ -274,9 +287,7 @@ function newWebApp() { async function asyncCall(resolve, reject) { let eventMessage let event - /* - Test Query User Profiles. - */ + eventMessage = { eventType: eventType, eventId: SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId(), @@ -301,4 +312,39 @@ function newWebApp() { } } } + + async function sendNewPostEvent( + postText + ) { + + return new Promise((resolve, reject) => { asyncCall(resolve, reject) }) + + async function asyncCall(resolve, reject) { + let eventMessage + let event + + eventMessage = { + eventType: SA.projects.socialTrading.globals.eventTypes.NEW_USER_POST, + eventId: SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId(), + text: postText + } + + event = { + requestType: 'Event', + eventMessage: JSON.stringify(eventMessage) + } + + await UI.projects.socialTrading.modules.webSocketsClient.sendMessage( + JSON.stringify(event) + ) + .then(resolve) + .catch(onError) + + function onError(errorMessage) { + console.log('[ERROR] Event not executed. ' + errorMessage) + console.log('[ERROR] event = ' + JSON.stringify(event)) + reject(errorMessage) + } + } + } } diff --git a/Desktop/WebServer/index.html b/Desktop/WebServer/index.html index fb3d12d3d..0f0c0a561 100644 --- a/Desktop/WebServer/index.html +++ b/Desktop/WebServer/index.html @@ -138,7 +138,7 @@ Permissions - Tool Bar + Tool Bar diff --git a/Projects/Foundations/SA/Utilities/FilesAndDirectories.js b/Projects/Foundations/SA/Utilities/FilesAndDirectories.js index 2f7bc485b..43917b759 100644 --- a/Projects/Foundations/SA/Utilities/FilesAndDirectories.js +++ b/Projects/Foundations/SA/Utilities/FilesAndDirectories.js @@ -2,7 +2,9 @@ exports.newFoundationsUtilitiesFilesAndDirectories = function () { let thisObject = { getDirectories: getDirectories, - getAllFilesInDirectoryAndSubdirectories: getAllFilesInDirectoryAndSubdirectories + getAllFilesInDirectoryAndSubdirectories: getAllFilesInDirectoryAndSubdirectories, + pathFromDate: pathFromDate, + mkDirByPathSync: mkDirByPathSync } return thisObject @@ -51,4 +53,49 @@ exports.newFoundationsUtilitiesFilesAndDirectories = function () { return files.reduce((a, f) => a.concat(f), []); } } + + function pathFromDate(timestamp) { + let file = { date: new Date(timestamp) } + file.year = file.date.getUTCFullYear() + file.month = file.date.getUTCMonth() + 1 + file.day = file.date.getUTCDate() + return file.year + '/' + + TS.projects.foundations.utilities.miscellaneousFunctions.pad(file.month, 2) + '/' + + TS.projects.foundations.utilities.miscellaneousFunctions.pad(file.day, 2) + } + + /* Function to create folders of missing folders at any path. */ + function mkDirByPathSync(targetDir, { isRelativeToScript = false } = {}) { + const path = require('path') + + targetDir = targetDir.substring(0, targetDir.lastIndexOf('/') + 1); + + const sep = '/'; + const initDir = path.isAbsolute(targetDir) ? sep : ''; + const baseDir = isRelativeToScript ? __dirname : '.'; + + return targetDir.split(sep).reduce((parentDir, childDir) => { + const curDir = path.resolve(baseDir, parentDir, childDir); + try { + const fs = require('fs') + fs.mkdirSync(curDir); + } catch (err) { + if (err.code === 'EEXIST') { // curDir already exists! + return curDir; + } + + // To avoid `EISDIR` error on Mac and `EACCES`-->`ENOENT` and `EPERM` on Windows. + if (err.code === 'ENOENT') { // Throw the original parentDir error on curDir `ENOENT` failure. + throw new Error(`EACCES: permission denied, mkdir '${parentDir}'`); + } + + const caughtErr = ['EACCES', 'EPERM', 'EISDIR'].indexOf(err.code) > -1; + if (!caughtErr || caughtErr && curDir === path.resolve(targetDir)) { + throw err; // Throw if it's just the last created dir. + } + } + + return curDir; + }, initDir); + } } \ No newline at end of file diff --git a/Projects/Foundations/SA/Utilities/MiscellaneousFunctions.js b/Projects/Foundations/SA/Utilities/MiscellaneousFunctions.js index 27c00cff2..992619b39 100644 --- a/Projects/Foundations/SA/Utilities/MiscellaneousFunctions.js +++ b/Projects/Foundations/SA/Utilities/MiscellaneousFunctions.js @@ -1,7 +1,8 @@ exports.newFoundationsUtilitiesMiscellaneousFunctions = function () { let thisObject = { - genereteUniqueId: genereteUniqueId + genereteUniqueId: genereteUniqueId, + pad: pad } return thisObject @@ -12,4 +13,9 @@ exports.newFoundationsUtilitiesMiscellaneousFunctions = function () { return v.toString(16) }) } + + function pad(str, max) { + str = str.toString(); + return str.length < max ? pad("0" + str, max) : str; + } } \ No newline at end of file diff --git a/Projects/Foundations/TS/Utilities/MiscellaneousFunctions.js b/Projects/Foundations/TS/Utilities/MiscellaneousFunctions.js index 502378e7d..98d21a40d 100644 --- a/Projects/Foundations/TS/Utilities/MiscellaneousFunctions.js +++ b/Projects/Foundations/TS/Utilities/MiscellaneousFunctions.js @@ -2,9 +2,7 @@ exports.newFoundationsUtilitiesMiscellaneousFunctions = function () { let thisObject = { truncateToThisPrecision: truncateToThisPrecision, - pad: pad, - asyncGetDatasetFile: asyncGetDatasetFile, - mkDirByPathSync: mkDirByPathSync + asyncGetDatasetFile: asyncGetDatasetFile } return thisObject @@ -13,11 +11,6 @@ exports.newFoundationsUtilitiesMiscellaneousFunctions = function () { return parseFloat(floatNumber.toFixed(precision)) } - function pad(str, max) { - str = str.toString(); - return str.length < max ? pad("0" + str, max) : str; - } - async function asyncGetDatasetFile(datasetModule, filePath, fileName) { /* This function helps a caller to use await syntax while the called @@ -39,38 +32,4 @@ exports.newFoundationsUtilitiesMiscellaneousFunctions = function () { return promise } - /* Function to create folders of missing folders at any path. */ - function mkDirByPathSync(targetDir, { isRelativeToScript = false } = {}) { - const path = require('path') - - targetDir = targetDir.substring(0, targetDir.lastIndexOf('/') + 1); - - const sep = '/'; - const initDir = path.isAbsolute(targetDir) ? sep : ''; - const baseDir = isRelativeToScript ? __dirname : '.'; - - return targetDir.split(sep).reduce((parentDir, childDir) => { - const curDir = path.resolve(baseDir, parentDir, childDir); - try { - const fs = require('fs') - fs.mkdirSync(curDir); - } catch (err) { - if (err.code === 'EEXIST') { // curDir already exists! - return curDir; - } - - // To avoid `EISDIR` error on Mac and `EACCES`-->`ENOENT` and `EPERM` on Windows. - if (err.code === 'ENOENT') { // Throw the original parentDir error on curDir `ENOENT` failure. - throw new Error(`EACCES: permission denied, mkdir '${parentDir}'`); - } - - const caughtErr = ['EACCES', 'EPERM', 'EISDIR'].indexOf(err.code) > -1; - if (!caughtErr || caughtErr && curDir === path.resolve(targetDir)) { - throw err; // Throw if it's just the last created dir. - } - } - - return curDir; - }, initDir); - } } \ No newline at end of file diff --git a/Projects/Social-Trading/DK/modules/WebAppInterface.js b/Projects/Social-Trading/DK/modules/WebAppInterface.js index ef3a6bd6f..47524bda3 100644 --- a/Projects/Social-Trading/DK/modules/WebAppInterface.js +++ b/Projects/Social-Trading/DK/modules/WebAppInterface.js @@ -65,6 +65,40 @@ exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModule } return JSON.stringify(response) } + + if ( + eventMessage.eventType === SA.projects.socialTrading.globals.eventTypes.NEW_USER_POST || + eventMessage.eventType === SA.projects.socialTrading.globals.eventTypes.REPLY_TO_USER_POST || + eventMessage.eventType === SA.projects.socialTrading.globals.eventTypes.REPOST_USER_POST + ) { + /* + We need to save the post at the User's storage and remove the text from the message + going to the Network Node. + */ + let commitMessage + switch (eventMessage.eventType) { + case SA.projects.socialTrading.globals.eventTypes.NEW_USER_POST: { + commitMessage = "New Post" + break + } + case SA.projects.socialTrading.globals.eventTypes.REPLY_TO_USER_POST: { + commitMessage = "Reply to User Post" + break + } + case SA.projects.socialTrading.globals.eventTypes.REPOST_USER_POST: { + commitMessage = "Repost User Post" + break + } + } + /* + The post text is eliminated, since it is now at the user's storage, + and a hash of the content was generated, and that is what is going to + the Network Node. + */ + eventMessage.emitterPostHash = await savePostAtStorage(eventMessage.text, commitMessage, eventMessage.timestamp) + eventMessage.text = undefined + } + eventMessage.emitterUserProfileId = DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID messageHeader.eventMessage = JSON.stringify(eventMessage) @@ -84,4 +118,35 @@ exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModule } } } + + async function savePostAtStorage(text, commitMessage, timestamp) { + const { createHash } = await import('crypto') + const hash = createHash('sha256') + let post = { + timestamp: timestamp, + text: text + } + + const fileContent = JSON.stringify(post, undefined, 4) + const fileHash = hash.update(fileContent).digest('hex') + const fileName = fileHash + ".json" + + let filePath = './My-Social-Trading-Data/User-Posts/' + SA.projects.foundations.utilities.filesAndDirectories.pathFromDate(timestamp) + + TS.projects.foundations.utilities.miscellaneousFunctions.mkDirByPathSync(filePath) + SA.nodeModules.fs.writeFileSync(filePath + '/' + fileName, fileContent) + + const options = { + baseDir: process.cwd() + '/My-Social-Trading-Data', + binary: 'git', + maxConcurrentProcesses: 6, + } + const git = SA.nodeModules.simpleGit(options) + + await git.add('./*') + await git.commit(commitMessage) + await git.push('origin') + + return fileHash + } } \ No newline at end of file diff --git a/Projects/Social-Trading/NT/Modules/Event.js b/Projects/Social-Trading/NT/Modules/Event.js index 7db74847a..f0bf34040 100644 --- a/Projects/Social-Trading/NT/Modules/Event.js +++ b/Projects/Social-Trading/NT/Modules/Event.js @@ -139,8 +139,6 @@ exports.newSocialTradingModulesEvent = function newSocialTradingModulesEvent() { emitterUserProfile.addPost( thisObject.emitterUserProfileId, thisObject.targetUserProfileId, - thisObject.emitterBotProfileId, - thisObject.targetBotProfileId, thisObject.emitterPostHash, thisObject.targetPostHash, thisObject.eventType - 10, diff --git a/TaskServer/.vscode/settings.json b/TaskServer/.vscode/settings.json index e94f27f6f..43e1dd87f 100644 --- a/TaskServer/.vscode/settings.json +++ b/TaskServer/.vscode/settings.json @@ -4,14 +4,16 @@ "**/Documentation": true, "**/Log-Files": true, "**/node_modules": true, - "**/Deprecated-Code": true + "**/Deprecated-Code": true, + "**/My-Social-Trading-Data": true, }, "search.exclude": { "**/Data-Storage": true, "**/Documentation": true, "**/Log-Files": true, "**/node_modules": true, - "**/Deprecated-Code": true + "**/Deprecated-Code": true, + "**/My-Social-Trading-Data": true }, "search.maintainFileSearchCache": true } \ No newline at end of file diff --git a/desktop.js b/desktop.js index 67f933c20..a4ee44975 100644 --- a/desktop.js +++ b/desktop.js @@ -44,7 +44,9 @@ SA.nodeModules = { web3: require('web3'), ws: require('ws'), open: require('open'), - http: require('http') + http: require('http'), + octokit: require("@octokit/rest"), + simpleGit: require('simple-git') } /* diff --git a/package-lock.json b/package-lock.json index 469e05fe0..d801cc66a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -220,6 +220,145 @@ "@ethersproject/strings": "^5.4.0" } }, + "@kwsites/file-exists": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", + "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==", + "requires": { + "debug": "^4.1.1" + }, + "dependencies": { + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "@kwsites/promise-deferred": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", + "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==" + }, + "@octokit/auth-token": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz", + "integrity": "sha512-BpGYsPgJt05M7/L/5FoE1PiAbdxXFZkX/3kDYcsvd1v6UhlnE5e96dTDr0ezX/EFwciQxf3cNV0loipsURU+WA==", + "requires": { + "@octokit/types": "^6.0.3" + } + }, + "@octokit/core": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz", + "integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==", + "requires": { + "@octokit/auth-token": "^2.4.4", + "@octokit/graphql": "^4.5.8", + "@octokit/request": "^5.6.0", + "@octokit/request-error": "^2.0.5", + "@octokit/types": "^6.0.3", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/endpoint": { + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", + "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", + "requires": { + "@octokit/types": "^6.0.3", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/graphql": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz", + "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==", + "requires": { + "@octokit/request": "^5.6.0", + "@octokit/types": "^6.0.3", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/openapi-types": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-10.1.1.tgz", + "integrity": "sha512-ygp/6r25Ezb1CJuVMnFfOsScEtPF0zosdTJDZ7mZ+I8IULl7DP1BS5ZvPRwglcarGPXOvS5sHdR0bjnVDDfQdQ==" + }, + "@octokit/plugin-paginate-rest": { + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.0.tgz", + "integrity": "sha512-8YYzALPMvEZ35kgy5pdYvQ22Roz+BIuEaedO575GwE2vb/ACDqQn0xQrTJR4tnZCJn7pi8+AWPVjrFDaERIyXQ==", + "requires": { + "@octokit/types": "^6.26.0" + } + }, + "@octokit/plugin-request-log": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", + "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==" + }, + "@octokit/plugin-rest-endpoint-methods": { + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.10.1.tgz", + "integrity": "sha512-Rf1iMl40I0dIxjh1g32qZ6Ym/uT8QWZMm2vYGG5Vi8SX1MwZvbuxEGXYgmzTUWSD3PYWSLilE2+4L8kmdLGTMg==", + "requires": { + "@octokit/types": "^6.27.0", + "deprecation": "^2.3.1" + } + }, + "@octokit/request": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.1.tgz", + "integrity": "sha512-Ls2cfs1OfXaOKzkcxnqw5MR6drMA/zWX/LIS/p8Yjdz7QKTPQLMsB3R+OvoxE6XnXeXEE2X7xe4G4l4X0gRiKQ==", + "requires": { + "@octokit/endpoint": "^6.0.1", + "@octokit/request-error": "^2.1.0", + "@octokit/types": "^6.16.1", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.1", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/request-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", + "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", + "requires": { + "@octokit/types": "^6.0.3", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "@octokit/rest": { + "version": "18.10.0", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.10.0.tgz", + "integrity": "sha512-esHR5OKy38bccL/sajHqZudZCvmv4yjovMJzyXlphaUo7xykmtOdILGJ3aAm0mFHmMLmPFmDMJXf39cAjNJsrw==", + "requires": { + "@octokit/core": "^3.5.1", + "@octokit/plugin-paginate-rest": "^2.16.0", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^5.9.0" + } + }, + "@octokit/types": { + "version": "6.27.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.27.0.tgz", + "integrity": "sha512-ha27f8DToxXBPEJdzHCCuqpw7AgKfjhWGdNf3yIlBAhAsaexBXTfWw36zNSsncALXGvJq4EjLy1p3Wz45Aqb4A==", + "requires": { + "@octokit/openapi-types": "^10.1.0" + } + }, "@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -357,6 +496,11 @@ "tweetnacl": "^0.14.3" } }, + "before-after-hook": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", + "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" + }, "bignumber.js": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", @@ -807,6 +951,11 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, + "deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" + }, "des.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", @@ -1561,6 +1710,11 @@ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" }, + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" + }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -2335,6 +2489,31 @@ "simple-concat": "^1.0.0" } }, + "simple-git": { + "version": "2.45.1", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-2.45.1.tgz", + "integrity": "sha512-NmEoThiLTJxl26WNtZxtJTue18ReTcSrf3so5vJG/O8KY9uMxH+yAhXV/DElBJyOYZrrBbVsH8JOFxgENdc9Xg==", + "requires": { + "@kwsites/file-exists": "^1.1.1", + "@kwsites/promise-deferred": "^1.1.1", + "debug": "^4.3.1" + }, + "dependencies": { + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", @@ -2570,6 +2749,11 @@ "which-boxed-primitive": "^1.0.2" } }, + "universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", diff --git a/package.json b/package.json index d083084f8..e59e25f2d 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,10 @@ { "dependencies": { + "@octokit/rest": "^18.10.0", "http": "0.0.1-security", "node-fetch": "^2.6.1", "open": "^8.2.1", + "simple-git": "^2.45.1", "web3": "^1.5.2", "ws": "^8.2.1" }