@atproto/bsky 0.0.10 → 0.0.12
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 +26 -0
- package/dist/api/com/atproto/admin/util.d.ts +5 -0
- package/dist/config.d.ts +2 -0
- package/dist/context.d.ts +8 -0
- package/dist/db/index.js +51 -2
- package/dist/db/index.js.map +3 -3
- package/dist/db/migrations/20230929T192920807Z-record-cursor-indexes.d.ts +3 -0
- package/dist/db/migrations/index.d.ts +1 -0
- package/dist/did-cache.d.ts +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1818 -580
- package/dist/index.js.map +3 -3
- package/dist/lexicon/index.d.ts +16 -0
- package/dist/lexicon/lexicons.d.ts +330 -3
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts +28 -0
- package/dist/lexicon/types/com/atproto/admin/getAccountInfo.d.ts +29 -0
- package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts +39 -0
- package/dist/lexicon/types/com/atproto/admin/searchRepos.d.ts +0 -1
- package/dist/lexicon/types/com/atproto/admin/updateSubjectStatus.d.ts +46 -0
- package/dist/lexicon/types/com/atproto/server/confirmEmail.d.ts +27 -0
- package/dist/lexicon/types/com/atproto/server/createAccount.d.ts +2 -0
- package/dist/lexicon/types/com/atproto/server/createSession.d.ts +2 -0
- package/dist/lexicon/types/com/atproto/server/getSession.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/server/requestEmailConfirmation.d.ts +19 -0
- package/dist/lexicon/types/com/atproto/server/requestEmailUpdate.d.ts +30 -0
- package/dist/lexicon/types/com/atproto/server/reserveSigningKey.d.ts +30 -0
- package/dist/lexicon/types/com/atproto/server/updateEmail.d.ts +27 -0
- package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts +1 -0
- package/dist/services/actor/index.d.ts +2 -2
- package/dist/services/actor/types.d.ts +1 -0
- package/dist/services/graph/index.d.ts +2 -0
- package/dist/services/moderation/index.d.ts +13 -3
- package/dist/services/util/search.d.ts +3 -3
- package/package.json +13 -14
- package/src/api/app/bsky/actor/searchActors.ts +36 -22
- package/src/api/app/bsky/actor/searchActorsTypeahead.ts +24 -17
- package/src/api/app/bsky/feed/getAuthorFeed.ts +2 -2
- package/src/api/app/bsky/feed/getPostThread.ts +2 -2
- package/src/api/app/bsky/graph/getSuggestedFollowsByActor.ts +1 -0
- package/src/api/app/bsky/notification/listNotifications.ts +33 -22
- package/src/api/com/atproto/admin/getModerationAction.ts +28 -2
- package/src/api/com/atproto/admin/getModerationReport.ts +27 -2
- package/src/api/com/atproto/admin/getRecord.ts +14 -2
- package/src/api/com/atproto/admin/getRepo.ts +13 -2
- package/src/api/com/atproto/admin/reverseModerationAction.ts +31 -5
- package/src/api/com/atproto/admin/searchRepos.ts +6 -12
- package/src/api/com/atproto/admin/takeModerationAction.ts +41 -7
- package/src/api/com/atproto/admin/util.ts +50 -0
- package/src/api/well-known.ts +8 -0
- package/src/auth.ts +12 -5
- package/src/auto-moderator/index.ts +1 -0
- package/src/config.ts +7 -0
- package/src/context.ts +30 -0
- package/src/db/migrations/20230929T192920807Z-record-cursor-indexes.ts +40 -0
- package/src/db/migrations/index.ts +1 -0
- package/src/did-cache.ts +29 -14
- package/src/feed-gen/with-friends.ts +2 -2
- package/src/index.ts +9 -1
- package/src/indexer/subscription.ts +1 -21
- package/src/lexicon/index.ts +96 -0
- package/src/lexicon/lexicons.ts +368 -4
- package/src/lexicon/types/app/bsky/actor/defs.ts +1 -0
- package/src/lexicon/types/com/atproto/admin/defs.ts +61 -0
- package/src/lexicon/types/com/atproto/admin/getAccountInfo.ts +41 -0
- package/src/lexicon/types/com/atproto/admin/getSubjectStatus.ts +54 -0
- package/src/lexicon/types/com/atproto/admin/searchRepos.ts +0 -1
- package/src/lexicon/types/com/atproto/admin/updateSubjectStatus.ts +61 -0
- package/src/lexicon/types/com/atproto/server/confirmEmail.ts +40 -0
- package/src/lexicon/types/com/atproto/server/createAccount.ts +2 -0
- package/src/lexicon/types/com/atproto/server/createSession.ts +2 -0
- package/src/lexicon/types/com/atproto/server/getSession.ts +1 -0
- package/src/lexicon/types/com/atproto/server/refreshSession.ts +1 -0
- package/src/lexicon/types/com/atproto/server/requestEmailConfirmation.ts +31 -0
- package/src/lexicon/types/com/atproto/server/requestEmailUpdate.ts +43 -0
- package/src/lexicon/types/com/atproto/server/reserveSigningKey.ts +44 -0
- package/src/lexicon/types/com/atproto/server/updateEmail.ts +41 -0
- package/src/lexicon/types/com/atproto/sync/listRepos.ts +1 -0
- package/src/logger.ts +8 -0
- package/src/services/actor/index.ts +16 -10
- package/src/services/actor/types.ts +1 -0
- package/src/services/actor/views.ts +26 -8
- package/src/services/graph/index.ts +26 -7
- package/src/services/indexing/index.ts +15 -17
- package/src/services/moderation/index.ts +94 -14
- package/src/services/moderation/views.ts +1 -0
- package/src/services/util/search.ts +24 -23
- package/tests/__snapshots__/feed-generation.test.ts.snap +12 -12
- package/tests/__snapshots__/indexing.test.ts.snap +4 -4
- package/tests/admin/__snapshots__/get-moderation-action.test.ts.snap +172 -0
- package/tests/admin/__snapshots__/get-moderation-actions.test.ts.snap +178 -0
- package/tests/admin/__snapshots__/get-moderation-report.test.ts.snap +177 -0
- package/tests/admin/__snapshots__/get-moderation-reports.test.ts.snap +307 -0
- package/tests/admin/__snapshots__/get-record.test.ts.snap +275 -0
- package/tests/admin/__snapshots__/get-repo.test.ts.snap +103 -0
- package/tests/admin/get-moderation-action.test.ts +100 -0
- package/tests/admin/get-moderation-actions.test.ts +164 -0
- package/tests/admin/get-moderation-report.test.ts +100 -0
- package/tests/admin/get-moderation-reports.test.ts +332 -0
- package/tests/admin/get-record.test.ts +115 -0
- package/tests/admin/get-repo.test.ts +101 -0
- package/tests/{moderation.test.ts → admin/moderation.test.ts} +107 -9
- package/tests/admin/repo-search.test.ts +124 -0
- package/tests/algos/hot-classic.test.ts +3 -5
- package/tests/algos/whats-hot.test.ts +3 -5
- package/tests/algos/with-friends.test.ts +2 -4
- package/tests/auth.test.ts +64 -0
- package/tests/auto-moderator/fuzzy-matcher.test.ts +2 -3
- package/tests/auto-moderator/labeler.test.ts +5 -7
- package/tests/auto-moderator/takedowns.test.ts +11 -12
- package/tests/blob-resolver.test.ts +1 -3
- package/tests/did-cache.test.ts +2 -5
- package/tests/feed-generation.test.ts +8 -6
- package/tests/handle-invalidation.test.ts +2 -3
- package/tests/image/server.test.ts +1 -4
- package/tests/image/sharp.test.ts +1 -1
- package/tests/indexing.test.ts +4 -4
- package/tests/notification-server.test.ts +2 -3
- package/tests/pipeline/backpressure.test.ts +2 -3
- package/tests/pipeline/reingest.test.ts +7 -4
- package/tests/pipeline/repartition.test.ts +2 -3
- package/tests/reprocessing.test.ts +2 -6
- package/tests/seeds/basic.ts +4 -4
- package/tests/seeds/follows.ts +1 -1
- package/tests/seeds/likes.ts +1 -1
- package/tests/seeds/reposts.ts +1 -1
- package/tests/seeds/users-bulk.ts +1 -1
- package/tests/seeds/users.ts +1 -1
- package/tests/server.test.ts +1 -3
- package/tests/subscription/repo.test.ts +2 -4
- package/tests/views/__snapshots__/author-feed.test.ts.snap +24 -24
- package/tests/views/__snapshots__/block-lists.test.ts.snap +42 -7
- package/tests/views/__snapshots__/blocks.test.ts.snap +2 -2
- package/tests/views/__snapshots__/list-feed.test.ts.snap +6 -6
- package/tests/views/__snapshots__/mute-lists.test.ts.snap +15 -4
- package/tests/views/__snapshots__/mutes.test.ts.snap +2 -2
- package/tests/views/__snapshots__/notifications.test.ts.snap +2 -2
- package/tests/views/__snapshots__/posts.test.ts.snap +8 -8
- package/tests/views/__snapshots__/thread.test.ts.snap +10 -10
- package/tests/views/__snapshots__/timeline.test.ts.snap +58 -58
- package/tests/views/actor-likes.test.ts +2 -3
- package/tests/views/actor-search.test.ts +5 -5
- package/tests/views/admin/repo-search.test.ts +2 -4
- package/tests/views/author-feed.test.ts +2 -4
- package/tests/views/block-lists.test.ts +34 -7
- package/tests/views/blocks.test.ts +6 -3
- package/tests/views/follows.test.ts +2 -4
- package/tests/views/likes.test.ts +2 -5
- package/tests/views/list-feed.test.ts +2 -4
- package/tests/views/mute-lists.test.ts +23 -5
- package/tests/views/mutes.test.ts +2 -5
- package/tests/views/notifications.test.ts +2 -4
- package/tests/views/posts.test.ts +2 -5
- package/tests/views/profile.test.ts +4 -5
- package/tests/views/reposts.test.ts +2 -4
- package/tests/views/suggested-follows.test.ts +2 -3
- package/tests/views/suggestions.test.ts +2 -4
- package/tests/views/thread.test.ts +2 -4
- package/tests/views/threadgating.test.ts +2 -3
- package/tests/views/timeline.test.ts +2 -4
- package/dist/env.d.ts +0 -1
- package/example.dev.env +0 -5
- package/src/env.ts +0 -9
- package/tests/seeds/client.ts +0 -466
- /package/tests/{__snapshots__ → admin/__snapshots__}/moderation.test.ts.snap +0 -0
- /package/tests/{image/fixtures → sample-img}/at.png +0 -0
- /package/tests/{image/fixtures → sample-img}/hd-key.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-alt.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-landscape-large.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-landscape-small.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-portrait-large.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-portrait-small.jpg +0 -0
package/src/lexicon/lexicons.ts
CHANGED
|
@@ -8,6 +8,18 @@ export const schemaDict = {
|
|
|
8
8
|
lexicon: 1,
|
|
9
9
|
id: 'com.atproto.admin.defs',
|
|
10
10
|
defs: {
|
|
11
|
+
statusAttr: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
required: ['applied'],
|
|
14
|
+
properties: {
|
|
15
|
+
applied: {
|
|
16
|
+
type: 'boolean',
|
|
17
|
+
},
|
|
18
|
+
ref: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
11
23
|
actionView: {
|
|
12
24
|
type: 'object',
|
|
13
25
|
required: [
|
|
@@ -424,6 +436,44 @@ export const schemaDict = {
|
|
|
424
436
|
},
|
|
425
437
|
},
|
|
426
438
|
},
|
|
439
|
+
accountView: {
|
|
440
|
+
type: 'object',
|
|
441
|
+
required: ['did', 'handle', 'indexedAt'],
|
|
442
|
+
properties: {
|
|
443
|
+
did: {
|
|
444
|
+
type: 'string',
|
|
445
|
+
format: 'did',
|
|
446
|
+
},
|
|
447
|
+
handle: {
|
|
448
|
+
type: 'string',
|
|
449
|
+
format: 'handle',
|
|
450
|
+
},
|
|
451
|
+
email: {
|
|
452
|
+
type: 'string',
|
|
453
|
+
},
|
|
454
|
+
indexedAt: {
|
|
455
|
+
type: 'string',
|
|
456
|
+
format: 'datetime',
|
|
457
|
+
},
|
|
458
|
+
invitedBy: {
|
|
459
|
+
type: 'ref',
|
|
460
|
+
ref: 'lex:com.atproto.server.defs#inviteCode',
|
|
461
|
+
},
|
|
462
|
+
invites: {
|
|
463
|
+
type: 'array',
|
|
464
|
+
items: {
|
|
465
|
+
type: 'ref',
|
|
466
|
+
ref: 'lex:com.atproto.server.defs#inviteCode',
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
invitesDisabled: {
|
|
470
|
+
type: 'boolean',
|
|
471
|
+
},
|
|
472
|
+
inviteNote: {
|
|
473
|
+
type: 'string',
|
|
474
|
+
},
|
|
475
|
+
},
|
|
476
|
+
},
|
|
427
477
|
repoViewNotFound: {
|
|
428
478
|
type: 'object',
|
|
429
479
|
required: ['did'],
|
|
@@ -444,6 +494,24 @@ export const schemaDict = {
|
|
|
444
494
|
},
|
|
445
495
|
},
|
|
446
496
|
},
|
|
497
|
+
repoBlobRef: {
|
|
498
|
+
type: 'object',
|
|
499
|
+
required: ['did', 'cid'],
|
|
500
|
+
properties: {
|
|
501
|
+
did: {
|
|
502
|
+
type: 'string',
|
|
503
|
+
format: 'did',
|
|
504
|
+
},
|
|
505
|
+
cid: {
|
|
506
|
+
type: 'string',
|
|
507
|
+
format: 'cid',
|
|
508
|
+
},
|
|
509
|
+
recordUri: {
|
|
510
|
+
type: 'string',
|
|
511
|
+
format: 'at-uri',
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
},
|
|
447
515
|
recordView: {
|
|
448
516
|
type: 'object',
|
|
449
517
|
required: [
|
|
@@ -730,6 +798,33 @@ export const schemaDict = {
|
|
|
730
798
|
},
|
|
731
799
|
},
|
|
732
800
|
},
|
|
801
|
+
ComAtprotoAdminGetAccountInfo: {
|
|
802
|
+
lexicon: 1,
|
|
803
|
+
id: 'com.atproto.admin.getAccountInfo',
|
|
804
|
+
defs: {
|
|
805
|
+
main: {
|
|
806
|
+
type: 'query',
|
|
807
|
+
description: 'View details about an account.',
|
|
808
|
+
parameters: {
|
|
809
|
+
type: 'params',
|
|
810
|
+
required: ['did'],
|
|
811
|
+
properties: {
|
|
812
|
+
did: {
|
|
813
|
+
type: 'string',
|
|
814
|
+
format: 'did',
|
|
815
|
+
},
|
|
816
|
+
},
|
|
817
|
+
},
|
|
818
|
+
output: {
|
|
819
|
+
encoding: 'application/json',
|
|
820
|
+
schema: {
|
|
821
|
+
type: 'ref',
|
|
822
|
+
ref: 'lex:com.atproto.admin.defs#accountView',
|
|
823
|
+
},
|
|
824
|
+
},
|
|
825
|
+
},
|
|
826
|
+
},
|
|
827
|
+
},
|
|
733
828
|
ComAtprotoAdminGetInviteCodes: {
|
|
734
829
|
lexicon: 1,
|
|
735
830
|
id: 'com.atproto.admin.getInviteCodes',
|
|
@@ -1026,6 +1121,55 @@ export const schemaDict = {
|
|
|
1026
1121
|
},
|
|
1027
1122
|
},
|
|
1028
1123
|
},
|
|
1124
|
+
ComAtprotoAdminGetSubjectStatus: {
|
|
1125
|
+
lexicon: 1,
|
|
1126
|
+
id: 'com.atproto.admin.getSubjectStatus',
|
|
1127
|
+
defs: {
|
|
1128
|
+
main: {
|
|
1129
|
+
type: 'query',
|
|
1130
|
+
description:
|
|
1131
|
+
'Fetch the service-specific the admin status of a subject (account, record, or blob)',
|
|
1132
|
+
parameters: {
|
|
1133
|
+
type: 'params',
|
|
1134
|
+
properties: {
|
|
1135
|
+
did: {
|
|
1136
|
+
type: 'string',
|
|
1137
|
+
format: 'did',
|
|
1138
|
+
},
|
|
1139
|
+
uri: {
|
|
1140
|
+
type: 'string',
|
|
1141
|
+
format: 'at-uri',
|
|
1142
|
+
},
|
|
1143
|
+
blob: {
|
|
1144
|
+
type: 'string',
|
|
1145
|
+
format: 'cid',
|
|
1146
|
+
},
|
|
1147
|
+
},
|
|
1148
|
+
},
|
|
1149
|
+
output: {
|
|
1150
|
+
encoding: 'application/json',
|
|
1151
|
+
schema: {
|
|
1152
|
+
type: 'object',
|
|
1153
|
+
required: ['subject'],
|
|
1154
|
+
properties: {
|
|
1155
|
+
subject: {
|
|
1156
|
+
type: 'union',
|
|
1157
|
+
refs: [
|
|
1158
|
+
'lex:com.atproto.admin.defs#repoRef',
|
|
1159
|
+
'lex:com.atproto.repo.strongRef',
|
|
1160
|
+
'lex:com.atproto.admin.defs#repoBlobRef',
|
|
1161
|
+
],
|
|
1162
|
+
},
|
|
1163
|
+
takedown: {
|
|
1164
|
+
type: 'ref',
|
|
1165
|
+
ref: 'lex:com.atproto.admin.defs#statusAttr',
|
|
1166
|
+
},
|
|
1167
|
+
},
|
|
1168
|
+
},
|
|
1169
|
+
},
|
|
1170
|
+
},
|
|
1171
|
+
},
|
|
1172
|
+
},
|
|
1029
1173
|
ComAtprotoAdminResolveModerationReports: {
|
|
1030
1174
|
lexicon: 1,
|
|
1031
1175
|
id: 'com.atproto.admin.resolveModerationReports',
|
|
@@ -1118,9 +1262,6 @@ export const schemaDict = {
|
|
|
1118
1262
|
q: {
|
|
1119
1263
|
type: 'string',
|
|
1120
1264
|
},
|
|
1121
|
-
invitedBy: {
|
|
1122
|
-
type: 'string',
|
|
1123
|
-
},
|
|
1124
1265
|
limit: {
|
|
1125
1266
|
type: 'integer',
|
|
1126
1267
|
minimum: 1,
|
|
@@ -1326,6 +1467,59 @@ export const schemaDict = {
|
|
|
1326
1467
|
},
|
|
1327
1468
|
},
|
|
1328
1469
|
},
|
|
1470
|
+
ComAtprotoAdminUpdateSubjectStatus: {
|
|
1471
|
+
lexicon: 1,
|
|
1472
|
+
id: 'com.atproto.admin.updateSubjectStatus',
|
|
1473
|
+
defs: {
|
|
1474
|
+
main: {
|
|
1475
|
+
type: 'procedure',
|
|
1476
|
+
description:
|
|
1477
|
+
'Update the service-specific admin status of a subject (account, record, or blob)',
|
|
1478
|
+
input: {
|
|
1479
|
+
encoding: 'application/json',
|
|
1480
|
+
schema: {
|
|
1481
|
+
type: 'object',
|
|
1482
|
+
required: ['subject'],
|
|
1483
|
+
properties: {
|
|
1484
|
+
subject: {
|
|
1485
|
+
type: 'union',
|
|
1486
|
+
refs: [
|
|
1487
|
+
'lex:com.atproto.admin.defs#repoRef',
|
|
1488
|
+
'lex:com.atproto.repo.strongRef',
|
|
1489
|
+
'lex:com.atproto.admin.defs#repoBlobRef',
|
|
1490
|
+
],
|
|
1491
|
+
},
|
|
1492
|
+
takedown: {
|
|
1493
|
+
type: 'ref',
|
|
1494
|
+
ref: 'lex:com.atproto.admin.defs#statusAttr',
|
|
1495
|
+
},
|
|
1496
|
+
},
|
|
1497
|
+
},
|
|
1498
|
+
},
|
|
1499
|
+
output: {
|
|
1500
|
+
encoding: 'application/json',
|
|
1501
|
+
schema: {
|
|
1502
|
+
type: 'object',
|
|
1503
|
+
required: ['subject'],
|
|
1504
|
+
properties: {
|
|
1505
|
+
subject: {
|
|
1506
|
+
type: 'union',
|
|
1507
|
+
refs: [
|
|
1508
|
+
'lex:com.atproto.admin.defs#repoRef',
|
|
1509
|
+
'lex:com.atproto.repo.strongRef',
|
|
1510
|
+
'lex:com.atproto.admin.defs#repoBlobRef',
|
|
1511
|
+
],
|
|
1512
|
+
},
|
|
1513
|
+
takedown: {
|
|
1514
|
+
type: 'ref',
|
|
1515
|
+
ref: 'lex:com.atproto.admin.defs#statusAttr',
|
|
1516
|
+
},
|
|
1517
|
+
},
|
|
1518
|
+
},
|
|
1519
|
+
},
|
|
1520
|
+
},
|
|
1521
|
+
},
|
|
1522
|
+
},
|
|
1329
1523
|
ComAtprotoIdentityResolveHandle: {
|
|
1330
1524
|
lexicon: 1,
|
|
1331
1525
|
id: 'com.atproto.identity.resolveHandle',
|
|
@@ -1632,6 +1826,8 @@ export const schemaDict = {
|
|
|
1632
1826
|
},
|
|
1633
1827
|
reason: {
|
|
1634
1828
|
type: 'string',
|
|
1829
|
+
maxGraphemes: 2000,
|
|
1830
|
+
maxLength: 20000,
|
|
1635
1831
|
},
|
|
1636
1832
|
subject: {
|
|
1637
1833
|
type: 'union',
|
|
@@ -2242,6 +2438,46 @@ export const schemaDict = {
|
|
|
2242
2438
|
},
|
|
2243
2439
|
},
|
|
2244
2440
|
},
|
|
2441
|
+
ComAtprotoServerConfirmEmail: {
|
|
2442
|
+
lexicon: 1,
|
|
2443
|
+
id: 'com.atproto.server.confirmEmail',
|
|
2444
|
+
defs: {
|
|
2445
|
+
main: {
|
|
2446
|
+
type: 'procedure',
|
|
2447
|
+
description:
|
|
2448
|
+
'Confirm an email using a token from com.atproto.server.requestEmailConfirmation.',
|
|
2449
|
+
input: {
|
|
2450
|
+
encoding: 'application/json',
|
|
2451
|
+
schema: {
|
|
2452
|
+
type: 'object',
|
|
2453
|
+
required: ['email', 'token'],
|
|
2454
|
+
properties: {
|
|
2455
|
+
email: {
|
|
2456
|
+
type: 'string',
|
|
2457
|
+
},
|
|
2458
|
+
token: {
|
|
2459
|
+
type: 'string',
|
|
2460
|
+
},
|
|
2461
|
+
},
|
|
2462
|
+
},
|
|
2463
|
+
},
|
|
2464
|
+
errors: [
|
|
2465
|
+
{
|
|
2466
|
+
name: 'AccountNotFound',
|
|
2467
|
+
},
|
|
2468
|
+
{
|
|
2469
|
+
name: 'ExpiredToken',
|
|
2470
|
+
},
|
|
2471
|
+
{
|
|
2472
|
+
name: 'InvalidToken',
|
|
2473
|
+
},
|
|
2474
|
+
{
|
|
2475
|
+
name: 'InvalidEmail',
|
|
2476
|
+
},
|
|
2477
|
+
],
|
|
2478
|
+
},
|
|
2479
|
+
},
|
|
2480
|
+
},
|
|
2245
2481
|
ComAtprotoServerCreateAccount: {
|
|
2246
2482
|
lexicon: 1,
|
|
2247
2483
|
id: 'com.atproto.server.createAccount',
|
|
@@ -2275,6 +2511,9 @@ export const schemaDict = {
|
|
|
2275
2511
|
recoveryKey: {
|
|
2276
2512
|
type: 'string',
|
|
2277
2513
|
},
|
|
2514
|
+
plcOp: {
|
|
2515
|
+
type: 'bytes',
|
|
2516
|
+
},
|
|
2278
2517
|
},
|
|
2279
2518
|
},
|
|
2280
2519
|
},
|
|
@@ -2298,6 +2537,9 @@ export const schemaDict = {
|
|
|
2298
2537
|
type: 'string',
|
|
2299
2538
|
format: 'did',
|
|
2300
2539
|
},
|
|
2540
|
+
didDoc: {
|
|
2541
|
+
type: 'unknown',
|
|
2542
|
+
},
|
|
2301
2543
|
},
|
|
2302
2544
|
},
|
|
2303
2545
|
},
|
|
@@ -2523,9 +2765,15 @@ export const schemaDict = {
|
|
|
2523
2765
|
type: 'string',
|
|
2524
2766
|
format: 'did',
|
|
2525
2767
|
},
|
|
2768
|
+
didDoc: {
|
|
2769
|
+
type: 'unknown',
|
|
2770
|
+
},
|
|
2526
2771
|
email: {
|
|
2527
2772
|
type: 'string',
|
|
2528
2773
|
},
|
|
2774
|
+
emailConfirmed: {
|
|
2775
|
+
type: 'boolean',
|
|
2776
|
+
},
|
|
2529
2777
|
},
|
|
2530
2778
|
},
|
|
2531
2779
|
},
|
|
@@ -2756,6 +3004,9 @@ export const schemaDict = {
|
|
|
2756
3004
|
email: {
|
|
2757
3005
|
type: 'string',
|
|
2758
3006
|
},
|
|
3007
|
+
emailConfirmed: {
|
|
3008
|
+
type: 'boolean',
|
|
3009
|
+
},
|
|
2759
3010
|
},
|
|
2760
3011
|
},
|
|
2761
3012
|
},
|
|
@@ -2833,6 +3084,9 @@ export const schemaDict = {
|
|
|
2833
3084
|
type: 'string',
|
|
2834
3085
|
format: 'did',
|
|
2835
3086
|
},
|
|
3087
|
+
didDoc: {
|
|
3088
|
+
type: 'unknown',
|
|
3089
|
+
},
|
|
2836
3090
|
},
|
|
2837
3091
|
},
|
|
2838
3092
|
},
|
|
@@ -2854,6 +3108,39 @@ export const schemaDict = {
|
|
|
2854
3108
|
},
|
|
2855
3109
|
},
|
|
2856
3110
|
},
|
|
3111
|
+
ComAtprotoServerRequestEmailConfirmation: {
|
|
3112
|
+
lexicon: 1,
|
|
3113
|
+
id: 'com.atproto.server.requestEmailConfirmation',
|
|
3114
|
+
defs: {
|
|
3115
|
+
main: {
|
|
3116
|
+
type: 'procedure',
|
|
3117
|
+
description:
|
|
3118
|
+
'Request an email with a code to confirm ownership of email',
|
|
3119
|
+
},
|
|
3120
|
+
},
|
|
3121
|
+
},
|
|
3122
|
+
ComAtprotoServerRequestEmailUpdate: {
|
|
3123
|
+
lexicon: 1,
|
|
3124
|
+
id: 'com.atproto.server.requestEmailUpdate',
|
|
3125
|
+
defs: {
|
|
3126
|
+
main: {
|
|
3127
|
+
type: 'procedure',
|
|
3128
|
+
description: 'Request a token in order to update email.',
|
|
3129
|
+
output: {
|
|
3130
|
+
encoding: 'application/json',
|
|
3131
|
+
schema: {
|
|
3132
|
+
type: 'object',
|
|
3133
|
+
required: ['tokenRequired'],
|
|
3134
|
+
properties: {
|
|
3135
|
+
tokenRequired: {
|
|
3136
|
+
type: 'boolean',
|
|
3137
|
+
},
|
|
3138
|
+
},
|
|
3139
|
+
},
|
|
3140
|
+
},
|
|
3141
|
+
},
|
|
3142
|
+
},
|
|
3143
|
+
},
|
|
2857
3144
|
ComAtprotoServerRequestPasswordReset: {
|
|
2858
3145
|
lexicon: 1,
|
|
2859
3146
|
id: 'com.atproto.server.requestPasswordReset',
|
|
@@ -2876,6 +3163,29 @@ export const schemaDict = {
|
|
|
2876
3163
|
},
|
|
2877
3164
|
},
|
|
2878
3165
|
},
|
|
3166
|
+
ComAtprotoServerReserveSigningKey: {
|
|
3167
|
+
lexicon: 1,
|
|
3168
|
+
id: 'com.atproto.server.reserveSigningKey',
|
|
3169
|
+
defs: {
|
|
3170
|
+
main: {
|
|
3171
|
+
type: 'procedure',
|
|
3172
|
+
description: 'Reserve a repo signing key for account creation.',
|
|
3173
|
+
output: {
|
|
3174
|
+
encoding: 'application/json',
|
|
3175
|
+
schema: {
|
|
3176
|
+
type: 'object',
|
|
3177
|
+
required: ['signingKey'],
|
|
3178
|
+
properties: {
|
|
3179
|
+
signingKey: {
|
|
3180
|
+
type: 'string',
|
|
3181
|
+
description: 'Public signing key in the form of a did:key.',
|
|
3182
|
+
},
|
|
3183
|
+
},
|
|
3184
|
+
},
|
|
3185
|
+
},
|
|
3186
|
+
},
|
|
3187
|
+
},
|
|
3188
|
+
},
|
|
2879
3189
|
ComAtprotoServerResetPassword: {
|
|
2880
3190
|
lexicon: 1,
|
|
2881
3191
|
id: 'com.atproto.server.resetPassword',
|
|
@@ -2931,6 +3241,44 @@ export const schemaDict = {
|
|
|
2931
3241
|
},
|
|
2932
3242
|
},
|
|
2933
3243
|
},
|
|
3244
|
+
ComAtprotoServerUpdateEmail: {
|
|
3245
|
+
lexicon: 1,
|
|
3246
|
+
id: 'com.atproto.server.updateEmail',
|
|
3247
|
+
defs: {
|
|
3248
|
+
main: {
|
|
3249
|
+
type: 'procedure',
|
|
3250
|
+
description: "Update an account's email.",
|
|
3251
|
+
input: {
|
|
3252
|
+
encoding: 'application/json',
|
|
3253
|
+
schema: {
|
|
3254
|
+
type: 'object',
|
|
3255
|
+
required: ['email'],
|
|
3256
|
+
properties: {
|
|
3257
|
+
email: {
|
|
3258
|
+
type: 'string',
|
|
3259
|
+
},
|
|
3260
|
+
token: {
|
|
3261
|
+
type: 'string',
|
|
3262
|
+
description:
|
|
3263
|
+
"Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed.",
|
|
3264
|
+
},
|
|
3265
|
+
},
|
|
3266
|
+
},
|
|
3267
|
+
},
|
|
3268
|
+
errors: [
|
|
3269
|
+
{
|
|
3270
|
+
name: 'ExpiredToken',
|
|
3271
|
+
},
|
|
3272
|
+
{
|
|
3273
|
+
name: 'InvalidToken',
|
|
3274
|
+
},
|
|
3275
|
+
{
|
|
3276
|
+
name: 'TokenRequired',
|
|
3277
|
+
},
|
|
3278
|
+
],
|
|
3279
|
+
},
|
|
3280
|
+
},
|
|
3281
|
+
},
|
|
2934
3282
|
ComAtprotoSyncGetBlob: {
|
|
2935
3283
|
lexicon: 1,
|
|
2936
3284
|
id: 'com.atproto.sync.getBlob',
|
|
@@ -3259,7 +3607,7 @@ export const schemaDict = {
|
|
|
3259
3607
|
},
|
|
3260
3608
|
repo: {
|
|
3261
3609
|
type: 'object',
|
|
3262
|
-
required: ['did', 'head'],
|
|
3610
|
+
required: ['did', 'head', 'rev'],
|
|
3263
3611
|
properties: {
|
|
3264
3612
|
did: {
|
|
3265
3613
|
type: 'string',
|
|
@@ -3269,6 +3617,9 @@ export const schemaDict = {
|
|
|
3269
3617
|
type: 'string',
|
|
3270
3618
|
format: 'cid',
|
|
3271
3619
|
},
|
|
3620
|
+
rev: {
|
|
3621
|
+
type: 'string',
|
|
3622
|
+
},
|
|
3272
3623
|
},
|
|
3273
3624
|
},
|
|
3274
3625
|
},
|
|
@@ -3672,6 +4023,10 @@ export const schemaDict = {
|
|
|
3672
4023
|
type: 'string',
|
|
3673
4024
|
format: 'at-uri',
|
|
3674
4025
|
},
|
|
4026
|
+
blockingByList: {
|
|
4027
|
+
type: 'ref',
|
|
4028
|
+
ref: 'lex:app.bsky.graph.defs#listViewBasic',
|
|
4029
|
+
},
|
|
3675
4030
|
following: {
|
|
3676
4031
|
type: 'string',
|
|
3677
4032
|
format: 'at-uri',
|
|
@@ -7208,6 +7563,7 @@ export const ids = {
|
|
|
7208
7563
|
'com.atproto.admin.disableAccountInvites',
|
|
7209
7564
|
ComAtprotoAdminDisableInviteCodes: 'com.atproto.admin.disableInviteCodes',
|
|
7210
7565
|
ComAtprotoAdminEnableAccountInvites: 'com.atproto.admin.enableAccountInvites',
|
|
7566
|
+
ComAtprotoAdminGetAccountInfo: 'com.atproto.admin.getAccountInfo',
|
|
7211
7567
|
ComAtprotoAdminGetInviteCodes: 'com.atproto.admin.getInviteCodes',
|
|
7212
7568
|
ComAtprotoAdminGetModerationAction: 'com.atproto.admin.getModerationAction',
|
|
7213
7569
|
ComAtprotoAdminGetModerationActions: 'com.atproto.admin.getModerationActions',
|
|
@@ -7215,6 +7571,7 @@ export const ids = {
|
|
|
7215
7571
|
ComAtprotoAdminGetModerationReports: 'com.atproto.admin.getModerationReports',
|
|
7216
7572
|
ComAtprotoAdminGetRecord: 'com.atproto.admin.getRecord',
|
|
7217
7573
|
ComAtprotoAdminGetRepo: 'com.atproto.admin.getRepo',
|
|
7574
|
+
ComAtprotoAdminGetSubjectStatus: 'com.atproto.admin.getSubjectStatus',
|
|
7218
7575
|
ComAtprotoAdminResolveModerationReports:
|
|
7219
7576
|
'com.atproto.admin.resolveModerationReports',
|
|
7220
7577
|
ComAtprotoAdminReverseModerationAction:
|
|
@@ -7224,6 +7581,7 @@ export const ids = {
|
|
|
7224
7581
|
ComAtprotoAdminTakeModerationAction: 'com.atproto.admin.takeModerationAction',
|
|
7225
7582
|
ComAtprotoAdminUpdateAccountEmail: 'com.atproto.admin.updateAccountEmail',
|
|
7226
7583
|
ComAtprotoAdminUpdateAccountHandle: 'com.atproto.admin.updateAccountHandle',
|
|
7584
|
+
ComAtprotoAdminUpdateSubjectStatus: 'com.atproto.admin.updateSubjectStatus',
|
|
7227
7585
|
ComAtprotoIdentityResolveHandle: 'com.atproto.identity.resolveHandle',
|
|
7228
7586
|
ComAtprotoIdentityUpdateHandle: 'com.atproto.identity.updateHandle',
|
|
7229
7587
|
ComAtprotoLabelDefs: 'com.atproto.label.defs',
|
|
@@ -7240,6 +7598,7 @@ export const ids = {
|
|
|
7240
7598
|
ComAtprotoRepoPutRecord: 'com.atproto.repo.putRecord',
|
|
7241
7599
|
ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef',
|
|
7242
7600
|
ComAtprotoRepoUploadBlob: 'com.atproto.repo.uploadBlob',
|
|
7601
|
+
ComAtprotoServerConfirmEmail: 'com.atproto.server.confirmEmail',
|
|
7243
7602
|
ComAtprotoServerCreateAccount: 'com.atproto.server.createAccount',
|
|
7244
7603
|
ComAtprotoServerCreateAppPassword: 'com.atproto.server.createAppPassword',
|
|
7245
7604
|
ComAtprotoServerCreateInviteCode: 'com.atproto.server.createInviteCode',
|
|
@@ -7256,10 +7615,15 @@ export const ids = {
|
|
|
7256
7615
|
ComAtprotoServerRefreshSession: 'com.atproto.server.refreshSession',
|
|
7257
7616
|
ComAtprotoServerRequestAccountDelete:
|
|
7258
7617
|
'com.atproto.server.requestAccountDelete',
|
|
7618
|
+
ComAtprotoServerRequestEmailConfirmation:
|
|
7619
|
+
'com.atproto.server.requestEmailConfirmation',
|
|
7620
|
+
ComAtprotoServerRequestEmailUpdate: 'com.atproto.server.requestEmailUpdate',
|
|
7259
7621
|
ComAtprotoServerRequestPasswordReset:
|
|
7260
7622
|
'com.atproto.server.requestPasswordReset',
|
|
7623
|
+
ComAtprotoServerReserveSigningKey: 'com.atproto.server.reserveSigningKey',
|
|
7261
7624
|
ComAtprotoServerResetPassword: 'com.atproto.server.resetPassword',
|
|
7262
7625
|
ComAtprotoServerRevokeAppPassword: 'com.atproto.server.revokeAppPassword',
|
|
7626
|
+
ComAtprotoServerUpdateEmail: 'com.atproto.server.updateEmail',
|
|
7263
7627
|
ComAtprotoSyncGetBlob: 'com.atproto.sync.getBlob',
|
|
7264
7628
|
ComAtprotoSyncGetBlocks: 'com.atproto.sync.getBlocks',
|
|
7265
7629
|
ComAtprotoSyncGetCheckout: 'com.atproto.sync.getCheckout',
|
|
@@ -10,6 +10,24 @@ import * as ComAtprotoModerationDefs from '../moderation/defs'
|
|
|
10
10
|
import * as ComAtprotoServerDefs from '../server/defs'
|
|
11
11
|
import * as ComAtprotoLabelDefs from '../label/defs'
|
|
12
12
|
|
|
13
|
+
export interface StatusAttr {
|
|
14
|
+
applied: boolean
|
|
15
|
+
ref?: string
|
|
16
|
+
[k: string]: unknown
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function isStatusAttr(v: unknown): v is StatusAttr {
|
|
20
|
+
return (
|
|
21
|
+
isObj(v) &&
|
|
22
|
+
hasProp(v, '$type') &&
|
|
23
|
+
v.$type === 'com.atproto.admin.defs#statusAttr'
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function validateStatusAttr(v: unknown): ValidationResult {
|
|
28
|
+
return lexicons.validate('com.atproto.admin.defs#statusAttr', v)
|
|
29
|
+
}
|
|
30
|
+
|
|
13
31
|
export interface ActionView {
|
|
14
32
|
id: number
|
|
15
33
|
action: ActionType
|
|
@@ -238,6 +256,30 @@ export function validateRepoViewDetail(v: unknown): ValidationResult {
|
|
|
238
256
|
return lexicons.validate('com.atproto.admin.defs#repoViewDetail', v)
|
|
239
257
|
}
|
|
240
258
|
|
|
259
|
+
export interface AccountView {
|
|
260
|
+
did: string
|
|
261
|
+
handle: string
|
|
262
|
+
email?: string
|
|
263
|
+
indexedAt: string
|
|
264
|
+
invitedBy?: ComAtprotoServerDefs.InviteCode
|
|
265
|
+
invites?: ComAtprotoServerDefs.InviteCode[]
|
|
266
|
+
invitesDisabled?: boolean
|
|
267
|
+
inviteNote?: string
|
|
268
|
+
[k: string]: unknown
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export function isAccountView(v: unknown): v is AccountView {
|
|
272
|
+
return (
|
|
273
|
+
isObj(v) &&
|
|
274
|
+
hasProp(v, '$type') &&
|
|
275
|
+
v.$type === 'com.atproto.admin.defs#accountView'
|
|
276
|
+
)
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export function validateAccountView(v: unknown): ValidationResult {
|
|
280
|
+
return lexicons.validate('com.atproto.admin.defs#accountView', v)
|
|
281
|
+
}
|
|
282
|
+
|
|
241
283
|
export interface RepoViewNotFound {
|
|
242
284
|
did: string
|
|
243
285
|
[k: string]: unknown
|
|
@@ -272,6 +314,25 @@ export function validateRepoRef(v: unknown): ValidationResult {
|
|
|
272
314
|
return lexicons.validate('com.atproto.admin.defs#repoRef', v)
|
|
273
315
|
}
|
|
274
316
|
|
|
317
|
+
export interface RepoBlobRef {
|
|
318
|
+
did: string
|
|
319
|
+
cid: string
|
|
320
|
+
recordUri?: string
|
|
321
|
+
[k: string]: unknown
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export function isRepoBlobRef(v: unknown): v is RepoBlobRef {
|
|
325
|
+
return (
|
|
326
|
+
isObj(v) &&
|
|
327
|
+
hasProp(v, '$type') &&
|
|
328
|
+
v.$type === 'com.atproto.admin.defs#repoBlobRef'
|
|
329
|
+
)
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export function validateRepoBlobRef(v: unknown): ValidationResult {
|
|
333
|
+
return lexicons.validate('com.atproto.admin.defs#repoBlobRef', v)
|
|
334
|
+
}
|
|
335
|
+
|
|
275
336
|
export interface RecordView {
|
|
276
337
|
uri: string
|
|
277
338
|
cid: string
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth } from '@atproto/xrpc-server'
|
|
10
|
+
import * as ComAtprotoAdminDefs from './defs'
|
|
11
|
+
|
|
12
|
+
export interface QueryParams {
|
|
13
|
+
did: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type InputSchema = undefined
|
|
17
|
+
export type OutputSchema = ComAtprotoAdminDefs.AccountView
|
|
18
|
+
export type HandlerInput = undefined
|
|
19
|
+
|
|
20
|
+
export interface HandlerSuccess {
|
|
21
|
+
encoding: 'application/json'
|
|
22
|
+
body: OutputSchema
|
|
23
|
+
headers?: { [key: string]: string }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface HandlerError {
|
|
27
|
+
status: number
|
|
28
|
+
message?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
32
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
33
|
+
auth: HA
|
|
34
|
+
params: QueryParams
|
|
35
|
+
input: HandlerInput
|
|
36
|
+
req: express.Request
|
|
37
|
+
res: express.Response
|
|
38
|
+
}
|
|
39
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
40
|
+
ctx: HandlerReqCtx<HA>,
|
|
41
|
+
) => Promise<HandlerOutput> | HandlerOutput
|