Skip to content

Instantly share code, notes, and snippets.

@pfftdammitchris
Created November 14, 2021 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfftdammitchris/4c249b21ad3965cc7437db3028a188a2 to your computer and use it in GitHub Desktop.
Save pfftdammitchris/4c249b21ad3965cc7437db3028a188a2 to your computer and use it in GitHub Desktop.
{
"$defs": {
"Action": {
"accessToken": {
"type": "string"
},
"actionType": {
"description": "Used as an identifier for an action",
"type": "string"
},
"contentType": {
"description": "Determines the content type of the component. For example, a textField component may be a date textField if it has contentType: dateSelect, or a password textField with contentType: password, etc",
"enum": [
"listObject",
"password",
"dateSelect"
],
"type": "string"
},
"dataKey": {
"description": "The path to a data object or value. It might provide a different behavior depending on where it is placed. For example, a dataKey set on a textField component will bind its value to the path in the dataKey, enabling it to mutate the value while updating textField's value",
"type": "string"
},
"dataObject": {
"description": "An object that contains data. It is most commonly used in actions such as updateObject as a way to update its data values",
"type": "string"
},
"dismissOnTouchOutside": {
"description": "Signals that a popup should close when a user clicks outside of it. This is used for closing modals/popups",
"type": "boolean"
},
"funcName": {
"description": "A name/identifier for a function. This is used mainly for builtIn actions, where applications implement their own behavior and binds it to some object in the noodl",
"type": "string"
},
"goto": {
"description": "A destination the user should navigate to",
"type": "string"
},
"object": {
"type": "object"
},
"popUpView": {
"description": "A binding between a popUp or popUpDismiss component to a popUp action.",
"type": "string"
},
"reload": {
"description": "When set to true, this signals that a page should run its \"init\" operation upon visiting from the user. If it is false, a page will not run it, which can be used to persist values when navigating pages",
"title": "Skip or run \"init\"",
"type": "boolean"
},
"roomId": {
"type": "string"
},
"timer": {
"description": "A timer is useful for situations such as chat rooms where users will have a time limit before being getting out",
"type": "string"
},
"timerTag": {
"type": "string"
},
"viewTag": {
"description": "An identifier which is used to bind a component and an action together. Actions can define a viewTag that invokes certain behavior towards a component. The component must also contain the same viewTag key/value. If multiple components have the same viewTag, then the action will effect multiple components",
"type": "string"
},
"wait": {
"description": "Used to prevent further actions from happening. For example, a popUp action with \"wait: true\" will open a pop up in the page and will not run actions that are next in the call stack. This can be used to restrict access to pages when authenticating",
"type": "boolean"
}
},
"Component": {
"anyOf": [],
"properties": {
"audioStream": {
"type": "boolean"
},
"borderRadius": {
"type": "number"
},
"children": {
"$ref": "#/$defs/Component",
"type": "array"
},
"colorChange": {
"type": "string"
},
"contentType": {
"type": "string"
},
"dataId": {
"type": "string"
},
"dataKey": {
"type": "string"
},
"dataModel": {
"type": "string"
},
"ecosObj": {
"type": "string"
},
"global": {
"type": "boolean"
},
"height": {
"default": "0",
"type": "string"
},
"image": {
"type": "string"
},
"imgPath": {
"type": "string"
},
"isEdit": {
"type": "boolean"
},
"isEditable": {
"type": "string"
},
"itemObject": {
"type": "string"
},
"iteratorVar": {
"type": "string"
},
"listObject": {
"anyOf": [
{
"type": "string"
},
{
"type": "array"
}
]
},
"message": {
"type": "string"
},
"message2": {
"type": "string"
},
"onChange": {
"type": "array"
},
"onClick": {
"items": {
"$ref": "#/$defs/Action"
},
"type": "array"
},
"onHover": {
"type": "array"
},
"onMouseEnter": {
"type": "array"
},
"onMouseLeave": {
"type": "array"
},
"onMouseOut": {
"type": "array"
},
"options": {
"type": "string"
},
"overflow": {
"type": "string"
},
"path": {
"$ref": "#/$defs/Path"
},
"placeHolder": {
"type": "string"
},
"placeholder": {
"type": "string"
},
"postMessage": {
"type": "array"
},
"required": {
"type": "string"
},
"resource": {
"type": "string"
},
"style": {
"$ref": "#/$defs/Style"
},
"text": {
"type": "string"
},
"text2": {
"type": "string"
},
"text3": {
"type": "string"
},
"text4": {
"type": "string"
},
"text=func": {
"type": "string"
},
"textAlign": {
"type": "object"
},
"textBoard": {
"type": "array"
},
"type": {
"type": "string"
},
"videoStream": {
"type": "boolean"
},
"viewTag": {
"type": "string"
},
"zIndex": {
"type": "number"
}
},
"required": [
"type"
],
"type": "object"
},
"ComponentType": {
"items": {
"title": "Component type",
"type": "string"
},
"type": "array"
},
"ConfigVersionObjectByDevice": {
"properties": {
"stable": {},
"test": {}
},
"type": "object"
},
"Emit": {
"description": "An emit is a special type of action that usually contains a dataKey paired with a list of actions that are called in order. Some emits can contain just a list of actions. When paired with a dataKey it is usually mutating the value at the path in the dataKey",
"properties": {
"emit": {
"oneOf": [
{
"type": "string"
},
{
"type": "object"
},
{
"type": "array"
}
]
}
}
},
"Goto": {
"anyOf": [
{
"$ref": "#/$defs/GotoPage"
},
{
"$ref": "#/$defs/GotoObject"
}
]
},
"GotoObject": {
"properties": {
"goto": {
"type": "string"
}
},
"type": "object"
},
"GotoPage": {
"type": "string"
},
"If": {
"description": "If objects contain an array with three items used for conditional checks. The first item is used as a test for truthiness which can be in the form of any data type such as a string, number, boolean, object, etc. Either the second or third item is returned depending on the result of the truthiness test",
"items": false,
"prefixItems": [
{
"anyOf": [
{
"type": "string"
},
{
"type": "boolean"
},
{
"type": "object"
}
]
},
{},
{}
],
"title": "A condition evaluation",
"type": "array"
},
"Page": {
"type": "object"
},
"PageNumber": {
"type": "string"
},
"Path": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/If"
},
{
"$ref": "#/$defs/Emit"
}
],
"description": "A path can be in the form of a string, an if object, or an emit object",
"title": "Destination pointing to a separate page or url"
},
"RootConfig": {
"properties": {
"android": {
"type": "object"
},
"apiCheck": {
"type": "object"
},
"apiHost": {
"type": "string"
},
"apiPort": {
"default": "443",
"type": "string"
},
"appApiHost": {
"type": "string"
},
"cadlBaseUrl": {
"type": "string"
},
"cadlMain": {
"default": "cadlEndpoint.yml",
"type": "string"
},
"cadlVersion": {
"type": "object"
},
"connectiontimeout": {
"type": "string"
},
"debug": {
"oneOf": [
{
"default": "console_log_api",
"type": "string"
},
{
"properties": {},
"type": "obeject"
}
]
},
"elasticClient": {
"type": "object"
},
"ios": {
"type": "object"
},
"isGetPosition": {
"default": false,
"type": "boolean"
},
"keywords": {
"type": "array"
},
"loadingLevel": {
"default": 1,
"type": "number"
},
"log": {
"type": "string"
},
"max": {
"type": "number"
},
"min": {
"type": "number"
},
"myBaseUrl": {
"type": "string"
},
"pathNotFound": {
"type": "object"
},
"return": {
"type": "string"
},
"searchLink": {
"type": "object"
},
"stable": {
"type": "string"
},
"syncHost": {
"type": "string"
},
"test": {
"type": "string"
},
"timestamp": {
"type": "number"
},
"unEvolvedValue": {
"type": "string"
},
"viewWidthHeightRatio": {
"properties": {
"max": {
"type": "number"
},
"min": {
"type": "number"
}
},
"type": "object"
},
"web": {
"type": "object"
},
"webApiHost": {
"type": "string"
}
},
"type": "object"
},
"Style": {
"properties": {
"Index": {
"type": "number"
},
"align": {
"enum": [
"centerX",
"centerY"
],
"type": "string"
},
"axis": {
"enum": [
"horizontal",
"vertical"
],
"type": "string"
},
"backgroundColor": {
"type": "string"
},
"border": {
"oneOf": [
{
"type": "string"
},
{
"properties": {
"color": {
"type": "string"
},
"style": {
"type": "string"
},
"width": {
"type": "string"
}
},
"type": "object"
}
]
},
"borderBottom": {
"type": "string"
},
"borderColor": {
"type": "string"
},
"borderRadius": {
"type": "string"
},
"borderRaduis": {
"type": "string"
},
"borderWidth": {
"type": "string"
},
"boxShadow": {
"type": "string"
},
"boxSizing": {
"type": "string"
},
"color": {
"type": "string"
},
"contentSize": {
"type": null
},
"display": {
"type": "string"
},
"flex": {
"type": "string"
},
"fonSize": {
"type": "string"
},
"fontFamily": {
"type": "string"
},
"fontSize": {
"type": "string"
},
"fontStyle": {
"type": "string"
},
"fontSytle": {
"type": "string"
},
"fontWeight": {
"type": "number"
},
"height": {
"type": "string"
},
"isEditable": {
"type": "string"
},
"isHidden": {
"type": "boolean"
},
"justifyContent": {
"type": "string"
},
"left": {
"default": "0",
"type": "string"
},
"letterSpacing": {
"type": "string"
},
"lineHeight": {
"type": "string"
},
"margin": {
"type": "string"
},
"marginTop": {
"type": "string"
},
"onClick": {
"anyOf": [
{
"type": "array"
},
{
"type": "object"
}
]
},
"opacity": {
"type": "string"
},
"overflow": {
"type": "string"
},
"padding": {
"type": "string"
},
"paddingBottom": {
"type": "string"
},
"paddingLeft": {
"type": "string"
},
"placeholder": {
"anyOf": [
{
"type": "string"
},
{
"type": "object"
}
]
},
"position": {
"type": "string"
},
"required": {
"type": "string"
},
"shadow": {
"anyOf": [
{
"required": [
"true"
],
"type": "string"
},
{
"type": "boolean"
}
],
"default": "true"
},
"style": {
"type": null
},
"textAlign": {
"oneOf": [
{
"enum": [
"left",
"center",
"right"
],
"type": "string"
},
{
"properties": {
"x": {
"type": "string"
},
"y": {
"type": "string"
}
},
"type": "object"
}
]
},
"textIndent": {
"type": "string"
},
"top": {
"default": "0",
"type": "string"
},
"width": {
"default": "0",
"type": "string"
},
"zIndex": {
"type": "string"
}
},
"type": "object"
},
"TextBoard": {
"items": {
"color": {
"type": "string"
},
"text": {
"type": "string"
}
},
"type": "array"
},
"UserEvent": {
"items": {
"$ref": "#/$defs/Action"
},
"type": "array"
},
"Value": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "object"
},
{
"type": "array"
},
{
"type": "null"
},
{
"$ref": "#/$defs/If"
},
{
"$ref": "#/$defs/Emit"
}
]
}
},
"$id": "noodl-schema",
"$ref": "#/$defs/Page",
"$schema": "http://json-schema.org/draft-07/schema#",
"anyOf": [
{
"$ref": "#/$defs/RootConfig"
},
{
"type": "string"
}
],
"patternProperties": {
"^[a-zA-Z0-9_]*$": {
"properties": {
"components": {
"items": {
"$ref": "#/$defs/Component"
},
"type": "array"
},
"pageNumber": {
"description": "A page number may help distinguish between pages with similar names",
"type": "string"
},
"title": {
"description": "Titles can be used to represent the page",
"type": "string"
},
"viewPort": {
"description": "Determines the initial scroll position for the user",
"enum": [
"top",
"center",
"bottom"
],
"type": "string"
}
},
"type": "object"
}
},
"title": "JSON schema for NOODL files"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment