@atproto/api 0.12.13 → 0.12.15

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 (90) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/agent.d.ts.map +1 -1
  3. package/dist/agent.js +5 -0
  4. package/dist/agent.js.map +1 -1
  5. package/dist/client/index.d.ts +3 -0
  6. package/dist/client/index.d.ts.map +1 -1
  7. package/dist/client/index.js +13 -4
  8. package/dist/client/index.js.map +1 -1
  9. package/dist/client/lexicons.d.ts +145 -0
  10. package/dist/client/lexicons.d.ts.map +1 -1
  11. package/dist/client/lexicons.js +225 -4
  12. package/dist/client/lexicons.js.map +1 -1
  13. package/dist/client/types/chat/bsky/convo/defs.d.ts +1 -1
  14. package/dist/client/types/com/atproto/admin/defs.d.ts +1 -0
  15. package/dist/client/types/com/atproto/admin/defs.d.ts.map +1 -1
  16. package/dist/client/types/com/atproto/admin/defs.js.map +1 -1
  17. package/dist/client/types/com/atproto/admin/getSubjectStatus.d.ts +1 -0
  18. package/dist/client/types/com/atproto/admin/getSubjectStatus.d.ts.map +1 -1
  19. package/dist/client/types/com/atproto/admin/getSubjectStatus.js.map +1 -1
  20. package/dist/client/types/com/atproto/server/createSession.d.ts +3 -0
  21. package/dist/client/types/com/atproto/server/createSession.d.ts.map +1 -1
  22. package/dist/client/types/com/atproto/server/createSession.js.map +1 -1
  23. package/dist/client/types/com/atproto/server/getSession.d.ts +3 -0
  24. package/dist/client/types/com/atproto/server/getSession.d.ts.map +1 -1
  25. package/dist/client/types/com/atproto/server/getSession.js.map +1 -1
  26. package/dist/client/types/com/atproto/server/refreshSession.d.ts +3 -0
  27. package/dist/client/types/com/atproto/server/refreshSession.d.ts.map +1 -1
  28. package/dist/client/types/com/atproto/server/refreshSession.js.map +1 -1
  29. package/dist/client/types/com/atproto/sync/getBlob.d.ts +16 -1
  30. package/dist/client/types/com/atproto/sync/getBlob.d.ts.map +1 -1
  31. package/dist/client/types/com/atproto/sync/getBlob.js +41 -1
  32. package/dist/client/types/com/atproto/sync/getBlob.js.map +1 -1
  33. package/dist/client/types/com/atproto/sync/getBlocks.d.ts +16 -1
  34. package/dist/client/types/com/atproto/sync/getBlocks.d.ts.map +1 -1
  35. package/dist/client/types/com/atproto/sync/getBlocks.js +41 -1
  36. package/dist/client/types/com/atproto/sync/getBlocks.js.map +1 -1
  37. package/dist/client/types/com/atproto/sync/getLatestCommit.d.ts +9 -0
  38. package/dist/client/types/com/atproto/sync/getLatestCommit.d.ts.map +1 -1
  39. package/dist/client/types/com/atproto/sync/getLatestCommit.js +25 -1
  40. package/dist/client/types/com/atproto/sync/getLatestCommit.js.map +1 -1
  41. package/dist/client/types/com/atproto/sync/getRecord.d.ts +16 -1
  42. package/dist/client/types/com/atproto/sync/getRecord.d.ts.map +1 -1
  43. package/dist/client/types/com/atproto/sync/getRecord.js +41 -1
  44. package/dist/client/types/com/atproto/sync/getRecord.js.map +1 -1
  45. package/dist/client/types/com/atproto/sync/getRepo.d.ts +13 -1
  46. package/dist/client/types/com/atproto/sync/getRepo.d.ts.map +1 -1
  47. package/dist/client/types/com/atproto/sync/getRepo.js +33 -1
  48. package/dist/client/types/com/atproto/sync/getRepo.js.map +1 -1
  49. package/dist/client/types/com/atproto/sync/getRepoStatus.d.ts +31 -0
  50. package/dist/client/types/com/atproto/sync/getRepoStatus.d.ts.map +1 -0
  51. package/dist/client/types/com/atproto/sync/getRepoStatus.js +22 -0
  52. package/dist/client/types/com/atproto/sync/getRepoStatus.js.map +1 -0
  53. package/dist/client/types/com/atproto/sync/listBlobs.d.ts +13 -1
  54. package/dist/client/types/com/atproto/sync/listBlobs.d.ts.map +1 -1
  55. package/dist/client/types/com/atproto/sync/listBlobs.js +33 -1
  56. package/dist/client/types/com/atproto/sync/listBlobs.js.map +1 -1
  57. package/dist/client/types/com/atproto/sync/listRepos.d.ts +3 -0
  58. package/dist/client/types/com/atproto/sync/listRepos.d.ts.map +1 -1
  59. package/dist/client/types/com/atproto/sync/listRepos.js.map +1 -1
  60. package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +18 -3
  61. package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
  62. package/dist/client/types/com/atproto/sync/subscribeRepos.js +11 -1
  63. package/dist/client/types/com/atproto/sync/subscribeRepos.js.map +1 -1
  64. package/dist/client/types/tools/ozone/moderation/defs.d.ts +2 -0
  65. package/dist/client/types/tools/ozone/moderation/defs.d.ts.map +1 -1
  66. package/dist/client/types/tools/ozone/moderation/defs.js.map +1 -1
  67. package/dist/types.d.ts +2 -0
  68. package/dist/types.d.ts.map +1 -1
  69. package/package.json +1 -1
  70. package/src/agent.ts +5 -0
  71. package/src/client/index.ts +13 -0
  72. package/src/client/lexicons.ts +236 -7
  73. package/src/client/types/chat/bsky/convo/defs.ts +1 -1
  74. package/src/client/types/com/atproto/admin/defs.ts +1 -0
  75. package/src/client/types/com/atproto/admin/getSubjectStatus.ts +1 -0
  76. package/src/client/types/com/atproto/server/createSession.ts +3 -0
  77. package/src/client/types/com/atproto/server/getSession.ts +3 -0
  78. package/src/client/types/com/atproto/server/refreshSession.ts +3 -0
  79. package/src/client/types/com/atproto/sync/getBlob.ts +35 -0
  80. package/src/client/types/com/atproto/sync/getBlocks.ts +35 -0
  81. package/src/client/types/com/atproto/sync/getLatestCommit.ts +21 -0
  82. package/src/client/types/com/atproto/sync/getRecord.ts +35 -0
  83. package/src/client/types/com/atproto/sync/getRepo.ts +28 -0
  84. package/src/client/types/com/atproto/sync/getRepoStatus.ts +48 -0
  85. package/src/client/types/com/atproto/sync/listBlobs.ts +28 -0
  86. package/src/client/types/com/atproto/sync/listRepos.ts +3 -0
  87. package/src/client/types/com/atproto/sync/subscribeRepos.ts +29 -3
  88. package/src/client/types/tools/ozone/moderation/defs.ts +2 -0
  89. package/src/types.ts +2 -0
  90. package/tests/agent.test.ts +1 -0
