@atproto/api 0.6.7 → 0.6.8

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 (111) hide show
  1. package/build.js +8 -0
  2. package/dist/agent.d.ts +25 -44
  3. package/dist/bsky-agent.d.ts +24 -0
  4. package/dist/client/types/app/bsky/actor/createScene.d.ts +32 -0
  5. package/dist/client/types/app/bsky/actor/defs.d.ts +65 -74
  6. package/dist/client/types/app/bsky/actor/ref.d.ts +28 -0
  7. package/dist/client/types/app/bsky/actor/search.d.ts +22 -0
  8. package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +20 -0
  9. package/dist/client/types/app/bsky/actor/updateProfile.d.ts +40 -0
  10. package/dist/client/types/app/bsky/embed/external.d.ts +23 -23
  11. package/dist/client/types/app/bsky/embed/images.d.ts +20 -20
  12. package/dist/client/types/app/bsky/embed/recordWithMedia.d.ts +20 -26
  13. package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +28 -0
  14. package/dist/client/types/app/bsky/feed/getSavedFeeds.d.ts +21 -0
  15. package/dist/client/types/app/bsky/feed/getVotes.d.ts +36 -0
  16. package/dist/client/types/app/bsky/feed/like.d.ts +7 -7
  17. package/dist/client/types/app/bsky/feed/repost.d.ts +7 -7
  18. package/dist/client/types/app/bsky/feed/saveFeed.d.ts +17 -0
  19. package/dist/client/types/app/bsky/feed/setVote.d.ts +25 -0
  20. package/dist/client/types/app/bsky/feed/trend.d.ts +9 -0
  21. package/dist/client/types/app/bsky/feed/unsaveFeed.d.ts +17 -0
  22. package/dist/client/types/app/bsky/feed/vote.d.ts +10 -0
  23. package/dist/client/types/app/bsky/graph/assertCreator.d.ts +1 -0
  24. package/dist/client/types/app/bsky/graph/assertMember.d.ts +1 -0
  25. package/dist/client/types/app/bsky/graph/assertion.d.ts +10 -0
  26. package/dist/client/types/app/bsky/graph/block.d.ts +6 -6
  27. package/dist/client/types/app/bsky/graph/confirmation.d.ts +11 -0
  28. package/dist/client/types/app/bsky/graph/defs.d.ts +36 -36
  29. package/dist/client/types/app/bsky/graph/follow.d.ts +6 -6
  30. package/dist/client/types/app/bsky/graph/getAssertions.d.ts +48 -0
  31. package/dist/client/types/app/bsky/graph/getListBlocks.d.ts +21 -0
  32. package/dist/client/types/app/bsky/graph/getMembers.d.ts +36 -0
  33. package/dist/client/types/app/bsky/graph/getMemberships.d.ts +36 -0
  34. package/dist/client/types/app/bsky/graph/listblock.d.ts +8 -0
  35. package/dist/client/types/app/bsky/graph/listitem.d.ts +7 -7
  36. package/dist/client/types/app/bsky/graph/mute.d.ts +17 -0
  37. package/dist/client/types/app/bsky/graph/subscribeMuteList.d.ts +17 -0
  38. package/dist/client/types/app/bsky/graph/unmute.d.ts +17 -0
  39. package/dist/client/types/app/bsky/graph/unsubscribeMuteList.d.ts +17 -0
  40. package/dist/client/types/app/bsky/notification/getCount.d.ts +17 -0
  41. package/dist/client/types/app/bsky/notification/list.d.ts +35 -0
  42. package/dist/client/types/app/bsky/richtext/facet.d.ts +22 -26
  43. package/dist/client/types/app/bsky/system/actorScene.d.ts +1 -0
  44. package/dist/client/types/app/bsky/system/actorUser.d.ts +1 -0
  45. package/dist/client/types/app/bsky/system/declRef.d.ts +8 -0
  46. package/dist/client/types/app/bsky/system/declaration.d.ts +7 -0
  47. package/dist/client/types/com/atproto/account/create.d.ts +41 -0
  48. package/dist/client/types/com/atproto/account/createInviteCode.d.ts +22 -0
  49. package/dist/client/types/com/atproto/account/delete.d.ts +25 -0
  50. package/dist/client/types/com/atproto/account/get.d.ts +12 -0
  51. package/dist/client/types/com/atproto/account/requestDelete.d.ts +13 -0
  52. package/dist/client/types/com/atproto/account/requestPasswordReset.d.ts +17 -0
  53. package/dist/client/types/com/atproto/account/resetPassword.d.ts +24 -0
  54. package/dist/client/types/com/atproto/admin/blob.d.ts +37 -0
  55. package/dist/client/types/com/atproto/admin/moderationAction.d.ts +60 -0
  56. package/dist/client/types/com/atproto/admin/moderationReport.d.ts +37 -0
  57. package/dist/client/types/com/atproto/admin/record.d.ts +43 -0
  58. package/dist/client/types/com/atproto/admin/repo.d.ts +45 -0
  59. package/dist/client/types/com/atproto/blob/upload.d.ts +19 -0
  60. package/dist/client/types/com/atproto/handle/resolve.d.ts +18 -0
  61. package/dist/client/types/com/atproto/handle/update.d.ts +17 -0
  62. package/dist/client/types/com/atproto/label/subscribeLabels.d.ts +12 -12
  63. package/dist/client/types/com/atproto/moderation/defs.d.ts +7 -16
  64. package/dist/client/types/com/atproto/repo/batchWrite.d.ts +46 -0
  65. package/dist/client/types/com/atproto/repo/describe.d.ts +22 -0
  66. package/dist/client/types/com/atproto/repo/recordRef.d.ts +8 -0
  67. package/dist/client/types/com/atproto/repo/repoRef.d.ts +7 -0
  68. package/dist/client/types/com/atproto/repo/strongRef.d.ts +6 -6
  69. package/dist/client/types/com/atproto/report/create.d.ts +39 -0
  70. package/dist/client/types/com/atproto/report/reasonType.d.ts +3 -0
  71. package/dist/client/types/com/atproto/report/subject.d.ts +23 -0
  72. package/dist/client/types/com/atproto/server/defs.d.ts +16 -16
  73. package/dist/client/types/com/atproto/server/getAccountsConfig.d.ts +27 -0
  74. package/dist/client/types/com/atproto/session/create.d.ts +29 -0
  75. package/dist/client/types/com/atproto/session/delete.d.ts +13 -0
  76. package/dist/client/types/com/atproto/session/get.d.ts +18 -0
  77. package/dist/client/types/com/atproto/session/refresh.d.ts +24 -0
  78. package/dist/client/types/com/atproto/sync/getRoot.d.ts +18 -0
  79. package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +9 -0
  80. package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +46 -46
  81. package/dist/client/types/com/atproto/sync/updateRepo.d.ts +15 -0
  82. package/dist/client/util.d.ts +2 -5
  83. package/dist/helpers/bsky.d.ts +20 -0
  84. package/dist/index.d.ts +1 -1
  85. package/dist/index.js +1260 -865
  86. package/dist/index.js.map +4 -4
  87. package/dist/mixins/bsky.d.ts +23 -0
  88. package/dist/rich-text/detection.d.ts +4 -4
  89. package/dist/rich-text/rich-text.d.ts +31 -31
  90. package/dist/rich-text/sanitization.d.ts +4 -7
  91. package/dist/rich-text/sanitize.d.ts +4 -0
  92. package/dist/rich-text/unicode.d.ts +9 -9
  93. package/dist/session.d.ts +42 -0
  94. package/dist/types.d.ts +32 -34
  95. package/package.json +23 -22
  96. package/src/bsky-agent.ts +181 -1
  97. package/src/client/index.ts +36 -39
  98. package/src/client/lexicons.ts +76 -129
  99. package/src/client/types/com/atproto/sync/getCheckout.ts +0 -2
  100. package/src/client/types/com/atproto/sync/{getCommitPath.ts → getLatestCommit.ts} +9 -5
  101. package/src/client/types/com/atproto/sync/getRepo.ts +2 -4
  102. package/src/client/types/com/atproto/sync/listBlobs.ts +5 -4
  103. package/src/client/types/com/atproto/sync/subscribeRepos.ts +5 -1
  104. package/src/client/types/com/atproto/{admin/rebaseRepo.ts → temp/upgradeRepoVersion.ts} +1 -18
  105. package/src/index.ts +1 -1
  106. package/src/types.ts +20 -0
  107. package/tests/bsky-agent.test.ts +149 -0
  108. package/tsconfig.build.tsbuildinfo +1 -1
  109. package/update-pkg.js +14 -0
  110. package/LICENSE +0 -21
  111. package/src/client/types/com/atproto/repo/rebaseRepo.ts +0 -49
