For the complete documentation index, see llms.txt. This page is also available as Markdown.

Script Objects

All about objects that contain Javascript

Rather than recreate the Rules and parser that we had in OLab3, we have instead decided to create an API that can be accessed via Javascript. This opens up a whole range of possibilities. It also means that authors are no longer limited by the simplistic parsing engine but can take greater advantage of what Javascript offers.

Scripts can be standalone but have much more utility when they can interface with other objects within the OLab4 core, via the REST API.

Script API

Get Cakes

GET https://api.cakes.com/v1/cakes/:id

This endpoint allows you to get free cakes.

Path Parameters

Name
Type
Description

id

string

ID of the cake to get, for free of course.

Query Parameters

Name
Type
Description

recipe

string

The API will do its best to find a cake matching the provided recipe.

gluten

boolean

Whether the cake should be gluten-free or not.

Headers

Name
Type
Description

Authentication

string

Authentication token to track down who is emptying our stocks.

Script Examples

Scripts as Scoped Objects

As noted in the section on Object, Scripts can also be Scoped Objects. They can have the same scope levels e.g. global, server, map and node-level. See #scopeforobjects for more details on this.

Last updated