0
2
{
"lexicon": 1,
"id": "dev.hatk.applyWrites",
"defs": {
"main": {
"type": "procedure",
"description": "Apply multiple record writes in a single atomic PDS transaction.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["writes"],
"properties": {
"writes": {
"type": "array",
"items": {
"type": "union",
"refs": ["#create", "#update", "#delete"]
}
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"type": "union",
"refs": ["#createResult", "#updateResult", "#deleteResult"]
}
}
}
}
}
},
"create": {
"type": "object",
"required": ["collection", "value"],
"properties": {
"collection": { "type": "string" },
"rkey": { "type": "string" },
"value": { "type": "unknown" }
}
},
"update": {
"type": "object",
"required": ["collection", "rkey", "value"],
"properties": {
"collection": { "type": "string" },
"rkey": { "type": "string" },
"value": { "type": "unknown" }
}
},
"delete": {
"type": "object",
"required": ["collection", "rkey"],
"properties": {
"collection": { "type": "string" },
"rkey": { "type": "string" }
}
},
"createResult": {
"type": "object",
"required": ["uri", "cid"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" }
}
},
"updateResult": {
"type": "object",
"required": ["uri", "cid"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" }
}
},
"deleteResult": {
"type": "object",
"properties": {}
}
}
}