@atproto/ozone 0.1.107 → 0.1.109
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 +27 -0
- package/dist/api/health.js +1 -1
- package/dist/api/health.js.map +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +6 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/server/getConfig.d.ts.map +1 -1
- package/dist/api/server/getConfig.js +1 -0
- package/dist/api/server/getConfig.js.map +1 -1
- package/dist/api/setting/removeOptions.d.ts.map +1 -1
- package/dist/api/setting/removeOptions.js +1 -0
- package/dist/api/setting/removeOptions.js.map +1 -1
- package/dist/api/setting/upsertOption.js +7 -0
- package/dist/api/setting/upsertOption.js.map +1 -1
- package/dist/api/util.d.ts +1 -1
- package/dist/api/util.d.ts.map +1 -1
- package/dist/api/util.js +6 -1
- package/dist/api/util.js.map +1 -1
- package/dist/api/verification/grantVerifications.d.ts +4 -0
- package/dist/api/verification/grantVerifications.d.ts.map +1 -0
- package/dist/api/verification/grantVerifications.js +60 -0
- package/dist/api/verification/grantVerifications.js.map +1 -0
- package/dist/api/verification/listVerifications.d.ts +4 -0
- package/dist/api/verification/listVerifications.d.ts.map +1 -0
- package/dist/api/verification/listVerifications.js +32 -0
- package/dist/api/verification/listVerifications.js.map +1 -0
- package/dist/api/verification/revokeVerifications.d.ts +4 -0
- package/dist/api/verification/revokeVerifications.d.ts.map +1 -0
- package/dist/api/verification/revokeVerifications.js +36 -0
- package/dist/api/verification/revokeVerifications.js.map +1 -0
- package/dist/auth-verifier.d.ts +4 -1
- package/dist/auth-verifier.d.ts.map +1 -1
- package/dist/auth-verifier.js +4 -3
- package/dist/auth-verifier.js.map +1 -1
- package/dist/background.d.ts +3 -1
- package/dist/background.d.ts.map +1 -1
- package/dist/background.js +4 -3
- package/dist/background.js.map +1 -1
- package/dist/config/config.d.ts +9 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +10 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/env.d.ts +5 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +5 -0
- package/dist/config/env.js.map +1 -1
- package/dist/context.d.ts +6 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +12 -0
- package/dist/context.js.map +1 -1
- package/dist/daemon/context.d.ts +3 -0
- package/dist/daemon/context.d.ts.map +1 -1
- package/dist/daemon/context.js +11 -0
- package/dist/daemon/context.js.map +1 -1
- package/dist/daemon/verification-listener.d.ts +29 -0
- package/dist/daemon/verification-listener.d.ts.map +1 -0
- package/dist/daemon/verification-listener.js +171 -0
- package/dist/daemon/verification-listener.js.map +1 -0
- package/dist/db/migrations/20250415T201720309Z-verification.d.ts +4 -0
- package/dist/db/migrations/20250415T201720309Z-verification.d.ts.map +1 -0
- package/dist/db/migrations/20250415T201720309Z-verification.js +35 -0
- package/dist/db/migrations/20250415T201720309Z-verification.js.map +1 -0
- package/dist/db/migrations/20250417T201720309Z-firehose-cursor.d.ts +4 -0
- package/dist/db/migrations/20250417T201720309Z-firehose-cursor.d.ts.map +1 -0
- package/dist/db/migrations/20250417T201720309Z-firehose-cursor.js +17 -0
- package/dist/db/migrations/20250417T201720309Z-firehose-cursor.js.map +1 -0
- package/dist/db/migrations/index.d.ts +2 -0
- package/dist/db/migrations/index.d.ts.map +1 -1
- package/dist/db/migrations/index.js +3 -1
- package/dist/db/migrations/index.js.map +1 -1
- package/dist/db/pagination.d.ts +15 -0
- package/dist/db/pagination.d.ts.map +1 -1
- package/dist/db/pagination.js +23 -1
- package/dist/db/pagination.js.map +1 -1
- package/dist/db/schema/firehose_cursor.d.ts +11 -0
- package/dist/db/schema/firehose_cursor.d.ts.map +1 -0
- package/dist/db/schema/firehose_cursor.js +5 -0
- package/dist/db/schema/firehose_cursor.js.map +1 -0
- package/dist/db/schema/index.d.ts +3 -1
- package/dist/db/schema/index.d.ts.map +1 -1
- package/dist/db/schema/member.d.ts +1 -1
- package/dist/db/schema/member.d.ts.map +1 -1
- package/dist/db/schema/verification.d.ts +19 -0
- package/dist/db/schema/verification.d.ts.map +1 -0
- package/dist/db/schema/verification.js +5 -0
- package/dist/db/schema/verification.js.map +1 -0
- package/dist/error.js +1 -1
- package/dist/error.js.map +1 -1
- package/dist/jetstream/service.d.ts +60 -0
- package/dist/jetstream/service.d.ts.map +1 -0
- package/dist/jetstream/service.js +65 -0
- package/dist/jetstream/service.js.map +1 -0
- package/dist/lexicon/index.d.ts +15 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +36 -1
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +918 -98
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +434 -0
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +21 -0
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js +9 -0
- package/dist/lexicon/types/app/bsky/actor/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/status.d.ts +23 -0
- package/dist/lexicon/types/app/bsky/actor/status.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/actor/status.js +19 -0
- package/dist/lexicon/types/app/bsky/actor/status.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/server/getConfig.d.ts +3 -1
- package/dist/lexicon/types/tools/ozone/server/getConfig.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/server/getConfig.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/setting/defs.d.ts +1 -1
- package/dist/lexicon/types/tools/ozone/setting/defs.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/setting/defs.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/setting/upsertOption.d.ts +1 -1
- package/dist/lexicon/types/tools/ozone/setting/upsertOption.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/team/addMember.d.ts +1 -1
- package/dist/lexicon/types/tools/ozone/team/addMember.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/team/defs.d.ts +3 -1
- package/dist/lexicon/types/tools/ozone/team/defs.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/team/defs.js +3 -1
- package/dist/lexicon/types/tools/ozone/team/defs.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/team/updateMember.d.ts +1 -1
- package/dist/lexicon/types/tools/ozone/team/updateMember.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/verification/defs.d.ts +43 -0
- package/dist/lexicon/types/tools/ozone/verification/defs.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/verification/defs.js +16 -0
- package/dist/lexicon/types/tools/ozone/verification/defs.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/verification/grantVerifications.d.ts +66 -0
- package/dist/lexicon/types/tools/ozone/verification/grantVerifications.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/verification/grantVerifications.js +25 -0
- package/dist/lexicon/types/tools/ozone/verification/grantVerifications.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/verification/listVerifications.d.ts +52 -0
- package/dist/lexicon/types/tools/ozone/verification/listVerifications.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/verification/listVerifications.js +7 -0
- package/dist/lexicon/types/tools/ozone/verification/listVerifications.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/verification/revokeVerifications.d.ts +56 -0
- package/dist/lexicon/types/tools/ozone/verification/revokeVerifications.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/verification/revokeVerifications.js +16 -0
- package/dist/lexicon/types/tools/ozone/verification/revokeVerifications.js.map +1 -0
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +2 -1
- package/dist/logger.js.map +1 -1
- package/dist/mod-service/index.js +1 -1
- package/dist/mod-service/index.js.map +1 -1
- package/dist/mod-service/status.d.ts +6 -0
- package/dist/mod-service/status.d.ts.map +1 -1
- package/dist/mod-service/views.d.ts.map +1 -1
- package/dist/mod-service/views.js +2 -0
- package/dist/mod-service/views.js.map +1 -1
- package/dist/team/index.d.ts +1 -0
- package/dist/team/index.d.ts.map +1 -1
- package/dist/team/index.js +5 -2
- package/dist/team/index.js.map +1 -1
- package/dist/verification/issuer.d.ts +37 -0
- package/dist/verification/issuer.d.ts.map +1 -0
- package/dist/verification/issuer.js +119 -0
- package/dist/verification/issuer.js.map +1 -0
- package/dist/verification/service.d.ts +47 -0
- package/dist/verification/service.d.ts.map +1 -0
- package/dist/verification/service.js +141 -0
- package/dist/verification/service.js.map +1 -0
- package/dist/verification/util.d.ts +6 -0
- package/dist/verification/util.d.ts.map +1 -0
- package/dist/verification/util.js +32 -0
- package/dist/verification/util.js.map +1 -0
- package/package.json +10 -9
- package/src/api/health.ts +1 -1
- package/src/api/index.ts +6 -0
- package/src/api/server/getConfig.ts +1 -0
- package/src/api/setting/removeOptions.ts +1 -0
- package/src/api/setting/upsertOption.ts +7 -0
- package/src/api/util.ts +7 -1
- package/src/api/verification/grantVerifications.ts +90 -0
- package/src/api/verification/listVerifications.ts +44 -0
- package/src/api/verification/revokeVerifications.ts +43 -0
- package/src/auth-verifier.ts +8 -4
- package/src/background.ts +8 -3
- package/src/config/config.ts +21 -0
- package/src/config/env.ts +10 -0
- package/src/context.ts +22 -0
- package/src/daemon/context.ts +19 -0
- package/src/daemon/verification-listener.ts +164 -0
- package/src/db/migrations/20250415T201720309Z-verification.ts +34 -0
- package/src/db/migrations/20250417T201720309Z-firehose-cursor.ts +16 -0
- package/src/db/migrations/index.ts +2 -0
- package/src/db/pagination.ts +31 -0
- package/src/db/schema/firehose_cursor.ts +13 -0
- package/src/db/schema/index.ts +5 -1
- package/src/db/schema/member.ts +1 -0
- package/src/db/schema/verification.ts +21 -0
- package/src/error.ts +1 -1
- package/src/jetstream/service.ts +104 -0
- package/src/lexicon/index.ts +50 -0
- package/src/lexicon/lexicons.ts +457 -0
- package/src/lexicon/types/app/bsky/actor/defs.ts +26 -0
- package/src/lexicon/types/app/bsky/actor/status.ts +40 -0
- package/src/lexicon/types/tools/ozone/server/getConfig.ts +3 -0
- package/src/lexicon/types/tools/ozone/setting/defs.ts +1 -0
- package/src/lexicon/types/tools/ozone/setting/upsertOption.ts +1 -0
- package/src/lexicon/types/tools/ozone/team/addMember.ts +1 -0
- package/src/lexicon/types/tools/ozone/team/defs.ts +3 -0
- package/src/lexicon/types/tools/ozone/team/updateMember.ts +1 -0
- package/src/lexicon/types/tools/ozone/verification/defs.ts +59 -0
- package/src/lexicon/types/tools/ozone/verification/grantVerifications.ts +100 -0
- package/src/lexicon/types/tools/ozone/verification/listVerifications.ts +70 -0
- package/src/lexicon/types/tools/ozone/verification/revokeVerifications.ts +81 -0
- package/src/logger.ts +2 -0
- package/src/mod-service/index.ts +1 -1
- package/src/mod-service/views.ts +4 -0
- package/src/team/index.ts +6 -5
- package/src/verification/issuer.ts +135 -0
- package/src/verification/service.ts +208 -0
- package/src/verification/util.ts +50 -0
- package/tests/__snapshots__/verification-listener.test.ts.snap +146 -0
- package/tests/__snapshots__/verification.test.ts.snap +288 -0
- package/tests/expiring-label.test.ts +72 -0
- package/tests/verification-listener.test.ts +102 -0
- package/tests/verification.test.ts +166 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.tests.tsbuildinfo +1 -1
package/src/db/pagination.ts
CHANGED
|
@@ -173,6 +173,37 @@ export class TimeIdKeyset extends GenericKeyset<TimeIdKeysetParam, Cursor> {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
type CreatedAtUriKeysetParam = {
|
|
177
|
+
createdAt: string
|
|
178
|
+
uri: string
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export class CreatedAtUriKeyset extends GenericKeyset<
|
|
182
|
+
CreatedAtUriKeysetParam,
|
|
183
|
+
Cursor
|
|
184
|
+
> {
|
|
185
|
+
labelResult(result: CreatedAtUriKeysetParam): Cursor
|
|
186
|
+
labelResult(result: CreatedAtUriKeysetParam) {
|
|
187
|
+
return { primary: result.createdAt, secondary: result.uri }
|
|
188
|
+
}
|
|
189
|
+
labeledResultToCursor(labeled: Cursor) {
|
|
190
|
+
return {
|
|
191
|
+
primary: new Date(labeled.primary).getTime().toString(),
|
|
192
|
+
secondary: labeled.secondary,
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
cursorToLabeledResult(cursor: Cursor) {
|
|
196
|
+
const primaryDate = new Date(parseInt(cursor.primary, 10))
|
|
197
|
+
if (isNaN(primaryDate.getTime())) {
|
|
198
|
+
throw new InvalidRequestError('Malformed cursor')
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
primary: primaryDate.toISOString(),
|
|
202
|
+
secondary: cursor.secondary,
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
176
207
|
export const paginate = <
|
|
177
208
|
QB extends AnyQb,
|
|
178
209
|
K extends GenericKeyset<unknown, any>,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Generated } from 'kysely'
|
|
2
|
+
|
|
3
|
+
export const firehoseCursorTableName = 'firehose_cursor'
|
|
4
|
+
|
|
5
|
+
export interface FirehoseCursor {
|
|
6
|
+
service: string
|
|
7
|
+
cursor: number | null
|
|
8
|
+
updatedAt: Generated<string>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type PartialDB = {
|
|
12
|
+
[firehoseCursorTableName]: FirehoseCursor
|
|
13
|
+
}
|
package/src/db/schema/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import * as accountRecordEventsStats from './account_record_events_stats'
|
|
|
4
4
|
import * as accountRecordStatusStats from './account_record_status_stats'
|
|
5
5
|
import * as blobPushEvent from './blob_push_event'
|
|
6
6
|
import * as communicationTemplate from './communication_template'
|
|
7
|
+
import * as firehoseCursor from './firehose_cursor'
|
|
7
8
|
import * as label from './label'
|
|
8
9
|
import * as member from './member'
|
|
9
10
|
import * as modEvent from './moderation_event'
|
|
@@ -14,6 +15,7 @@ import * as recordPushEvent from './record_push_event'
|
|
|
14
15
|
import * as repoPushEvent from './repo_push_event'
|
|
15
16
|
import * as setting from './setting'
|
|
16
17
|
import * as signingKey from './signing_key'
|
|
18
|
+
import * as verification from './verification'
|
|
17
19
|
|
|
18
20
|
export type DatabaseSchemaType = modEvent.PartialDB &
|
|
19
21
|
modSubjectStatus.PartialDB &
|
|
@@ -29,7 +31,9 @@ export type DatabaseSchemaType = modEvent.PartialDB &
|
|
|
29
31
|
accountEventsStats.PartialDB &
|
|
30
32
|
recordEventsStats.PartialDB &
|
|
31
33
|
accountRecordEventsStats.PartialDB &
|
|
32
|
-
accountRecordStatusStats.PartialDB
|
|
34
|
+
accountRecordStatusStats.PartialDB &
|
|
35
|
+
verification.PartialDB &
|
|
36
|
+
firehoseCursor.PartialDB
|
|
33
37
|
|
|
34
38
|
export type DatabaseSchema = Kysely<DatabaseSchemaType>
|
|
35
39
|
|
package/src/db/schema/member.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Generated } from 'kysely'
|
|
2
|
+
|
|
3
|
+
export const verificationTableName = 'verification'
|
|
4
|
+
|
|
5
|
+
export interface Verification {
|
|
6
|
+
uri: string
|
|
7
|
+
cid: string
|
|
8
|
+
issuer: string
|
|
9
|
+
subject: string
|
|
10
|
+
handle: string
|
|
11
|
+
displayName: string
|
|
12
|
+
revokeReason: string | null
|
|
13
|
+
revokedBy: string | null
|
|
14
|
+
revokedAt: string | null
|
|
15
|
+
createdAt: string
|
|
16
|
+
updatedAt: Generated<string>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type PartialDB = {
|
|
20
|
+
[verificationTableName]: Verification
|
|
21
|
+
}
|
package/src/error.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { XRPCError } from '@atproto/xrpc-server'
|
|
|
3
3
|
import { httpLogger as log } from './logger'
|
|
4
4
|
|
|
5
5
|
export const handler: ErrorRequestHandler = (err, _req, res, next) => {
|
|
6
|
-
log.error(err, 'unexpected internal server error')
|
|
6
|
+
log.error({ err }, 'unexpected internal server error')
|
|
7
7
|
if (res.headersSent) {
|
|
8
8
|
return next(err)
|
|
9
9
|
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { WebSocketKeepAlive } from '@atproto/xrpc-server'
|
|
2
|
+
|
|
3
|
+
type JetstreamRecord = Record<string, unknown>
|
|
4
|
+
type OnCreateCallback<T extends JetstreamRecord> = (
|
|
5
|
+
e: CommitCreateEvent<T>,
|
|
6
|
+
) => Promise<void>
|
|
7
|
+
|
|
8
|
+
export type JetstreamOptions = {
|
|
9
|
+
endpoint: string
|
|
10
|
+
/**
|
|
11
|
+
* The record collections that you want to receive updates for.
|
|
12
|
+
* Leave this empty to receive updates for all record collections.
|
|
13
|
+
*/
|
|
14
|
+
wantedCollections?: string[]
|
|
15
|
+
/**
|
|
16
|
+
* The DIDs that you want to receive updates for.
|
|
17
|
+
* Leave this empty to receive updates for all DIDs.
|
|
18
|
+
*/
|
|
19
|
+
wantedDids?: string[]
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The Unix timestamp in microseconds that you want to receive updates from.
|
|
23
|
+
*/
|
|
24
|
+
cursor?: number
|
|
25
|
+
}
|
|
26
|
+
export type EventBase = {
|
|
27
|
+
did: string
|
|
28
|
+
time_us: number
|
|
29
|
+
// @TODO: Limited to just commit events for now
|
|
30
|
+
kind: 'commit'
|
|
31
|
+
}
|
|
32
|
+
export type CommitBase = {
|
|
33
|
+
collection: string
|
|
34
|
+
rkey: string
|
|
35
|
+
cid: string
|
|
36
|
+
}
|
|
37
|
+
export interface CommitCreateEvent<RecordType extends JetstreamRecord>
|
|
38
|
+
extends EventBase {
|
|
39
|
+
kind: 'commit'
|
|
40
|
+
commit: {
|
|
41
|
+
operation: 'create'
|
|
42
|
+
record: RecordType
|
|
43
|
+
} & CommitBase
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface CommitDeleteEvent extends EventBase {
|
|
47
|
+
kind: 'commit'
|
|
48
|
+
commit: {
|
|
49
|
+
operation: 'delete'
|
|
50
|
+
} & CommitBase
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export class Jetstream {
|
|
54
|
+
public ws?: WebSocketKeepAlive
|
|
55
|
+
public url: URL
|
|
56
|
+
/** The current cursor. */
|
|
57
|
+
public cursor?: number
|
|
58
|
+
|
|
59
|
+
constructor(opts: JetstreamOptions) {
|
|
60
|
+
this.url = new URL(opts.endpoint)
|
|
61
|
+
opts.wantedCollections?.forEach((collection) => {
|
|
62
|
+
this.url.searchParams.append('wantedCollections', collection)
|
|
63
|
+
})
|
|
64
|
+
opts.wantedDids?.forEach((did) => {
|
|
65
|
+
this.url.searchParams.append('wantedDids', did)
|
|
66
|
+
})
|
|
67
|
+
if (opts.cursor) this.cursor = opts.cursor
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async start(options: {
|
|
71
|
+
onCreate?: Record<string, OnCreateCallback<any>>
|
|
72
|
+
onDelete?: Record<string, (e: CommitDeleteEvent) => Promise<void>>
|
|
73
|
+
}) {
|
|
74
|
+
this.ws = new WebSocketKeepAlive({
|
|
75
|
+
getUrl: async () => {
|
|
76
|
+
if (this.cursor)
|
|
77
|
+
this.url.searchParams.set('cursor', this.cursor.toString())
|
|
78
|
+
return this.url.toString()
|
|
79
|
+
},
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
for await (const message of this.ws) {
|
|
83
|
+
const parsedMessage = JSON.parse(message.toString())
|
|
84
|
+
if (parsedMessage.kind === 'commit') {
|
|
85
|
+
const { collection, operation, record } = parsedMessage.commit || {}
|
|
86
|
+
|
|
87
|
+
if (operation === 'create') {
|
|
88
|
+
options.onCreate?.[collection]?.(
|
|
89
|
+
parsedMessage as CommitCreateEvent<typeof record>,
|
|
90
|
+
)
|
|
91
|
+
} else if (operation === 'delete') {
|
|
92
|
+
options.onDelete?.[collection]?.(parsedMessage as CommitDeleteEvent)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Closes the WebSocket connection.
|
|
100
|
+
*/
|
|
101
|
+
close() {
|
|
102
|
+
this.ws?.ws?.close()
|
|
103
|
+
}
|
|
104
|
+
}
|
package/src/lexicon/index.ts
CHANGED
|
@@ -217,6 +217,9 @@ import * as ToolsOzoneTeamAddMember from './types/tools/ozone/team/addMember.js'
|
|
|
217
217
|
import * as ToolsOzoneTeamDeleteMember from './types/tools/ozone/team/deleteMember.js'
|
|
218
218
|
import * as ToolsOzoneTeamListMembers from './types/tools/ozone/team/listMembers.js'
|
|
219
219
|
import * as ToolsOzoneTeamUpdateMember from './types/tools/ozone/team/updateMember.js'
|
|
220
|
+
import * as ToolsOzoneVerificationGrantVerifications from './types/tools/ozone/verification/grantVerifications.js'
|
|
221
|
+
import * as ToolsOzoneVerificationListVerifications from './types/tools/ozone/verification/listVerifications.js'
|
|
222
|
+
import * as ToolsOzoneVerificationRevokeVerifications from './types/tools/ozone/verification/revokeVerifications.js'
|
|
220
223
|
|
|
221
224
|
export const COM_ATPROTO_MODERATION = {
|
|
222
225
|
DefsReasonSpam: 'com.atproto.moderation.defs#reasonSpam',
|
|
@@ -227,6 +230,9 @@ export const COM_ATPROTO_MODERATION = {
|
|
|
227
230
|
DefsReasonOther: 'com.atproto.moderation.defs#reasonOther',
|
|
228
231
|
DefsReasonAppeal: 'com.atproto.moderation.defs#reasonAppeal',
|
|
229
232
|
}
|
|
233
|
+
export const APP_BSKY_ACTOR = {
|
|
234
|
+
StatusLive: 'app.bsky.actor.status#live',
|
|
235
|
+
}
|
|
230
236
|
export const APP_BSKY_FEED = {
|
|
231
237
|
DefsRequestLess: 'app.bsky.feed.defs#requestLess',
|
|
232
238
|
DefsRequestMore: 'app.bsky.feed.defs#requestMore',
|
|
@@ -258,6 +264,7 @@ export const TOOLS_OZONE_TEAM = {
|
|
|
258
264
|
DefsRoleAdmin: 'tools.ozone.team.defs#roleAdmin',
|
|
259
265
|
DefsRoleModerator: 'tools.ozone.team.defs#roleModerator',
|
|
260
266
|
DefsRoleTriage: 'tools.ozone.team.defs#roleTriage',
|
|
267
|
+
DefsRoleVerifier: 'tools.ozone.team.defs#roleVerifier',
|
|
261
268
|
}
|
|
262
269
|
|
|
263
270
|
export function createServer(options?: XrpcOptions): Server {
|
|
@@ -2495,6 +2502,7 @@ export class ToolsOzoneNS {
|
|
|
2495
2502
|
setting: ToolsOzoneSettingNS
|
|
2496
2503
|
signature: ToolsOzoneSignatureNS
|
|
2497
2504
|
team: ToolsOzoneTeamNS
|
|
2505
|
+
verification: ToolsOzoneVerificationNS
|
|
2498
2506
|
|
|
2499
2507
|
constructor(server: Server) {
|
|
2500
2508
|
this._server = server
|
|
@@ -2506,6 +2514,7 @@ export class ToolsOzoneNS {
|
|
|
2506
2514
|
this.setting = new ToolsOzoneSettingNS(server)
|
|
2507
2515
|
this.signature = new ToolsOzoneSignatureNS(server)
|
|
2508
2516
|
this.team = new ToolsOzoneTeamNS(server)
|
|
2517
|
+
this.verification = new ToolsOzoneVerificationNS(server)
|
|
2509
2518
|
}
|
|
2510
2519
|
}
|
|
2511
2520
|
|
|
@@ -2936,6 +2945,47 @@ export class ToolsOzoneTeamNS {
|
|
|
2936
2945
|
}
|
|
2937
2946
|
}
|
|
2938
2947
|
|
|
2948
|
+
export class ToolsOzoneVerificationNS {
|
|
2949
|
+
_server: Server
|
|
2950
|
+
|
|
2951
|
+
constructor(server: Server) {
|
|
2952
|
+
this._server = server
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
grantVerifications<AV extends AuthVerifier>(
|
|
2956
|
+
cfg: ConfigOf<
|
|
2957
|
+
AV,
|
|
2958
|
+
ToolsOzoneVerificationGrantVerifications.Handler<ExtractAuth<AV>>,
|
|
2959
|
+
ToolsOzoneVerificationGrantVerifications.HandlerReqCtx<ExtractAuth<AV>>
|
|
2960
|
+
>,
|
|
2961
|
+
) {
|
|
2962
|
+
const nsid = 'tools.ozone.verification.grantVerifications' // @ts-ignore
|
|
2963
|
+
return this._server.xrpc.method(nsid, cfg)
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2966
|
+
listVerifications<AV extends AuthVerifier>(
|
|
2967
|
+
cfg: ConfigOf<
|
|
2968
|
+
AV,
|
|
2969
|
+
ToolsOzoneVerificationListVerifications.Handler<ExtractAuth<AV>>,
|
|
2970
|
+
ToolsOzoneVerificationListVerifications.HandlerReqCtx<ExtractAuth<AV>>
|
|
2971
|
+
>,
|
|
2972
|
+
) {
|
|
2973
|
+
const nsid = 'tools.ozone.verification.listVerifications' // @ts-ignore
|
|
2974
|
+
return this._server.xrpc.method(nsid, cfg)
|
|
2975
|
+
}
|
|
2976
|
+
|
|
2977
|
+
revokeVerifications<AV extends AuthVerifier>(
|
|
2978
|
+
cfg: ConfigOf<
|
|
2979
|
+
AV,
|
|
2980
|
+
ToolsOzoneVerificationRevokeVerifications.Handler<ExtractAuth<AV>>,
|
|
2981
|
+
ToolsOzoneVerificationRevokeVerifications.HandlerReqCtx<ExtractAuth<AV>>
|
|
2982
|
+
>,
|
|
2983
|
+
) {
|
|
2984
|
+
const nsid = 'tools.ozone.verification.revokeVerifications' // @ts-ignore
|
|
2985
|
+
return this._server.xrpc.method(nsid, cfg)
|
|
2986
|
+
}
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2939
2989
|
type SharedRateLimitOpts<T> = {
|
|
2940
2990
|
name: string
|
|
2941
2991
|
calcKey?: (ctx: T) => string | null
|