@atproto/pds 0.4.100 → 0.4.101
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/CHANGELOG.md +13 -0
- package/dist/actor-store/repo/transactor.d.ts +5 -5
- package/dist/actor-store/repo/transactor.d.ts.map +1 -1
- package/dist/actor-store/repo/transactor.js +38 -18
- package/dist/actor-store/repo/transactor.js.map +1 -1
- package/dist/actor-store/repo/util.d.ts +5 -0
- package/dist/actor-store/repo/util.d.ts.map +1 -0
- package/dist/actor-store/repo/util.js +25 -0
- package/dist/actor-store/repo/util.js.map +1 -0
- package/dist/api/com/atproto/repo/applyWrites.js +1 -1
- package/dist/api/com/atproto/repo/applyWrites.js.map +1 -1
- package/dist/api/com/atproto/repo/createRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/createRecord.js +3 -3
- package/dist/api/com/atproto/repo/createRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/deleteRecord.js +1 -1
- package/dist/api/com/atproto/repo/deleteRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/putRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/putRecord.js +1 -1
- package/dist/api/com/atproto/repo/putRecord.js.map +1 -1
- package/dist/api/com/atproto/server/activateAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/activateAccount.js +4 -1
- package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
- package/dist/api/com/atproto/server/createAccount.js +1 -1
- package/dist/api/com/atproto/server/createAccount.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lexicon/lexicons.d.ts +98 -32
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +70 -15
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/getRepoStatus.d.ts +1 -1
- package/dist/lexicon/types/com/atproto/sync/getRepoStatus.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts +1 -1
- package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/listRepos.js.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts +25 -7
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js +9 -0
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts +2 -2
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts.map +1 -1
- package/dist/repo/types.d.ts +12 -1
- package/dist/repo/types.d.ts.map +1 -1
- package/dist/repo/types.js.map +1 -1
- package/dist/scripts/rebuild-repo.d.ts.map +1 -1
- package/dist/scripts/rebuild-repo.js +4 -1
- package/dist/scripts/rebuild-repo.js.map +1 -1
- package/dist/sequencer/events.d.ts +22 -16
- package/dist/sequencer/events.d.ts.map +1 -1
- package/dist/sequencer/events.js +31 -39
- package/dist/sequencer/events.js.map +1 -1
- package/dist/sequencer/sequencer.d.ts +2 -3
- package/dist/sequencer/sequencer.d.ts.map +1 -1
- package/dist/sequencer/sequencer.js +2 -2
- package/dist/sequencer/sequencer.js.map +1 -1
- package/package.json +6 -6
- package/src/actor-store/repo/transactor.ts +47 -21
- package/src/actor-store/repo/util.ts +22 -0
- package/src/api/com/atproto/repo/applyWrites.ts +1 -1
- package/src/api/com/atproto/repo/createRecord.ts +28 -31
- package/src/api/com/atproto/repo/deleteRecord.ts +1 -1
- package/src/api/com/atproto/repo/putRecord.ts +3 -3
- package/src/api/com/atproto/server/activateAccount.ts +4 -1
- package/src/api/com/atproto/server/createAccount.ts +1 -1
- package/src/index.ts +1 -1
- package/src/lexicon/lexicons.ts +79 -16
- package/src/lexicon/types/com/atproto/sync/getRepoStatus.ts +8 -1
- package/src/lexicon/types/com/atproto/sync/listRepos.ts +8 -1
- package/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +41 -6
- package/src/lexicon/types/tools/ozone/moderation/defs.ts +2 -2
- package/src/repo/types.ts +14 -1
- package/src/scripts/rebuild-repo.ts +4 -1
- package/src/sequencer/events.ts +35 -49
- package/src/sequencer/sequencer.ts +3 -5
- package/tests/crud.test.ts +1 -1
- package/tests/sequencer.test.ts +1 -5
- package/tests/sync/invertible-ops.test.ts +104 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.tests.tsbuildinfo +1 -1
@@ -1,8 +1,7 @@
|
|
1
1
|
import TypedEmitter from 'typed-emitter';
|
2
|
-
import { CommitData } from '@atproto/repo';
|
3
2
|
import { AccountStatus } from '../account-manager/helpers/account';
|
4
3
|
import { Crawlers } from '../crawlers';
|
5
|
-
import {
|
4
|
+
import { CommitDataWithOps } from '../repo';
|
6
5
|
import { RepoSeqEntry, RepoSeqInsert, SequencerDb } from './db';
|
7
6
|
import { SeqEvt } from './events';
|
8
7
|
export * from './events';
|
@@ -29,7 +28,7 @@ export declare class Sequencer extends Sequencer_base {
|
|
29
28
|
private pollDb;
|
30
29
|
private exponentialBackoff;
|
31
30
|
sequenceEvt(evt: RepoSeqInsert): Promise<number>;
|
32
|
-
sequenceCommit(did: string, commitData:
|
31
|
+
sequenceCommit(did: string, commitData: CommitDataWithOps): Promise<number>;
|
33
32
|
sequenceHandleUpdate(did: string, handle: string): Promise<number>;
|
34
33
|
sequenceIdentityEvt(did: string, handle?: string): Promise<number>;
|
35
34
|
sequenceAccountEvt(did: string, status: AccountStatus): Promise<number>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,eA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AAiB,GAC5B,OAAO,CAAC,MAAM,CAAC;IAKZ,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKlE,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKlE,kBAAkB,CACtB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,MAAM,CAAC;IAKZ,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK/C,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,GAAE,MAAM,EAAO;CAUjE;AAED,KAAK,MAAM,GAAG,YAAY,CAAA;AAE1B,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAChC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,eAAe,CAAC,CAAA;AAE5D,eAAe,SAAS,CAAA"}
|
@@ -222,8 +222,8 @@ class Sequencer extends node_events_1.default {
|
|
222
222
|
this.crawlers.notifyOfUpdate();
|
223
223
|
return res[0].seq;
|
224
224
|
}
|
225
|
-
async sequenceCommit(did, commitData
|
226
|
-
const evt = await (0, events_1.formatSeqCommit)(did, commitData
|
225
|
+
async sequenceCommit(did, commitData) {
|
226
|
+
const evt = await (0, events_1.formatSeqCommit)(did, commitData);
|
227
227
|
return await this.sequenceEvt(evt);
|
228
228
|
}
|
229
229
|
async sequenceHandleUpdate(did, handle) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sequencer.js","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,8DAAsC;AAEtC,4CAA0D;
|
1
|
+
{"version":3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B,CAAC,GAAW,EAAE,gBAA0B,EAAE;QAC9D,MAAM,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAC5B,IAAI,CAAC,EAAE,CAAC,EAAE;aACP,UAAU,CAAC,UAAU,CAAC;aACtB,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC;aACtB,EAAE,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CACnC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,aAAa,CAAC,CACzC,CACJ,CAAA;IACH,CAAC;CACF;AAnOD,8BAmOC;AAWD,kBAAe,SAAS,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atproto/pds",
|
3
|
-
"version": "0.4.
|
3
|
+
"version": "0.4.101",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "Reference implementation of atproto Personal Data Server (PDS)",
|
6
6
|
"keywords": [
|
@@ -50,14 +50,14 @@
|
|
50
50
|
"zod": "^3.23.8",
|
51
51
|
"@atproto-labs/fetch-node": "0.1.7",
|
52
52
|
"@atproto-labs/xrpc-utils": "0.0.7",
|
53
|
-
"@atproto/api": "^0.14.
|
54
|
-
"@atproto/aws": "^0.2.
|
53
|
+
"@atproto/api": "^0.14.5",
|
54
|
+
"@atproto/aws": "^0.2.16",
|
55
55
|
"@atproto/common": "^0.4.8",
|
56
56
|
"@atproto/crypto": "^0.4.4",
|
57
57
|
"@atproto/identity": "^0.4.6",
|
58
58
|
"@atproto/lexicon": "^0.4.7",
|
59
59
|
"@atproto/oauth-provider": "^0.3.1",
|
60
|
-
"@atproto/repo": "^0.
|
60
|
+
"@atproto/repo": "^0.7.0",
|
61
61
|
"@atproto/syntax": "^0.3.3",
|
62
62
|
"@atproto/xrpc": "^0.6.9",
|
63
63
|
"@atproto/xrpc-server": "^0.7.11"
|
@@ -78,8 +78,8 @@
|
|
78
78
|
"ts-node": "^10.8.2",
|
79
79
|
"typescript": "^5.6.3",
|
80
80
|
"ws": "^8.12.0",
|
81
|
-
"@atproto/api": "^0.14.
|
82
|
-
"@atproto/bsky": "^0.0.
|
81
|
+
"@atproto/api": "^0.14.5",
|
82
|
+
"@atproto/bsky": "^0.0.122",
|
83
83
|
"@atproto/lex-cli": "^0.6.1",
|
84
84
|
"@atproto/oauth-client-browser-example": "0.0.1"
|
85
85
|
},
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { CID } from 'multiformats/cid'
|
2
2
|
import * as crypto from '@atproto/crypto'
|
3
|
-
import { BlobStore,
|
3
|
+
import { BlobStore, Repo, WriteOpAction, formatDataKey } from '@atproto/repo'
|
4
4
|
import { AtUri } from '@atproto/syntax'
|
5
5
|
import { InvalidRequestError } from '@atproto/xrpc-server'
|
6
6
|
import { BackgroundQueue } from '../../background'
|
@@ -8,6 +8,8 @@ import { createWriteToOp, writeToOp } from '../../repo'
|
|
8
8
|
import {
|
9
9
|
BadCommitSwapError,
|
10
10
|
BadRecordSwapError,
|
11
|
+
CommitDataWithOps,
|
12
|
+
CommitOp,
|
11
13
|
PreparedCreate,
|
12
14
|
PreparedWrite,
|
13
15
|
} from '../../repo/types'
|
@@ -16,6 +18,7 @@ import { ActorDb } from '../db'
|
|
16
18
|
import { RecordTransactor } from '../record/transactor'
|
17
19
|
import { RepoReader } from './reader'
|
18
20
|
import { SqlRepoTransactor } from './sql-repo-transactor'
|
21
|
+
import { blobCidsFromWrites, commitOpsFromCreates } from './util'
|
19
22
|
|
20
23
|
export class RepoTransactor extends RepoReader {
|
21
24
|
blob: BlobTransactor
|
@@ -45,24 +48,31 @@ export class RepoTransactor extends RepoReader {
|
|
45
48
|
return res ? Repo.load(this.storage, CID.parse(res.cid)) : null
|
46
49
|
}
|
47
50
|
|
48
|
-
async createRepo(writes: PreparedCreate[]): Promise<
|
51
|
+
async createRepo(writes: PreparedCreate[]): Promise<CommitDataWithOps> {
|
49
52
|
this.db.assertTransaction()
|
50
|
-
const writeOps = writes.map(createWriteToOp)
|
51
53
|
const commit = await Repo.formatInitCommit(
|
52
54
|
this.storage,
|
53
55
|
this.did,
|
54
56
|
this.signingKey,
|
55
|
-
|
57
|
+
writes.map(createWriteToOp),
|
56
58
|
)
|
57
59
|
await Promise.all([
|
58
60
|
this.storage.applyCommit(commit, true),
|
59
61
|
this.indexWrites(writes, commit.rev),
|
60
62
|
this.blob.processWriteBlobs(commit.rev, writes),
|
61
63
|
])
|
62
|
-
return
|
64
|
+
return {
|
65
|
+
...commit,
|
66
|
+
ops: commitOpsFromCreates(writes),
|
67
|
+
blobs: blobCidsFromWrites(writes),
|
68
|
+
prevData: null,
|
69
|
+
}
|
63
70
|
}
|
64
71
|
|
65
|
-
async processWrites(
|
72
|
+
async processWrites(
|
73
|
+
writes: PreparedWrite[],
|
74
|
+
swapCommitCid?: CID,
|
75
|
+
): Promise<CommitDataWithOps> {
|
66
76
|
this.db.assertTransaction()
|
67
77
|
const commit = await this.formatCommit(writes, swapCommitCid)
|
68
78
|
await Promise.all([
|
@@ -79,7 +89,7 @@ export class RepoTransactor extends RepoReader {
|
|
79
89
|
async formatCommit(
|
80
90
|
writes: PreparedWrite[],
|
81
91
|
swapCommit?: CID,
|
82
|
-
): Promise<
|
92
|
+
): Promise<CommitDataWithOps> {
|
83
93
|
// this is not in a txn, so this won't actually hold the lock,
|
84
94
|
// we just check if it is currently held by another txn
|
85
95
|
const currRoot = await this.storage.getRootDetailed()
|
@@ -93,6 +103,7 @@ export class RepoTransactor extends RepoReader {
|
|
93
103
|
await this.storage.cacheRev(currRoot.rev)
|
94
104
|
const newRecordCids: CID[] = []
|
95
105
|
const delAndUpdateUris: AtUri[] = []
|
106
|
+
const commitOps: CommitOp[] = []
|
96
107
|
for (const write of writes) {
|
97
108
|
const { action, uri, swapCid } = write
|
98
109
|
if (action !== WriteOpAction.Delete) {
|
@@ -101,26 +112,36 @@ export class RepoTransactor extends RepoReader {
|
|
101
112
|
if (action !== WriteOpAction.Create) {
|
102
113
|
delAndUpdateUris.push(uri)
|
103
114
|
}
|
104
|
-
if (swapCid === undefined) {
|
105
|
-
continue
|
106
|
-
}
|
107
115
|
const record = await this.record.getRecord(uri, null, true)
|
108
|
-
const currRecord = record
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
116
|
+
const currRecord = record ? CID.parse(record.cid) : null
|
117
|
+
|
118
|
+
const op: CommitOp = {
|
119
|
+
action,
|
120
|
+
path: formatDataKey(uri.collection, uri.rkey),
|
121
|
+
cid: write.action === WriteOpAction.Delete ? null : write.cid,
|
114
122
|
}
|
115
|
-
if (
|
116
|
-
|
123
|
+
if (currRecord) {
|
124
|
+
op.prev = currRecord
|
117
125
|
}
|
118
|
-
|
119
|
-
|
126
|
+
commitOps.push(op)
|
127
|
+
if (swapCid !== undefined) {
|
128
|
+
if (action === WriteOpAction.Create && swapCid !== null) {
|
129
|
+
throw new BadRecordSwapError(currRecord) // There should be no current record for a create
|
130
|
+
}
|
131
|
+
if (action === WriteOpAction.Update && swapCid === null) {
|
132
|
+
throw new BadRecordSwapError(currRecord) // There should be a current record for an update
|
133
|
+
}
|
134
|
+
if (action === WriteOpAction.Delete && swapCid === null) {
|
135
|
+
throw new BadRecordSwapError(currRecord) // There should be a current record for a delete
|
136
|
+
}
|
137
|
+
if ((currRecord || swapCid) && !currRecord?.equals(swapCid)) {
|
138
|
+
throw new BadRecordSwapError(currRecord)
|
139
|
+
}
|
120
140
|
}
|
121
141
|
}
|
122
142
|
|
123
143
|
const repo = await Repo.load(this.storage, currRoot.cid)
|
144
|
+
const prevData = repo.commit.data
|
124
145
|
const writeOps = writes.map(writeToOp)
|
125
146
|
const commit = await repo.formatCommit(writeOps, this.signingKey)
|
126
147
|
|
@@ -142,7 +163,12 @@ export class RepoTransactor extends RepoReader {
|
|
142
163
|
)
|
143
164
|
commit.relevantBlocks.addMap(missingBlocks.blocks)
|
144
165
|
}
|
145
|
-
return
|
166
|
+
return {
|
167
|
+
...commit,
|
168
|
+
ops: commitOps,
|
169
|
+
blobs: blobCidsFromWrites(writes),
|
170
|
+
prevData,
|
171
|
+
}
|
146
172
|
}
|
147
173
|
|
148
174
|
async indexWrites(writes: PreparedWrite[], rev: string) {
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { CidSet, formatDataKey } from '@atproto/repo'
|
2
|
+
import { CommitOp, PreparedCreate, PreparedWrite } from '../../repo'
|
3
|
+
|
4
|
+
export const blobCidsFromWrites = (writes: PreparedWrite[]): CidSet => {
|
5
|
+
const blobCids = new CidSet()
|
6
|
+
for (const w of writes) {
|
7
|
+
if (w.action === 'create' || w.action === 'update') {
|
8
|
+
for (const blob of w.blobs) {
|
9
|
+
blobCids.add(blob.cid)
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
13
|
+
return blobCids
|
14
|
+
}
|
15
|
+
|
16
|
+
export const commitOpsFromCreates = (writes: PreparedCreate[]): CommitOp[] => {
|
17
|
+
return writes.map((w) => ({
|
18
|
+
action: 'create' as const,
|
19
|
+
path: formatDataKey(w.uri.collection, w.uri.rkey),
|
20
|
+
cid: w.cid,
|
21
|
+
}))
|
22
|
+
}
|
@@ -130,7 +130,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
130
130
|
}
|
131
131
|
})
|
132
132
|
|
133
|
-
await ctx.sequencer.sequenceCommit(did, commit
|
133
|
+
await ctx.sequencer.sequenceCommit(did, commit)
|
134
134
|
await ctx.accountManager.updateRepoRoot(did, commit.cid, commit.rev)
|
135
135
|
|
136
136
|
return {
|
@@ -66,40 +66,37 @@ export default function (server: Server, ctx: AppContext) {
|
|
66
66
|
throw err
|
67
67
|
}
|
68
68
|
|
69
|
-
const
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
69
|
+
const commit = await ctx.actorStore.transact(did, async (actorTxn) => {
|
70
|
+
const backlinkConflicts =
|
71
|
+
validate !== false
|
72
|
+
? await actorTxn.record.getBacklinkConflicts(
|
73
|
+
write.uri,
|
74
|
+
write.record,
|
75
|
+
)
|
76
|
+
: []
|
77
|
+
const backlinkDeletions = backlinkConflicts.map((uri) =>
|
78
|
+
prepareDelete({
|
79
|
+
did: uri.hostname,
|
80
|
+
collection: uri.collection,
|
81
|
+
rkey: uri.rkey,
|
82
|
+
}),
|
83
|
+
)
|
84
|
+
const writes = [...backlinkDeletions, write]
|
85
|
+
try {
|
86
|
+
const commit = await actorTxn.repo.processWrites(
|
87
|
+
writes,
|
88
|
+
swapCommitCid,
|
85
89
|
)
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
swapCommitCid,
|
91
|
-
)
|
92
|
-
return { commit, writes }
|
93
|
-
} catch (err) {
|
94
|
-
if (err instanceof BadCommitSwapError) {
|
95
|
-
throw new InvalidRequestError(err.message, 'InvalidSwap')
|
96
|
-
}
|
97
|
-
throw err
|
90
|
+
return commit
|
91
|
+
} catch (err) {
|
92
|
+
if (err instanceof BadCommitSwapError) {
|
93
|
+
throw new InvalidRequestError(err.message, 'InvalidSwap')
|
98
94
|
}
|
99
|
-
|
100
|
-
|
95
|
+
throw err
|
96
|
+
}
|
97
|
+
})
|
101
98
|
|
102
|
-
await ctx.sequencer.sequenceCommit(did, commit
|
99
|
+
await ctx.sequencer.sequenceCommit(did, commit)
|
103
100
|
await ctx.accountManager.updateRepoRoot(did, commit.cid, commit.rev)
|
104
101
|
|
105
102
|
return {
|
@@ -71,7 +71,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
71
71
|
})
|
72
72
|
|
73
73
|
if (commit !== null) {
|
74
|
-
await ctx.sequencer.sequenceCommit(did, commit
|
74
|
+
await ctx.sequencer.sequenceCommit(did, commit)
|
75
75
|
await ctx.accountManager.updateRepoRoot(did, commit.cid, commit.rev)
|
76
76
|
}
|
77
77
|
return {
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { CID } from 'multiformats/cid'
|
2
2
|
import { BlobRef } from '@atproto/lexicon'
|
3
|
-
import { CommitData } from '@atproto/repo'
|
4
3
|
import { AtUri } from '@atproto/syntax'
|
5
4
|
import { AuthRequiredError, InvalidRequestError } from '@atproto/xrpc-server'
|
6
5
|
import { ActorStoreTransactor } from '../../../../actor-store/actor-store-transactor'
|
@@ -11,6 +10,7 @@ import { Record as ProfileRecord } from '../../../../lexicon/types/app/bsky/acto
|
|
11
10
|
import {
|
12
11
|
BadCommitSwapError,
|
13
12
|
BadRecordSwapError,
|
13
|
+
CommitDataWithOps,
|
14
14
|
InvalidRecordError,
|
15
15
|
PreparedCreate,
|
16
16
|
PreparedUpdate,
|
@@ -104,7 +104,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
104
104
|
}
|
105
105
|
}
|
106
106
|
|
107
|
-
let commit:
|
107
|
+
let commit: CommitDataWithOps
|
108
108
|
try {
|
109
109
|
commit = await actorTxn.repo.processWrites([write], swapCommitCid)
|
110
110
|
} catch (err) {
|
@@ -122,7 +122,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
122
122
|
)
|
123
123
|
|
124
124
|
if (commit !== null) {
|
125
|
-
await ctx.sequencer.sequenceCommit(did, commit
|
125
|
+
await ctx.sequencer.sequenceCommit(did, commit)
|
126
126
|
await ctx.accountManager.updateRepoRoot(did, commit.cid, commit.rev)
|
127
127
|
}
|
128
128
|
|
@@ -43,6 +43,9 @@ export default function (server: Server, ctx: AppContext) {
|
|
43
43
|
newBlocks: blocks.blocks,
|
44
44
|
relevantBlocks: blocks.blocks,
|
45
45
|
removedCids: new CidSet(),
|
46
|
+
ops: [],
|
47
|
+
blobs: new CidSet(),
|
48
|
+
prevData: null,
|
46
49
|
}
|
47
50
|
})
|
48
51
|
|
@@ -53,7 +56,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
53
56
|
requester,
|
54
57
|
account.handle ?? INVALID_HANDLE,
|
55
58
|
)
|
56
|
-
await ctx.sequencer.sequenceCommit(requester, commitData
|
59
|
+
await ctx.sequencer.sequenceCommit(requester, commitData)
|
57
60
|
},
|
58
61
|
})
|
59
62
|
}
|
@@ -74,7 +74,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
74
74
|
if (!deactivated) {
|
75
75
|
await ctx.sequencer.sequenceIdentityEvt(did, handle)
|
76
76
|
await ctx.sequencer.sequenceAccountEvt(did, AccountStatus.Active)
|
77
|
-
await ctx.sequencer.sequenceCommit(did, commit
|
77
|
+
await ctx.sequencer.sequenceCommit(did, commit)
|
78
78
|
}
|
79
79
|
await ctx.accountManager.updateRepoRoot(did, commit.cid, commit.rev)
|
80
80
|
await ctx.actorStore.clearReservedKeypair(signingKey.did(), did)
|
package/src/index.ts
CHANGED
@@ -37,7 +37,7 @@ export { createSecretKeyObject } from './auth-verifier'
|
|
37
37
|
export { type Handler as SkeletonHandler } from './lexicon/types/app/bsky/feed/getFeedSkeleton'
|
38
38
|
export { createServer as createLexiconServer } from './lexicon'
|
39
39
|
export * as sequencer from './sequencer'
|
40
|
-
export { type PreparedWrite } from './repo'
|
40
|
+
export { type CommitDataWithOps, type PreparedWrite } from './repo'
|
41
41
|
export * as repoPrepare from './repo/prepare'
|
42
42
|
export { scripts } from './scripts'
|
43
43
|
|
package/src/lexicon/lexicons.ts
CHANGED
@@ -3517,7 +3517,14 @@ export const schemaDict = {
|
|
3517
3517
|
type: 'string',
|
3518
3518
|
description:
|
3519
3519
|
'If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.',
|
3520
|
-
knownValues: [
|
3520
|
+
knownValues: [
|
3521
|
+
'takendown',
|
3522
|
+
'suspended',
|
3523
|
+
'deleted',
|
3524
|
+
'deactivated',
|
3525
|
+
'desynchronized',
|
3526
|
+
'throttled',
|
3527
|
+
],
|
3521
3528
|
},
|
3522
3529
|
rev: {
|
3523
3530
|
type: 'string',
|
@@ -3671,7 +3678,14 @@ export const schemaDict = {
|
|
3671
3678
|
type: 'string',
|
3672
3679
|
description:
|
3673
3680
|
'If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.',
|
3674
|
-
knownValues: [
|
3681
|
+
knownValues: [
|
3682
|
+
'takendown',
|
3683
|
+
'suspended',
|
3684
|
+
'deleted',
|
3685
|
+
'deactivated',
|
3686
|
+
'desynchronized',
|
3687
|
+
'throttled',
|
3688
|
+
],
|
3675
3689
|
},
|
3676
3690
|
},
|
3677
3691
|
},
|
@@ -3810,6 +3824,7 @@ export const schemaDict = {
|
|
3810
3824
|
type: 'union',
|
3811
3825
|
refs: [
|
3812
3826
|
'lex:com.atproto.sync.subscribeRepos#commit',
|
3827
|
+
'lex:com.atproto.sync.subscribeRepos#sync',
|
3813
3828
|
'lex:com.atproto.sync.subscribeRepos#identity',
|
3814
3829
|
'lex:com.atproto.sync.subscribeRepos#account',
|
3815
3830
|
'lex:com.atproto.sync.subscribeRepos#handle',
|
@@ -3847,7 +3862,7 @@ export const schemaDict = {
|
|
3847
3862
|
'blobs',
|
3848
3863
|
'time',
|
3849
3864
|
],
|
3850
|
-
nullable: ['
|
3865
|
+
nullable: ['since'],
|
3851
3866
|
properties: {
|
3852
3867
|
seq: {
|
3853
3868
|
type: 'integer',
|
@@ -3860,22 +3875,18 @@ export const schemaDict = {
|
|
3860
3875
|
tooBig: {
|
3861
3876
|
type: 'boolean',
|
3862
3877
|
description:
|
3863
|
-
'Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data.',
|
3878
|
+
'DEPRECATED -- replaced by #sync event and data limits. Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data.',
|
3864
3879
|
},
|
3865
3880
|
repo: {
|
3866
3881
|
type: 'string',
|
3867
3882
|
format: 'did',
|
3868
|
-
description:
|
3883
|
+
description:
|
3884
|
+
"The repo this event comes from. Note that all other message types name this field 'did'.",
|
3869
3885
|
},
|
3870
3886
|
commit: {
|
3871
3887
|
type: 'cid-link',
|
3872
3888
|
description: 'Repo commit object CID.',
|
3873
3889
|
},
|
3874
|
-
prev: {
|
3875
|
-
type: 'cid-link',
|
3876
|
-
description:
|
3877
|
-
'DEPRECATED -- unused. WARNING -- nullable and optional; stick with optional to ensure golang interoperability.',
|
3878
|
-
},
|
3879
3890
|
rev: {
|
3880
3891
|
type: 'string',
|
3881
3892
|
format: 'tid',
|
@@ -3891,8 +3902,8 @@ export const schemaDict = {
|
|
3891
3902
|
blocks: {
|
3892
3903
|
type: 'bytes',
|
3893
3904
|
description:
|
3894
|
-
|
3895
|
-
maxLength:
|
3905
|
+
"CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list.",
|
3906
|
+
maxLength: 2000000,
|
3896
3907
|
},
|
3897
3908
|
ops: {
|
3898
3909
|
type: 'array',
|
@@ -3909,9 +3920,49 @@ export const schemaDict = {
|
|
3909
3920
|
items: {
|
3910
3921
|
type: 'cid-link',
|
3911
3922
|
description:
|
3912
|
-
'List of new blobs (by CID) referenced by records in this commit.',
|
3923
|
+
'DEPRECATED -- will soon always be empty. List of new blobs (by CID) referenced by records in this commit.',
|
3913
3924
|
},
|
3914
3925
|
},
|
3926
|
+
prevData: {
|
3927
|
+
type: 'cid-link',
|
3928
|
+
description:
|
3929
|
+
"The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose.",
|
3930
|
+
},
|
3931
|
+
time: {
|
3932
|
+
type: 'string',
|
3933
|
+
format: 'datetime',
|
3934
|
+
description:
|
3935
|
+
'Timestamp of when this message was originally broadcast.',
|
3936
|
+
},
|
3937
|
+
},
|
3938
|
+
},
|
3939
|
+
sync: {
|
3940
|
+
type: 'object',
|
3941
|
+
description:
|
3942
|
+
'Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository.',
|
3943
|
+
required: ['seq', 'did', 'blocks', 'rev', 'time'],
|
3944
|
+
properties: {
|
3945
|
+
seq: {
|
3946
|
+
type: 'integer',
|
3947
|
+
description: 'The stream sequence number of this message.',
|
3948
|
+
},
|
3949
|
+
did: {
|
3950
|
+
type: 'string',
|
3951
|
+
format: 'did',
|
3952
|
+
description:
|
3953
|
+
'The account this repo event corresponds to. Must match that in the commit object.',
|
3954
|
+
},
|
3955
|
+
blocks: {
|
3956
|
+
type: 'bytes',
|
3957
|
+
description:
|
3958
|
+
"CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'.",
|
3959
|
+
maxLength: 10000,
|
3960
|
+
},
|
3961
|
+
rev: {
|
3962
|
+
type: 'string',
|
3963
|
+
description:
|
3964
|
+
'The rev of the commit. This value must match that in the commit object.',
|
3965
|
+
},
|
3915
3966
|
time: {
|
3916
3967
|
type: 'string',
|
3917
3968
|
format: 'datetime',
|
@@ -3971,7 +4022,14 @@ export const schemaDict = {
|
|
3971
4022
|
type: 'string',
|
3972
4023
|
description:
|
3973
4024
|
'If active=false, this optional field indicates a reason for why the account is not active.',
|
3974
|
-
knownValues: [
|
4025
|
+
knownValues: [
|
4026
|
+
'takendown',
|
4027
|
+
'suspended',
|
4028
|
+
'deleted',
|
4029
|
+
'deactivated',
|
4030
|
+
'desynchronized',
|
4031
|
+
'throttled',
|
4032
|
+
],
|
3975
4033
|
},
|
3976
4034
|
},
|
3977
4035
|
},
|
@@ -4068,6 +4126,11 @@ export const schemaDict = {
|
|
4068
4126
|
description:
|
4069
4127
|
'For creates and updates, the new record CID. For deletions, null.',
|
4070
4128
|
},
|
4129
|
+
prev: {
|
4130
|
+
type: 'cid-link',
|
4131
|
+
description:
|
4132
|
+
'For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined.',
|
4133
|
+
},
|
4071
4134
|
},
|
4072
4135
|
},
|
4073
4136
|
},
|
@@ -11777,8 +11840,8 @@ export const schemaDict = {
|
|
11777
11840
|
},
|
11778
11841
|
modEventComment: {
|
11779
11842
|
type: 'object',
|
11780
|
-
description:
|
11781
|
-
|
11843
|
+
description:
|
11844
|
+
'Add a comment to a subject. An empty comment will clear any previously set sticky comment.',
|
11782
11845
|
properties: {
|
11783
11846
|
comment: {
|
11784
11847
|
type: 'string',
|
@@ -23,7 +23,14 @@ export interface OutputSchema {
|
|
23
23
|
did: string
|
24
24
|
active: boolean
|
25
25
|
/** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */
|
26
|
-
status?:
|
26
|
+
status?:
|
27
|
+
| 'takendown'
|
28
|
+
| 'suspended'
|
29
|
+
| 'deleted'
|
30
|
+
| 'deactivated'
|
31
|
+
| 'desynchronized'
|
32
|
+
| 'throttled'
|
33
|
+
| (string & {})
|
27
34
|
/** Optional field, the current rev of the repo, if active=true */
|
28
35
|
rev?: string
|
29
36
|
}
|
@@ -58,7 +58,14 @@ export interface Repo {
|
|
58
58
|
rev: string
|
59
59
|
active?: boolean
|
60
60
|
/** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */
|
61
|
-
status?:
|
61
|
+
status?:
|
62
|
+
| 'takendown'
|
63
|
+
| 'suspended'
|
64
|
+
| 'deleted'
|
65
|
+
| 'deactivated'
|
66
|
+
| 'desynchronized'
|
67
|
+
| 'throttled'
|
68
|
+
| (string & {})
|
62
69
|
}
|
63
70
|
|
64
71
|
const hashRepo = 'repo'
|