fn(submit$0, fetch_contents$1, upload$2, event$3, then$4) =>
let request$5 = #object<@definy.json>([{key: "signedEventBytes", value: #string<@definy.json>($3.signed_event_bytes)}]);
$0(
request: $5,
then: fn(result$6) =>
match $6 {
#error(message$7) =>
$4(error: #some($7)),
#ok(json$8) =>
match @definy.json-get-string(value: $8, key: "status") {
#some("missing_content") =>
$1(
hashes: match @definy.json-get-strings(value: $8, key: "missingContentHashes") {
#some(hashes$9) =>
$9,
#none(_) =>
[]
},
then: fn(result$10) =>
match $10 {
#error(message$11) =>
$4(error: #some($11)),
#ok(items$12) =>
$2(
items: $12,
then: fn(result$13) =>
match $13 {
#error(message$14) =>
$4(error: #some($14)),
#ok(_) =>
$0(
request: $5,
then: fn(result$15) =>
match $15 {
#error(message$16) =>
$4(error: #some($16)),
#ok(json$17) =>
match @definy.json-get-string(value: $17, key: "status") {
#some("missing_content") =>
$4(error: #some("the contents of the event are still missing")),
_ =>
$4(error: #none)
}
}
)
}
)
}
),
_ =>
$4(error: #none)
}
}
)