~ Initial publish
8
.vscode/settings.json
vendored
Normal file
8
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"grammarly.selectors": [
|
||||||
|
{
|
||||||
|
"language": "markdown",
|
||||||
|
"scheme": "file"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
55
Config.md
Normal file
55
Config.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# Config
|
||||||
|
Certainly! The configuration file, located at `%userhome%/MorphixProductions/Getiyo/config.json`, enables you to modify core behaviors that aren't accessible through the user interface. By adjusting the settings in this file, you can optimize Getiyo to meet your specific needs.
|
||||||
|
|
||||||
|
## Structure
|
||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"name": null,
|
||||||
|
"developmentMode": false,
|
||||||
|
"ports": {
|
||||||
|
"http": 4080,
|
||||||
|
"https": 4443
|
||||||
|
},
|
||||||
|
"systemColor": "#f44336",
|
||||||
|
"singleChannelMode": {
|
||||||
|
"enabled": false,
|
||||||
|
"channelID": null
|
||||||
|
},
|
||||||
|
"moduleStore": {
|
||||||
|
"address": "https://dev.getiyo.com",
|
||||||
|
"port": 4181,
|
||||||
|
"frontEndAddress": null,
|
||||||
|
"frontEndPort": null,
|
||||||
|
"browserKey": null
|
||||||
|
},
|
||||||
|
"installation": {
|
||||||
|
"performance": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"statistics": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"logsave": {
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"saveInterval": 60000,
|
||||||
|
"currentDate": "2023-01-16"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|Property|Description|
|
||||||
|
|-|-|
|
||||||
|
name | Defines the name of the Getiyo instance.
|
||||||
|
developmentMode | **TURN THIS OFF IN PRODUCTION** Disables account authentication and create routes for the [GetiyoModuleTool](./GetiyoModuleTool) to restart the server during development.
|
||||||
|
port.http | Specifies the port for the HTTP server to bind.
|
||||||
|
port.https | Indicates the port for the HTTPS server to bind; requires `privkey.pem`, `cert.pem`, and `chain.pem` in the %userhome%/MorphixProductions/Getiyo/cert directory.
|
||||||
|
systemColor | Sets the highlight color used for various UI elements such as menus, buttons, toggles, and anchor elements.
|
||||||
|
singleChannelMode.enabled | When enabled only one channel can be accessed on this server. The main display of the channel will also be the root url of the server (`http://serverip:4080`) instead of `http://serverip:4080/channelname`. This requires the `singleChannelMode.channelID` property to be set.
|
||||||
|
singleChannelMode.channelID | Determines the channel ID for single-channel mode; see singleChannelMode.enabled.
|
||||||
|
moduleStore.* | Config data for the module store; most settings accessible via admin module page (http://serverip:4080/admin/modules)
|
||||||
|
installation.performance | Activates server performance logging
|
||||||
|
installation.statics | Enables IP visitor logging
|
||||||
|
installation.logsave | Saves server console output
|
||||||
|
saveInterval | Sets frequency (in milliseconds) for writing changed channel updates to their file.
|
||||||
|
currentDate | Internal property for time tracking and backup control.
|
||||||
14
ContactDetails.md
Normal file
14
ContactDetails.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Contact Details
|
||||||
|
Getiyo by Morphix.productions is an interactive software system developed by:
|
||||||
|
|
||||||
|
> ### Mees van der Wijk
|
||||||
|
> Email [mees@morphix.productions](mailto:mees@morphix.productions)<br>
|
||||||
|
> Tel [+31613392837](tel:+31613392837)<br>
|
||||||
|
> *Available for development & security questions*
|
||||||
|
|
||||||
|
> ### Marco Mooren
|
||||||
|
> Email [marco@morphix.productions](mailto:marco@morphix.productions)<br>
|
||||||
|
> Tel [+31641238972](tel:+31641238972)<br>
|
||||||
|
> *Available for inqueries & concept development*
|
||||||
|
|
||||||
|

|
||||||
24
GetiyoModuleTool.md
Normal file
24
GetiyoModuleTool.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Getiyo Module Tool
|
||||||
|
The GetiyoModuleTool (or GMT in short) is the development tool for Getiyo. It can create development environments, build/install modules and publish them to the [ModuleStore](./ModuleStore). GMT has four modes which are described below.
|
||||||
|
|
||||||
|
## build - ```gmt build```
|
||||||
|
Build a module to the `.dist` directory.
|
||||||
|
|Argument|Description|
|
||||||
|
|-|-|
|
||||||
|
--output-server|Output the build to your local server. Requires ip & port to be set (See [set](./GetiyoModuleTool#set-gmt-set-property-value))
|
||||||
|
--stop-server|Restart the server when the build is finished. Requires development mode to be turned on in the [config](./Config).
|
||||||
|
|
||||||
|
## create - ```gmt create```
|
||||||
|
Create a new development environment. GMT will ask some questions to generate the wanted environment settings.
|
||||||
|
|
||||||
|
## install - ```gmt install```
|
||||||
|
Install the current build in .dist to your local server.
|
||||||
|
|
||||||
|
## set - ```gmt set <property> <value```
|
||||||
|
Update a GMT settings.
|
||||||
|
|Property|Description|
|
||||||
|
|ip|Local server ip address
|
||||||
|
|port|Local server port
|
||||||
|
|
||||||
|
## publish - ```gmt publish```
|
||||||
|
Publish the latest build to the ModuleStore. This requires a publish-key (see [ModuleStore](./ModuleStore)).
|
||||||
1
Home.md
1
Home.md
@@ -1 +0,0 @@
|
|||||||
Welcome to the Wiki.
|
|
||||||
220
ModuleClientAPI.md
Normal file
220
ModuleClientAPI.md
Normal file
@@ -0,0 +1,220 @@
|
|||||||
|
# ModuleClientAPI
|
||||||
|
|
||||||
|
Class representing the ModuleClientAPI.
|
||||||
|
|
||||||
|
<!-- ## Overiew
|
||||||
|
Communication
|
||||||
|
* [send](./ModuleClientAPI#send)
|
||||||
|
* [on](./ModuleClientAPI#on)
|
||||||
|
* [finishClientCondition](./ModuleClientAPI#finishclientcondition)
|
||||||
|
|
||||||
|
Events
|
||||||
|
* [onPropertyUpdate](./ModuleClientAPI#onpropertyupdate)
|
||||||
|
* [onUserDetailsChange](./ModuleClientAPI#onuserdetailschange)
|
||||||
|
* [onResize](./ModuleClientAPI#onresize)
|
||||||
|
|
||||||
|
Module
|
||||||
|
* [dom](./ModuleClientAPI#dom)
|
||||||
|
* [getResolution](./ModuleClientAPI#getresolution)
|
||||||
|
|
||||||
|
Environment
|
||||||
|
* [redirect](./ModuleClientAPI#redirect)
|
||||||
|
* [getUser](./ModuleClientAPI#getuser)
|
||||||
|
|
||||||
|
|
||||||
|
Globals
|
||||||
|
* [Feedback](./ModuleClientAPI#feedback-notifications-dialogs-confirms-alerts)
|
||||||
|
* [ce (Create Element)](./ModuleClientAPI#ce)
|
||||||
|
* [loading](./ModuleClientAPI#loading)
|
||||||
|
* [hideLoading](./ModuleClientAPI#hideloading)
|
||||||
|
* [*CHANNEL*](./ModuleClientAPI#const-channel)
|
||||||
|
* [*ID*](./ModuleClientAPI#const-id)
|
||||||
|
* [*DISPLAY*](./ModuleClientAPI#const-display) -->
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
### send
|
||||||
|
|
||||||
|
Send a message to the ModuleServerAPI.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.send(header, ...args);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | -------------------------- |
|
||||||
|
| header | string | The header of the message. |
|
||||||
|
| args | any[] | Data of any type |
|
||||||
|
|
||||||
|
### on
|
||||||
|
|
||||||
|
Register a listener for messages from the ModuleServerAPI.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.on(header, callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ----------------------- | ----------------------------------------------------------- |
|
||||||
|
| header | string | To header of the messages the listener will receive. |
|
||||||
|
| callback | ( ...args:any [] ):void | Function that receives the incomming message and arguments. |
|
||||||
|
|
||||||
|
### finishClientCondition
|
||||||
|
|
||||||
|
Finish a client condition for this client.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.finishClientCondition(conditionId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ----------- | ------ | ------------------------ |
|
||||||
|
| conditionId | string | The id of the condition. |
|
||||||
|
|
||||||
|
### onPropertyUpdate
|
||||||
|
|
||||||
|
Register a listener for when a property updates in a scene change.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.onPropertyUpdate(propertyId, callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ---------- | ------------------ | ----------------------------------------------- |
|
||||||
|
| propertyId | string | The property ID that the listener will receive. |
|
||||||
|
| callback | ( value:any ):void | Function that receives the new property value. |
|
||||||
|
|
||||||
|
### onUserDetailsChange
|
||||||
|
|
||||||
|
Register a listener for when the user changes their details.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.onUserDetailsChange(callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | -------- | ----------------------------------------------------------------- |
|
||||||
|
| callback | function | Function that will be called when the user changed their details. |
|
||||||
|
|
||||||
|
### onResize
|
||||||
|
|
||||||
|
Register a listener for when the module changes size.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.onResize(callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | -------- | -------------------------------------------------------- |
|
||||||
|
| callback | function | Function that will be called when the module is resized. |
|
||||||
|
|
||||||
|
### dom
|
||||||
|
|
||||||
|
Get the HTMLDivElement that contains the module HTML. It is important that all your query's to the document are based of this. So you need to use `api.dom().querySeletor(p)` instead of `document.querySeletor(p)` to prevent querying element from another module.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.dom();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** HTMLDivElement _The module container_
|
||||||
|
|
||||||
|
### getResolution
|
||||||
|
|
||||||
|
Get the scene resolution.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.getResolution();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** { width:number, height:number } _Resolution of scene_
|
||||||
|
|
||||||
|
### redirect
|
||||||
|
|
||||||
|
Redirect user to another url. If the url is a channel on the same server and target is `self` it will redirect internally.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.redirect(address target)
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | ------------------------------ | -------- | ------------------------------- |
|
||||||
|
| address | string | The new address to redirect to |
|
||||||
|
| target | 'self' | 'blank' | 'parent' | The target to open the page in. |
|
||||||
|
|
||||||
|
### getUser
|
||||||
|
|
||||||
|
Get the current user object.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.getUser();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Return** [User](./ModuleClientAPIUser) _The user object_
|
||||||
|
|
||||||
|
## Globals
|
||||||
|
|
||||||
|
### Feedback (notifications, dialogs, confirms, alerts)
|
||||||
|
|
||||||
|
Use the internal feedback component. See [feedback](./Feedback)
|
||||||
|
|
||||||
|
### ce
|
||||||
|
|
||||||
|
Util function to quickly create HTML elements.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
ce(tagName, classList?, attributes?, innerText?, innerHTML?);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| --------------------- | --------------------------------- | ------------------------------------------------- |
|
||||||
|
| tagName | keyof HTMLElementTagNameMap | The tagname of the new element. (For example div) |
|
||||||
|
| (Optional) classList | string \| string[] | Class(es) to add to the element. |
|
||||||
|
| (Optional) attributes | { [key:string]:string } | Attributes to set on the element. |
|
||||||
|
| (Optional) innerText | Text to set as the inner content. |
|
||||||
|
| (Optional) innerHTML | HTML to set as the inner content. |
|
||||||
|
|
||||||
|
**Returns** HTMLElement _New HTML element_
|
||||||
|
|
||||||
|
### loading
|
||||||
|
|
||||||
|
Show the system UI loader.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
loading(zIndex);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | ---------------------------------------------- |
|
||||||
|
| zIndex | number | The z index lever on which to draw the loader. |
|
||||||
|
|
||||||
|
### loading
|
||||||
|
|
||||||
|
Hide the system UI loader.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
hideLoading();
|
||||||
|
```
|
||||||
|
|
||||||
|
### const _CHANNEL_
|
||||||
|
|
||||||
|
Current channel hostname.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
CHANNEL;
|
||||||
|
```
|
||||||
|
|
||||||
|
### const _ID_
|
||||||
|
|
||||||
|
Current channel id.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
ID;
|
||||||
|
```
|
||||||
|
|
||||||
|
### const _DISPLAY_
|
||||||
|
|
||||||
|
Current display id.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
DISPLAY;
|
||||||
|
```
|
||||||
2
ModuleClientAPIFeedback.md
Normal file
2
ModuleClientAPIFeedback.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# ModuleClientApi - Feedback
|
||||||
|
Need to do this sometime... Please contact me if needed!
|
||||||
144
ModuleClientAPIUser.md
Normal file
144
ModuleClientAPIUser.md
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
# ModuleClientApi - User
|
||||||
|
|
||||||
|
Class representing the ModuleClientAPI User.
|
||||||
|
|
||||||
|
<!--
|
||||||
|
## Overview
|
||||||
|
Details
|
||||||
|
* [getName](./ModuleClientAPIUser#getname)
|
||||||
|
* [getOrganization](./ModuleClientAPIUser#getorganization)
|
||||||
|
* [hasName](./ModuleClientAPIUser#hasname)
|
||||||
|
* [hasOrganization](./ModuleClientAPIUser#hasorganization)
|
||||||
|
* [changeDetails](./ModuleClientAPIUser#changedetails)
|
||||||
|
|
||||||
|
MultiMedia
|
||||||
|
* [getCameraID](./ModuleClientAPIUser#getcameraid)
|
||||||
|
* [getMicrophoneID](./ModuleClientAPIUser#getmicrophoneid)
|
||||||
|
* [hasCameraID](./ModuleClientAPIUser#hascameraid)
|
||||||
|
* [hasMicrophoneID](./ModuleClientAPIUser#hasmicrophoneid)
|
||||||
|
|
||||||
|
Device
|
||||||
|
* [isMobile](./ModuleClientAPIUser#ismobile)
|
||||||
|
* [isMobileOrTablet](./ModuleClientAPIUser#ismobileortablet) -->
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
### getName
|
||||||
|
|
||||||
|
Get the name of the user.
|
||||||
|
|
||||||
|
```
|
||||||
|
api.getUser().getName(callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ------------------- | -------------------- | ------------------------------------------------------------------------------------------ |
|
||||||
|
| (Optional) callback | ( name:string ):void | Show a popup when a user has not entered their name and receive the name via the callback. |
|
||||||
|
|
||||||
|
**Returns** string _Name of the user (only if callback is undefined)_
|
||||||
|
|
||||||
|
### getOrganization
|
||||||
|
|
||||||
|
Get the organization of the user.
|
||||||
|
|
||||||
|
```
|
||||||
|
api.getUser().getName(callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||||
|
| (Optional) callback | ( name:string ):void | Show a popup when a user has not entered their organization and receive the organization via the callback. |
|
||||||
|
|
||||||
|
**Returns** string _Organization of the user (only if callback is undefined)_
|
||||||
|
|
||||||
|
### hasName
|
||||||
|
|
||||||
|
Check is the user has a name.
|
||||||
|
|
||||||
|
```
|
||||||
|
api.getUser().hasName();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Return** boolean _User has name_
|
||||||
|
|
||||||
|
### hasOrganization
|
||||||
|
|
||||||
|
Check is the user has a organization.
|
||||||
|
|
||||||
|
```
|
||||||
|
api.getUser().hasOrganization();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Return** boolean _User has organization_
|
||||||
|
|
||||||
|
### changeDetails
|
||||||
|
|
||||||
|
Show the change name dialog to the user.
|
||||||
|
|
||||||
|
```
|
||||||
|
api.getUser().changeDetails(callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | -------- | --------------------------------------------------------------------------- |
|
||||||
|
| callback | function | Function that will be called when the user finishes changing their details. |
|
||||||
|
|
||||||
|
### getCameraID
|
||||||
|
|
||||||
|
Get current select camera deviceID.
|
||||||
|
|
||||||
|
```
|
||||||
|
api.getUser().getCameraID();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** string _Select camera device ID or null_
|
||||||
|
|
||||||
|
### getMicrophoneID
|
||||||
|
|
||||||
|
Get current select microphone deviceID.
|
||||||
|
|
||||||
|
```
|
||||||
|
api.getUser().getMicrophoneID();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** string _Select microphone device ID or null_
|
||||||
|
|
||||||
|
### hasCameraID
|
||||||
|
|
||||||
|
Check if the user has a camera selected.
|
||||||
|
|
||||||
|
```
|
||||||
|
api.getUser().hasCameraID();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** boolean _Camera is selected_
|
||||||
|
|
||||||
|
### hasMicrophoneID
|
||||||
|
|
||||||
|
Check if the user has a microphone selected.
|
||||||
|
|
||||||
|
```
|
||||||
|
api.getUser().hasMicrophoneID();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** boolean _Microphone is selected_
|
||||||
|
|
||||||
|
### isMobile
|
||||||
|
|
||||||
|
Check if the user is watching from a mobile phone.
|
||||||
|
|
||||||
|
```
|
||||||
|
api.getUser().isMobile();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** boolean _User is on mobile_
|
||||||
|
|
||||||
|
### isMobileOrTablet
|
||||||
|
|
||||||
|
Check if the user is watching from a mobile phone or from a tablet.
|
||||||
|
|
||||||
|
```
|
||||||
|
api.getUser().isMobileOrTablet();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** boolean _User is on mobile or table_
|
||||||
20
ModuleCondition.md
Normal file
20
ModuleCondition.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Module.json Condition
|
||||||
|
A condition is a way for the timeline to wait till a condition is met. There are two types of conditions: server or client.
|
||||||
|
### Client Conditions
|
||||||
|
Client conditions can be met via the [ModuleClientAPI](./ModuleClientAPI). Because the ModuleClientAPI runs on the machines of viewers which you can not trust, Getiyo has a system that allows timeline makers to specify a minimum percentage of clients to have met the condition before continuing. The ModuleServerAPI can force a client condition.
|
||||||
|
### Server Conditions
|
||||||
|
Server conditions can be met via the [ModuleServerAPI](./ModuleServerAPI).
|
||||||
|
|
||||||
|
Although these two types of conditions function differently you specify them the same way in your module.json. Below is an example of what a condition would look like:
|
||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"title": "Wait for something",
|
||||||
|
"description": "This will wait till something will happen."
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|Parameter|Description|
|
||||||
|
|-|-|
|
||||||
|
title | Visual title of the condition
|
||||||
|
description | Short description that explains what the condition does
|
||||||
|
|
||||||
|
View this in a [complete module.json example](./module.json).
|
||||||
13
ModuleDebugging.md
Normal file
13
ModuleDebugging.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Module Debugging
|
||||||
|
When you use the console in your module the [GetiyoModuleTool](./GetiyoModuleTool) will automatically convert them into internal logs. The server-side logs are directly printed to the console but the page logs are hidden by default. If you want to view the logs open the page with the `debug=` url parameter followed one or more module ids or module types separated by a comma. You can also use a * to show all logs.
|
||||||
|
|
||||||
|
If you did not open the page with the debug parameter, or if you want to view all logs even if they were not filtered by the debug parameter values, you can run `ModuleLogs.writeOut()` to write out all the logs since the page load.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
### Show logs of all *DemoModule*
|
||||||
|
`http://serverIp:4080/:CHANNELNAME?debug=demomodule`
|
||||||
|
### Show logs of all *DemoModule* & *TestModule*
|
||||||
|
`http://serverIp:4080/:CHANNELNAME?debug=demomodule,testmodule`
|
||||||
|
### Show logs a specific module
|
||||||
|
`http://serverIp:4080/:CHANNELNAME?debug=8K20FK5JSK`
|
||||||
28
ModuleEnvironment.md
Normal file
28
ModuleEnvironment.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# Development environment
|
||||||
|
Making your own modules is quite easy if you know the basic workflow. First, you need to set up the global [GetiyoModuleTool](./GetiyoModuleTool) and from there it's fast and easy to set up an environment or build a module.
|
||||||
|
|
||||||
|
|
||||||
|
## Setting up for the first time
|
||||||
|
1) Make sure you have [Node.js LTS](https://nodejs.org/en/) installed.
|
||||||
|
2) Clone the GetiyoModuleTool from [the repository](https://git.mooren.tv/Getiyo/Getiyo-Module-Tool).
|
||||||
|
3) Navigate into the directory and run ```npm i```
|
||||||
|
4) Wait for the process to finish and run ```npm install -g```
|
||||||
|
5) After the process is finished verify by running ```gmt```
|
||||||
|
6) It should output the arguments list for GMT. To effectively build modules, GMT has a build-in way to restart your Getiyo server. **However**, this requires that the development mode is turned on in the [config](./Config.md).
|
||||||
|
|
||||||
|
## Creating a module environment
|
||||||
|
1) Create a directory where you'd like to create the module workspace and open a terminal there.
|
||||||
|
2) Run ```gmt create```
|
||||||
|
3) GMT will ask some questions to create the module.json
|
||||||
|
4) After the questions, the environment will be created.
|
||||||
|
5) You can now open the directory with your preferred IDE.
|
||||||
|
|
||||||
|
## Building a module
|
||||||
|
1) Open the root directory of the module environment in a terminal.
|
||||||
|
2) Run ```gmt build```
|
||||||
|
3) Additionally, you can also let GMT automatically install the module to your local server with the argument `--output-server`
|
||||||
|
4) You can also restart the server with `--stop-server` but development mode has to be turned on and you have to configure your server details first with:
|
||||||
|
* `gmt set ip <serverip>`
|
||||||
|
* `gmt set port <port>`
|
||||||
|
|
||||||
|
[Full documentation of the GetiyoModuleTool.](./GetiyoModuleTool.md)
|
||||||
55
ModuleJSON.md
Normal file
55
ModuleJSON.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# Module.json
|
||||||
|
The module.json is the main file for every module. It contains metadata that tells Getiyo what it is and it contains the modules properties, triggers & conditions. The [GetiyoModuleTool](./GetiyoModuleTool) will set this file up for you, but if you wish to change/add properties/triggers/conditions see the documentation below. There is also a [complete module.json example](./module.json).
|
||||||
|
|
||||||
|
The module.json file serves as the central configuration file for each module in Getiyo. It contains essential metadata that informs Getiyo about the module's identity, as well as the module's properties, triggers, and conditions. The [GetiyoModuleTool](./GetiyoModuleTool) can automatically generate this file for you, streamlining the setup process. However, if you want to modify or add properties, triggers, or conditions, you can refer to the documentation provided below. For a full example of a module.json file, see the [complete module.json example](./module.json).
|
||||||
|
|
||||||
|
## Structure
|
||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"name": "DemoModule",
|
||||||
|
"author": "Mees van der Wijk",
|
||||||
|
"category": "Debug",
|
||||||
|
"description": "A simple demo module!",
|
||||||
|
|
||||||
|
"default_reference_properties": {
|
||||||
|
"propertyId": { property }
|
||||||
|
},
|
||||||
|
|
||||||
|
"default_module_properties": {
|
||||||
|
"propertyId": { property }
|
||||||
|
},
|
||||||
|
|
||||||
|
"triggers": {
|
||||||
|
"triggerId": { trigger }
|
||||||
|
},
|
||||||
|
|
||||||
|
"conditions": {
|
||||||
|
"client": {
|
||||||
|
"conditionId": { condition }
|
||||||
|
},
|
||||||
|
"server": {
|
||||||
|
"conditionId": { condition }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"defaultsize": { "width": 400, "height": 400 },
|
||||||
|
"defaultlocation": { "x": 100, "y": 100 }
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|Property|Description|Example
|
||||||
|
|-|-|-|
|
||||||
|
name | The property name, used internally for creating an ID. Changing this will break modules using the old name.
|
||||||
|
author | The module author.
|
||||||
|
category | A fitting category for the module.
|
||||||
|
description | A short module description.
|
||||||
|
default_reference_properties | An object with property IDs as keys and property objects as values. Reference properties are unique for each scene a module is a part of. These are also the properties you edit in the scene editor. See [property](./ModuleJSONProperty) for all parameters. | ```{ property1: { property }, property2: { property } }```
|
||||||
|
default_module_properties | An object with property IDs as keys and property objects as values. Module properties are shared for the entire module instance. See [property](./ModuleJSONProperty) for all parameters. | ```{ property1: { property }, property2: { property } }```
|
||||||
|
triggers | An object with trigger IDs as keys and trigger data as values. Triggers allow the timeline to call the server-side of a module, controlling module behavior automatically. See [trigger](./ModuleTrigger) for all parameters. | ```{ trigger1: { trigger }, trigger1: { trigger } }```
|
||||||
|
conditions.client | An object with condition IDs as keys and condition data as values. A condition is a way for the timeline to wait till a condition is met. These are client conditions, they can be met via the [ModuleClientAPI](./ModuleClientAPI). Because the ModuleClientAPI runs on the machines of viewers which you can not trust, Getiyo has a system that allows timeline makers to specify a minimum percentage of clients to have met the condition before continuing. The ModuleServerAPI can force a client condition. See [conditions](./ModuleCondition) for all parameters. | ```{ condition1: { condition }, condition2: { condition } }```
|
||||||
|
conditions.server | An object with condition IDs as keys and condition data as values. These are server conditions, they can be met via the [ModuleServerAPI](./ModuleServerAPI). The object is the same as `conditions.client`. | ```{ condition1: { condition }, condition2: { condition } }```
|
||||||
|
defaultsize.width | The default width of the module.
|
||||||
|
defaultsize.height |The default height of the module.
|
||||||
|
defaultlocation.x | <span style="color:red">**Probably deprecated soon!**</span> Default x coordinate of the module.
|
||||||
|
defaultlocation.y | <span style="color:red">**Probably deprecated soon!**</span> Default y coordinate of the module.
|
||||||
101
ModuleJSONProperty.md
Normal file
101
ModuleJSONProperty.md
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
# Module.json Property
|
||||||
|
Each property consists of a property-type, some metadata and of course the value. Below is an example of what a basic property looks like.
|
||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"name": "Property 1",
|
||||||
|
"type": "text",
|
||||||
|
"description": "Enter some text",
|
||||||
|
"value": "Hello World!"
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|Property|Description|
|
||||||
|
|-|-|
|
||||||
|
name | Name of the property, this will be visible in the scene editor.
|
||||||
|
type | Property type, see below.
|
||||||
|
description | A description what the property does, this will be shown when a user clicks the questionmark next to the property in the scene editor.
|
||||||
|
value | The default value for the property.
|
||||||
|
|
||||||
|
## Property Types
|
||||||
|
The property type specifies how the property should behave in the editor. Some properties have additional parameters you must/can set. Below you can find all property types and additional parameters.
|
||||||
|
|
||||||
|
### text
|
||||||
|
Text input field
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
|value|string|The default value for the property.
|
||||||
|
|
||||||
|
### textarea
|
||||||
|
Multiline text input field
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
|value|string|The default value for the property.
|
||||||
|
### number
|
||||||
|
Number input field
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
|value|number|The default value for the property.
|
||||||
|
|min|number|The minimum value.
|
||||||
|
|max|number|The maximum value.
|
||||||
|
|step|number|The step to increase/decrease with.
|
||||||
|
|
||||||
|
### slider
|
||||||
|
Range slider
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
|value|number|The default value for the property.
|
||||||
|
|min|number|The minimum value.
|
||||||
|
|max|number|The maximum value.
|
||||||
|
|step|number|The step to increase/decrease with.
|
||||||
|
|
||||||
|
### color
|
||||||
|
Color picker
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
|value|string|The default value for the property.
|
||||||
|
|
||||||
|
### checkbox
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
|value|boolean|The default value for the property.
|
||||||
|
|
||||||
|
### time
|
||||||
|
Time selector
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
|value|number|The default value (unix epoch seconds) for the property.
|
||||||
|
|
||||||
|
### date
|
||||||
|
Date selector
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
|value|number|The default value (unix epoch seconds) for the property.
|
||||||
|
|
||||||
|
### datetime
|
||||||
|
Date + Time selector
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
|value|number|The default value (unix epoch seconds) for the property.
|
||||||
|
|
||||||
|
### select
|
||||||
|
Dropdown select
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
|value|string|The default selected value for the property.
|
||||||
|
|allowedValues|{id:string, text:string}[]|The values that can be selected.
|
||||||
|
|
||||||
|
### file
|
||||||
|
Select file from filebrowser
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
|value|null|
|
||||||
|
|multi|boolean|Can select multiple files.
|
||||||
|
|allowedTypes|string[]|Selectable file types. Can be `image`, `video`, `audio`, `font`, `pdf`, `animation`, `vectorImage`
|
||||||
|
|
||||||
|
### giphy
|
||||||
|
Grab animation from Giphy
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
|value|null|
|
||||||
|
|
||||||
|
View this in a [complete module.json example](./module.json).
|
||||||
544
ModuleServerAPI.md
Normal file
544
ModuleServerAPI.md
Normal file
@@ -0,0 +1,544 @@
|
|||||||
|
# ModuleServerAPI
|
||||||
|
|
||||||
|
Class representing the ModuleServerAPI.
|
||||||
|
|
||||||
|
<!--
|
||||||
|
## Overview
|
||||||
|
Libs
|
||||||
|
* [libs](./ModuleServerAPI#libs)
|
||||||
|
|
||||||
|
Communication
|
||||||
|
* [on](./ModuleServerAPI#on)
|
||||||
|
* [broadcast](./ModuleServerAPI#broadcast)
|
||||||
|
|
||||||
|
Clients
|
||||||
|
* [getClients](./ModuleServerAPI#getclients)
|
||||||
|
* [getClient](./ModuleServerAPI#getclient)
|
||||||
|
* [hasClient](./ModuleServerAPI#hasclient)
|
||||||
|
* [onNewClient](./ModuleServerAPI#onnewclient)
|
||||||
|
|
||||||
|
Events
|
||||||
|
* [onModulePropertyUpdate](./ModuleServerAPI#onmodulepropertyupdate)
|
||||||
|
* [onReferencePropertyUpdate](./ModuleServerAPI#onreferencepropertyupdate)
|
||||||
|
* [onSceneChange](./ModuleServerAPI#onscenechange)
|
||||||
|
* [onFileUpload](./ModuleServerAPI#onfileupload)
|
||||||
|
* [onTrigger](./ModuleServerAPI#ontrigger)
|
||||||
|
* [onInit](./ModuleServerAPI#oninit-deprecated) **Deprecated**
|
||||||
|
|
||||||
|
Properties
|
||||||
|
* [getReferenceProperties](./ModuleServerAPI#getreferenceproperties)
|
||||||
|
* [getReferenceProperty](./ModuleServerAPI#getreferenceproperty)
|
||||||
|
* [hasReferenceProperty](./ModuleServerAPI#hasreferenceproperty)
|
||||||
|
* [getModuleProperties](./ModuleServerAPI#getmoduleproperties)
|
||||||
|
* [getModuleProperty](./ModuleServerAPI#getmoduleproperty)
|
||||||
|
* [hasModuleProperty](./ModuleServerAPI#hasmoduleproperty)
|
||||||
|
* [getLastState](./ModuleServerAPI#setlaststate)
|
||||||
|
* [setLastState](./ModuleServerAPI#setlaststate)
|
||||||
|
|
||||||
|
Files
|
||||||
|
* [readJSON](./ModuleServerAPI#readjson)
|
||||||
|
* [writeJSON](./ModuleServerAPI#writejson)
|
||||||
|
* [writeFile](./ModuleServerAPI#writefile)
|
||||||
|
* [fileExists](./ModuleServerAPI#fileexists)
|
||||||
|
* [addHost](./ModuleServerAPI#addhost)
|
||||||
|
* [removeHost](./ModuleServerAPI#removehost)
|
||||||
|
* [hasHost](./ModuleServerAPI#hashost)
|
||||||
|
* [hostFile](./ModuleServerAPI#hostfile-deprecated) **Deprecated**
|
||||||
|
* [removeHostFile](./ModuleServerAPI#removehostfile-deprecated) **Deprecated**
|
||||||
|
* [hasHostFile](./ModuleServerAPI#hashostfile-deprecated) **Deprecated**
|
||||||
|
|
||||||
|
Conditions
|
||||||
|
* [finishServerCondition](./ModuleServerAPI#finishservercondition)
|
||||||
|
* [forceClientCondition](./ModuleServerAPI#forceclientcondition)
|
||||||
|
|
||||||
|
|
||||||
|
Environment
|
||||||
|
* [getModuleID](./ModuleServerAPI.md#getmoduleid)
|
||||||
|
* [getScenes](./ModuleServerAPI#getscenes)
|
||||||
|
* [getResolution](./ModuleServerAPI#getresolution) **Deprecated** -->
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
### Libs
|
||||||
|
|
||||||
|
The Libs object.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.Libs;
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** [Libs](./ModuleServerAPILibs) _Libs object_
|
||||||
|
|
||||||
|
### on
|
||||||
|
|
||||||
|
Register a listener for messages from the ModuleServerAPI.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.on(header, callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ---------------------------------------------------------------- | ----------------------------------------------------------- |
|
||||||
|
| header | string | To header of the messages the listener will receive. |
|
||||||
|
| callback | ( client:[Client](./ModuleServerAPIClient), ...args:any[] ):void | Function that receives the incomming message and arguments. |
|
||||||
|
|
||||||
|
### broadcast
|
||||||
|
|
||||||
|
Broadcasts a message to all connected ModuleClientAPI's.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.broadcast(header, ...args);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | -------------------------- |
|
||||||
|
| header | string | The header of the message. |
|
||||||
|
| args | any[] | Data of any type. |
|
||||||
|
|
||||||
|
### getClients
|
||||||
|
|
||||||
|
Get all connected clients.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.getClients(displays);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ------------------- | -------- | ------------------------------------------------ |
|
||||||
|
| (Optional) displays | string[] | Array of displays to check, leave empty for all. |
|
||||||
|
|
||||||
|
**Returns** { [clientId:string]:[Client](./ModuleServerAPIClient) } _Client list_
|
||||||
|
|
||||||
|
### getClient
|
||||||
|
|
||||||
|
Get a connected client.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.getClient(clientId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | --------------------- |
|
||||||
|
| clientId | string | The id of the client. |
|
||||||
|
|
||||||
|
**Returns** [Client](./ModuleServerAPIClient) _Client object_
|
||||||
|
|
||||||
|
### hasClient
|
||||||
|
|
||||||
|
Check if client is connceted.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.hasClient(clientId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | --------------------- |
|
||||||
|
| clientId | string | The id of the client. |
|
||||||
|
|
||||||
|
**Returns** boolean _Client connected_
|
||||||
|
|
||||||
|
### onNewClient
|
||||||
|
|
||||||
|
Assigns an event to be triggered when a new ModuleClientAPI connects.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.onNewClient(callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------------------------------------------------- | ------------------------------------------------------------ |
|
||||||
|
| callback | ( client:[Client](./ModuleServerAPIClient) ):void | Function will be called when a new ModuleClientAPI connects. |
|
||||||
|
|
||||||
|
### onModulePropertyUpdate
|
||||||
|
|
||||||
|
Register a listener for when a module property updates.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.onModulePropertyUpdate(propertyId, callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ---------- | ------------------ | ----------------------------------------------- |
|
||||||
|
| propertyId | string | The property ID that the listener will receive. |
|
||||||
|
| callback | ( value:any ):void | Function that receives the new property value. |
|
||||||
|
|
||||||
|
### onReferencePropertyUpdate
|
||||||
|
|
||||||
|
Register a listener for when a reference property updates in a scene change.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.onReferencePropertyUpdate(propertyId, callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ---------- | ------------------ | ----------------------------------------------- |
|
||||||
|
| propertyId | string | The property ID that the listener will receive. |
|
||||||
|
| callback | ( value:any ):void | Function that receives the new property value. |
|
||||||
|
|
||||||
|
### onSceneChange
|
||||||
|
|
||||||
|
Register for a listener when the module is part of a scene change.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.onSceneChange(callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------------------------------------------------------------ | ---------------------------------------------------- |
|
||||||
|
| callback | ( displayId:string, origin:string, destination:string ):void | Function will be called when a scene change occures. |
|
||||||
|
|
||||||
|
### onFileUpload
|
||||||
|
|
||||||
|
Register for a listener for when a file is uploaded through the module file upload route. To use this send a HTTP post with the files in formData as the body to `http://serverIp:4080/:CHANNELNAME/upload/:MODULEID`.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.onFileUpload(callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------- |
|
||||||
|
| callback | ( files: { filename:string, originalFilename:string, byUser:string, size:number }[] ):void | Function will be called when a file upload has finished. |
|
||||||
|
|
||||||
|
### onTrigger
|
||||||
|
|
||||||
|
Register a listener for when a trigger is called from the timeline.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.onTrigger(triggerId, callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| --------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| triggerId | string | The trigger ID that the listener will receive. |
|
||||||
|
| callback | ( finish:function, status: (text:string)=>void, ...args:any[] ):void | Function will be called when the trigger is called from the timeline. The callback will receive the arguments in the same order they are defined in the [module.json](./ModuleJSON). |
|
||||||
|
|
||||||
|
### onInit **Deprecated**.
|
||||||
|
|
||||||
|
**Deprecated:** This is no longer needed, any code that needs to be run on init can be placed in the root.
|
||||||
|
|
||||||
|
Register a listener for when the module is first loaded.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.onInit(callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| --------- | -------- | -------------------------------------------------------- |
|
||||||
|
| triggerId | string | The trigger ID that the listener will receive. |
|
||||||
|
| callback | function | Function will be called when the module is first loaded. |
|
||||||
|
|
||||||
|
### getReferenceProperties
|
||||||
|
|
||||||
|
Get all properties of a module reference in a scene.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.getReferenceProperties(sceneId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | ------------------------------------------------------------ |
|
||||||
|
| sceneId | string | The id of the scene where you want to get the properties of. |
|
||||||
|
|
||||||
|
**Returns** { [ propertyId:string ]: [Property](./ModuleServerAPIProperty) } _All reference properties_
|
||||||
|
|
||||||
|
### getReferenceProperty
|
||||||
|
|
||||||
|
Get a property of a module reference in a scene.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.getReferenceProperty(sceneId, propertyId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ---------- | ------ | ------------------------------------------------------------ |
|
||||||
|
| sceneId | string | The id of the scene where you want to get the properties of. |
|
||||||
|
| propertyId | string | The id of the property you want to get. |
|
||||||
|
|
||||||
|
**Returns** [Property](./ModuleServerAPIProperty) _Reference property_
|
||||||
|
|
||||||
|
### hasReferenceProperty
|
||||||
|
|
||||||
|
Check if a module reference has a property.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.hasReferenceProperty(sceneId, propertyId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ---------- | ------ | ------------------------------------------------------------ |
|
||||||
|
| sceneId | string | The id of the scene where you want to get the properties of. |
|
||||||
|
| propertyId | string | The id of the property you want to check. |
|
||||||
|
|
||||||
|
**Returns** boolean _Has reference property_
|
||||||
|
|
||||||
|
### getModuleProperties
|
||||||
|
|
||||||
|
Get all properties of the module.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.getModuleProperties();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** { [ propertyId:string ]: [Property](./ModuleServerAPIProperty) } _All module properties_
|
||||||
|
|
||||||
|
### getModuleProperty
|
||||||
|
|
||||||
|
Get a property of the module.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.getModuleProperty(propertyId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ---------- | ------ | --------------------------------------- |
|
||||||
|
| propertyId | string | The id of the property you want to get. |
|
||||||
|
|
||||||
|
**Returns** [Property](./ModuleServerAPIProperty) _Reference property_
|
||||||
|
|
||||||
|
### hasModuleProperty
|
||||||
|
|
||||||
|
Check if the module has a property.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.hasModuleProperty(propertyId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ---------- | ------ | ----------------------------------------- |
|
||||||
|
| propertyId | string | The id of the property you want to check. |
|
||||||
|
|
||||||
|
**Returns** boolean _Has module property_
|
||||||
|
|
||||||
|
### getLastState
|
||||||
|
|
||||||
|
Get the last state of the module. This is last version that has been edited, this is used for the default data for new reference of this modules.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.getLastState();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** [ModuleData](./ModuleServerAPIData) _The last state_
|
||||||
|
|
||||||
|
### setLastState
|
||||||
|
|
||||||
|
Set the last state of the module. This is used for the default data for new reference of this modules.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.setLastState(state);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ----------------------------------- | ---------------------------- |
|
||||||
|
| state | [ModuleData](./ModuleServerAPIData) | New laststate of the module. |
|
||||||
|
|
||||||
|
### readJSON
|
||||||
|
|
||||||
|
Read a file as JSON.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.readJSON(scope, filename, callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | --------------------------------- | ------------------------------------------------------------------------ |
|
||||||
|
| scope | 'static' \| 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). |
|
||||||
|
| filename | string | The name of the file. |
|
||||||
|
| callback | ( json:any ):void | Function will be called with the JSON once it's loaded. |
|
||||||
|
|
||||||
|
### writeJSON
|
||||||
|
|
||||||
|
Write a file as JSON.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.writeJSON(scope, filename, json, callback?);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ------------------- | --------------------- | ------------------------------------------------------------------------ |
|
||||||
|
| scope | 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). |
|
||||||
|
| filename | string | The name of the file. |
|
||||||
|
| json | object | The JSON data to write. |
|
||||||
|
| (Optional) callback | function | Function will be called with the JSON was saved. |
|
||||||
|
|
||||||
|
### writeFile
|
||||||
|
|
||||||
|
Write a file.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.writeFile(scope, filename, data, options, callback?);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| scope | 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). |
|
||||||
|
| filename | string | The name of the file. |
|
||||||
|
| data | string \| Buffer \| TypedArray \| DataView \| Object | The data to write. See [fs.writeFile](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). |
|
||||||
|
| options | Object \| string | Writing options/mode to use. See [fs.writeFile](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). |
|
||||||
|
| (Optional) callback | function | Function will be called with the JSON was saved. |
|
||||||
|
|
||||||
|
### fileExists
|
||||||
|
|
||||||
|
Check if a file exists.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.fileExists(scope, filename, callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | --------------------------------- | ------------------------------------------------------------------------ |
|
||||||
|
| scope | 'static' \| 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). |
|
||||||
|
| filename | string | The name of the file. |
|
||||||
|
| callback | ( exists:boolean ):void | Function will be called when the file exists check has finished. |
|
||||||
|
|
||||||
|
### addHost
|
||||||
|
|
||||||
|
Make a file accessable through the webserver.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.addHost(scope, filename);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | --------------------- | ------------------------------------------------------------------------ |
|
||||||
|
| scope | 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). |
|
||||||
|
| filename | string | The name of the file. |
|
||||||
|
|
||||||
|
\*_Returns_ { hostID:string, relativeUrl:string, downloadUrl:string } _The data of the hosted file._
|
||||||
|
|
||||||
|
### removeHost
|
||||||
|
|
||||||
|
Remove a file that is currently hosted.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.removeHost(hostId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | -------------------------------------------------- |
|
||||||
|
| hostId | string | The host id of the hosted file you want to remove. |
|
||||||
|
|
||||||
|
### hasHost
|
||||||
|
|
||||||
|
Check if host ID is still being hosted.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.hasHost(hostId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | ------------------------------------------------- |
|
||||||
|
| hostId | string | The host id of the hosted file you want to check. |
|
||||||
|
|
||||||
|
**Returns** boolean \*Host ID is active.
|
||||||
|
|
||||||
|
### hostFile **Deprecated**
|
||||||
|
|
||||||
|
**Deprecated** Replaced by: [addHost](./ModuleServerAPI#addhost)
|
||||||
|
|
||||||
|
Make a file accessable through the webserver.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.hostFile(scope, filename);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | --------------------- | ------------------------------------------------------------------------ |
|
||||||
|
| scope | 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). |
|
||||||
|
| filename | string | The name of the file. |
|
||||||
|
|
||||||
|
\*_Returns_ { hostID:string, relativeUrl:string} _The data of the hosted file._
|
||||||
|
|
||||||
|
### removeHostFile **Deprecated**
|
||||||
|
|
||||||
|
**Deprecated** Replaced by: [addHost](./ModuleServerAPI#removehost)
|
||||||
|
|
||||||
|
Remove a file that is currently hosted.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.removeHostFile(hostId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | -------------------------------------------------- |
|
||||||
|
| hostId | string | The host id of the hosted file you want to remove. |
|
||||||
|
|
||||||
|
### hasHostFile **Deprecated**
|
||||||
|
|
||||||
|
**Deprecated** Replaced by: [addHost](./ModuleServerAPI#hashost)
|
||||||
|
|
||||||
|
Check if host ID is still being hosted.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.hasHostFile(hostId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | ------------------------------------------------- |
|
||||||
|
| hostId | string | The host id of the hosted file you want to check. |
|
||||||
|
|
||||||
|
**Returns** boolean \*Host ID is active.
|
||||||
|
|
||||||
|
### finishServerCondition
|
||||||
|
|
||||||
|
Finish a server condition.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.finishServerCondition(conditionId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ----------- | ------ | ------------------------ |
|
||||||
|
| conditionId | string | The id of the condition. |
|
||||||
|
|
||||||
|
### forceClientCondition
|
||||||
|
|
||||||
|
Force a client condition.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.forceClientCondition(conditionId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ----------- | ------ | ------------------------ |
|
||||||
|
| conditionId | string | The id of the condition. |
|
||||||
|
|
||||||
|
### getModuleID
|
||||||
|
|
||||||
|
Get the current module id.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.getModuleID();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** string _Module ID_
|
||||||
|
|
||||||
|
### getScenes
|
||||||
|
|
||||||
|
Get a list of all scenes this module is a part of.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.getModuleID();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** string[] _List of scene IDs_
|
||||||
|
|
||||||
|
### getResolution **Deprecated**
|
||||||
|
|
||||||
|
**Deprecated** This will currently return the default channel resolution. This needs to be replaced by a function that can get a scene or display resolution
|
||||||
|
|
||||||
|
Get the default channel resolution.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.getResolution();
|
||||||
|
```
|
||||||
|
|
||||||
|
## Information
|
||||||
|
|
||||||
|
### File Scopes
|
||||||
|
|
||||||
|
For every API call you make that uses the filesystem you have to specify a scope and a filename. The scope is used to differentiate between different locations the file can be in. Below is table with the scope's, their description and in which API calls they can be used.
|
||||||
|
|Scope|Description|[readJSON](./ModuleServerAPI#readjson)|[writeJSON](./ModuleServerAPI#writejson)|[writeFile](./ModuleServerAPI#writefile)|[fileExists](./ModuleServerAPI#fileexists)|[addHost](./ModuleServerAPI#addhost)
|
||||||
|
|-|-|-|-|-|-|-|
|
||||||
|
static|Target static files inside the build. See [static files](./ModuleStructure#static-files). |x|||x|x
|
||||||
|
module|Target files that can only be accessed by a specific instance of this module.|x|x|x|x|x
|
||||||
|
channel|Target files that can accessed by all module of this type in the channel.|x|x|x|x|x
|
||||||
68
ModuleServerAPIClient.md
Normal file
68
ModuleServerAPIClient.md
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
# ModuleServerApi - Client
|
||||||
|
|
||||||
|
Class representing the ModuleServerApi Client.
|
||||||
|
|
||||||
|
<!-- ## Overview
|
||||||
|
Communication
|
||||||
|
* [send](./ModuleServerAPIClient#send)
|
||||||
|
|
||||||
|
Information
|
||||||
|
* [isAuthorized](./ModuleServerAPIClient#isauthorized)
|
||||||
|
* [getSceneID](./ModuleServerAPIClient#getsceneid)
|
||||||
|
* [getDisplayID](./ModuleServerAPIClient#getdisplayid)
|
||||||
|
* [getUserID](./ModuleServerAPIClient#getuserid) -->
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
### send
|
||||||
|
|
||||||
|
Send a message to the client.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
client.send(header, ...args);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | -------------------------- |
|
||||||
|
| header | string | The header of the message. |
|
||||||
|
| args | any[] | Data of any type |
|
||||||
|
|
||||||
|
### isAuthorized
|
||||||
|
|
||||||
|
Check if the client is authorized, meaning they are logged in and have access to the channel.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
client.isAuthorized();
|
||||||
|
```
|
||||||
|
|
||||||
|
\*_Returns_ boolean _Client is authorized_
|
||||||
|
|
||||||
|
### getSceneID
|
||||||
|
|
||||||
|
Get the scene id the client is in.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
client.getSceneID();
|
||||||
|
```
|
||||||
|
|
||||||
|
\*_Returns_ string _Scene ID_
|
||||||
|
|
||||||
|
### getDisplayID
|
||||||
|
|
||||||
|
Get the display id the client is in.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
client.getDisplayID();
|
||||||
|
```
|
||||||
|
|
||||||
|
\*_Returns_ string _Display ID_
|
||||||
|
|
||||||
|
### getUserID
|
||||||
|
|
||||||
|
Get the user id.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
client.getUserID();
|
||||||
|
```
|
||||||
|
|
||||||
|
\*_Returns_ string _User ID_
|
||||||
29
ModuleServerAPIData.md
Normal file
29
ModuleServerAPIData.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# ModuleData
|
||||||
|
Structure of the module data. You can find the property documentation [here](./module).
|
||||||
|
|
||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"size": {
|
||||||
|
"width": { property },
|
||||||
|
"height": { property }
|
||||||
|
},
|
||||||
|
"location": {
|
||||||
|
"x" { property },
|
||||||
|
"y": { property }
|
||||||
|
},
|
||||||
|
"appearance": {
|
||||||
|
"rotation": { property },
|
||||||
|
"warp": { property },
|
||||||
|
"transparency": { property },
|
||||||
|
"transition": { property },
|
||||||
|
"transitionDuration": { property },
|
||||||
|
"animation": { property },
|
||||||
|
"animationSpeed": { property },
|
||||||
|
"animationIntensity": { property },
|
||||||
|
"animationSmooth": { property }
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
[propertyId:string]: Property
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
51
ModuleServerAPILibs.md
Normal file
51
ModuleServerAPILibs.md
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# ModuleServerAPI Libs
|
||||||
|
|
||||||
|
Class representing the ModuleServerAPI Libs.
|
||||||
|
|
||||||
|
<!-- ## Overview
|
||||||
|
* [getWebSocket](./ModuleServerAPILibs#getwebsocket)
|
||||||
|
* [getAxios](./ModuleServerAPILibs#getaxios)
|
||||||
|
* [getRedis](./ModuleServerAPILibs#getredis)
|
||||||
|
* [getUuid](./ModuleServerAPILibs#getuuid) -->
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
### getWebSocket
|
||||||
|
|
||||||
|
Get the WebSocket lib.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.Libs.getWebSocket();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** [LibWebSocket](./ModuleServerAPILibsWebSocketLib) _LibWebSocket object_
|
||||||
|
|
||||||
|
### getAxios
|
||||||
|
|
||||||
|
Get the Axios lib.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.Libs.getAxios();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** [Axios](https://axios-http.com/docs/instance) _Axios object_
|
||||||
|
|
||||||
|
### getRedis
|
||||||
|
|
||||||
|
Get the Redis lib.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.Libs.getRedis();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** [Redis](https://github.com/redis/node-redis) _Redis object_
|
||||||
|
|
||||||
|
### getUuid
|
||||||
|
|
||||||
|
Get the UUID lib.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.Libs.getUuid();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** [Redis](https://www.npmjs.com/package/uuid) _UUID object_
|
||||||
109
ModuleServerAPILibsWebSocketLib.md
Normal file
109
ModuleServerAPILibsWebSocketLib.md
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
# ModuleServerAPI LibWebSocket
|
||||||
|
|
||||||
|
Class representing the ModuleServerAPI LibWebSocket.
|
||||||
|
|
||||||
|
<!-- ## Overview
|
||||||
|
|
||||||
|
Communication
|
||||||
|
* [on](./ModuleServerAPILibsWebSocketLib#on)
|
||||||
|
* [broadcast](./ModuleServerAPILibsWebSocketLib#broadcast)
|
||||||
|
|
||||||
|
Clients
|
||||||
|
* [onClientConnect](./ModuleServerAPILibsWebSocketLib#onclientconnect)
|
||||||
|
* [onClientDisconnect](./ModuleServerAPILibsWebSocketLib#onclientdisconnect)
|
||||||
|
* [getClients](./ModuleServerAPILibsWebSocketLib#getclients)
|
||||||
|
* [getClient](./ModuleServerAPILibsWebSocketLib#getclient)
|
||||||
|
* [broadcast](./ModuleServerAPILibsWebSocketLib#broadcast)
|
||||||
|
* [rawBroadcast](./ModuleServerAPILibsWebSocketLib#rawbroadcast) -->
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
### on
|
||||||
|
|
||||||
|
Register a listener for messages from a LibWebSocketClient.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.Libs.getWebSocket().on(header, callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | -------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
|
||||||
|
| header | string | To header of the messages the listener will receive. |
|
||||||
|
| callback | ( client:[LibWebSocketClient](./ModuleServerAPILibsWebSocketLibClient), ...args:any[] ):void | Function that receives the incomming message and arguments. |
|
||||||
|
|
||||||
|
### onClientConnect
|
||||||
|
|
||||||
|
Assigns an event to be triggered when a new LibWebSocketClient connects.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.Libs.getWebSocket().onClientConnect(callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------- |
|
||||||
|
| callback | ( client:[LibWebSocketClient](./ModuleServerAPILibsWebSocketLibClient) ):void | Function will be called when a new LibWebSocketClient connects. |
|
||||||
|
|
||||||
|
### onClientDisconnect
|
||||||
|
|
||||||
|
Assigns an event to be triggered when a LibWebSocketClient disconnects.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.Libs.getWebSocket().onClientDisconnect(callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------------------------ | -------------------------------------------------------------- |
|
||||||
|
| callback | ( socketId:string ):void | Function will be called when a LibWebSocketClient disconnects. |
|
||||||
|
|
||||||
|
### getClients
|
||||||
|
|
||||||
|
Get the connected LibWebSocketClients.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.Libs.getWebSocket().getClient(socketId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | ---------------------------- |
|
||||||
|
| socketId | string | The id of the socket client. |
|
||||||
|
|
||||||
|
**Return** [LibWebSocketClient](./ModuleServerAPILibsWebSocketLibClient) _Socket client_
|
||||||
|
|
||||||
|
### getClient
|
||||||
|
|
||||||
|
Get a specific LibWebSocketClient.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.Libs.getWebSocket().getClient(socketId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | ---------------------------- |
|
||||||
|
| socketId | string | The id of the socket client. |
|
||||||
|
|
||||||
|
**Return** [LibWebSocketClient](./ModuleServerAPILibsWebSocketLibClient) _Socket client_
|
||||||
|
|
||||||
|
### broadcast
|
||||||
|
|
||||||
|
Broadcasts a message to all connected LibWebSocketClients.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.Libs.getWebSocket().broadcast(header, ...args);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | -------------------------- |
|
||||||
|
| header | string | The header of the message. |
|
||||||
|
| args | any[] | Data of any type. |
|
||||||
|
|
||||||
|
### rawBroadcast
|
||||||
|
|
||||||
|
Broadcasts a raw message to all connected LibWebSocketClients.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
api.Libs.getWebSocket().rawBroadcast(data);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | ----------- | -------- | ------ | --------------- | ---------- | ----------- | ----------------- | ------------------ | --------------------- | -------------------------- | -------------------------------- | ------------------------- | ------------------------------------ | --------------------- | ----------------------------------------------- | ------------------------ |
|
||||||
|
| data | string | Buffer | DataView | number | ArrayBufferView | Uint8Array | ArrayBuffer | SharedArrayBuffer | ReadonlyArray<any> | ReadonlyArray<number> | { valueOf(): ArrayBuffer } | { valueOf(): SharedArrayBuffer } | { valueOf(): Uint8Array } | { valueOf(): ReadonlyArray<number> } | { valueOf(): string } | { [Symbol.toPrimitive](hint: string): string }; | The data of the message. |
|
||||||
36
ModuleServerAPILibsWebSocketLibClient.md
Normal file
36
ModuleServerAPILibsWebSocketLibClient.md
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# ModuleServerAPI LibWebSocketClient
|
||||||
|
|
||||||
|
Class representing the ModuleServerAPI LibWebSocketClient.
|
||||||
|
|
||||||
|
<!-- ## Overview
|
||||||
|
|
||||||
|
Communication
|
||||||
|
* [send](./ModuleServerAPILibsWebSocketLibClient#send)
|
||||||
|
* [rawSend](./ModuleServerAPILibsWebSocketLibClient#rawSend) -->
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
### send
|
||||||
|
|
||||||
|
Broadcasts a message to the LibWebSocketClients.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
client.send(header, ...args);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | -------------------------- |
|
||||||
|
| header | string | The header of the message. |
|
||||||
|
| args | any[] | Data of any type. |
|
||||||
|
|
||||||
|
### rawSend
|
||||||
|
|
||||||
|
Broadcasts a raw message to the LibWebSocketClients.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
client.rawBroadcast(data);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | ----------- | -------- | ------ | --------------- | ---------- | ----------- | ----------------- | ------------------ | --------------------- | -------------------------- | -------------------------------- | ------------------------- | ------------------------------------ | --------------------- | ----------------------------------------------- | ------------------------ |
|
||||||
|
| data | string | Buffer | DataView | number | ArrayBufferView | Uint8Array | ArrayBuffer | SharedArrayBuffer | ReadonlyArray<any> | ReadonlyArray<number> | { valueOf(): ArrayBuffer } | { valueOf(): SharedArrayBuffer } | { valueOf(): Uint8Array } | { valueOf(): ReadonlyArray<number> } | { valueOf(): string } | { [Symbol.toPrimitive](hint: string): string }; | The data of the message. |
|
||||||
171
ModuleServerAPIProperty.md
Normal file
171
ModuleServerAPIProperty.md
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
# ModuleServerApi - Property
|
||||||
|
|
||||||
|
Class representing the ModuleServerApi Property.
|
||||||
|
|
||||||
|
<!-- ## Overview
|
||||||
|
Value
|
||||||
|
* [setValue](./ModuleServerAPIProperty#setvalue)
|
||||||
|
* [getValue](./ModuleServerAPIProperty#getvalue)
|
||||||
|
* [asString](./ModuleServerAPIProperty#asstring)
|
||||||
|
* [asNumber](./ModuleServerAPIProperty#asnumber)
|
||||||
|
* [asBoolean](./ModuleServerAPIProperty#asboolean)
|
||||||
|
* [asFile](./ModuleServerAPIProperty#asfile)
|
||||||
|
* [asGiphy](./ModuleServerAPIProperty#asgiphy)
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
* [*title*](./ModuleServerAPIProperty#title)
|
||||||
|
* [*value*](./ModuleServerAPIProperty#value)
|
||||||
|
* [*description*](./ModuleServerAPIProperty#description)
|
||||||
|
* [*min*](./ModuleServerAPIProperty#min)
|
||||||
|
* [*max*](./ModuleServerAPIProperty#max)
|
||||||
|
* [*step*](./ModuleServerAPIProperty#step)
|
||||||
|
* [*allowedValues*](./ModuleServerAPIProperty#allowedvalues)
|
||||||
|
* [*allowedTypes*](./ModuleServerAPIProperty#allowedtypes) -->
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
### setValue
|
||||||
|
|
||||||
|
Set the value of the property.
|
||||||
|
|
||||||
|
```
|
||||||
|
property.setValue(value);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ---- | --------------------------- |
|
||||||
|
| value | any | New value for the property. |
|
||||||
|
|
||||||
|
### getValue
|
||||||
|
|
||||||
|
Get the value of the property.
|
||||||
|
|
||||||
|
```
|
||||||
|
property.getValue();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** any _Value of the property_
|
||||||
|
|
||||||
|
## asString
|
||||||
|
|
||||||
|
Get the value of the property as a string.
|
||||||
|
|
||||||
|
```
|
||||||
|
property.asString();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** string _Value of the property_
|
||||||
|
|
||||||
|
## asNumber
|
||||||
|
|
||||||
|
Get the value of the property as a number.
|
||||||
|
|
||||||
|
```
|
||||||
|
property.asNumber();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** number _Value of the property_
|
||||||
|
|
||||||
|
## asBoolean
|
||||||
|
|
||||||
|
Get the value of the property as a boolean.
|
||||||
|
|
||||||
|
```
|
||||||
|
property.asBoolean();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** boolean _Value of the property_
|
||||||
|
|
||||||
|
## asFile
|
||||||
|
|
||||||
|
Get the value of the property as a file.
|
||||||
|
|
||||||
|
```
|
||||||
|
property.asFile();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** { name:string, address:string } _Value of the property_
|
||||||
|
|
||||||
|
## asGiphy
|
||||||
|
|
||||||
|
Get the value of the property as a giphy.
|
||||||
|
|
||||||
|
```
|
||||||
|
property.asGiphy();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Returns** { name:string, address:string } _Value of the property_
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
### _title_
|
||||||
|
|
||||||
|
Title of the property
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
property.title as string;
|
||||||
|
```
|
||||||
|
|
||||||
|
### _value_
|
||||||
|
|
||||||
|
Raw value of the property
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
property.value as any;
|
||||||
|
```
|
||||||
|
|
||||||
|
### _description_
|
||||||
|
|
||||||
|
Description of the property
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
property.description as string;
|
||||||
|
```
|
||||||
|
|
||||||
|
### _min_
|
||||||
|
|
||||||
|
The minimal value of the property
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
property.min as number;
|
||||||
|
```
|
||||||
|
|
||||||
|
### _max_
|
||||||
|
|
||||||
|
The maximal value of the property
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
property.max as number;
|
||||||
|
```
|
||||||
|
|
||||||
|
### _title_
|
||||||
|
|
||||||
|
Title of the property
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
property.title as string;
|
||||||
|
```
|
||||||
|
|
||||||
|
### _step_
|
||||||
|
|
||||||
|
Step size of the property
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
property.step as number;
|
||||||
|
```
|
||||||
|
|
||||||
|
### _allowedValues_
|
||||||
|
|
||||||
|
Title of the property
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
property.allowedValues as { id: string; name: string };
|
||||||
|
```
|
||||||
|
|
||||||
|
### _allowedTypes_
|
||||||
|
|
||||||
|
Title of the property
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
property.allowedTypes as string[];
|
||||||
|
```
|
||||||
26
ModuleStore.md
Normal file
26
ModuleStore.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# Module Store
|
||||||
|
The module store is a system that is used to distribute modules between different Getiyo instances. Although it has *Store* in the name it has no monetization system and is just used for distribution and version management. You can publish a module to the ModuleStore via the [GetiyoModuleTool](./GetiyoModuleTool) and install modules to your Getiyo server in the admin dashboard. For both publishing & browsing, you'll need to request an access key.
|
||||||
|
|
||||||
|
## Keys
|
||||||
|
If you want to publish or browse the ModuleStore you'll need a publish or browser key. These keys allow you to make contact with the ModuleStore safely. To request a key please contact the ModuleStore admin at:
|
||||||
|
> modulestore@morphix.productions <br>
|
||||||
|
> or call to +31613392837
|
||||||
|
|
||||||
|
### Set up browser key
|
||||||
|
1) Navigate admin modules page at `http://serverIp:4080/admin/modules`.
|
||||||
|
2) Right click the `Activate store` button in the top right corner.
|
||||||
|
3) Enter the browserkey and click `Ok`.
|
||||||
|
4) Server will validate the key, if key is valid page will reload.
|
||||||
|
5) You can now browse the store with the `Browse Store` button in the top right corner.
|
||||||
|
|
||||||
|
### Set up publish key
|
||||||
|
1) Open a terminal on the machine you want to publish from.
|
||||||
|
2) Run `gmt set publishkey <publishKey`
|
||||||
|
3) GMT will verify if the publish key is valid.
|
||||||
|
4) You can now publish modules.
|
||||||
|
|
||||||
|
## Publish a module
|
||||||
|
1) Open a terminal in the root of the module environment.
|
||||||
|
2) Run `gmt publish`
|
||||||
|
3) If there's no `changed.md` file found, GMT will ask if you'd like to create one.
|
||||||
|
4) Follow the steps and the module is published!
|
||||||
113
ModuleStructure.md
Normal file
113
ModuleStructure.md
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
# Module Structure
|
||||||
|
Each module in Getiyo comprises four key components: module.json, a server-side script, a user page, and optionally a control/external page. The detailed structure of each component is outlined below. You can automatically set up this file structure by using the [GetiyoModuleTool](./GetiyoModuleTool), as described in the ["Setting up a development environment]"(./ModuleEnvironment) section of the documentation.
|
||||||
|
|
||||||
|
|
||||||
|
## Module.json
|
||||||
|
The module.json file serves as the central configuration file for each module in Getiyo. It contains essential metadata that informs Getiyo about the module's identity, as well as the module's properties, triggers, and conditions. The [GetiyoModuleTool](./GetiyoModuleTool) can automatically generate this file for you, streamlining the setup process. However, if you want to modify or add properties, triggers, or conditions, you can refer to the module.json section in the documentation. To learn more about configuring the [module.json](./ModuleJSON) file and its various elements, consult the Module JSON section in the documentation.
|
||||||
|
|
||||||
|
## Server-Side
|
||||||
|
The server-side component of a Getiyo module is comprised of one or more TypeScript or JavaScript files, organized according to the structure outlined below. The server-side code utilizes the [ModuleServerAPI](./ModuleServerAPI), which facilitates communication with the ModuleClientAPI, file management, show control, and more. For a comprehensive overview of the ModuleServerAPI's features and capabilities, visit the [ModuleServerAPI](./ModuleServerAPI) section in the documentation. By familiarizing yourself with the API, you can better leverage its functionality to create powerful and versatile Getiyo modules.
|
||||||
|
|
||||||
|
```
|
||||||
|
Module Root
|
||||||
|
├── server
|
||||||
|
│ ├── **/*.ts
|
||||||
|
│ └── **/*.js
|
||||||
|
```
|
||||||
|
*See bottom of the page for a complete directory structure*
|
||||||
|
|
||||||
|
## Page
|
||||||
|
A page of a module consists of an HTML file, TypeScript (or JavaScript), and Sass (or CSS). The user page is required because it is shown as the module to a user. The following representation illustrates the typical file structure for a module page:
|
||||||
|
```
|
||||||
|
Module Root
|
||||||
|
├── user
|
||||||
|
│ ├── ts (Required)
|
||||||
|
│ │ ├── ModuleClientAPI.d.ts
|
||||||
|
│ │ └── **/*.ts
|
||||||
|
│ ├── js (Optional)
|
||||||
|
│ │ └── **/*.js
|
||||||
|
│ ├── scss (Optional)
|
||||||
|
│ │ └── **/*.scss
|
||||||
|
│ ├── css (Optional)
|
||||||
|
│ │ └── **/*.css
|
||||||
|
│ ├── lib (Optional)
|
||||||
|
│ │ ├── **/*.ts
|
||||||
|
│ │ ├── **/*.js
|
||||||
|
│ │ ├── **/*.scss
|
||||||
|
│ │ └── **/*.css
|
||||||
|
│ └── index.html
|
||||||
|
```
|
||||||
|
*See bottom of the page for a complete directory structure*
|
||||||
|
The only required directory is ts, as it contains the type definitions for the API in ModuleClientAPI.d.ts. If you prefer using plain JavaScript, create a js folder, but do not remove the ts directory. Each page has access to the ModuleClientAPI which will automatically be connected to its server-side ModuleServerAPI. For a comprehensive overview of the ModuleClientAPI's features and capabilities, visit the [ModuleClientAPI](./ModuleClientAPI). section in the documentation.
|
||||||
|
|
||||||
|
### Control Page
|
||||||
|
A control page is a specialized module page accessible only to moderators or admins of a Getiyo channel. This can be used to create a live control panel for your module. It can be opened directly or loaded into the broadcast view—a page where moderators or broadcasters can arrange a controller layout with control pages from different modules. The file structure for a control page is the same as that of a user page.
|
||||||
|
|
||||||
|
### External Page
|
||||||
|
An external page is a unique module page without Getiyo UI elements that can be accessed by anyone with the URL. Unlike user and control pages, external pages are not scaled or queued. The file structure for an external page is the same as that of a user page.
|
||||||
|
|
||||||
|
## Static Files
|
||||||
|
It is possible to add static files to a module build that can be used by the [ModuleServerAPI](./ModuleServerAPI) later. Simple create a `Static` directory in the root of the module environment and place files inside it to add them to the build.
|
||||||
|
|
||||||
|
You can include static files in a module build for later use with the [ModuleServerAPI](./ModuleServerAPI). To do so, create a `static` directory at the root of the module environment and place the files inside. This will ensure that they are added to the build. By following this approach, you can easily store and manage static assets, such as images, fonts, or other files, that your module may need for its functionality.
|
||||||
|
|
||||||
|
## Example complete file structure
|
||||||
|
|
||||||
|
```
|
||||||
|
Module Root
|
||||||
|
├── user
|
||||||
|
│ ├── ts (Required)
|
||||||
|
│ │ ├── ModuleClientAPI.d.ts
|
||||||
|
│ │ └── **/*.ts
|
||||||
|
│ ├── js (Optional)
|
||||||
|
│ │ └── **/*.js
|
||||||
|
│ ├── scss (Optional)
|
||||||
|
│ │ └── **/*.scss
|
||||||
|
│ ├── css (Optional)
|
||||||
|
│ │ └── **/*.css
|
||||||
|
│ ├── lib (Optional)
|
||||||
|
│ │ ├── **/*.ts
|
||||||
|
│ │ ├── **/*.js
|
||||||
|
│ │ ├── **/*.scss
|
||||||
|
│ │ └── **/*.css
|
||||||
|
│ └── index.html
|
||||||
|
├── control
|
||||||
|
│ ├── ts (Required)
|
||||||
|
│ │ ├── ModuleClientAPI.d.ts
|
||||||
|
│ │ └── **/*.ts
|
||||||
|
│ ├── js (Optional)
|
||||||
|
│ │ └── **/*.js
|
||||||
|
│ ├── scss (Optional)
|
||||||
|
│ │ └── **/*.scss
|
||||||
|
│ ├── css (Optional)
|
||||||
|
│ │ └── **/*.css
|
||||||
|
│ ├── lib (Optional)
|
||||||
|
│ │ ├── **/*.ts
|
||||||
|
│ │ ├── **/*.js
|
||||||
|
│ │ ├── **/*.scss
|
||||||
|
│ │ └── **/*.css
|
||||||
|
│ └── index.html
|
||||||
|
├── external
|
||||||
|
│ ├── ts (Required)
|
||||||
|
│ │ ├── ModuleClientAPI.d.ts
|
||||||
|
│ │ └── **/*.ts
|
||||||
|
│ ├── js (Optional)
|
||||||
|
│ │ └── **/*.js
|
||||||
|
│ ├── scss (Optional)
|
||||||
|
│ │ └── **/*.scss
|
||||||
|
│ ├── css (Optional)
|
||||||
|
│ │ └── **/*.css
|
||||||
|
│ ├── lib (Optional)
|
||||||
|
│ │ ├── **/*.ts
|
||||||
|
│ │ ├── **/*.js
|
||||||
|
│ │ ├── **/*.scss
|
||||||
|
│ │ └── **/*.css
|
||||||
|
│ └── index.html
|
||||||
|
├── server
|
||||||
|
│ ├── **/*.ts
|
||||||
|
│ └── **/*.js
|
||||||
|
├── static
|
||||||
|
│ └── **/*.*
|
||||||
|
├── .dist
|
||||||
|
└── module.json
|
||||||
|
```
|
||||||
53
ModuleTrigger.md
Normal file
53
ModuleTrigger.md
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# Module.json Trigger
|
||||||
|
A trigger is a way for the timeline to call the server side of a module. This way you can control the module behavior automatically. You can also specify parameters to input values. A basic trigger with no parameters will look like this:
|
||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"title":"Update Something",
|
||||||
|
"description": "This does something in the module.",
|
||||||
|
"arguments:" []
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|Property|Description|
|
||||||
|
|-|-|
|
||||||
|
title|The title of the trigger, this is visible in the timeline.
|
||||||
|
description|Description that explains what the trigger does.
|
||||||
|
arguments|An array of arguments, see below.
|
||||||
|
|
||||||
|
## Arguments
|
||||||
|
Arguments can be used to let a timeline creator input variable values. This can be used to control a module through the timeline. Every argument needs to have a type and some argument types have additional parameters. Below you can find the argument types and their parameters.
|
||||||
|
|
||||||
|
### text
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
title|string|Visual name of the argument.
|
||||||
|
|
||||||
|
### number
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
title|string|Visual name of the argument.
|
||||||
|
|
||||||
|
### scenes
|
||||||
|
|Parameter|Type|Description|
|
||||||
|
|-|-|-|
|
||||||
|
title|string|Visual name of the argument.
|
||||||
|
onlyContainingModule|boolean|Can only select scenes this module is a part of.
|
||||||
|
|
||||||
|
|
||||||
|
## Example Argument
|
||||||
|
Number argument
|
||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"type": "number",
|
||||||
|
"title": "Hours from now"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Scene select argument
|
||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"type": "scenes",
|
||||||
|
"title": "In scenes",
|
||||||
|
"onlyContainingModule": true
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
View this in a [complete module.json example](./module.json).
|
||||||
12
Prerequisites.md
Normal file
12
Prerequisites.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Prerequisites
|
||||||
|
Getiyo is a streamlined, efficient system designed to operate with minimal dependencies, as most requirements are already embedded within the executable itself. However, to unlock the complete range of Getiyo's features, some external software installations may be necessary on your computer or server. Below, you'll find a curated list of the software that may be required by certain features, accompanied by a clear and concise table outlining which features correspond to specific software.
|
||||||
|
|
||||||
|
* [ImageMagick](https://imagemagick.org/)
|
||||||
|
* [GraphicsMagick](http://www.graphicsmagick.org/)
|
||||||
|
* [FFmpeg](https://ffmpeg.org/)
|
||||||
|
|
||||||
|
| Feature | Required software |
|
||||||
|
|-|-|
|
||||||
|
Change channel logo | ImageMagick, GraphicsMagick
|
||||||
|
FileBrowser upload (Animation, Image, VectorImage) | ImageMagick, GraphicsMagick
|
||||||
|
FileBrowser upload (Video) | ImageMagick, GraphicsMagick, FFmpeg
|
||||||
6
Reporting.md
Normal file
6
Reporting.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Bug/Feature Reporting
|
||||||
|
**For privacy or security bugs contact us directly at [security@morphix.productions](mailto:security@morphix.productions).**
|
||||||
|
|
||||||
|
If you stumble upon some bugs or have some feature that you'd like to see implemented, there is an easy way to report and them to our [issue tracker](https://git.mooren.tv/Getiyo/Getiyo-Wiki/issues).
|
||||||
|
|
||||||
|
Getiyo has a built-in reporting tool that can be opened on any page by using the shortcut `Ctrl + Shift + B`. From there you enter a title, description, category, and optionally your email.
|
||||||
26
ServerSetup.md
Normal file
26
ServerSetup.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# Setting up server
|
||||||
|
|
||||||
|
Effortlessly set up your Getiyo server by simply running the provided executable. Watch as the server initializes, storing all data in a designated folder located at `%userhome%/MorphixProductions/Getiyo`.
|
||||||
|
|
||||||
|
## Initial setup
|
||||||
|
Upon launching Getiyo for the first time, the system will generate the required directory structure within the data folder. By default, the server operates on port 4080, but this can be easily customized in the [config](./Config). A temporary admin user will also be created, which remains active until another admin user is established. Follow these steps to create an account with your own credentials as the server admin:
|
||||||
|
|
||||||
|
1) Create a new user on `http://serverip:4080/login`, when finished you'll be logged into the account.
|
||||||
|
2) Log out and log in again to the temporary admin account with the following credentials:
|
||||||
|
> **Email** admin@getiyo.com <br>
|
||||||
|
> **Password** Getiyo12345!
|
||||||
|
3) Head over to the user management page at `http://serverip:4080/admin/users` and find your newly created account in the list.
|
||||||
|
4) Enable the admin toggle on your account. You'll be immediately logged out and the temporary admin account will be disabled.
|
||||||
|
5) Now your account is an admin and can make other users admin.
|
||||||
|
|
||||||
|
### Forgot all admin passwords?
|
||||||
|
1) Navigate to `%userhome%/MorphixProductions/Getiyo/users`
|
||||||
|
2) Remove all admin user files from the directory
|
||||||
|
3) Restart the server and repeat the steps above
|
||||||
|
|
||||||
|
## Installing modules from store
|
||||||
|
To supercharge your testing and development experience, easily access and install additional modules for crafting dynamic scenes. First, ensure you've configured the [ModuleStore browser key](./ModuleStore#set-up-browser-key). Then, follow these simple steps:
|
||||||
|
|
||||||
|
1) Visit the admin modules page at http://serverIp:4080/admin/modules.
|
||||||
|
2) Click the 'Browse Store' button in the top right corner.
|
||||||
|
3) Open a module you'd like to install and click 'Install'
|
||||||
1
_Footer.md
Normal file
1
_Footer.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
© Vix Entertainment 2023 - © Mooren Productief 2023 - All rights reserved
|
||||||
4
_Home.md
Normal file
4
_Home.md
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|

|
||||||
|
|
||||||
|
# Introduction
|
||||||
|
Introducing Getiyo - your cutting-edge, virtual convergence hub for dynamic, interactive content delivery. Unleash the power of live streams, immersive gatherings, precision narrowcasting, seamless automations, displays, theatrical experiences and next-level show control. Effortlessly craft scenes with modules in our sleek, intuitive editor and publish them to multiple display endpoints with lightning-fast synchronization. Sit back as Getiyo orchestrates fluid transitions and generates visually-striking animations between scene metamorphoses. Embrace the future of digital interactivity with Getiyo!
|
||||||
26
_Sidebar.md
Normal file
26
_Sidebar.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
* [Introduction](./Home)
|
||||||
|
* [Prerequisites](./Prerequisites)
|
||||||
|
* [Setting up server](./ServerSetup)
|
||||||
|
* [Config](./Config)
|
||||||
|
* Module Development
|
||||||
|
* [Module Structure](./ModuleStructure)
|
||||||
|
* [Module.json](./ModuleJSON)
|
||||||
|
* [Property](./ModuleJSONProperty)
|
||||||
|
* [Trigger](./ModuleTrigger)
|
||||||
|
* [Condition](./ModuleCondition)
|
||||||
|
* [Complete Example](./module.json)
|
||||||
|
* [Development environment/Building](./ModuleEnvironment)
|
||||||
|
* [GetiyoModuleTool](./GetiyoModuleTool)
|
||||||
|
* [ModuleClientAPI](./ModuleClientAPI)
|
||||||
|
* [User](./ModuleClientAPIUser)
|
||||||
|
* [ModuleServerAPI](./ModuleServerAPI)
|
||||||
|
* [Client](./ModuleServerAPIClient)
|
||||||
|
* [Property](./ModuleServerAPIProperty)
|
||||||
|
* [ModuleData](./ModuleServerAPIModuleData)
|
||||||
|
* [Libs](./ModuleServerAPILibs)
|
||||||
|
* [LibWebSocket](./ModuleServerAPILibsWebSocketLib)
|
||||||
|
* [Axios](https://axios-http.com/docs/instance)
|
||||||
|
* [Module Debugging](./ModuleDebugging)
|
||||||
|
* [ModuleStore](./ModuleStore)
|
||||||
|
* [Bug/Feature Reporting](./Reporting)
|
||||||
|
* [Contact Details](./ContactDetails)
|
||||||
85
module.json.md
Normal file
85
module.json.md
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"name": "DemoModule",
|
||||||
|
|
||||||
|
"author": "Mees van der Wijk",
|
||||||
|
"category": "Widget",
|
||||||
|
"description": "Showcase the module!",
|
||||||
|
|
||||||
|
"default_reference_properties": {
|
||||||
|
"text": {
|
||||||
|
"type": "text",
|
||||||
|
"title": "Text",
|
||||||
|
"description": "The text for the demo!",
|
||||||
|
"value": "Hello world!"
|
||||||
|
},
|
||||||
|
"color": {
|
||||||
|
"type": "color",
|
||||||
|
"title": "Color",
|
||||||
|
"description": "The color of the demo.",
|
||||||
|
"value": "#f44336"
|
||||||
|
},
|
||||||
|
"style": {
|
||||||
|
"type": "select",
|
||||||
|
"title": "Style",
|
||||||
|
"description": "The style of the demo",
|
||||||
|
"value": "cool",
|
||||||
|
"allowedValues": [
|
||||||
|
{
|
||||||
|
"id": "cool",
|
||||||
|
"text": "Cool Demo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fast",
|
||||||
|
"text": "Fast Demo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "slow",
|
||||||
|
"text": "Slow Demo"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"default_module_properties": {},
|
||||||
|
|
||||||
|
"triggers": {
|
||||||
|
"setText": {
|
||||||
|
"title": "Set text",
|
||||||
|
"description": "Set the text of the demo.",
|
||||||
|
"arguments": [
|
||||||
|
{
|
||||||
|
"type": "scenes",
|
||||||
|
"title": "In scenes",
|
||||||
|
"onlyContainingModule": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"title": "New text"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"conditions": {
|
||||||
|
"server": {
|
||||||
|
"textStop": {
|
||||||
|
"title": "Text Stop",
|
||||||
|
"description": "Will be met when the text stops."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"default_size": {
|
||||||
|
"width": 300,
|
||||||
|
"height": 300
|
||||||
|
},
|
||||||
|
|
||||||
|
"default_location": {
|
||||||
|
"x": 100,
|
||||||
|
"y": 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user