@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.
- package/CHANGELOG.md +14 -0
- package/dist/api/util.d.ts.map +1 -1
- package/dist/api/util.js +2 -0
- package/dist/api/util.js.map +1 -1
- package/dist/lexicon/index.d.ts +2 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +4 -0
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +145 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +225 -4
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/chat/bsky/convo/defs.d.ts +1 -1
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/admin/defs.js.map +1 -1
- package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/server/createSession.d.ts +3 -0
- package/dist/lexicon/types/com/atproto/server/createSession.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/server/getSession.d.ts +3 -0
- package/dist/lexicon/types/com/atproto/server/getSession.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +3 -0
- package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/getBlob.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/sync/getBlob.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/getBlocks.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/sync/getBlocks.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/getLatestCommit.d.ts +1 -1
- package/dist/lexicon/types/com/atproto/sync/getLatestCommit.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/getRecord.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/sync/getRecord.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/getRepo.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/sync/getRepo.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/getRepoStatus.d.ts +42 -0
- package/dist/lexicon/types/com/atproto/sync/getRepoStatus.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/sync/getRepoStatus.js +3 -0
- package/dist/lexicon/types/com/atproto/sync/getRepoStatus.js.map +1 -0
- package/dist/lexicon/types/com/atproto/sync/listBlobs.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/sync/listBlobs.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts +3 -0
- 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 +19 -4
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js +11 -1
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts +2 -0
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.js.map +1 -1
- package/dist/mod-service/index.d.ts +2 -2
- package/dist/mod-service/status.d.ts +1 -1
- package/package.json +3 -3
- package/src/api/util.ts +2 -0
- package/src/lexicon/index.ts +12 -0
- package/src/lexicon/lexicons.ts +236 -7
- package/src/lexicon/types/chat/bsky/convo/defs.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/defs.ts +1 -0
- package/src/lexicon/types/com/atproto/admin/getSubjectStatus.ts +1 -0
- package/src/lexicon/types/com/atproto/server/createSession.ts +3 -0
- package/src/lexicon/types/com/atproto/server/getSession.ts +3 -0
- package/src/lexicon/types/com/atproto/server/refreshSession.ts +3 -0
- package/src/lexicon/types/com/atproto/sync/getBlob.ts +6 -0
- package/src/lexicon/types/com/atproto/sync/getBlocks.ts +6 -0
- package/src/lexicon/types/com/atproto/sync/getLatestCommit.ts +1 -1
- package/src/lexicon/types/com/atproto/sync/getRecord.ts +6 -0
- package/src/lexicon/types/com/atproto/sync/getRepo.ts +1 -0
- package/src/lexicon/types/com/atproto/sync/getRepoStatus.ts +52 -0
- package/src/lexicon/types/com/atproto/sync/listBlobs.ts +1 -0
- package/src/lexicon/types/com/atproto/sync/listRepos.ts +3 -0
- package/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +30 -3
- package/src/lexicon/types/tools/ozone/moderation/defs.ts +2 -0
- 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
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
|
package/tests/get-repo.test.ts
CHANGED
|
@@ -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' },
|