@atproto/ozone 0.1.149 → 0.1.151

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 (205) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/api/moderation/queryEvents.d.ts.map +1 -1
  3. package/dist/api/moderation/queryEvents.js +2 -1
  4. package/dist/api/moderation/queryEvents.js.map +1 -1
  5. package/dist/context.d.ts +3 -0
  6. package/dist/context.d.ts.map +1 -1
  7. package/dist/context.js +7 -1
  8. package/dist/context.js.map +1 -1
  9. package/dist/daemon/context.d.ts +3 -0
  10. package/dist/daemon/context.d.ts.map +1 -1
  11. package/dist/daemon/context.js +11 -1
  12. package/dist/daemon/context.js.map +1 -1
  13. package/dist/daemon/index.d.ts +1 -0
  14. package/dist/daemon/index.d.ts.map +1 -1
  15. package/dist/daemon/index.js +3 -1
  16. package/dist/daemon/index.js.map +1 -1
  17. package/dist/daemon/strike-expiry-processor.d.ts +18 -0
  18. package/dist/daemon/strike-expiry-processor.d.ts.map +1 -0
  19. package/dist/daemon/strike-expiry-processor.js +111 -0
  20. package/dist/daemon/strike-expiry-processor.js.map +1 -0
  21. package/dist/db/migrations/20251008T120000000Z-add-strike-system.d.ts +4 -0
  22. package/dist/db/migrations/20251008T120000000Z-add-strike-system.d.ts.map +1 -0
  23. package/dist/db/migrations/20251008T120000000Z-add-strike-system.js +75 -0
  24. package/dist/db/migrations/20251008T120000000Z-add-strike-system.js.map +1 -0
  25. package/dist/db/migrations/index.d.ts +1 -0
  26. package/dist/db/migrations/index.d.ts.map +1 -1
  27. package/dist/db/migrations/index.js +2 -1
  28. package/dist/db/migrations/index.js.map +1 -1
  29. package/dist/db/schema/account_strike.d.ts +12 -0
  30. package/dist/db/schema/account_strike.d.ts.map +1 -0
  31. package/dist/db/schema/account_strike.js +5 -0
  32. package/dist/db/schema/account_strike.js.map +1 -0
  33. package/dist/db/schema/index.d.ts +3 -1
  34. package/dist/db/schema/index.d.ts.map +1 -1
  35. package/dist/db/schema/index.js.map +1 -1
  36. package/dist/db/schema/job_cursor.d.ts +11 -0
  37. package/dist/db/schema/job_cursor.d.ts.map +1 -0
  38. package/dist/db/schema/job_cursor.js +5 -0
  39. package/dist/db/schema/job_cursor.js.map +1 -0
  40. package/dist/db/schema/moderation_event.d.ts +3 -0
  41. package/dist/db/schema/moderation_event.d.ts.map +1 -1
  42. package/dist/db/schema/moderation_event.js.map +1 -1
  43. package/dist/lexicon/lexicons.d.ts +176 -0
  44. package/dist/lexicon/lexicons.d.ts.map +1 -1
  45. package/dist/lexicon/lexicons.js +88 -0
  46. package/dist/lexicon/lexicons.js.map +1 -1
  47. package/dist/lexicon/types/app/bsky/actor/profile.d.ts +4 -3
  48. package/dist/lexicon/types/app/bsky/actor/profile.d.ts.map +1 -1
  49. package/dist/lexicon/types/app/bsky/actor/profile.js +9 -7
  50. package/dist/lexicon/types/app/bsky/actor/profile.js.map +1 -1
  51. package/dist/lexicon/types/app/bsky/actor/status.d.ts +4 -3
  52. package/dist/lexicon/types/app/bsky/actor/status.d.ts.map +1 -1
  53. package/dist/lexicon/types/app/bsky/actor/status.js +9 -7
  54. package/dist/lexicon/types/app/bsky/actor/status.js.map +1 -1
  55. package/dist/lexicon/types/app/bsky/feed/generator.d.ts +4 -3
  56. package/dist/lexicon/types/app/bsky/feed/generator.d.ts.map +1 -1
  57. package/dist/lexicon/types/app/bsky/feed/generator.js +9 -7
  58. package/dist/lexicon/types/app/bsky/feed/generator.js.map +1 -1
  59. package/dist/lexicon/types/app/bsky/feed/like.d.ts +4 -3
  60. package/dist/lexicon/types/app/bsky/feed/like.d.ts.map +1 -1
  61. package/dist/lexicon/types/app/bsky/feed/like.js +9 -7
  62. package/dist/lexicon/types/app/bsky/feed/like.js.map +1 -1
  63. package/dist/lexicon/types/app/bsky/feed/post.d.ts +4 -3
  64. package/dist/lexicon/types/app/bsky/feed/post.d.ts.map +1 -1
  65. package/dist/lexicon/types/app/bsky/feed/post.js +9 -7
  66. package/dist/lexicon/types/app/bsky/feed/post.js.map +1 -1
  67. package/dist/lexicon/types/app/bsky/feed/postgate.d.ts +4 -3
  68. package/dist/lexicon/types/app/bsky/feed/postgate.d.ts.map +1 -1
  69. package/dist/lexicon/types/app/bsky/feed/postgate.js +9 -7
  70. package/dist/lexicon/types/app/bsky/feed/postgate.js.map +1 -1
  71. package/dist/lexicon/types/app/bsky/feed/repost.d.ts +4 -3
  72. package/dist/lexicon/types/app/bsky/feed/repost.d.ts.map +1 -1
  73. package/dist/lexicon/types/app/bsky/feed/repost.js +9 -7
  74. package/dist/lexicon/types/app/bsky/feed/repost.js.map +1 -1
  75. package/dist/lexicon/types/app/bsky/feed/threadgate.d.ts +4 -3
  76. package/dist/lexicon/types/app/bsky/feed/threadgate.d.ts.map +1 -1
  77. package/dist/lexicon/types/app/bsky/feed/threadgate.js +9 -7
  78. package/dist/lexicon/types/app/bsky/feed/threadgate.js.map +1 -1
  79. package/dist/lexicon/types/app/bsky/graph/block.d.ts +4 -3
  80. package/dist/lexicon/types/app/bsky/graph/block.d.ts.map +1 -1
  81. package/dist/lexicon/types/app/bsky/graph/block.js +9 -7
  82. package/dist/lexicon/types/app/bsky/graph/block.js.map +1 -1
  83. package/dist/lexicon/types/app/bsky/graph/follow.d.ts +4 -3
  84. package/dist/lexicon/types/app/bsky/graph/follow.d.ts.map +1 -1
  85. package/dist/lexicon/types/app/bsky/graph/follow.js +9 -7
  86. package/dist/lexicon/types/app/bsky/graph/follow.js.map +1 -1
  87. package/dist/lexicon/types/app/bsky/graph/list.d.ts +4 -3
  88. package/dist/lexicon/types/app/bsky/graph/list.d.ts.map +1 -1
  89. package/dist/lexicon/types/app/bsky/graph/list.js +9 -7
  90. package/dist/lexicon/types/app/bsky/graph/list.js.map +1 -1
  91. package/dist/lexicon/types/app/bsky/graph/listblock.d.ts +4 -3
  92. package/dist/lexicon/types/app/bsky/graph/listblock.d.ts.map +1 -1
  93. package/dist/lexicon/types/app/bsky/graph/listblock.js +9 -7
  94. package/dist/lexicon/types/app/bsky/graph/listblock.js.map +1 -1
  95. package/dist/lexicon/types/app/bsky/graph/listitem.d.ts +4 -3
  96. package/dist/lexicon/types/app/bsky/graph/listitem.d.ts.map +1 -1
  97. package/dist/lexicon/types/app/bsky/graph/listitem.js +9 -7
  98. package/dist/lexicon/types/app/bsky/graph/listitem.js.map +1 -1
  99. package/dist/lexicon/types/app/bsky/graph/starterpack.d.ts +4 -3
  100. package/dist/lexicon/types/app/bsky/graph/starterpack.d.ts.map +1 -1
  101. package/dist/lexicon/types/app/bsky/graph/starterpack.js +9 -7
  102. package/dist/lexicon/types/app/bsky/graph/starterpack.js.map +1 -1
  103. package/dist/lexicon/types/app/bsky/graph/verification.d.ts +4 -3
  104. package/dist/lexicon/types/app/bsky/graph/verification.d.ts.map +1 -1
  105. package/dist/lexicon/types/app/bsky/graph/verification.js +9 -7
  106. package/dist/lexicon/types/app/bsky/graph/verification.js.map +1 -1
  107. package/dist/lexicon/types/app/bsky/labeler/service.d.ts +4 -3
  108. package/dist/lexicon/types/app/bsky/labeler/service.d.ts.map +1 -1
  109. package/dist/lexicon/types/app/bsky/labeler/service.js +9 -7
  110. package/dist/lexicon/types/app/bsky/labeler/service.js.map +1 -1
  111. package/dist/lexicon/types/app/bsky/notification/declaration.d.ts +4 -3
  112. package/dist/lexicon/types/app/bsky/notification/declaration.d.ts.map +1 -1
  113. package/dist/lexicon/types/app/bsky/notification/declaration.js +9 -7
  114. package/dist/lexicon/types/app/bsky/notification/declaration.js.map +1 -1
  115. package/dist/lexicon/types/chat/bsky/actor/declaration.d.ts +4 -3
  116. package/dist/lexicon/types/chat/bsky/actor/declaration.d.ts.map +1 -1
  117. package/dist/lexicon/types/chat/bsky/actor/declaration.js +9 -7
  118. package/dist/lexicon/types/chat/bsky/actor/declaration.js.map +1 -1
  119. package/dist/lexicon/types/com/atproto/lexicon/schema.d.ts +4 -3
  120. package/dist/lexicon/types/com/atproto/lexicon/schema.d.ts.map +1 -1
  121. package/dist/lexicon/types/com/atproto/lexicon/schema.js +9 -7
  122. package/dist/lexicon/types/com/atproto/lexicon/schema.js.map +1 -1
  123. package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts +35 -0
  124. package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts.map +1 -1
  125. package/dist/lexicon/types/tools/ozone/moderation/defs.js +9 -0
  126. package/dist/lexicon/types/tools/ozone/moderation/defs.js.map +1 -1
  127. package/dist/lexicon/types/tools/ozone/moderation/queryEvents.d.ts +2 -0
  128. package/dist/lexicon/types/tools/ozone/moderation/queryEvents.d.ts.map +1 -1
  129. package/dist/lexicon/types/tools/ozone/moderation/queryEvents.js.map +1 -1
  130. package/dist/lexicon/types/tools/ozone/moderation/queryStatuses.d.ts +2 -0
  131. package/dist/lexicon/types/tools/ozone/moderation/queryStatuses.d.ts.map +1 -1
  132. package/dist/lexicon/types/tools/ozone/moderation/queryStatuses.js.map +1 -1
  133. package/dist/mod-service/index.d.ts +9 -3
  134. package/dist/mod-service/index.d.ts.map +1 -1
  135. package/dist/mod-service/index.js +58 -5
  136. package/dist/mod-service/index.js.map +1 -1
  137. package/dist/mod-service/status.d.ts +44 -2
  138. package/dist/mod-service/status.d.ts.map +1 -1
  139. package/dist/mod-service/status.js +7 -0
  140. package/dist/mod-service/status.js.map +1 -1
  141. package/dist/mod-service/strike.d.ts +19 -0
  142. package/dist/mod-service/strike.d.ts.map +1 -0
  143. package/dist/mod-service/strike.js +86 -0
  144. package/dist/mod-service/strike.js.map +1 -0
  145. package/dist/mod-service/types.d.ts +4 -0
  146. package/dist/mod-service/types.d.ts.map +1 -1
  147. package/dist/mod-service/types.js.map +1 -1
  148. package/dist/mod-service/views.d.ts.map +1 -1
  149. package/dist/mod-service/views.js +20 -4
  150. package/dist/mod-service/views.js.map +1 -1
  151. package/dist/setting/constants.d.ts +1 -0
  152. package/dist/setting/constants.d.ts.map +1 -1
  153. package/dist/setting/constants.js +2 -1
  154. package/dist/setting/constants.js.map +1 -1
  155. package/dist/setting/validators.d.ts.map +1 -1
  156. package/dist/setting/validators.js +179 -0
  157. package/dist/setting/validators.js.map +1 -1
  158. package/package.json +4 -4
  159. package/src/api/moderation/queryEvents.ts +2 -0
  160. package/src/context.ts +20 -11
  161. package/src/daemon/context.ts +15 -1
  162. package/src/daemon/index.ts +1 -0
  163. package/src/daemon/strike-expiry-processor.ts +111 -0
  164. package/src/db/migrations/20251008T120000000Z-add-strike-system.ts +87 -0
  165. package/src/db/migrations/index.ts +1 -0
  166. package/src/db/schema/account_strike.ts +13 -0
  167. package/src/db/schema/index.ts +4 -0
  168. package/src/db/schema/job_cursor.ts +13 -0
  169. package/src/db/schema/moderation_event.ts +3 -0
  170. package/src/lexicon/lexicons.ts +103 -0
  171. package/src/lexicon/types/app/bsky/actor/profile.ts +12 -6
  172. package/src/lexicon/types/app/bsky/actor/status.ts +12 -6
  173. package/src/lexicon/types/app/bsky/feed/generator.ts +12 -6
  174. package/src/lexicon/types/app/bsky/feed/like.ts +12 -6
  175. package/src/lexicon/types/app/bsky/feed/post.ts +12 -6
  176. package/src/lexicon/types/app/bsky/feed/postgate.ts +12 -6
  177. package/src/lexicon/types/app/bsky/feed/repost.ts +12 -6
  178. package/src/lexicon/types/app/bsky/feed/threadgate.ts +12 -6
  179. package/src/lexicon/types/app/bsky/graph/block.ts +12 -6
  180. package/src/lexicon/types/app/bsky/graph/follow.ts +12 -6
  181. package/src/lexicon/types/app/bsky/graph/list.ts +12 -6
  182. package/src/lexicon/types/app/bsky/graph/listblock.ts +12 -6
  183. package/src/lexicon/types/app/bsky/graph/listitem.ts +12 -6
  184. package/src/lexicon/types/app/bsky/graph/starterpack.ts +12 -6
  185. package/src/lexicon/types/app/bsky/graph/verification.ts +12 -6
  186. package/src/lexicon/types/app/bsky/labeler/service.ts +12 -6
  187. package/src/lexicon/types/app/bsky/notification/declaration.ts +12 -6
  188. package/src/lexicon/types/chat/bsky/actor/declaration.ts +12 -6
  189. package/src/lexicon/types/com/atproto/lexicon/schema.ts +12 -6
  190. package/src/lexicon/types/tools/ozone/moderation/defs.ts +44 -0
  191. package/src/lexicon/types/tools/ozone/moderation/queryEvents.ts +2 -0
  192. package/src/lexicon/types/tools/ozone/moderation/queryStatuses.ts +2 -0
  193. package/src/mod-service/index.ts +69 -2
  194. package/src/mod-service/status.ts +9 -0
  195. package/src/mod-service/strike.ts +96 -0
  196. package/src/mod-service/types.ts +6 -0
  197. package/src/mod-service/views.ts +25 -4
  198. package/src/setting/constants.ts +1 -0
  199. package/src/setting/validators.ts +231 -1
  200. package/tests/__snapshots__/account-strikes.test.ts.snap +159 -0
  201. package/tests/account-strikes.test.ts +184 -0
  202. package/tests/query-labels.test.ts +1 -0
  203. package/tests/strike-expiry-processor.test.ts +299 -0
  204. package/tsconfig.build.tsbuildinfo +1 -1
  205. package/tsconfig.tests.tsbuildinfo +1 -1
