@atproto/ozone 0.0.6 → 0.0.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 (45) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE.txt +1 -1
  3. package/dist/db/index.js +15 -1
  4. package/dist/db/index.js.map +3 -3
  5. package/dist/db/migrations/20240201T051104136Z-mod-event-blobs.d.ts +3 -0
  6. package/dist/db/migrations/index.d.ts +1 -0
  7. package/dist/db/schema/moderation_event.d.ts +1 -0
  8. package/dist/db/types.d.ts +1 -0
  9. package/dist/index.js +440 -294
  10. package/dist/index.js.map +3 -3
  11. package/dist/lexicon/index.d.ts +2 -2
  12. package/dist/lexicon/lexicons.d.ts +67 -47
  13. package/dist/lexicon/types/com/atproto/admin/defs.d.ts +2 -2
  14. package/dist/lexicon/types/com/atproto/admin/queryModerationEvents.d.ts +7 -0
  15. package/dist/lexicon/types/{app/bsky/unspecced/getTimelineSkeleton.d.ts → com/atproto/temp/checkSignupQueue.d.ts} +3 -6
  16. package/dist/mod-service/index.d.ts +13 -4
  17. package/dist/mod-service/subject.d.ts +3 -0
  18. package/dist/mod-service/types.d.ts +2 -0
  19. package/package.json +6 -6
  20. package/src/api/admin/emitModerationEvent.ts +9 -6
  21. package/src/api/admin/queryModerationEvents.ts +14 -0
  22. package/src/api/moderation/util.ts +1 -0
  23. package/src/api/temp/fetchLabels.ts +36 -21
  24. package/src/context.ts +1 -0
  25. package/src/daemon/context.ts +1 -0
  26. package/src/db/migrations/20240201T051104136Z-mod-event-blobs.ts +15 -0
  27. package/src/db/migrations/index.ts +1 -0
  28. package/src/db/schema/moderation_event.ts +1 -0
  29. package/src/db/types.ts +6 -1
  30. package/src/lexicon/index.ts +12 -12
  31. package/src/lexicon/lexicons.ts +72 -50
  32. package/src/lexicon/types/com/atproto/admin/defs.ts +2 -0
  33. package/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts +13 -0
  34. package/src/lexicon/types/{app/bsky/unspecced/getTimelineSkeleton.ts → com/atproto/temp/checkSignupQueue.ts} +4 -8
  35. package/src/mod-service/index.ts +142 -64
  36. package/src/mod-service/status.ts +3 -2
  37. package/src/mod-service/subject.ts +9 -2
  38. package/src/mod-service/types.ts +4 -0
  39. package/src/mod-service/views.ts +1 -1
  40. package/tests/__snapshots__/get-record.test.ts.snap +16 -0
  41. package/tests/__snapshots__/get-repo.test.ts.snap +9 -1
  42. package/tests/moderation-appeals.test.ts +1 -1
  43. package/tests/moderation-events.test.ts +161 -8
  44. package/tests/moderation-statuses.test.ts +55 -0
  45. package/tests/moderation.test.ts +133 -34
package/dist/index.js CHANGED
@@ -27864,16 +27864,16 @@ var require_validate = __commonJS({
27864
27864
  const matches = RELATIVE_JSON_POINTER.exec($data);
27865
27865
  if (!matches)
27866
27866
  throw new Error(`Invalid JSON-pointer: ${$data}`);
27867
- const up3 = +matches[1];
27867
+ const up4 = +matches[1];
27868
27868
  jsonPointer = matches[2];
27869
27869
  if (jsonPointer === "#") {
27870
- if (up3 >= dataLevel)
27871
- throw new Error(errorMsg("property/index", up3));
27872
- return dataPathArr[dataLevel - up3];
27870
+ if (up4 >= dataLevel)
27871
+ throw new Error(errorMsg("property/index", up4));
27872
+ return dataPathArr[dataLevel - up4];
27873
27873
  }
27874
- if (up3 > dataLevel)
27875
- throw new Error(errorMsg("data", up3));
27876
- data = dataNames[dataLevel - up3];
27874
+ if (up4 > dataLevel)
27875
+ throw new Error(errorMsg("data", up4));
27876
+ data = dataNames[dataLevel - up4];
27877
27877
  if (!jsonPointer)
27878
27878
  return data;
27879
27879
  }
@@ -27886,8 +27886,8 @@ var require_validate = __commonJS({
27886
27886
  }
27887
27887
  }
27888
27888
  return expr;
27889
- function errorMsg(pointerType, up3) {
27890
- return `Cannot access ${pointerType} ${up3} levels up, current level is ${dataLevel}`;
27889
+ function errorMsg(pointerType, up4) {
27890
+ return `Cannot access ${pointerType} ${up4} levels up, current level is ${dataLevel}`;
27891
27891
  }
27892
27892
  }
27893
27893
  exports.getData = getData;
@@ -101683,7 +101683,8 @@ var schemaDict = {
101683
101683
  "lex:com.atproto.admin.defs#modEventAcknowledge",
101684
101684
  "lex:com.atproto.admin.defs#modEventEscalate",
101685
101685
  "lex:com.atproto.admin.defs#modEventMute",
101686
- "lex:com.atproto.admin.defs#modEventEmail"
101686
+ "lex:com.atproto.admin.defs#modEventEmail",
101687
+ "lex:com.atproto.admin.defs#modEventResolveAppeal"
101687
101688
  ]
101688
101689
  },
101689
101690
  subject: {
@@ -101740,6 +101741,7 @@ var schemaDict = {
101740
101741
  "lex:com.atproto.admin.defs#modEventAcknowledge",
101741
101742
  "lex:com.atproto.admin.defs#modEventEscalate",
101742
101743
  "lex:com.atproto.admin.defs#modEventMute",
101744
+ "lex:com.atproto.admin.defs#modEventEmail",
101743
101745
  "lex:com.atproto.admin.defs#modEventResolveAppeal"
101744
101746
  ]
101745
101747
  },
@@ -103029,6 +103031,16 @@ var schemaDict = {
103029
103031
  enum: ["asc", "desc"],
103030
103032
  description: "Sort direction for the events. Defaults to descending order of created at timestamp."
103031
103033
  },
103034
+ createdAfter: {
103035
+ type: "string",
103036
+ format: "datetime",
103037
+ description: "Retrieve events created after a given timestamp"
103038
+ },
103039
+ createdBefore: {
103040
+ type: "string",
103041
+ format: "datetime",
103042
+ description: "Retrieve events created before a given timestamp"
103043
+ },
103032
103044
  subject: {
103033
103045
  type: "string",
103034
103046
  format: "uri"
@@ -103044,6 +103056,34 @@ var schemaDict = {
103044
103056
  maximum: 100,
103045
103057
  default: 50
103046
103058
  },
103059
+ hasComment: {
103060
+ type: "boolean",
103061
+ description: "If true, only events with comments are returned"
103062
+ },
103063
+ comment: {
103064
+ type: "string",
103065
+ description: "If specified, only events with comments containing the keyword are returned"
103066
+ },
103067
+ addedLabels: {
103068
+ type: "array",
103069
+ items: {
103070
+ type: "string"
103071
+ },
103072
+ description: "If specified, only events where all of these labels were added are returned"
103073
+ },
103074
+ removedLabels: {
103075
+ type: "array",
103076
+ items: {
103077
+ type: "string"
103078
+ },
103079
+ description: "If specified, only events where all of these labels were removed are returned"
103080
+ },
103081
+ reportTypes: {
103082
+ type: "array",
103083
+ items: {
103084
+ type: "string"
103085
+ }
103086
+ },
103047
103087
  cursor: {
103048
103088
  type: "string"
103049
103089
  }
@@ -105784,6 +105824,34 @@ var schemaDict = {
105784
105824
  }
105785
105825
  }
105786
105826
  },
105827
+ ComAtprotoTempCheckSignupQueue: {
105828
+ lexicon: 1,
105829
+ id: "com.atproto.temp.checkSignupQueue",
105830
+ defs: {
105831
+ main: {
105832
+ type: "query",
105833
+ description: "Check accounts location in signup queue.",
105834
+ output: {
105835
+ encoding: "application/json",
105836
+ schema: {
105837
+ type: "object",
105838
+ required: ["activated"],
105839
+ properties: {
105840
+ activated: {
105841
+ type: "boolean"
105842
+ },
105843
+ placeInQueue: {
105844
+ type: "integer"
105845
+ },
105846
+ estimatedTimeMs: {
105847
+ type: "integer"
105848
+ }
105849
+ }
105850
+ }
105851
+ }
105852
+ }
105853
+ }
105854
+ },
105787
105855
  ComAtprotoTempFetchLabels: {
105788
105856
  lexicon: 1,
105789
105857
  id: "com.atproto.temp.fetchLabels",
@@ -109580,54 +109648,6 @@ var schemaDict = {
109580
109648
  }
109581
109649
  }
109582
109650
  },