@@ -66,6 +66,10 @@ export const schemaDict = {
66
66
  inviteNote: {
67
67
  type: 'string',
68
68
  },
69
+ deactivatedAt: {
70
+ type: 'string',
71
+ format: 'datetime',
72
+ },
69
73
  },
70
74
  },
71
75
  repoRef: {
@@ -364,6 +368,10 @@ export const schemaDict = {
364
368
  type: 'ref',
365
369
  ref: 'lex:com.atproto.admin.defs#statusAttr',
366
370
  },
371
+ deactivated: {
372
+ type: 'ref',
373
+ ref: 'lex:com.atproto.admin.defs#statusAttr',
374
+ },
367
375
  },
368
376
  },
369
377
  },
@@ -2255,6 +2263,15 @@ export const schemaDict = {
2255
2263
  emailAuthFactor: {
2256
2264
  type: 'boolean',
2257
2265
  },
2266
+ active: {
2267
+ type: 'boolean',
2268
+ },
2269
+ status: {
2270
+ type: 'string',
2271
+ description:
2272
+ 'If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.',
2273
+ knownValues: ['takendown', 'suspended', 'deactivated'],
2274
+ },
2258
2275
  },
2259
2276
  },
2260
2277
  },
@@ -2591,6 +2608,15 @@ export const schemaDict = {
2591
2608
  didDoc: {
2592
2609
  type: 'unknown',
2593
2610
  },
2611
+ active: {
2612
+ type: 'boolean',
2613
+ },
2614
+ status: {
2615
+ type: 'string',
2616
+ description:
2617
+ 'If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.',
2618
+ knownValues: ['takendown', 'suspended', 'deactivated'],
2619
+ },
2594
2620
  },
