-
Notifications
You must be signed in to change notification settings - Fork 406
/
applyWrites.json
77 lines (77 loc) · 2.47 KB
/
applyWrites.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
"lexicon": 1,
"id": "com.atproto.repo.applyWrites",
"defs": {
"main": {
"type": "procedure",
"description": "Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["repo", "writes"],
"properties": {
"repo": {
"type": "string",
"format": "at-identifier",
"description": "The handle or DID of the repo (aka, current account)."
},
"validate": {
"type": "boolean",
"default": true,
"description": "Can be set to 'false' to skip Lexicon schema validation of record data, for all operations."
},
"writes": {
"type": "array",
"items": {
"type": "union",
"refs": ["#create", "#update", "#delete"],
"closed": true
}
},
"swapCommit": {
"type": "string",
"description": "If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.",
"format": "cid"
}
}
}
},
"errors": [
{
"name": "InvalidSwap",
"description": "Indicates that the 'swapCommit' parameter did not match current commit."
}
]
},
"create": {
"type": "object",
"description": "Operation which creates a new record.",
"required": ["collection", "value"],
"properties": {
"collection": { "type": "string", "format": "nsid" },
"rkey": { "type": "string", "maxLength": 15 },
"value": { "type": "unknown" }
}
},
"update": {
"type": "object",
"description": "Operation which updates an existing record.",
"required": ["collection", "rkey", "value"],
"properties": {
"collection": { "type": "string", "format": "nsid" },
"rkey": { "type": "string" },
"value": { "type": "unknown" }
}
},
"delete": {
"type": "object",
"description": "Operation which deletes an existing record.",
"required": ["collection", "rkey"],
"properties": {
"collection": { "type": "string", "format": "nsid" },
"rkey": { "type": "string" }
}
}
}
}