All modules moved to Projects structure

This commit is contained in:
Luis Fernando Molina committed 2021-08-30 14:42:13 +02:00
1 parent ecd0dcc761
commit b6d04746d6
16 files changed
+102 -40

No files matched your search

+1 -19
View File
@@ -10,25 +10,7 @@ This module is the starting point of the Social Graph Network Node.
This type of node is responsible for mantaining the whole Social Graph
or relationships between User and Bot profiles and also between their posts.
*/
global.NT = {
modules: {
BOOTSTRAP: require('./Bootstrap.js'),
USER_PROFILE: require('./UserProfile.js'),
BOT_PROFILE: require('./BotProfile.js'),
POST: require('./Post.js'),
QUERY: require('./Query.js'),
QUERY_USER_PROFILE_STATS: require('./Queries/UserProfileStats.js'),
QUERY_BOT_PROFILE_STATS: require('./Queries/BotProfileStats.js'),
QUERY_PROFILE_POSTS: require('./Queries/ProfilePosts.js'),
QUERY_PROFILE_FOLLOWERS: require('./Queries/ProfileFollowers.js'),
QUERY_PROFILE_FOLLOWING: require('./Queries/ProfileFollowing.js'),
QUERY_POST_REPLIES: require('./Queries/PostReplies.js'),
QUERY_EVENTS: require('./Queries/Events.js')
},
utilities: {
queriesValidations: require('./Utilities/QueriesValidations.js').newQueriesValidations()
}
}
/*
The NT object is accesible everywhere at the Superalgos Network.
It provides access to all modules built for this Network.
+1 -1
View File
@@ -80,7 +80,7 @@ exports.newClientInterface = function newClientInterface() {
*/
let queryReceived = JSON.parse(queryMessage)
let query = NT.modules.QUERY.newQuery()
let query = NT.modules.queriesQuery.newNetworkModulesQuery()
query.initialize(queryReceived)
return query.execute()
}
File renamed without changes.
@@ -1,4 +1,4 @@
exports.newBotProfileStats = function newBotProfileStats() {
exports.newNetworkModulesQueriesBotProfileStats = function newNetworkModulesQueriesBotProfileStats() {
let thisObject = {
profile: undefined,
@@ -1,4 +1,4 @@
exports.newEvents = function newEvents() {
exports.newNetworkModulesQueriesEvents = function newNetworkModulesQueriesEvents() {
/*
This is the query executed to fill the timeline of a certain User or Bot Profile.
@@ -217,28 +217,28 @@ exports.newEvents = function newEvents() {
}
if (emitterUserProfile !== undefined) {
let query = NT.modules.QUERY_USER_PROFILE_STATS.newUserProfileStats()
let query = NT.modules.queriesUserProfileStats.newNetworkModulesQueriesUserProfileStats()
query.initialize({ targetUserProfileId: event.emitterUserProfileId })
eventResponse.emitterUserProfile = query.execute()
query.finalize()
}
if (targetUserProfile !== undefined) {
let query = NT.modules.QUERY_USER_PROFILE_STATS.newUserProfileStats()
let query = NT.modules.queriesUserProfileStats.newNetworkModulesQueriesUserProfileStats()
query.initialize({ targetUserProfileId: event.targetUserProfileId })
eventResponse.targetUserProfile = query.execute()
query.finalize()
}
if (emitterBotProfile !== undefined) {
let query = NT.modules.QUERY_BOT_PROFILE_STATS.newBotProfileStats()
let query = NT.modules.queriesBotProfileStats.newNetworkModulesQueriesBotProfileStats()
query.initialize({ targetUserProfileId: event.emitterUserProfileId, targetBotProfileId: emitterBotProfileId })
eventResponse.emitterBotProfile = query.execute()
query.finalize()
}
if (targetBotProfile !== undefined) {
let query = NT.modules.QUERY_BOT_PROFILE_STATS.newBotProfileStats()
let query = NT.modules.queriesBotProfileStats.newNetworkModulesQueriesBotProfileStats()
query.initialize({ targetUserProfileId: event.targetUserProfileId, targetBotProfileId: targetBotProfileId })
eventResponse.targetBotProfile = query.execute()
query.finalize()
@@ -1,4 +1,4 @@
exports.newPostReplies = function newPostReplies() {
exports.newNetworkModulesQueriesPostReplies = function newNetworkModulesQueriesPostReplies() {
/*
Each Post regardless if it is authored by a User or Bot Profile,
can have replies. This query is designed for Network Clients to
@@ -1,4 +1,4 @@
exports.newProfileFollowers = function newProfileFollowers() {
exports.newNetworkModulesQueriesProfileFollowers = function newNetworkModulesQueriesProfileFollowers() {
/*
This module represents the query that allows a Network Client to know
all the User or Bot profiles that are following a certain User or Bot profile.
@@ -1,4 +1,4 @@
exports.newProfileFollowing = function newProfileFollowing() {
exports.newNetworkModulesQueriesProfileFollowing = function newNetworkModulesQueriesProfileFollowing() {
/*
This module represents the query that allows a Network Client to know
all the User or Bot profiles that are being followed by a certain User or Bot profile.
@@ -1,4 +1,4 @@
exports.newProfilePosts = function newProfilePosts() {
exports.newNetworkModulesQueriesUserProfileStats = function newNetworkModulesQueriesUserProfileStats() {
/*
Each User or Bot Profile can have posts. This query
is designed for Network Clients to fetch the posts
@@ -1,4 +1,4 @@
exports.newUserProfileStats = function newUserProfileStats() {
exports.newNetworkModulesQueriesUserProfileStats = function newNetworkModulesQueriesUserProfileStats() {
let thisObject = {
profile: undefined,
@@ -1,4 +1,4 @@
exports.newQuery = function newQuery() {
exports.newNetworkModulesQuery = function newNetworkModulesQuery() {
/*
A Query is a call from a Network Client to
a Network Node with the purpose to get
@@ -41,49 +41,49 @@ exports.newQuery = function newQuery() {
switch (thisObject.queryType) {
case QUERY_TYPES.USER_PROFILE_STATS: {
thisObject.query = NT.modules.QUERY_USER_PROFILE_STATS.newUserProfileStats()
thisObject.query = NT.modules.queriesUserProfileStats.newNetworkModulesQueriesUserProfileStats()
query.initialize(queryReceived)
query.finalize()
break
}
case QUERY_TYPES.BOT_PROFILE_STATS: {
thisObject.query = NT.modules.QUERY_BOT_PROFILE_STATS.newBotProfileStats()
thisObject.query = NT.modules.queriesBotProfileStats.newNetworkModulesQueriesBotProfileStats()
query.initialize(queryReceived)
query.finalize()
break
}
case QUERY_TYPES.PROFILE_POSTS: {
thisObject.query = NT.modules.QUERY_PROFILE_POSTS.newProfilePosts()
thisObject.query = NT.modules.queriesProfilePosts.newNetworkModulesQueriesProfilePosts()
query.initialize(queryReceived)
query.finalize()
break
}
case QUERY_TYPES.POST_REPLIES: {
thisObject.query = NT.modules.QUERY_POST_REPLIES.newPostReplies()
thisObject.query = NT.modules.queriesPostReplies.newNetworkModulesQueriesPostReplies()
query.initialize(queryReceived)
query.finalize()
break
}
case QUERY_TYPES.PROFILE_FOLLOWERS: {
thisObject.query = NT.modules.QUERY_PROFILE_FOLLOWERS.newProfileFollowers()
thisObject.query = NT.modules.queriesProfileFollowers.newNetworkModulesQueriesProfileFollowers()
query.initialize(queryReceived)
query.finalize()
break
}
case QUERY_TYPES.PROFILE_FOLLOWING: {
thisObject.query = NT.modules.QUERY_PROFILE_FOLLOWING.newProfileFollowing()
thisObject.query = NT.modules.queriesProfileFollowing.newNetworkModulesQueriesProfileFollowing()
query.initialize(queryReceived)
query.finalize()
break
}
case QUERY_TYPES.maps.EVENTS: {
thisObject.query = NT.modules.QUERY_EVENTS.newEvents()
thisObject.query = NT.modules.queriesEvents.newNetworkModulesQueriesEvents()
query.initialize(queryReceived)
query.finalize()
break
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
exports.newQueriesValidations = function newQueriesValidations() {
exports.newNetworkUtilitiesQueriesValidations = function newNetworkUtilitiesQueriesValidations() {
/*
This module have a few funcions that are often needed at Queries Modules.
*/
+80
View File
@@ -1287,12 +1287,92 @@
}
],
"modules": [
{
"name": "Bot Profile Stats",
"propertyName": "queriesBotProfileStats",
"functionName": "newNetworkModulesQueriesBotProfileStats",
"fileName": "Queries/BotProfileStats.js"
},
{
"name": "User Profile Stats",
"propertyName": "queriesUserProfileStats",
"functionName": "newNetworkModulesQueriesUserProfileStats",
"fileName": "Queries/UserProfileStats.js"
},
{
"name": "Profile Posts",
"propertyName": "queriesProfilePosts",
"functionName": "newNetworkModulesQueriesProfilePosts",
"fileName": "Queries/ProfilePosts.js"
},
{
"name": "Profile Followers",
"propertyName": "queriesProfileFollowers",
"functionName": "newNetworkModulesQueriesProfileFollowers",
"fileName": "Queries/ProfileFollowers.js"
},
{
"name": "Profile Following",
"propertyName": "queriesProfileFollowing",
"functionName": "newNetworkModulesQueriesProfileFollowing",
"fileName": "Queries/ProfileFollowing.js"
},
{
"name": "Post Replies",
"propertyName": "queriesPostReplies",
"functionName": "newNetworkModulesQueriesPostReplies",
"fileName": "Queries/PostReplies.js"
},
{
"name": "Events",
"propertyName": "queriesEvents",
"functionName": "newNetworkModulesQueriesEvents",
"fileName": "Queries/Events.js"
},
{
"name": "User Profile",
"propertyName": "socialGraphUserProfile",
"functionName": "newNetworkModulesSocialGraphUserProfile",
"fileName": "Social-Graph/UserProfile.js"
},
{
"name": "Bot Profile",
"propertyName": "socialGraphBotProfile",
"functionName": "newNetworkModulesSocialGraphBotProfile",
"fileName": "Social-Graph/BotProfile.js"
},
{
"name": "Post",
"propertyName": "socialGraphPost",
"functionName": "newNetworkModulesSocialGraphPost",
"fileName": "Social-Graph/Post.js"
},
{
"name": "Bootstrap",
"propertyName": "bootstrap",
"functionName": "newNetworkModulesBootstrap",
"fileName": "Bootstrap.js"
},
{
"name": "Query",
"propertyName": "Query",
"functionName": "newNetworkModulesQuery",
"fileName": "Query.js"
},
{
"name": "Event",
"propertyName": "event",
"functionName": "newNetworkModulesEvent",
"fileName": "Event.js"
}
],
"utilities": [
{
"name": "Queries Validations",
"propertyName": "queriesValidations",
"functionName": "newNetworkUtilitiesQueriesValidations",
"fileName": "QueriesValidations.js"
}
]
}
}