@@ -37,6 +37,8 @@ export type QueryParams = {
37
37
  batchId?: string;
38
38
  /** If specified, only events where the age assurance state matches the given value are returned */
39
39
  ageAssuranceState?: 'pending' | 'assured' | 'unknown' | 'reset' | 'blocked' | (string & {});
40
+ /** If specified, only events where strikeCount value is set are returned. */
41
+ withStrike?: boolean;
40
42
  cursor?: string;
41
43
  };
42
44
  export type InputSchema = undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"queryEvents.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/queryEvents.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,KAAK,wBAAwB,MAAM,WAAW,CAAA;AAM1D,MAAM,MAAM,WAAW,GAAG;IACxB,wKAAwK;IACxK,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2FAA2F;IAC3F,aAAa,EAAE,KAAK,GAAG,MAAM,CAAA;IAC7B,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB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B,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,CAAA"}
1
+ {"version":3,"file":"queryEvents.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/queryEvents.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,KAAK,wBAAwB,MAAM,WAAW,CAAA;AAM1D,MAAM,MAAM,WAAW,GAAG;IACxB,wKAAwK;IACxK,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2FAA2F;IAC3F,aAAa,EAAE,KAAK,GAAG,MAAM,CAAA;IAC7B,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iKAAiK;IACjK,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,4PAA4P;IAC5P,WAAW,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IAClD,iJAAiJ;IACjJ,qBAAqB,EAAE,OAAO,CAAA;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,sDAAsD;IACtD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,6JAA6J;IAC7J,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,oFAAoF;IACpF,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,oGAAoG;IACpG,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,uFAAuF;IACvF,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,mGAAmG;IACnG,iBAAiB,CAAC,EACd,SAAS,GACT,SAAS,GACT,SAAS,GACT,OAAO,GACP,SAAS,GACT,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IACjB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AACD,MAAM,MAAM,WAAW,GAAG,SAAS,CAAA;AAEnC,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,wBAAwB,CAAC,YAAY,EAAE,CAAA;CAChD;AAED,MAAM,MAAM,YAAY,GAAG,IAAI,CAAA;AAE/B,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"queryEvents.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/queryEvents.ts"],"names":[],"mappings":";;AAKA,mDAA4D;AAC5D,2CAIyB;AAGzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,oCAAoC,CAAA","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as ToolsOzoneModerationDefs from './defs.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'tools.ozone.moderation.queryEvents'\n\nexport type QueryParams = {\n /** The types of events (fully qualified string in the format of tools.ozone.moderation.defs#modEvent<name>) to filter by. If not specified, all events are returned. */\n types?: string[]\n createdBy?: string\n /** Sort direction for the events. Defaults to descending order of created at timestamp. */\n sortDirection: 'asc' | 'desc'\n /** Retrieve events created after a given timestamp */\n createdAfter?: string\n /** Retrieve events created before a given timestamp */\n createdBefore?: string\n subject?: string\n /** If specified, only events where the subject belongs to the given collections will be returned. When subjectType is set to 'account', this will be ignored. */\n collections?: string[]\n /** If specified, only events where the subject is of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored. */\n subjectType?: 'account' | 'record' | (string & {})\n /** If true, events on all record types (posts, lists, profile etc.) or records from given 'collections' param, owned by the did are returned. */\n includeAllUserRecords: boolean\n limit: number\n /** If true, only events with comments are returned */\n hasComment?: boolean\n /** If specified, only events with comments containing the keyword are returned. Apply || separator to use multiple keywords and match using OR condition. */\n comment?: string\n /** If specified, only events where all of these labels were added are returned */\n addedLabels?: string[]\n /** If specified, only events where all of these labels were removed are returned */\n removedLabels?: string[]\n /** If specified, only events where all of these tags were added are returned */\n addedTags?: string[]\n /** If specified, only events where all of these tags were removed are returned */\n removedTags?: string[]\n reportTypes?: string[]\n policies?: string[]\n /** If specified, only events where the modTool name matches any of the given values are returned */\n modTool?: string[]\n /** If specified, only events where the batchId matches the given value are returned */\n batchId?: string\n /** If specified, only events where the age assurance state matches the given value are returned */\n ageAssuranceState?:\n | 'pending'\n | 'assured'\n | 'unknown'\n | 'reset'\n | 'blocked'\n | (string & {})\n cursor?: string\n}\nexport type InputSchema = undefined\n\nexport interface OutputSchema {\n cursor?: string\n events: ToolsOzoneModerationDefs.ModEventView[]\n}\n\nexport type HandlerInput = void\n\nexport interface HandlerSuccess {\n encoding: 'application/json'\n body: OutputSchema\n headers?: { [key: string]: string }\n}\n\nexport interface HandlerError {\n status: number\n message?: string\n}\n\nexport type HandlerOutput = HandlerError | HandlerSuccess\n"]}
1
+ {"version":3,"file":"queryEvents.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/queryEvents.ts"],"names":[],"mappings":";;AAKA,mDAA4D;AAC5D,2CAIyB;AAGzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,oCAAoC,CAAA","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as ToolsOzoneModerationDefs from './defs.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'tools.ozone.moderation.queryEvents'\n\nexport type QueryParams = {\n /** The types of events (fully qualified string in the format of tools.ozone.moderation.defs#modEvent<name>) to filter by. If not specified, all events are returned. */\n types?: string[]\n createdBy?: string\n /** Sort direction for the events. Defaults to descending order of created at timestamp. */\n sortDirection: 'asc' | 'desc'\n /** Retrieve events created after a given timestamp */\n createdAfter?: string\n /** Retrieve events created before a given timestamp */\n createdBefore?: string\n subject?: string\n /** If specified, only events where the subject belongs to the given collections will be returned. When subjectType is set to 'account', this will be ignored. */\n collections?: string[]\n /** If specified, only events where the subject is of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored. */\n subjectType?: 'account' | 'record' | (string & {})\n /** If true, events on all record types (posts, lists, profile etc.) or records from given 'collections' param, owned by the did are returned. */\n includeAllUserRecords: boolean\n limit: number\n /** If true, only events with comments are returned */\n hasComment?: boolean\n /** If specified, only events with comments containing the keyword are returned. Apply || separator to use multiple keywords and match using OR condition. */\n comment?: string\n /** If specified, only events where all of these labels were added are returned */\n addedLabels?: string[]\n /** If specified, only events where all of these labels were removed are returned */\n removedLabels?: string[]\n /** If specified, only events where all of these tags were added are returned */\n addedTags?: string[]\n /** If specified, only events where all of these tags were removed are returned */\n removedTags?: string[]\n reportTypes?: string[]\n policies?: string[]\n /** If specified, only events where the modTool name matches any of the given values are returned */\n modTool?: string[]\n /** If specified, only events where the batchId matches the given value are returned */\n batchId?: string\n /** If specified, only events where the age assurance state matches the given value are returned */\n ageAssuranceState?:\n | 'pending'\n | 'assured'\n | 'unknown'\n | 'reset'\n | 'blocked'\n | (string & {})\n /** If specified, only events where strikeCount value is set are returned. */\n withStrike?: boolean\n cursor?: string\n}\nexport type InputSchema = undefined\n\nexport interface OutputSchema {\n cursor?: string\n events: ToolsOzoneModerationDefs.ModEventView[]\n}\n\nexport type HandlerInput = void\n\nexport interface HandlerSuccess {\n encoding: 'application/json'\n body: OutputSchema\n headers?: { [key: string]: string }\n}\n\nexport interface HandlerError {\n status: number\n message?: string\n}\n\nexport type HandlerOutput = HandlerError | HandlerSuccess\n"]}
@@ -61,6 +61,8 @@ export type QueryParams = {
61
61
  minTakendownRecordsCount?: number;
62
62
  /** If specified, only subjects that have priority score value above the given value will be returned. */
63
63
  minPriorityScore?: number;
64
+ /** If specified, only subjects that belong to an account that has at least this many active strikes will be returned. */
65
+ minStrikeCount?: number;
64
66
  /** If specified, only subjects with the given age assurance state will be returned. */
65
67
  ageAssuranceState?: 'pending' | 'assured' | 'unknown' | 'reset' | 'blocked' | (string & {});
66
68
  };
