@atproto/bsky 0.0.14 → 0.0.16

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 (195) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/api/app/bsky/feed/searchPosts.d.ts +3 -0
  3. package/dist/api/com/atproto/moderation/util.d.ts +4 -3
  4. package/dist/config.d.ts +2 -2
  5. package/dist/context.d.ts +16 -1
  6. package/dist/db/index.js +26 -1
  7. package/dist/db/index.js.map +3 -3
  8. package/dist/db/migrations/20231003T202833377Z-create-moderation-subject-status.d.ts +3 -0
  9. package/dist/db/migrations/index.d.ts +1 -0
  10. package/dist/db/pagination.d.ts +2 -1
  11. package/dist/db/{periodic-moderation-action-reversal.d.ts → periodic-moderation-event-reversal.d.ts} +3 -5
  12. package/dist/db/tables/moderation.d.ts +24 -34
  13. package/dist/feed-gen/types.d.ts +1 -1
  14. package/dist/index.d.ts +2 -1
  15. package/dist/index.js +3332 -2430
  16. package/dist/index.js.map +3 -3
  17. package/dist/lexicon/index.d.ts +18 -18
  18. package/dist/lexicon/lexicons.d.ts +460 -385
  19. package/dist/lexicon/types/app/bsky/feed/defs.d.ts +1 -7
  20. package/dist/lexicon/types/app/bsky/graph/defs.d.ts +1 -0
  21. package/dist/lexicon/types/com/atproto/admin/defs.d.ts +116 -48
  22. package/dist/lexicon/types/com/atproto/admin/{takeModerationAction.d.ts → emitModerationEvent.d.ts} +5 -6
  23. package/dist/lexicon/types/com/atproto/admin/{getModerationAction.d.ts → getModerationEvent.d.ts} +1 -1
  24. package/dist/lexicon/types/com/atproto/admin/{getModerationActions.d.ts → queryModerationEvents.d.ts} +5 -1
  25. package/dist/lexicon/types/com/atproto/admin/{getModerationReports.d.ts → queryModerationStatuses.d.ts} +12 -6
  26. package/dist/lexicon/types/com/atproto/admin/sendEmail.d.ts +1 -0
  27. package/dist/lexicon/types/com/atproto/{admin/getModerationReport.d.ts → temp/fetchLabels.d.ts} +7 -3
  28. package/dist/migrate-moderation-data.d.ts +1 -0
  29. package/dist/services/actor/views.d.ts +2 -5
  30. package/dist/services/feed/index.d.ts +1 -0
  31. package/dist/services/feed/util.d.ts +9 -1
  32. package/dist/services/feed/views.d.ts +6 -17
  33. package/dist/services/graph/index.d.ts +5 -29
  34. package/dist/services/graph/types.d.ts +1 -0
  35. package/dist/services/moderation/index.d.ts +135 -72
  36. package/dist/services/moderation/pagination.d.ts +36 -0
  37. package/dist/services/moderation/status.d.ts +13 -0
  38. package/dist/services/moderation/types.d.ts +35 -0
  39. package/dist/services/moderation/views.d.ts +18 -14
  40. package/dist/util/debug.d.ts +1 -1
  41. package/package.json +14 -15
  42. package/src/api/app/bsky/actor/getSuggestions.ts +45 -21
  43. package/src/api/app/bsky/feed/getActorFeeds.ts +2 -1
  44. package/src/api/app/bsky/feed/getActorLikes.ts +1 -3
  45. package/src/api/app/bsky/feed/getAuthorFeed.ts +1 -3
  46. package/src/api/app/bsky/feed/getFeed.ts +9 -9
  47. package/src/api/app/bsky/feed/getFeedGenerator.ts +3 -0
  48. package/src/api/app/bsky/feed/getFeedGenerators.ts +2 -1
  49. package/src/api/app/bsky/feed/getListFeed.ts +1 -3
  50. package/src/api/app/bsky/feed/getPostThread.ts +31 -58
  51. package/src/api/app/bsky/feed/getPosts.ts +21 -18
  52. package/src/api/app/bsky/feed/getSuggestedFeeds.ts +2 -1
  53. package/src/api/app/bsky/feed/getTimeline.ts +1 -3
  54. package/src/api/app/bsky/feed/searchPosts.ts +130 -0
  55. package/src/api/app/bsky/graph/getList.ts +6 -3
  56. package/src/api/app/bsky/graph/getListBlocks.ts +3 -2
  57. package/src/api/app/bsky/graph/getListMutes.ts +2 -1
  58. package/src/api/app/bsky/graph/getLists.ts +2 -1
  59. package/src/api/app/bsky/unspecced/getPopularFeedGenerators.ts +3 -1
  60. package/src/api/blob-resolver.ts +6 -11
  61. package/src/api/com/atproto/admin/emitModerationEvent.ts +220 -0
  62. package/src/api/com/atproto/admin/{getModerationActions.ts → getModerationEvent.ts} +5 -11
  63. package/src/api/com/atproto/admin/getRecord.ts +1 -0
  64. package/src/api/com/atproto/admin/{getModerationReports.ts → queryModerationEvents.ts} +13 -16
  65. package/src/api/com/atproto/admin/queryModerationStatuses.ts +55 -0
  66. package/src/api/com/atproto/admin/util.ts +3 -1
  67. package/src/api/com/atproto/moderation/createReport.ts +9 -7
  68. package/src/api/com/atproto/moderation/util.ts +38 -20
  69. package/src/api/com/atproto/temp/fetchLabels.ts +30 -0
  70. package/src/api/index.ts +12 -14
  71. package/src/auth.ts +29 -21
  72. package/src/auto-moderator/index.ts +26 -19
  73. package/src/config.ts +6 -6
  74. package/src/context.ts +15 -9
  75. package/src/db/migrations/20231003T202833377Z-create-moderation-subject-status.ts +123 -0
  76. package/src/db/migrations/index.ts +1 -0
  77. package/src/db/pagination.ts +26 -3
  78. package/src/db/{periodic-moderation-action-reversal.ts → periodic-moderation-event-reversal.ts} +51 -55
  79. package/src/db/tables/moderation.ts +35 -52
  80. package/src/feed-gen/best-of-follows.ts +6 -3
  81. package/src/feed-gen/bsky-team.ts +1 -1
  82. package/src/feed-gen/hot-classic.ts +1 -1
  83. package/src/feed-gen/mutuals.ts +6 -2
  84. package/src/feed-gen/types.ts +1 -1
  85. package/src/feed-gen/whats-hot.ts +1 -1
  86. package/src/feed-gen/with-friends.ts +7 -3
  87. package/src/index.ts +2 -1
  88. package/src/lexicon/index.ts +52 -67
  89. package/src/lexicon/lexicons.ts +674 -579
  90. package/src/lexicon/types/app/bsky/actor/defs.ts +2 -2
  91. package/src/lexicon/types/app/bsky/actor/searchActors.ts +2 -2
  92. package/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts +2 -2
  93. package/src/lexicon/types/app/bsky/feed/defs.ts +1 -18
  94. package/src/lexicon/types/app/bsky/feed/searchPosts.ts +3 -3
  95. package/src/lexicon/types/app/bsky/graph/defs.ts +3 -2
  96. package/src/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.ts +4 -4
  97. package/src/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.ts +3 -3
  98. package/src/lexicon/types/com/atproto/admin/defs.ts +278 -84
  99. package/src/lexicon/types/com/atproto/admin/disableAccountInvites.ts +1 -1
  100. package/src/lexicon/types/com/atproto/admin/{takeModerationAction.ts → emitModerationEvent.ts} +13 -11
  101. package/src/lexicon/types/com/atproto/admin/enableAccountInvites.ts +1 -1
  102. package/src/lexicon/types/com/atproto/admin/{getModerationReport.ts → getModerationEvent.ts} +1 -1
  103. package/src/lexicon/types/com/atproto/admin/{getModerationReports.ts → queryModerationEvents.ts} +8 -15
  104. package/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts +70 -0
  105. package/src/lexicon/types/com/atproto/admin/sendEmail.ts +1 -0
  106. package/src/lexicon/types/com/atproto/label/defs.ts +9 -9
  107. package/src/lexicon/types/com/atproto/label/queryLabels.ts +2 -2
  108. package/src/lexicon/types/com/atproto/repo/applyWrites.ts +1 -1
  109. package/src/lexicon/types/com/atproto/repo/createRecord.ts +2 -2
  110. package/src/lexicon/types/com/atproto/repo/deleteRecord.ts +2 -2
  111. package/src/lexicon/types/com/atproto/repo/listRecords.ts +1 -1
  112. package/src/lexicon/types/com/atproto/repo/putRecord.ts +3 -3
  113. package/src/lexicon/types/com/atproto/sync/listBlobs.ts +1 -1
  114. package/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +4 -4
  115. package/src/lexicon/types/com/atproto/{admin/getModerationActions.ts → temp/fetchLabels.ts} +3 -5
  116. package/src/migrate-moderation-data.ts +414 -0
  117. package/src/services/actor/views.ts +5 -14
  118. package/src/services/feed/index.ts +26 -7
  119. package/src/services/feed/util.ts +47 -19
  120. package/src/services/feed/views.ts +68 -4
  121. package/src/services/graph/index.ts +21 -3
  122. package/src/services/graph/types.ts +1 -0
  123. package/src/services/indexing/plugins/block.ts +2 -3
  124. package/src/services/indexing/plugins/feed-generator.ts +2 -3
  125. package/src/services/indexing/plugins/follow.ts +2 -3
  126. package/src/services/indexing/plugins/like.ts +2 -3
  127. package/src/services/indexing/plugins/list-block.ts +2 -3
  128. package/src/services/indexing/plugins/list-item.ts +2 -3
  129. package/src/services/indexing/plugins/list.ts +2 -3
  130. package/src/services/indexing/plugins/post.ts +3 -4
  131. package/src/services/indexing/plugins/repost.ts +2 -3
  132. package/src/services/indexing/plugins/thread-gate.ts +2 -3
  133. package/src/services/label/index.ts +2 -3
  134. package/src/services/moderation/index.ts +380 -395
  135. package/src/services/moderation/pagination.ts +96 -0
  136. package/src/services/moderation/status.ts +244 -0
  137. package/src/services/moderation/types.ts +49 -0
  138. package/src/services/moderation/views.ts +278 -329
  139. package/src/util/debug.ts +2 -2
  140. package/tests/__snapshots__/feed-generation.test.ts.snap +322 -6
  141. package/tests/__snapshots__/indexing.test.ts.snap +0 -6
  142. package/tests/admin/__snapshots__/get-record.test.ts.snap +30 -132
  143. package/tests/admin/__snapshots__/get-repo.test.ts.snap +14 -60
  144. package/tests/admin/__snapshots__/moderation-events.test.ts.snap +146 -0
  145. package/tests/admin/__snapshots__/moderation-statuses.test.ts.snap +64 -0
  146. package/tests/admin/__snapshots__/moderation.test.ts.snap +0 -125
  147. package/tests/admin/get-record.test.ts +5 -9
  148. package/tests/admin/get-repo.test.ts +38 -9
  149. package/tests/admin/moderation-events.test.ts +221 -0
  150. package/tests/admin/moderation-statuses.test.ts +145 -0
  151. package/tests/admin/moderation.test.ts +512 -860
  152. package/tests/admin/repo-search.test.ts +2 -3
  153. package/tests/auto-moderator/fuzzy-matcher.test.ts +2 -1
  154. package/tests/auto-moderator/takedowns.test.ts +45 -18
  155. package/tests/feed-generation.test.ts +57 -9
  156. package/tests/views/__snapshots__/block-lists.test.ts.snap +3 -9
  157. package/tests/views/__snapshots__/blocks.test.ts.snap +0 -9
  158. package/tests/views/__snapshots__/mute-lists.test.ts.snap +5 -5
  159. package/tests/views/__snapshots__/mutes.test.ts.snap +0 -3
  160. package/tests/views/__snapshots__/thread.test.ts.snap +0 -30
  161. package/tests/views/actor-search.test.ts +2 -3
  162. package/tests/views/author-feed.test.ts +42 -36
  163. package/tests/views/follows.test.ts +40 -35
  164. package/tests/views/list-feed.test.ts +17 -9
  165. package/tests/views/notifications.test.ts +13 -9
  166. package/tests/views/profile.test.ts +20 -18
  167. package/tests/views/suggestions.test.ts +15 -7
  168. package/tests/views/thread.test.ts +54 -26
  169. package/tests/views/threadgating.test.ts +51 -19
  170. package/tests/views/timeline.test.ts +21 -13
  171. package/dist/api/com/atproto/admin/reverseModerationAction.d.ts +0 -3
  172. package/dist/api/com/atproto/admin/takeModerationAction.d.ts +0 -3
  173. package/dist/lexicon/types/com/atproto/admin/resolveModerationReports.d.ts +0 -36
  174. package/dist/lexicon/types/com/atproto/admin/reverseModerationAction.d.ts +0 -36
  175. package/src/api/com/atproto/admin/getModerationAction.ts +0 -44
  176. package/src/api/com/atproto/admin/getModerationReport.ts +0 -43
  177. package/src/api/com/atproto/admin/resolveModerationReports.ts +0 -24
  178. package/src/api/com/atproto/admin/reverseModerationAction.ts +0 -115
  179. package/src/api/com/atproto/admin/takeModerationAction.ts +0 -156
  180. package/src/lexicon/types/com/atproto/admin/getModerationAction.ts +0 -41
  181. package/src/lexicon/types/com/atproto/admin/resolveModerationReports.ts +0 -49
  182. package/src/lexicon/types/com/atproto/admin/reverseModerationAction.ts +0 -49
  183. package/tests/admin/__snapshots__/get-moderation-action.test.ts.snap +0 -172
  184. package/tests/admin/__snapshots__/get-moderation-actions.test.ts.snap +0 -178
  185. package/tests/admin/__snapshots__/get-moderation-report.test.ts.snap +0 -177
  186. package/tests/admin/__snapshots__/get-moderation-reports.test.ts.snap +0 -307
  187. package/tests/admin/get-moderation-action.test.ts +0 -100
  188. package/tests/admin/get-moderation-actions.test.ts +0 -164
  189. package/tests/admin/get-moderation-report.test.ts +0 -100
  190. package/tests/admin/get-moderation-reports.test.ts +0 -332
  191. /package/dist/api/com/atproto/admin/{getModerationAction.d.ts → emitModerationEvent.d.ts} +0 -0
  192. /package/dist/api/com/atproto/admin/{getModerationActions.d.ts → getModerationEvent.d.ts} +0 -0
  193. /package/dist/api/com/atproto/admin/{getModerationReport.d.ts → queryModerationEvents.d.ts} +0 -0
  194. /package/dist/api/com/atproto/admin/{getModerationReports.d.ts → queryModerationStatuses.d.ts} +0 -0
  195. /package/dist/api/com/atproto/{admin/resolveModerationReports.d.ts → temp/fetchLabels.d.ts} +0 -0
