@atproto/ozone 0.1.18 → 0.1.20

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 (73) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/api/util.d.ts.map +1 -1
  3. package/dist/api/util.js +2 -0
  4. package/dist/api/util.js.map +1 -1
  5. package/dist/lexicon/index.d.ts +2 -0
  6. package/dist/lexicon/index.d.ts.map +1 -1
  7. package/dist/lexicon/index.js +4 -0
  8. package/dist/lexicon/index.js.map +1 -1
  9. package/dist/lexicon/lexicons.d.ts +145 -0
  10. package/dist/lexicon/lexicons.d.ts.map +1 -1
  11. package/dist/lexicon/lexicons.js +225 -4
  12. package/dist/lexicon/lexicons.js.map +1 -1
  13. package/dist/lexicon/types/chat/bsky/convo/defs.d.ts +1 -1
  14. package/dist/lexicon/types/com/atproto/admin/defs.d.ts +1 -0
  15. package/dist/lexicon/types/com/atproto/admin/defs.d.ts.map +1 -1
  16. package/dist/lexicon/types/com/atproto/admin/defs.js.map +1 -1
  17. package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts +1 -0
  18. package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts.map +1 -1
  19. package/dist/lexicon/types/com/atproto/server/createSession.d.ts +3 -0
  20. package/dist/lexicon/types/com/atproto/server/createSession.d.ts.map +1 -1
  21. package/dist/lexicon/types/com/atproto/server/getSession.d.ts +3 -0
  22. package/dist/lexicon/types/com/atproto/server/getSession.d.ts.map +1 -1
  23. package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +3 -0
  24. package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts.map +1 -1
  25. package/dist/lexicon/types/com/atproto/sync/getBlob.d.ts +1 -0
  26. package/dist/lexicon/types/com/atproto/sync/getBlob.d.ts.map +1 -1
  27. package/dist/lexicon/types/com/atproto/sync/getBlocks.d.ts +1 -0
  28. package/dist/lexicon/types/com/atproto/sync/getBlocks.d.ts.map +1 -1
  29. package/dist/lexicon/types/com/atproto/sync/getLatestCommit.d.ts +1 -1
  30. package/dist/lexicon/types/com/atproto/sync/getLatestCommit.d.ts.map +1 -1
  31. package/dist/lexicon/types/com/atproto/sync/getRecord.d.ts +1 -0
  32. package/dist/lexicon/types/com/atproto/sync/getRecord.d.ts.map +1 -1
  33. package/dist/lexicon/types/com/atproto/sync/getRepo.d.ts +1 -0
  34. package/dist/lexicon/types/com/atproto/sync/getRepo.d.ts.map +1 -1
  35. package/dist/lexicon/types/com/atproto/sync/getRepoStatus.d.ts +42 -0
  36. package/dist/lexicon/types/com/atproto/sync/getRepoStatus.d.ts.map +1 -0
  37. package/dist/lexicon/types/com/atproto/sync/getRepoStatus.js +3 -0
  38. package/dist/lexicon/types/com/atproto/sync/getRepoStatus.js.map +1 -0
  39. package/dist/lexicon/types/com/atproto/sync/listBlobs.d.ts +1 -0
  40. package/dist/lexicon/types/com/atproto/sync/listBlobs.d.ts.map +1 -1
  41. package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts +3 -0
  42. package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts.map +1 -1
  43. package/dist/lexicon/types/com/atproto/sync/listRepos.js.map +1 -1
  44. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts +19 -4
  45. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
  46. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js +11 -1
  47. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js.map +1 -1
  48. package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts +2 -0
  49. package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts.map +1 -1
  50. package/dist/lexicon/types/tools/ozone/moderation/defs.js.map +1 -1
  51. package/dist/mod-service/index.d.ts +2 -2
  52. package/dist/mod-service/status.d.ts +1 -1
  53. package/package.json +3 -3
  54. package/src/api/util.ts +2 -0
  55. package/src/lexicon/index.ts +12 -0
  56. package/src/lexicon/lexicons.ts +236 -7
  57. package/src/lexicon/types/chat/bsky/convo/defs.ts +1 -1
  58. package/src/lexicon/types/com/atproto/admin/defs.ts +1 -0
  59. package/src/lexicon/types/com/atproto/admin/getSubjectStatus.ts +1 -0
  60. package/src/lexicon/types/com/atproto/server/createSession.ts +3 -0
  61. package/src/lexicon/types/com/atproto/server/getSession.ts +3 -0
  62. package/src/lexicon/types/com/atproto/server/refreshSession.ts +3 -0
  63. package/src/lexicon/types/com/atproto/sync/getBlob.ts +6 -0
  64. package/src/lexicon/types/com/atproto/sync/getBlocks.ts +6 -0
  65. package/src/lexicon/types/com/atproto/sync/getLatestCommit.ts +1 -1
  66. package/src/lexicon/types/com/atproto/sync/getRecord.ts +6 -0
  67. package/src/lexicon/types/com/atproto/sync/getRepo.ts +1 -0
  68. package/src/lexicon/types/com/atproto/sync/getRepoStatus.ts +52 -0
  69. package/src/lexicon/types/com/atproto/sync/listBlobs.ts +1 -0
  70. package/src/lexicon/types/com/atproto/sync/listRepos.ts +3 -0
  71. package/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +30 -3
  72. package/src/lexicon/types/tools/ozone/moderation/defs.ts +2 -0
  73. package/tests/get-repo.test.ts +13 -0
