Merge branch 'develop' of https://github.com/Superalgos/Superalgos into develop

This commit is contained in:
harrellbm committed 2021-10-07 08:26:13 -05:00
commit 6885c2ded8
255 files changed
+16484 -2566

No files matched your search

+2
View File
@@ -4,6 +4,8 @@ My-Workspaces
My-Social-Trading-Data
My-Network-Nodes-Data
My-Secrets
My-Data-Storage
My-Log-Files
debug.log
.DS_Store
*.db
+4
View File
@@ -0,0 +1,4 @@
brew "git"
brew "node"
brew "npm"
brew "python@3.9"
+1 -1
View File
@@ -12,5 +12,5 @@ RUN apk add --no-cache --virtual .build-deps make g++ \
USER superalgos
EXPOSE 34248
EXPOSE 18041
VOLUME ["/app/Data-Storage", "/app/Log-Files", "/app/My-Workspaces"]
VOLUME ["/app/Platform/My-Data-Storage", "/app/Platform/My-Log-Files", "/app/Platform/My-Workspaces"]
ENTRYPOINT ["node", "platform", "noBrowser"]
+273
View File
@@ -0,0 +1,273 @@
# Superalgos Docker Guide
## Table of Contents
- [Introduction](#introduction)
- [Installation](#installation)
- [Mac OS](#mac-os)
- [Windows](#windows)
- [Linux and BSD](#linux-and-bsd)
- [Running Superalgos](#running-superalgos)
- [Using Docker-Compose](#using-docker-compose)
- [Docker Best Practices](#docker-best-practices)
- [Docker Development Best Practices](#docker-development-best-practices)
- [Dockerfile Best Practices](#dockerfile-best-practices)
- [Twelve Factor App](#twelve-factor-app)
## Introduction
This walkthrough is broken up into to parts: a quick-start guide to running [Superalgos](https://github.com/Superalgos/Superalgos) with Docker and a deeper, more theoretical dive into containers with the hopes of explaining some of the design decisions.
[Superalgos](https://github.com/Superalgos/Superalgos), at its core, is a web application which also means it can be deployed inside a container like many other web applications. One of the leading platforms for operating containers is Docker. Docker can run on many different operatng systems and compute platforms. The containers provide an easy, fast, repeatable, and secure way to deploy and distribute applications. While it doesn't take much experience to run containers or Docker, there are some basics that any user should learn in order to use the technology effectively.
Before getting started, be aware that Docker is not the originally intended method of running the [Superalgos](https://github.com/Superalgos/Superalgos) application and as such there are some drawbacks to doing so. Namely, you won't be able contribute back to the project or configure your Governance profile. We'll discuss this more later. Therefore, you should only consider using the Docker container for production deployments.
It is also worth noting that [Superalgos](https://github.com/Superalgos/Superalgos) is very resource intense so it is best to get acquainted with the software by running it on a fast computer with a good amount of RAM as opposed to a tiny, slow Raspberry Pi. But, once you are ready to run a production deployment, then a more economical server is preferred.
Docker container images are hosted on `ghcr`. You can browse the containers in the [Packages section of the code repository](https://github.com/users/Superalgos/packages/container/package/superalgos).
> **Note:** The container and the application are still under heavy development and testing. Please join the [Superalgos SysAdmins Group](https://t.me/superalgossysadmins) to discuss any issues you may run into.
## Installation
First, Docker Desktop needs to be installed on a Mac or Windows computer in order to run the containers. Linux and BSD users will need Docker Engine. Docker-compose is also recommended and it should be included with Docker Desktop, but it may need to be installed separately.
### Mac OS
Docker can be downloaded from the Docker Store following the [directions in the official Docker Docs](https://docs.docker.com/desktop/mac/install/). It can also be installed from the command line using Homebrew.
```shell
brew cask install docker
brew install docker-compose
```
Then, make sure Docker Desktop is running. An easy way to check is to push `Cmd + space` then type `docker.app` in the search bar. You should also see the little whale icon in the top menu bar near the clock.
### Windows
Windows requires a few more steps than Mac OS, but it can also be downloaded from the Docker Store following the [directions in the official Docker Docs](https://docs.docker.com/desktop/windows/install/). It can also be installed from the command line using Chocolatey.
```shell
choco install docker-desktop
```
Docker should automatically start after installation. If you don't see the whale icon in the tray by the clock, then find `Docker` in the start menu.
### Linux and BSD
On Linux and BSD systems, Docker can be installed using the prefered package manager. [Step by step instructions for many different distributions](https://docs.docker.com/engine/install/debian/) of Linux can be found in the official Docker Docs. Since [Superalgos](https://github.com/Superalgos/Superalgos) runs well on Raspberry Pi 4 single-board computers, I'm going to illustrate the commands necessary to run [Superalgos](https://github.com/Superalgos/Superalgos) on the Raspbian Linux distribution.
```shell
# install the requirements
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
# add the gpg keys to verify the packages
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# confgure the official repository
echo \
"deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# install docker engine
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose
```
Docker should automatically start when it is done installing. You can check its status with `systemctl status docker`. To make things easier, ensure your user is added to the `docker` group. Type `id` at the command prompt and you should see something like `groups=...999(docker)`. If you don't see it listed, you can add yourself with `sudo usermod -a -G docker <username>`.
## Running Superalgos
Now that we have Docker installed and running, we can run the container. The option `--rm` will remove the isntance of the container when it is exited.
```shell
docker run --rm ghcr.io/superalgos/superalgos:latest
```
You'll see some messages showing the container being downloaded and then some messages from the application itself showing that it is starting up and ready to accept connections. We'll stop the container now and add in a few more options so make it more useful, so press `ctrl + c` to exit.
We'll need to expose some ports so we can actually connect to it from our browser. Also, we'll want to create a few directories on our host file system so we can save, or persist, data between container reboots.
- `-d` to run the container daemonized, in the background
- `-p` to map ports to the host system to allow connections
- `-v` to mount local directories inside the container to persist data
- `--name` to assign a name to the container for easier reference
```shell
# create the data directories
mkdir -p Data-Storage Log-Files My-Workspaces
# run the container with the extra options
docker run \
-d \
--rm \
--name superalgos \
--user $(id -u):$(id -g) \
-p 18041:18041 \
-p 34248:34248 \
-v $(pwd)/Data-Storage:/app/Data-Storage \
-v $(pwd)/Log-Files:/app/Log-Files \
-v $(pwd)/My-Workspaces:/app/My-Workspaces \
ghcr.io/superalgos/superalgos:latest
```
You can check the status of the container with `docker ps -a` and view the logs with `docker logs superalgos`.
Note that you will see one error in the log output informing you that `git` is not installed. This is intentional and is not required for the bot to function properly.
Now you can open your browser and load the application front end. Try loading `http://localhost:34248` if you are on the same computer that is running the container, otherwise use the host ip, for example `http://192.168.1.10:34248`.
If you want to stop the container, you can run `docker stop superalgos`. When you want to upgrade the container, use:
```shell
docker pull ghcr.io/superalgos/superalgos:latest
docker stop superalgos
docker run \
-d \
--rm \
--name superalgos \
--user $(id -u):$(id -g) \
-p 18041:18041 \
-p 34248:34248 \
-v $(pwd)/Data-Storage:/app/Data-Storage \
-v $(pwd)/Log-Files:/app/Log-Files \
-v $(pwd)/My-Workspaces:/app/My-Workspaces \
ghcr.io/superalgos/superalgos:latest
```
Let's stop the container for now (`docker stop superalgos`) and we'll run it again using `docker-compose`.
Continue reading the [Docker Command Line documentation](https://docs.docker.com/engine/reference/commandline/cli/) for more details.
### Using Docker-Compose
Docker-compose is a wrapper for the Docker API which makes it a little easier to maintain a declaritive configuration for an application instead of using the direct command line commands. There is a sample docker-compose configuration included in the [Superalgos](https://github.com/Superalgos/Superalgos) which you can as the basis for your own configuration.
Let's download the sample and edit it. If you don't use `vim`, change that command for your preferred editor.
```shell
wget https://raw.githubusercontent.com/Superalgos/Superalgos/master/Docker/docker-compose.yml
vim docker-compose.yml
```
Now, let's change some of the settings:
```yaml
version: "3"
services:
superalgos:
image: ghcr.io/superalgos/superalgos:latest
command: ["minMemo"]
user: "$UID:$GID"
ports:
- '34248:34248'
- '18041:18041'
volumes:
- ./Data-Storage:/app/Data-Storage
- ./Log-Files:/app/Log-Files
- ./My-Workspaces:/app/My-Workspaces
restart: on-failure
```
You can see we have the same ports and volumes mapped. We also get a few extra settings like `command`, `environment`, and `restart`.
- `command` adds an extra setting to the main startup, so the application ends up running with the full command `node platform noBrowser minMemo`. The base of that command is defined as the `ENTRYPOINT` in the `Dockerfile` that builds the container.
- `user` defines the UID and GID the container should run as so that the data can be persisted with the correct permissions in the Data-Storage, Log-Files, and My-Workspaces directories that we created on the host. If you leave this out, the container will use the built in `superalgos` user which has `uid: 1001` and `gid: 1001`. Instead of using variables, you could also hard-code these UID and GID numbers into the configuration.
- `restart` tells Docker to restart the container if an error occurs.
Save the file and exit the editor. If you are using `vim`, hit escape and then type `:wq!` or press `shift + Z + Z` (two capital Z's).
Now, start the container with `docker-compose up`. This will start the container in the foreground and you'll connect to the log output. Hit `ctrl + c` to exit. Going forward, you'll want to add the `-d` option to start the container and keep it running in the background.
```shell
# some preliminary configuration to set up the persistent data directories
mkdir -p Data-Storage Log-Files My-Workspaces
export UID=$(id -u)
export GID=$(id -g)
# run the container in the background
docker-compose up -d
```
Now you have several `docker-compose` commands at your disposal to interact with the container:
- `docker-compose ps` to see details of the container
- `docker-compose logs` to see the logs
- `docker-compose down` to stop and remove the instance of the container
- `docker-compose pull` to pull the container, or a new version of the `latest` tag
Putting some of those concepts together, you can keep the running container up to date with this one-liner:
```shell
docker-compose pull && docker-compose down && docker-compose up -d
```
Explore the full [Docker Compose documentation](https://docs.docker.com/compose/) for more information.
## Docker Best Practices
As with any technology, there are lots of ways of doing things. A lot of them will give the same end result, but some may have fewer steps, or be more secure, or be more maintainable. That is where "best practices" come in. They aren't there to necessarily tell you what to do and what not to do, but they are there to help guide you in the right direction. A lot of times, they help you avoid making architectural mistakes that could come back and bite you further down the road.
One general best practice when running a production deployment is to avoid breaking changes by pinning to specific container tags. The `shasum hash` and the `release` tags are the best to use. These will generally ensure you are always running the same code and it will only upgrade when configured to do so. The other tags will change which code they are pointing to more frequently and without notice.
- `latest` : the absolute latest build
- `master` : the latest master branch build
- `develop` : the latest develop branch build
- `<shasum hash>` : a specific git commit hash
- `<release>` : corresponds with a Github Release (git tag), i.e. `beta-10`
## Docker Development Best Practices
Docker has many advantages which can aid in every step from development through production deployment. There are some useful tips located directly in the [Docker documentation](https://docs.docker.com/develop/dev-best-practices/). Concisely, they are to keep the build images small, a few tips on when and how to persist data, and to use CI/CD for testing and deployment. All of these tips are used in one way or another as a part of the [Superalgos](https://github.com/Superalgos/Superalgos) project.
- Use a minimal base image and multi-stage build. Superalgos is currently using an [alpine](https://www.alpinelinux.org/) base image but [distroless](https://github.com/GoogleContainerTools/distroless) is becoming more common and some times using a base image like [python-slim](https://hub.docker.com/_/python) is the bast that can be achieved.
- The images are quite large (around 2 GB in size), unfortunately, because the codebase itself is large. We've recently put in a lot of effort to make these images as small as possible.
- The images are built automatically using Github Actions when pull requests are merged.
- With the correct configuration, data, like data mine and trading bot information, is persisted to the host using volume mounts
### Dockerfile Best Practices
Docker maintains a list of [Dockerfile best practices](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/) in their main documentation. These tips dictate many of the decisions around the Superalgos Dockerfile. Some of the tips that are used by [Superalgos](https://github.com/Superalgos/Superalgos) are listed below.
- Use `.dockerignore` to prevent unwanted data from entering the container. This keeps the container small but also enhances security to prevent secrets from leaking into a container by accident.
- Don't install unneccesary packages. In lieu of multi-stage builds, build caches and build dependencies are removed before finalizing the container. Only packages that are necessary for the execution of the application are installed. This is why `git` is not present.
- Minimize the number of layers. Many `RUN` commands are combined into one using `&&` in order to reduce the number of layers.
- Sort multiline arguments. This mostly enhances readability and maintainability.
- Leverage build cache. When testing locally, several of the tips above help levarage the build cache and speed up build times.
### Twelve Factor App
[Superalgos](https://github.com/Superalgos/Superalgos) is a web app but it was originally designed to be run on a local workstation or server on a trusted network. However, I don't think it would be prudent to talk about Docker best practices without mentioning the [Twelve Factor App](https://12factor.net/) manifesto. Over time, [Superalgos](https://github.com/Superalgos/Superalgos) itself may iterate and implement more and more of these principles as more people get involved and more people deploy production environments.
The Twelve Factors:
- Codebase: One codebase tracked in revision control, many deploys
- Superalgos utilizes one GitHub repository
- Dependencies: Explicitly declare and isolate dependencies
- Superalgos is a node.js app and uses npm to track and install dependencies
- Config: Store config in the environment
- Superalgos does not use environment variables the moment for configuration. Options are passed on the command line at run time. Other configuration is hard coded into the Workspaces.
- Backing services: Treat backing services as attached resources
- Superalgos connects to external services via API calls over HTTP (TCP)
- Build, release, run: Strictly separate build and run stages
- Superalgos is deployed by end users in their own local environments
- Processes: Execute the app as one or more stateless processes
- Superalgos is one application
- Port binding: Export services via port binding
- Superalgos exposes an HTTP frontend port and a Websockets backend port (TCP)
- Concurrency: Scale out via the process model
- Superalgos can be clustered but the front end and backend do not necessarily scale out independently from each other
- Disposability: Maximize robustness with fast startup and graceful shutdown
- Superalgos is not stateless in that the data files must be persisted to disk. Also, Superalgos cannot run behind a load balancer and have requests randomly distributed to different backend servers.
- Dev/prod parity: Keep development, staging, and production as similar as possible
- Superalgos doesn't have its own production environment but the container makes it easy to ensure development environments are the same as what a user will see when they deploy it for themselves in their own production environment.
- Logs: Treat logs as event streams
- Superalgos sends its own application logs to standard out. The trading mine logs are sent to flat files (persisted through volume mounts)
- Admin processes: Run admin/management tasks as one-off processes
- Superalgos does not have any admin or management tasks outside of what is used to create the container at build time.
+4 -6
View File
@@ -6,14 +6,12 @@ services:
dockerfile: ./Docker/Dockerfile
image: ghcr.io/superalgos/superalgos:latest
command: ["minMemo"]
user: "$UID:$GID"
ports:
- '34248:34248'
- '18041:18041'
volumes:
- ../Data-Storage:/app/Data-Storage
- ../Log-Files:/app/Log-Files
- ../My-Workspaces:/app/My-Workspaces
environment:
PUID: '1000'
PGID: '1000'
- ../Platform/My-Data-Storage:/app/Platform/My-Data-Storage
- ../Platform/My-Log-Files:/app/Platform/My-Log-Files
- ../Platform/My-Workspaces:/app/Platform/My-Workspaces
restart: on-failure
+3 -3
View File
@@ -4,14 +4,14 @@ exports.newEnvironment = function () {
WEB_SERVER_URL: 'localhost',
CLIENT_WEB_SOCKETS_INTERFACE_PORT: 18041,
CLIENT_HTTP_INTERFACE_PORT: 34248,
PATH_TO_DATA_STORAGE: './Data-Storage',
PATH_TO_DATA_STORAGE: './Platform/My-Data-Storage',
PATH_TO_LOG_FILES: './Platform/My-Log-Files',
PATH_TO_PROJECTS: './Projects',
PATH_TO_LOG_FILES: './Log-Files',
PATH_TO_PROJECTS_REQUIRED: './Projects',
PATH_TO_PROJECT_SCHEMA: './Projects/ProjectsSchema.json',
PATH_TO_CLIENT: './Platform',
PATH_TO_DEFAULT_WORKSPACE: './Projects/Foundations/Plugins/Workspaces',
PATH_TO_MY_WORKSPACES: './My-Workspaces',
PATH_TO_MY_WORKSPACES: './Platform/My-Workspaces',
PATH_TO_FONTS: './Platform/WebServer/Fonts'
}
+3 -3
View File
@@ -8,15 +8,15 @@ exports.newEnvironment = function () {
DESKTOP_WEB_SOCKETS_INTERFACE_HOST: 'localhost',
CLIENT_HTTP_INTERFACE_PORT: 34248,
DESKTOP_HTTP_INTERFACE_PORT: 34249,
PATH_TO_DATA_STORAGE: './Data-Storage',
PATH_TO_DATA_STORAGE: './Platform/My-Data-Storage',
PATH_TO_LOG_FILES: './Platform/My-Log-Files',
PATH_TO_PROJECTS: './Projects',
PATH_TO_LOG_FILES: './Log-Files',
PATH_TO_PROJECTS_REQUIRED: './Projects',
PATH_TO_PROJECT_SCHEMA: './Projects/ProjectsSchema.json',
PATH_TO_CLIENT: './Platform',
PATH_TO_DESKTOP: './Desktop',
PATH_TO_DEFAULT_WORKSPACE: './Projects/Foundations/Plugins/Workspaces',
PATH_TO_MY_WORKSPACES: './My-Workspaces',
PATH_TO_MY_WORKSPACES: './Platform/My-Workspaces',
PATH_TO_FONTS: './Platform/WebServer/Fonts'
}
+7 -7
View File
@@ -79,7 +79,7 @@ exports.newGithubServer = function newGithubServer() {
const octokit = new Octokit({
auth: token,
userAgent: 'Superalgos Beta 11'
userAgent: 'Superalgos Beta 12'
})
await getList()
@@ -207,7 +207,7 @@ exports.newGithubServer = function newGithubServer() {
const { Octokit } = SA.nodeModules.octokit
const octokit = new Octokit({
auth: token,
userAgent: 'Superalgos Beta 11'
userAgent: 'Superalgos Beta 12'
})
await getPrList()
await mergePrs()
@@ -340,7 +340,7 @@ exports.newGithubServer = function newGithubServer() {
owner: owner,
repo: repo,
issue_number: pullRequest.number,
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.'
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. \n\n If you intentionally submitted the extra files, the way to get your work merged is by first removing your User Profile file from the Plugins folder at your local installation and executing an app.contribute again. Then wait until the PR is merged (manually reviewed) and after that you put your User Profile file again and create a new PR only with that file with an app.contribute. That last PR should be merged automatically.'
});
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
@@ -508,14 +508,14 @@ exports.newGithubServer = function newGithubServer() {
unless the existing one belongs to the same Github username.
*/
let userProfileIdMap = new Map()
let pluginFileNames = await SA.projects.foundations.utilities.plugins.getPluginFileNames(
let pluginFileNames = await SA.projects.communityPlugins.utilities.plugins.getPluginFileNames(
'Governance',
'User-Profiles'
)
for (let i = 0; i < pluginFileNames.length; i++) {
let pluginFileName = pluginFileNames[i]
let pluginFileContent = await SA.projects.foundations.utilities.plugins.getPluginFileContent(
let pluginFileContent = await SA.projects.communityPlugins.utilities.plugins.getPluginFileContent(
'Governance',
'User-Profiles',
pluginFileName
@@ -558,13 +558,13 @@ exports.newGithubServer = function newGithubServer() {
unless the existing one belongs to the same Github username.
*/
let userProfileIdMap = new Map()
let pluginFileNames = await SA.projects.foundations.utilities.plugins.getPluginFileNames(
let pluginFileNames = await SA.projects.communityPlugins.utilities.plugins.getPluginFileNames(
'Governance',
'User-Profiles'
)
for (let i = 0; i < pluginFileNames.length; i++) {
let pluginFileName = pluginFileNames[i]
let pluginFileContent = await SA.projects.foundations.utilities.plugins.getPluginFileContent(
let pluginFileContent = await SA.projects.communityPlugins.utilities.plugins.getPluginFileContent(
'Governance',
'User-Profiles',
pluginFileName
+15 -9
View File
@@ -725,7 +725,7 @@ exports.newHttpInterface = function newHttpInterface() {
const octokit = new Octokit({
auth: token,
userAgent: 'Superalgos Beta 11'
userAgent: 'Superalgos Beta 12'
})
const repo = 'Superalgos'
@@ -1415,11 +1415,13 @@ exports.newHttpInterface = function newHttpInterface() {
try {
let project = unescape(requestPath[2])
let folder = unescape(requestPath[3])
let response = await SA.projects.foundations.utilities.plugins.getPluginFileNames(
let response = await SA.projects.communityPlugins.utilities.plugins.getPluginFileNames(
project,
folder
)
).catch(err => {
console.log('[ERROR] httpInterface -> PluginFileNames -> err.stack = ' + err.stack)
})
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(response), httpResponse)
@@ -1452,12 +1454,18 @@ exports.newHttpInterface = function newHttpInterface() {
if (fileName === 'Superalgos-CL.json') {
fileName = 'Superalgos-PL.json'
}
let response = await SA.projects.foundations.utilities.plugins.getPluginFileContent(
await SA.projects.communityPlugins.utilities.plugins.getPluginFileContent(
project,
folder,
fileName
).catch(err => {
)
.then( response =>
{
SA.projects.foundations.utilities.httpResponses.respondWithContent(response, httpResponse)
}
)
.catch(err => {
let error = {
result: 'Fail Because',
message: err
@@ -1466,8 +1474,6 @@ exports.newHttpInterface = function newHttpInterface() {
return
})
SA.projects.foundations.utilities.httpResponses.respondWithContent(response, httpResponse)
} catch (err) {
console.log('[ERROR] httpInterface -> LoadPlugin -> Method call produced an error.')
console.log('[ERROR] httpInterface -> LoadPlugin -> err.stack = ' + err.stack)
+1 -1
View File
@@ -143,7 +143,7 @@ exports.newPlatformApp = function newPlatformApp() {
console.log('Http Interface .............................................. Listening at port ' + global.env.CLIENT_HTTP_INTERFACE_PORT)
console.log('')
console.log("You are running Superalgos Beta 11")
console.log("You are running Superalgos Beta 12")
console.log('')
console.log("What's new? These are the main new features in this version:")
console.log('')
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@@ -0,0 +1,63 @@
{
"type": "Algorithmic-Trading Project",
"menuItems": [
{
"action": "Add Missing Children",
"label": "Add Missing Children",
"iconPathOn": "algorithmic-trading-project",
"iconPathOff": "algorithmic-trading-project",
"iconProject": "Algorithmic-Trading",
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Add UI Object",
"label": "Add Trading Mine",
"relatedUiObject": "Trading Mine",
"relatedUiObjectProject": "Algorithmic-Trading",
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Add UI Object",
"label": "Add Trading Engine",
"relatedUiObject": "Trading Engine",
"relatedUiObjectProject": "Algorithmic-Trading",
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Add UI Object",
"label": "Add Trading System",
"relatedUiObject": "Trading System",
"relatedUiObjectProject": "Algorithmic-Trading",
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"actionFunction": "payload.executeAction",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionProject": "Foundations"
}
],
"isProjectHead": true,
"isTitleAllwaysVisible": false,
"addLeftIcons": true,
"isPinned": true,
"positionLocked": true,
"icon": "algorithmic-trading-project",
"childrenNodesProperties": [
{
"name": "projectDefinition",
"type": "node",
"childType": "Project Definition",
"project": "Foundations",
"autoAdd": true
}
]
}
@@ -7,25 +7,29 @@
"iconPathOn": "configuration",
"iconPathOff": "configuration",
"dontShowAtFullscreen": true,
"actionFunction": "uiObject.configEditor.activate"
"actionFunction": "uiObject.configEditor.activate",
"actionProject": "Foundations"
},
{
"action": "Add UI Object",
"label": "Add Process Definition",
"relatedUiObject": "Process Definition",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Add UI Object",
"label": "Add Product Definition",
"relatedUiObject": "Product Definition",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Add UI Object",
"label": "Add Product Definition Folder",
"relatedUiObject": "Product Definition Folder",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Delete UI Object",
@@ -34,7 +38,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"isTitleAllwaysVisible": true,
@@ -54,19 +59,22 @@
"name": "processes",
"type": "array",
"childType": "Process Definition",
"autoAdd": true
"autoAdd": true,
"project": "Foundations"
},
{
"name": "products",
"type": "array",
"childType": "Product Definition",
"autoAdd": true
"autoAdd": true,
"project": "Foundations"
},
{
"name": "productDefinitionFolders",
"type": "array",
"childType": "Product Definition Folder",
"autoAdd": true
"autoAdd": true,
"project": "Foundations"
}
],
"propertyNameAtParent": "tradingBots"
@@ -5,7 +5,8 @@
"action": "Add Missing Children",
"label": "Add Missing Children",
"relatedUiObject": "Trading Engine",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Delete UI Object",
@@ -14,7 +15,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"isHierarchyHead": true,
@@ -25,19 +27,22 @@
"name": "tradingCurrent",
"type": "node",
"childType": "Trading Current",
"autoAdd": true
"autoAdd": false,
"project": "Foundations"
},
{
"name": "tradingLast",
"type": "node",
"childType": "Trading Last",
"autoAdd": true
"autoAdd": false,
"project": "Foundations"
},
{
"name": "exchangeOrders",
"type": "node",
"childType": "Exchange Orders",
"autoAdd": true
"autoAdd": false,
"project": "Foundations"
}
]
}
@@ -6,20 +6,26 @@
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration",
"iconProject": "Foundations",
"dontShowAtFullscreen": true,
"actionFunction": "uiObject.configEditor.activate"
"actionFunction": "uiObject.configEditor.activate",
"actionProject": "Foundations"
},
{
"action": "Add UI Object",
"label": "Add Trading Bot",
"relatedUiObject": "Trading Bot",
"actionFunction": "payload.executeAction"
"relatedUiObjectProject": "Algorithmic-Trading",
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Add UI Object",
"label": "Add Plotter",
"relatedUiObject": "Plotter",
"actionFunction": "payload.executeAction"
"relatedUiObjectProject": "Foundations",
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Delete UI Object",
@@ -28,7 +34,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"isTitleAllwaysVisible": true,
@@ -45,12 +52,14 @@
{
"name": "tradingBots",
"type": "array",
"childType": "Trading Bot"
"childType": "Trading Bot",
"project": "Algorithmic-Trading"
},
{
"name": "plotters",
"type": "array",
"childType": "Plotter"
"childType": "Plotter",
"project": "Foundations"
}
]
}
@@ -5,7 +5,8 @@
"action": "Add UI Object",
"label": "Add Trading Strategy",
"relatedUiObject": "Trading Strategy",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Add UI Object",
@@ -13,7 +14,8 @@
"propertyToCheckFor": "dynamicIndicators",
"label": "Add Dynamic Indicators",
"relatedUiObject": "Dynamic Indicators",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Delete UI Object",
@@ -22,7 +24,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"isHierarchyHead": true,
@@ -33,13 +36,15 @@
"name": "tradingStrategies",
"type": "array",
"childType": "Trading Strategy",
"autoAdd": true
"autoAdd": true,
"project": "Foundations"
},
{
"name": "dynamicIndicators",
"type": "node",
"childType": "Dynamic Indicators",
"autoAdd": true
"autoAdd": true,
"project": "Foundations"
}
]
}
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesExchangeAPI = function (processIndex) {
exports.newAlgorithmicTradingBotModulesExchangeAPI = function (processIndex) {
let MODULE_NAME = "Exchange API";
@@ -1,8 +1,7 @@
exports.newFoundationsBotModulesOrdersCalculations = function (processIndex) {
exports.newAlgorithmicTradingBotModulesOrdersCalculations = function (processIndex) {
/*
When we are live trading, we need to syncronize with the exchange.
*/
const MODULE_NAME = 'Orders Calculations'
let thisObject = {
actualSizeCalculation: actualSizeCalculation,
@@ -1,8 +1,7 @@
exports.newFoundationsBotModulesOrdersSimulations = function (processIndex) {
exports.newAlgorithmicTradingBotModulesOrdersSimulations = function (processIndex) {
/*
When we are backtesting or paper trading, we need to simulate what would have happened at the exchange.
*/
const MODULE_NAME = 'Orders Simulations'
let thisObject = {
actualSizeSimulation: actualSizeSimulation,
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesSnapshots = function(processIndex) {
exports.newAlgorithmicTradingBotModulesSnapshots = function(processIndex) {
/*
This module encapsulates the snapshots functionality.
*/
@@ -1,9 +1,9 @@
exports.newFoundationsBotModulesTradingEngine = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingEngine = function (processIndex) {
/*
We call the Trading Engine to the data structure that is needed in order to exevute the
trading protocol with the specific rules defined at the Trading System.
*/
const MODULE_NAME = 'Trading Engine'
let thisObject = {
mantain: mantain,
reset: reset,
@@ -1,8 +1,7 @@
exports.newFoundationsBotModulesTradingEpisode = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingEpisode = function (processIndex) {
/*
This module packages all functions related to Episodes.
*/
const MODULE_NAME = 'Trading Episode'
let thisObject = {
mantain: mantain,
reset: reset,
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesTradingExecution = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingExecution = function (processIndex) {
/*
The Trading Execution modules manages the execution nodes and execution algoritms.
*/
@@ -16,7 +16,7 @@ exports.newFoundationsBotModulesTradingExecution = function (processIndex) {
let tradingSystem
let sessionParameters
let tradingOrdersModuleObject = TS.projects.foundations.botModules.tradingOrders.newFoundationsBotModulesTradingOrders(processIndex)
let tradingOrdersModuleObject = TS.projects.algorithmicTrading.botModules.tradingOrders.newAlgorithmicTradingBotModulesTradingOrders(processIndex)
return thisObject
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingOrders = function (processIndex) {
/*
The Trading Orders modules manages the execution of orders against the exchanges.
*/
@@ -16,7 +16,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
let tradingSystem
let sessionParameters
let exchangeAPIModuleObject = TS.projects.foundations.botModules.exchangeAPI.newFoundationsBotModulesExchangeAPI(processIndex)
let exchangeAPIModuleObject = TS.projects.algorithmicTrading.botModules.exchangeAPI.newAlgorithmicTradingBotModulesExchangeAPI(processIndex)
let announcementsModuleObject = TS.projects.foundations.botModules.announcements.newFoundationsBotModulesAnnouncements(processIndex)
return thisObject
@@ -843,7 +843,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
let previousBaseAssetFeesPaid = tradingEngineOrder.orderBaseAsset.feesPaid.value
let previousQuotedAssetFeesPaid = tradingEngineOrder.orderQuotedAsset.feesPaid.value
let ordersSimulationsModuleObject = TS.projects.foundations.botModules.ordersSimulations.newFoundationsBotModulesOrdersSimulations(processIndex)
let ordersSimulationsModuleObject = TS.projects.algorithmicTrading.botModules.ordersSimulations.newAlgorithmicTradingBotModulesOrdersSimulations(processIndex)
ordersSimulationsModuleObject.initialize()
ordersSimulationsModuleObject.actualSizeSimulation(tradingEngineStage, tradingSystemOrder, tradingEngineOrder, applyFeePercentage)
@@ -874,7 +874,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
let previousBaseAssetFeesPaid = tradingEngineOrder.orderBaseAsset.feesPaid.value
let previousQuotedAssetFeesPaid = tradingEngineOrder.orderQuotedAsset.feesPaid.value
let ordersCalculationsModuleObject = TS.projects.foundations.botModules.ordersCalculations.newFoundationsBotModulesOrdersCalculations(processIndex)
let ordersCalculationsModuleObject = TS.projects.algorithmicTrading.botModules.ordersCalculations.newAlgorithmicTradingBotModulesOrdersCalculations(processIndex)
ordersCalculationsModuleObject.initialize()
await ordersCalculationsModuleObject.actualSizeCalculation(tradingEngineStage, tradingSystemOrder, tradingEngineOrder, order, applyFeePercentage)
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesTradingOutput = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingOutput = function (processIndex) {
/*
This module will load if necesary all the data outputs so that they can be appended with new
records if needed. After running the simulation, it will save all the data outputs.
@@ -29,7 +29,7 @@ exports.newFoundationsBotModulesTradingOutput = function (processIndex) {
}
/* Preparing everything for the Simulation */
let tradingSimulationModuleObject = TS.projects.foundations.botModules.tradingSimulation.newFoundationsBotModulesTradingSimulation(processIndex)
let tradingSimulationModuleObject = TS.projects.algorithmicTrading.botModules.tradingSimulation.newAlgorithmicTradingBotModulesTradingSimulation(processIndex)
let outputDatasets = TS.projects.foundations.utilities.nodeFunctions.nodeBranchToArray(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput, 'Output Dataset')
let outputDatasetsMap = new Map()
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesTradingPosition = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingPosition = function (processIndex) {
/*
This module packages all functions related to Positions.
*/
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesTradingProcess = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingProcess = function (processIndex) {
/*
This Module will load all the process data dependencies from files and send them downstream.
After execution, will save the time range and status report of the process.
@@ -16,8 +16,8 @@
let dataFiles = new Map()
let multiTimeFrameDataFiles = new Map()
TS.projects.foundations.globals.processModuleObjects.MODULE_OBJECTS_BY_PROCESS_INDEX_MAP.get(processIndex).TRADING_ENGINE_MODULE_OBJECT = TS.projects.foundations.botModules.tradingEngine.newFoundationsBotModulesTradingEngine(processIndex)
let tradingOutputModuleObject = TS.projects.foundations.botModules.tradingOutput.newFoundationsBotModulesTradingOutput(processIndex)
TS.projects.foundations.globals.processModuleObjects.MODULE_OBJECTS_BY_PROCESS_INDEX_MAP.get(processIndex).TRADING_ENGINE_MODULE_OBJECT = TS.projects.algorithmicTrading.botModules.tradingEngine.newAlgorithmicTradingBotModulesTradingEngine(processIndex)
let tradingOutputModuleObject = TS.projects.algorithmicTrading.botModules.tradingOutput.newAlgorithmicTradingBotModulesTradingOutput(processIndex)
let currentTimeFrame = {}
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesTradingRecords = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingRecords = function (processIndex) {
/*
This module facilitates the appending of records to the output of the process.
*/
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingSimulation = function (processIndex) {
/*
This Module represents the trading simulacion. Escentially a loop through a set of candles and
the execution at each loop cycle of the Trading System Protocol.
@@ -34,13 +34,13 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
'[INFO] runSimulation -> finalDatetime = ' + sessionParameters.timeRange.config.finalDatetime)
/* These are the Modules we will need to run the Simulation */
let tradingRecordsModuleObject = TS.projects.foundations.botModules.tradingRecords.newFoundationsBotModulesTradingRecords(processIndex)
let tradingRecordsModuleObject = TS.projects.algorithmicTrading.botModules.tradingRecords.newAlgorithmicTradingBotModulesTradingRecords(processIndex)
tradingRecordsModuleObject.initialize(outputDatasetsMap)
let tradingSystemModuleObject = TS.projects.foundations.botModules.tradingSystem.newFoundationsBotModulesTradingSystem(processIndex)
let tradingSystemModuleObject = TS.projects.algorithmicTrading.botModules.tradingSystem.newAlgorithmicTradingBotModulesTradingSystem(processIndex)
tradingSystemModuleObject.initialize()
let tradingEpisodeModuleObject = TS.projects.foundations.botModules.tradingEpisode.newFoundationsBotModulesTradingEpisode(processIndex)
let tradingEpisodeModuleObject = TS.projects.algorithmicTrading.botModules.tradingEpisode.newAlgorithmicTradingBotModulesTradingEpisode(processIndex)
tradingEpisodeModuleObject.initialize()
/* Setting up the candles array: The whole simulation is based on the array of candles at the time-frame defined at the session parameters. */
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesTradingStages = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingStages = function (processIndex) {
/*
This module packages all functions related to Stages.
*/
@@ -21,12 +21,12 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
finalize: finalize
}
let tradingStrategyModuleObject = TS.projects.foundations.botModules.tradingStrategy.newFoundationsBotModulesTradingStrategy(processIndex)
let tradingPositionModuleObject = TS.projects.foundations.botModules.tradingPosition.newFoundationsBotModulesTradingPosition(processIndex)
let tradingExecutionModuleObject = TS.projects.foundations.botModules.tradingExecution.newFoundationsBotModulesTradingExecution(processIndex)
let tradingStrategyModuleObject = TS.projects.algorithmicTrading.botModules.tradingStrategy.newAlgorithmicTradingBotModulesTradingStrategy(processIndex)
let tradingPositionModuleObject = TS.projects.algorithmicTrading.botModules.tradingPosition.newAlgorithmicTradingBotModulesTradingPosition(processIndex)
let tradingExecutionModuleObject = TS.projects.algorithmicTrading.botModules.tradingExecution.newAlgorithmicTradingBotModulesTradingExecution(processIndex)
let announcementsModuleObject = TS.projects.foundations.botModules.announcements.newFoundationsBotModulesAnnouncements(processIndex)
let snapshotsModuleObject = TS.projects.foundations.botModules.snapshots.newFoundationsBotModulesSnapshots(processIndex)
let tradingEpisodeModuleObject = TS.projects.foundations.botModules.tradingEpisode.newFoundationsBotModulesTradingEpisode(processIndex)
let snapshotsModuleObject = TS.projects.algorithmicTrading.botModules.snapshots.newAlgorithmicTradingBotModulesSnapshots(processIndex)
let tradingEpisodeModuleObject = TS.projects.algorithmicTrading.botModules.tradingEpisode.newAlgorithmicTradingBotModulesTradingEpisode(processIndex)
let tradingEngine
let tradingSystem
@@ -1,8 +1,8 @@
exports.newFoundationsBotModulesTradingStrategy = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingStrategy = function (processIndex) {
/*
This module packages all functions related to Strategies.
*/
const MODULE_NAME = 'Trading Strategy'
let thisObject = {
mantain: mantain,
reset: reset,
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesTradingSystem = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingSystem = function (processIndex) {
/*
The Trading System is the user defined set of rules compliant with the Trading Protocol that
defines the trading logic to be applied during each cycle of the Simulation.
@@ -26,7 +26,7 @@ exports.newFoundationsBotModulesTradingSystem = function (processIndex) {
let sessionParameters
let dynamicIndicators
let tradingStagesModuleObject = TS.projects.foundations.botModules.tradingStages.newFoundationsBotModulesTradingStages(processIndex)
let tradingStagesModuleObject = TS.projects.algorithmicTrading.botModules.tradingStages.newAlgorithmicTradingBotModulesTradingStages(processIndex)
let taskParameters = {
market: TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName +
@@ -1,8 +1,8 @@
exports.newFoundationsBotModulesSingleMarketTradingBot = function (processIndex) {
exports.newAlgorithmicTradingBotModulesSingleMarketTradingBot = function (processIndex) {
const MODULE_NAME = "Single Market Trading Bot";
let session = TS.projects.foundations.botModules.tradingSession.newFoundationsBotModulesTradingSession(processIndex)
let session = TS.projects.algorithmicTrading.botModules.tradingSession.newAlgorithmicTradingBotModulesTradingSession(processIndex)
let nextLoopTimeoutHandle;
let thisObject = {
@@ -282,7 +282,7 @@
"[INFO] run -> loop -> initializeDataDependencies -> onInizialized -> Execution finished well.")
switch (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.framework.name) {
case 'Low-Frequency-Trading-Process': {
processFramework = TS.projects.foundations.botModules.tradingProcess.newFoundationsBotModulesTradingProcess(processIndex);
processFramework = TS.projects.algorithmicTrading.botModules.tradingProcess.newAlgorithmicTradingBotModulesTradingProcess(processIndex);
startProcessFramework();
break;
}
@@ -1,4 +1,4 @@
exports.newFoundationsBotModulesTradingSession = function (processIndex) {
exports.newAlgorithmicTradingBotModulesTradingSession = function (processIndex) {
const MODULE_NAME = "Trading Session"
@@ -0,0 +1,38 @@
function newAlgorithmicTradingActionSwitch() {
let thisObject = {
executeAction: executeAction,
initialize: initialize,
finalize: finalize
}
return thisObject
function finalize() {
}
function initialize() {
/* Nothing to initialize since a Function Library does not hold any state. */
}
async function executeAction(action) {
switch (action.name) {
case 'Run Trading Session':
{
UI.projects.algorithmicTrading.functionLibraries.tradingSessionFunctions.runSession(action.node, false, action.callBackFunction)
}
break
case 'Resume Trading Session':
{
UI.projects.algorithmicTrading.functionLibraries.tradingSessionFunctions.runSession(action.node, true, action.callBackFunction)
}
break
case 'Stop Trading Session':
{
UI.projects.algorithmicTrading.functionLibraries.tradingSessionFunctions.stopSession(action.node, action.callBackFunction)
}
break
}
}
}
@@ -1,4 +1,4 @@
function newFoundationsFunctionLibraryTradingSessionFunctions() {
function newAlgorithmicTradingFunctionLibraryTradingSessionFunctions() {
let thisObject = {
syncronizeSessionWithBackEnd: syncronizeSessionWithBackEnd,
runSession: runSession,
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

@@ -1,4 +1,4 @@
exports.newFoundationsUtilitiesPlugins = function () {
exports.newPluginsUtilitiesPlugins = function () {
let thisObject = {
getPluginFileNames: getPluginFileNames,
@@ -14,7 +14,7 @@ exports.newFoundationsUtilitiesPlugins = function () {
SA.nodeModules.fs.readdir(path, (err, files) => {
if (err) {
reject()
reject(err)
return
}
if (files === undefined) {
@@ -8,7 +8,8 @@
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "API Map",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Community-Plugins"
},
{
"action": "Delete UI Object",
@@ -17,7 +18,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"addLeftIcons": true,
@@ -7,8 +7,11 @@
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "Data Mine",
"actionFunction": "payload.executeAction"
"iconPathOn": "data-mine",
"iconPathOff": "data-mine",
"iconProject": "Data-Mining",
"actionFunction": "payload.executeAction",
"actionProject": "Community-Plugins"
},
{
"action": "Delete UI Object",
@@ -17,7 +20,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"addLeftIcons": true,
@@ -31,7 +35,8 @@
"name": "pluginFiles",
"type": "array",
"childType": "Plugin File",
"autoAdd": false
"autoAdd": false,
"project": "Foundations"
}
]
}
@@ -8,7 +8,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"title": [
@@ -6,7 +6,8 @@
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration",
"actionFunction": "uiObject.configEditor.activate"
"actionFunction": "uiObject.configEditor.activate",
"actionProject": "Foundations"
},
{
"action": "Add UI Object",
@@ -14,25 +15,29 @@
"propertyToCheckFor": "pluginFilePosition",
"actionFunction": "payload.executeAction",
"label": "Add Plugin File Position",
"relatedUiObject": "Plugin File Position"
"relatedUiObject": "Plugin File Position",
"actionProject": "Foundations"
},
{
"action": "Enable Saving With Workspace",
"actionFunction": "payload.executeAction",
"label": "Enable Saving With Workspace",
"relatedUiObject": "Plugin File"
"relatedUiObject": "Plugin File",
"actionProject": "Community-Plugins"
},
{
"action": "Disable Saving With Workspace",
"actionFunction": "payload.executeAction",
"label": "Disable Saving With Workspace",
"relatedUiObject": "Plugin File"
"relatedUiObject": "Plugin File",
"actionProject": "Community-Plugins"
},
{
"action": "Save Plugin",
"actionFunction": "payload.executeAction",
"label": "Save Plugin",
"relatedUiObject": "Plugin File"
"relatedUiObject": "Plugin File",
"actionProject": "Community-Plugins"
},
{
"action": "Delete UI Object",
@@ -41,7 +46,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"editors": {
@@ -7,8 +7,11 @@
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "Learning Engine",
"actionFunction": "payload.executeAction"
"iconPathOn": "learning-engine",
"iconPathOff": "learning-engine",
"iconProject": "Machine-Learning",
"actionFunction": "payload.executeAction",
"actionProject": "Community-Plugins"
},
{
"action": "Delete UI Object",
@@ -17,7 +20,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"addLeftIcons": true,
@@ -7,8 +7,11 @@
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "Learning Mine",
"actionFunction": "payload.executeAction"
"iconPathOn": "learning-mine",
"iconPathOff": "learning-mine",
"iconProject": "Machine-Learning",
"actionFunction": "payload.executeAction",
"actionProject": "Community-Plugins"
},
{
"action": "Delete UI Object",
@@ -17,7 +20,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"addLeftIcons": true,
@@ -7,8 +7,11 @@
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "Learning System",
"actionFunction": "payload.executeAction"
"iconPathOn": "learning-system",
"iconPathOff": "learning-system",
"iconProject": "Machine-Learning",
"actionFunction": "payload.executeAction",
"actionProject": "Community-Plugins"
},
{
"action": "Delete UI Object",
@@ -17,7 +20,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"addLeftIcons": true,
@@ -6,13 +6,15 @@
"actionFunction": "uiObject.configEditor.activate",
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration"
"iconPathOff": "configuration",
"actionProject": "Foundations"
},
{
"action": "Add Missing Plugin Types",
"label": "Add Missing Plugin Types",
"relatedUiObject": "Plugins",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Community-Plugins"
},
{
"action": "Delete UI Object",
@@ -21,7 +23,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"initialValues": {
@@ -7,8 +7,11 @@
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "Trading Engine",
"actionFunction": "payload.executeAction"
"iconPathOn": "trading-engine",
"iconPathOff": "trading-engine",
"iconProject": "Algorithmic-Trading",
"actionFunction": "payload.executeAction",
"actionProject": "Community-Plugins"
},
{
"action": "Delete UI Object",
@@ -17,7 +20,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"addLeftIcons": true,
@@ -7,8 +7,11 @@
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "Trading Mine",
"actionFunction": "payload.executeAction"
"iconPathOn": "trading-mine",
"iconPathOff": "trading-mine",
"iconProject": "Algorithmic-Trading",
"actionFunction": "payload.executeAction",
"actionProject": "Community-Plugins"
},
{
"action": "Delete UI Object",
@@ -17,7 +20,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"addLeftIcons": true,
@@ -7,8 +7,11 @@
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "Trading System",
"actionFunction": "payload.executeAction"
"iconPathOn": "trading-system",
"iconPathOff": "trading-system",
"iconProject": "Algorithmic-Trading",
"actionFunction": "payload.executeAction",
"actionProject": "Community-Plugins"
},
{
"action": "Delete UI Object",
@@ -17,7 +20,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"addLeftIcons": true,
@@ -9,7 +9,8 @@
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "Tutorial",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Community-Plugins"
},
{
"action": "Delete UI Object",
@@ -18,7 +19,8 @@
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
}
],
"addLeftIcons": true,
@@ -0,0 +1,45 @@
{
"type": "Plugins Project",
"menuItems": [
{
"action": "Add Missing Children",
"label": "Add Missing Children",
"relatedUiObject": "Foundations Project",
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Add UI Object",
"label": "Add Plugins",
"relatedUiObject": "Plugins",
"relatedUiObjectProject": "Community-Plugins",
"actionFunction": "payload.executeAction",
"actionProject": "Foundations"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"actionFunction": "payload.executeAction",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionProject": "Foundations"
}
],
"isProjectHead": true,
"isTitleAllwaysVisible": false,
"addLeftIcons": true,
"isPinned": true,
"positionLocked": true,
"icon": "plugins-project",
"childrenNodesProperties": [
{
"name": "projectDefinition",
"type": "node",
"childType": "Project Definition",
"project": "Foundations",
"autoAdd": true
}
]
}
@@ -8,7 +8,8 @@
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
"relatedUiObject": "Plugin Project",
"actionFunction": "payload.executeAction"
"actionFunction": "payload.executeAction",
"actionProject": "Community-Plugins"
},
{
"action": "Delete UI Object",
@@ -17,7 +18,8 @@
"actionFunction": "payload.executeAction",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity"
"iconPathOff": "delete-entity",
"actionProject": "Foundations"
}
],
"isHierarchyHead": true,
@@ -0,0 +1,98 @@
function newCommunityPluginsActionSwitch() {
let thisObject = {
executeAction: executeAction,
initialize: initialize,
finalize: finalize
}
return thisObject
function finalize() {
}
function initialize() {
/* Nothing to initialize since a Function Library does not hold any state. */
}
async function executeAction(action) {
switch (action.name) {
case 'Install as Plugin':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.installAsPlugin(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Projects':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginProjects(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Types':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginTypes(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Data Mines':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginDataMines(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Trading Mines':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginTradingMines(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Trading Systems':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginTradingSystems(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Trading Engines':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginTradingEngines(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Learning Mines':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginLearningMines(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Learning Systems':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginLearningSystems(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Learning Engines':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginLearningEngines(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin Tutorials':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginTutorials(action.node, action.rootNodes)
}
break
case 'Add Missing Plugin API Maps':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.addMissingPluginApiMaps(action.node, action.rootNodes)
}
break
case 'Enable Saving With Workspace':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.enableSavingWithWorkspace(action.node, action.rootNodes)
}
break
case 'Disable Saving With Workspace':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.disableSavingWithWorkspace(action.node, action.rootNodes)
}
break
case 'Save Plugin':
{
UI.projects.communityPlugins.functionLibraries.pluginsFunctions.savePlugin(action.node, action.rootNodes)
}
break
}
}
}
@@ -1,4 +1,4 @@
function newFoundationsFunctionLibraryPluginsFunctions() {
function newPluginsFunctionLibraryPluginsFunctions() {
let thisObject = {
addMissingPluginProjects: addMissingPluginProjects,
addMissingPluginTypes: addMissingPluginTypes,
@@ -43,14 +43,14 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
let pluginType = "Plugin" + " " + projectDefinition.plugins[i]
if (UI.projects.foundations.utilities.nodeChildren.isMissingChildrenByType(node, pluginType) === true) {
UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, pluginType, undefined, project)
UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, pluginType, undefined, 'Community-Plugins')
}
}
}
}
function addMissingPluginDataMines(node, rootNodes) {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
@@ -58,15 +58,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Data-Mines', onNamesArrived)
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Data-Mines', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Data-Mines', 'Data Mine')
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Data-Mines', 'Data Mine', 'Data-Mining')
}
}
function addMissingPluginTradingMines(node, rootNodes) {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
@@ -74,15 +74,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Mines', onNamesArrived)
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Trading-Mines', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Trading-Mines', 'Trading Mine')
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Trading-Mines', 'Trading Mine', 'Algorithmic-Trading')
}
}
function addMissingPluginTradingSystems(node, rootNodes) {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
@@ -90,15 +90,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Systems', onNamesArrived)
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Trading-Systems', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Trading-Systems', 'Trading System')
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Trading-Systems', 'Trading System', 'Algorithmic-Trading')
}
}
function addMissingPluginTradingEngines(node, rootNodes) {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
@@ -106,15 +106,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Engines', onNamesArrived)
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Trading-Engines', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Trading-Engines', 'Trading Engine')
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Trading-Engines', 'Trading Engine', 'Algorithmic-Trading')
}
}
function addMissingPluginLearningMines(node, rootNodes) {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
@@ -122,15 +122,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Mines', onNamesArrived)
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Learning-Mines', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Learning-Mines', 'Learning Mine')
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Learning-Mines', 'Learning Mine', 'Machine-Learning')
}
}
function addMissingPluginLearningSystems(node, rootNodes) {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
@@ -138,15 +138,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Systems', onNamesArrived)
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Learning-Systems', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Learning-Systems', 'Learning System')
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Learning-Systems', 'Learning System', 'Machine-Learning')
}
}
function addMissingPluginLearningEngines(node, rootNodes) {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
@@ -154,15 +154,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Engines', onNamesArrived)
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Learning-Engines', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Learning-Engines', 'Learning Engine')
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Learning-Engines', 'Learning Engine', 'Machine-Learning')
}
}
function addMissingPluginTutorials(node, rootNodes) {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
@@ -170,15 +170,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Tutorials', onNamesArrived)
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'Tutorials', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Tutorials', 'Tutorial')
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'Tutorials', 'Tutorial', 'Education')
}
}
function addMissingPluginApiMaps(node, rootNodes) {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
let projectName = UI.projects.communityPlugins.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
@@ -186,10 +186,10 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
}
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'API-Maps', onNamesArrived)
UI.projects.communityPlugins.utilities.plugins.getPluginFileNames(projectName, 'API-Maps', onNamesArrived)
function onNamesArrived(fileNames) {
UI.projects.foundations.utilities.plugins.addMissingPluginFiles(node, fileNames, 'API-Maps', 'API Map')
UI.projects.communityPlugins.utilities.plugins.addMissingPluginFiles(node, fileNames, 'API-Maps', 'API Map', 'Foundations')
}
}
@@ -204,16 +204,16 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
}
function savePlugin(node, rootNodes) {
UI.projects.foundations.utilities.plugins.savePluginFile(node)
UI.projects.communityPlugins.utilities.plugins.savePluginFile(node)
}
function installAsPlugin(node, rootNodes) {
let plugins = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadByNodeType('Plugins')
let pluginProject = UI.projects.foundations.utilities.nodeChildren.findChildByCodeName(plugins, node.project)
let pluginFolderName = UI.projects.foundations.utilities.plugins.getPluginFolderNamesByNodeType(node.type)
let pluginFolderName = UI.projects.communityPlugins.utilities.plugins.getPluginFolderNamesByNodeType(node.type)
let pluginForlderNodeType = 'Plugin ' + pluginFolderName.replaceAll('-', ' ')
let pluginFolderNode = UI.projects.foundations.utilities.nodeChildren.findChildByType(pluginProject, pluginForlderNodeType)
let pluginFile = UI.projects.foundations.utilities.plugins.addMissingPluginFile(pluginFolderNode, node.name, pluginFolderName, node.type, true)
let pluginFile = UI.projects.communityPlugins.utilities.plugins.addMissingPluginFile(pluginFolderNode, node.name, pluginFolderName, node.type, node.project, true)
node.isPlugin = true
if (pluginFile === undefined) {
@@ -221,6 +221,6 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
return
}
UI.projects.foundations.utilities.plugins.savePluginFile(pluginFile)
UI.projects.communityPlugins.utilities.plugins.savePluginFile(pluginFile)
}
}
@@ -1,4 +1,4 @@
function newFoundationsUtilitiesPlugins() {
function newPluginsUtilitiesPlugins() {
let thisObject = {
getPluginFileNames: getPluginFileNames,
getPluginFolderNamesByNodeType: getPluginFolderNamesByNodeType,
@@ -24,20 +24,20 @@ function newFoundationsUtilitiesPlugins() {
}
}
function addMissingPluginFiles(node, fileNames, pluginFolder, nodeType) {
function addMissingPluginFiles(node, fileNames, pluginFolder, nodeType, project) {
for (let i = 0; i < fileNames.length; i++) {
let fileName = fileNames[i]
fileName = fileName.replace('.json', '')
addMissingPluginFile(node, fileName, pluginFolder, nodeType, false)
addMissingPluginFile(node, fileName, pluginFolder, nodeType, project, false)
}
}
function addMissingPluginFile(node, fileName, pluginFolder, nodeType, saveWithWorkspace) {
function addMissingPluginFile(node, fileName, pluginFolder, nodeType, project, saveWithWorkspace) {
if (UI.projects.foundations.utilities.nodeChildren.isMissingChildrenByName(node, fileName) === true) {
let child = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, 'Plugin File', undefined, 'Foundations')
let child = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, 'Plugin File', undefined, 'Community-Plugins')
child.name = fileName
child.config = JSON.stringify({
project: node.project,
project: project,
fileName: fileName,
folderName: pluginFolder,
nodeType: nodeType,
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Loaded 100 of 255 files, more files were not shown because too many files have changed in this diff. Show more