@atproto/pds 0.4.104 → 0.4.105

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.
Files changed (206) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/account-manager/{index.d.ts → account-manager.d.ts} +26 -35
  3. package/dist/account-manager/account-manager.d.ts.map +1 -0
  4. package/dist/account-manager/{index.js → account-manager.js} +52 -207
  5. package/dist/account-manager/account-manager.js.map +1 -0
  6. package/dist/account-manager/helpers/account.d.ts +3 -3
  7. package/dist/account-manager/helpers/device-account.d.ts +15 -15
  8. package/dist/account-manager/helpers/device-account.d.ts.map +1 -1
  9. package/dist/account-manager/helpers/device-account.js +2 -1
  10. package/dist/account-manager/helpers/device-account.js.map +1 -1
  11. package/dist/account-manager/helpers/token.d.ts +98 -98
  12. package/dist/account-manager/oauth-store.d.ts +58 -0
  13. package/dist/account-manager/oauth-store.d.ts.map +1 -0
  14. package/dist/account-manager/oauth-store.js +417 -0
  15. package/dist/account-manager/oauth-store.js.map +1 -0
  16. package/dist/actor-store/record/reader.d.ts +3 -3
  17. package/dist/actor-store/repo/reader.d.ts +2 -0
  18. package/dist/actor-store/repo/reader.d.ts.map +1 -1
  19. package/dist/actor-store/repo/reader.js +9 -0
  20. package/dist/actor-store/repo/reader.js.map +1 -1
  21. package/dist/actor-store/repo/sql-repo-reader.d.ts +1 -1
  22. package/dist/actor-store/repo/transactor.d.ts.map +1 -1
  23. package/dist/actor-store/repo/transactor.js +13 -4
  24. package/dist/actor-store/repo/transactor.js.map +1 -1
  25. package/dist/api/com/atproto/admin/deleteAccount.d.ts.map +1 -1
  26. package/dist/api/com/atproto/admin/deleteAccount.js +2 -3
  27. package/dist/api/com/atproto/admin/deleteAccount.js.map +1 -1
  28. package/dist/api/com/atproto/admin/updateAccountHandle.d.ts.map +1 -1
  29. package/dist/api/com/atproto/admin/updateAccountHandle.js +2 -6
  30. package/dist/api/com/atproto/admin/updateAccountHandle.js.map +1 -1
  31. package/dist/api/com/atproto/identity/resolveHandle.d.ts.map +1 -1
  32. package/dist/api/com/atproto/identity/resolveHandle.js +2 -36
  33. package/dist/api/com/atproto/identity/resolveHandle.js.map +1 -1
  34. package/dist/api/com/atproto/identity/updateHandle.d.ts.map +1 -1
  35. package/dist/api/com/atproto/identity/updateHandle.js +1 -7
  36. package/dist/api/com/atproto/identity/updateHandle.js.map +1 -1
  37. package/dist/api/com/atproto/server/activateAccount.d.ts.map +1 -1
  38. package/dist/api/com/atproto/server/activateAccount.js +2 -18
  39. package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
  40. package/dist/api/com/atproto/server/createAccount.d.ts.map +1 -1
  41. package/dist/api/com/atproto/server/createAccount.js +5 -7
  42. package/dist/api/com/atproto/server/createAccount.js.map +1 -1
  43. package/dist/api/com/atproto/server/createSession.js +1 -1
  44. package/dist/api/com/atproto/server/createSession.js.map +1 -1
  45. package/dist/api/com/atproto/server/deleteAccount.d.ts.map +1 -1
  46. package/dist/api/com/atproto/server/deleteAccount.js +2 -3
  47. package/dist/api/com/atproto/server/deleteAccount.js.map +1 -1
  48. package/dist/api/com/atproto/server/getSession.js +1 -1
  49. package/dist/api/com/atproto/server/getSession.js.map +1 -1
  50. package/dist/api/com/atproto/server/refreshSession.js +1 -1
  51. package/dist/api/com/atproto/server/refreshSession.js.map +1 -1
  52. package/dist/api/com/atproto/sync/getRecord.d.ts.map +1 -1
  53. package/dist/api/com/atproto/sync/getRecord.js.map +1 -1
  54. package/dist/api/com/atproto/sync/getRepoStatus.js +1 -1
  55. package/dist/api/com/atproto/sync/getRepoStatus.js.map +1 -1
  56. package/dist/api/com/atproto/sync/listRepos.js +1 -1
  57. package/dist/api/com/atproto/sync/listRepos.js.map +1 -1
  58. package/dist/api/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
  59. package/dist/api/com/atproto/sync/subscribeRepos.js +2 -10
  60. package/dist/api/com/atproto/sync/subscribeRepos.js.map +1 -1
  61. package/dist/app-view.d.ts +14 -0
  62. package/dist/app-view.d.ts.map +1 -0
  63. package/dist/app-view.js +36 -0
  64. package/dist/app-view.js.map +1 -0
  65. package/dist/auth-routes.d.ts +1 -1
  66. package/dist/auth-routes.d.ts.map +1 -1
  67. package/dist/auth-routes.js +9 -3
  68. package/dist/auth-routes.js.map +1 -1
  69. package/dist/auth-verifier.d.ts +1 -1
  70. package/dist/auth-verifier.d.ts.map +1 -1
  71. package/dist/config/config.d.ts +3 -2
  72. package/dist/config/config.d.ts.map +1 -1
  73. package/dist/config/config.js +17 -7
  74. package/dist/config/config.js.map +1 -1
  75. package/dist/config/env.d.ts +4 -0
  76. package/dist/config/env.d.ts.map +1 -1
  77. package/dist/config/env.js +5 -0
  78. package/dist/config/env.js.map +1 -1
  79. package/dist/context.d.ts +4 -4
  80. package/dist/context.d.ts.map +1 -1
  81. package/dist/context.js +24 -18
  82. package/dist/context.js.map +1 -1
  83. package/dist/handle/index.d.ts +0 -7
  84. package/dist/handle/index.d.ts.map +1 -1
  85. package/dist/handle/index.js +4 -58
  86. package/dist/handle/index.js.map +1 -1
  87. package/dist/image/image-url.d.ts +8 -0
  88. package/dist/image/image-url.d.ts.map +1 -0
  89. package/dist/image/image-url.js +26 -0
  90. package/dist/image/image-url.js.map +1 -0
  91. package/dist/lexicon/index.d.ts +6 -0
  92. package/dist/lexicon/index.d.ts.map +1 -1
  93. package/dist/lexicon/index.js +12 -0
  94. package/dist/lexicon/index.js.map +1 -1
  95. package/dist/lexicon/lexicons.d.ts +304 -130
  96. package/dist/lexicon/lexicons.d.ts.map +1 -1
  97. package/dist/lexicon/lexicons.js +168 -67
  98. package/dist/lexicon/lexicons.js.map +1 -1
  99. package/dist/lexicon/types/app/bsky/embed/video.d.ts +1 -0
  100. package/dist/lexicon/types/app/bsky/embed/video.d.ts.map +1 -1
  101. package/dist/lexicon/types/app/bsky/embed/video.js.map +1 -1
  102. package/dist/lexicon/types/com/atproto/identity/defs.d.ts +17 -0
  103. package/dist/lexicon/types/com/atproto/identity/defs.d.ts.map +1 -0
  104. package/dist/lexicon/types/com/atproto/identity/defs.js +16 -0
  105. package/dist/lexicon/types/com/atproto/identity/defs.js.map +1 -0
  106. package/dist/lexicon/types/com/atproto/identity/refreshIdentity.d.ts +39 -0
  107. package/dist/lexicon/types/com/atproto/identity/refreshIdentity.d.ts.map +1 -0
  108. package/dist/lexicon/types/com/atproto/identity/refreshIdentity.js +7 -0
  109. package/dist/lexicon/types/com/atproto/identity/refreshIdentity.js.map +1 -0
  110. package/dist/lexicon/types/com/atproto/identity/resolveDid.d.ts +40 -0
  111. package/dist/lexicon/types/com/atproto/identity/resolveDid.d.ts.map +1 -0
  112. package/dist/lexicon/types/com/atproto/identity/resolveDid.js +7 -0
  113. package/dist/lexicon/types/com/atproto/identity/resolveDid.js.map +1 -0
  114. package/dist/lexicon/types/com/atproto/identity/resolveHandle.d.ts +1 -0
  115. package/dist/lexicon/types/com/atproto/identity/resolveHandle.d.ts.map +1 -1
  116. package/dist/lexicon/types/com/atproto/identity/resolveIdentity.d.ts +36 -0
  117. package/dist/lexicon/types/com/atproto/identity/resolveIdentity.d.ts.map +1 -0
  118. package/dist/lexicon/types/com/atproto/identity/resolveIdentity.js +7 -0
  119. package/dist/lexicon/types/com/atproto/identity/resolveIdentity.js.map +1 -0
  120. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts +1 -30
  121. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
  122. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js +0 -27
  123. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js.map +1 -1
  124. package/dist/mailer/index.d.ts +5 -5
  125. package/dist/mailer/index.d.ts.map +1 -1
  126. package/dist/mailer/index.js +6 -5
  127. package/dist/mailer/index.js.map +1 -1
  128. package/dist/read-after-write/viewer.d.ts +1 -1
  129. package/dist/read-after-write/viewer.d.ts.map +1 -1
  130. package/dist/repo/types.d.ts +6 -2
  131. package/dist/repo/types.d.ts.map +1 -1
  132. package/dist/repo/types.js.map +1 -1
  133. package/dist/scripts/rebuild-repo.d.ts.map +1 -1
  134. package/dist/scripts/rebuild-repo.js +2 -1
  135. package/dist/scripts/rebuild-repo.js.map +1 -1
  136. package/dist/sequencer/db/schema.d.ts +1 -1
  137. package/dist/sequencer/db/schema.d.ts.map +1 -1
  138. package/dist/sequencer/events.d.ts +29 -41
  139. package/dist/sequencer/events.d.ts.map +1 -1
  140. package/dist/sequencer/events.js +24 -58
  141. package/dist/sequencer/events.js.map +1 -1
  142. package/dist/sequencer/sequencer.d.ts +2 -3
  143. package/dist/sequencer/sequencer.d.ts.map +1 -1
  144. package/dist/sequencer/sequencer.js +5 -17
  145. package/dist/sequencer/sequencer.js.map +1 -1
  146. package/package.json +15 -15
  147. package/src/account-manager/{index.ts → account-manager.ts} +107 -307
  148. package/src/account-manager/helpers/device-account.ts +1 -0
  149. package/src/account-manager/oauth-store.ts +494 -0
  150. package/src/actor-store/repo/reader.ts +11 -0
  151. package/src/actor-store/repo/transactor.ts +15 -4
  152. package/src/api/com/atproto/admin/deleteAccount.ts +2 -3
  153. package/src/api/com/atproto/admin/updateAccountHandle.ts +7 -8
  154. package/src/api/com/atproto/identity/resolveHandle.ts +2 -11
  155. package/src/api/com/atproto/identity/updateHandle.ts +4 -7
  156. package/src/api/com/atproto/server/activateAccount.ts +4 -18
  157. package/src/api/com/atproto/server/createAccount.ts +10 -11
  158. package/src/api/com/atproto/server/createSession.ts +1 -1
  159. package/src/api/com/atproto/server/deleteAccount.ts +2 -3
  160. package/src/api/com/atproto/server/getSession.ts +1 -1
  161. package/src/api/com/atproto/server/refreshSession.ts +1 -1
  162. package/src/api/com/atproto/sync/getRecord.ts +0 -1
  163. package/src/api/com/atproto/sync/getRepoStatus.ts +1 -1
  164. package/src/api/com/atproto/sync/listRepos.ts +1 -1
  165. package/src/api/com/atproto/sync/subscribeRepos.ts +2 -9
  166. package/src/app-view.ts +24 -0
  167. package/src/auth-routes.ts +9 -3
  168. package/src/auth-verifier.ts +1 -1
  169. package/src/config/config.ts +25 -13
  170. package/src/config/env.ts +12 -0
  171. package/src/context.ts +44 -24
  172. package/src/handle/index.ts +6 -52
  173. package/src/image/image-url.ts +16 -0
  174. package/src/lexicon/index.ts +36 -0
  175. package/src/lexicon/lexicons.ts +183 -67
  176. package/src/lexicon/types/app/bsky/embed/video.ts +1 -0
  177. package/src/lexicon/types/com/atproto/identity/defs.ts +30 -0
  178. package/src/lexicon/types/com/atproto/identity/refreshIdentity.ts +52 -0
  179. package/src/lexicon/types/com/atproto/identity/resolveDid.ts +52 -0
  180. package/src/lexicon/types/com/atproto/identity/resolveHandle.ts +1 -0
  181. package/src/lexicon/types/com/atproto/identity/resolveIdentity.ts +48 -0
  182. package/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +0 -59
  183. package/src/mailer/index.ts +7 -5
  184. package/src/read-after-write/viewer.ts +1 -1
  185. package/src/repo/types.ts +7 -2
  186. package/src/scripts/rebuild-repo.ts +4 -1
  187. package/src/sequencer/db/schema.ts +1 -8
  188. package/src/sequencer/events.ts +29 -75
  189. package/src/sequencer/sequencer.ts +9 -23
  190. package/tests/account-deletion.test.ts +3 -5
  191. package/tests/oauth.test.ts +286 -71
  192. package/tests/sequencer.test.ts +18 -27
  193. package/tests/sync/subscribe-repos.test.ts +67 -45
  194. package/tsconfig.build.tsbuildinfo +1 -1
  195. package/dist/account-manager/index.d.ts.map +0 -1
  196. package/dist/account-manager/index.js.map +0 -1
  197. package/dist/actor-store/repo/util.d.ts +0 -5
  198. package/dist/actor-store/repo/util.d.ts.map +0 -1
  199. package/dist/actor-store/repo/util.js +0 -25
  200. package/dist/actor-store/repo/util.js.map +0 -1
  201. package/dist/oauth/provider.d.ts +0 -10
  202. package/dist/oauth/provider.d.ts.map +0 -1
  203. package/dist/oauth/provider.js +0 -38
  204. package/dist/oauth/provider.js.map +0 -1
  205. package/src/actor-store/repo/util.ts +0 -22
  206. package/src/oauth/provider.ts +0 -59
