adaptorex
Version:
Connect all your live interactive storytelling devices and software
312 lines (311 loc) • 10.7 kB
JSON
{
"settings": {
"type": "object",
"title": "Data",
"description": "allows you to store and use variables and more.",
"additionalProperties": false,
"readonly": true
},
"definitions": {
"files": {
"anyOf": [
{
"type": "string",
"title": "Drop File",
"adaptorReplaceOnDrop": true,
"isAdaptorContent": true
},
{
"type": "string",
"title": "Select File",
"enum": [],
"adaptorReplaceOnDrop": true,
"isAdaptorContent": true
}
]
},
"collection": {
"type": "string",
"title": "Collection",
"isAdaptorContent": false,
"description": "Select a data, plugin or game collection",
"enum": ["levels", "sessions"],
"options": {
"enum_titles": ["levels", "sessions"]
}
},
"data_collection": {
"type": "string",
"title": "Collection",
"isAdaptorContent": false,
"enum": []
},
"multiple": {
"type": "boolean",
"title": "multiple items",
"format": "checkbox",
"default": true,
"description": "Allow updating or referencing multiple items. Uncheck this to make sure you are not addressing more than one item. Multiple items are treated as one and are edited similarly on each update. If an action can only handle a single value, the first items value is used."
}
},
"actions": {
"set": {
"title": "Set variable",
"description": "Create a new variable or set an existing variable to a new value (a=x).",
"documentation": "https://docs.adaptorex.org/basics/actions/data/set.html",
"template": "{return { title:`data ${action.name}`, body:[{ text: `${payload.variable} = ${payload.value}`}]} }",
"type": "object",
"resolveAdaptorVariables": false,
"additionalProperties": false,
"required": ["variable", "value"],
"default": { "variable": "", "value": "", "multiple": true },
"properties": {
"variable": {
"type": "string",
"title": "set variable",
"adaptorReplaceOnDrop": true,
"minLength": 1
},
"value": {
"type": ["string", "number", "array"],
"title": "to value",
"items": {
"default": ""
}
},
"multiple": { "$ref": "#/definitions/multiple" }
}
},
"increase": {
"title": "Increase number",
"description": "Increase a number variable (a=a+a).",
"documentation": "https://docs.adaptorex.org/basics/actions/data/increase.html",
"template": "{return { title:`data ${action.name}`, body:[{ text: `${payload.variable} += ${payload.value}`}]} }",
"type": "object",
"resolveAdaptorVariables": false,
"additionalProperties": false,
"required": ["variable", "value"],
"default": { "variable": "", "value": "", "multiple": true },
"properties": {
"variable": {
"type": "string",
"title": "increase variable",
"minLength": 1
},
"value": {
"type": "number",
"title": "by value"
},
"multiple": { "$ref": "#/definitions/multiple" }
}
},
"push": {
"title": "Add to list",
"description": "Append values to an exiting list variable or create a new list variable.",
"documentation": "https://docs.adaptorex.org/basics/actions/data/push.html",
"template": "{return { title:`data ${action.name}`, body:[{ text: `Add ${payload.value} to ${payload.variable}`}]} }",
"type": "object",
"resolveAdaptorVariables": false,
"additionalProperties": false,
"required": ["variable", "value"],
"default": {
"value": [""],
"variable": "",
"duplicates": false,
"multiple": true
},
"properties": {
"value": {
"type": "array",
"format": "table",
"default": [""],
"title": "add values",
"items": {
"title": "Value",
"type": ["string", "number"]
}
},
"variable": {
"type": "string",
"title": "to list",
"minLength": 1
},
"duplicates": {
"type": "boolean",
"title": "allow duplicates",
"format": "checkbox",
"description": "Set true to add value even if it already exists in the list."
},
"multiple": { "$ref": "#/definitions/multiple" }
}
},
"pull": {
"title": "Remove from list",
"description": "Remove values from a list",
"documentation": "https://docs.adaptorex.org/basics/actions/data/pull.html",
"template": "{return { title:`data ${action.name}`, body:[{ text: `Remove ${payload.value} from ${payload.variable}`}]} }",
"type": "object",
"resolveAdaptorVariables": false,
"additionalProperties": false,
"required": ["variable", "value"],
"default": { "value": [""], "variable": "", "multiple": true },
"properties": {
"value": {
"type": "array",
"format": "table",
"default": [""],
"title": "remove values",
"items": {
"title": "Value",
"type": ["string", "number"]
}
},
"variable": {
"type": "string",
"minLength": 1,
"description": "Variable has to be of list type. Use 'Delete' if you want to remove the variable.",
"title": "from list"
},
"multiple": { "$ref": "#/definitions/multiple" }
}
},
"getItem": {
"type": "object",
"title": "Get Item",
"required": ["reference", "collection", "query"],
"description": "Create a new level variable that references a data item or plugin item.",
"documentation": "https://docs.adaptorex.org/basics/actions/data/getItem.html",
"additionalProperties": false,
"default": {
"reference": "",
"collection": "",
"query": "",
"multiple": true
},
"properties": {
"reference": {
"type": "string",
"title": "reference name",
"description": "Name of reference with which the Item can be used inside this level.",
"minLength": 1,
"isAdaptorContent": false
},
"collection": { "$ref": "#/definitions/collection" },
"query": {
"type": "string",
"title": "find query",
"format": "textarea",
"minLength": 1,
"description": "Item name or Mongo DB style find query: {'color':'blue'}",
"isAdaptorContent": false
},
"multiple": { "$ref": "#/definitions/multiple" },
"sort": {
"type": "array",
"format": "table",
"description": "Create reference to items whilst generating a specific sort order based on item properties. Upmost entry will be dominant sort order.",
"default": [{ "by": "name", "direction": 1 }],
"items": {
"type": "object",
"title": "sort order",
"additionalProperties": false,
"properties": {
"by": {
"type": "string"
},
"direction": {
"type": "number",
"enum": [1, -1],
"options": {
"enum_titles": ["ascending", "descending"]
}
}
}
}
},
"limit": {
"type": "string",
"description": "Set the maximum number of items you want to create the reference to"
},
"skip": {
"type": "string",
"description": "Set the number of items that should be skipped and not referenced. Will then reference only the nth and following items."
}
}
},
"addItem": {
"title": "Add new Item",
"description": "Add a new Item to a Data Collection. You can add an empty item or assign variables right away.",
"documentation": "https://docs.adaptorex.org/basics/actions/data/addItem.html",
"type": "object",
"resolveAdaptorVariables": false,
"additionalProperties": true,
"required": ["collection", "variables"],
"default": { "collection": "", "variables": { "name": "" } },
"properties": {
"collection": { "$ref": "#/definitions/data_collection" },
"reference": {
"type": "string",
"minLength": 1,
"description": "Set an optional name reference to easily access the item in this level."
},
"variables": {
"type": "object",
"required": ["name"],
"properties": {
"name": {
"minLength": 1,
"type": "string"
}
},
"additionalProperties": {
"type": ["string", "number", "boolean", "array"],
"format": "table"
}
}
}
},
"update": {
"title": "Update Item",
"description": "Use any operation and the full syntax of the mongo db update query.",
"documentation": "https://docs.adaptorex.org/basics/actions/data/update.html",
"template": "{return { title:`data ${action.name}`, subtitle:`Update ${payload.item}`, body:[{ text: payload.update || 'undefined'}]} }",
"type": "object",
"resolveAdaptorVariables": false,
"additionalProperties": false,
"required": ["item", "update"],
"default": { "item": "", "update": "", "multiple": true },
"properties": {
"item": {
"type": "string",
"minLength": 1
},
"update": {
"type": "string",
"format": "textarea",
"title": "update query",
"minLength": 1
},
"multiple": { "$ref": "#/definitions/multiple" }
}
},
"delete": {
"title": "Delete Item or variable",
"description": "Delete a variable: [[item.variable]] or a complete item: [[item]]",
"documentation": "https://docs.adaptorex.org/basics/actions/data/delete.html",
"template": "{return { title:`data ${action.name}`, body:[{ text: `Delete ${payload.variable}`}]} }",
"resolveAdaptorVariables": false,
"additionalProperties": false,
"required": ["variable"],
"default": { "variable": "", "multiple": false },
"type": "object",
"properties": {
"variable": {
"type": "string",
"minLength": 1
},
"multiple": { "$ref": "#/definitions/multiple" }
}
}
}
}