2595
2621
  },
2596
2622
  },
@@ -2675,6 +2701,15 @@ export const schemaDict = {
2675
2701
  didDoc: {
2676
2702
  type: 'unknown',
2677
2703
  },
2704
+ active: {
2705
+ type: 'boolean',
2706
+ },
2707
+ status: {
2708
+ type: 'string',
2709
+ description:
2710
+ "Hosting status of the account. If not specified, then assume 'active'.",
2711
+ knownValues: ['takendown', 'suspended', 'deactivated'],
2712
+ },
2678
2713
  },
2679
2714
  },
2680
2715
  },
@@ -2912,6 +2947,23 @@ export const schemaDict = {
2912
2947
  output: {
2913
2948
  encoding: '*/*',
2914
2949
  },
2950
+ errors: [
2951
+ {
2952
+ name: 'BlobNotFound',
2953
+ },
2954
+ {
2955
+ name: 'RepoNotFound',
2956
+ },
2957
+ {
2958
+ name: 'RepoTakendown',
2959
+ },
2960
+ {
2961
+ name: 'RepoSuspended',
2962
+ },
2963
+ {
2964
+ name: 'RepoDeactivated',
2965
+ },
2966
+ ],
2915
2967
  },
2916
2968
  },
2917
2969
  },
@@ -2944,6 +2996,23 @@ export const schemaDict = {
2944
2996
  output: {
2945
2997
  encoding: 'application/vnd.ipld.car',
2946
2998
  },
2999
+ errors: [
3000
+ {
3001
+ name: 'BlockNotFound',
3002
+ },
3003
+ {
3004
+ name: 'RepoNotFound',
3005
+ },
3006
+ {
3007
+ name: 'RepoTakendown',
3008
+ },
3009
+ {
3010
+ name: 'RepoSuspended',
3011
+ },
3012
+ {
3013
+ name: 'RepoDeactivated',
3014
+ },
3015
+ ],
2947
3016
  },
2948
3017
  },
2949
3018
  },
@@ -3050,6 +3119,15 @@ export const schemaDict = {
3050
3119
  {
3051
3120
  name: 'RepoNotFound',
3052
3121
  },
3122
+ {
3123
+ name: 'RepoTakendown',
3124
+ },
3125
+ {
3126
+ name: 'RepoSuspended',
3127
+ },
3128
+ {
3129
+ name: 'RepoDeactivated',
3130
+ },
3053
3131
  ],
3054
3132
  },
3055
3133
  },
@@ -3090,6 +3168,23 @@ export const schemaDict = {
3090
3168
  output: {
3091
3169
  encoding: 'application/vnd.ipld.car',
3092
3170
  },
3171
+ errors: [
3172
+ {
3173
+ name: 'RecordNotFound',
3174
+ },
3175
+ {
3176
+ name: 'RepoNotFound',
3177
+ },
3178
+ {
3179
+ name: 'RepoTakendown',
3180
+ },
3181
+ {
3182
+ name: 'RepoSuspended',
3183
+ },
3184
+ {
3185
+ name: 'RepoDeactivated',
3186
+ },
3187
+ ],
3093
3188
  },
3094
3189
  },
3095
3190
  },