@@ -18,7 +18,6 @@ import * as ComAtprotoAdminGetModerationReport from './types/com/atproto/admin/g
18
18
  import * as ComAtprotoAdminGetModerationReports from './types/com/atproto/admin/getModerationReports'
19
19
  import * as ComAtprotoAdminGetRecord from './types/com/atproto/admin/getRecord'
20
20
  import * as ComAtprotoAdminGetRepo from './types/com/atproto/admin/getRepo'
21
- import * as ComAtprotoAdminRebaseRepo from './types/com/atproto/admin/rebaseRepo'
22
21
  import * as ComAtprotoAdminResolveModerationReports from './types/com/atproto/admin/resolveModerationReports'
23
22
  import * as ComAtprotoAdminReverseModerationAction from './types/com/atproto/admin/reverseModerationAction'
24
23
  import * as ComAtprotoAdminSearchRepos from './types/com/atproto/admin/searchRepos'
@@ -40,7 +39,6 @@ import * as ComAtprotoRepoDescribeRepo from './types/com/atproto/repo/describeRe
40
39
  import * as ComAtprotoRepoGetRecord from './types/com/atproto/repo/getRecord'
41
40
  import * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords'
42
41
  import * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord'
43
- import * as ComAtprotoRepoRebaseRepo from './types/com/atproto/repo/rebaseRepo'
44
42
  import * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef'