@@ -16,6 +16,7 @@ export interface QueryParams {
16
16
  export type OutputSchema =
17
17
  | Commit
18
18
  | Identity
19
+ | Account
19
20
  | Handle
20
21
  | Migrate
21
22
  | Tombstone
@@ -77,6 +78,8 @@ export interface Identity {
77
78
  seq: number
78
79
  did: string
79
80
  time: string
81
+ /** The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details. */
82
+ handle?: string
80
83
  [k: string]: unknown
81
84
  }
82
85
 
@@ -92,7 +95,31 @@ export function validateIdentity(v: unknown): ValidationResult {
92
95
  return lexicons.validate('com.atproto.sync.subscribeRepos#identity', v)
93
96
  }
94
97
 
95
- /** Represents an update of the account's handle, or transition to/from invalid state. NOTE: Will be deprecated in favor of #identity. */
98
+ /** Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active. */
99
+ export interface Account {
100
+ seq: number
101
+ did: string
102
+ time: string
103
+ /** Indicates that the account has a repository which can be fetched from the host that emitted this event. */
104
+ active: boolean
105
+ /** If active=false, this optional field indicates a reason for why the account is not active. */
106
+ status?: 'takendown' | 'suspended' | 'deleted' | 'deactivated' | (string & {})
107
+ [k: string]: unknown
108
+ }
109
+
110
+ export function isAccount(v: unknown): v is Account {
111
+ return (
112
+ isObj(v) &&
113
+ hasProp(v, '$type') &&
114
+ v.$type === 'com.atproto.sync.subscribeRepos#account'
115
+ )
116
+ }
117
+
118
+ export function validateAccount(v: unknown): ValidationResult {
119
+ return lexicons.validate('com.atproto.sync.subscribeRepos#account', v)
120
+ }
121
+
122
+ /** DEPRECATED -- Use #identity event instead */
96
123
  export interface Handle {
97
124
  seq: number
98
125
  did: string
@@ -113,7 +140,7 @@ export function validateHandle(v: unknown): ValidationResult {
113
140
  return lexicons.validate('com.atproto.sync.subscribeRepos#handle', v)
114
141
  }
115
142
 
116
- /** Represents an account moving from one PDS instance to another. NOTE: not implemented; account migration uses #identity instead */
143
+ /** DEPRECATED -- Use #account event instead */
117
144
  export interface Migrate {
118
145
  seq: number
119
146
  did: string
@@ -134,7 +161,7 @@ export function validateMigrate(v: unknown): ValidationResult {
134
161
  return lexicons.validate('com.atproto.sync.subscribeRepos#migrate', v)
135
162
  }
136
163
 
137
- /** Indicates that an account has been deleted. NOTE: may be deprecated in favor of #identity or a future #account event */
164
+ /** DEPRECATED -- Use #account event instead */
138
165
  export interface Tombstone {
139
166
  seq: number
140
167
  did: string
@@ -478,6 +478,7 @@ export interface RepoView {
478
478
  invitedBy?: ComAtprotoServerDefs.InviteCode
479
479
  invitesDisabled?: boolean
480
480
  inviteNote?: string
481
+ deactivatedAt?: string
481
482
  [k: string]: unknown
482
483
  }
483
484
 
@@ -506,6 +507,7 @@ export interface RepoViewDetail {
506
507
  invitesDisabled?: boolean
507
508
  inviteNote?: string
508
509
  emailConfirmedAt?: string
510
+ deactivatedAt?: string
509
511
  [k: string]: unknown
510
512
  }
511
513
 
@@ -30,6 +30,10 @@ describe('admin get repo view', () => {
30
30
  sc = network.getSeedClient()
31
31
  modClient = ozone.getModClient()
32
32
  await basicSeed(sc)
33
+ await pdsAgent.com.atproto.server.deactivateAccount(
34
+ {},
35
+ { encoding: 'application/json', headers: sc.getHeaders(sc.dids.dan) },
36
+ )
33
37
  await network.processAll()
34
38
  })
35
39
 
@@ -133,6 +137,15 @@ describe('admin get repo view', () => {
133
137
  ).toBeGreaterThan(timestampBeforeVerification)
134
138
  })
135
139
 
140
+ it('returns deactivation state', async () => {
141
+ const res = await agent.api.tools.ozone.moderation.getRepo(
142
+ { did: sc.dids.dan },
143
+ { headers: await ozone.modHeaders() },
144
+ )
145
+
146
+ expect(res.data.deactivatedAt).toBeDefined()
147
+ })
148
+
136
149
  it('fails when repo does not exist.', async () => {
137
150
  const promise = agent.api.tools.ozone.moderation.getRepo(
138
151
  { did: 'did:plc:doesnotexist' },