@@ -3120,6 +3215,74 @@ export const schemaDict = {
3120
3215
  output: {
3121
3216
  encoding: 'application/vnd.ipld.car',
3122
3217
  },
3218
+ errors: [
3219
+ {
3220
+ name: 'RepoNotFound',
3221
+ },
3222
+ {
3223
+ name: 'RepoTakendown',
3224
+ },
3225
+ {
3226
+ name: 'RepoSuspended',
3227
+ },
3228
+ {
3229
+ name: 'RepoDeactivated',
3230
+ },
3231
+ ],
3232
+ },
3233
+ },
3234
+ },
3235
+ ComAtprotoSyncGetRepoStatus: {
3236
+ lexicon: 1,
3237
+ id: 'com.atproto.sync.getRepoStatus',
3238
+ defs: {
3239
+ main: {
3240
+ type: 'query',
3241
+ description:
3242
+ 'Get the hosting status for a repository, on this server. Expected to be implemented by PDS and Relay.',
3243
+ parameters: {
3244
+ type: 'params',
3245
+ required: ['did'],
3246
+ properties: {
3247
+ did: {
3248
+ type: 'string',
3249
+ format: 'did',
3250
+ description: 'The DID of the repo.',
3251
+ },
3252
+ },
3253
+ },
3254
+ output: {
3255
+ encoding: 'application/json',
3256
+ schema: {
3257
+ type: 'object',
3258
+ required: ['did', 'active'],
3259
+ properties: {
3260
+ did: {
3261
+ type: 'string',
3262
+ format: 'did',
3263
+ },
3264
+ active: {
3265
+ type: 'boolean',
3266
+ },
3267
+ status: {
3268
+ type: 'string',
3269
+ description:
3270
+ 'If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.',
3271
+ knownValues: ['takendown', 'suspended', 'deactivated'],
3272
+ },
3273
+ rev: {
3274
+ type: 'string',
3275
+ description:
3276
+ 'Optional field, the current rev of the repo, if active=true',
3277
+ },
3278
+ },
3279
+ },
3280
+ },
3281
+ errors: [
3282
+ {
3283
+ name: 'RepoNotFound',
3284
+ },
3285
+ ],
3123
3286
  },
3124
3287
  },
3125
3288
  },
@@ -3174,6 +3337,20 @@ export const schemaDict = {
3174
3337
  },
3175
3338
  },
3176
3339
  },
3340
+ errors: [
3341
+ {
3342
+ name: 'RepoNotFound',
3343
+ },
3344
+ {
3345
+ name: 'RepoTakendown',
3346
+ },
3347
+ {
3348
+ name: 'RepoSuspended',
3349
+ },
3350
+ {
3351
+ name: 'RepoDeactivated',
3352
+ },
3353
+ ],
3177
3354
  },
3178
3355
  },
3179
3356
  },
@@ -3235,6 +3412,15 @@ export const schemaDict = {
3235
3412
  rev: {
3236
3413
  type: 'string',
3237
3414
  },
3415
+ active: {
3416
+ type: 'boolean',
3417
+ },
3418
+ status: {
3419
+ type: 'string',
3420
+ description:
3421
+ 'If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.',
3422
+ knownValues: ['takendown', 'suspended', 'deactivated'],
3423
+ },
3238
3424
  },
3239
3425
  },
3240
3426
  },
@@ -3312,6 +3498,7 @@ export const schemaDict = {
3312
3498
  refs: [
3313
3499
  'lex:com.atproto.sync.subscribeRepos#commit',
3314
3500
  'lex:com.atproto.sync.subscribeRepos#identity',
3501
+ 'lex:com.atproto.sync.subscribeRepos#account',
3315
3502
  'lex:com.atproto.sync.subscribeRepos#handle',
3316
3503
  'lex:com.atproto.sync.subscribeRepos#migrate',
3317
3504
  'lex:com.atproto.sync.subscribeRepos#tombstone',
@@ -3435,12 +3622,47 @@ export const schemaDict = {
3435
3622
  type: 'string',
3436
3623
  format: 'datetime',
3437
3624
  },
3625
+ handle: {
3626
+ type: 'string',
3627
+ format: 'handle',
3628
+ description:
3629
+ "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.",
3630
+ },
3438
3631
  },
3439
3632
  },
