@atproto/api 0.6.7 → 0.6.9
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/build.js +8 -0
- package/dist/agent.d.ts +25 -44
- package/dist/bsky-agent.d.ts +24 -0
- package/dist/client/index.d.ts +14 -9
- package/dist/client/lexicons.d.ts +103 -100
- package/dist/client/types/app/bsky/actor/defs.d.ts +65 -74
- package/dist/client/types/app/bsky/actor/getFeedSuggestions.d.ts +21 -0
- package/dist/client/types/app/bsky/embed/external.d.ts +23 -23
- package/dist/client/types/app/bsky/embed/images.d.ts +20 -20
- package/dist/client/types/app/bsky/embed/recordWithMedia.d.ts +20 -26
- package/dist/client/types/{com/atproto/sync/getCommitPath.d.ts → app/bsky/feed/getFeedSuggestions.d.ts} +5 -4
- package/dist/client/types/app/bsky/feed/getSuggestedFeeds.d.ts +21 -0
- package/dist/client/types/app/bsky/feed/like.d.ts +7 -7
- package/dist/client/types/app/bsky/feed/repost.d.ts +7 -7
- package/dist/client/types/app/bsky/graph/block.d.ts +6 -6
- package/dist/client/types/app/bsky/graph/defs.d.ts +36 -36
- package/dist/client/types/app/bsky/graph/follow.d.ts +6 -6
- package/dist/client/types/app/bsky/graph/listitem.d.ts +7 -7
- package/dist/client/types/app/bsky/richtext/facet.d.ts +22 -26
- package/dist/client/types/com/atproto/label/subscribeLabels.d.ts +12 -12
- package/dist/client/types/com/atproto/moderation/defs.d.ts +7 -16
- package/dist/client/types/com/atproto/repo/strongRef.d.ts +6 -6
- package/dist/client/types/com/atproto/server/defs.d.ts +16 -16
- package/dist/client/types/com/atproto/sync/getCheckout.d.ts +0 -1
- package/dist/client/types/com/atproto/{admin/rebaseRepo.d.ts → sync/getLatestCommit.d.ts} +7 -9
- package/dist/client/types/com/atproto/sync/getRepo.d.ts +1 -2
- package/dist/client/types/com/atproto/sync/listBlobs.d.ts +4 -2
- package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +48 -46
- package/dist/client/types/{app/bsky/unspecced/registerPushNotification.d.ts → com/atproto/temp/upgradeRepoVersion.d.ts} +7 -5
- package/dist/client/util.d.ts +2 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1651 -1277
- package/dist/index.js.map +4 -4
- package/dist/rich-text/detection.d.ts +4 -4
- package/dist/rich-text/rich-text.d.ts +31 -31
- package/dist/rich-text/sanitization.d.ts +4 -7
- package/dist/rich-text/unicode.d.ts +9 -9
- package/dist/types.d.ts +32 -34
- package/package.json +24 -23
- package/src/bsky-agent.ts +181 -1
- package/src/client/index.ts +49 -39
- package/src/client/lexicons.ts +123 -129
- package/src/client/types/{com/atproto/sync/getCommitPath.ts → app/bsky/feed/getSuggestedFeeds.ts} +5 -7
- package/src/client/types/com/atproto/sync/getCheckout.ts +0 -2
- package/src/client/types/com/atproto/{admin/rebaseRepo.ts → sync/getLatestCommit.ts} +12 -17
- package/src/client/types/com/atproto/sync/getRepo.ts +2 -4
- package/src/client/types/com/atproto/sync/listBlobs.ts +5 -4
- package/src/client/types/com/atproto/sync/subscribeRepos.ts +5 -1
- package/src/client/types/com/atproto/{repo/rebaseRepo.ts → temp/upgradeRepoVersion.ts} +2 -18
- package/src/index.ts +1 -1
- package/src/types.ts +20 -0
- package/tests/bsky-agent.test.ts +149 -0
- package/update-pkg.js +14 -0
- package/LICENSE +0 -21
- package/dist/client/types/com/atproto/repo/rebaseRepo.d.ts +0 -24
- package/tsconfig.build.tsbuildinfo +0 -1
package/src/client/lexicons.ts
CHANGED
|
@@ -1026,44 +1026,6 @@ export const schemaDict = {
|
|
|
1026
1026
|
},
|
|
1027
1027
|
},
|
|
1028
1028
|
},
|
|
1029
|
-
ComAtprotoAdminRebaseRepo: {
|
|
1030
|
-
lexicon: 1,
|
|
1031
|
-
id: 'com.atproto.admin.rebaseRepo',
|
|
1032
|
-
defs: {
|
|
1033
|
-
main: {
|
|
1034
|
-
type: 'procedure',
|
|
1035
|
-
description: "Administrative action to rebase an account's repo",
|
|
1036
|
-
input: {
|
|
1037
|
-
encoding: 'application/json',
|
|
1038
|
-
schema: {
|
|
1039
|
-
type: 'object',
|
|
1040
|
-
required: ['repo'],
|
|
1041
|
-
properties: {
|
|
1042
|
-
repo: {
|
|
1043
|
-
type: 'string',
|
|
1044
|
-
format: 'at-identifier',
|
|
1045
|
-
description: 'The handle or DID of the repo.',
|
|
1046
|
-
},
|
|
1047
|
-
swapCommit: {
|
|
1048
|
-
type: 'string',
|
|
1049
|
-
format: 'cid',
|
|
1050
|
-
description:
|
|
1051
|
-
'Compare and swap with the previous commit by cid.',
|
|
1052
|
-
},
|
|
1053
|
-
},
|
|
1054
|
-
},
|
|
1055
|
-
},
|
|
1056
|
-
errors: [
|
|
1057
|
-
{
|
|
1058
|
-
name: 'InvalidSwap',
|
|
1059
|
-
},
|
|
1060
|
-
{
|
|
1061
|
-
name: 'ConcurrentWrites',
|
|
1062
|
-
},
|
|
1063
|
-
],
|
|
1064
|
-
},
|
|
1065
|
-
},
|
|
1066
|
-
},
|
|
1067
1029
|
ComAtprotoAdminResolveModerationReports: {
|
|
1068
1030
|
lexicon: 1,
|
|
1069
1031
|
id: 'com.atproto.admin.resolveModerationReports',
|
|
@@ -2229,44 +2191,6 @@ export const schemaDict = {
|
|
|
2229
2191
|
},
|
|
2230
2192
|
},
|
|
2231
2193
|
},
|
|
2232
|
-
ComAtprotoRepoRebaseRepo: {
|
|
2233
|
-
lexicon: 1,
|
|
2234
|
-
id: 'com.atproto.repo.rebaseRepo',
|
|
2235
|
-
defs: {
|
|
2236
|
-
main: {
|
|
2237
|
-
type: 'procedure',
|
|
2238
|
-
description: 'Simple rebase of repo that deletes history',
|
|
2239
|
-
input: {
|
|
2240
|
-
encoding: 'application/json',
|
|
2241
|
-
schema: {
|
|
2242
|
-
type: 'object',
|
|
2243
|
-
required: ['repo'],
|
|
2244
|
-
properties: {
|
|
2245
|
-
repo: {
|
|
2246
|
-
type: 'string',
|
|
2247
|
-
format: 'at-identifier',
|
|
2248
|
-
description: 'The handle or DID of the repo.',
|
|
2249
|
-
},
|
|
2250
|
-
swapCommit: {
|
|
2251
|
-
type: 'string',
|
|
2252
|
-
format: 'cid',
|
|
2253
|
-
description:
|
|
2254
|
-
'Compare and swap with the previous commit by cid.',
|
|
2255
|
-
},
|
|
2256
|
-
},
|
|
2257
|
-
},
|
|
2258
|
-
},
|
|
2259
|
-
errors: [
|
|
2260
|
-
{
|
|
2261
|
-
name: 'InvalidSwap',
|
|
2262
|
-
},
|
|
2263
|
-
{
|
|
2264
|
-
name: 'ConcurrentWrites',
|
|
2265
|
-
},
|
|
2266
|
-
],
|
|
2267
|
-
},
|
|
2268
|
-
},
|
|
2269
|
-
},
|
|
2270
2194
|
ComAtprotoRepoStrongRef: {
|
|
2271
2195
|
lexicon: 1,
|
|
2272
2196
|
id: 'com.atproto.repo.strongRef',
|
|
@@ -3069,7 +2993,7 @@ export const schemaDict = {
|
|
|
3069
2993
|
defs: {
|
|
3070
2994
|
main: {
|
|
3071
2995
|
type: 'query',
|
|
3072
|
-
description: '
|
|
2996
|
+
description: 'DEPRECATED - please use com.atproto.sync.getRepo instead',
|
|
3073
2997
|
parameters: {
|
|
3074
2998
|
type: 'params',
|
|
3075
2999
|
required: ['did'],
|
|
@@ -3079,12 +3003,6 @@ export const schemaDict = {
|
|
|
3079
3003
|
format: 'did',
|
|
3080
3004
|
description: 'The DID of the repo.',
|
|
3081
3005
|
},
|
|
3082
|
-
commit: {
|
|
3083
|
-
type: 'string',
|
|
3084
|
-
format: 'cid',
|
|
3085
|
-
description:
|
|
3086
|
-
'The commit to get the checkout from. Defaults to current HEAD.',
|
|
3087
|
-
},
|
|
3088
3006
|
},
|
|
3089
3007
|
},
|
|
3090
3008
|
output: {
|
|
@@ -3093,13 +3011,14 @@ export const schemaDict = {
|
|
|
3093
3011
|
},
|
|
3094
3012
|
},
|
|
3095
3013
|
},
|
|
3096
|
-
|
|
3014
|
+
ComAtprotoSyncGetHead: {
|
|
3097
3015
|
lexicon: 1,
|
|
3098
|
-
id: 'com.atproto.sync.
|
|
3016
|
+
id: 'com.atproto.sync.getHead',
|
|
3099
3017
|
defs: {
|
|
3100
3018
|
main: {
|
|
3101
3019
|
type: 'query',
|
|
3102
|
-
description:
|
|
3020
|
+
description:
|
|
3021
|
+
'DEPRECATED - please use com.atproto.sync.getLatestCommit instead',
|
|
3103
3022
|
parameters: {
|
|
3104
3023
|
type: 'params',
|
|
3105
3024
|
required: ['did'],
|
|
@@ -3109,44 +3028,36 @@ export const schemaDict = {
|
|
|
3109
3028
|
format: 'did',
|
|
3110
3029
|
description: 'The DID of the repo.',
|
|
3111
3030
|
},
|
|
3112
|
-
latest: {
|
|
3113
|
-
type: 'string',
|
|
3114
|
-
format: 'cid',
|
|
3115
|
-
description: 'The most recent commit',
|
|
3116
|
-
},
|
|
3117
|
-
earliest: {
|
|
3118
|
-
type: 'string',
|
|
3119
|
-
format: 'cid',
|
|
3120
|
-
description: 'The earliest commit to start from',
|
|
3121
|
-
},
|
|
3122
3031
|
},
|
|
3123
3032
|
},
|
|
3124
3033
|
output: {
|
|
3125
3034
|
encoding: 'application/json',
|
|
3126
3035
|
schema: {
|
|
3127
3036
|
type: 'object',
|
|
3128
|
-
required: ['
|
|
3037
|
+
required: ['root'],
|
|
3129
3038
|
properties: {
|
|
3130
|
-
|
|
3131
|
-
type: '
|
|
3132
|
-
|
|
3133
|
-
type: 'string',
|
|
3134
|
-
format: 'cid',
|
|
3135
|
-
},
|
|
3039
|
+
root: {
|
|
3040
|
+
type: 'string',
|
|
3041
|
+
format: 'cid',
|
|
3136
3042
|
},
|
|
3137
3043
|
},
|
|
3138
3044
|
},
|
|
3139
3045
|
},
|
|
3046
|
+
errors: [
|
|
3047
|
+
{
|
|
3048
|
+
name: 'HeadNotFound',
|
|
3049
|
+
},
|
|
3050
|
+
],
|
|
3140
3051
|
},
|
|
3141
3052
|
},
|
|
3142
3053
|
},
|
|
3143
|
-
|
|
3054
|
+
ComAtprotoSyncGetLatestCommit: {
|
|
3144
3055
|
lexicon: 1,
|
|
3145
|
-
id: 'com.atproto.sync.
|
|
3056
|
+
id: 'com.atproto.sync.getLatestCommit',
|
|
3146
3057
|
defs: {
|
|
3147
3058
|
main: {
|
|
3148
3059
|
type: 'query',
|
|
3149
|
-
description: 'Gets the current
|
|
3060
|
+
description: 'Gets the current commit CID & revision of the repo.',
|
|
3150
3061
|
parameters: {
|
|
3151
3062
|
type: 'params',
|
|
3152
3063
|
required: ['did'],
|
|
@@ -3162,18 +3073,21 @@ export const schemaDict = {
|
|
|
3162
3073
|
encoding: 'application/json',
|
|
3163
3074
|
schema: {
|
|
3164
3075
|
type: 'object',
|
|
3165
|
-
required: ['
|
|
3076
|
+
required: ['cid', 'rev'],
|
|
3166
3077
|
properties: {
|
|
3167
|
-
|
|
3078
|
+
cid: {
|
|
3168
3079
|
type: 'string',
|
|
3169
3080
|
format: 'cid',
|
|
3170
3081
|
},
|
|
3082
|
+
rev: {
|
|
3083
|
+
type: 'string',
|
|
3084
|
+
},
|
|
3171
3085
|
},
|
|
3172
3086
|
},
|
|
3173
3087
|
},
|
|
3174
3088
|
errors: [
|
|
3175
3089
|
{
|
|
3176
|
-
name: '
|
|
3090
|
+
name: 'RepoNotFound',
|
|
3177
3091
|
},
|
|
3178
3092
|
],
|
|
3179
3093
|
},
|
|
@@ -3222,7 +3136,8 @@ export const schemaDict = {
|
|
|
3222
3136
|
defs: {
|
|
3223
3137
|
main: {
|
|
3224
3138
|
type: 'query',
|
|
3225
|
-
description:
|
|
3139
|
+
description:
|
|
3140
|
+
"Gets the did's repo, optionally catching up from a specific revision.",
|
|
3226
3141
|
parameters: {
|
|
3227
3142
|
type: 'params',
|
|
3228
3143
|
required: ['did'],
|
|
@@ -3232,16 +3147,10 @@ export const schemaDict = {
|
|
|
3232
3147
|
format: 'did',
|
|
3233
3148
|
description: 'The DID of the repo.',
|
|
3234
3149
|
},
|
|
3235
|
-
|
|
3150
|
+
since: {
|
|
3236
3151
|
type: 'string',
|
|
3237
3152
|
format: 'cid',
|
|
3238
|
-
description:
|
|
3239
|
-
'The earliest commit in the commit range (not inclusive)',
|
|
3240
|
-
},
|
|
3241
|
-
latest: {
|
|
3242
|
-
type: 'string',
|
|
3243
|
-
format: 'cid',
|
|
3244
|
-
description: 'The latest commit in the commit range (inclusive)',
|
|
3153
|
+
description: 'The revision of the repo to catch up from.',
|
|
3245
3154
|
},
|
|
3246
3155
|
},
|
|
3247
3156
|
},
|
|
@@ -3257,7 +3166,7 @@ export const schemaDict = {
|
|
|
3257
3166
|
defs: {
|
|
3258
3167
|
main: {
|
|
3259
3168
|
type: 'query',
|
|
3260
|
-
description: 'List blob cids
|
|
3169
|
+
description: 'List blob cids since some revision',
|
|
3261
3170
|
parameters: {
|
|
3262
3171
|
type: 'params',
|
|
3263
3172
|
required: ['did'],
|
|
@@ -3267,15 +3176,19 @@ export const schemaDict = {
|
|
|
3267
3176
|
format: 'did',
|
|
3268
3177
|
description: 'The DID of the repo.',
|
|
3269
3178
|
},
|
|
3270
|
-
|
|
3179
|
+
since: {
|
|
3271
3180
|
type: 'string',
|
|
3272
3181
|
format: 'cid',
|
|
3273
|
-
description: '
|
|
3182
|
+
description: 'Optional revision of the repo to list blobs since',
|
|
3274
3183
|
},
|
|
3275
|
-
|
|
3184
|
+
limit: {
|
|
3185
|
+
type: 'integer',
|
|
3186
|
+
minimum: 1,
|
|
3187
|
+
maximum: 1000,
|
|
3188
|
+
default: 500,
|
|
3189
|
+
},
|
|
3190
|
+
cursor: {
|
|
3276
3191
|
type: 'string',
|
|
3277
|
-
format: 'cid',
|
|
3278
|
-
description: 'The earliest commit to start from',
|
|
3279
3192
|
},
|
|
3280
3193
|
},
|
|
3281
3194
|
},
|
|
@@ -3285,6 +3198,9 @@ export const schemaDict = {
|
|
|
3285
3198
|
type: 'object',
|
|
3286
3199
|
required: ['cids'],
|
|
3287
3200
|
properties: {
|
|
3201
|
+
cursor: {
|
|
3202
|
+
type: 'string',
|
|
3203
|
+
},
|
|
3288
3204
|
cids: {
|
|
3289
3205
|
type: 'array',
|
|
3290
3206
|
items: {
|
|
@@ -3449,13 +3365,14 @@ export const schemaDict = {
|
|
|
3449
3365
|
'tooBig',
|
|
3450
3366
|
'repo',
|
|
3451
3367
|
'commit',
|
|
3452
|
-
'
|
|
3368
|
+
'rev',
|
|
3369
|
+
'since',
|
|
3453
3370
|
'blocks',
|
|
3454
3371
|
'ops',
|
|
3455
3372
|
'blobs',
|
|
3456
3373
|
'time',
|
|
3457
3374
|
],
|
|
3458
|
-
nullable: ['prev'],
|
|
3375
|
+
nullable: ['prev', 'since'],
|
|
3459
3376
|
properties: {
|
|
3460
3377
|
seq: {
|
|
3461
3378
|
type: 'integer',
|
|
@@ -3476,6 +3393,14 @@ export const schemaDict = {
|
|
|
3476
3393
|
prev: {
|
|
3477
3394
|
type: 'cid-link',
|
|
3478
3395
|
},
|
|
3396
|
+
rev: {
|
|
3397
|
+
type: 'string',
|
|
3398
|
+
description: 'The rev of the emitted commit',
|
|
3399
|
+
},
|
|
3400
|
+
since: {
|
|
3401
|
+
type: 'string',
|
|
3402
|
+
description: 'The rev of the last emitted commit from this repo',
|
|
3403
|
+
},
|
|
3479
3404
|
blocks: {
|
|
3480
3405
|
type: 'bytes',
|
|
3481
3406
|
description: 'CAR file containing relevant blocks',
|
|
@@ -3594,6 +3519,32 @@ export const schemaDict = {
|
|
|
3594
3519
|
},
|
|
3595
3520
|
},
|
|
3596
3521
|
},
|
|
3522
|
+
ComAtprotoTempUpgradeRepoVersion: {
|
|
3523
|
+
lexicon: 1,
|
|
3524
|
+
id: 'com.atproto.temp.upgradeRepoVersion',
|
|
3525
|
+
defs: {
|
|
3526
|
+
main: {
|
|
3527
|
+
type: 'procedure',
|
|
3528
|
+
description: 'Upgrade a repo to v3',
|
|
3529
|
+
input: {
|
|
3530
|
+
encoding: 'application/json',
|
|
3531
|
+
schema: {
|
|
3532
|
+
type: 'object',
|
|
3533
|
+
required: ['did'],
|
|
3534
|
+
properties: {
|
|
3535
|
+
did: {
|
|
3536
|
+
type: 'string',
|
|
3537
|
+
format: 'did',
|
|
3538
|
+
},
|
|
3539
|
+
force: {
|
|
3540
|
+
type: 'boolean',
|
|
3541
|
+
},
|
|
3542
|
+
},
|
|
3543
|
+
},
|
|
3544
|
+
},
|
|
3545
|
+
},
|
|
3546
|
+
},
|
|
3547
|
+
},
|
|
3597
3548
|
AppBskyActorDefs: {
|
|
3598
3549
|
lexicon: 1,
|
|
3599
3550
|
id: 'app.bsky.actor.defs',
|
|
@@ -5354,6 +5305,49 @@ export const schemaDict = {
|
|
|
5354
5305
|
},
|
|
5355
5306
|
},
|
|
5356
5307
|
},
|
|
5308
|
+
AppBskyFeedGetSuggestedFeeds: {
|
|
5309
|
+
lexicon: 1,
|
|
5310
|
+
id: 'app.bsky.feed.getSuggestedFeeds',
|
|
5311
|
+
defs: {
|
|
5312
|
+
main: {
|
|
5313
|
+
type: 'query',
|
|
5314
|
+
description: 'Get a list of suggested feeds for the viewer.',
|
|
5315
|
+
parameters: {
|
|
5316
|
+
type: 'params',
|
|
5317
|
+
properties: {
|
|
5318
|
+
limit: {
|
|
5319
|
+
type: 'integer',
|
|
5320
|
+
minimum: 1,
|
|
5321
|
+
maximum: 100,
|
|
5322
|
+
default: 50,
|
|
5323
|
+
},
|
|
5324
|
+
cursor: {
|
|
5325
|
+
type: 'string',
|
|
5326
|
+
},
|
|
5327
|
+
},
|
|
5328
|
+
},
|
|
5329
|
+
output: {
|
|
5330
|
+
encoding: 'application/json',
|
|
5331
|
+
schema: {
|
|
5332
|
+
type: 'object',
|
|
5333
|
+
required: ['feeds'],
|
|
5334
|
+
properties: {
|
|
5335
|
+
cursor: {
|
|
5336
|
+
type: 'string',
|
|
5337
|
+
},
|
|
5338
|
+
feeds: {
|
|
5339
|
+
type: 'array',
|
|
5340
|
+
items: {
|
|
5341
|
+
type: 'ref',
|
|
5342
|
+
ref: 'lex:app.bsky.feed.defs#generatorView',
|
|
5343
|
+
},
|
|
5344
|
+
},
|
|
5345
|
+
},
|
|
5346
|
+
},
|
|
5347
|
+
},
|
|
5348
|
+
},
|
|
5349
|
+
},
|
|
5350
|
+
},
|
|
5357
5351
|
AppBskyFeedGetTimeline: {
|
|
5358
5352
|
lexicon: 1,
|
|
5359
5353
|
id: 'app.bsky.feed.getTimeline',
|
|
@@ -6672,7 +6666,6 @@ export const ids = {
|
|
|
6672
6666
|
ComAtprotoAdminGetModerationReports: 'com.atproto.admin.getModerationReports',
|
|
6673
6667
|
ComAtprotoAdminGetRecord: 'com.atproto.admin.getRecord',
|
|
6674
6668
|
ComAtprotoAdminGetRepo: 'com.atproto.admin.getRepo',
|
|
6675
|
-
ComAtprotoAdminRebaseRepo: 'com.atproto.admin.rebaseRepo',
|
|
6676
6669
|
ComAtprotoAdminResolveModerationReports:
|
|
6677
6670
|
'com.atproto.admin.resolveModerationReports',
|
|
6678
6671
|
ComAtprotoAdminReverseModerationAction:
|
|
@@ -6696,7 +6689,6 @@ export const ids = {
|
|
|
6696
6689
|
ComAtprotoRepoGetRecord: 'com.atproto.repo.getRecord',
|
|
6697
6690
|
ComAtprotoRepoListRecords: 'com.atproto.repo.listRecords',
|
|
6698
6691
|
ComAtprotoRepoPutRecord: 'com.atproto.repo.putRecord',
|
|
6699
|
-
ComAtprotoRepoRebaseRepo: 'com.atproto.repo.rebaseRepo',
|
|
6700
6692
|
ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef',
|
|
6701
6693
|
ComAtprotoRepoUploadBlob: 'com.atproto.repo.uploadBlob',
|
|
6702
6694
|
ComAtprotoServerCreateAccount: 'com.atproto.server.createAccount',
|
|
@@ -6722,8 +6714,8 @@ export const ids = {
|
|
|
6722
6714
|
ComAtprotoSyncGetBlob: 'com.atproto.sync.getBlob',
|
|
6723
6715
|
ComAtprotoSyncGetBlocks: 'com.atproto.sync.getBlocks',
|
|
6724
6716
|
ComAtprotoSyncGetCheckout: 'com.atproto.sync.getCheckout',
|
|
6725
|
-
ComAtprotoSyncGetCommitPath: 'com.atproto.sync.getCommitPath',
|
|
6726
6717
|
ComAtprotoSyncGetHead: 'com.atproto.sync.getHead',
|
|
6718
|
+
ComAtprotoSyncGetLatestCommit: 'com.atproto.sync.getLatestCommit',
|
|
6727
6719
|
ComAtprotoSyncGetRecord: 'com.atproto.sync.getRecord',
|
|
6728
6720
|
ComAtprotoSyncGetRepo: 'com.atproto.sync.getRepo',
|
|
6729
6721
|
ComAtprotoSyncListBlobs: 'com.atproto.sync.listBlobs',
|
|
@@ -6731,6 +6723,7 @@ export const ids = {
|
|
|
6731
6723
|
ComAtprotoSyncNotifyOfUpdate: 'com.atproto.sync.notifyOfUpdate',
|
|
6732
6724
|
ComAtprotoSyncRequestCrawl: 'com.atproto.sync.requestCrawl',
|
|
6733
6725
|
ComAtprotoSyncSubscribeRepos: 'com.atproto.sync.subscribeRepos',
|
|
6726
|
+
ComAtprotoTempUpgradeRepoVersion: 'com.atproto.temp.upgradeRepoVersion',
|
|
6734
6727
|
AppBskyActorDefs: 'app.bsky.actor.defs',
|
|
6735
6728
|
AppBskyActorGetPreferences: 'app.bsky.actor.getPreferences',
|
|
6736
6729
|
AppBskyActorGetProfile: 'app.bsky.actor.getProfile',
|
|
@@ -6758,6 +6751,7 @@ export const ids = {
|
|
|
6758
6751
|
AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
|
|
6759
6752
|
AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
|
|
6760
6753
|
AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy',
|
|
6754
|
+
AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds',
|
|
6761
6755
|
AppBskyFeedGetTimeline: 'app.bsky.feed.getTimeline',
|
|
6762
6756
|
AppBskyFeedLike: 'app.bsky.feed.like',
|
|
6763
6757
|
AppBskyFeedPost: 'app.bsky.feed.post',
|
package/src/client/types/{com/atproto/sync/getCommitPath.ts → app/bsky/feed/getSuggestedFeeds.ts}
RENAMED
|
@@ -6,20 +6,18 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
|
6
6
|
import { isObj, hasProp } from '../../../../util'
|
|
7
7
|
import { lexicons } from '../../../../lexicons'
|
|
8
8
|
import { CID } from 'multiformats/cid'
|
|
9
|
+
import * as AppBskyFeedDefs from './defs'
|
|
9
10
|
|
|
10
11
|
export interface QueryParams {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/** The most recent commit */
|
|
14
|
-
latest?: string
|
|
15
|
-
/** The earliest commit to start from */
|
|
16
|
-
earliest?: string
|
|
12
|
+
limit?: number
|
|
13
|
+
cursor?: string
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
export type InputSchema = undefined
|
|
20
17
|
|
|
21
18
|
export interface OutputSchema {
|
|
22
|
-
|
|
19
|
+
cursor?: string
|
|
20
|
+
feeds: AppBskyFeedDefs.GeneratorView[]
|
|
23
21
|
[k: string]: unknown
|
|
24
22
|
}
|
|
25
23
|
|
|
@@ -7,34 +7,30 @@ import { isObj, hasProp } from '../../../../util'
|
|
|
7
7
|
import { lexicons } from '../../../../lexicons'
|
|
8
8
|
import { CID } from 'multiformats/cid'
|
|
9
9
|
|
|
10
|
-
export interface QueryParams {
|
|
10
|
+
export interface QueryParams {
|
|
11
|
+
/** The DID of the repo. */
|
|
12
|
+
did: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type InputSchema = undefined
|
|
11
16
|
|
|
12
|
-
export interface
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/** Compare and swap with the previous commit by cid. */
|
|
16
|
-
swapCommit?: string
|
|
17
|
+
export interface OutputSchema {
|
|
18
|
+
cid: string
|
|
19
|
+
rev: string
|
|
17
20
|
[k: string]: unknown
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
export interface CallOptions {
|
|
21
24
|
headers?: Headers
|
|
22
|
-
qp?: QueryParams
|
|
23
|
-
encoding: 'application/json'
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export interface Response {
|
|
27
28
|
success: boolean
|
|
28
29
|
headers: Headers
|
|
30
|
+
data: OutputSchema
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
export class
|
|
32
|
-
constructor(src: XRPCError) {
|
|
33
|
-
super(src.status, src.error, src.message, src.headers)
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export class ConcurrentWritesError extends XRPCError {
|
|
33
|
+
export class RepoNotFoundError extends XRPCError {
|
|
38
34
|
constructor(src: XRPCError) {
|
|
39
35
|
super(src.status, src.error, src.message, src.headers)
|
|
40
36
|
}
|
|
@@ -42,8 +38,7 @@ export class ConcurrentWritesError extends XRPCError {
|
|
|
42
38
|
|
|
43
39
|
export function toKnownErr(e: any) {
|
|
44
40
|
if (e instanceof XRPCError) {
|
|
45
|
-
if (e.error === '
|
|
46
|
-
if (e.error === 'ConcurrentWrites') return new ConcurrentWritesError(e)
|
|
41
|
+
if (e.error === 'RepoNotFound') return new RepoNotFoundError(e)
|
|
47
42
|
}
|
|
48
43
|
return e
|
|
49
44
|
}
|
|
@@ -10,10 +10,8 @@ import { CID } from 'multiformats/cid'
|
|
|
10
10
|
export interface QueryParams {
|
|
11
11
|
/** The DID of the repo. */
|
|
12
12
|
did: string
|
|
13
|
-
/** The
|
|
14
|
-
|
|
15
|
-
/** The latest commit in the commit range (inclusive) */
|
|
16
|
-
latest?: string
|
|
13
|
+
/** The revision of the repo to catch up from. */
|
|
14
|
+
since?: string
|
|
17
15
|
}
|
|
18
16
|
|
|
19
17
|
export type InputSchema = undefined
|
|
@@ -10,15 +10,16 @@ import { CID } from 'multiformats/cid'
|
|
|
10
10
|
export interface QueryParams {
|
|
11
11
|
/** The DID of the repo. */
|
|
12
12
|
did: string
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
/** Optional revision of the repo to list blobs since */
|
|
14
|
+
since?: string
|
|
15
|
+
limit?: number
|
|
16
|
+
cursor?: string
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export type InputSchema = undefined
|
|
20
20
|
|
|
21
21
|
export interface OutputSchema {
|
|
22
|
+
cursor?: string
|
|
22
23
|
cids: string[]
|
|
23
24
|
[k: string]: unknown
|
|
24
25
|
}
|
|
@@ -13,7 +13,11 @@ export interface Commit {
|
|
|
13
13
|
tooBig: boolean
|
|
14
14
|
repo: string
|
|
15
15
|
commit: CID
|
|
16
|
-
prev
|
|
16
|
+
prev?: CID | null
|
|
17
|
+
/** The rev of the emitted commit */
|
|
18
|
+
rev: string
|
|
19
|
+
/** The rev of the last emitted commit from this repo */
|
|
20
|
+
since: string | null
|
|
17
21
|
/** CAR file containing relevant blocks */
|
|
18
22
|
blocks: Uint8Array
|
|
19
23
|
ops: RepoOp[]
|
|
@@ -10,10 +10,8 @@ import { CID } from 'multiformats/cid'
|
|
|
10
10
|
export interface QueryParams {}
|
|
11
11
|
|
|
12
12
|
export interface InputSchema {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/** Compare and swap with the previous commit by cid. */
|
|
16
|
-
swapCommit?: string
|
|
13
|
+
did: string
|
|
14
|
+
force?: boolean
|
|
17
15
|
[k: string]: unknown
|
|
18
16
|
}
|
|
19
17
|
|
|
@@ -28,22 +26,8 @@ export interface Response {
|
|
|
28
26
|
headers: Headers
|
|
29
27
|
}
|
|
30
28
|
|
|
31
|
-
export class InvalidSwapError extends XRPCError {
|
|
32
|
-
constructor(src: XRPCError) {
|
|
33
|
-
super(src.status, src.error, src.message, src.headers)
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export class ConcurrentWritesError extends XRPCError {
|
|
38
|
-
constructor(src: XRPCError) {
|
|
39
|
-
super(src.status, src.error, src.message, src.headers)
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
29
|
export function toKnownErr(e: any) {
|
|
44
30
|
if (e instanceof XRPCError) {
|
|
45
|
-
if (e.error === 'InvalidSwap') return new InvalidSwapError(e)
|
|
46
|
-
if (e.error === 'ConcurrentWrites') return new ConcurrentWritesError(e)
|
|
47
31
|
}
|
|
48
32
|
return e
|
|
49
33
|
}
|
package/src/index.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LabelPreference } from './moderation/types'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Used by the PersistSessionHandler to indicate what change occurred
|
|
3
5
|
*/
|
|
@@ -70,3 +72,21 @@ export type AtpAgentFetchHandler = (
|
|
|
70
72
|
export interface AtpAgentGlobalOpts {
|
|
71
73
|
fetch: AtpAgentFetchHandler
|
|
72
74
|
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Content-label preference
|
|
78
|
+
*/
|
|
79
|
+
export type BskyLabelPreference = LabelPreference | 'show'
|
|
80
|
+
// TEMP we need to permanently convert 'show' to 'ignore', for now we manually convert -prf
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Bluesky preferences object
|
|
84
|
+
*/
|
|
85
|
+
export interface BskyPreferences {
|
|
86
|
+
feeds: {
|
|
87
|
+
saved?: string[]
|
|
88
|
+
pinned?: string[]
|
|
89
|
+
}
|
|
90
|
+
adultContentEnabled: boolean
|
|
91
|
+
contentLabels: Record<string, BskyLabelPreference>
|
|
92
|
+
}
|