@atproto/ozone 0.0.16 → 0.0.17-next.0

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 (66) hide show
  1. package/dist/api/moderation/util.d.ts +1 -1
  2. package/dist/auth-verifier.d.ts +7 -11
  3. package/dist/config/config.d.ts +1 -0
  4. package/dist/config/env.d.ts +1 -2
  5. package/dist/config/secrets.d.ts +0 -2
  6. package/dist/daemon/event-pusher.d.ts +2 -0
  7. package/dist/db/index.js.map +1 -1
  8. package/dist/db/schema/moderation_subject_status.d.ts +2 -2
  9. package/dist/index.js +821 -1055
  10. package/dist/index.js.map +3 -3
  11. package/dist/lexicon/index.d.ts +8 -0
  12. package/dist/lexicon/lexicons.d.ts +298 -0
  13. package/dist/lexicon/types/app/bsky/actor/defs.d.ts +23 -1
  14. package/dist/lexicon/types/app/bsky/embed/record.d.ts +2 -1
  15. package/dist/lexicon/types/app/bsky/labeler/defs.d.ts +41 -0
  16. package/dist/lexicon/types/app/bsky/labeler/getServices.d.ts +36 -0
  17. package/dist/lexicon/types/app/bsky/labeler/service.d.ts +14 -0
  18. package/dist/lexicon/types/com/atproto/admin/defs.d.ts +2 -1
  19. package/dist/lexicon/types/com/atproto/label/defs.d.ts +18 -0
  20. package/dist/mod-service/index.d.ts +2 -2
  21. package/package.json +5 -4
  22. package/src/api/admin/createCommunicationTemplate.ts +1 -1
  23. package/src/api/admin/deleteCommunicationTemplate.ts +1 -1
  24. package/src/api/admin/emitModerationEvent.ts +6 -2
  25. package/src/api/admin/getModerationEvent.ts +1 -1
  26. package/src/api/admin/getRecord.ts +1 -1
  27. package/src/api/admin/getRepo.ts +1 -1
  28. package/src/api/admin/listCommunicationTemplates.ts +1 -1
  29. package/src/api/admin/queryModerationEvents.ts +1 -1
  30. package/src/api/admin/queryModerationStatuses.ts +1 -1
  31. package/src/api/admin/searchRepos.ts +1 -1
  32. package/src/api/admin/updateCommunicationTemplate.ts +1 -1
  33. package/src/api/admin/util.ts +1 -1
  34. package/src/api/moderation/createReport.ts +1 -2
  35. package/src/api/proxied.ts +8 -8
  36. package/src/api/temp/fetchLabels.ts +1 -1
  37. package/src/auth-verifier.ts +19 -29
  38. package/src/config/config.ts +10 -7
  39. package/src/config/env.ts +2 -4
  40. package/src/config/secrets.ts +0 -6
  41. package/src/context.ts +1 -3
  42. package/src/daemon/context.ts +2 -2
  43. package/src/daemon/event-pusher.ts +9 -1
  44. package/src/db/schema/moderation_subject_status.ts +6 -1
  45. package/src/lexicon/index.ts +23 -0
  46. package/src/lexicon/lexicons.ts +327 -1
  47. package/src/lexicon/types/app/bsky/actor/defs.ts +57 -1
  48. package/src/lexicon/types/app/bsky/embed/record.ts +2 -0
  49. package/src/lexicon/types/app/bsky/labeler/defs.ts +93 -0
  50. package/src/lexicon/types/app/bsky/labeler/getServices.ts +51 -0
  51. package/src/lexicon/types/app/bsky/labeler/service.ts +31 -0
  52. package/src/lexicon/types/com/atproto/admin/defs.ts +3 -0
  53. package/src/lexicon/types/com/atproto/label/defs.ts +68 -0
  54. package/src/mod-service/index.ts +4 -3
  55. package/src/mod-service/status.ts +42 -26
  56. package/tests/__snapshots__/get-record.test.ts.snap +4 -4
  57. package/tests/__snapshots__/get-repo.test.ts.snap +2 -2
  58. package/tests/communication-templates.test.ts +7 -7
  59. package/tests/get-record.test.ts +17 -7
  60. package/tests/get-repo.test.ts +24 -12
  61. package/tests/moderation-appeals.test.ts +24 -52
  62. package/tests/moderation-events.test.ts +87 -130
  63. package/tests/moderation-status-tags.test.ts +16 -31
  64. package/tests/moderation-statuses.test.ts +125 -58
  65. package/tests/moderation.test.ts +140 -287
  66. package/tests/repo-search.test.ts +11 -4
package/dist/index.js CHANGED
@@ -93725,7 +93725,7 @@ var getServiceEndpoint = (doc, opts) => {
93725
93725
  const found = services.find((service2) => service2.id === opts.id || service2.id === `${did2}${opts.id}`);
93726
93726
  if (!found)
93727
93727
  return void 0;
93728
- if (found.type !== opts.type) {
93728
+ if (opts.type && found.type !== opts.type) {
93729
93729
  return void 0;
93730
93730
  }
93731
93731
  if (typeof found.serviceEndpoint !== "string") {
@@ -102720,7 +102720,8 @@ var schemaDict = {
102720
102720
  knownValues: [
102721
102721
  "lex:com.atproto.admin.defs#reviewOpen",
102722
102722
  "lex:com.atproto.admin.defs#reviewEscalated",
102723
- "lex:com.atproto.admin.defs#reviewClosed"
102723
+ "lex:com.atproto.admin.defs#reviewClosed",
102724
+ "lex:com.atproto.admin.defs#reviewNone"
102724
102725
  ]
102725
102726
  },
102726
102727
  reviewOpen: {
@@ -102735,6 +102736,10 @@ var schemaDict = {
102735
102736
  type: "token",
102736
102737
  description: "Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator"
102737
102738
  },
102739
+ reviewNone: {
102740
+ type: "token",
102741
+ description: "Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it"
102742
+ },
102738
102743
  modEventTakedown: {
102739
102744
  type: "object",
102740
102745
  description: "Take down a subject permanently or temporarily",
@@ -104194,6 +104199,76 @@ var schemaDict = {
104194
104199
  description: "The short string name of the value or type of this label."
104195
104200
  }
104196
104201
  }
104202
+ },
104203
+ labelValueDefinition: {
104204
+ type: "object",
104205
+ description: "Declares a label value and its expected interpertations and behaviors.",
104206
+ required: ["identifier", "severity", "blurs", "locales"],
104207
+ properties: {
104208
+ identifier: {
104209
+ type: "string",
104210
+ description: "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).",
104211
+ maxLength: 100,
104212
+ maxGraphemes: 100
104213
+ },
104214
+ severity: {
104215
+ type: "string",
104216
+ description: "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.",
104217
+ knownValues: ["inform", "alert", "none"]
104218
+ },
104219
+ blurs: {
104220
+ type: "string",
104221
+ description: "What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.",
104222
+ knownValues: ["content", "media", "none"]
104223
+ },
104224
+ locales: {
104225
+ type: "array",
104226
+ items: {
104227
+ type: "ref",
104228
+ ref: "lex:com.atproto.label.defs#labelValueDefinitionStrings"
104229
+ }
104230
+ }
104231
+ }
104232
+ },
104233
+ labelValueDefinitionStrings: {
104234
+ type: "object",
104235
+ description: "Strings which describe the label in the UI, localized into a specific language.",
104236
+ required: ["lang", "name", "description"],
104237
+ properties: {
104238
+ lang: {
104239
+ type: "string",
104240
+ description: "The code of the language these strings are written in.",
104241
+ format: "language"
104242
+ },
104243
+ name: {
104244
+ type: "string",
104245
+ description: "A short human-readable name for the label.",
104246
+ maxGraphemes: 64,
104247
+ maxLength: 640
104248
+ },
104249
+ description: {
104250
+ type: "string",
104251
+ description: "A longer description of what the label means and why it might be applied.",
104252
+ maxGraphemes: 1e4,
104253
+ maxLength: 1e5
104254
+ }
104255
+ }
104256
+ },
104257
+ labelValue: {
104258
+ type: "string",
104259
+ knownValues: [
104260
+ "!hide",
104261
+ "!no-promote",
104262
+ "!warn",
104263
+ "!no-unauthenticated",
104264
+ "dmca-violation",
104265
+ "doxxing",
104266
+ "porn",
104267
+ "sexual",
104268
+ "nudity",
104269
+ "nsfl",
104270
+ "gore"
104271
+ ]
104197
104272
  }
104198
104273
  }
104199
104274
  },
@@ -106882,6 +106957,10 @@ var schemaDict = {
106882
106957
  postsCount: {
106883
106958
  type: "integer"
106884
106959
  },
106960
+ associated: {
106961
+ type: "ref",
106962
+ ref: "lex:app.bsky.actor.defs#profileAssociated"
106963
+ },
106885
106964
  indexedAt: {
106886
106965
  type: "string",
106887
106966
  format: "datetime"
@@ -106899,6 +106978,20 @@ var schemaDict = {
106899
106978
  }
106900
106979
  }
106901
106980
  },
106981
+ profileAssociated: {
106982
+ type: "object",
106983
+ properties: {
106984
+ lists: {
106985
+ type: "integer"
106986
+ },
106987
+ feedgens: {
106988
+ type: "integer"
106989
+ },
106990
+ labeler: {
106991
+ type: "boolean"
106992
+ }
106993
+ }
106994
+ },
106902
106995
  viewerState: {
106903
106996
  type: "object",
106904
106997
  description: "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.",
@@ -106962,12 +107055,17 @@ var schemaDict = {
106962
107055
  type: "object",
106963
107056
  required: ["label", "visibility"],
106964
107057
  properties: {
107058
+ labelerDid: {
107059
+ type: "string",
107060
+ description: "Which labeler does this preference apply to? If undefined, applies globally.",
107061
+ format: "did"
107062
+ },
106965
107063
  label: {
106966
107064
  type: "string"
106967
107065
  },
106968
107066
  visibility: {
106969
107067
  type: "string",
106970
- knownValues: ["show", "warn", "hide"]
107068
+ knownValues: ["ignore", "show", "warn", "hide"]
106971
107069
  }
106972
107070
  }
106973
107071
  },
@@ -107119,6 +107217,29 @@ var schemaDict = {
107119
107217
  description: "A list of URIs of posts the account owner has hidden."
107120
107218
  }
107121
107219
  }
107220
+ },
107221
+ modsPref: {
107222
+ type: "object",
107223
+ required: ["mods"],
107224
+ properties: {
107225
+ mods: {
107226
+ type: "array",
107227
+ items: {
107228
+ type: "ref",
107229
+ ref: "lex:app.bsky.actor.defs#modPrefItem"
107230
+ }
107231
+ }
107232
+ }
107233
+ },
107234
+ modPrefItem: {
107235
+ type: "object",
107236
+ required: ["did"],
107237
+ properties: {
107238
+ did: {
107239
+ type: "string",
107240
+ format: "did"
107241
+ }
107242
+ }
107122
107243
  }
107123
107244
  }
107124
107245
  },
@@ -107607,7 +107728,8 @@ var schemaDict = {
107607
107728
  "lex:app.bsky.embed.record#viewNotFound",
107608
107729
  "lex:app.bsky.embed.record#viewBlocked",
107609
107730
  "lex:app.bsky.feed.defs#generatorView",
107610
- "lex:app.bsky.graph.defs#listView"
107731
+ "lex:app.bsky.graph.defs#listView",
107732
+ "lex:app.bsky.labeler.defs#labelerView"
107611
107733
  ]
107612
107734
  }
107613
107735
  }
@@ -110085,6 +110207,196 @@ var schemaDict = {
110085
110207
  }
110086
110208
  }
110087
110209
  },