45
43
  import * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob'
46
44
  import * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount'
@@ -63,8 +61,8 @@ import * as ComAtprotoServerRevokeAppPassword from './types/com/atproto/server/r
63
61
  import * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob'
64
62
  import * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks'
65
63
  import * as ComAtprotoSyncGetCheckout from './types/com/atproto/sync/getCheckout'
66
- import * as ComAtprotoSyncGetCommitPath from './types/com/atproto/sync/getCommitPath'
67
64
  import * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead'
65
+ import * as ComAtprotoSyncGetLatestCommit from './types/com/atproto/sync/getLatestCommit'
68
66
  import * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord'
69
67
  import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo'
70
68
  import * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs'
@@ -72,6 +70,7 @@ import * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos'
72
70
  import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate'
73
71
  import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl'
74
72
  import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos'
73
+ import * as ComAtprotoTempUpgradeRepoVersion from './types/com/atproto/temp/upgradeRepoVersion'
75
74
  import * as AppBskyActorDefs from './types/app/bsky/actor/defs'
76
75
  import * as AppBskyActorGetPreferences from './types/app/bsky/actor/getPreferences'
77
76
  import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'
@@ -140,7 +139,6 @@ export * as ComAtprotoAdminGetModerationReport from './types/com/atproto/admin/g
140
139
  export * as ComAtprotoAdminGetModerationReports from './types/com/atproto/admin/getModerationReports'
141
140
  export * as ComAtprotoAdminGetRecord from './types/com/atproto/admin/getRecord'
142
141
  export * as ComAtprotoAdminGetRepo from './types/com/atproto/admin/getRepo'
143
- export * as ComAtprotoAdminRebaseRepo from './types/com/atproto/admin/rebaseRepo'
144
142
  export * as ComAtprotoAdminResolveModerationReports from './types/com/atproto/admin/resolveModerationReports'
145
143
  export * as ComAtprotoAdminReverseModerationAction from './types/com/atproto/admin/reverseModerationAction'
146
144
  export * as ComAtprotoAdminSearchRepos from './types/com/atproto/admin/searchRepos'
@@ -162,7 +160,6 @@ export * as ComAtprotoRepoDescribeRepo from './types/com/atproto/repo/describeRe
162
160
  export * as ComAtprotoRepoGetRecord from './types/com/atproto/repo/getRecord'
163
161
  export * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords'
164
162
  export * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord'
165
- export * as ComAtprotoRepoRebaseRepo from './types/com/atproto/repo/rebaseRepo'
166
163
  export * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef'
167
164
  export * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob'
168
165
  export * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount'
@@ -185,8 +182,8 @@ export * as ComAtprotoServerRevokeAppPassword from './types/com/atproto/server/r
185
182
  export * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob'
186
183
  export * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks'
187
184
  export * as ComAtprotoSyncGetCheckout from './types/com/atproto/sync/getCheckout'
188
- export * as ComAtprotoSyncGetCommitPath from './types/com/atproto/sync/getCommitPath'
189
185
  export * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead'
186
+ export * as ComAtprotoSyncGetLatestCommit from './types/com/atproto/sync/getLatestCommit'
190
187
  export * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord'
191
188
  export * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo'
192
189
  export * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs'
