- @edurata/types
- Interfaces
@edurata/types
@edurata/types
Table of contents
Interfaces
- ComputeResources
- Config
- FunctionConfig
- Interface
- InterfaceProperty
- Registry
- SourceImageRepo
- SourceRegistry
- SourceRepo
- StepDependency
- WorkflowConfig
Type Aliases
Type Aliases
Step
Ƭ Step: StepWithSource
| StepWithInline
StepBase
Ƭ StepBase: Object
Type declaration
Name | Type | Description |
---|---|---|
description? | string | An additional description next to the key of the step. |
foreach? | StepDependencyNested | If defined and the dependency is of type array, this step will loop over the array. The props attribute can then use “each” as StepDependencySchema.stepId, pointing to each iteration. |
if? | string | If defined, this step will only execute if the condition is true. The condition is a javascript boolean expression. |
props? | { [key: string] : StepDependencyNested ; } | Specifies where to get the input data (from other steps or the global inputs of the workflow defined in the “interface” attribute at the top). Each key must be an input of this step and should be defined in FunctionSchema.interface.inputs of the function defined in “source”. |
StepDependencyNested
Ƭ StepDependencyNested: { [key: string]
: StepDependencyNested
; } | StepDependencyNested
[] | StepDependency
| StepDependencyString
StepDependencyString
Ƭ StepDependencyString: `${string}.${string | “”}.${string | “”}`
Schema for a string representing an educational function step dependency.
Example
"stepId.outputId.outputPath"
StepWithInline
Ƭ StepWithInline: StepBase
& FunctionConfig
Schema for a workflow step with a function directly defined inline with code property
StepWithSource
Ƭ StepWithSource: StepBase
& { source?
: Source
}
Schema for a workflow step with source
Interfaces
@edurata/types / ComputeResources
Interface: ComputeResources
Table of contents
Properties
Properties
cpu
• cpu: number
The number of vCPUs to allocate for the function. The available CPU values depend on the amount of memory allocated to the function and vice versa. 0.25 vCPU - Available memory values: 0.5 GB, 1 GB, 2 GB
0.5 vCPU - Available memory values: 1 GB, 2 GB, 3 GB, 4 GB
1 vCPU - Available memory values: 2 GB, 3 GB, 4 GB, 5 GB, 6 GB, 7 GB, 8 GB
2 vCPU - Available memory values: 4 GB, 16 GB in increments of 1 GB
4 vCPU - Available memory values: 8 GB, 30 GB in increments of 1 GB
8 vCPU - Available memory values: 16 GB, 60 GB in 4 GB increments This option requires Linux platform 1.4.0 or later. 16 vCPU - Available memory values: 32 GB, 120 GB in 8 GB increments This option requires Linux platform 1.4.0 or later.
Example
"2"
memory
• memory: number
The memory allocated. The available memory values depend on the amount of vCPUs allocated to the function and vice versa. See above
Example
"16"
@edurata/types / Config
Interface: Config
Hierarchy
-
Config
Table of contents
Properties
Properties
description
• Optional
description: string
An additional description of the workflow or function
inputs
• Optional
inputs: Object
The global inputs of the workflow (or function). These can be used in any step of the workflow. Here fixed values or secrets or variables can be accessed. *
Example
{ "name": "${variables.employees.top}" }
*
Example
{ "name": "John" }
*
Example
{ "password": "${secrets.password}" }
Index signature
▪ [key: string
]: StepDependencyNested
interface
• Optional
interface: Interface
The schema of inputs and outputs of this workflow or function
name
• Optional
name: string
An identifier that is unique in the registry. It is used as reference in deployments or workflows.
outputs
• Optional
outputs: Object
Outputs of the workflow or function that can be used as inputs in other workflows or functions or just to inspect the output.
Index signature
▪ [key: string
]: StepDependencyNested
title
• Optional
title: string
A short title that describes the workflow or function. This is NOT the id that will be used in the registry!
@edurata/types / FunctionConfig
Interface: FunctionConfig
Represents the configuration schema for a function.
Hierarchy
-
↳
FunctionConfig
Table of contents
Properties
- apiRevision
- code
- description
- entrypoint
- exclude
- include
- inputs
- interface
- name
- outputs
- registry
- runtime
- title
Properties
apiRevision
• Optional
apiRevision: "edurata.io/function/v1"
Refers to the version of this schema and should be updated whenever the schema changes
code
• Optional
code: string
Inline code. You don’t need to put the handler function and can write the content of the function directly
description
• Optional
description: string
An additional description of the workflow or function
Inherited from
entrypoint
• Optional
entrypoint: string
Points to the entrypoint of the function. Defaults to index.js, index.py, index.sh, etc.
exclude
• Optional
exclude: string
[]
Specifies which files to exclude from the function. Can be a glob pattern. Defaults to none.
include
• Optional
include: string
[]
Specifies which files to include in the function. Can be a glob pattern. Defaults to all files in the same directory as the entrypoint.
inputs
• Optional
inputs: Object
The global inputs of the workflow (or function). These can be used in any step of the workflow. Here fixed values or secrets or variables can be accessed. *
Example
{ "name": "${variables.employees.top}" }
*
Example
{ "name": "John" }
*
Example
{ "password": "${secrets.password}" }
Index signature
▪ [key: string
]: StepDependencyNested
Inherited from
interface
• Optional
interface: Interface
The schema of inputs and outputs of this workflow or function
Inherited from
name
• Optional
name: string
An identifier that is unique in the registry. It is used as reference in deployments or workflows.
Inherited from
outputs
• Optional
outputs: Object
Outputs of the workflow or function that can be used as inputs in other workflows or functions or just to inspect the output.
Index signature
▪ [key: string
]: StepDependencyNested
Inherited from
registry
• Optional
registry: Registry
If the source shouldn’t be built but is already in an external registry, you can point to it here.
runtime
• Optional
runtime: "nodejs20"
| "python3_10"
| "docker"
Specifies the programming language the code is written in.
title
• Optional
title: string
A short title that describes the workflow or function. This is NOT the id that will be used in the registry!
Inherited from
@edurata/types / Interface
Interface: Interface
Schema for an interface of a workflow or function.
Example
{
inputs: {
required: ["name"],
properties: {
name: {
type: "string",
title: "Name",
description: "The name of the person",
}
}
}
Table of contents
Properties
Properties
inputs
• Optional
inputs: Object
Type declaration
Name | Type |
---|---|
properties? | { [key: string] : InterfaceProperty ; } |
required? | string [] |
type? | "object" |
outputs
• Optional
outputs: Object
Type declaration
Name | Type |
---|---|
properties? | { [key: string] : InterfaceProperty ; } |
required? | string [] |
type? | "object" |
@edurata/types / InterfaceProperty
Interface: InterfaceProperty
Inspired by JSON Schema for easier conversion from and to other tools.
See
https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
Table of contents
Properties
Properties
const
• Optional
const: InterfaceProperty
default
• Optional
default: any
description
• Optional
description: string
enum
• Optional
enum: (string
| number
| boolean
)[]
examples
• Optional
examples: InterfaceProperty
[]
items
• Optional
items: InterfaceProperty
properties
• Optional
properties: Object
Index signature
▪ [key: string
]: InterfaceProperty
required
• Optional
required: string
[]
title
• Optional
title: string
type
• type: "string"
| "number"
| "bigint"
| "boolean"
| "undefined"
| "object"
| "integer"
| "null"
| "array"
| "any"
| "file"
| "env"
| "cmdValue"
| "cmdKeyValue"
| "meta"
| "dependency"
| "interpolation"
@edurata/types / Registry
Interface: Registry
If a registry is used, this is the schema for it. Currently only supported for runtime: “docker”
Example
url: "docker.io/edurata", tag: "latest"
Example
url: "ghcr.io/edurata", tag: "latest"
Table of contents
Properties
Properties
tag
• tag: string
url
• url: string
@edurata/types / SourceImageRepo
Interface: SourceImageRepo
If the source is an image, you can point to an image repo and its tag.
Table of contents
Properties
Properties
imageRepoUrl
• imageRepoUrl: string
The url of the image repository. If dockerhub is used, url is optional.
Example
"docker.io/edurata"
Example
"ghcr.io/edurata"
Example
"quay.io/edurata"
tag
• tag: string
The tag of the image.
Example
"latest"
Example
"12"
Example
"1.0.0"
@edurata/types / SourceRegistry
Interface: SourceRegistry
If the source is already in the registry you can point to an entry of the registry.
Table of contents
Properties
Properties
name
• name: string
The name of the function in the registry.
Example
"my-function"
revision
• Optional
revision: string
The revision of the function in the registry.
Example
"12"
@edurata/types / SourceRepo
Interface: SourceRepo
If the source is a git repository, this is the schema for it.
Table of contents
Properties
Properties
path
• Optional
path: string
the path of where to find the function code inside the repository
Example
"tests/sleep"
ref
• Optional
ref: string
The ref of the git repository to use. Defaults to “main”.
Example
"main"
repoUrl
• repoUrl: string
the url of the git repository
Example
"https://github.com/Edurata/edurata-functions"
@edurata/types / StepDependency
Interface: StepDependency
Schema for an educational function step dependency.
Example
assuming the step “inputs” has an output “name” with the value “John”
{
stepId: "inputs",
outputId: "name",
}
Example
assuming the step “inputs” has an output “name” that is a complex object with a key “firstName” with the value “John”
{
stepId: "inputs",
outputId: "name",
outputPath: "firstName",
}
Table of contents
Properties
Properties
outputId
• Optional
outputId: string
the name of the output of a step (thereby its function). has to be one of the outputs defined in FunctionSchema.interface.outputs of the dependent step mentioned with “stepId”
outputPath
• Optional
outputPath: string
[]
only used when the output is a complex object and the value is inside. is a string with dot notation to point to the value. e.g. “data.name” to point to the value of the key “name” inside the object “data”.
Example
["data", "name"]
stepId
• Optional
stepId: string
the step which to depend on. Needs to be one defined in the “steps” attribute of the workflow definition. Can be “inputs” to refer to the global inputs of the workflow. Can be “each” if the attribute “foreach” in the parent step is defined.
value
• Optional
value: string
If you want to pass in a value directly instead of a step dependency, you can use this attribute. You can also use interpolation here.
Example
"examplestring"
Example
"${inputs.name} is here!"
@edurata/types / WorkflowConfig
Interface: WorkflowConfig
Represents the configuration schema for a workflow.
Hierarchy
-
↳
WorkflowConfig
Table of contents
Properties
Properties
apiRevision
• Optional
apiRevision: "edurata.io/workflow/v1"
Refers to the version of this schema and should be updated whenever the schema changes
description
• Optional
description: string
An additional description of the workflow or function
Inherited from
inputs
• Optional
inputs: Object
The global inputs of the workflow (or function). These can be used in any step of the workflow. Here fixed values or secrets or variables can be accessed. *
Example
{ "name": "${variables.employees.top}" }
*
Example
{ "name": "John" }
*
Example
{ "password": "${secrets.password}" }
Index signature
▪ [key: string
]: StepDependencyNested
Inherited from
interface
• Optional
interface: Interface
The schema of inputs and outputs of this workflow or function
Inherited from
name
• Optional
name: string
An identifier that is unique in the registry. It is used as reference in deployments or workflows.
Inherited from
outputs
• Optional
outputs: Object
Outputs of the workflow or function that can be used as inputs in other workflows or functions or just to inspect the output.
Index signature
▪ [key: string
]: StepDependencyNested
Inherited from
schedule
• Optional
schedule: string
A cron schedule that determines when the workflow should be executed.
Example
"0 0 * * *" -> every day at midnight
Example
"0 0 * * 0" -> every sunday at midnight
Example
"0 0 1 * *" -> every first day of the month at midnight
Example
"0 0 1 1 *" -> every first day of the year at midnight
Example
"0 0 1 1 0" -> every first sunday of the year at midnight
steps
• steps: Object
Each step of the workflow specified by a unique key and its definition as a value. The order of execution and dataflow is inferred by “props”.
Index signature
▪ [key: string
]: Step
title
• Optional
title: string
A short title that describes the workflow or function. This is NOT the id that will be used in the registry!