@@ -1 +1 @@
1
- {"version":3,"file":"queryStatuses.d.ts","sourceR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pC;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,CAAA"}
1
+ {"version":3,"file":"queryStatuses.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/queryStatuses.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,KAAK,wBAAwB,MAAM,WAAW,CAAA;AAM1D,MAAM,MAAM,WAAW,GAAG;IACxB,0FAA0F;IAC1F,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4IAA4I;IAC5I,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,8FAA8F;IAC9F,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,+FAA+F;IAC/F,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,8FAA8F;IAC9F,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,+FAA+F;IAC/F,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,oGAAoG;IACpG,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,OAAO,CAA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B,EAAE,CAAA;CAC9D;AAED,MAAM,MAAM,YAAY,GAAG,IAAI,CAAA;AAE/B,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"queryStatuses.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/queryStatuses.ts"],"names":[],"mappings":";;AAKA,mDAA4D;AAC5D,2CAIyB;AAGzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,sCAAsC,CAAA","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as ToolsOzoneModerationDefs from './defs.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'tools.ozone.moderation.queryStatuses'\n\nexport type QueryParams = {\n /** Number of queues being used by moderators. Subjects will be split among all queues. */\n queueCount?: number\n /** Index of the queue to fetch subjects from. Works only when queueCount value is specified. */\n queueIndex?: number\n /** A seeder to shuffle/balance the queue items. */\n queueSeed?: string\n /** All subjects, or subjects from given 'collections' param, belonging to the account specified in the 'subject' param will be returned. */\n includeAllUserRecords?: boolean\n /** The subject to get the status for. */\n subject?: string\n /** Search subjects by keyword from comments */\n comment?: string\n /** Search subjects reported after a given timestamp */\n reportedAfter?: string\n /** Search subjects reported before a given timestamp */\n reportedBefore?: string\n /** Search subjects reviewed after a given timestamp */\n reviewedAfter?: string\n /** Search subjects where the associated record/account was deleted after a given timestamp */\n hostingDeletedAfter?: string\n /** Search subjects where the associated record/account was deleted before a given timestamp */\n hostingDeletedBefore?: string\n /** Search subjects where the associated record/account was updated after a given timestamp */\n hostingUpdatedAfter?: string\n /** Search subjects where the associated record/account was updated before a given timestamp */\n hostingUpdatedBefore?: string\n /** Search subjects by the status of the associated record/account */\n hostingStatuses?: string[]\n /** Search subjects reviewed before a given timestamp */\n reviewedBefore?: string\n /** By default, we don't include muted subjects in the results. Set this to true to include them. */\n includeMuted?: boolean\n /** When set to true, only muted subjects and reporters will be returned. */\n onlyMuted?: boolean\n /** Specify when fetching subjects in a certain state */\n reviewState?: string\n ignoreSubjects?: string[]\n /** Get all subject statuses that were reviewed by a specific moderator */\n lastReviewedBy?: string\n sortField:\n | 'lastReviewedAt'\n | 'lastReportedAt'\n | 'reportedRecordsCount'\n | 'takendownRecordsCount'\n | 'priorityScore'\n sortDirection: 'asc' | 'desc'\n /** Get subjects that were taken down */\n takendown?: boolean\n /** Get subjects in unresolved appealed status */\n appealed?: boolean\n limit: number\n tags?: string[]\n excludeTags?: string[]\n cursor?: string\n /** If specified, subjects belonging to the given collections will be returned. When subjectType is set to 'account', this will be ignored. */\n collections?: string[]\n /** If specified, subjects of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored. */\n subjectType?: 'account' | 'record' | (string & {})\n /** If specified, only subjects that belong to an account that has at least this many suspensions will be returned. */\n minAccountSuspendCount?: number\n /** If specified, only subjects that belong to an account that has at least this many reported records will be returned. */\n minReportedRecordsCount?: number\n /** If specified, only subjects that belong to an account that has at least this many taken down records will be returned. */\n minTakendownRecordsCount?: number\n /** If specified, only subjects that have priority score value above the given value will be returned. */\n minPriorityScore?: number\n /** If specified, only subjects with the given age assurance state will be returned. */\n ageAssuranceState?:\n | 'pending'\n | 'assured'\n | 'unknown'\n | 'reset'\n | 'blocked'\n | (string & {})\n}\nexport type InputSchema = undefined\n\nexport interface OutputSchema {\n cursor?: string\n subjectStatuses: ToolsOzoneModerationDefs.SubjectStatusView[]\n}\n\nexport type HandlerInput = void\n\nexport interface HandlerSuccess {\n encoding: 'application/json'\n body: OutputSchema\n headers?: { [key: string]: string }\n}\n\nexport interface HandlerError {\n status: number\n message?: string\n}\n\nexport type HandlerOutput = HandlerError | HandlerSuccess\n"]}
1
+ {"version":3,"file":"queryStatuses.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/queryStatuses.ts"],"names":[],"mappings":";;AAKA,mDAA4D;AAC5D,2CAIyB;AAGzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,sCAAsC,CAAA","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as ToolsOzoneModerationDefs from './defs.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'tools.ozone.moderation.queryStatuses'\n\nexport type QueryParams = {\n /** Number of queues being used by moderators. Subjects will be split among all queues. */\n queueCount?: number\n /** Index of the queue to fetch subjects from. Works only when queueCount value is specified. */\n queueIndex?: number\n /** A seeder to shuffle/balance the queue items. */\n queueSeed?: string\n /** All subjects, or subjects from given 'collections' param, belonging to the account specified in the 'subject' param will be returned. */\n includeAllUserRecords?: boolean\n /** The subject to get the status for. */\n subject?: string\n /** Search subjects by keyword from comments */\n comment?: string\n /** Search subjects reported after a given timestamp */\n reportedAfter?: string\n /** Search subjects reported before a given timestamp */\n reportedBefore?: string\n /** Search subjects reviewed after a given timestamp */\n reviewedAfter?: string\n /** Search subjects where the associated record/account was deleted after a given timestamp */\n hostingDeletedAfter?: string\n /** Search subjects where the associated record/account was deleted before a given timestamp */\n hostingDeletedBefore?: string\n /** Search subjects where the associated record/account was updated after a given timestamp */\n hostingUpdatedAfter?: string\n /** Search subjects where the associated record/account was updated before a given timestamp */\n hostingUpdatedBefore?: string\n /** Search subjects by the status of the associated record/account */\n hostingStatuses?: string[]\n /** Search subjects reviewed before a given timestamp */\n reviewedBefore?: string\n /** By default, we don't include muted subjects in the results. Set this to true to include them. */\n includeMuted?: boolean\n /** When set to true, only muted subjects and reporters will be returned. */\n onlyMuted?: boolean\n /** Specify when fetching subjects in a certain state */\n reviewState?: string\n ignoreSubjects?: string[]\n /** Get all subject statuses that were reviewed by a specific moderator */\n lastReviewedBy?: string\n sortField:\n | 'lastReviewedAt'\n | 'lastReportedAt'\n | 'reportedRecordsCount'\n | 'takendownRecordsCount'\n | 'priorityScore'\n sortDirection: 'asc' | 'desc'\n /** Get subjects that were taken down */\n takendown?: boolean\n /** Get subjects in unresolved appealed status */\n appealed?: boolean\n limit: number\n tags?: string[]\n excludeTags?: string[]\n cursor?: string\n /** If specified, subjects belonging to the given collections will be returned. When subjectType is set to 'account', this will be ignored. */\n collections?: string[]\n /** If specified, subjects of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored. */\n subjectType?: 'account' | 'record' | (string & {})\n /** If specified, only subjects that belong to an account that has at least this many suspensions will be returned. */\n minAccountSuspendCount?: number\n /** If specified, only subjects that belong to an account that has at least this many reported records will be returned. */\n minReportedRecordsCount?: number\n /** If specified, only subjects that belong to an account that has at least this many taken down records will be returned. */\n minTakendownRecordsCount?: number\n /** If specified, only subjects that have priority score value above the given value will be returned. */\n minPriorityScore?: number\n /** If specified, only subjects that belong to an account that has at least this many active strikes will be returned. */\n minStrikeCount?: number\n /** If specified, only subjects with the given age assurance state will be returned. */\n ageAssuranceState?:\n | 'pending'\n | 'assured'\n | 'unknown'\n | 'reset'\n | 'blocked'\n | (string & {})\n}\nexport type InputSchema = undefined\n\nexport interface OutputSchema {\n cursor?: string\n subjectStatuses: ToolsOzoneModerationDefs.SubjectStatusView[]\n}\n\nexport type HandlerInput = void\n\nexport interface HandlerSuccess {\n encoding: 'application/json'\n body: OutputSchema\n headers?: { [key: string]: string }\n}\n\nexport interface HandlerError {\n status: number\n message?: string\n}\n\nexport type HandlerOutput = HandlerError | HandlerSuccess\n"]}
@@ -14,6 +14,7 @@ import { Label } from '../lexicon/types/com/atproto/label/defs';
14
14
  import { ReasonType } from '../lexicon/types/com/atproto/moderation/defs';