@@ -194,6 +191,7 @@ export * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos'
194
191
  export * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate'
195
192
  export * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl'
196
193
  export * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos'
194
+ export * as ComAtprotoTempUpgradeRepoVersion from './types/com/atproto/temp/upgradeRepoVersion'
197
195
  export * as AppBskyActorDefs from './types/app/bsky/actor/defs'
198
196
  export * as AppBskyActorGetPreferences from './types/app/bsky/actor/getPreferences'
199
197
  export * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'
@@ -318,6 +316,7 @@ export class AtprotoNS {
318
316
  repo: RepoNS
319
317
  server: ServerNS
320
318
  sync: SyncNS
319
+ temp: TempNS
321
320
 
322
321
  constructor(service: AtpServiceClient) {
323
322
  this._service = service
@@ -328,6 +327,7 @@ export class AtprotoNS {
328
327
  this.repo = new RepoNS(service)
329
328
  this.server = new ServerNS(service)
330
329
  this.sync = new SyncNS(service)
330
+ this.temp = new TempNS(service)
331
331
  }
332
332
  }
333
333
 
@@ -448,17 +448,6 @@ export class AdminNS {
448
448
  })
449
449
  }
450
450
 
451
- rebaseRepo(
452
- data?: ComAtprotoAdminRebaseRepo.InputSchema,
453
- opts?: ComAtprotoAdminRebaseRepo.CallOptions,
454
- ): Promise<ComAtprotoAdminRebaseRepo.Response> {
455
- return this._service.xrpc
456
- .call('com.atproto.admin.rebaseRepo', opts?.qp, data, opts)
457
- .catch((e) => {
458
- throw ComAtprotoAdminRebaseRepo.toKnownErr(e)
459
- })
460
- }
461
-
462
451
  resolveModerationReports(
463
452
  data?: ComAtprotoAdminResolveModerationReports.InputSchema,
464
453
  opts?: ComAtprotoAdminResolveModerationReports.CallOptions,
@@ -689,17 +678,6 @@ export class RepoNS {
689
678
  })
690
679
  }
691
680
 
692
- rebaseRepo(
693
- data?: ComAtprotoRepoRebaseRepo.InputSchema,
694
- opts?: ComAtprotoRepoRebaseRepo.CallOptions,
695
- ): Promise<ComAtprotoRepoRebaseRepo.Response> {
696
- return this._service.xrpc
697
- .call('com.atproto.repo.rebaseRepo', opts?.qp, data, opts)
698
- .catch((e) => {
699
- throw ComAtprotoRepoRebaseRepo.toKnownErr(e)
700
- })
701
- }
702
-
703
681
  uploadBlob(
704
682
  data?: ComAtprotoRepoUploadBlob.InputSchema,
705
683
  opts?: ComAtprotoRepoUploadBlob.CallOptions,
@@ -936,17 +914,6 @@ export class SyncNS {
936
914
  })
937
915
  }
938
916
 
939
- getCommitPath(
940
- params?: ComAtprotoSyncGetCommitPath.QueryParams,
941
- opts?: ComAtprotoSyncGetCommitPath.CallOptions,
942
- ): Promise<ComAtprotoSyncGetCommitPath.Response> {
943
- return this._service.xrpc
944
- .call('com.atproto.sync.getCommitPath', params, undefined, opts)
945
- .catch((e) => {
946
- throw ComAtprotoSyncGetCommitPath.toKnownErr(e)
947
- })
948
- }
949
-
950
917
  getHead(
951
918
  params?: ComAtprotoSyncGetHead.QueryParams,
952
919
  opts?: ComAtprotoSyncGetHead.CallOptions,
@@ -958,6 +925,17 @@ export class SyncNS {
958
925
  })
959
926
  }
960
927
 
928
+ getLatestCommit(
929
+ params?: ComAtprotoSyncGetLatestCommit.QueryParams,
930
+ opts?: ComAtprotoSyncGetLatestCommit.CallOptions,
931
+ ): Promise<ComAtprotoSyncGetLatestCommit.Response> {
932
+ return this._service.xrpc
933
+ .call('com.atproto.sync.getLatestCommit', params, undefined, opts)
934
+ .catch((e) => {
935
+ throw ComAtprotoSyncGetLatestCommit.toKnownErr(e)
936
+ })
937
+ }
938
+
961
939
  getRecord(
962
940
  params?: ComAtprotoSyncGetRecord.QueryParams,
963
941
  opts?: ComAtprotoSyncGetRecord.CallOptions,
@@ -1025,6 +1003,25 @@ export class SyncNS {
1025
1003
  }
1026
1004
  }
