@atproto/bsky 0.0.21 → 0.0.22

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 (42) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/api/com/atproto/moderation/util.d.ts +1 -1
  3. package/dist/db/index.js +17 -1
  4. package/dist/db/index.js.map +3 -3
  5. package/dist/db/migrations/20231213T181744386Z-moderation-subject-appeal.d.ts +3 -0
  6. package/dist/db/migrations/index.d.ts +1 -0
  7. package/dist/db/tables/moderation.d.ts +3 -1
  8. package/dist/index.js +213 -32
  9. package/dist/index.js.map +3 -3
  10. package/dist/lexicon/index.d.ts +1 -0
  11. package/dist/lexicon/lexicons.d.ts +35 -0
  12. package/dist/lexicon/types/com/atproto/admin/defs.d.ts +10 -1
  13. package/dist/lexicon/types/com/atproto/admin/queryModerationStatuses.d.ts +1 -0
  14. package/dist/lexicon/types/com/atproto/admin/sendEmail.d.ts +1 -0
  15. package/dist/lexicon/types/com/atproto/moderation/defs.d.ts +2 -1
  16. package/dist/services/feed/views.d.ts +1 -1
  17. package/dist/services/moderation/index.d.ts +7 -2
  18. package/package.json +5 -5
  19. package/src/api/app/bsky/feed/getPostThread.ts +4 -3
  20. package/src/api/app/bsky/feed/getTimeline.ts +54 -0
  21. package/src/api/com/atproto/admin/queryModerationStatuses.ts +2 -0
  22. package/src/api/com/atproto/moderation/createReport.ts +14 -3
  23. package/src/api/com/atproto/moderation/util.ts +2 -0
  24. package/src/api/health.ts +14 -0
  25. package/src/auto-moderator/index.ts +19 -0
  26. package/src/db/migrations/20231213T181744386Z-moderation-subject-appeal.ts +23 -0
  27. package/src/db/migrations/index.ts +1 -0
  28. package/src/db/tables/moderation.ts +3 -0
  29. package/src/lexicon/index.ts +1 -0
  30. package/src/lexicon/lexicons.ts +40 -0
  31. package/src/lexicon/types/com/atproto/admin/defs.ts +28 -0
  32. package/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts +2 -0
  33. package/src/lexicon/types/com/atproto/admin/sendEmail.ts +2 -0
  34. package/src/lexicon/types/com/atproto/moderation/defs.ts +3 -0
  35. package/src/services/feed/views.ts +6 -3
  36. package/src/services/moderation/index.ts +9 -0
  37. package/src/services/moderation/status.ts +24 -0
  38. package/src/services/moderation/views.ts +2 -0
  39. package/tests/admin/moderation-appeals.test.ts +269 -0
  40. package/tests/auto-moderator/labeler.test.ts +39 -0
  41. package/tests/views/blocks.test.ts +14 -1
  42. package/tests/views/timeline.test.ts +14 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atproto/bsky
2
2
 
3
+ ## 0.0.22
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`14067733`](https://github.com/bluesky-social/atproto/commit/140677335f76b99129c1f593d9e11d64624386c6)]:
8
+ - @atproto/api@0.8.0
9
+
3
10
  ## 0.0.21
4
11
 
5
12
  ### Patch Changes
@@ -13,6 +13,6 @@ export declare const getSubject: (subject: SubjectInput) => {
13
13
  did?: undefined;
14
14
  };
15
15
  export declare const getReasonType: (reasonType: ReportInput['reasonType']) => string | boolean;
16
- export declare const getEventType: (type: string) => "com.atproto.admin.defs#modEventTakedown" | "com.atproto.admin.defs#modEventReverseTakedown" | "com.atproto.admin.defs#modEventComment" | "com.atproto.admin.defs#modEventReport" | "com.atproto.admin.defs#modEventLabel" | "com.atproto.admin.defs#modEventAcknowledge" | "com.atproto.admin.defs#modEventEscalate" | "com.atproto.admin.defs#modEventMute" | "com.atproto.admin.defs#modEventEmail";
16
+ export declare const getEventType: (type: string) => "com.atproto.admin.defs#modEventTakedown" | "com.atproto.admin.defs#modEventReverseTakedown" | "com.atproto.admin.defs#modEventResolveAppeal" | "com.atproto.admin.defs#modEventComment" | "com.atproto.admin.defs#modEventReport" | "com.atproto.admin.defs#modEventLabel" | "com.atproto.admin.defs#modEventAcknowledge" | "com.atproto.admin.defs#modEventEscalate" | "com.atproto.admin.defs#modEventMute" | "com.atproto.admin.defs#modEventEmail";
17
17
  export declare const getReviewState: (reviewState?: string) => "com.atproto.admin.defs#reviewOpen" | "com.atproto.admin.defs#reviewEscalated" | "com.atproto.admin.defs#reviewClosed" | undefined;
18
18
  export {};
package/dist/db/index.js CHANGED
@@ -33504,7 +33504,8 @@ __export(migrations_exports, {
33504
33504
  _20230920T213858047Z: () => T213858047Z_add_tags_to_post_exports,
33505
33505
  _20230929T192920807Z: () => T192920807Z_record_cursor_indexes_exports,
33506
33506
  _20231003T202833377Z: () => T202833377Z_create_moderation_subject_status_exports,
33507
- _20231205T000257238Z: () => T000257238Z_remove_did_cache_exports
33507
+ _20231205T000257238Z: () => T000257238Z_remove_did_cache_exports,
33508
+ _20231213T181744386Z: () => T181744386Z_moderation_subject_appeal_exports
33508
33509
  });
33509
33510
 
33510
33511
  // src/db/migrations/20230309T045948368Z-init.ts
@@ -34040,6 +34041,21 @@ async function down30(db) {
34040
34041
  await db.schema.createTable("did_cache").addColumn("did", "varchar", (col) => col.primaryKey()).addColumn("doc", "jsonb", (col) => col.notNull()).addColumn("updatedAt", "bigint", (col) => col.notNull()).execute();
34041
34042
  }
34042
34043
 
34044
+ // src/db/migrations/20231213T181744386Z-moderation-subject-appeal.ts
34045
+ var T181744386Z_moderation_subject_appeal_exports = {};
34046
+ __export(T181744386Z_moderation_subject_appeal_exports, {
34047
+ down: () => down31,
34048
+ up: () => up31
34049
+ });
34050
+ async function up31(db) {
34051
+ await db.schema.alterTable("moderation_subject_status").addColumn("lastAppealedAt", "varchar").execute();
34052
+ await db.schema.alterTable("moderation_subject_status").addColumn("appealed", "boolean").execute();
34053
+ }
34054
+ async function down31(db) {
34055
+ await db.schema.alterTable("moderation_subject_status").dropColumn("lastAppealedAt").execute();
34056
+ await db.schema.alterTable("moderation_subject_status").dropColumn("appealed").execute();
34057
+ }
34058
+
34043
34059
  // src/db/migrations/provider.ts
34044
34060
  var CtxMigrationProvider = class {
34045
34061
  constructor(migrations, ctx) {