15
15
  import { Main as StrongRef } from '../lexicon/types/com/atproto/repo/strongRef';
16
16
  import { QueryParams as QueryStatusParams } from '../lexicon/types/tools/ozone/moderation/queryStatuses';
17
+ import { StrikeService, StrikeServiceCreator } from './strike';
17
18
  import { ModSubject, RecordSubject, RepoSubject } from './subject';
18
19
  import { ModEventType, ModerationEventRow, ModerationSubjectStatusRow, ModerationSubjectStatusRowWithHandle, ReporterStats, ReporterStatsResult, ReversibleModerationEvent } from './types';
19
20
  import { AuthHeaders, ModerationViews } from './views';
@@ -28,9 +29,10 @@ export declare class ModerationService {
28
29
  eventPusher: EventPusher;
29
30
  appviewAgent: AtpAgent;
30
31
  private createAuthHeaders;
32
+ strikeService: StrikeService;
31
33
  imgInvalidator?: ImageInvalidator | undefined;
32
- constructor(db: Database, signingKey: Keypair, signingKeyId: number, cfg: OzoneConfig, backgroundQueue: BackgroundQueue, idResolver: IdResolver, eventPusher: EventPusher, appviewAgent: AtpAgent, createAuthHeaders: (aud: string, method: string) => Promise<AuthHeaders>, imgInvalidator?: ImageInvalidator | undefined);
33
- static creator(signingKey: Keypair, signingKeyId: number, cfg: OzoneConfig, backgroundQueue: BackgroundQueue, idResolver: IdResolver, eventPusher: EventPusher, appviewAgent: AtpAgent, createAuthHeaders: (aud: string, method: string) => Promise<AuthHeaders>, imgInvalidator?: ImageInvalidator): (db: Database) => ModerationService;
34
+ constructor(db: Database, signingKey: Keypair, signingKeyId: number, cfg: OzoneConfig, backgroundQueue: BackgroundQueue, idResolver: IdResolver, eventPusher: EventPusher, appviewAgent: AtpAgent, createAuthHeaders: (aud: string, method: string) => Promise<AuthHeaders>, strikeService: StrikeService, imgInvalidator?: ImageInvalidator | undefined);
35
+ static creator(signingKey: Keypair, signingKeyId: number, cfg: OzoneConfig, backgroundQueue: BackgroundQueue, idResolver: IdResolver, eventPusher: EventPusher, appviewAgent: AtpAgent, createAuthHeaders: (aud: string, method: string) => Promise<AuthHeaders>, strikeServiceCreator: StrikeServiceCreator, imgInvalidator?: ImageInvalidator): (db: Database) => ModerationService;
34
36
  views: ModerationViews;
35
37
  getEvent(id: number): Promise<ModerationEventRow | undefined>;
36
38
  getEventOrThrow(id: number): Promise<ModerationEventRow>;
@@ -58,6 +60,7 @@ export declare class ModerationService {
58
60
  modTool?: string[];
59
61
  ageAssuranceState?: string;
60
62
  batchId?: string;
63
+ withStrike?: boolean;
61
64
  }): Promise<{
62
65
  cursor?: string;
63
66
  events: ModerationEventRow[];
@@ -135,6 +138,9 @@ export declare class ModerationService {
135
138
  name: string;
136
139
  meta?: { [_ in string]: unknown; };
137
140
  } | null;
141
+ severityLevel: string | null;
142
+ strikeCount: number | null;
143
+ strikeExpiresAt: string | null;
138
144
  externalId: string | null;
139
145
  } | null | undefined>;