1027
1005
 
1006
+ export class TempNS {
1007
+ _service: AtpServiceClient
1008
+
1009
+ constructor(service: AtpServiceClient) {
1010
+ this._service = service
1011
+ }
1012
+
1013
+ upgradeRepoVersion(
1014
+ data?: ComAtprotoTempUpgradeRepoVersion.InputSchema,
1015
+ opts?: ComAtprotoTempUpgradeRepoVersion.CallOptions,
1016
+ ): Promise<ComAtprotoTempUpgradeRepoVersion.Response> {
1017
+ return this._service.xrpc
1018
+ .call('com.atproto.temp.upgradeRepoVersion', opts?.qp, data, opts)
1019
+ .catch((e) => {
1020
+ throw ComAtprotoTempUpgradeRepoVersion.toKnownErr(e)
1021
+ })
1022
+ }
1023
+ }
1024
+
1028
1025
  export class AppNS {
1029
1026
  _service: AtpServiceClient
1030
1027
  bsky: BskyNS
@@ -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: 'Gets the repo state.',
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
- ComAtprotoSyncGetCommitPath: {
3014
+ ComAtprotoSyncGetHead: {
3097
3015
  lexicon: 1,
3098
- id: 'com.atproto.sync.getCommitPath',
3016
+ id: 'com.atproto.sync.getHead',
3099
3017
  defs: {
3100
3018
  main: {
3101
3019
  type: 'query',
3102
- description: 'Gets the path of repo commits',
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: ['commits'],
3037
+ required: ['root'],
3129
3038
  properties: {
3130
- commits: {
3131
- type: 'array',
3132
- items: {
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
- ComAtprotoSyncGetHead: {
3054
+ ComAtprotoSyncGetLatestCommit: {
3144
3055
  lexicon: 1,
3145
- id: 'com.atproto.sync.getHead',
3056
+ id: 'com.atproto.sync.getLatestCommit',
3146
3057
  defs: {
3147
3058
  main: {
3148
3059
  type: 'query',
3149
- description: 'Gets the current HEAD CID of a repo.',
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: ['root'],
3076
+ required: ['cid', 'rev'],
3166
3077
  properties: {
3167
- root: {
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: 'HeadNotFound',
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: 'Gets the repo state.',
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
- earliest: {
3236
- type: 'string',
3237
- format: 'cid',
3238
- description:
3239
- 'The earliest commit in the commit range (not inclusive)',
3240
- },
3241
- latest: {
3150
+ since: {
3242
3151
  type: 'string',
3243
3152
  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 for some range of commits',
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
- latest: {
3179
+ since: {
3271
3180
  type: 'string',
3272
3181
  format: 'cid',
3273
- description: 'The most recent commit',
3182
+ description: 'Optional revision of the repo to list blobs since',
3274
3183
  },
3275
- earliest: {
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
- 'prev',
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,29 @@ 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
+ },
3540
+ },
3541
+ },
3542
+ },
3543
+ },
3544
+ },
3597
3545
  AppBskyActorDefs: {
3598
3546
  lexicon: 1,
3599
3547
  id: 'app.bsky.actor.defs',
@@ -6672,7 +6620,6 @@ export const ids = {
6672
6620
  ComAtprotoAdminGetModerationReports: 'com.atproto.admin.getModerationReports',
6673
6621
  ComAtprotoAdminGetRecord: 'com.atproto.admin.getRecord',
6674
6622
  ComAtprotoAdminGetRepo: 'com.atproto.admin.getRepo',
6675
- ComAtprotoAdminRebaseRepo: 'com.atproto.admin.rebaseRepo',
6676
6623
  ComAtprotoAdminResolveModerationReports:
6677
6624
  'com.atproto.admin.resolveModerationReports',
6678
6625
  ComAtprotoAdminReverseModerationAction:
@@ -6696,7 +6643,6 @@ export const ids = {
6696
6643
  ComAtprotoRepoGetRecord: 'com.atproto.repo.getRecord',
6697
6644
  ComAtprotoRepoListRecords: 'com.atproto.repo.listRecords',
6698
6645
  ComAtprotoRepoPutRecord: 'com.atproto.repo.putRecord',
6699
- ComAtprotoRepoRebaseRepo: 'com.atproto.repo.rebaseRepo',
6700
6646
  ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef',
6701
6647
  ComAtprotoRepoUploadBlob: 'com.atproto.repo.uploadBlob',
6702
6648
  ComAtprotoServerCreateAccount: 'com.atproto.server.createAccount',
@@ -6722,8 +6668,8 @@ export const ids = {
6722
6668
  ComAtprotoSyncGetBlob: 'com.atproto.sync.getBlob',
6723
6669
  ComAtprotoSyncGetBlocks: 'com.atproto.sync.getBlocks',
6724
6670
  ComAtprotoSyncGetCheckout: 'com.atproto.sync.getCheckout',
6725
- ComAtprotoSyncGetCommitPath: 'com.atproto.sync.getCommitPath',
6726
6671
  ComAtprotoSyncGetHead: 'com.atproto.sync.getHead',
6672
+ ComAtprotoSyncGetLatestCommit: 'com.atproto.sync.getLatestCommit',
6727
6673
  ComAtprotoSyncGetRecord: 'com.atproto.sync.getRecord',
6728
6674
  ComAtprotoSyncGetRepo: 'com.atproto.sync.getRepo',
6729
6675
  ComAtprotoSyncListBlobs: 'com.atproto.sync.listBlobs',
@@ -6731,6 +6677,7 @@ export const ids = {
6731
6677
  ComAtprotoSyncNotifyOfUpdate: 'com.atproto.sync.notifyOfUpdate',
6732
6678
  ComAtprotoSyncRequestCrawl: 'com.atproto.sync.requestCrawl',
6733
6679
  ComAtprotoSyncSubscribeRepos: 'com.atproto.sync.subscribeRepos',
6680
+ ComAtprotoTempUpgradeRepoVersion: 'com.atproto.temp.upgradeRepoVersion',
6734
6681
  AppBskyActorDefs: 'app.bsky.actor.defs',
6735
6682
  AppBskyActorGetPreferences: 'app.bsky.actor.getPreferences',
6736
6683
  AppBskyActorGetProfile: 'app.bsky.actor.getProfile',
@@ -10,8 +10,6 @@ import { CID } from 'multiformats/cid'
10
10
  export interface QueryParams {
11
11
  /** The DID of the repo. */
12
12
  did: string
13
- /** The commit to get the checkout from. Defaults to current HEAD. */
14
- commit?: string
15
13
  }
16
14
 
17
15
  export type InputSchema = undefined
@@ -10,16 +10,13 @@ import { CID } from 'multiformats/cid'
10
10
  export interface QueryParams {
11
11
  /** The DID of the repo. */
12
12
  did: string
13
- /** The most recent commit */
14
- latest?: string
15
- /** The earliest commit to start from */
16
- earliest?: string
17
13
  }
18
14
 
19
15
  export type InputSchema = undefined
20
16
 
21
17
  export interface OutputSchema {
22
- commits: string[]
18
+ cid: string
19
+ rev: string
23
20
  [k: string]: unknown
24
21
  }
25
22
 
@@ -33,8 +30,15 @@ export interface Response {
33
30
  data: OutputSchema
34
31
  }
35
32
 
33
+ export class RepoNotFoundError extends XRPCError {
34
+ constructor(src: XRPCError) {
35
+ super(src.status, src.error, src.message, src.headers)
36
+ }
37
+ }
38
+
36
39
  export function toKnownErr(e: any) {
37
40
  if (e instanceof XRPCError) {
41
+ if (e.error === 'RepoNotFound') return new RepoNotFoundError(e)
38
42
  }
39
43
  return e
40
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 earliest commit in the commit range (not inclusive) */
14
- earliest?: string
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
- /** The most recent commit */
14
- latest?: string
15
- /** The earliest commit to start from */
16
- earliest?: string
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: CID | null
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,7 @@ import { CID } from 'multiformats/cid'
10
10
  export interface QueryParams {}
11
11
 
12
12
  export interface InputSchema {
13
- /** The handle or DID of the repo. */
14
- repo: string
15
- /** Compare and swap with the previous commit by cid. */
16
- swapCommit?: string
13
+ did: string
17
14
  [k: string]: unknown
18
15
  }
19
16
 
@@ -28,22 +25,8 @@ export interface Response {
28
25
  headers: Headers
29
26
  }
30
27
 
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
28
  export function toKnownErr(e: any) {
44
29
  if (e instanceof XRPCError) {
45
- if (e.error === 'InvalidSwap') return new InvalidSwapError(e)
46
- if (e.error === 'ConcurrentWrites') return new ConcurrentWritesError(e)
47
30
  }
48
31
  return e
49
32
  }