@getcirrus/space-conformance 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-D8a-ZK57.d.ts +249 -0
- package/dist/base-D8a-ZK57.d.ts.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +373 -0
- package/dist/cli.js.map +1 -0
- package/dist/coverage-DhJZu8P8.js +1914 -0
- package/dist/coverage-DhJZu8P8.js.map +1 -0
- package/dist/full-D4ufJLcw.js +409 -0
- package/dist/full-D4ufJLcw.js.map +1 -0
- package/dist/full.d.ts +59 -0
- package/dist/full.d.ts.map +1 -0
- package/dist/full.js +4 -0
- package/dist/index.d.ts +178 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +114 -0
- package/dist/index.js.map +1 -0
- package/dist/operator-BErXCDow.js +923 -0
- package/dist/operator-BErXCDow.js.map +1 -0
- package/lexicons/MANIFEST.json +7 -0
- package/lexicons/simplespace/addMember.json +37 -0
- package/lexicons/simplespace/checkUserAccess.json +43 -0
- package/lexicons/simplespace/createSpace.json +74 -0
- package/lexicons/simplespace/defs.json +47 -0
- package/lexicons/simplespace/deleteSpace.json +32 -0
- package/lexicons/simplespace/getSpace.json +53 -0
- package/lexicons/simplespace/listMembers.json +65 -0
- package/lexicons/simplespace/removeMember.json +37 -0
- package/lexicons/simplespace/updateSpace.json +57 -0
- package/lexicons/space/applyWrites.json +163 -0
- package/lexicons/space/createRecord.json +79 -0
- package/lexicons/space/defs.json +38 -0
- package/lexicons/space/deleteRecord.json +51 -0
- package/lexicons/space/getBlob.json +54 -0
- package/lexicons/space/getDelegationToken.json +34 -0
- package/lexicons/space/getLatestCommit.json +57 -0
- package/lexicons/space/getRecord.json +76 -0
- package/lexicons/space/getRepo.json +41 -0
- package/lexicons/space/getSpaceCredential.json +67 -0
- package/lexicons/space/listBlobs.json +59 -0
- package/lexicons/space/listRecords.json +108 -0
- package/lexicons/space/listRepoOps.json +111 -0
- package/lexicons/space/listRepos.json +75 -0
- package/lexicons/space/listSpaces.json +65 -0
- package/lexicons/space/notifySpaceDeleted.json +24 -0
- package/lexicons/space/notifyWrite.json +38 -0
- package/lexicons/space/putRecord.json +75 -0
- package/lexicons/space/registerNotify.json +49 -0
- package/lexicons/space/unregisterNotify.json +29 -0
- package/package.json +53 -0
|
@@ -0,0 +1,1914 @@
|
|
|
1
|
+
//#region src/runner.ts
|
|
2
|
+
async function runChecks(options) {
|
|
3
|
+
const logs = [];
|
|
4
|
+
const state = /* @__PURE__ */ new Map();
|
|
5
|
+
const ctx = {
|
|
6
|
+
...options.context,
|
|
7
|
+
state,
|
|
8
|
+
log: (message) => logs.push(message)
|
|
9
|
+
};
|
|
10
|
+
const timeoutMs = options.checkTimeoutMs ?? 3e4;
|
|
11
|
+
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
12
|
+
const results = [];
|
|
13
|
+
const emit = (result) => {
|
|
14
|
+
results.push(result);
|
|
15
|
+
try {
|
|
16
|
+
options.onResult?.(result);
|
|
17
|
+
} catch {}
|
|
18
|
+
};
|
|
19
|
+
for (const check of options.catalog.runnable) {
|
|
20
|
+
const began = Date.now();
|
|
21
|
+
const controller = new AbortController();
|
|
22
|
+
const checkCtx = {
|
|
23
|
+
...ctx,
|
|
24
|
+
fetch: (input, init) => ctx.fetch(input, {
|
|
25
|
+
...init,
|
|
26
|
+
signal: init?.signal ?? controller.signal
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
try {
|
|
30
|
+
const outcome = await withTimeout(check.run(checkCtx), timeoutMs, check.id, controller);
|
|
31
|
+
emit({
|
|
32
|
+
id: check.id,
|
|
33
|
+
tier: check.tier,
|
|
34
|
+
status: outcome.status,
|
|
35
|
+
detail: outcome.detail,
|
|
36
|
+
citations: check.citations,
|
|
37
|
+
...outcome.evidence !== void 0 ? { evidence: outcome.evidence } : {},
|
|
38
|
+
durationMs: Date.now() - began
|
|
39
|
+
});
|
|
40
|
+
} catch (err) {
|
|
41
|
+
emit({
|
|
42
|
+
id: check.id,
|
|
43
|
+
tier: check.tier,
|
|
44
|
+
status: "error",
|
|
45
|
+
detail: err instanceof Error ? err.message : String(err),
|
|
46
|
+
citations: check.citations,
|
|
47
|
+
durationMs: Date.now() - began
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
for (const { check, reason } of options.catalog.skipped) emit({
|
|
52
|
+
id: check.id,
|
|
53
|
+
tier: check.tier,
|
|
54
|
+
status: "skipped",
|
|
55
|
+
detail: reason,
|
|
56
|
+
citations: check.citations
|
|
57
|
+
});
|
|
58
|
+
const summary = {
|
|
59
|
+
pass: results.filter((r) => r.status === "pass").length,
|
|
60
|
+
fail: results.filter((r) => r.status === "fail").length,
|
|
61
|
+
mustFail: results.filter((r) => r.status === "fail" && r.tier === "must").length,
|
|
62
|
+
mustError: results.filter((r) => r.status === "error" && r.tier === "must").length,
|
|
63
|
+
skipped: results.filter((r) => r.status === "skipped").length,
|
|
64
|
+
error: results.filter((r) => r.status === "error").length
|
|
65
|
+
};
|
|
66
|
+
return {
|
|
67
|
+
suite: {
|
|
68
|
+
name: "@getcirrus/space-conformance",
|
|
69
|
+
version: options.suiteVersion
|
|
70
|
+
},
|
|
71
|
+
alphaBuild: options.alphaBuild,
|
|
72
|
+
target: options.context.target,
|
|
73
|
+
startedAt,
|
|
74
|
+
finishedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
75
|
+
results,
|
|
76
|
+
logs,
|
|
77
|
+
summary
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function withTimeout(promise, ms, id$29, controller) {
|
|
81
|
+
return new Promise((resolve, reject) => {
|
|
82
|
+
const timer = setTimeout(() => {
|
|
83
|
+
controller.abort();
|
|
84
|
+
reject(/* @__PURE__ */ new Error(`check ${id$29} timed out after ${ms}ms`));
|
|
85
|
+
}, ms);
|
|
86
|
+
promise.then((value) => {
|
|
87
|
+
clearTimeout(timer);
|
|
88
|
+
resolve(value);
|
|
89
|
+
}, (err) => {
|
|
90
|
+
clearTimeout(timer);
|
|
91
|
+
reject(err);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/** Render a compact human-readable summary of a report. */
|
|
96
|
+
function renderReport(report) {
|
|
97
|
+
const lines = [];
|
|
98
|
+
const icon = {
|
|
99
|
+
pass: "✓",
|
|
100
|
+
fail: "✗",
|
|
101
|
+
skipped: "-",
|
|
102
|
+
error: "!"
|
|
103
|
+
};
|
|
104
|
+
lines.push(`# ${report.suite.name}@${report.suite.version} vs ${report.target.implementation ?? report.target.origin}`);
|
|
105
|
+
lines.push(`alpha build: ${report.alphaBuild}`);
|
|
106
|
+
for (const result of report.results) lines.push(`${icon[result.status]} [${result.tier}] ${result.id} — ${result.detail}`);
|
|
107
|
+
const s = report.summary;
|
|
108
|
+
lines.push(`${s.pass} pass, ${s.fail} fail (${s.mustFail} must), ${s.skipped} skipped, ${s.error} errored`);
|
|
109
|
+
return lines.join("\n");
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region lexicons/space/applyWrites.json
|
|
114
|
+
var applyWrites_default = {
|
|
115
|
+
lexicon: 1,
|
|
116
|
+
id: "com.atproto.space.applyWrites",
|
|
117
|
+
defs: {
|
|
118
|
+
"main": {
|
|
119
|
+
"type": "procedure",
|
|
120
|
+
"description": "Apply a batch transaction of creates, updates, and deletes in a permissioned space. Requires auth, implemented by PDS.",
|
|
121
|
+
"input": {
|
|
122
|
+
"encoding": "application/json",
|
|
123
|
+
"schema": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"required": [
|
|
126
|
+
"space",
|
|
127
|
+
"repo",
|
|
128
|
+
"writes"
|
|
129
|
+
],
|
|
130
|
+
"properties": {
|
|
131
|
+
"space": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"format": "space-ref",
|
|
134
|
+
"description": "Reference to the space."
|
|
135
|
+
},
|
|
136
|
+
"repo": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"format": "did",
|
|
139
|
+
"description": "The DID of the repo to write to (the authenticated member)."
|
|
140
|
+
},
|
|
141
|
+
"validate": {
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"description": "Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons."
|
|
144
|
+
},
|
|
145
|
+
"writes": {
|
|
146
|
+
"type": "array",
|
|
147
|
+
"items": {
|
|
148
|
+
"type": "union",
|
|
149
|
+
"refs": [
|
|
150
|
+
"#create",
|
|
151
|
+
"#update",
|
|
152
|
+
"#delete"
|
|
153
|
+
],
|
|
154
|
+
"closed": true
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"output": {
|
|
161
|
+
"encoding": "application/json",
|
|
162
|
+
"schema": {
|
|
163
|
+
"type": "object",
|
|
164
|
+
"properties": { "results": {
|
|
165
|
+
"type": "array",
|
|
166
|
+
"items": {
|
|
167
|
+
"type": "union",
|
|
168
|
+
"refs": [
|
|
169
|
+
"#createResult",
|
|
170
|
+
"#updateResult",
|
|
171
|
+
"#deleteResult"
|
|
172
|
+
],
|
|
173
|
+
"closed": true
|
|
174
|
+
}
|
|
175
|
+
} }
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"errors": [
|
|
179
|
+
{ "name": "SpaceNotFound" },
|
|
180
|
+
{
|
|
181
|
+
"name": "RecordNotFound",
|
|
182
|
+
"description": "An update or delete targeted a record that does not exist."
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "RecordAlreadyExists",
|
|
186
|
+
"description": "A create targeted a collection and rkey that already holds a record."
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
"create": {
|
|
191
|
+
"type": "object",
|
|
192
|
+
"description": "Operation which creates a new record.",
|
|
193
|
+
"required": ["collection", "value"],
|
|
194
|
+
"properties": {
|
|
195
|
+
"collection": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"format": "nsid"
|
|
198
|
+
},
|
|
199
|
+
"rkey": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"format": "record-key",
|
|
202
|
+
"maxLength": 512
|
|
203
|
+
},
|
|
204
|
+
"value": { "type": "unknown" }
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"update": {
|
|
208
|
+
"type": "object",
|
|
209
|
+
"description": "Operation which updates an existing record.",
|
|
210
|
+
"required": [
|
|
211
|
+
"collection",
|
|
212
|
+
"rkey",
|
|
213
|
+
"value"
|
|
214
|
+
],
|
|
215
|
+
"properties": {
|
|
216
|
+
"collection": {
|
|
217
|
+
"type": "string",
|
|
218
|
+
"format": "nsid"
|
|
219
|
+
},
|
|
220
|
+
"rkey": {
|
|
221
|
+
"type": "string",
|
|
222
|
+
"format": "record-key"
|
|
223
|
+
},
|
|
224
|
+
"value": { "type": "unknown" }
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"delete": {
|
|
228
|
+
"type": "object",
|
|
229
|
+
"description": "Operation which deletes an existing record.",
|
|
230
|
+
"required": ["collection", "rkey"],
|
|
231
|
+
"properties": {
|
|
232
|
+
"collection": {
|
|
233
|
+
"type": "string",
|
|
234
|
+
"format": "nsid"
|
|
235
|
+
},
|
|
236
|
+
"rkey": {
|
|
237
|
+
"type": "string",
|
|
238
|
+
"format": "record-key"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"createResult": {
|
|
243
|
+
"type": "object",
|
|
244
|
+
"required": ["uri", "cid"],
|
|
245
|
+
"properties": {
|
|
246
|
+
"uri": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"format": "at-uri"
|
|
249
|
+
},
|
|
250
|
+
"cid": {
|
|
251
|
+
"type": "string",
|
|
252
|
+
"format": "cid"
|
|
253
|
+
},
|
|
254
|
+
"validationStatus": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"knownValues": ["valid", "unknown"]
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"updateResult": {
|
|
261
|
+
"type": "object",
|
|
262
|
+
"required": ["uri", "cid"],
|
|
263
|
+
"properties": {
|
|
264
|
+
"uri": {
|
|
265
|
+
"type": "string",
|
|
266
|
+
"format": "at-uri"
|
|
267
|
+
},
|
|
268
|
+
"cid": {
|
|
269
|
+
"type": "string",
|
|
270
|
+
"format": "cid"
|
|
271
|
+
},
|
|
272
|
+
"validationStatus": {
|
|
273
|
+
"type": "string",
|
|
274
|
+
"knownValues": ["valid", "unknown"]
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"deleteResult": {
|
|
279
|
+
"type": "object",
|
|
280
|
+
"required": [],
|
|
281
|
+
"properties": {}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region lexicons/space/createRecord.json
|
|
288
|
+
var createRecord_default = {
|
|
289
|
+
lexicon: 1,
|
|
290
|
+
id: "com.atproto.space.createRecord",
|
|
291
|
+
defs: { "main": {
|
|
292
|
+
"type": "procedure",
|
|
293
|
+
"description": "Create a single new record in a permissioned space. Requires auth, implemented by PDS.",
|
|
294
|
+
"input": {
|
|
295
|
+
"encoding": "application/json",
|
|
296
|
+
"schema": {
|
|
297
|
+
"type": "object",
|
|
298
|
+
"required": [
|
|
299
|
+
"space",
|
|
300
|
+
"repo",
|
|
301
|
+
"collection",
|
|
302
|
+
"record"
|
|
303
|
+
],
|
|
304
|
+
"properties": {
|
|
305
|
+
"space": {
|
|
306
|
+
"type": "string",
|
|
307
|
+
"format": "space-ref",
|
|
308
|
+
"description": "Reference to the space."
|
|
309
|
+
},
|
|
310
|
+
"repo": {
|
|
311
|
+
"type": "string",
|
|
312
|
+
"format": "did",
|
|
313
|
+
"description": "The DID of the repo to write to (the authenticated member)."
|
|
314
|
+
},
|
|
315
|
+
"collection": {
|
|
316
|
+
"type": "string",
|
|
317
|
+
"format": "nsid",
|
|
318
|
+
"description": "The NSID of the record collection."
|
|
319
|
+
},
|
|
320
|
+
"rkey": {
|
|
321
|
+
"type": "string",
|
|
322
|
+
"format": "record-key",
|
|
323
|
+
"description": "The Record Key.",
|
|
324
|
+
"maxLength": 512
|
|
325
|
+
},
|
|
326
|
+
"validate": {
|
|
327
|
+
"type": "boolean",
|
|
328
|
+
"description": "Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons."
|
|
329
|
+
},
|
|
330
|
+
"record": {
|
|
331
|
+
"type": "unknown",
|
|
332
|
+
"description": "The record itself. Must contain a $type field."
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
"output": {
|
|
338
|
+
"encoding": "application/json",
|
|
339
|
+
"schema": {
|
|
340
|
+
"type": "object",
|
|
341
|
+
"required": ["uri", "cid"],
|
|
342
|
+
"properties": {
|
|
343
|
+
"uri": {
|
|
344
|
+
"type": "string",
|
|
345
|
+
"format": "at-uri",
|
|
346
|
+
"description": "URI of the created record."
|
|
347
|
+
},
|
|
348
|
+
"cid": {
|
|
349
|
+
"type": "string",
|
|
350
|
+
"format": "cid"
|
|
351
|
+
},
|
|
352
|
+
"validationStatus": {
|
|
353
|
+
"type": "string",
|
|
354
|
+
"knownValues": ["valid", "unknown"]
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"errors": [{ "name": "SpaceNotFound" }, {
|
|
360
|
+
"name": "RecordAlreadyExists",
|
|
361
|
+
"description": "A record already exists at this collection and rkey. Retry with a different rkey, or use putRecord."
|
|
362
|
+
}]
|
|
363
|
+
} }
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region lexicons/space/defs.json
|
|
368
|
+
var defs_default$1 = {
|
|
369
|
+
lexicon: 1,
|
|
370
|
+
id: "com.atproto.space.defs",
|
|
371
|
+
defs: { "signedCommit": {
|
|
372
|
+
"type": "object",
|
|
373
|
+
"description": "A signed commit over the current state of a permissioned repo.",
|
|
374
|
+
"required": [
|
|
375
|
+
"ver",
|
|
376
|
+
"hash",
|
|
377
|
+
"mac",
|
|
378
|
+
"ikm",
|
|
379
|
+
"sig",
|
|
380
|
+
"rev"
|
|
381
|
+
],
|
|
382
|
+
"properties": {
|
|
383
|
+
"ver": {
|
|
384
|
+
"type": "integer",
|
|
385
|
+
"description": "Commit format version, currently 1. Corresponds to the version in the ctx protocol tag (atproto-space-v1)."
|
|
386
|
+
},
|
|
387
|
+
"hash": {
|
|
388
|
+
"type": "bytes",
|
|
389
|
+
"description": "sha256 digest of the LtHash state (32 bytes)."
|
|
390
|
+
},
|
|
391
|
+
"ikm": {
|
|
392
|
+
"type": "bytes",
|
|
393
|
+
"description": "Per-signature input keying material (32 random bytes)"
|
|
394
|
+
},
|
|
395
|
+
"sig": {
|
|
396
|
+
"type": "bytes",
|
|
397
|
+
"description": "Signature over ctx (space, author DID, rev, ikm) by the user's atproto signing key. Does not cover the repo hash."
|
|
398
|
+
},
|
|
399
|
+
"mac": {
|
|
400
|
+
"type": "bytes",
|
|
401
|
+
"description": "HMAC-SHA256 over hash, keyed by HKDF-SHA256(ikm, info=ctx). Binds the repo hash to this commit's context."
|
|
402
|
+
},
|
|
403
|
+
"rev": {
|
|
404
|
+
"type": "string",
|
|
405
|
+
"format": "tid",
|
|
406
|
+
"description": "Commit revision (TID), also bound into ctx."
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
} }
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
//#endregion
|
|
413
|
+
//#region lexicons/space/deleteRecord.json
|
|
414
|
+
var deleteRecord_default = {
|
|
415
|
+
lexicon: 1,
|
|
416
|
+
id: "com.atproto.space.deleteRecord",
|
|
417
|
+
defs: { "main": {
|
|
418
|
+
"type": "procedure",
|
|
419
|
+
"description": "Delete a record from a permissioned space, or ensure it doesn't exist. Succeeds whether or not the record was present. Requires auth, implemented by PDS.",
|
|
420
|
+
"input": {
|
|
421
|
+
"encoding": "application/json",
|
|
422
|
+
"schema": {
|
|
423
|
+
"type": "object",
|
|
424
|
+
"required": [
|
|
425
|
+
"space",
|
|
426
|
+
"repo",
|
|
427
|
+
"collection",
|
|
428
|
+
"rkey"
|
|
429
|
+
],
|
|
430
|
+
"properties": {
|
|
431
|
+
"space": {
|
|
432
|
+
"type": "string",
|
|
433
|
+
"format": "space-ref",
|
|
434
|
+
"description": "Reference to the space."
|
|
435
|
+
},
|
|
436
|
+
"repo": {
|
|
437
|
+
"type": "string",
|
|
438
|
+
"format": "did",
|
|
439
|
+
"description": "The DID of the repo to delete from (the authenticated member)."
|
|
440
|
+
},
|
|
441
|
+
"collection": {
|
|
442
|
+
"type": "string",
|
|
443
|
+
"format": "nsid",
|
|
444
|
+
"description": "The NSID of the record collection."
|
|
445
|
+
},
|
|
446
|
+
"rkey": {
|
|
447
|
+
"type": "string",
|
|
448
|
+
"format": "record-key",
|
|
449
|
+
"description": "The Record Key."
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
"output": {
|
|
455
|
+
"encoding": "application/json",
|
|
456
|
+
"schema": {
|
|
457
|
+
"type": "object",
|
|
458
|
+
"properties": {}
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
"errors": [{ "name": "SpaceNotFound" }]
|
|
462
|
+
} }
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region lexicons/space/getBlob.json
|
|
467
|
+
var getBlob_default = {
|
|
468
|
+
lexicon: 1,
|
|
469
|
+
id: "com.atproto.space.getBlob",
|
|
470
|
+
defs: { "main": {
|
|
471
|
+
"type": "query",
|
|
472
|
+
"description": "Get a blob referenced from a record in a permissioned space. Returns the full blob as originally uploaded. Blobs are not uploaded through this namespace: a space record references a blob uploaded via com.atproto.repo.uploadBlob, so a client writing blob-bearing records into a space needs a blob permission alongside its space permission. Use listBlobs to enumerate a repo's blobs in a space. Callable with either OAuth (for the authenticated user's own data) or a space credential (for syncing services).",
|
|
473
|
+
"parameters": {
|
|
474
|
+
"type": "params",
|
|
475
|
+
"required": [
|
|
476
|
+
"space",
|
|
477
|
+
"repo",
|
|
478
|
+
"cid"
|
|
479
|
+
],
|
|
480
|
+
"properties": {
|
|
481
|
+
"space": {
|
|
482
|
+
"type": "string",
|
|
483
|
+
"format": "space-ref",
|
|
484
|
+
"description": "Reference to the space."
|
|
485
|
+
},
|
|
486
|
+
"repo": {
|
|
487
|
+
"type": "string",
|
|
488
|
+
"format": "did",
|
|
489
|
+
"description": "The DID of the account whose repo holds the blob."
|
|
490
|
+
},
|
|
491
|
+
"cid": {
|
|
492
|
+
"type": "string",
|
|
493
|
+
"format": "cid",
|
|
494
|
+
"description": "The CID of the blob to fetch."
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
"output": { "encoding": "*/*" },
|
|
499
|
+
"errors": [
|
|
500
|
+
{ "name": "BlobNotFound" },
|
|
501
|
+
{ "name": "SpaceNotFound" },
|
|
502
|
+
{ "name": "RepoNotFound" },
|
|
503
|
+
{ "name": "RepoTakendown" },
|
|
504
|
+
{ "name": "RepoSuspended" },
|
|
505
|
+
{ "name": "RepoDeactivated" }
|
|
506
|
+
]
|
|
507
|
+
} }
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region lexicons/space/getDelegationToken.json
|
|
512
|
+
var getDelegationToken_default = {
|
|
513
|
+
lexicon: 1,
|
|
514
|
+
id: "com.atproto.space.getDelegationToken",
|
|
515
|
+
defs: { "main": {
|
|
516
|
+
"type": "query",
|
|
517
|
+
"description": "Mint a delegation token for a space, proving the requesting app is acting on the user's behalf. Exchanged with the space authority for a space credential. Served by the requesting user's PDS. Requires OAuth auth.",
|
|
518
|
+
"parameters": {
|
|
519
|
+
"type": "params",
|
|
520
|
+
"required": ["space"],
|
|
521
|
+
"properties": { "space": {
|
|
522
|
+
"type": "string",
|
|
523
|
+
"format": "space-ref",
|
|
524
|
+
"description": "Reference to the space."
|
|
525
|
+
} }
|
|
526
|
+
},
|
|
527
|
+
"output": {
|
|
528
|
+
"encoding": "application/json",
|
|
529
|
+
"schema": {
|
|
530
|
+
"type": "object",
|
|
531
|
+
"required": ["token"],
|
|
532
|
+
"properties": { "token": {
|
|
533
|
+
"type": "string",
|
|
534
|
+
"description": "A signed JWT delegation token."
|
|
535
|
+
} }
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
} }
|
|
539
|
+
};
|
|
540
|
+
|
|
541
|
+
//#endregion
|
|
542
|
+
//#region lexicons/space/getLatestCommit.json
|
|
543
|
+
var getLatestCommit_default = {
|
|
544
|
+
lexicon: 1,
|
|
545
|
+
id: "com.atproto.space.getLatestCommit",
|
|
546
|
+
defs: { "main": {
|
|
547
|
+
"type": "query",
|
|
548
|
+
"description": "Get the current signed commit for an account's permissioned repo within a space. Served by a repo host. Throws RepoNotFound when the account holds no repo in the space, including the case of a member that has never written to it. Callable with either OAuth (for the authenticated user's own data) or a space credential (for syncing services).",
|
|
549
|
+
"parameters": {
|
|
550
|
+
"type": "params",
|
|
551
|
+
"required": ["space", "repo"],
|
|
552
|
+
"properties": {
|
|
553
|
+
"space": {
|
|
554
|
+
"type": "string",
|
|
555
|
+
"format": "space-ref",
|
|
556
|
+
"description": "Reference to the space."
|
|
557
|
+
},
|
|
558
|
+
"repo": {
|
|
559
|
+
"type": "string",
|
|
560
|
+
"format": "did",
|
|
561
|
+
"description": "The DID of the account whose latest commit to retrieve."
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
},
|
|
565
|
+
"output": {
|
|
566
|
+
"encoding": "application/json",
|
|
567
|
+
"schema": {
|
|
568
|
+
"type": "object",
|
|
569
|
+
"properties": { "commit": {
|
|
570
|
+
"type": "ref",
|
|
571
|
+
"ref": "com.atproto.space.defs#signedCommit",
|
|
572
|
+
"description": "The account's current signed commit."
|
|
573
|
+
} },
|
|
574
|
+
"required": ["commit"]
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
"errors": [
|
|
578
|
+
{ "name": "SpaceNotFound" },
|
|
579
|
+
{ "name": "RepoNotFound" },
|
|
580
|
+
{ "name": "RepoTakendown" },
|
|
581
|
+
{ "name": "RepoSuspended" },
|
|
582
|
+
{ "name": "RepoDeactivated" }
|
|
583
|
+
]
|
|
584
|
+
} }
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
//#endregion
|
|
588
|
+
//#region lexicons/space/getRecord.json
|
|
589
|
+
var getRecord_default = {
|
|
590
|
+
lexicon: 1,
|
|
591
|
+
id: "com.atproto.space.getRecord",
|
|
592
|
+
defs: { "main": {
|
|
593
|
+
"type": "query",
|
|
594
|
+
"description": "Get a single record from a permissioned space. Callable with either OAuth (for the authenticated user's own data) or a space credential (for syncing services). Throws RepoNotFound when the account holds no repo in the space; this does not distinguish a member that has never written from a non-member.",
|
|
595
|
+
"parameters": {
|
|
596
|
+
"type": "params",
|
|
597
|
+
"required": [
|
|
598
|
+
"space",
|
|
599
|
+
"repo",
|
|
600
|
+
"collection",
|
|
601
|
+
"rkey"
|
|
602
|
+
],
|
|
603
|
+
"properties": {
|
|
604
|
+
"space": {
|
|
605
|
+
"type": "string",
|
|
606
|
+
"format": "space-ref",
|
|
607
|
+
"description": "Reference to the space."
|
|
608
|
+
},
|
|
609
|
+
"repo": {
|
|
610
|
+
"type": "string",
|
|
611
|
+
"format": "did",
|
|
612
|
+
"description": "The DID of the account whose repo to read from."
|
|
613
|
+
},
|
|
614
|
+
"collection": {
|
|
615
|
+
"type": "string",
|
|
616
|
+
"format": "nsid",
|
|
617
|
+
"description": "The NSID of the record collection."
|
|
618
|
+
},
|
|
619
|
+
"rkey": {
|
|
620
|
+
"type": "string",
|
|
621
|
+
"format": "record-key",
|
|
622
|
+
"description": "The Record Key."
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
"output": {
|
|
627
|
+
"encoding": "application/json",
|
|
628
|
+
"schema": {
|
|
629
|
+
"type": "object",
|
|
630
|
+
"required": [
|
|
631
|
+
"uri",
|
|
632
|
+
"cid",
|
|
633
|
+
"value"
|
|
634
|
+
],
|
|
635
|
+
"properties": {
|
|
636
|
+
"uri": {
|
|
637
|
+
"type": "string",
|
|
638
|
+
"format": "at-uri"
|
|
639
|
+
},
|
|
640
|
+
"cid": {
|
|
641
|
+
"type": "string",
|
|
642
|
+
"format": "cid"
|
|
643
|
+
},
|
|
644
|
+
"value": { "type": "unknown" }
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
"errors": [
|
|
649
|
+
{ "name": "RecordNotFound" },
|
|
650
|
+
{ "name": "SpaceNotFound" },
|
|
651
|
+
{ "name": "RepoNotFound" },
|
|
652
|
+
{ "name": "RepoTakendown" },
|
|
653
|
+
{ "name": "RepoSuspended" },
|
|
654
|
+
{ "name": "RepoDeactivated" }
|
|
655
|
+
]
|
|
656
|
+
} }
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
//#endregion
|
|
660
|
+
//#region lexicons/space/getRepo.json
|
|
661
|
+
var getRepo_default = {
|
|
662
|
+
lexicon: 1,
|
|
663
|
+
id: "com.atproto.space.getRepo",
|
|
664
|
+
defs: { "main": {
|
|
665
|
+
"type": "query",
|
|
666
|
+
"description": "Download an account's permissioned repo within a space as a CAR file, for full-state recovery. The CAR declares two roots in order: the signed commit, then a DRISL (DAG-CBOR) index mapping '{collection}/{rkey}' to record CID. Record blocks follow, in the same canonical DAG-CBOR key order as the index (length-first, then bytewise). Blobs are not included and are fetched separately via getBlob. Served by a repo host. Callable with either OAuth (for the authenticated user's own data) or a space credential (for syncing services).",
|
|
667
|
+
"parameters": {
|
|
668
|
+
"type": "params",
|
|
669
|
+
"required": ["space", "repo"],
|
|
670
|
+
"properties": {
|
|
671
|
+
"space": {
|
|
672
|
+
"type": "string",
|
|
673
|
+
"format": "space-ref",
|
|
674
|
+
"description": "Reference to the space."
|
|
675
|
+
},
|
|
676
|
+
"repo": {
|
|
677
|
+
"type": "string",
|
|
678
|
+
"format": "did",
|
|
679
|
+
"description": "The DID of the account whose repo to download."
|
|
680
|
+
},
|
|
681
|
+
"excludeValues": {
|
|
682
|
+
"type": "boolean",
|
|
683
|
+
"default": false,
|
|
684
|
+
"description": "If true, omit the record blocks and return only the commit and index roots. The index is still fully authenticated by folding its entries into a set hash and comparing against the commit, so a syncer can diff it against a local copy and fetch just the records it lacks. Note the resulting CAR declares two roots and carries no non-root blocks."
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
},
|
|
688
|
+
"output": { "encoding": "application/vnd.ipld.car" },
|
|
689
|
+
"errors": [
|
|
690
|
+
{ "name": "SpaceNotFound" },
|
|
691
|
+
{ "name": "RepoNotFound" },
|
|
692
|
+
{ "name": "RepoTakendown" },
|
|
693
|
+
{ "name": "RepoSuspended" },
|
|
694
|
+
{ "name": "RepoDeactivated" }
|
|
695
|
+
]
|
|
696
|
+
} }
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
//#endregion
|
|
700
|
+
//#region lexicons/space/getSpaceCredential.json
|
|
701
|
+
var getSpaceCredential_default = {
|
|
702
|
+
lexicon: 1,
|
|
703
|
+
id: "com.atproto.space.getSpaceCredential",
|
|
704
|
+
defs: { "main": {
|
|
705
|
+
"type": "procedure",
|
|
706
|
+
"description": "Exchange a delegation token for a space credential. Called on the space authority, with the delegation token as the request's authorization token and a DPoP proof signed by the key to bind the credential to. The resulting space credential reads repos across the space. Requires a delegation token and DPoP proof, plus a client attestation when the space gates on app identity.",
|
|
707
|
+
"input": {
|
|
708
|
+
"encoding": "application/json",
|
|
709
|
+
"schema": {
|
|
710
|
+
"type": "object",
|
|
711
|
+
"required": ["space"],
|
|
712
|
+
"properties": {
|
|
713
|
+
"space": {
|
|
714
|
+
"type": "string",
|
|
715
|
+
"format": "space-ref",
|
|
716
|
+
"description": "Reference to the space."
|
|
717
|
+
},
|
|
718
|
+
"clientAttestation": {
|
|
719
|
+
"type": "string",
|
|
720
|
+
"description": "Optional client attestation JWT establishing the app's identity. Required only when the space gates on app identity."
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
},
|
|
725
|
+
"output": {
|
|
726
|
+
"encoding": "application/json",
|
|
727
|
+
"schema": {
|
|
728
|
+
"type": "object",
|
|
729
|
+
"required": ["credential"],
|
|
730
|
+
"properties": { "credential": {
|
|
731
|
+
"type": "string",
|
|
732
|
+
"description": "A signed JWT space credential, bound through its cnf.jkt claim to the key that signed the request's DPoP proof."
|
|
733
|
+
} }
|
|
734
|
+
}
|
|
735
|
+
},
|
|
736
|
+
"errors": [
|
|
737
|
+
{ "name": "SpaceNotFound" },
|
|
738
|
+
{ "name": "SpaceDeleted" },
|
|
739
|
+
{
|
|
740
|
+
"name": "UserNotAuthorized",
|
|
741
|
+
"description": "Refused on the basis of the requesting user."
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"name": "AppNotAuthorized",
|
|
745
|
+
"description": "Refused on the basis of the requesting app."
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"name": "NotAuthorized",
|
|
749
|
+
"description": "Refused without attributing the refusal to the user or the app. Authorities that do not wish to disclose which perimeter failed may return this in place of UserNotAuthorized or AppNotAuthorized."
|
|
750
|
+
},
|
|
751
|
+
{ "name": "InvalidDelegationToken" },
|
|
752
|
+
{ "name": "InvalidClientAttestation" }
|
|
753
|
+
]
|
|
754
|
+
} }
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
//#endregion
|
|
758
|
+
//#region lexicons/space/listBlobs.json
|
|
759
|
+
var listBlobs_default = {
|
|
760
|
+
lexicon: 1,
|
|
761
|
+
id: "com.atproto.space.listBlobs",
|
|
762
|
+
defs: { "main": {
|
|
763
|
+
"type": "query",
|
|
764
|
+
"description": "List the CIDs of blobs referenced by an account's records within a permissioned space, optionally since some revision of that repo. Lets a syncer discover which blobs to fetch via getBlob, and lets an account enumerate the blobs it must carry when migrating a permissioned repo. Scoped to one space: blobs behind permissioned records are never enumerated by com.atproto.sync.listBlobs, which is unauthenticated. Callable with either OAuth (for the authenticated user's own data) or a space credential (for syncing services).",
|
|
765
|
+
"parameters": {
|
|
766
|
+
"type": "params",
|
|
767
|
+
"required": ["space", "repo"],
|
|
768
|
+
"properties": {
|
|
769
|
+
"space": {
|
|
770
|
+
"type": "string",
|
|
771
|
+
"format": "space-ref",
|
|
772
|
+
"description": "Reference to the space."
|
|
773
|
+
},
|
|
774
|
+
"repo": {
|
|
775
|
+
"type": "string",
|
|
776
|
+
"format": "did",
|
|
777
|
+
"description": "The DID of the account whose blobs to list."
|
|
778
|
+
},
|
|
779
|
+
"since": {
|
|
780
|
+
"type": "string",
|
|
781
|
+
"format": "tid",
|
|
782
|
+
"description": "Optional revision of the permissioned repo to list blobs since."
|
|
783
|
+
},
|
|
784
|
+
"limit": {
|
|
785
|
+
"type": "integer",
|
|
786
|
+
"minimum": 1,
|
|
787
|
+
"maximum": 1e3,
|
|
788
|
+
"default": 500
|
|
789
|
+
},
|
|
790
|
+
"cursor": { "type": "string" }
|
|
791
|
+
}
|
|
792
|
+
},
|
|
793
|
+
"output": {
|
|
794
|
+
"encoding": "application/json",
|
|
795
|
+
"schema": {
|
|
796
|
+
"type": "object",
|
|
797
|
+
"required": ["cids"],
|
|
798
|
+
"properties": {
|
|
799
|
+
"cursor": { "type": "string" },
|
|
800
|
+
"cids": {
|
|
801
|
+
"type": "array",
|
|
802
|
+
"items": {
|
|
803
|
+
"type": "string",
|
|
804
|
+
"format": "cid"
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
},
|
|
810
|
+
"errors": [
|
|
811
|
+
{ "name": "SpaceNotFound" },
|
|
812
|
+
{ "name": "RepoNotFound" },
|
|
813
|
+
{ "name": "RepoTakendown" },
|
|
814
|
+
{ "name": "RepoSuspended" },
|
|
815
|
+
{ "name": "RepoDeactivated" }
|
|
816
|
+
]
|
|
817
|
+
} }
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
//#endregion
|
|
821
|
+
//#region lexicons/space/listRecords.json
|
|
822
|
+
var listRecords_default = {
|
|
823
|
+
lexicon: 1,
|
|
824
|
+
id: "com.atproto.space.listRecords",
|
|
825
|
+
defs: {
|
|
826
|
+
"main": {
|
|
827
|
+
"type": "query",
|
|
828
|
+
"description": "List the records in an account's repo within a permissioned space, optionally filtered by collection. By default each record's value is inlined; set excludeValues for a metadata-only listing (collection, rkey, cid). Used for full-state recovery. Callable with either OAuth (for the authenticated user's own data) or a space credential (for syncing services). Throws RepoNotFound when the account holds no repo in the space; this does not distinguish a member that has never written from a non-member.",
|
|
829
|
+
"parameters": {
|
|
830
|
+
"type": "params",
|
|
831
|
+
"required": ["space", "repo"],
|
|
832
|
+
"properties": {
|
|
833
|
+
"space": {
|
|
834
|
+
"type": "string",
|
|
835
|
+
"format": "space-ref",
|
|
836
|
+
"description": "Reference to the space."
|
|
837
|
+
},
|
|
838
|
+
"repo": {
|
|
839
|
+
"type": "string",
|
|
840
|
+
"format": "did",
|
|
841
|
+
"description": "The DID of the account whose repo to list."
|
|
842
|
+
},
|
|
843
|
+
"collection": {
|
|
844
|
+
"type": "string",
|
|
845
|
+
"format": "nsid",
|
|
846
|
+
"description": "The NSID of the record collection. If omitted, lists records across all collections."
|
|
847
|
+
},
|
|
848
|
+
"limit": {
|
|
849
|
+
"type": "integer",
|
|
850
|
+
"minimum": 1,
|
|
851
|
+
"maximum": 1e3,
|
|
852
|
+
"default": 50,
|
|
853
|
+
"description": "The number of records to return."
|
|
854
|
+
},
|
|
855
|
+
"cursor": { "type": "string" },
|
|
856
|
+
"reverse": {
|
|
857
|
+
"type": "boolean",
|
|
858
|
+
"description": "Flag to reverse the order of the returned records."
|
|
859
|
+
},
|
|
860
|
+
"excludeValues": {
|
|
861
|
+
"type": "boolean",
|
|
862
|
+
"default": false,
|
|
863
|
+
"description": "If true, omit inlined record values and return only metadata (collection, rkey, cid)."
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
},
|
|
867
|
+
"output": {
|
|
868
|
+
"encoding": "application/json",
|
|
869
|
+
"schema": {
|
|
870
|
+
"type": "object",
|
|
871
|
+
"required": ["records"],
|
|
872
|
+
"properties": {
|
|
873
|
+
"cursor": { "type": "string" },
|
|
874
|
+
"records": {
|
|
875
|
+
"type": "array",
|
|
876
|
+
"items": {
|
|
877
|
+
"type": "ref",
|
|
878
|
+
"ref": "#record"
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
},
|
|
884
|
+
"errors": [
|
|
885
|
+
{ "name": "SpaceNotFound" },
|
|
886
|
+
{ "name": "RepoNotFound" },
|
|
887
|
+
{ "name": "RepoTakendown" },
|
|
888
|
+
{ "name": "RepoSuspended" },
|
|
889
|
+
{ "name": "RepoDeactivated" }
|
|
890
|
+
]
|
|
891
|
+
},
|
|
892
|
+
"record": {
|
|
893
|
+
"type": "object",
|
|
894
|
+
"required": [
|
|
895
|
+
"collection",
|
|
896
|
+
"rkey",
|
|
897
|
+
"cid"
|
|
898
|
+
],
|
|
899
|
+
"properties": {
|
|
900
|
+
"collection": {
|
|
901
|
+
"type": "string",
|
|
902
|
+
"format": "nsid"
|
|
903
|
+
},
|
|
904
|
+
"rkey": {
|
|
905
|
+
"type": "string",
|
|
906
|
+
"format": "record-key"
|
|
907
|
+
},
|
|
908
|
+
"cid": {
|
|
909
|
+
"type": "string",
|
|
910
|
+
"format": "cid"
|
|
911
|
+
},
|
|
912
|
+
"value": {
|
|
913
|
+
"type": "unknown",
|
|
914
|
+
"description": "The record's value. Inlined by default; omitted when excludeValues is set."
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
//#endregion
|
|
922
|
+
//#region lexicons/space/listRepoOps.json
|
|
923
|
+
var listRepoOps_default = {
|
|
924
|
+
lexicon: 1,
|
|
925
|
+
id: "com.atproto.space.listRepoOps",
|
|
926
|
+
defs: {
|
|
927
|
+
"main": {
|
|
928
|
+
"type": "query",
|
|
929
|
+
"description": "List the operation log for an account's permissioned repo within a space, returning operations after a given revision. Primary incremental sync mechanism. By default each created or updated operation inlines the record's current value; set excludeValues for metadata-only entries. Note the oplog is a transport optimization with no history guarantee: a host may compact it or drop it, and it does not survive account migration, so omitting `since` returns the retained window rather than the repo's full history. Use getRepo for an initial sync or when a `since` revision is no longer available. Callable with either OAuth (for the authenticated user's own data) or a space credential (for syncing services).",
|
|
930
|
+
"parameters": {
|
|
931
|
+
"type": "params",
|
|
932
|
+
"required": ["space", "repo"],
|
|
933
|
+
"properties": {
|
|
934
|
+
"space": {
|
|
935
|
+
"type": "string",
|
|
936
|
+
"format": "space-ref",
|
|
937
|
+
"description": "Reference to the space."
|
|
938
|
+
},
|
|
939
|
+
"repo": {
|
|
940
|
+
"type": "string",
|
|
941
|
+
"format": "did",
|
|
942
|
+
"description": "The DID of the account whose oplog to retrieve."
|
|
943
|
+
},
|
|
944
|
+
"since": {
|
|
945
|
+
"type": "string",
|
|
946
|
+
"format": "tid",
|
|
947
|
+
"description": "Return operations after this revision. The caller's own sync position; use `cursor` to continue a paginated response."
|
|
948
|
+
},
|
|
949
|
+
"limit": {
|
|
950
|
+
"type": "integer",
|
|
951
|
+
"minimum": 1,
|
|
952
|
+
"maximum": 1e3,
|
|
953
|
+
"default": 100,
|
|
954
|
+
"description": "Maximum number of operations to return."
|
|
955
|
+
},
|
|
956
|
+
"cursor": {
|
|
957
|
+
"type": "string",
|
|
958
|
+
"description": "Opaque pagination cursor from a previous response. Takes precedence over `since` when both are supplied."
|
|
959
|
+
},
|
|
960
|
+
"excludeValues": {
|
|
961
|
+
"type": "boolean",
|
|
962
|
+
"default": false,
|
|
963
|
+
"description": "If true, omit inlined record values and return only operation metadata."
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
},
|
|
967
|
+
"output": {
|
|
968
|
+
"encoding": "application/json",
|
|
969
|
+
"schema": {
|
|
970
|
+
"type": "object",
|
|
971
|
+
"required": ["ops"],
|
|
972
|
+
"properties": {
|
|
973
|
+
"ops": {
|
|
974
|
+
"type": "array",
|
|
975
|
+
"items": {
|
|
976
|
+
"type": "ref",
|
|
977
|
+
"ref": "#opEntry"
|
|
978
|
+
}
|
|
979
|
+
},
|
|
980
|
+
"commit": {
|
|
981
|
+
"type": "ref",
|
|
982
|
+
"ref": "com.atproto.space.defs#signedCommit",
|
|
983
|
+
"description": "The account's current signed commit. Included when the response reaches the head of the oplog; omitted on backfill responses."
|
|
984
|
+
},
|
|
985
|
+
"cursor": {
|
|
986
|
+
"type": "string",
|
|
987
|
+
"description": "Pass as `cursor` to fetch the next page. Absent once the response reaches the head of the oplog."
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
},
|
|
992
|
+
"errors": [
|
|
993
|
+
{ "name": "SpaceNotFound" },
|
|
994
|
+
{ "name": "RepoNotFound" },
|
|
995
|
+
{ "name": "RepoTakendown" },
|
|
996
|
+
{ "name": "RepoSuspended" },
|
|
997
|
+
{ "name": "RepoDeactivated" }
|
|
998
|
+
]
|
|
999
|
+
},
|
|
1000
|
+
"opEntry": {
|
|
1001
|
+
"type": "object",
|
|
1002
|
+
"description": "A single operation in a permissioned repo's oplog. cid is null for deletes; prev is null for creates. Operations sharing the same rev belong to the same batch. value carries the record's current value for creates and updates, unless excludeValues was set or the value is stale (superseded by a later operation).",
|
|
1003
|
+
"required": [
|
|
1004
|
+
"rev",
|
|
1005
|
+
"collection",
|
|
1006
|
+
"rkey",
|
|
1007
|
+
"cid",
|
|
1008
|
+
"prev"
|
|
1009
|
+
],
|
|
1010
|
+
"nullable": ["cid", "prev"],
|
|
1011
|
+
"properties": {
|
|
1012
|
+
"rev": {
|
|
1013
|
+
"type": "string",
|
|
1014
|
+
"format": "tid"
|
|
1015
|
+
},
|
|
1016
|
+
"collection": {
|
|
1017
|
+
"type": "string",
|
|
1018
|
+
"format": "nsid"
|
|
1019
|
+
},
|
|
1020
|
+
"rkey": {
|
|
1021
|
+
"type": "string",
|
|
1022
|
+
"format": "record-key"
|
|
1023
|
+
},
|
|
1024
|
+
"cid": {
|
|
1025
|
+
"type": "string",
|
|
1026
|
+
"format": "cid"
|
|
1027
|
+
},
|
|
1028
|
+
"prev": {
|
|
1029
|
+
"type": "string",
|
|
1030
|
+
"format": "cid"
|
|
1031
|
+
},
|
|
1032
|
+
"value": {
|
|
1033
|
+
"type": "unknown",
|
|
1034
|
+
"description": "The record's current value, inlined for create and update operations. Omitted when excludeValues is set, for deletes, or when the value has been superseded by a later operation."
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
|
|
1041
|
+
//#endregion
|
|
1042
|
+
//#region lexicons/space/listRepos.json
|
|
1043
|
+
var listRepos_default = {
|
|
1044
|
+
lexicon: 1,
|
|
1045
|
+
id: "com.atproto.space.listRepos",
|
|
1046
|
+
defs: {
|
|
1047
|
+
"main": {
|
|
1048
|
+
"type": "query",
|
|
1049
|
+
"description": "List the known repos that hold data in a space (the writer set), with each repo's current rev and commit hash. Served by the space host. This is the sync boundary, not an access-control list: it enumerates only writers, never readers. The set is what the authority claims from write notifications and is not itself authoritative; a repo's host is the source of truth.",
|
|
1050
|
+
"parameters": {
|
|
1051
|
+
"type": "params",
|
|
1052
|
+
"required": ["space"],
|
|
1053
|
+
"properties": {
|
|
1054
|
+
"space": {
|
|
1055
|
+
"type": "string",
|
|
1056
|
+
"format": "space-ref",
|
|
1057
|
+
"description": "Reference to the space."
|
|
1058
|
+
},
|
|
1059
|
+
"limit": {
|
|
1060
|
+
"type": "integer",
|
|
1061
|
+
"minimum": 1,
|
|
1062
|
+
"maximum": 1e3,
|
|
1063
|
+
"default": 100,
|
|
1064
|
+
"description": "Maximum number of repos to return."
|
|
1065
|
+
},
|
|
1066
|
+
"cursor": { "type": "string" }
|
|
1067
|
+
}
|
|
1068
|
+
},
|
|
1069
|
+
"output": {
|
|
1070
|
+
"encoding": "application/json",
|
|
1071
|
+
"schema": {
|
|
1072
|
+
"type": "object",
|
|
1073
|
+
"required": ["repos"],
|
|
1074
|
+
"properties": {
|
|
1075
|
+
"cursor": { "type": "string" },
|
|
1076
|
+
"repos": {
|
|
1077
|
+
"type": "array",
|
|
1078
|
+
"items": {
|
|
1079
|
+
"type": "ref",
|
|
1080
|
+
"ref": "#repo"
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
},
|
|
1086
|
+
"errors": [{ "name": "SpaceNotFound" }]
|
|
1087
|
+
},
|
|
1088
|
+
"repo": {
|
|
1089
|
+
"type": "object",
|
|
1090
|
+
"required": [
|
|
1091
|
+
"did",
|
|
1092
|
+
"rev",
|
|
1093
|
+
"hash"
|
|
1094
|
+
],
|
|
1095
|
+
"properties": {
|
|
1096
|
+
"did": {
|
|
1097
|
+
"type": "string",
|
|
1098
|
+
"format": "did",
|
|
1099
|
+
"description": "The DID of a repo that holds data in the space."
|
|
1100
|
+
},
|
|
1101
|
+
"rev": {
|
|
1102
|
+
"type": "string",
|
|
1103
|
+
"description": "The repo's current revision (TID), as last reported to the authority. May lag the repo host, which is the source of truth.",
|
|
1104
|
+
"format": "tid"
|
|
1105
|
+
},
|
|
1106
|
+
"hash": {
|
|
1107
|
+
"type": "bytes",
|
|
1108
|
+
"description": "The repo's current commit hash (sha256 of the LtHash state), as last reported to the authority."
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
};
|
|
1114
|
+
|
|
1115
|
+
//#endregion
|
|
1116
|
+
//#region lexicons/space/listSpaces.json
|
|
1117
|
+
var listSpaces_default = {
|
|
1118
|
+
lexicon: 1,
|
|
1119
|
+
id: "com.atproto.space.listSpaces",
|
|
1120
|
+
defs: {
|
|
1121
|
+
"main": {
|
|
1122
|
+
"type": "query",
|
|
1123
|
+
"description": "List the spaces the authenticated user holds a repo in (i.e. spaces the user has written data to), optionally filtered by type and/or authority DID. Note this is not 'spaces I'm a member of' — a member's PDS only tracks spaces its user has written to. Requires auth, implemented by PDS.",
|
|
1124
|
+
"parameters": {
|
|
1125
|
+
"type": "params",
|
|
1126
|
+
"properties": {
|
|
1127
|
+
"type": {
|
|
1128
|
+
"type": "string",
|
|
1129
|
+
"format": "nsid",
|
|
1130
|
+
"description": "Filter to spaces of this type."
|
|
1131
|
+
},
|
|
1132
|
+
"did": {
|
|
1133
|
+
"type": "string",
|
|
1134
|
+
"format": "did",
|
|
1135
|
+
"description": "Filter to spaces under this authority DID."
|
|
1136
|
+
},
|
|
1137
|
+
"limit": {
|
|
1138
|
+
"type": "integer",
|
|
1139
|
+
"minimum": 1,
|
|
1140
|
+
"maximum": 100,
|
|
1141
|
+
"default": 50,
|
|
1142
|
+
"description": "The number of spaces to return."
|
|
1143
|
+
},
|
|
1144
|
+
"cursor": { "type": "string" }
|
|
1145
|
+
}
|
|
1146
|
+
},
|
|
1147
|
+
"output": {
|
|
1148
|
+
"encoding": "application/json",
|
|
1149
|
+
"schema": {
|
|
1150
|
+
"type": "object",
|
|
1151
|
+
"required": ["spaces"],
|
|
1152
|
+
"properties": {
|
|
1153
|
+
"cursor": { "type": "string" },
|
|
1154
|
+
"spaces": {
|
|
1155
|
+
"type": "array",
|
|
1156
|
+
"items": {
|
|
1157
|
+
"type": "ref",
|
|
1158
|
+
"ref": "#spaceView"
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
},
|
|
1165
|
+
"spaceView": {
|
|
1166
|
+
"type": "object",
|
|
1167
|
+
"required": ["uri"],
|
|
1168
|
+
"properties": { "uri": {
|
|
1169
|
+
"type": "string",
|
|
1170
|
+
"format": "space-ref",
|
|
1171
|
+
"description": "URI of the space."
|
|
1172
|
+
} }
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
};
|
|
1176
|
+
|
|
1177
|
+
//#endregion
|
|
1178
|
+
//#region lexicons/space/notifySpaceDeleted.json
|
|
1179
|
+
var notifySpaceDeleted_default = {
|
|
1180
|
+
lexicon: 1,
|
|
1181
|
+
id: "com.atproto.space.notifySpaceDeleted",
|
|
1182
|
+
defs: { "main": {
|
|
1183
|
+
"type": "procedure",
|
|
1184
|
+
"description": "Notify a syncing service that a space has been deleted, and that it should drop every copy of the space's data it holds. Sent by the space authority to the services registered for the space, best-effort. Authenticated with service auth addressed to the receiving service.",
|
|
1185
|
+
"input": {
|
|
1186
|
+
"encoding": "application/json",
|
|
1187
|
+
"schema": {
|
|
1188
|
+
"type": "object",
|
|
1189
|
+
"required": ["space"],
|
|
1190
|
+
"properties": { "space": {
|
|
1191
|
+
"type": "string",
|
|
1192
|
+
"format": "space-ref",
|
|
1193
|
+
"description": "Reference to the deleted space."
|
|
1194
|
+
} }
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
} }
|
|
1198
|
+
};
|
|
1199
|
+
|
|
1200
|
+
//#endregion
|
|
1201
|
+
//#region lexicons/space/notifyWrite.json
|
|
1202
|
+
var notifyWrite_default = {
|
|
1203
|
+
lexicon: 1,
|
|
1204
|
+
id: "com.atproto.space.notifyWrite",
|
|
1205
|
+
defs: { "main": {
|
|
1206
|
+
"type": "procedure",
|
|
1207
|
+
"description": "Notify that a repo in a space has advanced to a new revision. Sent by a repo host to the space host, and forwarded to registered syncers. Best-effort. Authenticated with service auth.",
|
|
1208
|
+
"input": {
|
|
1209
|
+
"encoding": "application/json",
|
|
1210
|
+
"schema": {
|
|
1211
|
+
"type": "object",
|
|
1212
|
+
"required": [
|
|
1213
|
+
"space",
|
|
1214
|
+
"repo",
|
|
1215
|
+
"rev",
|
|
1216
|
+
"hash"
|
|
1217
|
+
],
|
|
1218
|
+
"properties": {
|
|
1219
|
+
"space": {
|
|
1220
|
+
"type": "string",
|
|
1221
|
+
"format": "space-ref",
|
|
1222
|
+
"description": "Reference to the space."
|
|
1223
|
+
},
|
|
1224
|
+
"repo": {
|
|
1225
|
+
"type": "string",
|
|
1226
|
+
"format": "did",
|
|
1227
|
+
"description": "The DID of the account whose repo advanced."
|
|
1228
|
+
},
|
|
1229
|
+
"rev": {
|
|
1230
|
+
"type": "string",
|
|
1231
|
+
"description": "The revision of the write.",
|
|
1232
|
+
"format": "tid"
|
|
1233
|
+
},
|
|
1234
|
+
"hash": {
|
|
1235
|
+
"type": "bytes",
|
|
1236
|
+
"description": "The repo's current commit hash (sha256 of the LtHash state) after the write. Lets the space host maintain each repo's hash for listRepos."
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
} }
|
|
1242
|
+
};
|
|
1243
|
+
|
|
1244
|
+
//#endregion
|
|
1245
|
+
//#region lexicons/space/putRecord.json
|
|
1246
|
+
var putRecord_default = {
|
|
1247
|
+
lexicon: 1,
|
|
1248
|
+
id: "com.atproto.space.putRecord",
|
|
1249
|
+
defs: { "main": {
|
|
1250
|
+
"type": "procedure",
|
|
1251
|
+
"description": "Write a record in a permissioned space, creating or updating it as needed. Requires auth, implemented by PDS.",
|
|
1252
|
+
"input": {
|
|
1253
|
+
"encoding": "application/json",
|
|
1254
|
+
"schema": {
|
|
1255
|
+
"type": "object",
|
|
1256
|
+
"required": [
|
|
1257
|
+
"space",
|
|
1258
|
+
"repo",
|
|
1259
|
+
"collection",
|
|
1260
|
+
"rkey",
|
|
1261
|
+
"record"
|
|
1262
|
+
],
|
|
1263
|
+
"properties": {
|
|
1264
|
+
"space": {
|
|
1265
|
+
"type": "string",
|
|
1266
|
+
"format": "space-ref",
|
|
1267
|
+
"description": "Reference to the space."
|
|
1268
|
+
},
|
|
1269
|
+
"repo": {
|
|
1270
|
+
"type": "string",
|
|
1271
|
+
"format": "did",
|
|
1272
|
+
"description": "The DID of the repo to write to (the authenticated member)."
|
|
1273
|
+
},
|
|
1274
|
+
"collection": {
|
|
1275
|
+
"type": "string",
|
|
1276
|
+
"format": "nsid",
|
|
1277
|
+
"description": "The NSID of the record collection."
|
|
1278
|
+
},
|
|
1279
|
+
"rkey": {
|
|
1280
|
+
"type": "string",
|
|
1281
|
+
"format": "record-key",
|
|
1282
|
+
"description": "The Record Key.",
|
|
1283
|
+
"maxLength": 512
|
|
1284
|
+
},
|
|
1285
|
+
"validate": {
|
|
1286
|
+
"type": "boolean",
|
|
1287
|
+
"description": "Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons."
|
|
1288
|
+
},
|
|
1289
|
+
"record": {
|
|
1290
|
+
"type": "unknown",
|
|
1291
|
+
"description": "The record to write."
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
},
|
|
1296
|
+
"output": {
|
|
1297
|
+
"encoding": "application/json",
|
|
1298
|
+
"schema": {
|
|
1299
|
+
"type": "object",
|
|
1300
|
+
"required": ["uri", "cid"],
|
|
1301
|
+
"properties": {
|
|
1302
|
+
"uri": {
|
|
1303
|
+
"type": "string",
|
|
1304
|
+
"format": "at-uri",
|
|
1305
|
+
"description": "URI of the written record."
|
|
1306
|
+
},
|
|
1307
|
+
"cid": {
|
|
1308
|
+
"type": "string",
|
|
1309
|
+
"format": "cid"
|
|
1310
|
+
},
|
|
1311
|
+
"validationStatus": {
|
|
1312
|
+
"type": "string",
|
|
1313
|
+
"knownValues": ["valid", "unknown"]
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
"errors": [{ "name": "SpaceNotFound" }]
|
|
1319
|
+
} }
|
|
1320
|
+
};
|
|
1321
|
+
|
|
1322
|
+
//#endregion
|
|
1323
|
+
//#region lexicons/space/registerNotify.json
|
|
1324
|
+
var registerNotify_default = {
|
|
1325
|
+
lexicon: 1,
|
|
1326
|
+
id: "com.atproto.space.registerNotify",
|
|
1327
|
+
defs: { "main": {
|
|
1328
|
+
"type": "procedure",
|
|
1329
|
+
"description": "Register a service to be notified of writes to any repo in a space. Called on the space host. The registering service is named by its service identifier rather than a bare URL, because notifyWrite is delivered with service auth addressed to that identifier; the delivery endpoint is resolved from the service's DID document. Authenticated with a space credential. Re-registering an existing service replaces its registration and extends the expiry.",
|
|
1330
|
+
"input": {
|
|
1331
|
+
"encoding": "application/json",
|
|
1332
|
+
"schema": {
|
|
1333
|
+
"type": "object",
|
|
1334
|
+
"required": ["space", "service"],
|
|
1335
|
+
"properties": {
|
|
1336
|
+
"space": {
|
|
1337
|
+
"type": "string",
|
|
1338
|
+
"format": "space-ref",
|
|
1339
|
+
"description": "Reference to the space."
|
|
1340
|
+
},
|
|
1341
|
+
"service": {
|
|
1342
|
+
"type": "string",
|
|
1343
|
+
"description": "Service identifier of the subscriber: a DID with an optional service fragment naming the entry in its DID document to deliver to (e.g. 'did:web:syncer.example.com#atproto_space_syncer'). notifyWrite calls are addressed to this identifier."
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
},
|
|
1348
|
+
"output": {
|
|
1349
|
+
"encoding": "application/json",
|
|
1350
|
+
"schema": {
|
|
1351
|
+
"type": "object",
|
|
1352
|
+
"required": ["expiresAt"],
|
|
1353
|
+
"properties": { "expiresAt": {
|
|
1354
|
+
"type": "string",
|
|
1355
|
+
"format": "datetime",
|
|
1356
|
+
"description": "When the registration expires. May be later than the expiry of the space credential the request was authenticated with; renew before this time to stay subscribed."
|
|
1357
|
+
} }
|
|
1358
|
+
}
|
|
1359
|
+
},
|
|
1360
|
+
"errors": [{ "name": "SpaceNotFound" }, {
|
|
1361
|
+
"name": "ServiceNotResolvable",
|
|
1362
|
+
"description": "The service identifier could not be resolved to a DID document with a matching service endpoint."
|
|
1363
|
+
}]
|
|
1364
|
+
} }
|
|
1365
|
+
};
|
|
1366
|
+
|
|
1367
|
+
//#endregion
|
|
1368
|
+
//#region lexicons/space/unregisterNotify.json
|
|
1369
|
+
var unregisterNotify_default = {
|
|
1370
|
+
lexicon: 1,
|
|
1371
|
+
id: "com.atproto.space.unregisterNotify",
|
|
1372
|
+
defs: { "main": {
|
|
1373
|
+
"type": "procedure",
|
|
1374
|
+
"description": "Withdraw a write-notification registration made through registerNotify. Called on the space host. Idempotent: succeeds whether or not a matching registration existed. Registrations also lapse on their own at the expiry returned by registerNotify, so this is for explicit withdrawal rather than cleanup. Authenticated with a space credential.",
|
|
1375
|
+
"input": {
|
|
1376
|
+
"encoding": "application/json",
|
|
1377
|
+
"schema": {
|
|
1378
|
+
"type": "object",
|
|
1379
|
+
"required": ["space", "service"],
|
|
1380
|
+
"properties": {
|
|
1381
|
+
"space": {
|
|
1382
|
+
"type": "string",
|
|
1383
|
+
"format": "space-ref",
|
|
1384
|
+
"description": "Reference to the space."
|
|
1385
|
+
},
|
|
1386
|
+
"service": {
|
|
1387
|
+
"type": "string",
|
|
1388
|
+
"description": "Service identifier of the subscriber to remove, as passed to registerNotify."
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
},
|
|
1393
|
+
"errors": [{ "name": "SpaceNotFound" }]
|
|
1394
|
+
} }
|
|
1395
|
+
};
|
|
1396
|
+
|
|
1397
|
+
//#endregion
|
|
1398
|
+
//#region lexicons/simplespace/addMember.json
|
|
1399
|
+
var addMember_default = {
|
|
1400
|
+
lexicon: 1,
|
|
1401
|
+
id: "com.atproto.simplespace.addMember",
|
|
1402
|
+
defs: { "main": {
|
|
1403
|
+
"type": "procedure",
|
|
1404
|
+
"description": "Add a member to a space's member list. The member list is host-internal state consulted at credential-mint time when the space's policy is 'member-list'. It is not a synced protocol structure and is not enumerated to the network. Requires auth as the space owner.",
|
|
1405
|
+
"input": {
|
|
1406
|
+
"encoding": "application/json",
|
|
1407
|
+
"schema": {
|
|
1408
|
+
"type": "object",
|
|
1409
|
+
"required": ["space", "did"],
|
|
1410
|
+
"properties": {
|
|
1411
|
+
"space": {
|
|
1412
|
+
"type": "string",
|
|
1413
|
+
"format": "space-ref",
|
|
1414
|
+
"description": "Reference to the space."
|
|
1415
|
+
},
|
|
1416
|
+
"did": {
|
|
1417
|
+
"type": "string",
|
|
1418
|
+
"format": "did",
|
|
1419
|
+
"description": "The DID of the member to add."
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
},
|
|
1424
|
+
"errors": [{ "name": "SpaceNotFound" }, { "name": "NotSpaceOwner" }]
|
|
1425
|
+
} }
|
|
1426
|
+
};
|
|
1427
|
+
|
|
1428
|
+
//#endregion
|
|
1429
|
+
//#region lexicons/simplespace/checkUserAccess.json
|
|
1430
|
+
var checkUserAccess_default = {
|
|
1431
|
+
lexicon: 1,
|
|
1432
|
+
id: "com.atproto.simplespace.checkUserAccess",
|
|
1433
|
+
defs: { "main": {
|
|
1434
|
+
"type": "query",
|
|
1435
|
+
"description": "Ask a space's managing app whether to authorize a requesting user for a space credential. Served by the managingApp (not the PDS), called by the space authority at mint time when policy is 'managing-app'. Authenticated with service auth from the authority.",
|
|
1436
|
+
"parameters": {
|
|
1437
|
+
"type": "params",
|
|
1438
|
+
"required": ["space", "user"],
|
|
1439
|
+
"properties": {
|
|
1440
|
+
"space": {
|
|
1441
|
+
"type": "string",
|
|
1442
|
+
"format": "space-ref",
|
|
1443
|
+
"description": "Reference to the space."
|
|
1444
|
+
},
|
|
1445
|
+
"user": {
|
|
1446
|
+
"type": "string",
|
|
1447
|
+
"format": "did",
|
|
1448
|
+
"description": "The DID of the requesting user."
|
|
1449
|
+
},
|
|
1450
|
+
"clientId": {
|
|
1451
|
+
"type": "string",
|
|
1452
|
+
"description": "The attested client_id, if a client attestation was presented."
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
},
|
|
1456
|
+
"output": {
|
|
1457
|
+
"encoding": "application/json",
|
|
1458
|
+
"schema": {
|
|
1459
|
+
"type": "object",
|
|
1460
|
+
"required": ["authorized"],
|
|
1461
|
+
"properties": { "authorized": {
|
|
1462
|
+
"type": "boolean",
|
|
1463
|
+
"description": "Whether the managing app authorizes the request."
|
|
1464
|
+
} }
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
} }
|
|
1468
|
+
};
|
|
1469
|
+
|
|
1470
|
+
//#endregion
|
|
1471
|
+
//#region lexicons/simplespace/createSpace.json
|
|
1472
|
+
var createSpace_default = {
|
|
1473
|
+
lexicon: 1,
|
|
1474
|
+
id: "com.atproto.simplespace.createSpace",
|
|
1475
|
+
defs: { "main": {
|
|
1476
|
+
"type": "procedure",
|
|
1477
|
+
"description": "Create a new space managed by the simplespace implementation. The space is anchored on the authenticated user's DID, who becomes the space owner. Requires auth, implemented by PDS.",
|
|
1478
|
+
"input": {
|
|
1479
|
+
"encoding": "application/json",
|
|
1480
|
+
"schema": {
|
|
1481
|
+
"type": "object",
|
|
1482
|
+
"required": [
|
|
1483
|
+
"type",
|
|
1484
|
+
"policy",
|
|
1485
|
+
"appAccess"
|
|
1486
|
+
],
|
|
1487
|
+
"properties": {
|
|
1488
|
+
"type": {
|
|
1489
|
+
"type": "string",
|
|
1490
|
+
"format": "nsid",
|
|
1491
|
+
"description": "The NSID of the space type, describing the modality of the space (e.g. app.bsky.group, app.bsky.personal)."
|
|
1492
|
+
},
|
|
1493
|
+
"skey": {
|
|
1494
|
+
"type": "string",
|
|
1495
|
+
"format": "record-key",
|
|
1496
|
+
"description": "The space key. Used to differentiate multiple spaces of the same type under the same owner. Same syntax requirements as a record key. If not provided, one will be auto-generated (TID)."
|
|
1497
|
+
},
|
|
1498
|
+
"policy": {
|
|
1499
|
+
"type": "union",
|
|
1500
|
+
"description": "How the authority decides whether to authorize a requesting user.",
|
|
1501
|
+
"refs": [
|
|
1502
|
+
"com.atproto.simplespace.defs#publicPolicy",
|
|
1503
|
+
"com.atproto.simplespace.defs#memberListPolicy",
|
|
1504
|
+
"com.atproto.simplespace.defs#managingAppPolicy"
|
|
1505
|
+
]
|
|
1506
|
+
},
|
|
1507
|
+
"appAccess": {
|
|
1508
|
+
"type": "union",
|
|
1509
|
+
"description": "How the authority decides whether to authorize a requesting app.",
|
|
1510
|
+
"refs": ["com.atproto.simplespace.defs#open", "com.atproto.simplespace.defs#allowList"]
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
},
|
|
1515
|
+
"output": {
|
|
1516
|
+
"encoding": "application/json",
|
|
1517
|
+
"schema": {
|
|
1518
|
+
"type": "object",
|
|
1519
|
+
"required": ["uri"],
|
|
1520
|
+
"properties": { "uri": {
|
|
1521
|
+
"type": "string",
|
|
1522
|
+
"format": "space-ref",
|
|
1523
|
+
"description": "URI of the created space."
|
|
1524
|
+
} }
|
|
1525
|
+
}
|
|
1526
|
+
},
|
|
1527
|
+
"errors": [
|
|
1528
|
+
{
|
|
1529
|
+
"name": "SpaceAlreadyExists",
|
|
1530
|
+
"description": "A space with this owner, type, and skey already exists. A space that was previously deleted may be created again."
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
"name": "UnsupportedPolicy",
|
|
1534
|
+
"description": "The requested policy is not one the host implements."
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
"name": "UnsupportedAppAccess",
|
|
1538
|
+
"description": "The requested appAccess variant is not one the host implements. A host will not store an app access policy it cannot enforce."
|
|
1539
|
+
}
|
|
1540
|
+
]
|
|
1541
|
+
} }
|
|
1542
|
+
};
|
|
1543
|
+
|
|
1544
|
+
//#endregion
|
|
1545
|
+
//#region lexicons/simplespace/defs.json
|
|
1546
|
+
var defs_default = {
|
|
1547
|
+
lexicon: 1,
|
|
1548
|
+
id: "com.atproto.simplespace.defs",
|
|
1549
|
+
defs: {
|
|
1550
|
+
"publicPolicy": {
|
|
1551
|
+
"type": "object",
|
|
1552
|
+
"description": "User access policy: any user may access the space.",
|
|
1553
|
+
"properties": {}
|
|
1554
|
+
},
|
|
1555
|
+
"memberListPolicy": {
|
|
1556
|
+
"type": "object",
|
|
1557
|
+
"description": "User access policy: only users on the space's member list may access it.",
|
|
1558
|
+
"properties": {}
|
|
1559
|
+
},
|
|
1560
|
+
"managingAppPolicy": {
|
|
1561
|
+
"type": "object",
|
|
1562
|
+
"description": "User access policy: the managing app is asked, via checkUserAccess, whether to authorize each user.",
|
|
1563
|
+
"required": ["managingApp"],
|
|
1564
|
+
"properties": { "managingApp": {
|
|
1565
|
+
"type": "string",
|
|
1566
|
+
"description": "Service identifier of the managing app: a DID with an optional service fragment (e.g. 'did:web:example.com#forum')."
|
|
1567
|
+
} }
|
|
1568
|
+
},
|
|
1569
|
+
"open": {
|
|
1570
|
+
"type": "object",
|
|
1571
|
+
"description": "App access policy: any app may access the space. No client attestation required.",
|
|
1572
|
+
"properties": {}
|
|
1573
|
+
},
|
|
1574
|
+
"allowList": {
|
|
1575
|
+
"type": "object",
|
|
1576
|
+
"description": "App access policy: only the named clients may access the space, evaluated against the attested client_id.",
|
|
1577
|
+
"required": ["allowed"],
|
|
1578
|
+
"properties": { "allowed": {
|
|
1579
|
+
"type": "array",
|
|
1580
|
+
"description": "The OAuth client IDs permitted to access the space.",
|
|
1581
|
+
"items": {
|
|
1582
|
+
"type": "string",
|
|
1583
|
+
"description": "An OAuth client ID."
|
|
1584
|
+
}
|
|
1585
|
+
} }
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
};
|
|
1589
|
+
|
|
1590
|
+
//#endregion
|
|
1591
|
+
//#region lexicons/simplespace/deleteSpace.json
|
|
1592
|
+
var deleteSpace_default = {
|
|
1593
|
+
lexicon: 1,
|
|
1594
|
+
id: "com.atproto.simplespace.deleteSpace",
|
|
1595
|
+
defs: { "main": {
|
|
1596
|
+
"type": "procedure",
|
|
1597
|
+
"description": "Delete a space. The authenticated user must be the space owner. The authority's own repo in the space is deleted along with it, since the space host and the repo host are the same service here; other members' repos are flagged as belonging to a deleted space rather than erased. After deletion, all reads and writes against the space fail with SpaceNotFound, and getSpaceCredential answers SpaceDeleted so a syncer that missed the notification still learns to drop its copy. Idempotent. Requires auth, implemented by PDS.",
|
|
1598
|
+
"input": {
|
|
1599
|
+
"encoding": "application/json",
|
|
1600
|
+
"schema": {
|
|
1601
|
+
"type": "object",
|
|
1602
|
+
"required": ["space"],
|
|
1603
|
+
"properties": { "space": {
|
|
1604
|
+
"type": "string",
|
|
1605
|
+
"format": "space-ref",
|
|
1606
|
+
"description": "Reference to the space to delete."
|
|
1607
|
+
} }
|
|
1608
|
+
}
|
|
1609
|
+
},
|
|
1610
|
+
"errors": [{ "name": "SpaceNotFound" }, { "name": "NotSpaceOwner" }]
|
|
1611
|
+
} }
|
|
1612
|
+
};
|
|
1613
|
+
|
|
1614
|
+
//#endregion
|
|
1615
|
+
//#region lexicons/simplespace/getSpace.json
|
|
1616
|
+
var getSpace_default = {
|
|
1617
|
+
lexicon: 1,
|
|
1618
|
+
id: "com.atproto.simplespace.getSpace",
|
|
1619
|
+
defs: { "main": {
|
|
1620
|
+
"type": "query",
|
|
1621
|
+
"description": "Describe a space managed by the simplespace implementation, including its configuration. Served by the space host. Requires either OAuth (for a caller with an account on this host) or a space credential (for a member hosted elsewhere); either way the caller must be authorized for the space.",
|
|
1622
|
+
"parameters": {
|
|
1623
|
+
"type": "params",
|
|
1624
|
+
"required": ["space"],
|
|
1625
|
+
"properties": { "space": {
|
|
1626
|
+
"type": "string",
|
|
1627
|
+
"format": "space-ref",
|
|
1628
|
+
"description": "Reference to the space."
|
|
1629
|
+
} }
|
|
1630
|
+
},
|
|
1631
|
+
"output": {
|
|
1632
|
+
"encoding": "application/json",
|
|
1633
|
+
"schema": {
|
|
1634
|
+
"type": "object",
|
|
1635
|
+
"required": [
|
|
1636
|
+
"uri",
|
|
1637
|
+
"policy",
|
|
1638
|
+
"appAccess"
|
|
1639
|
+
],
|
|
1640
|
+
"properties": {
|
|
1641
|
+
"uri": {
|
|
1642
|
+
"type": "string",
|
|
1643
|
+
"format": "space-ref",
|
|
1644
|
+
"description": "URI of the space."
|
|
1645
|
+
},
|
|
1646
|
+
"policy": {
|
|
1647
|
+
"type": "union",
|
|
1648
|
+
"description": "How the authority decides whether to authorize a requesting user.",
|
|
1649
|
+
"refs": [
|
|
1650
|
+
"com.atproto.simplespace.defs#publicPolicy",
|
|
1651
|
+
"com.atproto.simplespace.defs#memberListPolicy",
|
|
1652
|
+
"com.atproto.simplespace.defs#managingAppPolicy"
|
|
1653
|
+
]
|
|
1654
|
+
},
|
|
1655
|
+
"appAccess": {
|
|
1656
|
+
"type": "union",
|
|
1657
|
+
"description": "How the authority decides whether to authorize a requesting app.",
|
|
1658
|
+
"refs": ["com.atproto.simplespace.defs#open", "com.atproto.simplespace.defs#allowList"]
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
},
|
|
1663
|
+
"errors": [{ "name": "SpaceNotFound" }]
|
|
1664
|
+
} }
|
|
1665
|
+
};
|
|
1666
|
+
|
|
1667
|
+
//#endregion
|
|
1668
|
+
//#region lexicons/simplespace/listMembers.json
|
|
1669
|
+
var listMembers_default = {
|
|
1670
|
+
lexicon: 1,
|
|
1671
|
+
id: "com.atproto.simplespace.listMembers",
|
|
1672
|
+
defs: {
|
|
1673
|
+
"main": {
|
|
1674
|
+
"type": "query",
|
|
1675
|
+
"description": "List the members in a space's host-internal member list. Must be called on the space authority's PDS. Requires OAuth with a covering read grant; a space credential is not sufficient, so members hosted elsewhere cannot enumerate the list. This reflects the simplespace member list, not a protocol-level reader set.",
|
|
1676
|
+
"parameters": {
|
|
1677
|
+
"type": "params",
|
|
1678
|
+
"required": ["space"],
|
|
1679
|
+
"properties": {
|
|
1680
|
+
"space": {
|
|
1681
|
+
"type": "string",
|
|
1682
|
+
"format": "space-ref",
|
|
1683
|
+
"description": "Reference to the space."
|
|
1684
|
+
},
|
|
1685
|
+
"limit": {
|
|
1686
|
+
"type": "integer",
|
|
1687
|
+
"minimum": 1,
|
|
1688
|
+
"maximum": 1e3,
|
|
1689
|
+
"default": 100,
|
|
1690
|
+
"description": "Maximum number of members to return."
|
|
1691
|
+
},
|
|
1692
|
+
"cursor": { "type": "string" }
|
|
1693
|
+
}
|
|
1694
|
+
},
|
|
1695
|
+
"output": {
|
|
1696
|
+
"encoding": "application/json",
|
|
1697
|
+
"schema": {
|
|
1698
|
+
"type": "object",
|
|
1699
|
+
"required": ["members"],
|
|
1700
|
+
"properties": {
|
|
1701
|
+
"cursor": { "type": "string" },
|
|
1702
|
+
"members": {
|
|
1703
|
+
"type": "array",
|
|
1704
|
+
"items": {
|
|
1705
|
+
"type": "ref",
|
|
1706
|
+
"ref": "#member"
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
},
|
|
1712
|
+
"errors": [{ "name": "SpaceNotFound" }]
|
|
1713
|
+
},
|
|
1714
|
+
"member": {
|
|
1715
|
+
"type": "object",
|
|
1716
|
+
"required": ["did"],
|
|
1717
|
+
"properties": { "did": {
|
|
1718
|
+
"type": "string",
|
|
1719
|
+
"format": "did"
|
|
1720
|
+
} }
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
};
|
|
1724
|
+
|
|
1725
|
+
//#endregion
|
|
1726
|
+
//#region lexicons/simplespace/removeMember.json
|
|
1727
|
+
var removeMember_default = {
|
|
1728
|
+
lexicon: 1,
|
|
1729
|
+
id: "com.atproto.simplespace.removeMember",
|
|
1730
|
+
defs: { "main": {
|
|
1731
|
+
"type": "procedure",
|
|
1732
|
+
"description": "Remove a member from a space's member list. The member list is host-internal state consulted at credential-mint time when the space's policy is 'member-list'. Requires auth as the space owner.",
|
|
1733
|
+
"input": {
|
|
1734
|
+
"encoding": "application/json",
|
|
1735
|
+
"schema": {
|
|
1736
|
+
"type": "object",
|
|
1737
|
+
"required": ["space", "did"],
|
|
1738
|
+
"properties": {
|
|
1739
|
+
"space": {
|
|
1740
|
+
"type": "string",
|
|
1741
|
+
"format": "space-ref",
|
|
1742
|
+
"description": "Reference to the space."
|
|
1743
|
+
},
|
|
1744
|
+
"did": {
|
|
1745
|
+
"type": "string",
|
|
1746
|
+
"format": "did",
|
|
1747
|
+
"description": "The DID of the member to remove."
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
},
|
|
1752
|
+
"errors": [{ "name": "SpaceNotFound" }, { "name": "NotSpaceOwner" }]
|
|
1753
|
+
} }
|
|
1754
|
+
};
|
|
1755
|
+
|
|
1756
|
+
//#endregion
|
|
1757
|
+
//#region lexicons/simplespace/updateSpace.json
|
|
1758
|
+
var updateSpace_default = {
|
|
1759
|
+
lexicon: 1,
|
|
1760
|
+
id: "com.atproto.simplespace.updateSpace",
|
|
1761
|
+
defs: { "main": {
|
|
1762
|
+
"type": "procedure",
|
|
1763
|
+
"description": "Update the configuration of a space. The authenticated user must be the space owner. Omitted fields are left unchanged. Requires auth, implemented by PDS.",
|
|
1764
|
+
"input": {
|
|
1765
|
+
"encoding": "application/json",
|
|
1766
|
+
"schema": {
|
|
1767
|
+
"type": "object",
|
|
1768
|
+
"required": ["space"],
|
|
1769
|
+
"properties": {
|
|
1770
|
+
"space": {
|
|
1771
|
+
"type": "string",
|
|
1772
|
+
"format": "space-ref",
|
|
1773
|
+
"description": "Reference to the space to update."
|
|
1774
|
+
},
|
|
1775
|
+
"policy": {
|
|
1776
|
+
"type": "union",
|
|
1777
|
+
"description": "How the authority decides whether to authorize a requesting user. When supplied, replaces the current policy wholesale.",
|
|
1778
|
+
"refs": [
|
|
1779
|
+
"com.atproto.simplespace.defs#publicPolicy",
|
|
1780
|
+
"com.atproto.simplespace.defs#memberListPolicy",
|
|
1781
|
+
"com.atproto.simplespace.defs#managingAppPolicy"
|
|
1782
|
+
]
|
|
1783
|
+
},
|
|
1784
|
+
"appAccess": {
|
|
1785
|
+
"type": "union",
|
|
1786
|
+
"description": "How the authority decides whether to authorize a requesting app. When supplied, replaces the current policy wholesale.",
|
|
1787
|
+
"refs": ["com.atproto.simplespace.defs#open", "com.atproto.simplespace.defs#allowList"]
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
},
|
|
1792
|
+
"errors": [
|
|
1793
|
+
{ "name": "SpaceNotFound" },
|
|
1794
|
+
{ "name": "NotSpaceOwner" },
|
|
1795
|
+
{
|
|
1796
|
+
"name": "UnsupportedPolicy",
|
|
1797
|
+
"description": "The requested policy is not one the host implements."
|
|
1798
|
+
},
|
|
1799
|
+
{
|
|
1800
|
+
"name": "UnsupportedAppAccess",
|
|
1801
|
+
"description": "The requested appAccess variant is not one the host implements. A host will not store an app access policy it cannot enforce."
|
|
1802
|
+
}
|
|
1803
|
+
]
|
|
1804
|
+
} }
|
|
1805
|
+
};
|
|
1806
|
+
|
|
1807
|
+
//#endregion
|
|
1808
|
+
//#region src/lexicons.ts
|
|
1809
|
+
/**
|
|
1810
|
+
* Vendored lexicon access. Regenerated by the vendor step of the weekly
|
|
1811
|
+
* sync whenever lexicons/ changes — imports are explicit so bundlers
|
|
1812
|
+
* carry the documents without filesystem access at runtime.
|
|
1813
|
+
*/
|
|
1814
|
+
const lexicons = [
|
|
1815
|
+
applyWrites_default,
|
|
1816
|
+
createRecord_default,
|
|
1817
|
+
defs_default$1,
|
|
1818
|
+
deleteRecord_default,
|
|
1819
|
+
getBlob_default,
|
|
1820
|
+
getDelegationToken_default,
|
|
1821
|
+
getLatestCommit_default,
|
|
1822
|
+
getRecord_default,
|
|
1823
|
+
getRepo_default,
|
|
1824
|
+
getSpaceCredential_default,
|
|
1825
|
+
listBlobs_default,
|
|
1826
|
+
listRecords_default,
|
|
1827
|
+
listRepoOps_default,
|
|
1828
|
+
listRepos_default,
|
|
1829
|
+
listSpaces_default,
|
|
1830
|
+
notifySpaceDeleted_default,
|
|
1831
|
+
notifyWrite_default,
|
|
1832
|
+
putRecord_default,
|
|
1833
|
+
registerNotify_default,
|
|
1834
|
+
unregisterNotify_default,
|
|
1835
|
+
addMember_default,
|
|
1836
|
+
checkUserAccess_default,
|
|
1837
|
+
createSpace_default,
|
|
1838
|
+
defs_default,
|
|
1839
|
+
deleteSpace_default,
|
|
1840
|
+
getSpace_default,
|
|
1841
|
+
listMembers_default,
|
|
1842
|
+
removeMember_default,
|
|
1843
|
+
updateSpace_default
|
|
1844
|
+
];
|
|
1845
|
+
|
|
1846
|
+
//#endregion
|
|
1847
|
+
//#region src/coverage.ts
|
|
1848
|
+
/** Extract the coverage requirements from the vendored lexicons. */
|
|
1849
|
+
function coverageRequirements(docs = lexicons) {
|
|
1850
|
+
const requirements = [];
|
|
1851
|
+
for (const doc of docs) {
|
|
1852
|
+
const main = doc.defs.main;
|
|
1853
|
+
if (!main || main.type !== "query" && main.type !== "procedure") continue;
|
|
1854
|
+
requirements.push({
|
|
1855
|
+
ref: doc.id,
|
|
1856
|
+
kind: "method"
|
|
1857
|
+
});
|
|
1858
|
+
for (const error of main.errors ?? []) requirements.push({
|
|
1859
|
+
ref: `${doc.id}@error:${error.name}`,
|
|
1860
|
+
kind: "error"
|
|
1861
|
+
});
|
|
1862
|
+
}
|
|
1863
|
+
return requirements;
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* A citation covers a requirement when it names the method (which covers
|
|
1867
|
+
* the method requirement) or the exact `@error:` form. A citation with a
|
|
1868
|
+
* `#def` fragment covers its method.
|
|
1869
|
+
*/
|
|
1870
|
+
function citationRefs(check) {
|
|
1871
|
+
return check.citations.filter((c) => c.source === "lexicon").map((c) => c.ref);
|
|
1872
|
+
}
|
|
1873
|
+
function coverageReport(catalog, docs = lexicons) {
|
|
1874
|
+
const requirements = coverageRequirements(docs);
|
|
1875
|
+
const known = new Set(requirements.map((r) => r.ref));
|
|
1876
|
+
const methodIds = new Set(requirements.filter((r) => r.kind === "method").map((r) => r.ref));
|
|
1877
|
+
const knownDocIds = new Set(docs.map((d) => d.id));
|
|
1878
|
+
const coveredBy = /* @__PURE__ */ new Map();
|
|
1879
|
+
const dangling = [];
|
|
1880
|
+
const credit = (ref, checkId) => coveredBy.set(ref, [...coveredBy.get(ref) ?? [], checkId]);
|
|
1881
|
+
for (const check of catalog) {
|
|
1882
|
+
if (check.tier !== "must") continue;
|
|
1883
|
+
for (const ref of citationRefs(check)) {
|
|
1884
|
+
const methodRef = ref.split("@")[0].split("#")[0];
|
|
1885
|
+
if (ref.includes("@error:")) {
|
|
1886
|
+
if (known.has(ref)) credit(ref, check.id);
|
|
1887
|
+
else dangling.push({
|
|
1888
|
+
checkId: check.id,
|
|
1889
|
+
ref
|
|
1890
|
+
});
|
|
1891
|
+
continue;
|
|
1892
|
+
}
|
|
1893
|
+
if (methodIds.has(methodRef)) credit(methodRef, check.id);
|
|
1894
|
+
else if (!knownDocIds.has(methodRef)) dangling.push({
|
|
1895
|
+
checkId: check.id,
|
|
1896
|
+
ref
|
|
1897
|
+
});
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
const gaps = requirements.filter((r) => !coveredBy.has(r.ref));
|
|
1901
|
+
return {
|
|
1902
|
+
requirements,
|
|
1903
|
+
covered: Array.from(coveredBy, ([ref, by]) => ({
|
|
1904
|
+
ref,
|
|
1905
|
+
by
|
|
1906
|
+
})),
|
|
1907
|
+
gaps,
|
|
1908
|
+
danglingCitations: dangling
|
|
1909
|
+
};
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
//#endregion
|
|
1913
|
+
export { runChecks as a, renderReport as i, coverageRequirements as n, lexicons as r, coverageReport as t };
|
|
1914
|
+
//# sourceMappingURL=coverage-DhJZu8P8.js.map
|