110210
+ AppBskyLabelerDefs: {
110211
+ lexicon: 1,
110212
+ id: "app.bsky.labeler.defs",
110213
+ defs: {
110214
+ labelerView: {
110215
+ type: "object",
110216
+ required: ["uri", "cid", "creator", "indexedAt"],
110217
+ properties: {
110218
+ uri: {
110219
+ type: "string",
110220
+ format: "at-uri"
110221
+ },
110222
+ cid: {
110223
+ type: "string",
110224
+ format: "cid"
110225
+ },
110226
+ creator: {
110227
+ type: "ref",
110228
+ ref: "lex:app.bsky.actor.defs#profileView"
110229
+ },
110230
+ likeCount: {
110231
+ type: "integer",
110232
+ minimum: 0
110233
+ },
110234
+ viewer: {
110235
+ type: "ref",
110236
+ ref: "lex:app.bsky.labeler.defs#labelerViewerState"
110237
+ },
110238
+ indexedAt: {
110239
+ type: "string",
110240
+ format: "datetime"
110241
+ },
110242
+ labels: {
110243
+ type: "array",
110244
+ items: {
110245
+ type: "ref",
110246
+ ref: "lex:com.atproto.label.defs#label"
110247
+ }
110248
+ }
110249
+ }
110250
+ },
110251
+ labelerViewDetailed: {
110252
+ type: "object",
110253
+ required: ["uri", "cid", "creator", "policies", "indexedAt"],
110254
+ properties: {
110255
+ uri: {
110256
+ type: "string",
110257
+ format: "at-uri"
110258
+ },
110259
+ cid: {
110260
+ type: "string",
110261
+ format: "cid"
110262
+ },
110263
+ creator: {
110264
+ type: "ref",
110265
+ ref: "lex:app.bsky.actor.defs#profileView"
110266
+ },
110267
+ policies: {
110268
+ type: "ref",
110269
+ ref: "lex:app.bsky.labeler.defs#labelerPolicies"
110270
+ },
110271
+ likeCount: {
110272
+ type: "integer",
110273
+ minimum: 0
110274
+ },
110275
+ viewer: {
110276
+ type: "ref",
110277
+ ref: "lex:app.bsky.labeler.defs#labelerViewerState"
110278
+ },
110279
+ indexedAt: {
110280
+ type: "string",
110281
+ format: "datetime"
110282
+ },
110283
+ labels: {
110284
+ type: "array",
110285
+ items: {
110286
+ type: "ref",
110287
+ ref: "lex:com.atproto.label.defs#label"
110288
+ }
110289
+ }
110290
+ }
110291
+ },
110292
+ labelerViewerState: {
110293
+ type: "object",
110294
+ properties: {
110295
+ like: {
110296
+ type: "string",
110297
+ format: "at-uri"
110298
+ }
110299
+ }
110300
+ },
110301
+ labelerPolicies: {
110302
+ type: "object",
110303
+ required: ["labelValues"],
110304
+ properties: {
110305
+ labelValues: {
110306
+ type: "array",
110307
+ description: "The label values which this labeler publishes. May include global or custom labels.",
110308
+ items: {
110309
+ type: "ref",
110310
+ ref: "lex:com.atproto.label.defs#labelValue"
110311
+ }
110312
+ },
110313
+ labelValueDefinitions: {
110314
+ type: "array",
110315
+ description: "Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.",
110316
+ items: {
110317
+ type: "ref",
110318
+ ref: "lex:com.atproto.label.defs#labelValueDefinition"
110319
+ }
110320
+ }
110321
+ }
110322
+ }
110323
+ }
110324
+ },
110325
+ AppBskyLabelerGetServices: {
110326
+ lexicon: 1,
110327
+ id: "app.bsky.labeler.getServices",
110328
+ defs: {
110329
+ main: {
110330
+ type: "query",
110331
+ description: "Get information about a list of labeler services.",
110332
+ parameters: {
110333
+ type: "params",
110334
+ required: ["dids"],
110335
+ properties: {
110336
+ dids: {
110337
+ type: "array",
110338
+ items: {
110339
+ type: "string",
110340
+ format: "did"
110341
+ }
110342
+ },
110343
+ detailed: {
110344
+ type: "boolean",
110345
+ default: false
110346
+ }
110347
+ }
110348
+ },
110349
+ output: {
110350
+ encoding: "application/json",
110351
+ schema: {
110352
+ type: "object",
110353
+ required: ["views"],
110354
+ properties: {
110355
+ views: {
110356
+ type: "array",
110357
+ items: {
110358
+ type: "union",
110359
+ refs: [
110360
+ "lex:app.bsky.labeler.defs#labelerView",
110361
+ "lex:app.bsky.labeler.defs#labelerViewDetailed"
110362
+ ]
110363
+ }
110364
+ }
110365
+ }
110366
+ }
110367
+ }
110368
+ }
110369
+ }
110370
+ },
110371
+ AppBskyLabelerService: {
110372
+ lexicon: 1,
110373
+ id: "app.bsky.labeler.service",
110374
+ defs: {
110375
+ main: {
110376
+ type: "record",
110377
+ description: "A declaration of the existence of labeler service.",
110378
+ key: "literal:self",
110379
+ record: {
110380
+ type: "object",
110381
+ required: ["policies", "createdAt"],
110382
+ properties: {
110383
+ policies: {
110384
+ type: "ref",
110385
+ ref: "lex:app.bsky.labeler.defs#labelerPolicies"
110386
+ },
110387
+ labels: {
110388
+ type: "union",
110389
+ refs: ["lex:com.atproto.label.defs#selfLabels"]
110390
+ },
110391
+ createdAt: {
110392
+ type: "string",
110393
+ format: "datetime"
110394
+ }
110395
+ }
110396
+ }
110397
+ }
110398
+ }
110399
+ },
110088
110400
  AppBskyNotificationGetUnreadCount: {
110089
110401
  lexicon: 1,
110090
110402
  id: "app.bsky.notification.getUnreadCount",
@@ -110614,6 +110926,7 @@ function hasProp2(data, prop) {
110614
110926
  var REVIEWOPEN = "com.atproto.admin.defs#reviewOpen";
110615
110927
  var REVIEWESCALATED = "com.atproto.admin.defs#reviewEscalated";
110616
110928
  var REVIEWCLOSED = "com.atproto.admin.defs#reviewClosed";
110929
+ var REVIEWNONE = "com.atproto.admin.defs#reviewNone";
110617
110930
  function isModEventTakedown(v) {
110618
110931
  return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.admin.defs#modEventTakedown";
110619
110932
  }
@@ -110852,7 +111165,7 @@ var ModerationLangService = class {
110852
111165
  // src/api/moderation/createReport.ts
110853
111166
  function createReport_default(server, ctx) {
110854
111167
  server.com.atproto.moderation.createReport({
110855
- auth: ctx.authVerifier.standardOptionalOrRole,
111168
+ auth: ctx.authVerifier.standard,
110856
111169
  handler: async ({ input, auth }) => {
110857
111170
  const requester = "iss" in auth.credentials ? auth.credentials.iss : ctx.cfg.service.did;
110858
111171
  const { reasonType, reason } = input.body;
@@ -110919,12 +111232,13 @@ var retryableHttpStatusCodes = /* @__PURE__ */ new Set([
110919
111232
  // src/api/admin/emitModerationEvent.ts
110920
111233
  function emitModerationEvent_default(server, ctx) {
110921
111234
  server.com.atproto.admin.emitModerationEvent({
110922
- auth: ctx.authVerifier.modOrRole,
111235
+ auth: ctx.authVerifier.modOrAdminToken,
110923
111236
  handler: async ({ input, auth }) => {
110924
111237
  const access = auth.credentials;
111238
+ const createdBy = auth.credentials.type === "moderator" ? auth.credentials.iss : input.body.createdBy;
110925
111239
  const db = ctx.db;
110926
111240
  const moderationService = ctx.modService(db);
110927
- const { createdBy, event } = input.body;
111241
+ const { event } = input.body;
110928
111242
  const isTakedownEvent = isModEventTakedown(event);
110929
111243
  const isReverseTakedownEvent = isModEventReverseTakedown(event);
110930
111244
  const isLabelEvent = isModEventLabel(event);
@@ -111026,7 +111340,7 @@ var badChars = [" ", ",", ";", `'`, `"`];
111026
111340
  // src/api/admin/searchRepos.ts
111027
111341
  function searchRepos_default(server, ctx) {
111028
111342
  server.com.atproto.admin.searchRepos({
111029
- auth: ctx.authVerifier.modOrRole,
111343
+ auth: ctx.authVerifier.modOrAdminToken,
111030
111344
  handler: async ({ params: params2 }) => {
111031
111345
  const modService = ctx.modService(ctx.db);
111032
111346
  const query = params2.q ?? params2.term;
@@ -111065,7 +111379,7 @@ var getPdsAccountInfo = async (ctx, did2) => {
111065
111379
  try {
111066
111380
  const res = await agent.api.com.atproto.admin.getAccountInfo({ did: did2 }, auth);
111067
111381
  return res.data;
111068
- } catch (err) {
111382
+ } catch {
111069
111383
  return null;
111070
111384
  }
111071
111385
  };
@@ -111097,7 +111411,7 @@ var addAccountInfoToRepoView = (repoView, accountInfo, includeEmail = false) =>
111097
111411
  // src/api/admin/getRecord.ts
111098
111412
  function getRecord_default(server, ctx) {
111099
111413
  server.com.atproto.admin.getRecord({
111100
- auth: ctx.authVerifier.modOrRole,
111414
+ auth: ctx.authVerifier.modOrAdminToken,
111101
111415
  handler: async ({ params: params2, auth }) => {
111102
111416
  const db = ctx.db;
111103
111417
  const [record, accountInfo] = await Promise.all([
@@ -111119,7 +111433,7 @@ function getRecord_default(server, ctx) {
111119
111433
  // src/api/admin/getRepo.ts
111120
111434
  function getRepo_default(server, ctx) {
111121
111435
  server.com.atproto.admin.getRepo({
111122
- auth: ctx.authVerifier.modOrRole,
111436
+ auth: ctx.authVerifier.modOrAdminToken,
111123
111437
  handler: async ({ params: params2, auth }) => {
111124
111438
  const { did: did2 } = params2;
111125
111439
  const db = ctx.db;
@@ -111142,7 +111456,7 @@ function getRepo_default(server, ctx) {
111142
111456
  // src/api/admin/queryModerationStatuses.ts
111143
111457
  function queryModerationStatuses_default(server, ctx) {
111144
111458
  server.com.atproto.admin.queryModerationStatuses({
111145
- auth: ctx.authVerifier.modOrRole,
111459
+ auth: ctx.authVerifier.modOrAdminToken,
111146
111460
  handler: async ({ params: params2 }) => {
111147
111461
  const {
111148
111462
  subject,
@@ -111199,7 +111513,7 @@ function queryModerationStatuses_default(server, ctx) {
111199
111513
  // src/api/admin/queryModerationEvents.ts
111200
111514
  function queryModerationEvents_default(server, ctx) {
111201
111515
  server.com.atproto.admin.queryModerationEvents({
111202
- auth: ctx.authVerifier.modOrRole,
111516
+ auth: ctx.authVerifier.modOrAdminToken,
111203
111517
  handler: async ({ params: params2 }) => {
111204
111518
  const {
111205
111519
  subject,
@@ -111253,7 +111567,7 @@ function queryModerationEvents_default(server, ctx) {
111253
111567
  // src/api/admin/getModerationEvent.ts
111254
111568
  function getModerationEvent_default(server, ctx) {
111255
111569
  server.com.atproto.admin.getModerationEvent({
111256
- auth: ctx.authVerifier.modOrRole,
111570
+ auth: ctx.authVerifier.modOrAdminToken,
111257
111571
  handler: async ({ params: params2 }) => {
111258
111572
  const { id } = params2;
111259
111573
  const db = ctx.db;
@@ -118975,7 +119289,7 @@ var UNSPECCED_TAKEDOWN_BLOBS_LABEL = "!unspecced-takedown-blobs";
118975
119289
  // src/api/temp/fetchLabels.ts
118976
119290
  function fetchLabels_default(server, ctx) {
118977
119291
  server.com.atproto.temp.fetchLabels({
118978
- auth: ctx.authVerifier.standardOptionalOrRole,
119292
+ auth: ctx.authVerifier.standardOptionalOrAdminToken,
118979
119293
  handler: async ({ auth, params: params2 }) => {
118980
119294
  const { limit } = params2;
118981
119295
  const since = params2.since !== void 0 ? new Date(params2.since).toISOString() : "";
@@ -118998,7 +119312,7 @@ function fetchLabels_default(server, ctx) {
118998
119312
  // src/api/admin/createCommunicationTemplate.ts
118999
119313
  function createCommunicationTemplate_default(server, ctx) {
119000
119314
  server.com.atproto.admin.createCommunicationTemplate({
119001
- auth: ctx.authVerifier.modOrRole,
119315
+ auth: ctx.authVerifier.modOrAdminToken,
119002
119316
  handler: async ({ input, auth }) => {
119003
119317
  const access = auth.credentials;
119004
119318
  const db = ctx.db;
@@ -119026,7 +119340,7 @@ function createCommunicationTemplate_default(server, ctx) {
119026
119340
  // src/api/admin/updateCommunicationTemplate.ts
119027
119341
  function updateCommunicationTemplate_default(server, ctx) {
119028
119342
  server.com.atproto.admin.updateCommunicationTemplate({
119029
- auth: ctx.authVerifier.modOrRole,
119343
+ auth: ctx.authVerifier.modOrAdminToken,
119030
119344
  handler: async ({ input, auth }) => {
119031
119345
  const access = auth.credentials;
119032
119346
  const db = ctx.db;
@@ -119056,7 +119370,7 @@ function updateCommunicationTemplate_default(server, ctx) {
119056
119370
  // src/api/admin/deleteCommunicationTemplate.ts
119057
119371
  function deleteCommunicationTemplate_default(server, ctx) {
119058
119372
  server.com.atproto.admin.deleteCommunicationTemplate({
119059
- auth: ctx.authVerifier.modOrRole,
119373
+ auth: ctx.authVerifier.modOrAdminToken,
119060
119374
  handler: async ({ input, auth }) => {
119061
119375
  const access = auth.credentials;
119062
119376
  const db = ctx.db;
@@ -119073,7 +119387,7 @@ function deleteCommunicationTemplate_default(server, ctx) {
119073
119387
  // src/api/admin/listCommunicationTemplates.ts
119074
119388
  function listCommunicationTemplates_default(server, ctx) {
119075
119389
  server.com.atproto.admin.listCommunicationTemplates({
119076
- auth: ctx.authVerifier.modOrRole,
119390
+ auth: ctx.authVerifier.modOrAdminToken,
119077
119391
  handler: async ({ auth }) => {
119078
119392
  const access = auth.credentials;
119079
119393
  const db = ctx.db;
@@ -119095,7 +119409,7 @@ function listCommunicationTemplates_default(server, ctx) {
119095
119409
  // src/api/proxied.ts
119096
119410
  function proxied_default(server, ctx) {
119097
119411
  server.app.bsky.actor.getProfile({
119098
- auth: ctx.authVerifier.modOrRole,
119412
+ auth: ctx.authVerifier.moderator,
119099
119413
  handler: async (request) => {
119100
119414
  const res = await ctx.appviewAgent.api.app.bsky.actor.getProfile(request.params, await ctx.appviewAuth());
119101
119415
  return {
@@ -119105,7 +119419,7 @@ function proxied_default(server, ctx) {
119105
119419
  }
119106
119420
  });
119107
119421
  server.app.bsky.actor.getProfiles({
119108
- auth: ctx.authVerifier.modOrRole,
119422
+ auth: ctx.authVerifier.moderator,
119109
119423
  handler: async (request) => {
119110
119424
  const res = await ctx.appviewAgent.api.app.bsky.actor.getProfiles(request.params, await ctx.appviewAuth());
119111
119425
  return {
@@ -119115,7 +119429,7 @@ function proxied_default(server, ctx) {
119115
119429
  }
119116
119430
  });
119117
119431
  server.app.bsky.feed.getAuthorFeed({
119118
- auth: ctx.authVerifier.modOrRole,
119432
+ auth: ctx.authVerifier.moderator,
119119
119433
  handler: async (request) => {
119120
119434
  const res = await ctx.appviewAgent.api.app.bsky.feed.getAuthorFeed(request.params, await ctx.appviewAuth());
119121
119435
  return {
@@ -119125,7 +119439,7 @@ function proxied_default(server, ctx) {
119125
119439
  }
119126
119440
  });
119127
119441
  server.app.bsky.feed.getPostThread({
119128
- auth: ctx.authVerifier.modOrRole,
119442
+ auth: ctx.authVerifier.moderator,
119129
119443
  handler: async (request) => {
119130
119444
  const res = await ctx.appviewAgent.api.app.bsky.feed.getPostThread(request.params, await ctx.appviewAuth());
119131
119445
  return {
@@ -119135,7 +119449,7 @@ function proxied_default(server, ctx) {
119135
119449
  }
119136
119450
  });
119137
119451
  server.app.bsky.feed.getFeedGenerator({
119138
- auth: ctx.authVerifier.modOrRole,
119452
+ auth: ctx.authVerifier.moderator,
119139
119453
  handler: async (request) => {
119140
119454
  const res = await ctx.appviewAgent.api.app.bsky.feed.getFeedGenerator(request.params, await ctx.appviewAuth());
119141
119455
  return {
@@ -119145,7 +119459,7 @@ function proxied_default(server, ctx) {
119145
119459
  }
119146
119460
  });
119147
119461
  server.app.bsky.graph.getFollows({
119148
- auth: ctx.authVerifier.modOrRole,
119462
+ auth: ctx.authVerifier.moderator,
119149
119463
  handler: async (request) => {
119150
119464
  const res = await ctx.appviewAgent.api.app.bsky.graph.getFollows(request.params, await ctx.appviewAuth());
119151
119465
  return {
@@ -119155,7 +119469,7 @@ function proxied_default(server, ctx) {
119155
119469
  }
119156
119470
  });
119157
119471
  server.app.bsky.graph.getFollowers({
119158
- auth: ctx.authVerifier.modOrRole,
119472
+ auth: ctx.authVerifier.moderator,
119159
119473
  handler: async (request) => {
119160
119474
  const res = await ctx.appviewAgent.api.app.bsky.graph.getFollowers(request.params, await ctx.appviewAuth());
119161
119475
  return {
@@ -119165,7 +119479,7 @@ function proxied_default(server, ctx) {
119165
119479
  }
119166
119480
  });
119167
119481
  server.app.bsky.graph.getList({
119168
- auth: ctx.authVerifier.modOrRole,
119482
+ auth: ctx.authVerifier.moderator,
119169
119483
  handler: async (request) => {
119170
119484
  const res = await ctx.appviewAgent.api.app.bsky.graph.getList(request.params, await ctx.appviewAuth());
119171
119485
  return {
@@ -119679,6 +119993,7 @@ var AppBskyNS = class {
119679
119993
  this.embed = new AppBskyEmbedNS(server);
119680
119994
  this.feed = new AppBskyFeedNS(server);
119681
119995
  this.graph = new AppBskyGraphNS(server);
119996
+ this.labeler = new AppBskyLabelerNS(server);
119682
119997
  this.notification = new AppBskyNotificationNS(server);
119683
119998
  this.richtext = new AppBskyRichtextNS(server);
119684
119999
  this.unspecced = new AppBskyUnspeccedNS(server);
@@ -119852,6 +120167,15 @@ var AppBskyGraphNS = class {
119852
120167
  return this._server.xrpc.method(nsid2, cfg);
119853
120168
  }
119854
120169
  };
120170
+ var AppBskyLabelerNS = class {
120171
+ constructor(server) {
120172
+ this._server = server;
120173
+ }
120174
+ getServices(cfg) {
120175
+ const nsid2 = "app.bsky.labeler.getServices";
120176
+ return this._server.xrpc.method(nsid2, cfg);
120177
+ }
120178
+ };
119855
120179
  var AppBskyNotificationNS = class {
119856
120180
  constructor(server) {
119857
120181
  this._server = server;
@@ -120242,6 +120566,9 @@ var IdResolver = class {
120242
120566
  }
120243
120567
  };
120244
120568
 
120569
+ // ../api/src/const.ts
120570
+ var BSKY_MODSERVICE_DID = "did:plc:ar7c4by46qjdydhdevvrndac";
120571
+
120245
120572
  // ../api/src/client/lexicons.ts
120246
120573
  var schemaDict2 = {
120247
120574
  ComAtprotoAdminCreateCommunicationTemplate: {
@@ -120980,7 +121307,8 @@ var schemaDict2 = {
120980
121307
  knownValues: [
120981
121308
  "lex:com.atproto.admin.defs#reviewOpen",
120982
121309
  "lex:com.atproto.admin.defs#reviewEscalated",
120983
- "lex:com.atproto.admin.defs#reviewClosed"
121310
+ "lex:com.atproto.admin.defs#reviewClosed",
121311
+ "lex:com.atproto.admin.defs#reviewNone"
120984
121312
  ]
120985
121313
  },
120986
121314
  reviewOpen: {
@@ -120995,6 +121323,10 @@ var schemaDict2 = {
120995
121323
  type: "token",
120996
121324
  description: "Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator"
120997
121325
  },
121326
+ reviewNone: {
121327
+ type: "token",
121328
+ description: "Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it"
121329
+ },
120998
121330
  modEventTakedown: {
120999
121331
  type: "object",
121000
121332
  description: "Take down a subject permanently or temporarily",
@@ -122454,6 +122786,76 @@ var schemaDict2 = {
122454
122786
  description: "The short string name of the value or type of this label."
122455
122787
  }
122456
122788
  }
122789
+ },
122790
+ labelValueDefinition: {
122791
+ type: "object",
122792
+ description: "Declares a label value and its expected interpertations and behaviors.",
122793
+ required: ["identifier", "severity", "blurs", "locales"],
122794
+ properties: {
122795
+ identifier: {
122796
+ type: "string",
122797
+ description: "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).",
122798
+ maxLength: 100,
122799
+ maxGraphemes: 100
122800
+ },
122801
+ severity: {
122802
+ type: "string",
122803
+ description: "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.",
122804
+ knownValues: ["inform", "alert", "none"]
122805
+ },
122806
+ blurs: {
122807
+ type: "string",
122808
+ description: "What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.",
122809
+ knownValues: ["content", "media", "none"]
122810
+ },
122811
+ locales: {
122812
+ type: "array",
122813
+ items: {
122814
+ type: "ref",
122815
+ ref: "lex:com.atproto.label.defs#labelValueDefinitionStrings"
122816
+ }
122817
+ }
122818
+ }
122819
+ },
122820
+ labelValueDefinitionStrings: {
122821
+ type: "object",
122822
+ description: "Strings which describe the label in the UI, localized into a specific language.",
122823
+ required: ["lang", "name", "description"],
122824
+ properties: {
122825
+ lang: {
122826
+ type: "string",
122827
+ description: "The code of the language these strings are written in.",
122828
+ format: "language"
122829
+ },
122830
+ name: {
122831
+ type: "string",
122832
+ description: "A short human-readable name for the label.",
122833
+ maxGraphemes: 64,
122834
+ maxLength: 640
122835
+ },
122836
+ description: {
122837
+ type: "string",
122838
+ description: "A longer description of what the label means and why it might be applied.",
122839
+ maxGraphemes: 1e4,
122840
+ maxLength: 1e5
122841
+ }
122842
+ }
122843
+ },
122844
+ labelValue: {
122845
+ type: "string",
122846
+ knownValues: [
122847
+ "!hide",
122848
+ "!no-promote",
122849
+ "!warn",
122850
+ "!no-unauthenticated",
122851
+ "dmca-violation",
122852
+ "doxxing",
122853
+ "porn",
122854
+ "sexual",
122855
+ "nudity",
122856
+ "nsfl",
122857
+ "gore"
122858
+ ]
122457
122859
  }
122458
122860
  }
122459
122861
  },
@@ -125142,6 +125544,10 @@ var schemaDict2 = {
125142
125544
  postsCount: {
125143
125545
  type: "integer"
125144
125546
  },
125547
+ associated: {
125548
+ type: "ref",
125549
+ ref: "lex:app.bsky.actor.defs#profileAssociated"
125550
+ },
125145
125551
  indexedAt: {
125146
125552
  type: "string",
125147
125553
  format: "datetime"
@@ -125159,6 +125565,20 @@ var schemaDict2 = {
125159
125565
  }
125160
125566
  }
125161
125567
  },
125568
+ profileAssociated: {
125569
+ type: "object",
125570
+ properties: {
125571
+ lists: {
125572
+ type: "integer"
125573
+ },
125574
+ feedgens: {
125575
+ type: "integer"
125576
+ },
125577
+ labeler: {
125578
+ type: "boolean"
125579
+ }
125580
+ }
125581
+ },
125162
125582
  viewerState: {
125163
125583
  type: "object",
125164
125584
  description: "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.",
@@ -125222,12 +125642,17 @@ var schemaDict2 = {
125222
125642
  type: "object",
125223
125643
  required: ["label", "visibility"],
125224
125644
  properties: {
125645
+ labelerDid: {
125646
+ type: "string",
125647
+ description: "Which labeler does this preference apply to? If undefined, applies globally.",
125648
+ format: "did"
125649
+ },
125225
125650
  label: {
125226
125651
  type: "string"
125227
125652
  },
125228
125653
  visibility: {
125229
125654
  type: "string",
125230
- knownValues: ["show", "warn", "hide"]
125655
+ knownValues: ["ignore", "show", "warn", "hide"]
125231
125656
  }
125232
125657
  }
125233
125658
  },
@@ -125379,6 +125804,29 @@ var schemaDict2 = {
125379
125804
  description: "A list of URIs of posts the account owner has hidden."
125380
125805
  }
125381
125806
  }
125807
+ },
125808
+ modsPref: {
125809
+ type: "object",
125810
+ required: ["mods"],
125811
+ properties: {
125812
+ mods: {
125813
+ type: "array",
125814
+ items: {
125815
+ type: "ref",
125816
+ ref: "lex:app.bsky.actor.defs#modPrefItem"
125817
+ }
125818
+ }
125819
+ }
125820
+ },
125821
+ modPrefItem: {
125822
+ type: "object",
125823
+ required: ["did"],
125824
+ properties: {
125825
+ did: {
125826
+ type: "string",
125827
+ format: "did"
125828
+ }
125829
+ }
125382
125830
  }
125383
125831
  }
125384
125832
  },
@@ -125867,7 +126315,8 @@ var schemaDict2 = {
125867
126315
  "lex:app.bsky.embed.record#viewNotFound",
125868
126316
  "lex:app.bsky.embed.record#viewBlocked",
125869
126317
  "lex:app.bsky.feed.defs#generatorView",
125870
- "lex:app.bsky.graph.defs#listView"
126318
+ "lex:app.bsky.graph.defs#listView",
126319
+ "lex:app.bsky.labeler.defs#labelerView"
125871
126320
  ]
125872
126321
  }
125873
126322
  }
@@ -128345,6 +128794,196 @@ var schemaDict2 = {
128345
128794
  }
128346
128795
  }
128347
128796
  },
128797
+ AppBskyLabelerDefs: {
128798
+ lexicon: 1,
128799
+ id: "app.bsky.labeler.defs",
128800
+ defs: {
128801
+ labelerView: {
128802
+ type: "object",
128803
+ required: ["uri", "cid", "creator", "indexedAt"],
128804
+ properties: {
128805
+ uri: {
128806
+ type: "string",
128807
+ format: "at-uri"
128808
+ },
128809
+ cid: {
128810
+ type: "string",
128811
+ format: "cid"
128812
+ },
128813
+ creator: {
128814
+ type: "ref",
128815
+ ref: "lex:app.bsky.actor.defs#profileView"
128816
+ },
128817
+ likeCount: {
128818
+ type: "integer",
128819
+ minimum: 0
128820
+ },
128821
+ viewer: {
128822
+ type: "ref",
128823
+ ref: "lex:app.bsky.labeler.defs#labelerViewerState"
128824
+ },
128825
+ indexedAt: {
128826
+ type: "string",
128827
+ format: "datetime"
128828
+ },
128829
+ labels: {
128830
+ type: "array",
128831
+ items: {
128832
+ type: "ref",
128833
+ ref: "lex:com.atproto.label.defs#label"
128834
+ }
128835
+ }
128836
+ }
128837
+ },
128838
+ labelerViewDetailed: {
128839
+ type: "object",
128840
+ required: ["uri", "cid", "creator", "policies", "indexedAt"],
128841
+ properties: {
128842
+ uri: {
128843
+ type: "string",
128844
+ format: "at-uri"
128845
+ },
128846
+ cid: {
128847
+ type: "string",
128848
+ format: "cid"
128849
+ },
128850
+ creator: {
128851
+ type: "ref",
128852
+ ref: "lex:app.bsky.actor.defs#profileView"
128853
+ },
128854
+ policies: {
128855
+ type: "ref",
128856
+ ref: "lex:app.bsky.labeler.defs#labelerPolicies"
128857
+ },
128858
+ likeCount: {
128859
+ type: "integer",
128860
+ minimum: 0
128861
+ },
128862
+ viewer: {
128863
+ type: "ref",
128864
+ ref: "lex:app.bsky.labeler.defs#labelerViewerState"
128865
+ },
128866
+ indexedAt: {
128867
+ type: "string",
128868
+ format: "datetime"
128869
+ },
128870
+ labels: {
128871
+ type: "array",
128872
+ items: {
128873
+ type: "ref",
128874
+ ref: "lex:com.atproto.label.defs#label"
128875
+ }
128876
+ }
128877
+ }
128878
+ },
128879
+ labelerViewerState: {
128880
+ type: "object",
128881
+ properties: {
128882
+ like: {
128883
+ type: "string",
128884
+ format: "at-uri"
128885
+ }
128886
+ }
128887
+ },
128888
+ labelerPolicies: {
128889
+ type: "object",
128890
+ required: ["labelValues"],
128891
+ properties: {
128892
+ labelValues: {
128893
+ type: "array",
128894
+ description: "The label values which this labeler publishes. May include global or custom labels.",
128895
+ items: {
128896
+ type: "ref",
128897
+ ref: "lex:com.atproto.label.defs#labelValue"
128898
+ }
128899
+ },
128900
+ labelValueDefinitions: {
128901
+ type: "array",
128902
+ description: "Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.",
128903
+ items: {
128904
+ type: "ref",
128905
+ ref: "lex:com.atproto.label.defs#labelValueDefinition"
128906
+ }
128907
+ }
128908
+ }
128909
+ }
128910
+ }
128911
+ },
128912
+ AppBskyLabelerGetServices: {
128913
+ lexicon: 1,
128914
+ id: "app.bsky.labeler.getServices",
128915
+ defs: {
128916
+ main: {
128917
+ type: "query",
128918
+ description: "Get information about a list of labeler services.",
128919
+ parameters: {
128920
+ type: "params",
128921
+ required: ["dids"],
128922
+ properties: {
128923
+ dids: {
128924
+ type: "array",
128925
+ items: {
128926
+ type: "string",
128927
+ format: "did"
128928
+ }
128929
+ },
128930
+ detailed: {
128931
+ type: "boolean",
128932
+ default: false
128933
+ }
128934
+ }
128935
+ },
128936
+ output: {
128937
+ encoding: "application/json",
128938
+ schema: {
128939
+ type: "object",
128940
+ required: ["views"],
128941
+ properties: {
128942
+ views: {
128943
+ type: "array",
128944
+ items: {
128945
+ type: "union",
128946
+ refs: [
128947
+ "lex:app.bsky.labeler.defs#labelerView",
128948
+ "lex:app.bsky.labeler.defs#labelerViewDetailed"
128949
+ ]
128950
+ }
128951
+ }
128952
+ }
128953
+ }
128954
+ }
128955
+ }
128956
+ }
128957
+ },
128958
+ AppBskyLabelerService: {
128959
+ lexicon: 1,
128960
+ id: "app.bsky.labeler.service",
128961
+ defs: {
128962
+ main: {
128963
+ type: "record",
128964
+ description: "A declaration of the existence of labeler service.",
128965
+ key: "literal:self",
128966
+ record: {
128967
+ type: "object",
128968
+ required: ["policies", "createdAt"],
128969
+ properties: {
128970
+ policies: {
128971
+ type: "ref",
128972
+ ref: "lex:app.bsky.labeler.defs#labelerPolicies"
128973
+ },
128974
+ labels: {
128975
+ type: "union",
128976
+ refs: ["lex:com.atproto.label.defs#selfLabels"]
128977
+ },
128978
+ createdAt: {
128979
+ type: "string",
128980
+ format: "datetime"
128981
+ }
128982
+ }
128983
+ }
128984
+ }
128985
+ }
128986
+ },
128348
128987
  AppBskyNotificationGetUnreadCount: {
128349
128988
  lexicon: 1,
128350
128989
  id: "app.bsky.notification.getUnreadCount",
@@ -129982,55 +130621,62 @@ function toKnownErr118(e) {
129982
130621
  return e;
129983
130622
  }
129984
130623
 
129985
- // ../api/src/client/types/app/bsky/notification/getUnreadCount.ts
130624
+ // ../api/src/client/types/app/bsky/labeler/getServices.ts
129986
130625
  function toKnownErr119(e) {
129987
130626
  if (e instanceof XRPCError) {
129988
130627
  }
129989
130628
  return e;
129990
130629
  }
129991
130630
 
129992
- // ../api/src/client/types/app/bsky/notification/listNotifications.ts
130631
+ // ../api/src/client/types/app/bsky/notification/getUnreadCount.ts
129993
130632
  function toKnownErr120(e) {
129994
130633
  if (e instanceof XRPCError) {
129995
130634
  }
129996
130635
  return e;
129997
130636
  }
129998
130637
 
129999
- // ../api/src/client/types/app/bsky/notification/registerPush.ts
130638
+ // ../api/src/client/types/app/bsky/notification/listNotifications.ts
130000
130639
  function toKnownErr121(e) {
130001
130640
  if (e instanceof XRPCError) {
130002
130641
  }
130003
130642
  return e;
130004
130643
  }
130005
130644
 
130006
- // ../api/src/client/types/app/bsky/notification/updateSeen.ts
130645
+ // ../api/src/client/types/app/bsky/notification/registerPush.ts
130007
130646
  function toKnownErr122(e) {
130008
130647
  if (e instanceof XRPCError) {
130009
130648
  }
130010
130649
  return e;
130011
130650
  }
130012
130651
 
130013
- // ../api/src/client/types/app/bsky/unspecced/getPopularFeedGenerators.ts
130652
+ // ../api/src/client/types/app/bsky/notification/updateSeen.ts
130014
130653
  function toKnownErr123(e) {
130015
130654
  if (e instanceof XRPCError) {
130016
130655
  }
130017
130656
  return e;
130018
130657
  }
130019
130658
 
130020
- // ../api/src/client/types/app/bsky/unspecced/getTaggedSuggestions.ts
130659
+ // ../api/src/client/types/app/bsky/unspecced/getPopularFeedGenerators.ts
130021
130660
  function toKnownErr124(e) {
130022
130661
  if (e instanceof XRPCError) {
130023
130662
  }
130024
130663
  return e;
130025
130664
  }
130026
130665
 
130666
+ // ../api/src/client/types/app/bsky/unspecced/getTaggedSuggestions.ts
130667
+ function toKnownErr125(e) {
130668
+ if (e instanceof XRPCError) {
130669
+ }
130670
+ return e;
130671
+ }
130672
+
130027
130673
  // ../api/src/client/types/app/bsky/unspecced/searchActorsSkeleton.ts
130028
130674
  var BadQueryStringError2 = class extends XRPCError {
130029
130675
  constructor(src3) {
130030
130676
  super(src3.status, src3.error, src3.message, src3.headers);
130031
130677
  }
130032
130678
  };
130033
- function toKnownErr125(e) {
130679
+ function toKnownErr126(e) {
130034
130680
  if (e instanceof XRPCError) {
130035
130681
  if (e.error === "BadQueryString")
130036
130682
  return new BadQueryStringError2(e);
@@ -130044,7 +130690,7 @@ var BadQueryStringError3 = class extends XRPCError {
130044
130690
  super(src3.status, src3.error, src3.message, src3.headers);
130045
130691
  }
130046
130692
  };
130047
- function toKnownErr126(e) {
130693
+ function toKnownErr127(e) {
130048
130694
  if (e instanceof XRPCError) {
130049
130695
  if (e.error === "BadQueryString")
130050
130696
  return new BadQueryStringError3(e);
@@ -130550,6 +131196,7 @@ var AppBskyNS2 = class {
130550
131196
  this.embed = new AppBskyEmbedNS2(service2);
130551
131197
  this.feed = new AppBskyFeedNS2(service2);
130552
131198
  this.graph = new AppBskyGraphNS2(service2);
131199
+ this.labeler = new AppBskyLabelerNS2(service2);
130553
131200
  this.notification = new AppBskyNotificationNS2(service2);
130554
131201
  this.richtext = new AppBskyRichtextNS2(service2);
130555
131202
  this.unspecced = new AppBskyUnspeccedNS2(service2);
@@ -131068,28 +131715,71 @@ var ListitemRecord = class {
131068
131715
  await this._service.xrpc.call("com.atproto.repo.deleteRecord", void 0, { collection: "app.bsky.graph.listitem", ...params2 }, { headers });
131069
131716
  }
131070
131717
  };
131718
+ var AppBskyLabelerNS2 = class {
131719
+ constructor(service2) {
131720
+ this._service = service2;
131721
+ this.service = new ServiceRecord(service2);
131722
+ }
131723
+ getServices(params2, opts) {
131724
+ return this._service.xrpc.call("app.bsky.labeler.getServices", params2, void 0, opts).catch((e) => {
131725
+ throw toKnownErr119(e);
131726
+ });
131727
+ }
131728
+ };
131729
+ var ServiceRecord = class {
131730
+ constructor(service2) {
131731
+ this._service = service2;
131732
+ }
131733
+ async list(params2) {
131734
+ const res = await this._service.xrpc.call("com.atproto.repo.listRecords", {
131735
+ collection: "app.bsky.labeler.service",
131736
+ ...params2
131737
+ });
131738
+ return res.data;
131739
+ }
131740
+ async get(params2) {
131741
+ const res = await this._service.xrpc.call("com.atproto.repo.getRecord", {
131742
+ collection: "app.bsky.labeler.service",
131743
+ ...params2
131744
+ });
131745
+ return res.data;
131746
+ }
131747
+ async create(params2, record, headers) {
131748
+ record.$type = "app.bsky.labeler.service";
131749
+ const res = await this._service.xrpc.call("com.atproto.repo.createRecord", void 0, {
131750
+ collection: "app.bsky.labeler.service",
131751
+ rkey: "self",
131752
+ ...params2,
131753
+ record
131754
+ }, { encoding: "application/json", headers });
131755
+ return res.data;
131756
+ }
131757
+ async delete(params2, headers) {
131758
+ await this._service.xrpc.call("com.atproto.repo.deleteRecord", void 0, { collection: "app.bsky.labeler.service", ...params2 }, { headers });
131759
+ }
131760
+ };
131071
131761
  var AppBskyNotificationNS2 = class {
131072
131762
  constructor(service2) {
131073
131763
  this._service = service2;
131074
131764
  }
131075
131765
  getUnreadCount(params2, opts) {
131076
131766
  return this._service.xrpc.call("app.bsky.notification.getUnreadCount", params2, void 0, opts).catch((e) => {
131077
- throw toKnownErr119(e);
131767
+ throw toKnownErr120(e);
131078
131768
  });
131079
131769
  }
131080
131770
  listNotifications(params2, opts) {
131081
131771
  return this._service.xrpc.call("app.bsky.notification.listNotifications", params2, void 0, opts).catch((e) => {
131082
- throw toKnownErr120(e);
131772
+ throw toKnownErr121(e);
131083
131773
  });
131084
131774
  }
131085
131775
  registerPush(data, opts) {
131086
131776
  return this._service.xrpc.call("app.bsky.notification.registerPush", opts?.qp, data, opts).catch((e) => {
131087
- throw toKnownErr121(e);
131777
+ throw toKnownErr122(e);
131088
131778
  });
131089
131779
  }
131090
131780
  updateSeen(data, opts) {
131091
131781
  return this._service.xrpc.call("app.bsky.notification.updateSeen", opts?.qp, data, opts).catch((e) => {
131092
- throw toKnownErr122(e);
131782
+ throw toKnownErr123(e);
131093
131783
  });
131094
131784
  }
131095
131785
  };
@@ -131104,22 +131794,22 @@ var AppBskyUnspeccedNS2 = class {
131104
131794
  }
131105
131795
  getPopularFeedGenerators(params2, opts) {
131106
131796
  return this._service.xrpc.call("app.bsky.unspecced.getPopularFeedGenerators", params2, void 0, opts).catch((e) => {
131107
- throw toKnownErr123(e);
131797
+ throw toKnownErr124(e);
131108
131798
  });
131109
131799
  }
131110
131800
  getTaggedSuggestions(params2, opts) {
131111
131801
  return this._service.xrpc.call("app.bsky.unspecced.getTaggedSuggestions", params2, void 0, opts).catch((e) => {
131112
- throw toKnownErr124(e);
131802
+ throw toKnownErr125(e);
131113
131803
  });
131114
131804
  }
131115
131805
  searchActorsSkeleton(params2, opts) {
131116
131806
  return this._service.xrpc.call("app.bsky.unspecced.searchActorsSkeleton", params2, void 0, opts).catch((e) => {
131117
- throw toKnownErr125(e);
131807
+ throw toKnownErr126(e);
131118
131808
  });
131119
131809
  }
131120
131810
  searchPostsSkeleton(params2, opts) {
131121
131811
  return this._service.xrpc.call("app.bsky.unspecced.searchPostsSkeleton", params2, void 0, opts).catch((e) => {
131122
- throw toKnownErr126(e);
131812
+ throw toKnownErr127(e);
131123
131813
  });
131124
131814
  }
131125
131815
  };
@@ -131128,6 +131818,7 @@ var AppBskyUnspeccedNS2 = class {
131128
131818
  var REFRESH_SESSION = "com.atproto.server.refreshSession";
131129
131819
  var _AtpAgent = class {
131130
131820
  constructor(opts) {
131821
+ this.labelersHeader = [BSKY_MODSERVICE_DID];
131131
131822
  this.uploadBlob = (data, opts) => this.api.com.atproto.repo.uploadBlob(data, opts);
131132
131823
  this.resolveHandle = (params2, opts) => this.api.com.atproto.identity.resolveHandle(params2, opts);
131133
131824
  this.updateHandle = (data, opts) => this.api.com.atproto.identity.updateHandle(data, opts);
@@ -131150,6 +131841,9 @@ var _AtpAgent = class {
131150
131841
  setPersistSessionHandler(handler2) {
131151
131842
  this._persistSession = handler2;
131152
131843
  }
131844
+ configureLabelersHeader(labelerDids) {
131845
+ this.labelersHeader = labelerDids;
131846
+ }
131153
131847
  async createAccount(opts) {
131154
131848
  try {
131155
131849
  const res = await this.api.com.atproto.server.createAccount(opts);
@@ -131228,13 +131922,19 @@ var _AtpAgent = class {
131228
131922
  throw e;
131229
131923
  }
131230
131924
  }
131231
- _addAuthHeader(reqHeaders) {
131925
+ _addHeaders(reqHeaders) {
131232
131926
  if (!reqHeaders.authorization && this.session?.accessJwt) {
131233
- return {
131927
+ reqHeaders = {
131234
131928
  ...reqHeaders,
131235
131929
  authorization: `Bearer ${this.session.accessJwt}`
131236
131930
  };
131237
131931
  }
131932
+ if (this.labelersHeader.length) {
131933
+ reqHeaders = {
131934
+ ...reqHeaders,
131935
+ "atproto-labelers": this.labelersHeader.filter((str) => str.startsWith("did:")).slice(0, 10).join(",")
131936
+ };
131937
+ }
131238
131938
  return reqHeaders;
131239
131939
  }
131240
131940
  async _fetch(reqUri, reqMethod, reqHeaders, reqBody) {
@@ -131242,10 +131942,10 @@ var _AtpAgent = class {
131242
131942
  throw new Error("AtpAgent fetch() method not configured");
131243
131943
  }
131244
131944
  await this._refreshSessionPromise;
131245
- let res = await _AtpAgent.fetch(reqUri, reqMethod, this._addAuthHeader(reqHeaders), reqBody);
131945
+ let res = await _AtpAgent.fetch(reqUri, reqMethod, this._addHeaders(reqHeaders), reqBody);
131246
131946
  if (isErrorResponse(res, ["ExpiredToken"]) && this.session?.refreshJwt) {
131247
131947
  await this.refreshSession();
131248
- res = await _AtpAgent.fetch(reqUri, reqMethod, this._addAuthHeader(reqHeaders), reqBody);
131948
+ res = await _AtpAgent.fetch(reqUri, reqMethod, this._addHeaders(reqHeaders), reqBody);
131249
131949
  }
131250
131950
  return res;
131251
131951
  }
@@ -131322,939 +132022,6 @@ function isNewSessionObject(client, v) {
131322
132022
  var encoder = new TextEncoder();
131323
132023
  var decoder2 = new TextDecoder();
131324
132024
 
131325
- // ../api/src/moderation/const/labels.ts
131326
- var LABELS = {
131327
- "!hide": {
131328
- id: "!hide",
131329
- preferences: ["hide"],
131330
- flags: ["no-override"],
131331
- onwarn: "blur",
131332
- groupId: "system",
131333
- configurable: false,
131334
- strings: {
131335
- settings: {
131336
- en: {
131337
- name: "Moderator Hide",
131338
- description: "Moderator has chosen to hide the content."
131339
- }
131340
- },
131341
- account: {
131342
- en: {
131343
- name: "Content Blocked",
131344
- description: "This account has been hidden by the moderators."
131345
- }
131346
- },
131347
- content: {
131348
- en: {
131349
- name: "Content Blocked",
131350
- description: "This content has been hidden by the moderators."
131351
- }
131352
- }
131353
- }
131354
- },
131355
- "!no-promote": {
131356
- id: "!no-promote",
131357
- preferences: ["hide"],
131358
- flags: [],
131359
- onwarn: null,
131360
- groupId: "system",
131361
- configurable: false,
131362
- strings: {
131363
- settings: {
131364
- en: {
131365
- name: "Moderator Filter",
131366
- description: "Moderator has chosen to filter the content from feeds."
131367
- }
131368
- },
131369
- account: {
131370
- en: {
131371
- name: "N/A",
131372
- description: "N/A"
131373
- }
131374
- },
131375
- content: {
131376
- en: {
131377
- name: "N/A",
131378
- description: "N/A"
131379
- }
131380
- }
131381
- }
131382
- },
131383
- "!warn": {
131384
- id: "!warn",
131385
- preferences: ["warn"],
131386
- flags: [],
131387
- onwarn: "blur",
131388
- groupId: "system",
131389
- configurable: false,
131390
- strings: {
131391
- settings: {
131392
- en: {
131393
- name: "Moderator Warn",
131394
- description: "Moderator has chosen to set a general warning on the content."
131395
- }
131396
- },
131397
- account: {
131398
- en: {
131399
- name: "Content Warning",
131400
- description: "This account has received a general warning from moderators."
131401
- }
131402
- },
131403
- content: {
131404
- en: {
131405
- name: "Content Warning",
131406
- description: "This content has received a general warning from moderators."
131407
- }
131408
- }
131409
- }
131410
- },
131411
- "!no-unauthenticated": {
131412
- id: "!no-unauthenticated",
131413
- preferences: ["hide"],
131414
- flags: ["no-override", "unauthed"],
131415
- onwarn: "blur",
131416
- groupId: "system",
131417
- configurable: false,
131418
- strings: {
131419
- settings: {
131420
- en: {
131421
- name: "Sign-in Required",
131422
- description: "This user has requested that their account only be shown to signed-in users."
131423
- }
131424
- },
131425
- account: {
131426
- en: {
131427
- name: "Sign-in Required",
131428
- description: "This user has requested that their account only be shown to signed-in users."
131429
- }
131430
- },
131431
- content: {
131432
- en: {
131433
- name: "Sign-in Required",
131434
- description: "This user has requested that their content only be shown to signed-in users."
131435
- }
131436
- }
131437
- }
131438
- },
131439
- "dmca-violation": {
131440
- id: "dmca-violation",
131441
- preferences: ["hide"],
131442
- flags: ["no-override"],
131443
- onwarn: "blur",
131444
- groupId: "legal",
131445
- configurable: false,
131446
- strings: {
131447
- settings: {
131448
- en: {
131449
- name: "Copyright Violation",
131450
- description: "The content has received a DMCA takedown request."
131451
- }
131452
- },
131453
- account: {
131454
- en: {
131455
- name: "Copyright Violation",
131456
- description: "This account has received a DMCA takedown request. It will be restored if the concerns can be resolved."
131457
- }
131458
- },
131459
- content: {
131460
- en: {
131461
- name: "Copyright Violation",
131462
- description: "This content has received a DMCA takedown request. It will be restored if the concerns can be resolved."
131463
- }
131464
- }
131465
- }
131466
- },
131467
- doxxing: {
131468
- id: "doxxing",
131469
- preferences: ["hide"],
131470
- flags: ["no-override"],
131471
- onwarn: "blur",
131472
- groupId: "legal",
131473
- configurable: false,
131474
- strings: {
131475
- settings: {
131476
- en: {
131477
- name: "Doxxing",
131478
- description: "Information that reveals private information about someone which has been shared without the consent of the subject."
131479
- }
131480
- },
131481
- account: {
131482
- en: {
131483
- name: "Doxxing",
131484
- description: "This account has been reported to publish private information about someone without their consent. This report is currently under review."
131485
- }
131486
- },
131487
- content: {
131488
- en: {
131489
- name: "Doxxing",
131490
- description: "This content has been reported to include private information about someone without their consent."
131491
- }
131492
- }
131493
- }
131494
- },
131495
- porn: {
131496
- id: "porn",
131497
- preferences: ["ignore", "warn", "hide"],
131498
- flags: ["adult"],
131499
- onwarn: "blur-media",
131500
- groupId: "sexual",
131501
- configurable: true,
131502
- strings: {
131503
- settings: {
131504
- en: {
131505
- name: "Pornography",
131506
- description: "Images of full-frontal nudity (genitalia) in any sexualized context, or explicit sexual activity (meaning contact with genitalia or breasts) even if partially covered. Includes graphic sexual cartoons (often jokes/memes)."
131507
- }
131508
- },
131509
- account: {
131510
- en: {
131511
- name: "Adult Content",
131512
- description: "This account contains imagery of full-frontal nudity or explicit sexual activity."
131513
- }
131514
- },
131515
- content: {
131516
- en: {
131517
- name: "Adult Content",
131518
- description: "This content contains imagery of full-frontal nudity or explicit sexual activity."
131519
- }
131520
- }
131521
- }
131522
- },
131523
- sexual: {
131524
- id: "sexual",
131525
- preferences: ["ignore", "warn", "hide"],
131526
- flags: ["adult"],
131527
- onwarn: "blur-media",
131528
- groupId: "sexual",
131529
- configurable: true,
131530
- strings: {
131531
- settings: {
131532
- en: {
131533
- name: "Sexually Suggestive",
131534
- description: 'Content that does not meet the level of "pornography", but is still sexual. Some common examples have been selfies and "hornyposting" with underwear on, or partially naked (naked but covered, eg with hands or from side perspective). Sheer/see-through nipples may end up in this category.'
131535
- }
131536
- },
131537
- account: {
131538
- en: {
131539
- name: "Suggestive Content",
131540
- description: "This account contains imagery which is sexually suggestive. Common examples include selfies in underwear or in partial undress."
131541
- }
131542
- },
131543
- content: {
131544
- en: {
131545
- name: "Suggestive Content",
131546
- description: "This content contains imagery which is sexually suggestive. Common examples include selfies in underwear or in partial undress."
131547
- }
131548
- }
131549
- }
131550
- },
131551
- nudity: {
131552
- id: "nudity",
131553
- preferences: ["ignore", "warn", "hide"],
131554
- flags: ["adult"],
131555
- onwarn: "blur-media",
131556
- groupId: "sexual",
131557
- configurable: true,
131558
- strings: {
131559
- settings: {
131560
- en: {
131561
- name: "Nudity",
131562
- description: 'Nudity which is not sexual, or that is primarily "artistic" in nature. For example: breastfeeding; classic art paintings and sculptures; newspaper images with some nudity; fashion modeling. "Erotic photography" is likely to end up in sexual or porn.'
131563
- }
131564
- },
131565
- account: {
131566
- en: {
131567
- name: "Adult Content",
131568
- description: "This account contains imagery which portrays nudity in a non-sexual or artistic setting."
131569
- }
131570
- },
131571
- content: {
131572
- en: {
131573
- name: "Adult Content",
131574
- description: "This content contains imagery which portrays nudity in a non-sexual or artistic setting."
131575
- }
131576
- }
131577
- }
131578
- },
131579
- nsfl: {
131580
- id: "nsfl",
131581
- preferences: ["ignore", "warn", "hide"],
131582
- flags: ["adult"],
131583
- onwarn: "blur-media",
131584
- groupId: "violence",
131585
- configurable: true,
131586
- strings: {
131587
- settings: {
131588
- en: {
131589
- name: "NSFL",
131590
- description: `"Not Suitable For Life." This includes graphic images like the infamous "goatse" (don't look it up).`
131591
- }
131592
- },
131593
- account: {
131594
- en: {
131595
- name: "Graphic Imagery (NSFL)",
131596
- description: 'This account contains graphic images which are often referred to as "Not Suitable For Life."'
131597
- }
131598
- },
131599
- content: {
131600
- en: {
131601
- name: "Graphic Imagery (NSFL)",
131602
- description: 'This content contains graphic images which are often referred to as "Not Suitable For Life."'
131603
- }
131604
- }
131605
- }
131606
- },
131607
- corpse: {
131608
- id: "corpse",
131609
- preferences: ["ignore", "warn", "hide"],
131610
- flags: ["adult"],
131611
- onwarn: "blur-media",
131612
- groupId: "violence",
131613
- configurable: true,
131614
- strings: {
131615
- settings: {
131616
- en: {
131617
- name: "Corpse",
131618
- description: "Visual image of a dead human body in any context. Includes war images, hanging, funeral caskets. Does not include all figurative cases (cartoons), but can include realistic figurative images or renderings."
131619
- }
131620
- },
131621
- account: {
131622
- en: {
131623
- name: "Graphic Imagery (Corpse)",
131624
- description: "This account contains images of a dead human body in any context. Includes war images, hanging, funeral caskets."
131625
- }
131626
- },
131627
- content: {
131628
- en: {
131629
- name: "Graphic Imagery (Corpse)",
131630
- description: "This content contains images of a dead human body in any context. Includes war images, hanging, funeral caskets."
131631
- }
131632
- }
131633
- }
131634
- },
131635
- gore: {
131636
- id: "gore",
131637
- preferences: ["ignore", "warn", "hide"],
131638
- flags: ["adult"],
131639
- onwarn: "blur-media",
131640
- groupId: "violence",
131641
- configurable: true,
131642
- strings: {
131643
- settings: {
131644
- en: {
131645
- name: "Gore",
131646
- description: "Intended for shocking images, typically involving blood or visible wounds."
131647
- }
131648
- },
131649
- account: {
131650
- en: {
131651
- name: "Graphic Imagery (Gore)",
131652
- description: "This account contains shocking images involving blood or visible wounds."
131653
- }
131654
- },
131655
- content: {
131656
- en: {
131657
- name: "Graphic Imagery (Gore)",
131658
- description: "This content contains shocking images involving blood or visible wounds."
131659
- }
131660
- }
131661
- }
131662
- },
131663
- torture: {
131664
- id: "torture",
131665
- preferences: ["ignore", "warn", "hide"],
131666
- flags: ["adult"],
131667
- onwarn: "blur",
131668
- groupId: "violence",
131669
- configurable: true,
131670
- strings: {
131671
- settings: {
131672
- en: {
131673
- name: "Torture",
131674
- description: "Depictions of torture of a human or animal (animal cruelty)."
131675
- }
131676
- },
131677
- account: {
131678
- en: {
131679
- name: "Graphic Imagery (Torture)",
131680
- description: "This account contains depictions of torture of a human or animal."
131681
- }
131682
- },
131683
- content: {
131684
- en: {
131685
- name: "Graphic Imagery (Torture)",
131686
- description: "This content contains depictions of torture of a human or animal."
131687
- }
131688
- }
131689
- }
131690
- },
131691
- "self-harm": {
131692
- id: "self-harm",
131693
- preferences: ["ignore", "warn", "hide"],
131694
- flags: ["adult"],
131695
- onwarn: "blur-media",
131696
- groupId: "violence",
131697
- configurable: true,
131698
- strings: {
131699
- settings: {
131700
- en: {
131701
- name: "Self-Harm",
131702
- description: "A visual depiction (photo or figurative) of cutting, suicide, or similar."
131703
- }
131704
- },
131705
- account: {
131706
- en: {
131707
- name: "Graphic Imagery (Self-Harm)",
131708
- description: "This account includes depictions of cutting, suicide, or other forms of self-harm."
131709
- }
131710
- },
131711
- content: {
131712
- en: {
131713
- name: "Graphic Imagery (Self-Harm)",
131714
- description: "This content includes depictions of cutting, suicide, or other forms of self-harm."
131715
- }
131716
- }
131717
- }
131718
- },
131719
- "intolerant-race": {
131720
- id: "intolerant-race",
131721
- preferences: ["ignore", "warn", "hide"],
131722
- flags: [],
131723
- onwarn: "blur",
131724
- groupId: "intolerance",
131725
- configurable: true,
131726
- strings: {
131727
- settings: {
131728
- en: {
131729
- name: "Racial Intolerance",
131730
- description: "Hateful or intolerant content related to race."
131731
- }
131732
- },
131733
- account: {
131734
- en: {
131735
- name: "Intolerance (Racial)",
131736
- description: "This account includes hateful or intolerant content related to race."
131737
- }
131738
- },
131739
- content: {
131740
- en: {
131741
- name: "Intolerance (Racial)",
131742
- description: "This content includes hateful or intolerant views related to race."
131743
- }
131744
- }
131745
- }
131746
- },
131747
- "intolerant-gender": {
131748
- id: "intolerant-gender",
131749
- preferences: ["ignore", "warn", "hide"],
131750
- flags: [],
131751
- onwarn: "blur",
131752
- groupId: "intolerance",
131753
- configurable: true,
131754
- strings: {
131755
- settings: {
131756
- en: {
131757
- name: "Gender Intolerance",
131758
- description: "Hateful or intolerant content related to gender or gender identity."
131759
- }
131760
- },
131761
- account: {
131762
- en: {
131763
- name: "Intolerance (Gender)",
131764
- description: "This account includes hateful or intolerant content related to gender or gender identity."
131765
- }
131766
- },
131767
- content: {
131768
- en: {
131769
- name: "Intolerance (Gender)",
131770
- description: "This content includes hateful or intolerant views related to gender or gender identity."
131771
- }
131772
- }
131773
- }
131774
- },
131775
- "intolerant-sexual-orientation": {
131776
- id: "intolerant-sexual-orientation",
131777
- preferences: ["ignore", "warn", "hide"],
131778
- flags: [],
131779
- onwarn: "blur",
131780
- groupId: "intolerance",
131781
- configurable: true,
131782
- strings: {
131783
- settings: {
131784
- en: {
131785
- name: "Sexual Orientation Intolerance",
131786
- description: "Hateful or intolerant content related to sexual preferences."
131787
- }
131788
- },
131789
- account: {
131790
- en: {
131791
- name: "Intolerance (Orientation)",
131792
- description: "This account includes hateful or intolerant content related to sexual preferences."
131793
- }
131794
- },
131795
- content: {
131796
- en: {
131797
- name: "Intolerance (Orientation)",
131798
- description: "This content includes hateful or intolerant views related to sexual preferences."
131799
- }
131800
- }
131801
- }
131802
- },
131803
- "intolerant-religion": {
131804
- id: "intolerant-religion",
131805
- preferences: ["ignore", "warn", "hide"],
131806
- flags: [],
131807
- onwarn: "blur",
131808
- groupId: "intolerance",
131809
- configurable: true,
131810
- strings: {
131811
- settings: {
131812
- en: {
131813
- name: "Religious Intolerance",
131814
- description: "Hateful or intolerant content related to religious views or practices."
131815
- }
131816
- },
131817
- account: {
131818
- en: {
131819
- name: "Intolerance (Religious)",
131820
- description: "This account includes hateful or intolerant content related to religious views or practices."
131821
- }
131822
- },
131823
- content: {
131824
- en: {
131825
- name: "Intolerance (Religious)",
131826
- description: "This content includes hateful or intolerant views related to religious views or practices."
131827
- }
131828
- }
131829
- }
131830
- },
131831
- intolerant: {
131832
- id: "intolerant",
131833
- preferences: ["ignore", "warn", "hide"],
131834
- flags: [],
131835
- onwarn: "blur",
131836
- groupId: "intolerance",
131837
- configurable: true,
131838
- strings: {
131839
- settings: {
131840
- en: {
131841
- name: "Intolerance",
131842
- description: "A catchall for hateful or intolerant content which is not covered elsewhere."
131843
- }
131844
- },
131845
- account: {
131846
- en: {
131847
- name: "Intolerance",
131848
- description: "This account includes hateful or intolerant content."
131849
- }
131850
- },
131851
- content: {
131852
- en: {
131853
- name: "Intolerance",
131854
- description: "This content includes hateful or intolerant views."
131855
- }
131856
- }
131857
- }
131858
- },
131859
- "icon-intolerant": {
131860
- id: "icon-intolerant",
131861
- preferences: ["ignore", "warn", "hide"],
131862
- flags: [],
131863
- onwarn: "blur-media",
131864
- groupId: "intolerance",
131865
- configurable: true,
131866
- strings: {
131867
- settings: {
131868
- en: {
131869
- name: "Intolerant Iconography",
131870
- description: "Visual imagery associated with a hate group, such as the KKK or Nazi, in any context (supportive, critical, documentary, etc)."
131871
- }
131872
- },
131873
- account: {
131874
- en: {
131875
- name: "Intolerant Iconography",
131876
- description: "This account includes imagery associated with a hate group such as the KKK or Nazis. This warning may apply to content any context, including critical or documentary purposes."
131877
- }
131878
- },
131879
- content: {
131880
- en: {
131881
- name: "Intolerant Iconography",
131882
- description: "This content includes imagery associated with a hate group such as the KKK or Nazis. This warning may apply to content any context, including critical or documentary purposes."
131883
- }
131884
- }
131885
- }
131886
- },
131887
- threat: {
131888
- id: "threat",
131889
- preferences: ["ignore", "warn", "hide"],
131890
- flags: [],
131891
- onwarn: "blur",
131892
- groupId: "rude",
131893
- configurable: true,
131894
- strings: {
131895
- settings: {
131896
- en: {
131897
- name: "Threats",
131898
- description: "Statements or imagery published with the intent to threaten, intimidate, or harm."
131899
- }
131900
- },
131901
- account: {
131902
- en: {
131903
- name: "Threats",
131904
- description: "The moderators believe this account has published statements or imagery with the intent to threaten, intimidate, or harm others."
131905
- }
131906
- },
131907
- content: {
131908
- en: {
131909
- name: "Threats",
131910
- description: "The moderators believe this content was published with the intent to threaten, intimidate, or harm others."
131911
- }
131912
- }
131913
- }
131914
- },
131915
- spoiler: {
131916
- id: "spoiler",
131917
- preferences: ["ignore", "warn", "hide"],
131918
- flags: [],
131919
- onwarn: "blur",
131920
- groupId: "curation",
131921
- configurable: true,
131922
- strings: {
131923
- settings: {
131924
- en: {
131925
- name: "Spoiler",
131926
- description: "Discussion about film, TV, etc which gives away plot points."
131927
- }
131928
- },
131929
- account: {
131930
- en: {
131931
- name: "Spoiler Warning",
131932
- description: "This account contains discussion about film, TV, etc which gives away plot points."
131933
- }
131934
- },
131935
- content: {
131936
- en: {
131937
- name: "Spoiler Warning",
131938
- description: "This content contains discussion about film, TV, etc which gives away plot points."
131939
- }
131940
- }
131941
- }
131942
- },
131943
- spam: {
131944
- id: "spam",
131945
- preferences: ["ignore", "warn", "hide"],
131946
- flags: [],
131947
- onwarn: "blur",
131948
- groupId: "spam",
131949
- configurable: true,
131950
- strings: {
131951
- settings: {
131952
- en: {
131953
- name: "Spam",
131954
- description: "Repeat, low-quality messages which are clearly not designed to add to a conversation or space."
131955
- }
131956
- },
131957
- account: {
131958
- en: {
131959
- name: "Spam",
131960
- description: "This account publishes repeat, low-quality messages which are clearly not designed to add to a conversation or space."
131961
- }
131962
- },
131963
- content: {
131964
- en: {
131965
- name: "Spam",
131966
- description: "This content is a part of repeat, low-quality messages which are clearly not designed to add to a conversation or space."
131967
- }
131968
- }
131969
- }
131970
- },
131971
- "account-security": {
131972
- id: "account-security",
131973
- preferences: ["ignore", "warn", "hide"],
131974
- flags: [],
131975
- onwarn: "blur",
131976
- groupId: "misinfo",
131977
- configurable: true,
131978
- strings: {
131979
- settings: {
131980
- en: {
131981
- name: "Security Concerns",
131982
- description: "Content designed to hijack user accounts such as a phishing attack."
131983
- }
131984
- },
131985
- account: {
131986
- en: {
131987
- name: "Security Warning",
131988
- description: "This account has published content designed to hijack user accounts such as a phishing attack."
131989
- }
131990
- },
131991
- content: {
131992
- en: {
131993
- name: "Security Warning",
131994
- description: "This content is designed to hijack user accounts such as a phishing attack."
131995
- }
131996
- }
131997
- }
131998
- },
131999
- "net-abuse": {
132000
- id: "net-abuse",
132001
- preferences: ["ignore", "warn", "hide"],
132002
- flags: [],
132003
- onwarn: "blur",
132004
- groupId: "misinfo",
132005
- configurable: true,
132006
- strings: {
132007
- settings: {
132008
- en: {
132009
- name: "Network Attacks",
132010
- description: "Content designed to attack network systems such as denial-of-service attacks."
132011
- }
132012
- },
132013
- account: {
132014
- en: {
132015
- name: "Network Attack Warning",
132016
- description: "This account has published content designed to attack network systems such as denial-of-service attacks."
132017
- }
132018
- },
132019
- content: {
132020
- en: {
132021
- name: "Network Attack Warning",
132022
- description: "This content is designed to attack network systems such as denial-of-service attacks."
132023
- }
132024
- }
132025
- }
132026
- },
132027
- impersonation: {
132028
- id: "impersonation",
132029
- preferences: ["ignore", "warn", "hide"],
132030
- flags: [],
132031
- onwarn: "alert",
132032
- groupId: "misinfo",
132033
- configurable: true,
132034
- strings: {
132035
- settings: {
132036
- en: {
132037
- name: "Impersonation",
132038
- description: "Accounts which falsely assert some identity."
132039
- }
132040
- },
132041
- account: {
132042
- en: {
132043
- name: "Impersonation Warning",
132044
- description: "The moderators believe this account is lying about their identity."
132045
- }
132046
- },
132047
- content: {
132048
- en: {
132049
- name: "Impersonation Warning",
132050
- description: "The moderators believe this account is lying about their identity."
132051
- }
132052
- }
132053
- }
132054
- },
132055
- scam: {
132056
- id: "scam",
132057
- preferences: ["ignore", "warn", "hide"],
132058
- flags: [],
132059
- onwarn: "alert",
132060
- groupId: "misinfo",
132061
- configurable: true,
132062
- strings: {
132063
- settings: {
132064
- en: {
132065
- name: "Scam",
132066
- description: "Fraudulent content."
132067
- }
132068
- },
132069
- account: {
132070
- en: {
132071
- name: "Scam Warning",
132072
- description: "The moderators believe this account publishes fraudulent content."
132073
- }
132074
- },
132075
- content: {
132076
- en: {
132077
- name: "Scam Warning",
132078
- description: "The moderators believe this is fraudulent content."
132079
- }
132080
- }
132081
- }
132082
- },
132083
- misleading: {
132084
- id: "misleading",
132085
- preferences: ["ignore", "warn", "hide"],
132086
- flags: [],
132087
- onwarn: "alert",
132088
- groupId: "misinfo",
132089
- configurable: true,
132090
- strings: {
132091
- settings: {
132092
- en: {
132093
- name: "Misleading",
132094
- description: "Accounts which share misleading information."
132095
- }
132096
- },
132097
- account: {
132098
- en: {
132099
- name: "Misleading",
132100
- description: "The moderators believe this account is spreading misleading information."
132101
- }
132102
- },
132103
- content: {
132104
- en: {
132105
- name: "Misleading",
132106
- description: "The moderators believe this account is spreading misleading information."
132107
- }
132108
- }
132109
- }
132110
- }
132111
- };
132112
-
132113
- // ../api/src/moderation/const/label-groups.ts
132114
- var LABEL_GROUPS = {
132115
- system: {
132116
- id: "system",
132117
- configurable: false,
132118
- labels: [
132119
- LABELS["!hide"],
132120
- LABELS["!no-promote"],
132121
- LABELS["!warn"],
132122
- LABELS["!no-unauthenticated"]
132123
- ],
132124
- strings: {
132125
- settings: {
132126
- en: {
132127
- name: "System",
132128
- description: "Moderator overrides for special cases."
132129
- }
132130
- }
132131
- }
132132
- },
132133
- legal: {
132134
- id: "legal",
132135
- configurable: false,
132136
- labels: [LABELS["dmca-violation"], LABELS["doxxing"]],
132137
- strings: {
132138
- settings: {
132139
- en: {
132140
- name: "Legal",
132141
- description: "Content removed for legal reasons."
132142
- }
132143
- }
132144
- }
132145
- },
132146
- sexual: {
132147
- id: "sexual",
132148
- configurable: true,
132149
- labels: [LABELS["porn"], LABELS["sexual"], LABELS["nudity"]],
132150
- strings: {
132151
- settings: {
132152
- en: {
132153
- name: "Adult Content",
132154
- description: "Content which is sexual in nature."
132155
- }
132156
- }
132157
- }
132158
- },
132159
- violence: {
132160
- id: "violence",
132161
- configurable: true,
132162
- labels: [
132163
- LABELS["nsfl"],
132164
- LABELS["corpse"],
132165
- LABELS["gore"],
132166
- LABELS["torture"],
132167
- LABELS["self-harm"]
132168
- ],
132169
- strings: {
132170
- settings: {
132171
- en: {
132172
- name: "Violence",
132173
- description: "Content which is violent or deeply disturbing."
132174
- }
132175
- }
132176
- }
132177
- },
132178
- intolerance: {
132179
- id: "intolerance",
132180
- configurable: true,
132181
- labels: [
132182
- LABELS["intolerant-race"],
132183
- LABELS["intolerant-gender"],
132184
- LABELS["intolerant-sexual-orientation"],
132185
- LABELS["intolerant-religion"],
132186
- LABELS["intolerant"],
132187
- LABELS["icon-intolerant"]
132188
- ],
132189
- strings: {
132190
- settings: {
132191
- en: {
132192
- name: "Intolerance",
132193
- description: "Content or behavior which is hateful or intolerant toward a group of people."
132194
- }
132195
- }
132196
- }
132197
- },
132198
- rude: {
132199
- id: "rude",
132200
- configurable: true,
132201
- labels: [LABELS["threat"]],
132202
- strings: {
132203
- settings: {
132204
- en: {
132205
- name: "Rude",
132206
- description: "Behavior which is rude toward other users."
132207
- }
132208
- }
132209
- }
132210
- },
132211
- curation: {
132212
- id: "curation",
132213
- configurable: true,
132214
- labels: [LABELS["spoiler"]],
132215
- strings: {
132216
- settings: {
132217
- en: {
132218
- name: "Curational",
132219
- description: "Subjective moderation geared towards curating a more positive environment."
132220
- }
132221
- }
132222
- }
132223
- },
132224
- spam: {
132225
- id: "spam",
132226
- configurable: true,
132227
- labels: [LABELS["spam"]],
132228
- strings: {
132229
- settings: {
132230
- en: {
132231
- name: "Spam",
132232
- description: "Content which doesn't add to the conversation."
132233
- }
132234
- }
132235
- }
132236
- },
132237
- misinfo: {
132238
- id: "misinfo",
132239
- configurable: true,
132240
- labels: [
132241
- LABELS["account-security"],
132242
- LABELS["net-abuse"],
132243
- LABELS["impersonation"],
132244
- LABELS["scam"],
132245
- LABELS["misleading"]
132246
- ],
132247
- strings: {
132248
- settings: {
132249
- en: {
132250
- name: "Misinformation",
132251
- description: "Content which misleads or defrauds users."
132252
- }
132253
- }
132254
- }
132255
- }
132256
- };
132257
-
132258
132025
  // src/db/index.ts
132259
132026
  var import_assert3 = __toESM(require("assert"));
132260
132027
  var import_pg = __toESM(require_lib7());
@@ -132911,11 +132678,13 @@ var jsonb = (val) => {
132911
132678
 
132912
132679
  // src/mod-service/status.ts
132913
132680
  var getSubjectStatusForModerationEvent = ({
132681
+ currentStatus,
132914
132682
  action,
132915
132683
  createdBy,
132916
132684
  createdAt,
132917
132685
  durationInHours
132918
132686
  }) => {
132687
+ const defaultReviewState = currentStatus ? currentStatus.reviewState : REVIEWNONE;
132919
132688
  switch (action) {
132920
132689
  case "com.atproto.admin.defs#modEventAcknowledge":
132921
132690
  return {
@@ -132946,7 +132715,7 @@ var getSubjectStatusForModerationEvent = ({
132946
132715
  return {
132947
132716
  lastReviewedBy: createdBy,
132948
132717
  muteUntil: null,
132949
- reviewState: REVIEWOPEN,
132718
+ reviewState: defaultReviewState,
132950
132719
  lastReviewedAt: createdAt
132951
132720
  };
132952
132721
  case "com.atproto.admin.defs#modEventTakedown":
@@ -132960,23 +132729,24 @@ var getSubjectStatusForModerationEvent = ({
132960
132729
  case "com.atproto.admin.defs#modEventMute":
132961
132730
  return {
132962
132731
  lastReviewedBy: createdBy,
132963
- reviewState: REVIEWOPEN,
132964
132732
  lastReviewedAt: createdAt,
132965
- muteUntil: new Date(Date.now() + (durationInHours || 24) * HOUR).toISOString()
132733
+ muteUntil: new Date(Date.now() + (durationInHours || 24) * HOUR).toISOString(),
132734
+ reviewState: defaultReviewState
132966
132735
  };
132967
132736
  case "com.atproto.admin.defs#modEventComment":
132968
132737
  return {
132969
132738
  lastReviewedBy: createdBy,
132970
- lastReviewedAt: createdAt
132739
+ lastReviewedAt: createdAt,
132740
+ reviewState: defaultReviewState
132971
132741
  };
132972
132742
  case "com.atproto.admin.defs#modEventTag":
132973
- return { tags: [] };
132743
+ return { tags: [], reviewState: defaultReviewState };
132974
132744
  case "com.atproto.admin.defs#modEventResolveAppeal":
132975
132745
  return {
132976
132746
  appealed: false
132977
132747
  };
132978
132748
  default:
132979
- return null;
132749
+ return {};
132980
132750
  }
132981
132751
  };
132982
132752
  var adjustModerationSubjectStatus = async (db, moderationEvent, blobCids) => {
@@ -132992,26 +132762,27 @@ var adjustModerationSubjectStatus = async (db, moderationEvent, blobCids) => {
132992
132762
  comment,
132993
132763
  createdAt
132994
132764
  } = moderationEvent;
132765
+ const identifier = getStatusIdentifierFromSubject(subjectUri || subjectDid);
132766
+ db.assertTransaction();
132767
+ const currentStatus = await db.db.selectFrom("moderation_subject_status").where("did", "=", identifier.did).where("recordPath", "=", identifier.recordPath).forUpdate().selectAll().executeTakeFirst();
132995
132768
  const isAppealEvent = action === "com.atproto.admin.defs#modEventReport" && meta?.reportType === REASONAPPEAL;
132996
132769
  const subjectStatus = getSubjectStatusForModerationEvent({
132770
+ currentStatus,
132997
132771
  action,
132998
132772
  createdBy,
132999
132773
  createdAt,
133000
132774
  durationInHours: moderationEvent.durationInHours
133001
132775
  });
133002
- if (!subjectStatus) {
133003
- return null;
133004
- }
133005
132776
  const now = new Date().toISOString();
133006
- const identifier = getStatusIdentifierFromSubject(subjectUri || subjectDid);
133007
- db.assertTransaction();
133008
- const currentStatus = await db.db.selectFrom("moderation_subject_status").where("did", "=", identifier.did).where("recordPath", "=", identifier.recordPath).selectAll().executeTakeFirst();
133009
- if (currentStatus?.reviewState === REVIEWESCALATED && subjectStatus.reviewState === REVIEWOPEN) {
132777
+ if (currentStatus?.reviewState === REVIEWESCALATED && subjectStatus.reviewState !== REVIEWCLOSED) {
133010
132778
  subjectStatus.reviewState = REVIEWESCALATED;
133011
132779
  }
132780
+ if (currentStatus && subjectStatus.reviewState === REVIEWNONE) {
132781
+ subjectStatus.reviewState = currentStatus.reviewState;
132782
+ }
133012
132783
  const defaultData = {
133013
132784
  comment: null,
133014
- reviewState: REVIEWOPEN,
132785
+ reviewState: REVIEWNONE,
133015
132786
  recordCid: subjectCid || null
133016
132787
  };
133017
132788
  const newStatus = {
@@ -133458,7 +133229,7 @@ var ModerationService = class {
133458
133229
  }
133459
133230
  async takedownRepo(subject, takedownId, isSuspend = false) {
133460
133231
  const takedownRef = `BSKY-${isSuspend ? "SUSPEND" : "TAKEDOWN"}-${takedownId}`;
133461
- const values = TAKEDOWNS.map((eventType) => ({
133232
+ const values = this.eventPusher.takedowns.map((eventType) => ({
133462
133233
  eventType,
133463
133234
  subjectDid: subject.did,
133464
133235
  takedownRef
@@ -133497,7 +133268,7 @@ var ModerationService = class {
133497
133268
  async takedownRecord(subject, takedownId) {
133498
133269
  this.db.assertTransaction();
133499
133270
  const takedownRef = `BSKY-TAKEDOWN-${takedownId}`;
133500
- const values = TAKEDOWNS.map((eventType) => ({
133271
+ const values = this.eventPusher.takedowns.map((eventType) => ({
133501
133272
  eventType,
133502
133273
  subjectDid: subject.did,
133503
133274
  subjectUri: subject.uri,
@@ -133525,7 +133296,7 @@ var ModerationService = class {
133525
133296
  });
133526
133297
  if (blobCids && blobCids.length > 0) {
133527
133298
  const blobValues = [];
133528
- for (const eventType of TAKEDOWNS) {
133299
+ for (const eventType of this.eventPusher.takedowns) {
133529
133300
  for (const cid2 of blobCids) {
133530
133301
  blobValues.push({
133531
133302
  eventType,
@@ -133795,10 +133566,10 @@ var BackgroundQueue = class {
133795
133566
  };
133796
133567
 
133797
133568
  // src/context.ts
133798
- var import_assert5 = __toESM(require("assert"));
133569
+ var import_assert4 = __toESM(require("assert"));
133799
133570
 
133800
133571
  // src/daemon/event-pusher.ts
133801
- var import_assert4 = __toESM(require("assert"));
133572
+ var import_node_assert = __toESM(require("node:assert"));
133802
133573
  var EventPusher = class {
133803
133574
  constructor(db, createAuthHeaders, services) {
133804
133575
  this.db = db;
@@ -133831,6 +133602,14 @@ var EventPusher = class {
133831
133602
  this.poll(this.recordPollState, () => this.pushRecordEvents());
133832
133603
  this.poll(this.blobPollState, () => this.pushBlobEvents());
133833
133604
  }
133605
+ get takedowns() {
133606
+ const takedowns = [];
133607
+ if (this.pds)
133608
+ takedowns.push("pds_takedown");
133609
+ if (this.appview)
133610
+ takedowns.push("appview_takedown");
133611
+ return takedowns;
133612
+ }
133834
133613
  poll(state, fn) {
133835
133614
  if (this.destroyed)
133836
133615
  return;
@@ -133901,7 +133680,7 @@ var EventPusher = class {
133901
133680
  if (!evt)
133902
133681
  return;
133903
133682
  const service2 = evt.eventType === "pds_takedown" ? this.pds : this.appview;
133904
- (0, import_assert4.default)(service2);
133683
+ (0, import_node_assert.default)(service2);
133905
133684
  const subject = {
133906
133685
  $type: "com.atproto.admin.defs#repoRef",
133907
133686
  did: evt.subjectDid
@@ -133919,7 +133698,7 @@ var EventPusher = class {
133919
133698
  if (!evt)
133920
133699
  return;
133921
133700
  const service2 = evt.eventType === "pds_takedown" ? this.pds : this.appview;
133922
- (0, import_assert4.default)(service2);
133701
+ (0, import_node_assert.default)(service2);
133923
133702
  const subject = {
133924
133703
  $type: "com.atproto.repo.strongRef",
133925
133704
  uri: evt.subjectUri,
@@ -133938,7 +133717,7 @@ var EventPusher = class {
133938
133717
  if (!evt)
133939
133718
  return;
133940
133719
  const service2 = evt.eventType === "pds_takedown" ? this.pds : this.appview;
133941
- (0, import_assert4.default)(service2);
133720
+ (0, import_node_assert.default)(service2);
133942
133721
  const subject = {
133943
133722
  $type: "com.atproto.admin.defs#repoBlobRef",
133944
133723
  did: evt.subjectDid,
@@ -134019,12 +133798,12 @@ var DaemonContext = class {
134019
133798
  const signingKey = await Secp256k1Keypair.import(secrets.signingKeyHex);
134020
133799
  const appviewAgent = new AtpAgent({ service: cfg.appview.url });
134021
133800
  const createAuthHeaders = (aud) => createServiceAuthHeaders({
134022
- iss: cfg.service.did,
133801
+ iss: `${cfg.service.did}#atproto_labeler`,
134023
133802
  aud,
134024
133803
  keypair: signingKey
134025
133804
  });
134026
133805
  const eventPusher = new EventPusher(db, createAuthHeaders, {
134027
- appview: cfg.appview,
133806
+ appview: cfg.appview.pushEvents ? cfg.appview : void 0,
134028
133807
  pds: cfg.pds ?? void 0
134029
133808
  });
134030
133809
  const backgroundQueue = new BackgroundQueue(db);
@@ -134250,11 +134029,11 @@ var CommunicationTemplateService = class {
134250
134029
  var AuthVerifier3 = class {
134251
134030
  constructor(idResolver, opts) {
134252
134031
  this.idResolver = idResolver;
134253
- this.modOrRole = async (reqCtx) => {
134254
- if (isBearerToken(reqCtx.req)) {
134255
- return this.moderator(reqCtx);
134032
+ this.modOrAdminToken = async (reqCtx) => {
134033
+ if (isBasicToken(reqCtx.req)) {
134034
+ return this.adminToken(reqCtx);
134256
134035
  } else {
134257
- return this.role(reqCtx);
134036
+ return this.moderator(reqCtx);
134258
134037
  }
134259
134038
  };
134260
134039
  this.moderator = async (reqCtx) => {
@@ -134301,33 +134080,27 @@ var AuthVerifier3 = class {
134301
134080
  }
134302
134081
  return this.nullCreds();
134303
134082
  };
134304
- this.standardOptionalOrRole = async (reqCtx) => {
134083
+ this.standardOptionalOrAdminToken = async (reqCtx) => {
134305
134084
  if (isBearerToken(reqCtx.req)) {
134306
134085
  return this.standard(reqCtx);
134307
134086
  } else if (isBasicToken(reqCtx.req)) {
134308
- return this.role(reqCtx);
134087
+ return this.adminToken(reqCtx);
134309
134088
  } else {
134310
134089
  return this.nullCreds();
134311
134090
  }
134312
134091
  };
134313
- this.role = async (reqCtx) => {
134092
+ this.adminToken = async (reqCtx) => {
134314
134093
  const parsed = parseBasicAuth(reqCtx.req.headers.authorization ?? "");
134315
134094
  const { username, password } = parsed ?? {};
134316
- if (username !== "admin") {
134317
- throw new AuthRequiredError();
134318
- }
134319
- const isAdmin = password === this.adminPassword;
134320
- const isModerator = isAdmin || password === this.moderatorPassword;
134321
- const isTriage = isModerator || password === this.triagePassword;
134322
- if (!isTriage) {
134095
+ if (username !== "admin" || password !== this.adminPassword) {
134323
134096
  throw new AuthRequiredError();
134324
134097
  }
134325
134098
  return {
134326
134099
  credentials: {
134327
- type: "role",
134328
- isAdmin,
134329
- isModerator,
134330
- isTriage
134100
+ type: "admin_token",
134101
+ isAdmin: true,
134102
+ isModerator: true,
134103
+ isTriage: true
134331
134104
  }
134332
134105
  };
134333
134106
  };
@@ -134336,8 +134109,6 @@ var AuthVerifier3 = class {
134336
134109
  this.moderators = opts.moderators;
134337
134110
  this.triage = opts.triage;
134338
134111
  this.adminPassword = opts.adminPassword;
134339
- this.moderatorPassword = opts.moderatorPassword;
134340
- this.triagePassword = opts.triagePassword;
134341
134112
  }
134342
134113
  nullCreds() {
134343
134114
  return {
@@ -134403,7 +134174,7 @@ var AppContext = class {
134403
134174
  });
134404
134175
  const backgroundQueue = new BackgroundQueue(db);
134405
134176
  const eventPusher = new EventPusher(db, createAuthHeaders, {
134406
- appview: cfg.appview,
134177
+ appview: cfg.appview.pushEvents ? cfg.appview : void 0,
134407
134178
  pds: cfg.pds ?? void 0
134408
134179
  });
134409
134180
  const idResolver = new IdResolver({
@@ -134417,9 +134188,7 @@ var AppContext = class {
134417
134188
  admins: cfg.access.admins,
134418
134189
  moderators: cfg.access.moderators,
134419
134190
  triage: cfg.access.triage,
134420
- adminPassword: secrets.adminPassword,
134421
- moderatorPassword: secrets.moderatorPassword,
134422
- triagePassword: secrets.triagePassword
134191
+ adminPassword: secrets.adminPassword
134423
134192
  });
134424
134193
  return new AppContext({
134425
134194
  db,
@@ -134437,7 +134206,7 @@ var AppContext = class {
134437
134206
  }, secrets);
134438
134207
  }
134439
134208
  assignPort(port) {
134440
- (0, import_assert5.default)(!this.cfg.service.port || this.cfg.service.port === port, "Conflicting port in config");
134209
+ (0, import_assert4.default)(!this.cfg.service.port || this.cfg.service.port === port, "Conflicting port in config");
134441
134210
  this.opts.cfg.service.port = port;
134442
134211
  }
134443
134212
  get db() {
@@ -134497,11 +134266,11 @@ var AppContext = class {
134497
134266
  var context_default2 = AppContext;
134498
134267
 
134499
134268
  // src/config/config.ts
134500
- var import_node_assert = __toESM(require("node:assert"));
134269
+ var import_node_assert2 = __toESM(require("node:assert"));
134501
134270
  var envToCfg = (env) => {
134502
134271
  const port = env.port ?? 3e3;
134503
- (0, import_node_assert.default)(env.publicUrl);
134504
- (0, import_node_assert.default)(env.serverDid);
134272
+ (0, import_node_assert2.default)(env.publicUrl);
134273
+ (0, import_node_assert2.default)(env.serverDid);
134505
134274
  const serviceCfg = {
134506
134275
  port,
134507
134276
  publicUrl: env.publicUrl,
@@ -134509,7 +134278,7 @@ var envToCfg = (env) => {
134509
134278
  version: env.version,
134510
134279
  devMode: env.devMode
134511
134280
  };
134512
- (0, import_node_assert.default)(env.dbPostgresUrl);
134281
+ (0, import_node_assert2.default)(env.dbPostgresUrl);
134513
134282
  const dbCfg = {
134514
134283
  postgresUrl: env.dbPostgresUrl,
134515
134284
  postgresSchema: env.dbPostgresSchema,
@@ -134517,22 +134286,24 @@ var envToCfg = (env) => {
134517
134286
  poolMaxUses: env.dbPoolMaxUses,
134518
134287
  poolIdleTimeoutMs: env.dbPoolIdleTimeoutMs
134519
134288
  };
134520
- (0, import_node_assert.default)(env.appviewUrl);
134521
- (0, import_node_assert.default)(env.appviewDid);
134289
+ (0, import_node_assert2.default)(env.appviewUrl && env.appviewDid);
134522
134290
  const appviewCfg = {
134523
134291
  url: env.appviewUrl,
134524
- did: env.appviewDid
134525
- };
134526
- (0, import_node_assert.default)(env.pdsUrl);
134527
- (0, import_node_assert.default)(env.pdsDid);
134528
- const pdsCfg = {
134529
- url: env.pdsUrl,
134530
- did: env.pdsDid
134292
+ did: env.appviewDid,
134293
+ pushEvents: !!env.appviewPushEvents
134531
134294
  };
134295
+ let pdsCfg = null;
134296
+ if (env.pdsUrl || env.pdsDid) {
134297
+ (0, import_node_assert2.default)(env.pdsUrl && env.pdsDid);
134298
+ pdsCfg = {
134299
+ url: env.pdsUrl,
134300
+ did: env.pdsDid
134301
+ };
134302
+ }
134532
134303
  const cdnCfg = {
134533
134304
  paths: env.cdnPaths
134534
134305
  };
134535
- (0, import_node_assert.default)(env.didPlcUrl);
134306
+ (0, import_node_assert2.default)(env.didPlcUrl);
134536
134307
  const identityCfg = {
134537
134308
  plcUrl: env.didPlcUrl
134538
134309
  };
@@ -134563,6 +134334,7 @@ var readEnv = () => {
134563
134334
  serverDid: envStr("OZONE_SERVER_DID"),
134564
134335
  appviewUrl: envStr("OZONE_APPVIEW_URL"),
134565
134336
  appviewDid: envStr("OZONE_APPVIEW_DID"),
134337
+ appviewPushEvents: envBool("OZONE_APPVIEW_PUSH_EVENTS"),
134566
134338
  pdsUrl: envStr("OZONE_PDS_URL"),
134567
134339
  pdsDid: envStr("OZONE_PDS_DID"),
134568
134340
  dbPostgresUrl: envStr("OZONE_DB_POSTGRES_URL"),
@@ -134576,23 +134348,17 @@ var readEnv = () => {
134576
134348
  moderatorDids: envList("OZONE_MODERATOR_DIDS"),
134577
134349
  triageDids: envList("OZONE_TRIAGE_DIDS"),
134578
134350
  adminPassword: envStr("OZONE_ADMIN_PASSWORD"),
134579
- moderatorPassword: envStr("OZONE_MODERATOR_PASSWORD"),
134580
- triagePassword: envStr("OZONE_TRIAGE_PASSWORD"),
134581
134351
  signingKeyHex: envStr("OZONE_SIGNING_KEY_HEX")
134582
134352
  };
134583
134353
  };
134584
134354
 
134585
134355
  // src/config/secrets.ts
134586
- var import_assert6 = __toESM(require("assert"));
134356
+ var import_assert5 = __toESM(require("assert"));
134587
134357
  var envToSecrets = (env) => {
134588
- (0, import_assert6.default)(env.adminPassword);
134589
- (0, import_assert6.default)(env.moderatorPassword);
134590
- (0, import_assert6.default)(env.triagePassword);
134591
- (0, import_assert6.default)(env.signingKeyHex);
134358
+ (0, import_assert5.default)(env.adminPassword);
134359
+ (0, import_assert5.default)(env.signingKeyHex);
134592
134360
  return {
134593
134361
  adminPassword: env.adminPassword,
134594
- moderatorPassword: env.moderatorPassword,
134595
- triagePassword: env.triagePassword,
134596
134362
  signingKeyHex: env.signingKeyHex
134597
134363
  };
134598
134364
  };