fn(signed_event_bytes$0) =>
match @std.base64-to-bytes(text: $0) {
#none(_) =>
#none,
#some(bytes$1) =>
match @definy.decode-signed-event-with(
bytes: $1,
content: fn(cbor$2) =>
@definy.snapshot-cbor-without-parts(cbor: $2)
) {
#decoded(decoded$3) =>
match $3.content {
#project_commit(commit$4) =>
#some({
account_id: @core.bytes-to-base64url(bytes: $3.account_id_bytes),
project_name: $4.project_name,
branch: $4.branch,
time_ms: $3.time_ms,
message: $4.message,
parent_commit_hash: $4.parent_commit_hash,
merged_commit_hash: $4.merged_commit_hash,
modules: @core.list-map(
T: @core.project-snapshot-module,
U: @definy.stored-snapshot-module,
f: fn(item$5) =>
{
name: $5.name,
id: @core.module-id(module_name: $5.name),
description: $5.description,
visibility: $5.visibility,
parts: []
},
xs: $4.modules
)
}),
_ =>
#none
},
#invalid(_) =>
#none
}
}