3440
- handle: {
3633
+ account: {
3441
3634
  type: 'object',
3442
3635
  description:
3443
- "Represents an update of the account's handle, or transition to/from invalid state. NOTE: Will be deprecated in favor of #identity.",
3636
+ "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.",
3637
+ required: ['seq', 'did', 'time', 'active'],
3638
+ properties: {
3639
+ seq: {
3640
+ type: 'integer',
3641
+ },
3642
+ did: {
3643
+ type: 'string',
3644
+ format: 'did',
3645
+ },
3646
+ time: {
3647
+ type: 'string',
3648
+ format: 'datetime',
3649
+ },
3650
+ active: {
3651
+ type: 'boolean',
3652
+ description:
3653
+ 'Indicates that the account has a repository which can be fetched from the host that emitted this event.',
3654
+ },
3655
+ status: {
3656
+ type: 'string',
3657
+ description:
3658
+ 'If active=false, this optional field indicates a reason for why the account is not active.',
3659
+ knownValues: ['takendown', 'suspended', 'deleted', 'deactivated'],
3660
+ },
3661
+ },
3662
+ },
3663
+ handle: {
3664
+ type: 'object',
3665
+ description: 'DEPRECATED -- Use #identity event instead',
3444
3666
  required: ['seq', 'did', 'handle', 'time'],
3445
3667
  properties: {
3446
3668
  seq: {
@@ -3462,8 +3684,7 @@ export const schemaDict = {
3462
3684
  },
3463
3685
  migrate: {
3464
3686
  type: 'object',
3465
- description:
3466
- 'Represents an account moving from one PDS instance to another. NOTE: not implemented; account migration uses #identity instead',
3687
+ description: 'DEPRECATED -- Use #account event instead',
3467
3688
  required: ['seq', 'did', 'migrateTo', 'time'],
3468
3689
  nullable: ['migrateTo'],
3469
3690
  properties: {
@@ -3485,8 +3706,7 @@ export const schemaDict = {
3485
3706
  },
3486
3707
  tombstone: {
3487
3708
  type: 'object',
3488
- description:
3489
- 'Indicates that an account has been deleted. NOTE: may be deprecated in favor of #identity or a future #account event',
3709
+ description: 'DEPRECATED -- Use #account event instead',
3490
3710
  required: ['seq', 'did', 'time'],
3491
3711
  properties: {
3492
3712
  seq: {
@@ -8379,7 +8599,7 @@ export const schemaDict = {
8379
8599
  },
8380
8600
  embed: {
8381
8601
  type: 'union',
8382
- refs: ['lex:app.bsky.embed.record'],
8602
+ refs: ['lex:app.bsky.embed.record#view'],
8383
8603
  },
8384
8604
  sender: {
8385
8605
  type: 'ref',
@@ -9814,6 +10034,10 @@ export const schemaDict = {
9814
10034
  inviteNote: {
9815
10035
  type: 'string',
9816
10036
  },
10037
+ deactivatedAt: {
10038
+ type: 'string',
10039
+ format: 'datetime',
10040
+ },
9817
10041
  },
9818
10042
  },
9819
10043
  repoViewDetail: {
@@ -9879,6 +10103,10 @@ export const schemaDict = {
9879
10103
  type: 'string',
9880
10104
  format: 'datetime',
9881
10105
  },
10106
+ deactivatedAt: {
10107
+ type: 'string',
10108
+ format: 'datetime',
10109
+ },
9882
10110
  },
9883
10111
  },
9884
10112
  repoViewNotFound: {
@@ -10624,6 +10852,7 @@ export const ids = {
10624
10852
  ComAtprotoSyncGetLatestCommit: 'com.atproto.sync.getLatestCommit',
10625
10853
  ComAtprotoSyncGetRecord: 'com.atproto.sync.getRecord',
10626
10854
  ComAtprotoSyncGetRepo: 'com.atproto.sync.getRepo',
10855
+ ComAtprotoSyncGetRepoStatus: 'com.atproto.sync.getRepoStatus',
10627
10856
  ComAtprotoSyncListBlobs: 'com.atproto.sync.listBlobs',
10628
10857
  ComAtprotoSyncListRepos: 'com.atproto.sync.listRepos',
10629
10858
  ComAtprotoSyncNotifyOfUpdate: 'com.atproto.sync.notifyOfUpdate',
@@ -54,7 +54,7 @@ export interface MessageView {
54
54
  text: string
55
55
  /** Annotations of text (mentions, URLs, hashtags, etc) */
56
56
  facets?: AppBskyRichtextFacet.Main[]
57
- embed?: AppBskyEmbedRecord.Main | { $type: string; [k: string]: unknown }
57
+ embed?: AppBskyEmbedRecord.View | { $type: string; [k: string]: unknown }
58
58
  sender: MessageViewSender
59
59
  sentAt: string
60
60
  [k: string]: unknown
@@ -36,6 +36,7 @@ export interface AccountView {
36
36
  invitesDisabled?: boolean
37
37
  emailConfirmedAt?: string
38
38
  inviteNote?: string
39
+ deactivatedAt?: string
39
40
  [k: string]: unknown
40
41
  }
41
42
 
@@ -24,6 +24,7 @@ export interface OutputSchema {
24
24
  | ComAtprotoAdminDefs.RepoBlobRef
25
25
  | { $type: string; [k: string]: unknown }
26
26
  takedown?: ComAtprotoAdminDefs.StatusAttr
27
+ deactivated?: ComAtprotoAdminDefs.StatusAttr
27
28
  [k: string]: unknown
28
29
  }
29
30
 
@@ -26,6 +26,9 @@ export interface OutputSchema {
26
26
  email?: string
27
27
  emailConfirmed?: boolean
28
28
  emailAuthFactor?: boolean
29
+ active?: boolean
30
+ /** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */
31
+ status?: 'takendown' | 'suspended' | 'deactivated' | (string & {})
29
32
  [k: string]: unknown
30
33
  }
31
34
 
@@ -18,6 +18,9 @@ export interface OutputSchema {
18
18
  emailConfirmed?: boolean
19
19
  emailAuthFactor?: boolean
20
20
  didDoc?: {}
21
+ active?: boolean
22
+ /** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */
23
+ status?: 'takendown' | 'suspended' | 'deactivated' | (string & {})
21
24
  [k: string]: unknown
22
25
  }
23
26
 
@@ -17,6 +17,9 @@ export interface OutputSchema {
17
17
  handle: string
18
18
  did: string
19
19
  didDoc?: {}
20
+ active?: boolean
21
+ /** Hosting status of the account. If not specified, then assume 'active'. */
22
+ status?: 'takendown' | 'suspended' | 'deactivated' | (string & {})
20
23
  [k: string]: unknown
21
24
  }
22
25
 
@@ -26,8 +26,43 @@ export interface Response {
26
26
  data: Uint8Array
27
27
  }
28
28
 
29
+ export class BlobNotFoundError extends XRPCError {
30
+ constructor(src: XRPCError) {
31
+ super(src.status, src.error, src.message, src.headers)
32
+ }
33
+ }
34
+
35
+ export class RepoNotFoundError extends XRPCError {
36
+ constructor(src: XRPCError) {
37
+ super(src.status, src.error, src.message, src.headers)
38
+ }
39
+ }
40
+
41
+ export class RepoTakendownError extends XRPCError {
42
+ constructor(src: XRPCError) {
43
+ super(src.status, src.error, src.message, src.headers)
44
+ }
45
+ }
46
+
47
+ export class RepoSuspendedError extends XRPCError {
48
+ constructor(src: XRPCError) {
49
+ super(src.status, src.error, src.message, src.headers)
50
+ }
51
+ }
52
+
53
+ export class RepoDeactivatedError extends XRPCError {
54
+ constructor(src: XRPCError) {
55
+ super(src.status, src.error, src.message, src.headers)
56
+ }
57
+ }
58
+
29
59
  export function toKnownErr(e: any) {
30
60
  if (e instanceof XRPCError) {
61
+ if (e.error === 'BlobNotFound') return new BlobNotFoundError(e)
62
+ if (e.error === 'RepoNotFound') return new RepoNotFoundError(e)
63
+ if (e.error === 'RepoTakendown') return new RepoTakendownError(e)
64
+ if (e.error === 'RepoSuspended') return new RepoSuspendedError(e)
65
+ if (e.error === 'RepoDeactivated') return new RepoDeactivatedError(e)
31
66
  }
32
67
  return e
33
68
  }
@@ -25,8 +25,43 @@ export interface Response {
25
25
  data: Uint8Array
26
26
  }
27
27
 
28
+ export class BlockNotFoundError extends XRPCError {
29
+ constructor(src: XRPCError) {
30
+ super(src.status, src.error, src.message, src.headers)
31
+ }
32
+ }
33
+
34
+ export class RepoNotFoundError extends XRPCError {
35
+ constructor(src: XRPCError) {
36
+ super(src.status, src.error, src.message, src.headers)
37
+ }
38
+ }
39
+
40
+ export class RepoTakendownError extends XRPCError {
41
+ constructor(src: XRPCError) {
42
+ super(src.status, src.error, src.message, src.headers)
43
+ }
44
+ }
45
+
46
+ export class RepoSuspendedError extends XRPCError {
47
+ constructor(src: XRPCError) {
48
+ super(src.status, src.error, src.message, src.headers)
49
+ }
50
+ }
51
+
52
+ export class RepoDeactivatedError extends XRPCError {
53
+ constructor(src: XRPCError) {
54
+ super(src.status, src.error, src.message, src.headers)
55
+ }
56
+ }
57
+
28
58
  export function toKnownErr(e: any) {
29
59
  if (e instanceof XRPCError) {
60
+ if (e.error === 'BlockNotFound') return new BlockNotFoundError(e)
61
+ if (e.error === 'RepoNotFound') return new RepoNotFoundError(e)
62
+ if (e.error === 'RepoTakendown') return new RepoTakendownError(e)
63
+ if (e.error === 'RepoSuspended') return new RepoSuspendedError(e)
64
+ if (e.error === 'RepoDeactivated') return new RepoDeactivatedError(e)
30
65
  }
31
66
  return e
32
67
  }
@@ -36,9 +36,30 @@ export class RepoNotFoundError extends XRPCError {
36
36
  }
37
37
  }
38
38
 
39
+ export class RepoTakendownError extends XRPCError {
40
+ constructor(src: XRPCError) {
41
+ super(src.status, src.error, src.message, src.headers)
42
+ }
43
+ }
44
+
45
+ export class RepoSuspendedError extends XRPCError {
46
+ constructor(src: XRPCError) {
47
+ super(src.status, src.error, src.message, src.headers)
48
+ }
49
+ }
50
+
51
+ export class RepoDeactivatedError extends XRPCError {
52
+ constructor(src: XRPCError) {
53
+ super(src.status, src.error, src.message, src.headers)
54
+ }
55
+ }
56
+
39
57
  export function toKnownErr(e: any) {
40
58
  if (e instanceof XRPCError) {
41
59
  if (e.error === 'RepoNotFound') return new RepoNotFoundError(e)
60
+ if (e.error === 'RepoTakendown') return new RepoTakendownError(e)
61
+ if (e.error === 'RepoSuspended') return new RepoSuspendedError(e)
62
+ if (e.error === 'RepoDeactivated') return new RepoDeactivatedError(e)
42
63
  }
43
64
  return e
44
65
  }
@@ -29,8 +29,43 @@ export interface Response {
29
29
  data: Uint8Array
30
30
  }
31
31
 
32
+ export class RecordNotFoundError extends XRPCError {
33
+ constructor(src: XRPCError) {
34
+ super(src.status, src.error, src.message, src.headers)
35
+ }
36
+ }
37
+
38
+ export class RepoNotFoundError extends XRPCError {
39
+ constructor(src: XRPCError) {
40
+ super(src.status, src.error, src.message, src.headers)
41
+ }
42
+ }
43
+
44
+ export class RepoTakendownError extends XRPCError {
45
+ constructor(src: XRPCError) {
46
+ super(src.status, src.error, src.message, src.headers)
47
+ }
48
+ }
49
+
50
+ export class RepoSuspendedError extends XRPCError {
51
+ constructor(src: XRPCError) {
52
+ super(src.status, src.error, src.message, src.headers)
53
+ }
54
+ }
55
+
56
+ export class RepoDeactivatedError extends XRPCError {
57
+ constructor(src: XRPCError) {
58
+ super(src.status, src.error, src.message, src.headers)
59
+ }
60
+ }
61
+
32
62
  export function toKnownErr(e: any) {
33
63
  if (e instanceof XRPCError) {
64
+ if (e.error === 'RecordNotFound') return new RecordNotFoundError(e)
65
+ if (e.error === 'RepoNotFound') return new RepoNotFoundError(e)
66
+ if (e.error === 'RepoTakendown') return new RepoTakendownError(e)
67
+ if (e.error === 'RepoSuspended') return new RepoSuspendedError(e)
68
+ if (e.error === 'RepoDeactivated') return new RepoDeactivatedError(e)
34
69
  }
35
70
  return e
36
71
  }
@@ -26,8 +26,36 @@ export interface Response {
26
26
  data: Uint8Array
27
27
  }
28
28
 
29
+ export class RepoNotFoundError extends XRPCError {
30
+ constructor(src: XRPCError) {
31
+ super(src.status, src.error, src.message, src.headers)
32
+ }
33
+ }
34
+
35
+ export class RepoTakendownError extends XRPCError {
36
+ constructor(src: XRPCError) {
37
+ super(src.status, src.error, src.message, src.headers)
38
+ }
39
+ }
40
+
41
+ export class RepoSuspendedError extends XRPCError {
42
+ constructor(src: XRPCError) {
43
+ super(src.status, src.error, src.message, src.headers)
44
+ }
45
+ }
46
+
47
+ export class RepoDeactivatedError extends XRPCError {
48
+ constructor(src: XRPCError) {
49
+ super(src.status, src.error, src.message, src.headers)
50
+ }
51
+ }
52
+
29
53
  export function toKnownErr(e: any) {
30
54
  if (e instanceof XRPCError) {
55
+ if (e.error === 'RepoNotFound') return new RepoNotFoundError(e)
56
+ if (e.error === 'RepoTakendown') return new RepoTakendownError(e)
57
+ if (e.error === 'RepoSuspended') return new RepoSuspendedError(e)
58
+ if (e.error === 'RepoDeactivated') return new RepoDeactivatedError(e)
31
59
  }
32
60
  return e
33
61
  }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
9
+
10
+ export interface QueryParams {
11
+ /** The DID of the repo. */
12
+ did: string
13
+ }
14
+
15
+ export type InputSchema = undefined
16
+
17
+ export interface OutputSchema {
18
+ did: string
19
+ active: boolean
20
+ /** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */
21
+ status?: 'takendown' | 'suspended' | 'deactivated' | (string & {})
22
+ /** Optional field, the current rev of the repo, if active=true */
23
+ rev?: string
24
+ [k: string]: unknown
25
+ }
26
+
27
+ export interface CallOptions {
28
+ headers?: Headers
29
+ }
30
+
31
+ export interface Response {
32
+ success: boolean
33
+ headers: Headers
34
+ data: OutputSchema
35
+ }
36
+
37
+ export class RepoNotFoundError extends XRPCError {
38
+ constructor(src: XRPCError) {
39
+ super(src.status, src.error, src.message, src.headers)
40
+ }
41
+ }
42
+
43
+ export function toKnownErr(e: any) {
44
+ if (e instanceof XRPCError) {
45
+ if (e.error === 'RepoNotFound') return new RepoNotFoundError(e)
46
+ }
47
+ return e
48
+ }