@@ -13,26 +13,28 @@ import * as ComAtprotoRepoStrongRef from '../repo/strongRef'
13
13
  export interface QueryParams {}
14
14
 
15
15
  export interface InputSchema {
16
- action:
17
- | 'com.atproto.admin.defs#takedown'
18
- | 'com.atproto.admin.defs#flag'
19
- | 'com.atproto.admin.defs#acknowledge'
20
- | (string & {})
16
+ event:
17
+ | ComAtprotoAdminDefs.ModEventTakedown
18
+ | ComAtprotoAdminDefs.ModEventAcknowledge
19
+ | ComAtprotoAdminDefs.ModEventEscalate
20
+ | ComAtprotoAdminDefs.ModEventComment
21
+ | ComAtprotoAdminDefs.ModEventLabel
22
+ | ComAtprotoAdminDefs.ModEventReport
23
+ | ComAtprotoAdminDefs.ModEventMute
24
+ | ComAtprotoAdminDefs.ModEventReverseTakedown
25
+ | ComAtprotoAdminDefs.ModEventUnmute
26
+ | ComAtprotoAdminDefs.ModEventEmail
27
+ | { $type: string; [k: string]: unknown }
21
28
  subject:
22
29
  | ComAtprotoAdminDefs.RepoRef
23
30
  | ComAtprotoRepoStrongRef.Main
24
31
  | { $type: string; [k: string]: unknown }
25
32
  subjectBlobCids?: string[]
26
- createLabelVals?: string[]
27
- negateLabelVals?: string[]
28
- reason: string
29
- /** Indicates how long this action was meant to be in effect before automatically expiring. */
30
- durationInHours?: number
31
33
  createdBy: string
32
34
  [k: string]: unknown
33
35
  }
