61 lines
1.4 KiB
Plaintext
61 lines
1.4 KiB
Plaintext
|
|
# stratum-base.ncl — shared Nickel types for stratum action nodes.
|
||
|
|
# Published as OCI artifact to Zot registry.
|
||
|
|
# Import: let base = import "nickel/stratum-base/stratum-base.ncl" in
|
||
|
|
|
||
|
|
let RetryPolicy = {
|
||
|
|
max | Number | default = 3,
|
||
|
|
backoff_secs | Number | default = 10,
|
||
|
|
strategy | [| 'fixed, 'linear, 'exponential |] | default = 'exponential,
|
||
|
|
}
|
||
|
|
in
|
||
|
|
|
||
|
|
let default_retry = {
|
||
|
|
max = 3,
|
||
|
|
backoff_secs = 10,
|
||
|
|
strategy = 'exponential,
|
||
|
|
}
|
||
|
|
in
|
||
|
|
|
||
|
|
let NodeDefinition = {
|
||
|
|
id | String,
|
||
|
|
handler | String,
|
||
|
|
input_schemas | { _ : String } | default = {},
|
||
|
|
output_schemas | { _ : String } | default = {},
|
||
|
|
compensate | std.option.Option String | default = std.option.None,
|
||
|
|
retry | RetryPolicy | default = default_retry,
|
||
|
|
timeout_secs | Number | default = 300,
|
||
|
|
atomic | Bool | default = true,
|
||
|
|
triggers | Array String | default = [],
|
||
|
|
}
|
||
|
|
in
|
||
|
|
|
||
|
|
let CapabilitySchema = {
|
||
|
|
name | String,
|
||
|
|
description | String,
|
||
|
|
schema | { _ : Dyn },
|
||
|
|
}
|
||
|
|
in
|
||
|
|
|
||
|
|
let SagaConfig = {
|
||
|
|
compensation_order | [| 'reverse, 'parallel |] | default = 'reverse,
|
||
|
|
fail_fast | Bool | default = true,
|
||
|
|
}
|
||
|
|
in
|
||
|
|
|
||
|
|
let ActionGroup = {
|
||
|
|
id | String,
|
||
|
|
nodes | Array NodeDefinition,
|
||
|
|
trigger | Array String,
|
||
|
|
saga | SagaConfig | default = {},
|
||
|
|
}
|
||
|
|
in
|
||
|
|
|
||
|
|
{
|
||
|
|
NodeDefinition,
|
||
|
|
RetryPolicy,
|
||
|
|
CapabilitySchema,
|
||
|
|
SagaConfig,
|
||
|
|
ActionGroup,
|
||
|
|
default_retry,
|
||
|
|
}
|