109583
- AppBskyUnspeccedGetTimelineSkeleton: {
109584
- lexicon: 1,
109585
- id: "app.bsky.unspecced.getTimelineSkeleton",
109586
- defs: {
109587
- main: {
109588
- type: "query",
109589
- description: "DEPRECATED: a skeleton of a timeline. Unspecced and will be unavailable soon.",
109590
- parameters: {
109591
- type: "params",
109592
- properties: {
109593
- limit: {
109594
- type: "integer",
109595
- minimum: 1,
109596
- maximum: 100,
109597
- default: 50
109598
- },
109599
- cursor: {
109600
- type: "string"
109601
- }
109602
- }
109603
- },
109604
- output: {
109605
- encoding: "application/json",
109606
- schema: {
109607
- type: "object",
109608
- required: ["feed"],
109609
- properties: {
109610
- cursor: {
109611
- type: "string"
109612
- },
109613
- feed: {
109614
- type: "array",
109615
- items: {
109616
- type: "ref",
109617
- ref: "lex:app.bsky.feed.defs#skeletonFeedPost"
109618
- }
109619
- }
109620
- }
109621
- }
109622
- },
109623
- errors: [
109624
- {
109625
- name: "UnknownFeed"
109626
- }
109627
- ]
109628
- }
109629
- }
109630
- },
109631
109651
  AppBskyUnspeccedSearchActorsSkeleton: {
109632
109652
  lexicon: 1,
109633
109653
  id: "app.bsky.unspecced.searchActorsSkeleton",
@@ -109827,7 +109847,8 @@ var eventTypes = /* @__PURE__ */ new Set([
109827
109847
  "com.atproto.admin.defs#modEventMute",
109828
109848
  "com.atproto.admin.defs#modEventUnmute",
109829
109849
  "com.atproto.admin.defs#modEventReverseTakedown",
109830
- "com.atproto.admin.defs#modEventEmail"
109850
+ "com.atproto.admin.defs#modEventEmail",
109851
+ "com.atproto.admin.defs#modEventResolveAppeal"
109831
109852
  ]);
109832
109853
 
109833
109854
  // src/mod-service/subject.ts
@@ -109845,7 +109866,7 @@ var subjectFromInput = (subject, blobs) => {
109845
109866
  };
109846
109867
  var subjectFromEventRow = (row) => {
109847
109868
  if (row.subjectType === "com.atproto.repo.strongRef" && row.subjectUri && row.subjectCid) {
109848
- return new RecordSubject(row.subjectUri, row.subjectCid);
109869
+ return new RecordSubject(row.subjectUri, row.subjectCid, row.subjectBlobCids ?? []);
109849
109870
  } else {
109850
109871
  return new RepoSubject(row.subjectDid);
109851
109872
  }
@@ -109853,7 +109874,7 @@ var subjectFromEventRow = (row) => {
109853
109874
  var subjectFromStatusRow = (row) => {
109854
109875
  if (row.recordPath && row.recordCid) {
109855
109876
  const uri2 = AtUri.make(row.did, ...row.recordPath.split("/")).toString();
109856
- return new RecordSubject(uri2.toString(), row.recordCid);
109877
+ return new RecordSubject(uri2.toString(), row.recordCid, row.blobCids ?? []);
109857
109878
  } else {
109858
109879
  return new RepoSubject(row.did);
109859
109880
  }
@@ -109875,7 +109896,8 @@ var RepoSubject = class {
109875
109896
  subjectType: "com.atproto.admin.defs#repoRef",
109876
109897
  subjectDid: this.did,
109877
109898
  subjectUri: null,
109878
- subjectCid: null
109899
+ subjectCid: null,
109900
+ subjectBlobCids: null
109879
109901
  };
109880
109902
  }
109881
109903
  lex() {
@@ -109905,7 +109927,8 @@ var RecordSubject = class {
109905
109927
  subjectType: "com.atproto.repo.strongRef",
109906
109928
  subjectDid: this.did,
109907
109929
  subjectUri: this.uri,
109908
- subjectCid: this.cid
109930
+ subjectCid: this.cid,
109931
+ subjectBlobCids: this.blobCids ?? []
109909
109932
  };
109910
109933
  }
109911
109934
  lex() {
@@ -109976,13 +109999,16 @@ function emitModerationEvent_default(server, ctx) {
109976
109999
  ]);
109977
110000
  }
109978
110001
  if (isTakedownEvent || isReverseTakedownEvent) {
109979
- const isSubjectTakendown = await moderationService.isSubjectTakendown(subject);
109980
- if (isSubjectTakendown && isTakedownEvent) {
110002
+ const status = await moderationService.getStatus(subject);
110003
+ if (status?.takendown && isTakedownEvent) {
109981
110004
  throw new InvalidRequestError(`Subject is already taken down`);
109982
110005
  }
109983
- if (!isSubjectTakendown && isReverseTakedownEvent) {
110006
+ if (!status?.takendown && isReverseTakedownEvent) {
109984
110007
  throw new InvalidRequestError(`Subject is not taken down`);
109985
110008
  }
110009
+ if (status?.takendown && isReverseTakedownEvent && subject.isRecord()) {
110010
+ subject.blobCids = status.blobCids ?? [];
110011
+ }
109986
110012
  }
109987
110013
  const moderationEvent = await db.transaction(async (dbTxn) => {
109988
110014
  const moderationTxn = ctx.modService(dbTxn);
@@ -110007,7 +110033,7 @@ function emitModerationEvent_default(server, ctx) {
110007
110033
  }
110008
110034
  }
110009
110035
  if (isLabelEvent) {
110010
- await moderationTxn.formatAndCreateLabels(ctx.cfg.service.did, result.subjectUri ?? result.subjectDid, result.subjectCid, {
110036
+ await moderationTxn.formatAndCreateLabels(result.subjectUri ?? result.subjectDid, result.subjectCid, {
110011
110037
  create: result.createLabelVals?.length ? result.createLabelVals.split(" ") : void 0,
110012
110038
  negate: result.negateLabelVals?.length ? result.negateLabelVals.split(" ") : void 0
110013
110039
  });
@@ -110213,7 +110239,14 @@ function queryModerationEvents_default(server, ctx) {
110213
110239
  sortDirection = "desc",
110214
110240
  types,
110215
110241
  includeAllUserRecords = false,
110216
- createdBy
110242
+ hasComment,
110243
+ comment,
110244
+ createdBy,
110245
+ createdAfter,
110246
+ createdBefore,
110247
+ addedLabels = [],
110248
+ removedLabels = [],
110249
+ reportTypes
110217
110250
  } = params2;
110218
110251
  const db = ctx.db;
110219
110252
  const modService = ctx.modService(db);
@@ -110224,7 +110257,14 @@ function queryModerationEvents_default(server, ctx) {
110224
110257
  limit,
110225
110258
  cursor,
110226
110259
  sortDirection,
110227
- includeAllUserRecords
110260
+ includeAllUserRecords,
110261
+ hasComment,
110262
+ comment,
110263
+ createdAfter,
110264
+ createdBefore,
110265
+ addedLabels,
110266
+ removedLabels,
110267
+ reportTypes
110228
110268
  });
110229
110269
  return {
110230
110270
  encoding: "application/json",
@@ -110255,22 +110295,33 @@ function getModerationEvent_default(server, ctx) {
110255
110295
  });
110256
110296
  }
110257
110297
 
110298
+ // src/mod-service/types.ts
110299
+ var UNSPECCED_TAKEDOWN_LABEL = "!unspecced-takedown";
110300
+ var UNSPECCED_TAKEDOWN_BLOBS_LABEL = "!unspecced-takedown-blobs";
110301
+
110258
110302
  // src/api/temp/fetchLabels.ts
110259
110303
  function fetchLabels_default(server, ctx) {
110260
- server.com.atproto.temp.fetchLabels(async ({ params: params2 }) => {
110261
- const { limit } = params2;
110262
- const since = params2.since !== void 0 ? new Date(params2.since).toISOString() : "";
110263
- const labelRes = await ctx.db.db.selectFrom("label").selectAll().orderBy("label.cts", "asc").where("cts", ">", since).limit(limit).execute();
110264
- const labels = labelRes.map((l) => ({
110265
- ...l,
110266
- cid: l.cid === "" ? void 0 : l.cid
110267
- }));
110268
- return {
110269
- encoding: "application/json",
110270
- body: {
110271
- labels
110272
- }
110273
- };
110304
+ server.com.atproto.temp.fetchLabels({
110305
+ auth: ctx.authOptionalAccessOrRoleVerifier,
110306
+ handler: async ({ auth, params: params2 }) => {
110307
+ const { limit } = params2;
110308
+ const since = params2.since !== void 0 ? new Date(params2.since).toISOString() : "";
110309
+ const includeUnspeccedTakedowns = auth.credentials.type === "role" && auth.credentials.admin;
110310
+ const labelRes = await ctx.db.db.selectFrom("label").selectAll().orderBy("label.cts", "asc").where("cts", ">", since).if(!includeUnspeccedTakedowns, (q) => q.where("label.val", "not in", [
110311
+ UNSPECCED_TAKEDOWN_LABEL,
110312
+ UNSPECCED_TAKEDOWN_BLOBS_LABEL
110313
+ ])).limit(limit).execute();
110314
+ const labels = labelRes.map((l) => ({
110315
+ ...l,
110316
+ cid: l.cid === "" ? void 0 : l.cid
110317
+ }));
110318
+ return {
110319
+ encoding: "application/json",
110320
+ body: {
110321
+ labels
110322
+ }
110323
+ };
110324
+ }
110274
110325
  });
110275
110326
  }
110276
110327
 
@@ -118354,6 +118405,10 @@ var ComAtprotoTempNS = class {
118354
118405
  constructor(server) {
118355
118406
  this._server = server;
118356
118407
  }
118408
+ checkSignupQueue(cfg) {
118409
+ const nsid2 = "com.atproto.temp.checkSignupQueue";
118410
+ return this._server.xrpc.method(nsid2, cfg);
118411
+ }
118357
118412
  fetchLabels(cfg) {
118358
118413
  const nsid2 = "com.atproto.temp.fetchLabels";
118359
118414
  return this._server.xrpc.method(nsid2, cfg);
@@ -118599,10 +118654,6 @@ var AppBskyUnspeccedNS = class {
118599
118654
  const nsid2 = "app.bsky.unspecced.getTaggedSuggestions";
118600
118655
  return this._server.xrpc.method(nsid2, cfg);
118601
118656
  }
118602
- getTimelineSkeleton(cfg) {
118603
- const nsid2 = "app.bsky.unspecced.getTimelineSkeleton";
118604
- return this._server.xrpc.method(nsid2, cfg);
118605
- }
118606
118657
  searchActorsSkeleton(cfg) {
118607
118658
  const nsid2 = "app.bsky.unspecced.searchActorsSkeleton";
118608
118659
  return this._server.xrpc.method(nsid2, cfg);
@@ -119038,7 +119089,8 @@ var schemaDict2 = {
119038
119089
  "lex:com.atproto.admin.defs#modEventAcknowledge",
119039
119090
  "lex:com.atproto.admin.defs#modEventEscalate",
119040
119091
  "lex:com.atproto.admin.defs#modEventMute",
119041
- "lex:com.atproto.admin.defs#modEventEmail"
119092
+ "lex:com.atproto.admin.defs#modEventEmail",
119093
+ "lex:com.atproto.admin.defs#modEventResolveAppeal"
119042
119094
  ]
119043
119095
  },
119044
119096
  subject: {
@@ -119095,6 +119147,7 @@ var schemaDict2 = {
119095
119147
  "lex:com.atproto.admin.defs#modEventAcknowledge",
119096
119148
  "lex:com.atproto.admin.defs#modEventEscalate",
119097
119149
  "lex:com.atproto.admin.defs#modEventMute",
119150
+ "lex:com.atproto.admin.defs#modEventEmail",
119098
119151
  "lex:com.atproto.admin.defs#modEventResolveAppeal"
119099
119152
  ]
119100
119153
  },
@@ -120384,6 +120437,16 @@ var schemaDict2 = {
120384
120437
  enum: ["asc", "desc"],
120385
120438
  description: "Sort direction for the events. Defaults to descending order of created at timestamp."
120386
120439
  },
120440
+ createdAfter: {
120441
+ type: "string",
120442
+ format: "datetime",
120443
+ description: "Retrieve events created after a given timestamp"
120444
+ },
120445
+ createdBefore: {
120446
+ type: "string",
120447
+ format: "datetime",
120448
+ description: "Retrieve events created before a given timestamp"
120449
+ },
120387
120450
  subject: {
120388
120451
  type: "string",
120389
120452
  format: "uri"
@@ -120399,6 +120462,34 @@ var schemaDict2 = {
120399
120462
  maximum: 100,
120400
120463
  default: 50
120401
120464
  },
120465
+ hasComment: {
120466
+ type: "boolean",
120467
+ description: "If true, only events with comments are returned"
120468
+ },
120469
+ comment: {
120470
+ type: "string",
120471
+ description: "If specified, only events with comments containing the keyword are returned"
120472
+ },
120473
+ addedLabels: {
120474
+ type: "array",
120475
+ items: {
120476
+ type: "string"
120477
+ },
120478
+ description: "If specified, only events where all of these labels were added are returned"
120479
+ },
120480
+ removedLabels: {
120481
+ type: "array",
120482
+ items: {
120483
+ type: "string"
120484
+ },
120485
+ description: "If specified, only events where all of these labels were removed are returned"
120486
+ },
120487
+ reportTypes: {
120488
+ type: "array",
120489
+ items: {
120490
+ type: "string"
120491
+ }
120492
+ },
120402
120493
  cursor: {
120403
120494
  type: "string"
120404
120495
  }
@@ -123139,6 +123230,34 @@ var schemaDict2 = {
123139
123230
  }
123140
123231
  }
123141
123232
  },
123233
+ ComAtprotoTempCheckSignupQueue: {
123234
+ lexicon: 1,
123235
+ id: "com.atproto.temp.checkSignupQueue",
123236
+ defs: {
123237
+ main: {
123238
+ type: "query",
123239
+ description: "Check accounts location in signup queue.",
123240
+ output: {
123241
+ encoding: "application/json",
123242
+ schema: {
123243
+ type: "object",
123244
+ required: ["activated"],
123245
+ properties: {
123246
+ activated: {
123247
+ type: "boolean"
123248
+ },
123249
+ placeInQueue: {
123250
+ type: "integer"
123251
+ },
123252
+ estimatedTimeMs: {
123253
+ type: "integer"
123254
+ }
123255
+ }
123256
+ }
123257
+ }
123258
+ }
123259
+ }
123260
+ },
123142
123261
  ComAtprotoTempFetchLabels: {
123143
123262
  lexicon: 1,
123144
123263
  id: "com.atproto.temp.fetchLabels",
@@ -126935,54 +127054,6 @@ var schemaDict2 = {
126935
127054
  }
126936
127055
  }
126937
127056
  },
126938
- AppBskyUnspeccedGetTimelineSkeleton: {
126939
- lexicon: 1,
126940
- id: "app.bsky.unspecced.getTimelineSkeleton",
126941
- defs: {
126942
- main: {
126943
- type: "query",
126944
- description: "DEPRECATED: a skeleton of a timeline. Unspecced and will be unavailable soon.",
126945
- parameters: {
126946
- type: "params",
126947
- properties: {
126948
- limit: {
126949
- type: "integer",
126950
- minimum: 1,
126951
- maximum: 100,
126952
- default: 50
126953
- },
126954
- cursor: {
126955
- type: "string"
126956
- }
126957
- }
126958
- },
126959
- output: {
126960
- encoding: "application/json",
126961
- schema: {
126962
- type: "object",
126963
- required: ["feed"],
126964
- properties: {
126965
- cursor: {
126966
- type: "string"
126967
- },
126968
- feed: {
126969
- type: "array",
126970
- items: {
126971
- type: "ref",
126972
- ref: "lex:app.bsky.feed.defs#skeletonFeedPost"
126973
- }
126974
- }
126975
- }
126976
- }
126977
- },
126978
- errors: [
126979
- {
126980
- name: "UnknownFeed"
126981
- }
126982
- ]
126983
- }
126984
- }
126985
- },
126986
127057
  AppBskyUnspeccedSearchActorsSkeleton: {
126987
127058
  lexicon: 1,
126988
127059
  id: "app.bsky.unspecced.searchActorsSkeleton",
@@ -127800,34 +127871,41 @@ function toKnownErr67(e) {
127800
127871
  return e;
127801
127872
  }
127802
127873
 
127803
- // ../api/src/client/types/com/atproto/temp/fetchLabels.ts
127874
+ // ../api/src/client/types/com/atproto/temp/checkSignupQueue.ts
127804
127875
  function toKnownErr68(e) {
127805
127876
  if (e instanceof XRPCError) {
127806
127877
  }
127807
127878
  return e;
127808
127879
  }
127809
127880
 
127810
- // ../api/src/client/types/com/atproto/temp/importRepo.ts
127881
+ // ../api/src/client/types/com/atproto/temp/fetchLabels.ts
127811
127882
  function toKnownErr69(e) {
127812
127883
  if (e instanceof XRPCError) {
127813
127884
  }
127814
127885
  return e;
127815
127886
  }
127816
127887
 
127817
- // ../api/src/client/types/com/atproto/temp/pushBlob.ts
127888
+ // ../api/src/client/types/com/atproto/temp/importRepo.ts
127818
127889
  function toKnownErr70(e) {
127819
127890
  if (e instanceof XRPCError) {
127820
127891
  }
127821
127892
  return e;
127822
127893
  }
127823
127894
 
127824
- // ../api/src/client/types/com/atproto/temp/requestPhoneVerification.ts
127895
+ // ../api/src/client/types/com/atproto/temp/pushBlob.ts
127825
127896
  function toKnownErr71(e) {
127826
127897
  if (e instanceof XRPCError) {
127827
127898
  }
127828
127899
  return e;
127829
127900
  }
127830
127901
 
127902
+ // ../api/src/client/types/com/atproto/temp/requestPhoneVerification.ts
127903
+ function toKnownErr72(e) {
127904
+ if (e instanceof XRPCError) {
127905
+ }
127906
+ return e;
127907
+ }
127908
+
127831
127909
  // ../api/src/client/types/com/atproto/temp/transferAccount.ts
127832
127910
  var InvalidHandleError3 = class extends XRPCError {
127833
127911
  constructor(src3) {
@@ -127864,7 +127942,7 @@ var IncompatibleDidDocError2 = class extends XRPCError {
127864
127942
  super(src3.status, src3.error, src3.message, src3.headers);
127865
127943
  }
127866
127944
  };
127867
- function toKnownErr72(e) {
127945
+ function toKnownErr73(e) {
127868
127946
  if (e instanceof XRPCError) {
127869
127947
  if (e.error === "InvalidHandle")
127870
127948
  return new InvalidHandleError3(e);
@@ -127885,63 +127963,63 @@ function toKnownErr72(e) {
127885
127963
  }
127886
127964
 
127887
127965
  // ../api/src/client/types/app/bsky/actor/getPreferences.ts
127888
- function toKnownErr73(e) {
127966
+ function toKnownErr74(e) {
127889
127967
  if (e instanceof XRPCError) {
127890
127968
  }
127891
127969
  return e;
127892
127970
  }
127893
127971
 
127894
127972
  // ../api/src/client/types/app/bsky/actor/getProfile.ts
127895
- function toKnownErr74(e) {
127973
+ function toKnownErr75(e) {
127896
127974
  if (e instanceof XRPCError) {
127897
127975
  }
127898
127976
  return e;
127899
127977
  }
127900
127978
 
127901
127979
  // ../api/src/client/types/app/bsky/actor/getProfiles.ts
127902
- function toKnownErr75(e) {
127980
+ function toKnownErr76(e) {
127903
127981
  if (e instanceof XRPCError) {
127904
127982
  }
127905
127983
  return e;
127906
127984
  }
127907
127985
 
127908
127986
  // ../api/src/client/types/app/bsky/actor/getSuggestions.ts
127909
- function toKnownErr76(e) {
127987
+ function toKnownErr77(e) {
127910
127988
  if (e instanceof XRPCError) {
127911
127989
  }
127912
127990
  return e;
127913
127991
  }
127914
127992
 
127915
127993
  // ../api/src/client/types/app/bsky/actor/putPreferences.ts
127916
- function toKnownErr77(e) {
127994
+ function toKnownErr78(e) {
127917
127995
  if (e instanceof XRPCError) {
127918
127996
  }
127919
127997
  return e;
127920
127998
  }
127921
127999
 
127922
128000
  // ../api/src/client/types/app/bsky/actor/searchActors.ts
127923
- function toKnownErr78(e) {
128001
+ function toKnownErr79(e) {
127924
128002
  if (e instanceof XRPCError) {
127925
128003
  }
127926
128004
  return e;
127927
128005
  }
127928
128006
 
127929
128007
  // ../api/src/client/types/app/bsky/actor/searchActorsTypeahead.ts
127930
- function toKnownErr79(e) {
128008
+ function toKnownErr80(e) {
127931
128009
  if (e instanceof XRPCError) {
127932
128010
  }
127933
128011
  return e;
127934
128012
  }
127935
128013
 
127936
128014
  // ../api/src/client/types/app/bsky/feed/describeFeedGenerator.ts
127937
- function toKnownErr80(e) {
128015
+ function toKnownErr81(e) {
127938
128016
  if (e instanceof XRPCError) {
127939
128017
  }
127940
128018
  return e;
127941
128019
  }
127942
128020
 
127943
128021
  // ../api/src/client/types/app/bsky/feed/getActorFeeds.ts
127944
- function toKnownErr81(e) {
128022
+ function toKnownErr82(e) {
127945
128023
  if (e instanceof XRPCError) {
127946
128024
  }
127947
128025
  return e;
@@ -127958,7 +128036,7 @@ var BlockedByActorError = class extends XRPCError {
127958
128036
  super(src3.status, src3.error, src3.message, src3.headers);
127959
128037
  }
127960
128038
  };
127961
- function toKnownErr82(e) {
128039
+ function toKnownErr83(e) {
127962
128040
  if (e instanceof XRPCError) {
127963
128041
  if (e.error === "BlockedActor")
127964
128042
  return new BlockedActorError(e);
@@ -127979,7 +128057,7 @@ var BlockedByActorError2 = class extends XRPCError {
127979
128057
  super(src3.status, src3.error, src3.message, src3.headers);
127980
128058
  }
127981
128059
  };
127982
- function toKnownErr83(e) {
128060
+ function toKnownErr84(e) {
127983
128061
  if (e instanceof XRPCError) {
127984
128062
  if (e.error === "BlockedActor")
127985
128063
  return new BlockedActorError2(e);
@@ -127995,7 +128073,7 @@ var UnknownFeedError = class extends XRPCError {
127995
128073
  super(src3.status, src3.error, src3.message, src3.headers);
127996
128074
  }
127997
128075
  };
127998
- function toKnownErr84(e) {
128076
+ function toKnownErr85(e) {
127999
128077
  if (e instanceof XRPCError) {
128000
128078
  if (e.error === "UnknownFeed")
128001
128079
  return new UnknownFeedError(e);
@@ -128004,14 +128082,14 @@ function toKnownErr84(e) {
128004
128082
  }
128005
128083
 
128006
128084
  // ../api/src/client/types/app/bsky/feed/getFeedGenerator.ts
128007
- function toKnownErr85(e) {
128085
+ function toKnownErr86(e) {
128008
128086
  if (e instanceof XRPCError) {
128009
128087
  }
128010
128088
  return e;
128011
128089
  }
128012
128090
 
128013
128091
  // ../api/src/client/types/app/bsky/feed/getFeedGenerators.ts
128014
- function toKnownErr86(e) {
128092
+ function toKnownErr87(e) {
128015
128093
  if (e instanceof XRPCError) {
128016
128094
  }
128017
128095
  return e;
@@ -128023,7 +128101,7 @@ var UnknownFeedError2 = class extends XRPCError {
128023
128101
  super(src3.status, src3.error, src3.message, src3.headers);
128024
128102
  }
128025
128103
  };
128026
- function toKnownErr87(e) {
128104
+ function toKnownErr88(e) {
128027
128105
  if (e instanceof XRPCError) {
128028
128106
  if (e.error === "UnknownFeed")
128029
128107
  return new UnknownFeedError2(e);
@@ -128032,7 +128110,7 @@ function toKnownErr87(e) {
128032
128110
  }
128033
128111
 
128034
128112
  // ../api/src/client/types/app/bsky/feed/getLikes.ts
128035
- function toKnownErr88(e) {
128113
+ function toKnownErr89(e) {
128036
128114
  if (e instanceof XRPCError) {
128037
128115
  }
128038
128116
  return e;
@@ -128044,7 +128122,7 @@ var UnknownListError = class extends XRPCError {
128044
128122
  super(src3.status, src3.error, src3.message, src3.headers);
128045
128123
  }
128046
128124
  };
128047
- function toKnownErr89(e) {
128125
+ function toKnownErr90(e) {
128048
128126
  if (e instanceof XRPCError) {
128049
128127
  if (e.error === "UnknownList")
128050
128128
  return new UnknownListError(e);
@@ -128058,7 +128136,7 @@ var NotFoundError = class extends XRPCError {
128058
128136
  super(src3.status, src3.error, src3.message, src3.headers);
128059
128137
  }
128060
128138
  };
128061
- function toKnownErr90(e) {
128139
+ function toKnownErr91(e) {
128062
128140
  if (e instanceof XRPCError) {
128063
128141
  if (e.error === "NotFound")
128064
128142
  return new NotFoundError(e);
@@ -128067,28 +128145,28 @@ function toKnownErr90(e) {
128067
128145
  }
128068
128146
 
128069
128147
  // ../api/src/client/types/app/bsky/feed/getPosts.ts
128070
- function toKnownErr91(e) {
128148
+ function toKnownErr92(e) {
128071
128149
  if (e instanceof XRPCError) {
128072
128150
  }
128073
128151
  return e;
128074
128152
  }
128075
128153
 
128076
128154
  // ../api/src/client/types/app/bsky/feed/getRepostedBy.ts
128077
- function toKnownErr92(e) {
128155
+ function toKnownErr93(e) {
128078
128156
  if (e instanceof XRPCError) {
128079
128157
  }
128080
128158
  return e;
128081
128159
  }
128082
128160
 
128083
128161
  // ../api/src/client/types/app/bsky/feed/getSuggestedFeeds.ts
128084
- function toKnownErr93(e) {
128162
+ function toKnownErr94(e) {
128085
128163
  if (e instanceof XRPCError) {
128086
128164
  }
128087
128165
  return e;
128088
128166
  }
128089
128167
 
128090
128168
  // ../api/src/client/types/app/bsky/feed/getTimeline.ts
128091
- function toKnownErr94(e) {
128169
+ function toKnownErr95(e) {
128092
128170
  if (e instanceof XRPCError) {
128093
128171
  }
128094
128172
  return e;
@@ -128100,7 +128178,7 @@ var BadQueryStringError = class extends XRPCError {
128100
128178
  super(src3.status, src3.error, src3.message, src3.headers);
128101
128179
  }
128102
128180
  };
128103
- function toKnownErr95(e) {
128181
+ function toKnownErr96(e) {
128104
128182
  if (e instanceof XRPCError) {
128105
128183
  if (e.error === "BadQueryString")
128106
128184
  return new BadQueryStringError(e);
@@ -128109,56 +128187,56 @@ function toKnownErr95(e) {
128109
128187
  }
128110
128188
 
128111
128189
  // ../api/src/client/types/app/bsky/graph/getBlocks.ts
128112
- function toKnownErr96(e) {
128190
+ function toKnownErr97(e) {
128113
128191
  if (e instanceof XRPCError) {
128114
128192
  }
128115
128193
  return e;
128116
128194
  }
128117
128195
 
128118
128196
  // ../api/src/client/types/app/bsky/graph/getFollowers.ts
128119
- function toKnownErr97(e) {
128197
+ function toKnownErr98(e) {
128120
128198
  if (e instanceof XRPCError) {
128121
128199
  }
128122
128200
  return e;
128123
128201
  }
128124
128202
 
128125
128203
  // ../api/src/client/types/app/bsky/graph/getFollows.ts
128126
- function toKnownErr98(e) {
128204
+ function toKnownErr99(e) {
128127
128205
  if (e instanceof XRPCError) {
128128
128206
  }
128129
128207
  return e;
128130
128208
  }
128131
128209
 
128132
128210
  // ../api/src/client/types/app/bsky/graph/getList.ts
128133
- function toKnownErr99(e) {
128211
+ function toKnownErr100(e) {
128134
128212
  if (e instanceof XRPCError) {
128135
128213
  }
128136
128214
  return e;
128137
128215
  }
128138
128216
 
128139
128217
  // ../api/src/client/types/app/bsky/graph/getListBlocks.ts
128140
- function toKnownErr100(e) {
128218
+ function toKnownErr101(e) {
128141
128219
  if (e instanceof XRPCError) {
128142
128220
  }
128143
128221
  return e;
128144
128222
  }
128145
128223
 
128146
128224
  // ../api/src/client/types/app/bsky/graph/getListMutes.ts
128147
- function toKnownErr101(e) {
128225
+ function toKnownErr102(e) {
128148
128226
  if (e instanceof XRPCError) {
128149
128227
  }
128150
128228
  return e;
128151
128229
  }
128152
128230
 
128153
128231
  // ../api/src/client/types/app/bsky/graph/getLists.ts
128154
- function toKnownErr102(e) {
128232
+ function toKnownErr103(e) {
128155
128233
  if (e instanceof XRPCError) {
128156
128234
  }
128157
128235
  return e;
128158
128236
  }
128159
128237
 
128160
128238
  // ../api/src/client/types/app/bsky/graph/getMutes.ts
128161
- function toKnownErr103(e) {
128239
+ function toKnownErr104(e) {
128162
128240
  if (e instanceof XRPCError) {
128163
128241
  }
128164
128242
  return e;
@@ -128170,7 +128248,7 @@ var ActorNotFoundError = class extends XRPCError {
128170
128248
  super(src3.status, src3.error, src3.message, src3.headers);
128171
128249
  }
128172
128250
  };
128173
- function toKnownErr104(e) {
128251
+ function toKnownErr105(e) {
128174
128252
  if (e instanceof XRPCError) {
128175
128253
  if (e.error === "ActorNotFound")
128176
128254
  return new ActorNotFoundError(e);
@@ -128179,92 +128257,78 @@ function toKnownErr104(e) {
128179
128257
  }
128180
128258
 
128181
128259
  // ../api/src/client/types/app/bsky/graph/getSuggestedFollowsByActor.ts
128182
- function toKnownErr105(e) {
128183
- if (e instanceof XRPCError) {
128184
- }
128185
- return e;
128186
- }
128187
-
128188
- // ../api/src/client/types/app/bsky/graph/muteActor.ts
128189
128260
  function toKnownErr106(e) {
128190
128261
  if (e instanceof XRPCError) {
128191
128262
  }
128192
128263
  return e;
128193
128264
  }
128194
128265
 
128195
- // ../api/src/client/types/app/bsky/graph/muteActorList.ts
128266
+ // ../api/src/client/types/app/bsky/graph/muteActor.ts
128196
128267
  function toKnownErr107(e) {
128197
128268
  if (e instanceof XRPCError) {
128198
128269
  }
128199
128270
  return e;
128200
128271
  }
128201
128272
 
128202
- // ../api/src/client/types/app/bsky/graph/unmuteActor.ts
128273
+ // ../api/src/client/types/app/bsky/graph/muteActorList.ts
128203
128274
  function toKnownErr108(e) {
128204
128275
  if (e instanceof XRPCError) {
128205
128276
  }
128206
128277
  return e;
128207
128278
  }
128208
128279
 
128209
- // ../api/src/client/types/app/bsky/graph/unmuteActorList.ts
128280
+ // ../api/src/client/types/app/bsky/graph/unmuteActor.ts
128210
128281
  function toKnownErr109(e) {
128211
128282
  if (e instanceof XRPCError) {
128212
128283
  }
128213
128284
  return e;
128214
128285
  }
128215
128286
 
128216
- // ../api/src/client/types/app/bsky/notification/getUnreadCount.ts
128287
+ // ../api/src/client/types/app/bsky/graph/unmuteActorList.ts
128217
128288
  function toKnownErr110(e) {
128218
128289
  if (e instanceof XRPCError) {
128219
128290
  }
128220
128291
  return e;
128221
128292
  }
128222
128293
 
128223
- // ../api/src/client/types/app/bsky/notification/listNotifications.ts
128294
+ // ../api/src/client/types/app/bsky/notification/getUnreadCount.ts
128224
128295
  function toKnownErr111(e) {
128225
128296
  if (e instanceof XRPCError) {
128226
128297
  }
128227
128298
  return e;
128228
128299
  }
128229
128300
 
128230
- // ../api/src/client/types/app/bsky/notification/registerPush.ts
128301
+ // ../api/src/client/types/app/bsky/notification/listNotifications.ts
128231
128302
  function toKnownErr112(e) {
128232
128303
  if (e instanceof XRPCError) {
128233
128304
  }
128234
128305
  return e;
128235
128306
  }
128236
128307
 
128237
- // ../api/src/client/types/app/bsky/notification/updateSeen.ts
128308
+ // ../api/src/client/types/app/bsky/notification/registerPush.ts
128238
128309
  function toKnownErr113(e) {
128239
128310
  if (e instanceof XRPCError) {
128240
128311
  }
128241
128312
  return e;
128242
128313
  }
128243
128314
 
128244
- // ../api/src/client/types/app/bsky/unspecced/getPopularFeedGenerators.ts
128315
+ // ../api/src/client/types/app/bsky/notification/updateSeen.ts
128245
128316
  function toKnownErr114(e) {
128246
128317
  if (e instanceof XRPCError) {
128247
128318
  }
128248
128319
  return e;
128249
128320
  }
128250
128321
 
128251
- // ../api/src/client/types/app/bsky/unspecced/getTaggedSuggestions.ts
128322
+ // ../api/src/client/types/app/bsky/unspecced/getPopularFeedGenerators.ts
128252
128323
  function toKnownErr115(e) {
128253
128324
  if (e instanceof XRPCError) {
128254
128325
  }
128255
128326
  return e;
128256
128327
  }
128257
128328
 
128258
- // ../api/src/client/types/app/bsky/unspecced/getTimelineSkeleton.ts
128259
- var UnknownFeedError3 = class extends XRPCError {
128260
- constructor(src3) {
128261
- super(src3.status, src3.error, src3.message, src3.headers);
128262
- }
128263
- };
128329
+ // ../api/src/client/types/app/bsky/unspecced/getTaggedSuggestions.ts
128264
128330
  function toKnownErr116(e) {
128265
128331
  if (e instanceof XRPCError) {
128266
- if (e.error === "UnknownFeed")
128267
- return new UnknownFeedError3(e);
128268
128332
  }
128269
128333
  return e;
128270
128334
  }
@@ -128711,29 +128775,34 @@ var ComAtprotoTempNS2 = class {
128711
128775
  constructor(service2) {
128712
128776
  this._service = service2;
128713
128777
  }
128778
+ checkSignupQueue(params2, opts) {
128779
+ return this._service.xrpc.call("com.atproto.temp.checkSignupQueue", params2, void 0, opts).catch((e) => {
128780
+ throw toKnownErr68(e);
128781
+ });
128782
+ }
128714
128783
  fetchLabels(params2, opts) {
128715
128784
  return this._service.xrpc.call("com.atproto.temp.fetchLabels", params2, void 0, opts).catch((e) => {
128716
- throw toKnownErr68(e);
128785
+ throw toKnownErr69(e);
128717
128786
  });
128718
128787
  }
128719
128788
  importRepo(data, opts) {
128720
128789
  return this._service.xrpc.call("com.atproto.temp.importRepo", opts?.qp, data, opts).catch((e) => {
128721
- throw toKnownErr69(e);
128790
+ throw toKnownErr70(e);
128722
128791
  });
128723
128792
  }
128724
128793
  pushBlob(data, opts) {
128725
128794
  return this._service.xrpc.call("com.atproto.temp.pushBlob", opts?.qp, data, opts).catch((e) => {
128726
- throw toKnownErr70(e);
128795
+ throw toKnownErr71(e);
128727
128796
  });
128728
128797
  }
128729
128798
  requestPhoneVerification(data, opts) {
128730
128799
  return this._service.xrpc.call("com.atproto.temp.requestPhoneVerification", opts?.qp, data, opts).catch((e) => {
128731
- throw toKnownErr71(e);
128800
+ throw toKnownErr72(e);
128732
128801
  });
128733
128802
  }
128734
128803
  transferAccount(data, opts) {
128735
128804
  return this._service.xrpc.call("com.atproto.temp.transferAccount", opts?.qp, data, opts).catch((e) => {
128736
- throw toKnownErr72(e);
128805
+ throw toKnownErr73(e);
128737
128806
  });
128738
128807
  }
128739
128808
  };
@@ -128762,37 +128831,37 @@ var AppBskyActorNS2 = class {
128762
128831
  }
128763
128832
  getPreferences(params2, opts) {
128764
128833
  return this._service.xrpc.call("app.bsky.actor.getPreferences", params2, void 0, opts).catch((e) => {
128765
- throw toKnownErr73(e);
128834
+ throw toKnownErr74(e);
128766
128835
  });
128767
128836
  }
128768
128837
  getProfile(params2, opts) {
128769
128838
  return this._service.xrpc.call("app.bsky.actor.getProfile", params2, void 0, opts).catch((e) => {
128770
- throw toKnownErr74(e);
128839
+ throw toKnownErr75(e);
128771
128840
  });
128772
128841
  }
128773
128842
  getProfiles(params2, opts) {
128774
128843
  return this._service.xrpc.call("app.bsky.actor.getProfiles", params2, void 0, opts).catch((e) => {
128775
- throw toKnownErr75(e);
128844
+ throw toKnownErr76(e);
128776
128845
  });
128777
128846
  }
128778
128847
  getSuggestions(params2, opts) {
128779
128848
  return this._service.xrpc.call("app.bsky.actor.getSuggestions", params2, void 0, opts).catch((e) => {
128780
- throw toKnownErr76(e);
128849
+ throw toKnownErr77(e);
128781
128850
  });
128782
128851
  }
128783
128852
  putPreferences(data, opts) {
128784
128853
  return this._service.xrpc.call("app.bsky.actor.putPreferences", opts?.qp, data, opts).catch((e) => {
128785
- throw toKnownErr77(e);
128854
+ throw toKnownErr78(e);
128786
128855
  });
128787
128856
  }
128788
128857
  searchActors(params2, opts) {
128789
128858
  return this._service.xrpc.call("app.bsky.actor.searchActors", params2, void 0, opts).catch((e) => {
128790
- throw toKnownErr78(e);
128859
+ throw toKnownErr79(e);
128791
128860
  });
128792
128861
  }
128793
128862
  searchActorsTypeahead(params2, opts) {
128794
128863
  return this._service.xrpc.call("app.bsky.actor.searchActorsTypeahead", params2, void 0, opts).catch((e) => {
128795
- throw toKnownErr79(e);
128864
+ throw toKnownErr80(e);
128796
128865
  });
128797
128866
  }
128798
128867
  };
@@ -128839,82 +128908,82 @@ var AppBskyFeedNS2 = class {
128839
128908
  }
128840
128909
  describeFeedGenerator(params2, opts) {
128841
128910
  return this._service.xrpc.call("app.bsky.feed.describeFeedGenerator", params2, void 0, opts).catch((e) => {
128842
- throw toKnownErr80(e);
128911
+ throw toKnownErr81(e);
128843
128912
  });
128844
128913
  }
128845
128914
  getActorFeeds(params2, opts) {
128846
128915
  return this._service.xrpc.call("app.bsky.feed.getActorFeeds", params2, void 0, opts).catch((e) => {
128847
- throw toKnownErr81(e);
128916
+ throw toKnownErr82(e);
128848
128917
  });
128849
128918
  }
128850
128919
  getActorLikes(params2, opts) {
128851
128920
  return this._service.xrpc.call("app.bsky.feed.getActorLikes", params2, void 0, opts).catch((e) => {
128852
- throw toKnownErr82(e);
128921
+ throw toKnownErr83(e);
128853
128922
  });
128854
128923
  }
128855
128924
  getAuthorFeed(params2, opts) {
128856
128925
  return this._service.xrpc.call("app.bsky.feed.getAuthorFeed", params2, void 0, opts).catch((e) => {
128857
- throw toKnownErr83(e);
128926
+ throw toKnownErr84(e);
128858
128927
  });
128859
128928
  }
128860
128929
  getFeed(params2, opts) {
128861
128930
  return this._service.xrpc.call("app.bsky.feed.getFeed", params2, void 0, opts).catch((e) => {
128862
- throw toKnownErr84(e);
128931
+ throw toKnownErr85(e);
128863
128932
  });
128864
128933
  }
128865
128934
  getFeedGenerator(params2, opts) {
128866
128935
  return this._service.xrpc.call("app.bsky.feed.getFeedGenerator", params2, void 0, opts).catch((e) => {
128867
- throw toKnownErr85(e);
128936
+ throw toKnownErr86(e);
128868
128937
  });
128869
128938
  }
128870
128939
  getFeedGenerators(params2, opts) {
128871
128940
  return this._service.xrpc.call("app.bsky.feed.getFeedGenerators", params2, void 0, opts).catch((e) => {
128872
- throw toKnownErr86(e);
128941
+ throw toKnownErr87(e);
128873
128942
  });
128874
128943
  }
128875
128944
  getFeedSkeleton(params2, opts) {
128876
128945
  return this._service.xrpc.call("app.bsky.feed.getFeedSkeleton", params2, void 0, opts).catch((e) => {
128877
- throw toKnownErr87(e);
128946
+ throw toKnownErr88(e);
128878
128947
  });
128879
128948
  }
128880
128949
  getLikes(params2, opts) {
128881
128950
  return this._service.xrpc.call("app.bsky.feed.getLikes", params2, void 0, opts).catch((e) => {
128882
- throw toKnownErr88(e);
128951
+ throw toKnownErr89(e);
128883
128952
  });
128884
128953
  }
128885
128954
  getListFeed(params2, opts) {
128886
128955
  return this._service.xrpc.call("app.bsky.feed.getListFeed", params2, void 0, opts).catch((e) => {
128887
- throw toKnownErr89(e);
128956
+ throw toKnownErr90(e);
128888
128957
  });
128889
128958
  }
128890
128959
  getPostThread(params2, opts) {
128891
128960
  return this._service.xrpc.call("app.bsky.feed.getPostThread", params2, void 0, opts).catch((e) => {
128892
- throw toKnownErr90(e);
128961
+ throw toKnownErr91(e);
128893
128962
  });
128894
128963
  }
128895
128964
  getPosts(params2, opts) {
128896
128965
  return this._service.xrpc.call("app.bsky.feed.getPosts", params2, void 0, opts).catch((e) => {
128897
- throw toKnownErr91(e);
128966
+ throw toKnownErr92(e);
128898
128967
  });
128899
128968
  }
128900
128969
  getRepostedBy(params2, opts) {
128901
128970
  return this._service.xrpc.call("app.bsky.feed.getRepostedBy", params2, void 0, opts).catch((e) => {
128902
- throw toKnownErr92(e);
128971
+ throw toKnownErr93(e);
128903
128972
  });
128904
128973
  }
128905
128974
  getSuggestedFeeds(params2, opts) {
128906
128975
  return this._service.xrpc.call("app.bsky.feed.getSuggestedFeeds", params2, void 0, opts).catch((e) => {
128907
- throw toKnownErr93(e);
128976
+ throw toKnownErr94(e);
128908
128977
  });
128909
128978
  }
128910
128979
  getTimeline(params2, opts) {
128911
128980
  return this._service.xrpc.call("app.bsky.feed.getTimeline", params2, void 0, opts).catch((e) => {
128912
- throw toKnownErr94(e);
128981
+ throw toKnownErr95(e);
128913
128982
  });
128914
128983
  }
128915
128984
  searchPosts(params2, opts) {
128916
128985
  return this._service.xrpc.call("app.bsky.feed.searchPosts", params2, void 0, opts).catch((e) => {
128917
- throw toKnownErr95(e);
128986
+ throw toKnownErr96(e);
128918
128987
  });
128919
128988
  }
128920
128989
  };
@@ -129064,72 +129133,72 @@ var AppBskyGraphNS2 = class {
129064
129133
  }
129065
129134
  getBlocks(params2, opts) {
129066
129135
  return this._service.xrpc.call("app.bsky.graph.getBlocks", params2, void 0, opts).catch((e) => {
129067
- throw toKnownErr96(e);
129136
+ throw toKnownErr97(e);
129068
129137
  });
129069
129138
  }
129070
129139
  getFollowers(params2, opts) {
129071
129140
  return this._service.xrpc.call("app.bsky.graph.getFollowers", params2, void 0, opts).catch((e) => {
129072
- throw toKnownErr97(e);
129141
+ throw toKnownErr98(e);
129073
129142
  });
129074
129143
  }
129075
129144
  getFollows(params2, opts) {
129076
129145
  return this._service.xrpc.call("app.bsky.graph.getFollows", params2, void 0, opts).catch((e) => {
129077
- throw toKnownErr98(e);
129146
+ throw toKnownErr99(e);
129078
129147
  });
129079
129148
  }
129080
129149
  getList(params2, opts) {
129081
129150
  return this._service.xrpc.call("app.bsky.graph.getList", params2, void 0, opts).catch((e) => {
129082
- throw toKnownErr99(e);
129151
+ throw toKnownErr100(e);
129083
129152
  });
129084
129153
  }
129085
129154
  getListBlocks(params2, opts) {
129086
129155
  return this._service.xrpc.call("app.bsky.graph.getListBlocks", params2, void 0, opts).catch((e) => {
129087
- throw toKnownErr100(e);
129156
+ throw toKnownErr101(e);
129088
129157
  });
129089
129158
  }
129090
129159
  getListMutes(params2, opts) {
129091
129160
  return this._service.xrpc.call("app.bsky.graph.getListMutes", params2, void 0, opts).catch((e) => {
129092
- throw toKnownErr101(e);
129161
+ throw toKnownErr102(e);
129093
129162
  });
129094
129163
  }
129095
129164
  getLists(params2, opts) {
129096
129165
  return this._service.xrpc.call("app.bsky.graph.getLists", params2, void 0, opts).catch((e) => {
129097
- throw toKnownErr102(e);
129166
+ throw toKnownErr103(e);
129098
129167
  });
129099
129168
  }
129100
129169
  getMutes(params2, opts) {
129101
129170
  return this._service.xrpc.call("app.bsky.graph.getMutes", params2, void 0, opts).catch((e) => {
129102
- throw toKnownErr103(e);
129171
+ throw toKnownErr104(e);
129103
129172
  });
129104
129173
  }
129105
129174
  getRelationships(params2, opts) {
129106
129175
  return this._service.xrpc.call("app.bsky.graph.getRelationships", params2, void 0, opts).catch((e) => {
129107
- throw toKnownErr104(e);
129176
+ throw toKnownErr105(e);
129108
129177
  });
129109
129178
  }
129110
129179
  getSuggestedFollowsByActor(params2, opts) {
129111
129180
  return this._service.xrpc.call("app.bsky.graph.getSuggestedFollowsByActor", params2, void 0, opts).catch((e) => {
129112
- throw toKnownErr105(e);
129181
+ throw toKnownErr106(e);
129113
129182
  });
129114
129183
  }
129115
129184
  muteActor(data, opts) {
129116
129185
  return this._service.xrpc.call("app.bsky.graph.muteActor", opts?.qp, data, opts).catch((e) => {
129117
- throw toKnownErr106(e);
129186
+ throw toKnownErr107(e);
129118
129187
  });
129119
129188
  }
129120
129189
  muteActorList(data, opts) {
129121
129190
  return this._service.xrpc.call("app.bsky.graph.muteActorList", opts?.qp, data, opts).catch((e) => {
129122
- throw toKnownErr107(e);
129191
+ throw toKnownErr108(e);
129123
129192
  });
129124
129193
  }
129125
129194
  unmuteActor(data, opts) {
129126
129195
  return this._service.xrpc.call("app.bsky.graph.unmuteActor", opts?.qp, data, opts).catch((e) => {
129127
- throw toKnownErr108(e);
129196
+ throw toKnownErr109(e);
129128
129197
  });
129129
129198
  }
129130
129199
  unmuteActorList(data, opts) {
129131
129200
  return this._service.xrpc.call("app.bsky.graph.unmuteActorList", opts?.qp, data, opts).catch((e) => {
129132
- throw toKnownErr109(e);
129201
+ throw toKnownErr110(e);
129133
129202
  });
129134
129203
  }
129135
129204
  };
@@ -129274,22 +129343,22 @@ var AppBskyNotificationNS2 = class {
129274
129343
  }
129275
129344
  getUnreadCount(params2, opts) {
129276
129345
  return this._service.xrpc.call("app.bsky.notification.getUnreadCount", params2, void 0, opts).catch((e) => {
129277
- throw toKnownErr110(e);
129346
+ throw toKnownErr111(e);
129278
129347
  });
129279
129348
  }
129280
129349
  listNotifications(params2, opts) {
129281
129350
  return this._service.xrpc.call("app.bsky.notification.listNotifications", params2, void 0, opts).catch((e) => {
129282
- throw toKnownErr111(e);
129351
+ throw toKnownErr112(e);
129283
129352
  });
129284
129353
  }
129285
129354
  registerPush(data, opts) {
129286
129355
  return this._service.xrpc.call("app.bsky.notification.registerPush", opts?.qp, data, opts).catch((e) => {
129287
- throw toKnownErr112(e);
129356
+ throw toKnownErr113(e);
129288
129357
  });
129289
129358
  }
129290
129359
  updateSeen(data, opts) {
129291
129360
  return this._service.xrpc.call("app.bsky.notification.updateSeen", opts?.qp, data, opts).catch((e) => {
129292
- throw toKnownErr113(e);
129361
+ throw toKnownErr114(e);
129293
129362
  });
129294
129363
  }
129295
129364
  };
@@ -129304,16 +129373,11 @@ var AppBskyUnspeccedNS2 = class {
129304
129373
  }
129305
129374
  getPopularFeedGenerators(params2, opts) {
129306
129375
  return this._service.xrpc.call("app.bsky.unspecced.getPopularFeedGenerators", params2, void 0, opts).catch((e) => {
129307
- throw toKnownErr114(e);
129376
+ throw toKnownErr115(e);
129308
129377
  });
129309
129378
  }
129310
129379
  getTaggedSuggestions(params2, opts) {
129311
129380
  return this._service.xrpc.call("app.bsky.unspecced.getTaggedSuggestions", params2, void 0, opts).catch((e) => {
129312
- throw toKnownErr115(e);
129313
- });
129314
- }
129315
- getTimelineSkeleton(params2, opts) {
129316
- return this._service.xrpc.call("app.bsky.unspecced.getTimelineSkeleton", params2, void 0, opts).catch((e) => {
129317
129381
  throw toKnownErr116(e);
129318
129382
  });
129319
129383
  }
@@ -129449,12 +129513,12 @@ var _AtpAgent = class {
129449
129513
  await this._refreshSessionPromise;
129450
129514
  let res = await _AtpAgent.fetch(reqUri, reqMethod, this._addAuthHeader(reqHeaders), reqBody);
129451
129515
  if (isErrorResponse(res, ["ExpiredToken"]) && this.session?.refreshJwt) {
129452
- await this._refreshSession();
129516
+ await this.refreshSession();
129453
129517
  res = await _AtpAgent.fetch(reqUri, reqMethod, this._addAuthHeader(reqHeaders), reqBody);
129454
129518
  }
129455
129519
  return res;
129456
129520
  }
129457
- async _refreshSession() {
129521
+ async refreshSession() {
129458
129522
  if (this._refreshSessionPromise) {
129459
129523
  return this._refreshSessionPromise;
129460
129524
  }
@@ -130469,7 +130533,8 @@ var import_stream8 = require("stream");
130469
130533
  var migrations_exports = {};
130470
130534
  __export(migrations_exports, {
130471
130535
  _20231219T205730722Z: () => T205730722Z_init_exports,
130472
- _20240116T085607200Z: () => T085607200Z_communication_template_exports
130536
+ _20240116T085607200Z: () => T085607200Z_communication_template_exports,
130537
+ _20240201T051104136Z: () => T051104136Z_mod_event_blobs_exports
130473
130538
  });
130474
130539
 
130475
130540
  // src/db/migrations/20231219T205730722Z-init.ts
@@ -130527,6 +130592,19 @@ async function down2(db) {
130527
130592
  await db.schema.dropTable("communication_template");
130528
130593
  }
130529
130594
 
130595
+ // src/db/migrations/20240201T051104136Z-mod-event-blobs.ts
130596
+ var T051104136Z_mod_event_blobs_exports = {};
130597
+ __export(T051104136Z_mod_event_blobs_exports, {
130598
+ down: () => down3,
130599
+ up: () => up3
130600
+ });
130601
+ async function up3(db) {
130602
+ await db.schema.alterTable("moderation_event").addColumn("subjectBlobCids", "jsonb").execute();
130603
+ }
130604
+ async function down3(db) {
130605
+ await db.schema.alterTable("moderation_event").dropColumn("subjectBlobCids").execute();
130606
+ }
130607
+
130530
130608
  // src/db/migrations/provider.ts
130531
130609
  var CtxMigrationProvider = class {
130532
130610
  constructor(migrations, ctx) {
@@ -130727,7 +130805,7 @@ var ModerationViews = class {
130727
130805
  comment: event.comment ?? void 0
130728
130806
  },
130729
130807
  subject: subjectFromEventRow(event).lex(),
130730
- subjectBlobCids: [],
130808
+ subjectBlobCids: event.subjectBlobCids ?? [],
130731
130809
  createdBy: event.createdBy,
130732
130810
  createdAt: event.createdAt,
130733
130811
  subjectHandle: event.subjectHandle ?? void 0,
@@ -131054,6 +131132,13 @@ function getSelfLabels(details) {
131054
131132
  });
131055
131133
  }
131056
131134
 
131135
+ // src/db/types.ts
131136
+ var jsonb = (val) => {
131137
+ if (val === null)
131138
+ return sql`null`;
131139
+ return sql`${JSON.stringify(val)}::jsonb`;
131140
+ };
131141
+
131057
131142
  // src/mod-service/status.ts
131058
131143
  var getSubjectStatusForModerationEvent = ({
131059
131144
  action,
@@ -131178,7 +131263,7 @@ var adjustModerationSubjectStatus = async (db, moderationEvent, blobCids) => {
131178
131263
  subjectStatus.comment = comment;
131179
131264
  }
131180
131265
  if (blobCids?.length) {
131181
- const newBlobCids = sql`${JSON.stringify(blobCids)}`;
131266
+ const newBlobCids = jsonb(blobCids);
131182
131267
  newStatus.blobCids = newBlobCids;
131183
131268
  subjectStatus.blobCids = newBlobCids;
131184
131269
  }
@@ -131351,16 +131436,17 @@ var paginate = (qb, opts) => {
131351
131436
 
131352
131437
  // src/mod-service/index.ts
131353
131438
  var ModerationService = class {
131354
- constructor(db, backgroundQueue, eventPusher, appviewAgent, appviewAuth) {
131439
+ constructor(db, backgroundQueue, eventPusher, appviewAgent, appviewAuth, serverDid) {
131355
131440
  this.db = db;
131356
131441
  this.backgroundQueue = backgroundQueue;
131357
131442
  this.eventPusher = eventPusher;
131358
131443
  this.appviewAgent = appviewAgent;
131359
131444
  this.appviewAuth = appviewAuth;
131445
+ this.serverDid = serverDid;
131360
131446
  this.views = new ModerationViews(this.db, this.appviewAgent, this.appviewAuth);
131361
131447
  }
131362
- static creator(backgroundQueue, eventPusher, appviewAgent, appviewAuth) {
131363
- return (db) => new ModerationService(db, backgroundQueue, eventPusher, appviewAgent, appviewAuth);
131448
+ static creator(backgroundQueue, eventPusher, appviewAgent, appviewAuth, serverDid) {
131449
+ return (db) => new ModerationService(db, backgroundQueue, eventPusher, appviewAgent, appviewAuth, serverDid);
131364
131450
  }
131365
131451
  async getEvent(id) {
131366
131452
  return await this.db.db.selectFrom("moderation_event").selectAll().where("id", "=", id).executeTakeFirst();
@@ -131379,7 +131465,14 @@ var ModerationService = class {
131379
131465
  cursor,
131380
131466
  includeAllUserRecords,
131381
131467
  sortDirection = "desc",
131382
- types
131468
+ types,
131469
+ hasComment,
131470
+ comment,
131471
+ createdAfter,
131472
+ createdBefore,
131473
+ addedLabels,
131474
+ removedLabels,
131475
+ reportTypes
131383
131476
  } = opts;
131384
131477
  let builder = this.db.db.selectFrom("moderation_event").selectAll();
131385
131478
  if (subject) {
@@ -131405,6 +131498,31 @@ var ModerationService = class {
131405
131498
  if (createdBy) {
131406
131499
  builder = builder.where("createdBy", "=", createdBy);
131407
131500
  }
131501
+ if (createdAfter) {
131502
+ builder = builder.where("createdAt", ">=", createdAfter);
131503
+ }
131504
+ if (createdBefore) {
131505
+ builder = builder.where("createdAt", "<=", createdBefore);
131506
+ }
131507
+ if (comment) {
131508
+ builder = builder.where("comment", "ilike", `%${comment}%`);
131509
+ }
131510
+ if (hasComment) {
131511
+ builder = builder.where("comment", "is not", null);
131512
+ }
131513
+ if (addedLabels.length) {
131514
+ addedLabels.forEach((label) => {
131515
+ builder = builder.where("createLabelVals", "ilike", `%${label}%`);
131516
+ });
131517
+ }
131518
+ if (removedLabels.length) {
131519
+ removedLabels.forEach((label) => {
131520
+ builder = builder.where("negateLabelVals", "ilike", `%${label}%`);
131521
+ });
131522
+ }
131523
+ if (reportTypes?.length) {
131524
+ builder = builder.where(sql`meta->>'reportType'`, "in", reportTypes);
131525
+ }
131408
131526
  const { ref } = this.db.db.dynamic;
131409
131527
  const keyset = new TimeIdKeyset(ref(`moderation_event.createdAt`), ref("moderation_event.id"));
131410
131528
  const paginatedBuilder = paginate(builder, {
@@ -131453,6 +131571,7 @@ var ModerationService = class {
131453
131571
  if (isModEventEmail(event)) {
131454
131572
  meta.subjectLine = event.subjectLine;
131455
131573
  }
131574
+ const subjectInfo = subject.info();
131456
131575
  const modEvent = await this.db.db.insertInto("moderation_event").values({
131457
131576
  comment: event.comment ? `${event.comment}` : null,
131458
131577
  action: event.$type,
@@ -131463,7 +131582,11 @@ var ModerationService = class {
131463
131582
  durationInHours: event.durationInHours ? Number(event.durationInHours) : null,
131464
131583
  meta,
131465
131584
  expiresAt: (isModEventTakedown(event) || isModEventMute(event)) && event.durationInHours ? addHoursToDate(event.durationInHours, createdAt).toISOString() : void 0,
131466
- ...subject.info()
131585
+ subjectType: subjectInfo.subjectType,
131586
+ subjectDid: subjectInfo.subjectDid,
131587
+ subjectUri: subjectInfo.subjectUri,
131588
+ subjectCid: subjectInfo.subjectCid,
131589
+ subjectBlobCids: jsonb(subjectInfo.subjectBlobCids)
131467
131590
  }).returningAll().executeTakeFirstOrThrow();
131468
131591
  await adjustModerationSubjectStatus(this.db, modEvent, subject.blobCids);
131469
131592
  return modEvent;
@@ -131531,12 +131654,17 @@ var ModerationService = class {
131531
131654
  subjectDid: subject.did,
131532
131655
  takedownRef
131533
131656
  }));
131534
- const repoEvts = await this.db.db.insertInto("repo_push_event").values(values).onConflict((oc) => oc.columns(["subjectDid", "eventType"]).doUpdateSet({
131535
- takedownRef,
131536
- confirmedAt: null,
131537
- attempts: 0,
131538
- lastAttempted: null
131539
- })).returning("id").execute();
131657
+ const [repoEvts] = await Promise.all([
131658
+ this.db.db.insertInto("repo_push_event").values(values).onConflict((oc) => oc.columns(["subjectDid", "eventType"]).doUpdateSet({
131659
+ takedownRef,
131660
+ confirmedAt: null,
131661
+ attempts: 0,
131662
+ lastAttempted: null
131663
+ })).returning("id").execute(),
131664
+ this.formatAndCreateLabels(subject.did, null, {
131665
+ create: [UNSPECCED_TAKEDOWN_LABEL]
131666
+ })
131667
+ ]);
131540
131668
  this.db.onCommit(() => {
131541
131669
  this.backgroundQueue.add(async () => {
131542
131670
  await Promise.all(repoEvts.map((evt) => this.eventPusher.attemptRepoEvent(evt.id)));
@@ -131544,12 +131672,17 @@ var ModerationService = class {
131544
131672
  });
131545
131673
  }
131546
131674
  async reverseTakedownRepo(subject) {
131547
- const repoEvts = await this.db.db.updateTable("repo_push_event").where("eventType", "in", TAKEDOWNS).where("subjectDid", "=", subject.did).set({
131548
- takedownRef: null,
131549
- confirmedAt: null,
131550
- attempts: 0,
131551
- lastAttempted: null
131552
- }).returning("id").execute();
131675
+ const [repoEvts] = await Promise.all([
131676
+ this.db.db.updateTable("repo_push_event").where("eventType", "in", TAKEDOWNS).where("subjectDid", "=", subject.did).set({
131677
+ takedownRef: null,
131678
+ confirmedAt: null,
131679
+ attempts: 0,
131680
+ lastAttempted: null
131681
+ }).returning("id").execute(),
131682
+ this.formatAndCreateLabels(subject.did, null, {
131683
+ negate: [UNSPECCED_TAKEDOWN_LABEL]
131684
+ })
131685
+ ]);
131553
131686
  this.db.onCommit(() => {
131554
131687
  this.backgroundQueue.add(async () => {
131555
131688
  await Promise.all(repoEvts.map((evt) => this.eventPusher.attemptRepoEvent(evt.id)));
@@ -131566,18 +131699,25 @@ var ModerationService = class {
131566
131699
  subjectCid: subject.cid,
131567
131700
  takedownRef
131568
131701
  }));
131569
- const recordEvts = await this.db.db.insertInto("record_push_event").values(values).onConflict((oc) => oc.columns(["subjectUri", "eventType"]).doUpdateSet({
131570
- takedownRef,
131571
- confirmedAt: null,
131572
- attempts: 0,
131573
- lastAttempted: null
131574
- })).returning("id").execute();
131702
+ const blobCids = subject.blobCids;
131703
+ const labels = [UNSPECCED_TAKEDOWN_LABEL];
131704
+ if (blobCids && blobCids.length > 0) {
131705
+ labels.push(UNSPECCED_TAKEDOWN_BLOBS_LABEL);
131706
+ }
131707
+ const [recordEvts] = await Promise.all([
131708
+ this.db.db.insertInto("record_push_event").values(values).onConflict((oc) => oc.columns(["subjectUri", "eventType"]).doUpdateSet({
131709
+ takedownRef,
131710
+ confirmedAt: null,
131711
+ attempts: 0,
131712
+ lastAttempted: null
131713
+ })).returning("id").execute(),
131714
+ this.formatAndCreateLabels(subject.uri, subject.cid, { create: labels })
131715
+ ]);
131575
131716
  this.db.onCommit(() => {
131576
131717
  this.backgroundQueue.add(async () => {
131577
131718
  await Promise.all(recordEvts.map((evt) => this.eventPusher.attemptRecordEvent(evt.id)));
131578
131719
  });
131579
131720
  });
131580
- const blobCids = subject.blobCids;
131581
131721
  if (blobCids && blobCids.length > 0) {
131582
131722
  const blobValues = [];
131583
131723
  for (const eventType of TAKEDOWNS) {
@@ -131605,18 +131745,25 @@ var ModerationService = class {
131605
131745
  }
131606
131746
  async reverseTakedownRecord(subject) {
131607
131747
  this.db.assertTransaction();
131608
- const recordEvts = await this.db.db.updateTable("record_push_event").where("eventType", "in", TAKEDOWNS).where("subjectDid", "=", subject.did).where("subjectUri", "=", subject.uri).set({
131609
- takedownRef: null,
131610
- confirmedAt: null,
131611
- attempts: 0,
131612
- lastAttempted: null
131613
- }).returning("id").execute();
131748
+ const labels = [UNSPECCED_TAKEDOWN_LABEL];
131749
+ const blobCids = subject.blobCids;
131750
+ if (blobCids && blobCids.length > 0) {
131751
+ labels.push(UNSPECCED_TAKEDOWN_BLOBS_LABEL);
131752
+ }
131753
+ const [recordEvts] = await Promise.all([
131754
+ this.db.db.updateTable("record_push_event").where("eventType", "in", TAKEDOWNS).where("subjectDid", "=", subject.did).where("subjectUri", "=", subject.uri).set({
131755
+ takedownRef: null,
131756
+ confirmedAt: null,
131757
+ attempts: 0,
131758
+ lastAttempted: null
131759
+ }).returning("id").execute(),
131760
+ this.formatAndCreateLabels(subject.uri, subject.cid, { negate: labels })
131761
+ ]);
131614
131762
  this.db.onCommit(() => {
131615
131763
  this.backgroundQueue.add(async () => {
131616
131764
  await Promise.all(recordEvts.map((evt) => this.eventPusher.attemptRecordEvent(evt.id)));
131617
131765
  });
131618
131766
  });
131619
- const blobCids = subject.blobCids;
131620
131767
  if (blobCids && blobCids.length > 0) {
131621
131768
  const blobEvts = await this.db.db.updateTable("blob_push_event").where("eventType", "in", TAKEDOWNS).where("subjectDid", "=", subject.did).where("subjectBlobCid", "in", blobCids.map((c) => c.toString())).set({
131622
131769
  takedownRef: null,
@@ -131724,15 +131871,14 @@ var ModerationService = class {
131724
131871
  cursor: keyset.packFromResult(results)
131725
131872
  };
131726
131873
  }
131727
- async isSubjectTakendown(subject) {
131728
- const builder = this.db.db.selectFrom("moderation_subject_status").where("did", "=", subject.did).where("recordPath", "=", subject.recordPath || "");
131729
- const result = await builder.select("takendown").executeTakeFirst();
131730
- return !!result?.takendown;
131874
+ async getStatus(subject) {
131875
+ const result = await this.db.db.selectFrom("moderation_subject_status").where("did", "=", subject.did).where("recordPath", "=", subject.recordPath ?? "").selectAll().executeTakeFirst();
131876
+ return result ?? null;
131731
131877
  }
131732
- async formatAndCreateLabels(src3, uri2, cid2, labels) {
131878
+ async formatAndCreateLabels(uri2, cid2, labels) {
131733
131879
  const { create: create2 = [], negate = [] } = labels;
131734
131880
  const toCreate = create2.map((val) => ({
131735
- src: src3,
131881
+ src: this.serverDid,
131736
131882
  uri: uri2,
131737
131883
  cid: cid2 ?? void 0,
131738
131884
  val,
@@ -131740,7 +131886,7 @@ var ModerationService = class {
131740
131886
  cts: new Date().toISOString()
131741
131887
  }));
131742
131888
  const toNegate = negate.map((val) => ({
131743
- src: src3,
131889
+ src: this.serverDid,
131744
131890
  uri: uri2,
131745
131891
  cid: cid2 ?? void 0,
131746
131892
  val,
@@ -132160,7 +132306,7 @@ var DaemonContext = class {
132160
132306
  pds: cfg.pds ?? void 0
132161
132307
  });
132162
132308
  const backgroundQueue = new BackgroundQueue(db);
132163
- const modService = ModerationService.creator(backgroundQueue, eventPusher, appviewAgent, appviewAuth);
132309
+ const modService = ModerationService.creator(backgroundQueue, eventPusher, appviewAgent, appviewAuth, cfg.service.did);
132164
132310
  const eventReverser = new EventReverser(db, modService);
132165
132311
  return new DaemonContext({
132166
132312
  db,
@@ -132305,7 +132451,7 @@ var AppContext = class {
132305
132451
  appview: cfg.appview,
132306
132452
  pds: cfg.pds ?? void 0
132307
132453
  });
132308
- const modService = ModerationService.creator(backgroundQueue, eventPusher, appviewAgent, appviewAuth);
132454
+ const modService = ModerationService.creator(backgroundQueue, eventPusher, appviewAgent, appviewAuth, cfg.service.did);
132309
132455
  const communicationTemplateService = CommunicationTemplateService.creator();
132310
132456
  const idResolver = new IdResolver({
132311
132457
  plcUrl: cfg.identity.plcUrl