34
36
 
35
- export type OutputSchema = ComAtprotoAdminDefs.ActionView
37
+ export type OutputSchema = ComAtprotoAdminDefs.ModEventView
36
38
 
37
39
  export interface HandlerInput {
38
40
  encoding: 'application/json'
@@ -12,7 +12,7 @@ export interface QueryParams {}
12
12
 
13
13
  export interface InputSchema {
14
14
  account: string
15
- /** Additionally add a note describing why the invites were enabled */
15
+ /** Optional reason for enabled invites. */
16
16
  note?: string
17
17
  [k: string]: unknown
18
18
  }
@@ -14,7 +14,7 @@ export interface QueryParams {
14
14
  }
15
15
 
16
16
  export type InputSchema = undefined
17
- export type OutputSchema = ComAtprotoAdminDefs.ReportViewDetail
17
+ export type OutputSchema = ComAtprotoAdminDefs.ModEventViewDetail
18
18
  export type HandlerInput = undefined
19
19
 
20
20
  export interface HandlerSuccess {
@@ -10,30 +10,23 @@ import { HandlerAuth } from '@atproto/xrpc-server'
10
10
  import * as ComAtprotoAdminDefs from './defs'
11
11
 
12
12
  export interface QueryParams {
13
+ /** The types of events (fully qualified string in the format of com.atproto.admin#modEvent<name>) to filter by. If not specified, all events are returned. */
14
+ types?: string[]
15
+ createdBy?: string
16
+ /** Sort direction for the events. Defaults to descending order of created at timestamp. */
17
+ sortDirection: 'asc' | 'desc'
13
18
  subject?: string
14
- ignoreSubjects?: string[]
15
- /** Get all reports that were actioned by a specific moderator */
16
- actionedBy?: string
17
- /** Filter reports made by one or more DIDs */
18
- reporters?: string[]
19
- resolved?: boolean
20
- actionType?:
21
- | 'com.atproto.admin.defs#takedown'
22
- | 'com.atproto.admin.defs#flag'
23
- | 'com.atproto.admin.defs#acknowledge'
24
- | 'com.atproto.admin.defs#escalate'
25
- | (string & {})
19
+ /** If true, events on all record types (posts, lists, profile etc.) owned by the did are returned */
20
+ includeAllUserRecords: boolean
26
21
  limit: number
27
22
  cursor?: string
28
- /** Reverse the order of the returned records? when true, returns reports in chronological order */
29
- reverse?: boolean
30
23
  }
31
24
 
32
25
  export type InputSchema = undefined
33
26
 
34
27
  export interface OutputSchema {
35
28
  cursor?: string
36
- reports: ComAtprotoAdminDefs.ReportView[]
29
+ events: ComAtprotoAdminDefs.ModEventView[]
37
30
  [k: string]: unknown
38
31
  }
39
32
 
@@ -0,0 +1,70 @@
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
+ subject?: string
14
+ /** Search subjects by keyword from comments */
15
+ comment?: string
16
+ /** Search subjects reported after a given timestamp */
17
+ reportedAfter?: string
18
+ /** Search subjects reported before a given timestamp */
19
+ reportedBefore?: string
20
+ /** Search subjects reviewed after a given timestamp */
21
+ reviewedAfter?: string
22
+ /** Search subjects reviewed before a given timestamp */
23
+ reviewedBefore?: string
24
+ /** By default, we don't include muted subjects in the results. Set this to true to include them. */
25
+ includeMuted?: boolean
26
+ /** Specify when fetching subjects in a certain state */
27
+ reviewState?: string
28
+ ignoreSubjects?: string[]
29
+ /** Get all subject statuses that were reviewed by a specific moderator */
30
+ lastReviewedBy?: string
31
+ sortField: 'lastReviewedAt' | 'lastReportedAt'
32
+ sortDirection: 'asc' | 'desc'
33
+ /** Get subjects that were taken down */
34
+ takendown?: boolean
35
+ limit: number
36
+ cursor?: string
37
+ }
38
+
39
+ export type InputSchema = undefined
40
+
41
+ export interface OutputSchema {
42
+ cursor?: string
43
+ subjectStatuses: ComAtprotoAdminDefs.SubjectStatusView[]
44
+ [k: string]: unknown
45
+ }
46
+
47
+ export type HandlerInput = undefined
48
+
49
+ export interface HandlerSuccess {
50
+ encoding: 'application/json'
51
+ body: OutputSchema
52
+ headers?: { [key: string]: string }
53
+ }
54
+
55
+ export interface HandlerError {
56
+ status: number
57
+ message?: string
58
+ }
59
+
60
+ export type HandlerOutput = HandlerError | HandlerSuccess
61
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
62
+ auth: HA
63
+ params: QueryParams
64
+ input: HandlerInput
65
+ req: express.Request
66
+ res: express.Response
67
+ }
68
+ export type Handler<HA extends HandlerAuth = never> = (
69
+ ctx: HandlerReqCtx<HA>,
70
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -14,6 +14,7 @@ export interface InputSchema {
14
14
  recipientDid: string
15
15
  content: string
16
16
  subject?: string
17
+ senderDid: string
17
18
  [k: string]: unknown
18
19
  }
19
20
 
@@ -6,19 +6,19 @@ import { lexicons } from '../../../../lexicons'
6
6
  import { isObj, hasProp } from '../../../../util'
7
7
  import { CID } from 'multiformats/cid'
8
8
 
9
- /** Metadata tag on an atproto resource (eg, repo or record) */
9
+ /** Metadata tag on an atproto resource (eg, repo or record). */
10
10
  export interface Label {
11
- /** DID of the actor who created this label */
11
+ /** DID of the actor who created this label. */
12
12
  src: string
13
- /** AT URI of the record, repository (account), or other resource which this label applies to */
13
+ /** AT URI of the record, repository (account), or other resource that this label applies to. */
14
14
  uri: string
15
- /** optionally, CID specifying the specific version of 'uri' resource this label applies to */
15
+ /** Optionally, CID specifying the specific version of 'uri' resource this label applies to. */
16
16
  cid?: string
17
- /** the short string name of the value or type of this label */
17
+ /** The short string name of the value or type of this label. */
18
18
  val: string
19
- /** if true, this is a negation label, overwriting a previous label */
19
+ /** If true, this is a negation label, overwriting a previous label. */
20
20
  neg?: boolean
21
- /** timestamp when this label was created */
21
+ /** Timestamp when this label was created. */
22
22
  cts: string
23
23
  [k: string]: unknown
24
24
  }
@@ -53,9 +53,9 @@ export function validateSelfLabels(v: unknown): ValidationResult {
53
53
  return lexicons.validate('com.atproto.label.defs#selfLabels', v)
54
54
  }
55
55
 
56
- /** Metadata tag on an atproto record, published by the author within the record. Note -- schemas should use #selfLabels, not #selfLabel. */
56
+ /** Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel. */
57
57
  export interface SelfLabel {
58
- /** the short string name of the value or type of this label */
58
+ /** The short string name of the value or type of this label. */
59
59
  val: string
60
60
  [k: string]: unknown
61
61
  }
@@ -10,9 +10,9 @@ import { HandlerAuth } from '@atproto/xrpc-server'
10
10
  import * as ComAtprotoLabelDefs from './defs'
11
11
 
12
12
  export interface QueryParams {
13
- /** List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI */
13
+ /** List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI. */
14
14
  uriPatterns: string[]
15
- /** Optional list of label sources (DIDs) to filter on */
15
+ /** Optional list of label sources (DIDs) to filter on. */
16
16
  sources?: string[]
17
17
  limit: number
18
18
  cursor?: string
@@ -13,7 +13,7 @@ export interface QueryParams {}
13
13
  export interface InputSchema {
14
14
  /** The handle or DID of the repo. */
15
15
  repo: string
16
- /** Validate the records? */
16
+ /** Flag for validating the records. */
17
17
  validate: boolean
18
18
  writes: (Create | Update | Delete)[]
19
19
  swapCommit?: string
@@ -17,11 +17,11 @@ export interface InputSchema {
17
17
  collection: string
18
18
  /** The key of the record. */
19
19
  rkey?: string
20
- /** Validate the record? */
20
+ /** Flag for validating the record. */
21
21
  validate: boolean
22
22
  /** The record to create. */
23
23
  record: {}
24
- /** Compare and swap with the previous commit by cid. */
24
+ /** Compare and swap with the previous commit by CID. */
25
25
  swapCommit?: string
26
26
  [k: string]: unknown
27
27
  }
@@ -17,9 +17,9 @@ export interface InputSchema {
17
17
  collection: string
18
18
  /** The key of the record. */
19
19
  rkey: string
20
- /** Compare and swap with the previous record by cid. */
20
+ /** Compare and swap with the previous record by CID. */
21
21
  swapRecord?: string
22
- /** Compare and swap with the previous commit by cid. */
22
+ /** Compare and swap with the previous commit by CID. */
23
23
  swapCommit?: string
24
24
  [k: string]: unknown
25
25
  }
@@ -20,7 +20,7 @@ export interface QueryParams {
20
20
  rkeyStart?: string
21
21
  /** DEPRECATED: The highest sort-ordered rkey to stop at (exclusive) */
22
22
  rkeyEnd?: string
23
- /** Reverse the order of the returned records? */
23
+ /** Flag to reverse the order of the returned records. */
24
24
  reverse?: boolean
25
25
  }
26
26
 
@@ -17,13 +17,13 @@ export interface InputSchema {
17
17
  collection: string
18
18
  /** The key of the record. */
19
19
  rkey: string
20
- /** Validate the record? */
20
+ /** Flag for validating the record. */
21
21
  validate: boolean
22
22
  /** The record to write. */
23
23
  record: {}
24
- /** Compare and swap with the previous record by cid. */
24
+ /** Compare and swap with the previous record by CID. */
25
25
  swapRecord?: string | null
26
- /** Compare and swap with the previous commit by cid. */
26
+ /** Compare and swap with the previous commit by CID. */
27
27
  swapCommit?: string
28
28
  [k: string]: unknown
29
29
  }
@@ -11,7 +11,7 @@ import { HandlerAuth } from '@atproto/xrpc-server'
11
11
  export interface QueryParams {
12
12
  /** The DID of the repo. */
13
13
  did: string
14
- /** Optional revision of the repo to list blobs since */
14
+ /** Optional revision of the repo to list blobs since. */
15
15
  since?: string
16
16
  limit: number
17
17
  cursor?: string
@@ -39,11 +39,11 @@ export interface Commit {
39
39
  repo: string
40
40
  commit: CID
41
41
  prev?: CID | null
42
- /** The rev of the emitted commit */
42
+ /** The rev of the emitted commit. */
43
43
  rev: string
44
- /** The rev of the last emitted commit from this repo */
44
+ /** The rev of the last emitted commit from this repo. */
45
45
  since: string | null
46
- /** CAR file containing relevant blocks */
46
+ /** CAR file containing relevant blocks. */
47
47
  blocks: Uint8Array
48
48
  ops: RepoOp[]
49
49
  blobs: CID[]
@@ -140,7 +140,7 @@ export function validateInfo(v: unknown): ValidationResult {
140
140
  return lexicons.validate('com.atproto.sync.subscribeRepos#info', v)
141
141
  }
142
142
 
143
- /** A repo operation, ie a write of a single record. For creates and updates, cid is the record's CID as of this operation. For deletes, it's null. */
143
+ /** A repo operation, ie a write of a single record. For creates and updates, CID is the record's CID as of this operation. For deletes, it's null. */
144
144
  export interface RepoOp {
145
145
  action: 'create' | 'update' | 'delete' | (string & {})
146
146
  path: string
@@ -7,19 +7,17 @@ import { lexicons } from '../../../../lexicons'
7
7
  import { isObj, hasProp } from '../../../../util'
8
8
  import { CID } from 'multiformats/cid'
9
9
  import { HandlerAuth } from '@atproto/xrpc-server'
10
- import * as ComAtprotoAdminDefs from './defs'
10
+ import * as ComAtprotoLabelDefs from '../label/defs'
11
11
 
12
12
  export interface QueryParams {
13
- subject?: string
13
+ since?: number
14
14
  limit: number
15
- cursor?: string
16
15
  }
17
16
 
18
17
  export type InputSchema = undefined
19
18
 
20
19
  export interface OutputSchema {
21
- cursor?: string
22
- actions: ComAtprotoAdminDefs.ActionView[]
20
+ labels: ComAtprotoLabelDefs.Label[]
23
21
  [k: string]: unknown
24
22
  }
25
23