@@ -1,13 +1,6 @@
1
1
  import { Generated, GeneratedAlways, Insertable, Selectable } from 'kysely'
2
2
 
3
- export type RepoSeqEventType =
4
- | 'append'
5
- | 'rebase'
6
- | 'handle'
7
- | 'migrate'
8
- | 'identity'
9
- | 'account'
10
- | 'tombstone'
3
+ export type RepoSeqEventType = 'append' | 'sync' | 'identity' | 'account'
11
4
 
12
5
  export interface RepoSeq {
13
6
  seq: GeneratedAlways<number>
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod'
2
2
  import { cborEncode, noUndefinedVals, schema } from '@atproto/common'
3
3
  import { BlockMap, blocksToCarFile } from '@atproto/repo'
4
- import { AccountStatus } from '../account-manager'
5
- import { CommitDataWithOps } from '../repo'
4
+ import { AccountStatus } from '../account-manager/account-manager'
5
+ import { CommitDataWithOps, SyncEvtData } from '../repo'
6
6
  import { RepoSeqInsert } from './db'
7
7
 
8
8
  export const formatSeqCommit = async (
@@ -13,41 +13,18 @@ export const formatSeqCommit = async (
13
13
  blocksToSend.addMap(commitData.newBlocks)
14
14
  blocksToSend.addMap(commitData.relevantBlocks)
15
15
 
16
- let evt: CommitEvt
17
-
18
- // If event is too big (max 200 ops or 1MB of data)
19
- if (commitData.ops.length > 200 || blocksToSend.byteSize > 1000000) {
20
- const justRoot = new BlockMap()
21
- const rootBlock = blocksToSend.get(commitData.cid)
22
- if (rootBlock) {
23
- justRoot.set(commitData.cid, rootBlock)
24
- }
25
-
26
- evt = {
27
- rebase: false,
28
- tooBig: true,
29
- repo: did,
30
- commit: commitData.cid,
31
- rev: commitData.rev,
32
- since: commitData.since,
33
- blocks: await blocksToCarFile(commitData.cid, justRoot),
34
- ops: [],
35
- blobs: [],
36
- prevData: commitData.prevData ?? undefined,
37
- }
38
- } else {
39
- evt = {
40
- rebase: false,
41
- tooBig: false,
42
- repo: did,
43
- commit: commitData.cid,
44
- rev: commitData.rev,
45
- since: commitData.since,
46
- blocks: await blocksToCarFile(commitData.cid, blocksToSend),
47
- ops: commitData.ops,
48
- blobs: commitData.blobs.toList(),
49
- prevData: commitData.prevData ?? undefined,
50
- }
16
+ const evt = {
17
+ repo: did,
18
+ commit: commitData.cid,
19
+ rev: commitData.rev,
20
+ since: commitData.since,
21
+ blocks: await blocksToCarFile(commitData.cid, blocksToSend),
22
+ ops: commitData.ops,
23
+ prevData: commitData.prevData ?? undefined,
24
+ // deprecated (but still required) fields
25
+ rebase: false,
26
+ tooBig: false,
27
+ blobs: [],
51
28
  }
52
29
 
53
30
  return {
@@ -58,17 +35,19 @@ export const formatSeqCommit = async (
58
35
  }
59
36
  }
60
37
 
61
- export const formatSeqHandleUpdate = async (
38
+ export const formatSeqSyncEvt = async (
62
39
  did: string,
63
- handle: string,
40
+ data: SyncEvtData,
64
41
  ): Promise<RepoSeqInsert> => {
65
- const evt: HandleEvt = {
42
+ const blocks = await blocksToCarFile(data.cid, data.blocks)
43
+ const evt: SyncEvt = {
66
44
  did,
67
- handle,
45
+ rev: data.rev,
46
+ blocks,
68
47
  }
69
48
  return {
70
49
  did,
71
- eventType: 'handle',
50
+ eventType: 'sync',
72
51
  event: cborEncode(evt),
73
52
  sequencedAt: new Date().toISOString(),
74
53
  }
@@ -112,20 +91,6 @@ export const formatSeqAccountEvt = async (
112
91
  }
113
92
  }
114
93
 
115
- export const formatSeqTombstone = async (
116
- did: string,
117
- ): Promise<RepoSeqInsert> => {
118
- const evt: TombstoneEvt = {
119
- did,
120
- }
121
- return {
122
- did,
123
- eventType: 'tombstone',
124
- event: cborEncode(evt),
125
- sequencedAt: new Date().toISOString(),
126
- }
127
- }
128
-
129
94
  export const commitEvtOp = z.object({
130
95
  action: z.union([
131
96
  z.literal('create'),
@@ -152,11 +117,12 @@ export const commitEvt = z.object({
152
117
  })
153
118
  export type CommitEvt = z.infer<typeof commitEvt>
154
119
 
155
- export const handleEvt = z.object({
120
+ export const syncEvt = z.object({
156
121
  did: z.string(),
157
- handle: z.string(),
122
+ blocks: schema.bytes,
123
+ rev: z.string(),
158
124
  })
159
- export type HandleEvt = z.infer<typeof handleEvt>
125
+ export type SyncEvt = z.infer<typeof syncEvt>
160
126
 
161
127
  export const identityEvt = z.object({
162
128
  did: z.string(),
@@ -178,22 +144,17 @@ export const accountEvt = z.object({
178
144
  })
179
145
  export type AccountEvt = z.infer<typeof accountEvt>
180
146
 
181
- export const tombstoneEvt = z.object({
182
- did: z.string(),
183
- })
184
- export type TombstoneEvt = z.infer<typeof tombstoneEvt>
185
-
186
147
  type TypedCommitEvt = {
187
148
  type: 'commit'
188
149
  seq: number
189
150
  time: string
190
151
  evt: CommitEvt
191
152
  }
192
- type TypedHandleEvt = {
193
- type: 'handle'
153
+ type TypedSyncEvt = {
154
+ type: 'sync'
194
155
  seq: number
195
156
  time: string
196
- evt: HandleEvt
157
+ evt: SyncEvt
197
158
  }
198
159
  type TypedIdentityEvt = {
199
160
  type: 'identity'
@@ -207,15 +168,8 @@ type TypedAccountEvt = {
207
168
  time: string
208
169
  evt: AccountEvt
209
170
  }
210
- type TypedTombstoneEvt = {
211
- type: 'tombstone'
212
- seq: number
213
- time: string
214
- evt: TombstoneEvt
215
- }
216
171
  export type SeqEvt =
217
172
  | TypedCommitEvt
218
- | TypedHandleEvt
173
+ | TypedSyncEvt
219
174
  | TypedIdentityEvt
220
175
  | TypedAccountEvt
221
- | TypedTombstoneEvt
@@ -4,7 +4,7 @@ import { SECOND, cborDecode, wait } from '@atproto/common'
4
4
  import { AccountStatus } from '../account-manager/helpers/account'
5
5
  import { Crawlers } from '../crawlers'
6
6
  import { seqLogger as log } from '../logger'
7
- import { CommitDataWithOps } from '../repo'
7
+ import { CommitDataWithOps, SyncEvtData } from '../repo'
8
8
  import {
9
9
  RepoSeqEntry,
10
10
  RepoSeqInsert,
@@ -15,15 +15,13 @@ import {
15
15
  import {
16
16
  AccountEvt,
17
17
  CommitEvt,
18
- HandleEvt,
19
18
  IdentityEvt,
20
19
  SeqEvt,
21
- TombstoneEvt,
20
+ SyncEvt,
22
21
  formatSeqAccountEvt,
23
22
  formatSeqCommit,
24
- formatSeqHandleUpdate,
25
23
  formatSeqIdentityEvt,
26
- formatSeqTombstone,
24
+ formatSeqSyncEvt,
27
25
  } from './events'
28
26
 
29
27
  export * from './events'
@@ -135,19 +133,19 @@ export class Sequencer extends (EventEmitter as new () => SequencerEmitter) {
135
133
  continue
136
134
  }
137
135
  const evt = cborDecode(row.event)
138
- if (row.eventType === 'append' || row.eventType === 'rebase') {
136
+ if (row.eventType === 'append') {
139
137
  seqEvts.push({
140
138
  type: 'commit',
141
139
  seq: row.seq,
142
140
  time: row.sequencedAt,
143
141
  evt: evt as CommitEvt,
144
142
  })
145
- } else if (row.eventType === 'handle') {
143
+ } else if (row.eventType === 'sync') {
146
144
  seqEvts.push({
147
- type: 'handle',
145
+ type: 'sync',
148
146
  seq: row.seq,
149
147
  time: row.sequencedAt,
150
- evt: evt as HandleEvt,
148
+ evt: evt as SyncEvt,
151
149
  })
152
150
  } else if (row.eventType === 'identity') {
153
151
  seqEvts.push({
@@ -163,13 +161,6 @@ export class Sequencer extends (EventEmitter as new () => SequencerEmitter) {
163
161
  time: row.sequencedAt,
164
162
  evt: evt as AccountEvt,
165
163
  })
166
- } else if (row.eventType === 'tombstone') {
167
- seqEvts.push({
168
- type: 'tombstone',
169
- seq: row.seq,
170
- time: row.sequencedAt,
171
- evt: evt as TombstoneEvt,
172
- })
173
164
  }
174
165
  }
175
166
 
@@ -222,8 +213,8 @@ export class Sequencer extends (EventEmitter as new () => SequencerEmitter) {
222
213
  return await this.sequenceEvt(evt)
223
214
  }
224
215
 
225
- async sequenceHandleUpdate(did: string, handle: string): Promise<number> {
226
- const evt = await formatSeqHandleUpdate(did, handle)
216
+ async sequenceSyncEvt(did: string, data: SyncEvtData) {
217
+ const evt = await formatSeqSyncEvt(did, data)
227
218
  return await this.sequenceEvt(evt)
228
219
  }
229
220
 
@@ -240,11 +231,6 @@ export class Sequencer extends (EventEmitter as new () => SequencerEmitter) {
240
231
  return await this.sequenceEvt(evt)
241
232
  }
242
233
 
243
- async sequenceTombstone(did: string): Promise<number> {
244
- const evt = await formatSeqTombstone(did)
245
- return await this.sequenceEvt(evt)
246
- }
247
-
248
234
  async deleteAllForUser(did: string, excludingSeqs: number[] = []) {
249
235
  await this.db.executeWithRetry(
250
236
  this.db.db
@@ -151,14 +151,12 @@ describe('account deletion', () => {
151
151
  expect(
152
152
  updatedDbContents.repoSeqs
153
153
  .filter((row) => row.did === carol.did)
154
- .every(
155
- (row) => row.eventType === 'tombstone' || row.eventType === 'account',
156
- ),
154
+ .every((row) => row.eventType === 'account'),
157
155
  ).toBe(true)
158
- // check we do have a tombstone for this did
156
+ // check we do have a account (deletion) event for this did
159
157
  expect(
160
158
  updatedDbContents.repoSeqs.filter(
161
- (row) => row.did === carol.did && row.eventType === 'tombstone',
159
+ (row) => row.did === carol.did && row.eventType === 'account',
162
160
  ).length,
163
161
  ).toEqual(1)
164
162
  expect(updatedDbContents.appPasswords).toEqual(