140
146
  getSubjectsDueForReversal(): Promise<ReversalSubject[]>;
@@ -160,7 +166,7 @@ export declare class ModerationService {
160
166
  event: ModerationEventRow;
161
167
  subjectStatus: ModerationSubjectStatusRow | null;
162
168
  }>;
163
- getSubjectStatuses({ queueCount, queueIndex, queueSeed, includeAllUserRecords, cursor, limit, takendown, appealed, reviewState, reviewedAfter, reviewedBefore, reportedAfter, reportedBefore, includeMuted, hostingDeletedBefore, hostingDeletedAfter, hostingUpdatedBefore, hostingUpdatedAfter, hostingStatuses, onlyMuted, ignoreSubjects, sortDirection, lastReviewedBy, sortField, subject, tags, excludeTags, collections, subjectType, minAccountSuspendCount, minReportedRecordsCount, minTakendownRecordsCount, minPriorityScore, ageAssuranceState, }: QueryStatusParams): Promise<{
169
+ getSubjectStatuses({ queueCount, queueIndex, queueSeed, includeAllUserRecords, cursor, limit, takendown, appealed, reviewState, reviewedAfter, reviewedBefore, reportedAfter, reportedBefore, includeMuted, hostingDeletedBefore, hostingDeletedAfter, hostingUpdatedBefore, hostingUpdatedAfter, hostingStatuses, onlyMuted, ignoreSubjects, sortDirection, lastReviewedBy, sortField, subject, tags, excludeTags, collections, subjectType, minAccountSuspendCount, minReportedRecordsCount, minTakendownRecordsCount, minPriorityScore, minStrikeCount, ageAssuranceState, }: QueryStatusParams): Promise<{
164
170
  statuses: ModerationSubjectStatusRowWithHandle[];
165
171
  cursor?: string;
166
172
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mod-service/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAEjE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAkB,MAAM,iBAAiB,CAAA;AAGvD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAIhC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAA;AAC9E,OAAO,EAAE,KAAK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OAAO,CAAA;IACvB,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA"}
@@ -18,7 +18,7 @@ const subject_1 = require("./subject");
18
18
  const util_3 = require("./util");
19
19
  const views_1 = require("./views");
20
20
  class ModerationService {
21
- constructor(db, signingKey, signingKeyId, cfg, backgroundQueue, idResolver, eventPusher, appviewAgent, createAuthHeaders, imgInvalidator) {
21
+ constructor(db, signingKey, signingKeyId, cfg, backgroundQueue, idResolver, eventPusher, appviewAgent, createAuthHeaders, strikeService, imgInvalidator) {
22
22
  Object.defineProperty(this, "db", {
23
23
  enumerable: true,
24
24
  configurable: true,
@@ -73,6 +73,12 @@ class ModerationService {
73
73
  writable: true,
74
74
  value: createAuthHeaders
75
75
  });
76
+ Object.defineProperty(this, "strikeService", {
77
+ enumerable: true,
78
+ configurable: true,
79
+ writable: true,
80
+ value: strikeService
81
+ });
76
82
  Object.defineProperty(this, "imgInvalidator", {
77
83
  enumerable: true,
78
84
  configurable: true,
@@ -92,8 +98,11 @@ class ModerationService {
92
98
  }, this.idResolver, this.cfg.service.devMode)
93
99
  });
94
100
  }
95
- static creator(signingKey, signingKeyId, cfg, backgroundQueue, idResolver, eventPusher, appviewAgent, createAuthHeaders, imgInvalidator) {
96
- return (db) => new ModerationService(db, signingKey, signingKeyId, cfg, backgroundQueue, idResolver, eventPusher, appviewAgent, createAuthHeaders, imgInvalidator);
101
+ static creator(signingKey, signingKeyId, cfg, backgroundQueue, idResolver, eventPusher, appviewAgent, createAuthHeaders, strikeServiceCreator, imgInvalidator) {
102
+ return (db) => {
103
+ const strikeService = strikeServiceCreator(db);
104
+ return new ModerationService(db, signingKey, signingKeyId, cfg, backgroundQueue, idResolver, eventPusher, appviewAgent, createAuthHeaders, strikeService, imgInvalidator);
105
+ };
97
106
  }
98
107
  async getEvent(id) {
99
108
  return await this.db.db
@@ -120,7 +129,7 @@ class ModerationService {
120
129
  return !!result;
121
130
  }
122
131
  async getEvents(opts) {
123
- const { subject, createdBy, limit, cursor, includeAllUserRecords, sortDirection = 'desc', types, hasComment, comment, createdAfter, createdBefore, addedLabels, removedLabels, addedTags, removedTags, reportTypes, collections, subjectType, policies, modTool, ageAssuranceState, batchId, } = opts;
132
+ const { subject, createdBy, limit, cursor, includeAllUserRecords, sortDirection = 'desc', types, hasComment, comment, createdAfter, createdBefore, addedLabels, removedLabels, addedTags, removedTags, reportTypes, collections, subjectType, policies, modTool, ageAssuranceState, batchId, withStrike, } = opts;
124
133
  const { ref } = this.db.db.dynamic;
125
134
  let builder = this.db.db.selectFrom('moderation_event').selectAll();
126
135
  if (subject) {
@@ -232,6 +241,9 @@ class ModerationService {
232
241
  ])
233
242
  .where((0, kysely_1.sql) `meta->>'status'`, '=', ageAssuranceState);
234
243
  }
244
+ if (withStrike !== undefined) {
245
+ builder = builder.where('strikeCount', 'is not', null);
246
+ }
235
247
  const keyset = new pagination_1.TimeIdKeyset(ref(`moderation_event.createdAt`), ref('moderation_event.id'));
236
248
  const paginatedBuilder = (0, pagination_1.paginate)(builder, {
237
249
  limit,
@@ -336,6 +348,9 @@ class ModerationService {
336
348
  if (event.content) {
337
349
  meta.content = event.content;
338
350
  }
351
+ if (event.policies?.length) {
352
+ meta.policies = event.policies.join(',');
353
+ }
339
354
  }
340
355
  if ((0, defs_1.isAccountEvent)(event)) {
341
356
  meta.active = event.active;
@@ -409,6 +424,28 @@ class ModerationService {
409
424
  }
410
425
  }
411
426
  const subjectInfo = subject.info();
427
+ // Store severityLevel, strikeCount, and strikeExpiresAt if provided
428
+ // These values should be calculated by the client based on configuration
429
+ // processNewEvent will update the account_strike table with the new strike count
430
+ let severityLevel = null;
431
+ let strikeCount = null;
432
+ let strikeExpiresAt = null;
433
+ if ((0, defs_1.isModEventTakedown)(event) ||
434
+ (0, defs_1.isModEventEmail)(event) ||
435
+ (0, defs_1.isModEventReverseTakedown)(event)) {
436
+ // Store severityLevel if provided (for display/tracking)
437
+ if (event.severityLevel) {
438
+ severityLevel = event.severityLevel;
439
+ }
440
+ // Store explicit strikeCount if provided
441
+ if (event.strikeCount !== undefined) {
442
+ strikeCount = event.strikeCount;
443
+ }
444
+ // Store strikeExpiresAt if provided by client
445
+ if ('strikeExpiresAt' in event && event.strikeExpiresAt) {
446
+ strikeExpiresAt = event.strikeExpiresAt;
447
+ }
448
+ }
412
449
  const modEvent = await this.db.db
413
450
  .insertInto('moderation_event')
414
451
  .values({
@@ -439,10 +476,23 @@ class ModerationService {
439
476
  subjectMessageId: subjectInfo.subjectMessageId,
440
477
  modTool: modTool ? (0, types_1.jsonb)(modTool) : null,
441
478
  externalId: externalId ?? null,
479
+ severityLevel,
480
+ strikeCount,
481
+ strikeExpiresAt,
442
482
  })
443
483
  .returningAll()
444
484
  .executeTakeFirstOrThrow();
445
485
  const subjectStatus = await (0, status_1.adjustModerationSubjectStatus)(this.db, modEvent, subject.blobCids);
486
+ // Updates are only needed if strikeCount is numeric (in some cases even 0)
487
+ if (modEvent.strikeCount !== null) {
488
+ try {
489
+ await this.strikeService.updateSubjectStrikeCount(modEvent.subjectDid);
490
+ }
491
+ catch (error) {
492
+ // Log error but don't fail the entire operation to ensure that events are logged even if updating strike count fails
493
+ logger_1.httpLogger.error({ err: error, modEventId: modEvent.id }, 'Error processing strikes for moderation event');
494
+ }
495
+ }
446
496
  return { event: modEvent, subjectStatus };
447
497
  }
448
498
  async getLastReversibleEventForSubject(subject) {
@@ -662,7 +712,7 @@ class ModerationService {
662
712
  });
663
713
  return result;
664
714
  }
665
- async getSubjectStatuses({ queueCount, queueIndex, queueSeed = '', includeAllUserRecords, cursor, limit = 50, takendown, appealed, reviewState, reviewedAfter, reviewedBefore, reportedAfter, reportedBefore, includeMuted = false, hostingDeletedBefore, hostingDeletedAfter, hostingUpdatedBefore, hostingUpdatedAfter, hostingStatuses, onlyMuted = false, ignoreSubjects, sortDirection = 'desc', lastReviewedBy, sortField = 'lastReportedAt', subject, tags, excludeTags, collections, subjectType, minAccountSuspendCount, minReportedRecordsCount, minTakendownRecordsCount, minPriorityScore, ageAssuranceState, }) {
715
+ async getSubjectStatuses({ queueCount, queueIndex, queueSeed = '', includeAllUserRecords, cursor, limit = 50, takendown, appealed, reviewState, reviewedAfter, reviewedBefore, reportedAfter, reportedBefore, includeMuted = false, hostingDeletedBefore, hostingDeletedAfter, hostingUpdatedBefore, hostingUpdatedAfter, hostingStatuses, onlyMuted = false, ignoreSubjects, sortDirection = 'desc', lastReviewedBy, sortField = 'lastReportedAt', subject, tags, excludeTags, collections, subjectType, minAccountSuspendCount, minReportedRecordsCount, minTakendownRecordsCount, minPriorityScore, minStrikeCount, ageAssuranceState, }) {
666
716
  let builder = (0, status_1.moderationSubjectStatusQueryBuilder)(this.db.db);
667
717
  const { ref } = this.db.db.dynamic;
668
718
  if (subject) {
@@ -795,6 +845,9 @@ class ModerationService {
795
845
  if (minPriorityScore != null && minPriorityScore >= 0) {
796
846
  builder = builder.where('moderation_subject_status.priorityScore', '>=', minPriorityScore);
797
847
  }
848
+ if (minStrikeCount != null && minStrikeCount >= 0) {
849
+ builder = builder.where('account_strike.activeStrikeCount', '>=', minStrikeCount);
850
+ }
798
851
  if (ageAssuranceState) {
799
852
  builder = builder.where('moderation_subject_status.ageAssuranceState', '=', ageAssuranceState);
800
853
  }