@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
@@ -747,6 +747,7 @@ export const schemaDict = {
747
747
  'lex:com.atproto.admin.defs#reviewOpen',
748
748
  'lex:com.atproto.admin.defs#reviewEscalated',
749
749
  'lex:com.atproto.admin.defs#reviewClosed',
750
+ 'lex:com.atproto.admin.defs#reviewNone',
750
751
  ],
751
752
  },
752
753
  reviewOpen: {
@@ -764,6 +765,11 @@ export const schemaDict = {
764
765
  description:
765
766
  'Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator',
766
767
  },
768
+ reviewNone: {
769
+ type: 'token',
770
+ description:
771
+ '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',
772
+ },
767
773
  modEventTakedown: {
768
774
  type: 'object',
769
775
  description: 'Take down a subject permanently or temporarily',
@@ -2261,6 +2267,83 @@ export const schemaDict = {
2261
2267
  },
2262
2268
  },
2263
2269
  },
2270
+ labelValueDefinition: {
2271
+ type: 'object',
2272
+ description:
2273
+ 'Declares a label value and its expected interpertations and behaviors.',
2274
+ required: ['identifier', 'severity', 'blurs', 'locales'],
2275
+ properties: {
2276
+ identifier: {
2277
+ type: 'string',
2278
+ description:
2279
+ "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).",
2280
+ maxLength: 100,
2281
+ maxGraphemes: 100,
2282
+ },
2283
+ severity: {
2284
+ type: 'string',
2285
+ description:
2286
+ "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.",
2287
+ knownValues: ['inform', 'alert', 'none'],
2288
+ },
2289
+ blurs: {
2290
+ type: 'string',
2291
+ description:
2292
+ "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.",
2293
+ knownValues: ['content', 'media', 'none'],
2294
+ },
2295
+ locales: {
2296
+ type: 'array',
2297
+ items: {
2298
+ type: 'ref',
2299
+ ref: 'lex:com.atproto.label.defs#labelValueDefinitionStrings',
2300
+ },
2301
+ },
2302
+ },
2303
+ },
2304
+ labelValueDefinitionStrings: {
2305
+ type: 'object',
2306
+ description:
2307
+ 'Strings which describe the label in the UI, localized into a specific language.',
2308
+ required: ['lang', 'name', 'description'],
2309
+ properties: {
2310
+ lang: {
2311
+ type: 'string',
2312
+ description:
2313
+ 'The code of the language these strings are written in.',
2314
+ format: 'language',
2315
+ },
2316
+ name: {
2317
+ type: 'string',
2318
+ description: 'A short human-readable name for the label.',
2319
+ maxGraphemes: 64,
2320
+ maxLength: 640,
2321
+ },
2322
+ description: {
2323
+ type: 'string',
2324
+ description:
2325
+ 'A longer description of what the label means and why it might be applied.',
2326
+ maxGraphemes: 10000,
2327
+ maxLength: 100000,
2328
+ },
2329
+ },
2330
+ },
2331
+ labelValue: {
2332
+ type: 'string',
2333
+ knownValues: [
2334
+ '!hide',
2335
+ '!no-promote',
2336
+ '!warn',
2337
+ '!no-unauthenticated',
2338
+ 'dmca-violation',
2339
+ 'doxxing',
2340
+ 'porn',
2341
+ 'sexual',
2342
+ 'nudity',
2343
+ 'nsfl',
2344
+ 'gore',
2345
+ ],
2346
+ },
2264
2347
  },
2265
2348
  },
2266
2349
  ComAtprotoLabelQueryLabels: {
@@ -5044,6 +5127,10 @@ export const schemaDict = {
5044
5127
  postsCount: {
5045
5128
  type: 'integer',
5046
5129
  },
5130
+ associated: {
5131
+ type: 'ref',
5132
+ ref: 'lex:app.bsky.actor.defs#profileAssociated',
5133
+ },
5047
5134
  indexedAt: {
5048
5135
  type: 'string',
5049
5136
  format: 'datetime',
@@ -5061,6 +5148,20 @@ export const schemaDict = {
5061
5148
  },
5062
5149
  },
5063
5150
  },
5151
+ profileAssociated: {
5152
+ type: 'object',
5153
+ properties: {
5154
+ lists: {
5155
+ type: 'integer',
5156
+ },
5157
+ feedgens: {
5158
+ type: 'integer',
5159
+ },
5160
+ labeler: {
5161
+ type: 'boolean',
5162
+ },
5163
+ },
5164
+ },
5064
5165
  viewerState: {
5065
5166
  type: 'object',
5066
5167
  description:
@@ -5125,12 +5226,18 @@ export const schemaDict = {
5125
5226
  type: 'object',
5126
5227
  required: ['label', 'visibility'],
5127
5228
  properties: {
5229
+ labelerDid: {
5230
+ type: 'string',
5231
+ description:
5232
+ 'Which labeler does this preference apply to? If undefined, applies globally.',
5233
+ format: 'did',
5234
+ },
5128
5235
  label: {
5129
5236
  type: 'string',
5130
5237
  },
5131
5238
  visibility: {
5132
5239
  type: 'string',
5133
- knownValues: ['show', 'warn', 'hide'],
5240
+ knownValues: ['ignore', 'show', 'warn', 'hide'],
5134
5241
  },
5135
5242
  },
5136
5243
  },
@@ -5288,6 +5395,29 @@ export const schemaDict = {
5288
5395
  },
5289
5396
  },
5290
5397
  },
5398
+ modsPref: {
5399
+ type: 'object',
5400
+ required: ['mods'],
5401
+ properties: {
5402
+ mods: {
5403
+ type: 'array',
5404
+ items: {
5405
+ type: 'ref',
5406
+ ref: 'lex:app.bsky.actor.defs#modPrefItem',
5407
+ },
5408
+ },
5409
+ },
5410
+ },
5411
+ modPrefItem: {
5412
+ type: 'object',
5413
+ required: ['did'],
5414
+ properties: {
5415
+ did: {
5416
+ type: 'string',
5417
+ format: 'did',
5418
+ },
5419
+ },
5420
+ },
5291
5421
  },
5292
5422
  },
5293
5423
  AppBskyActorGetPreferences: {
@@ -5792,6 +5922,7 @@ export const schemaDict = {
5792
5922
  'lex:app.bsky.embed.record#viewBlocked',
5793
5923
  'lex:app.bsky.feed.defs#generatorView',
5794
5924
  'lex:app.bsky.graph.defs#listView',
5925
+ 'lex:app.bsky.labeler.defs#labelerView',
5795
5926
  ],
5796
5927
  },
5797
5928
  },
@@ -8333,6 +8464,198 @@ export const schemaDict = {
8333
8464
  },
8334
8465
  },
8335
8466
  },
8467
+ AppBskyLabelerDefs: {
8468
+ lexicon: 1,
8469
+ id: 'app.bsky.labeler.defs',
8470
+ defs: {
8471
+ labelerView: {
8472
+ type: 'object',
8473
+ required: ['uri', 'cid', 'creator', 'indexedAt'],
8474
+ properties: {
8475
+ uri: {
8476
+ type: 'string',
8477
+ format: 'at-uri',
8478
+ },
8479
+ cid: {
8480
+ type: 'string',
8481
+ format: 'cid',
8482
+ },
8483
+ creator: {
8484
+ type: 'ref',
8485
+ ref: 'lex:app.bsky.actor.defs#profileView',
8486
+ },
8487
+ likeCount: {
8488
+ type: 'integer',
8489
+ minimum: 0,
8490
+ },
8491
+ viewer: {
8492
+ type: 'ref',
8493
+ ref: 'lex:app.bsky.labeler.defs#labelerViewerState',
8494
+ },
8495
+ indexedAt: {
8496
+ type: 'string',
8497
+ format: 'datetime',
8498
+ },
8499
+ labels: {
8500
+ type: 'array',
8501
+ items: {
8502
+ type: 'ref',
8503
+ ref: 'lex:com.atproto.label.defs#label',
8504
+ },
8505
+ },
8506
+ },
8507
+ },
8508
+ labelerViewDetailed: {
8509
+ type: 'object',
8510
+ required: ['uri', 'cid', 'creator', 'policies', 'indexedAt'],
8511
+ properties: {
8512
+ uri: {
8513
+ type: 'string',
8514
+ format: 'at-uri',
8515
+ },
8516
+ cid: {
8517
+ type: 'string',
8518
+ format: 'cid',
8519
+ },
8520
+ creator: {
8521
+ type: 'ref',
8522
+ ref: 'lex:app.bsky.actor.defs#profileView',
8523
+ },
8524
+ policies: {
8525
+ type: 'ref',
8526
+ ref: 'lex:app.bsky.labeler.defs#labelerPolicies',
8527
+ },
8528
+ likeCount: {
8529
+ type: 'integer',
8530
+ minimum: 0,
8531
+ },
8532
+ viewer: {
8533
+ type: 'ref',
8534
+ ref: 'lex:app.bsky.labeler.defs#labelerViewerState',
8535
+ },
8536
+ indexedAt: {
8537
+ type: 'string',
8538
+ format: 'datetime',
8539
+ },
8540
+ labels: {
8541
+ type: 'array',
8542
+ items: {
8543
+ type: 'ref',
8544
+ ref: 'lex:com.atproto.label.defs#label',
8545
+ },
8546
+ },
8547
+ },
8548
+ },
8549
+ labelerViewerState: {
8550
+ type: 'object',
8551
+ properties: {
8552
+ like: {
8553
+ type: 'string',
8554
+ format: 'at-uri',
8555
+ },
8556
+ },
8557
+ },
8558
+ labelerPolicies: {
8559
+ type: 'object',
8560
+ required: ['labelValues'],
8561
+ properties: {
8562
+ labelValues: {
8563
+ type: 'array',
8564
+ description:
8565
+ 'The label values which this labeler publishes. May include global or custom labels.',
8566
+ items: {
8567
+ type: 'ref',
8568
+ ref: 'lex:com.atproto.label.defs#labelValue',
8569
+ },
8570
+ },
8571
+ labelValueDefinitions: {
8572
+ type: 'array',
8573
+ description:
8574
+ 'Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.',
8575
+ items: {
8576
+ type: 'ref',
8577
+ ref: 'lex:com.atproto.label.defs#labelValueDefinition',
8578
+ },
8579
+ },
8580
+ },
8581
+ },
8582
+ },
8583
+ },
8584
+ AppBskyLabelerGetServices: {
8585
+ lexicon: 1,
8586
+ id: 'app.bsky.labeler.getServices',
8587
+ defs: {
8588
+ main: {
8589
+ type: 'query',
8590
+ description: 'Get information about a list of labeler services.',
8591
+ parameters: {
8592
+ type: 'params',
8593
+ required: ['dids'],
8594
+ properties: {
8595
+ dids: {
8596
+ type: 'array',
8597
+ items: {
8598
+ type: 'string',
8599
+ format: 'did',
8600
+ },
8601
+ },
8602
+ detailed: {
8603
+ type: 'boolean',
8604
+ default: false,
8605
+ },
8606
+ },
8607
+ },
8608
+ output: {
8609
+ encoding: 'application/json',
8610
+ schema: {
8611
+ type: 'object',
8612
+ required: ['views'],
8613
+ properties: {
8614
+ views: {
8615
+ type: 'array',
8616
+ items: {
8617
+ type: 'union',
8618
+ refs: [
8619
+ 'lex:app.bsky.labeler.defs#labelerView',
8620
+ 'lex:app.bsky.labeler.defs#labelerViewDetailed',
8621
+ ],
8622
+ },
8623
+ },
8624
+ },
8625
+ },
8626
+ },
8627
+ },
8628
+ },
8629
+ },
8630
+ AppBskyLabelerService: {
8631
+ lexicon: 1,
8632
+ id: 'app.bsky.labeler.service',
8633
+ defs: {
8634
+ main: {
8635
+ type: 'record',
8636
+ description: 'A declaration of the existence of labeler service.',
8637
+ key: 'literal:self',
8638
+ record: {
8639
+ type: 'object',
8640
+ required: ['policies', 'createdAt'],
8641
+ properties: {
8642
+ policies: {
8643
+ type: 'ref',
8644
+ ref: 'lex:app.bsky.labeler.defs#labelerPolicies',
8645
+ },
8646
+ labels: {
8647
+ type: 'union',
8648
+ refs: ['lex:com.atproto.label.defs#selfLabels'],
8649
+ },
8650
+ createdAt: {
8651
+ type: 'string',
8652
+ format: 'datetime',
8653
+ },
8654
+ },
8655
+ },
8656
+ },
8657
+ },
8658
+ },
8336
8659
  AppBskyNotificationGetUnreadCount: {
8337
8660
  lexicon: 1,
8338
8661
  id: 'app.bsky.notification.getUnreadCount',
@@ -9026,6 +9349,9 @@ export const ids = {
9026
9349
  AppBskyGraphMuteActorList: 'app.bsky.graph.muteActorList',
9027
9350
  AppBskyGraphUnmuteActor: 'app.bsky.graph.unmuteActor',
9028
9351
  AppBskyGraphUnmuteActorList: 'app.bsky.graph.unmuteActorList',
9352
+ AppBskyLabelerDefs: 'app.bsky.labeler.defs',
9353
+ AppBskyLabelerGetServices: 'app.bsky.labeler.getServices',
9354
+ AppBskyLabelerService: 'app.bsky.labeler.service',
9029
9355
  AppBskyNotificationGetUnreadCount: 'app.bsky.notification.getUnreadCount',
9030
9356
  AppBskyNotificationListNotifications:
9031
9357
  'app.bsky.notification.listNotifications',
@@ -64,6 +64,7 @@ export interface ProfileViewDetailed {
64
64
  followersCount?: number
65
65
  followsCount?: number
66
66
  postsCount?: number
67
+ associated?: ProfileAssociated
67
68
  indexedAt?: string
68
69
  viewer?: ViewerState
69
70
  labels?: ComAtprotoLabelDefs.Label[]
@@ -82,6 +83,25 @@ export function validateProfileViewDetailed(v: unknown): ValidationResult {
82
83
  return lexicons.validate('app.bsky.actor.defs#profileViewDetailed', v)
83
84
  }
84
85
 
86
+ export interface ProfileAssociated {
87
+ lists?: number
88
+ feedgens?: number
89
+ labeler?: boolean
90
+ [k: string]: unknown
91
+ }
92
+
93
+ export function isProfileAssociated(v: unknown): v is ProfileAssociated {
94
+ return (
95
+ isObj(v) &&
96
+ hasProp(v, '$type') &&
97
+ v.$type === 'app.bsky.actor.defs#profileAssociated'
98
+ )
99
+ }
100
+
101
+ export function validateProfileAssociated(v: unknown): ValidationResult {
102
+ return lexicons.validate('app.bsky.actor.defs#profileAssociated', v)
103
+ }
104
+
85
105
  /** Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. */
86
106
  export interface ViewerState {
87
107
  muted?: boolean
@@ -137,8 +157,10 @@ export function validateAdultContentPref(v: unknown): ValidationResult {
137
157
  }
138
158
 
139
159
  export interface ContentLabelPref {
160
+ /** Which labeler does this preference apply to? If undefined, applies globally. */
161
+ labelerDid?: string
140
162
  label: string
141
- visibility: 'show' | 'warn' | 'hide' | (string & {})
163
+ visibility: 'ignore' | 'show' | 'warn' | 'hide' | (string & {})
142
164
  [k: string]: unknown
143
165
  }
144
166
 
@@ -315,3 +337,37 @@ export function isHiddenPostsPref(v: unknown): v is HiddenPostsPref {
315
337
  export function validateHiddenPostsPref(v: unknown): ValidationResult {
316
338
  return lexicons.validate('app.bsky.actor.defs#hiddenPostsPref', v)
317
339
  }
340
+
341
+ export interface ModsPref {
342
+ mods: ModPrefItem[]
343
+ [k: string]: unknown
344
+ }
345
+
346
+ export function isModsPref(v: unknown): v is ModsPref {
347
+ return (
348
+ isObj(v) &&
349
+ hasProp(v, '$type') &&
350
+ v.$type === 'app.bsky.actor.defs#modsPref'
351
+ )
352
+ }
353
+
354
+ export function validateModsPref(v: unknown): ValidationResult {
355
+ return lexicons.validate('app.bsky.actor.defs#modsPref', v)
356
+ }
357
+
358
+ export interface ModPrefItem {
359
+ did: string
360
+ [k: string]: unknown
361
+ }
362
+
363
+ export function isModPrefItem(v: unknown): v is ModPrefItem {
364
+ return (
365
+ isObj(v) &&
366
+ hasProp(v, '$type') &&
367
+ v.$type === 'app.bsky.actor.defs#modPrefItem'
368
+ )
369
+ }
370
+
371
+ export function validateModPrefItem(v: unknown): ValidationResult {
372
+ return lexicons.validate('app.bsky.actor.defs#modPrefItem', v)
373
+ }
@@ -8,6 +8,7 @@ import { CID } from 'multiformats/cid'
8
8
  import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
9
9
  import * as AppBskyFeedDefs from '../feed/defs'
10
10
  import * as AppBskyGraphDefs from '../graph/defs'
11
+ import * as AppBskyLabelerDefs from '../labeler/defs'
11
12
  import * as AppBskyActorDefs from '../actor/defs'
12
13
  import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
13
14
  import * as AppBskyEmbedImages from './images'
@@ -39,6 +40,7 @@ export interface View {
39
40
  | ViewBlocked
40
41
  | AppBskyFeedDefs.GeneratorView
41
42
  | AppBskyGraphDefs.ListView
43
+ | AppBskyLabelerDefs.LabelerView
42
44
  | { $type: string; [k: string]: unknown }
43
45
  [k: string]: unknown
44
46
  }
@@ -0,0 +1,93 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { lexicons } from '../../../../lexicons'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { CID } from 'multiformats/cid'
8
+ import * as AppBskyActorDefs from '../actor/defs'
9
+ import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
10
+
11
+ export interface LabelerView {
12
+ uri: string
13
+ cid: string
14
+ creator: AppBskyActorDefs.ProfileView
15
+ likeCount?: number
16
+ viewer?: LabelerViewerState
17
+ indexedAt: string
18
+ labels?: ComAtprotoLabelDefs.Label[]
19
+ [k: string]: unknown
20
+ }
21
+
22
+ export function isLabelerView(v: unknown): v is LabelerView {
23
+ return (
24
+ isObj(v) &&
25
+ hasProp(v, '$type') &&
26
+ v.$type === 'app.bsky.labeler.defs#labelerView'
27
+ )
28
+ }
29
+
30
+ export function validateLabelerView(v: unknown): ValidationResult {
31
+ return lexicons.validate('app.bsky.labeler.defs#labelerView', v)
32
+ }
33
+
34
+ export interface LabelerViewDetailed {
35
+ uri: string
36
+ cid: string
37
+ creator: AppBskyActorDefs.ProfileView
38
+ policies: LabelerPolicies
39
+ likeCount?: number
40
+ viewer?: LabelerViewerState
41
+ indexedAt: string
42
+ labels?: ComAtprotoLabelDefs.Label[]
43
+ [k: string]: unknown
44
+ }
45
+
46
+ export function isLabelerViewDetailed(v: unknown): v is LabelerViewDetailed {
47
+ return (
48
+ isObj(v) &&
49
+ hasProp(v, '$type') &&
50
+ v.$type === 'app.bsky.labeler.defs#labelerViewDetailed'
51
+ )
52
+ }
53
+
54
+ export function validateLabelerViewDetailed(v: unknown): ValidationResult {
55
+ return lexicons.validate('app.bsky.labeler.defs#labelerViewDetailed', v)
56
+ }
57
+
58
+ export interface LabelerViewerState {
59
+ like?: string
60
+ [k: string]: unknown
61
+ }
62
+
63
+ export function isLabelerViewerState(v: unknown): v is LabelerViewerState {
64
+ return (
65
+ isObj(v) &&
66
+ hasProp(v, '$type') &&
67
+ v.$type === 'app.bsky.labeler.defs#labelerViewerState'
68
+ )
69
+ }
70
+
71
+ export function validateLabelerViewerState(v: unknown): ValidationResult {
72
+ return lexicons.validate('app.bsky.labeler.defs#labelerViewerState', v)
73
+ }
74
+
75
+ export interface LabelerPolicies {
76
+ /** The label values which this labeler publishes. May include global or custom labels. */
77
+ labelValues: ComAtprotoLabelDefs.LabelValue[]
78
+ /** Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler. */
79
+ labelValueDefinitions?: ComAtprotoLabelDefs.LabelValueDefinition[]
80
+ [k: string]: unknown
81
+ }
82
+
83
+ export function isLabelerPolicies(v: unknown): v is LabelerPolicies {
84
+ return (
85
+ isObj(v) &&
86
+ hasProp(v, '$type') &&
87
+ v.$type === 'app.bsky.labeler.defs#labelerPolicies'
88
+ )
89
+ }
90
+
91
+ export function validateLabelerPolicies(v: unknown): ValidationResult {
92
+ return lexicons.validate('app.bsky.labeler.defs#labelerPolicies', v)
93
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
10
+ import * as AppBskyLabelerDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ dids: string[]
14
+ detailed: boolean
15
+ }
16
+
17
+ export type InputSchema = undefined
18
+
19
+ export interface OutputSchema {
20
+ views: (
21
+ | AppBskyLabelerDefs.LabelerView
22
+ | AppBskyLabelerDefs.LabelerViewDetailed
23
+ | { $type: string; [k: string]: unknown }
24
+ )[]
25
+ [k: string]: unknown
26
+ }
27
+
28
+ export type HandlerInput = undefined
29
+
30
+ export interface HandlerSuccess {
31
+ encoding: 'application/json'
32
+ body: OutputSchema
33
+ headers?: { [key: string]: string }
34
+ }
35
+
36
+ export interface HandlerError {
37
+ status: number
38
+ message?: string
39
+ }
40
+
41
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
42
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
43
+ auth: HA
44
+ params: QueryParams
45
+ input: HandlerInput
46
+ req: express.Request
47
+ res: express.Response
48
+ }
49
+ export type Handler<HA extends HandlerAuth = never> = (
50
+ ctx: HandlerReqCtx<HA>,
51
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,31 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { lexicons } from '../../../../lexicons'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { CID } from 'multiformats/cid'
8
+ import * as AppBskyLabelerDefs from './defs'
9
+ import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
10
+
11
+ export interface Record {
12
+ policies: AppBskyLabelerDefs.LabelerPolicies
13
+ labels?:
14
+ | ComAtprotoLabelDefs.SelfLabels
15
+ | { $type: string; [k: string]: unknown }
16
+ createdAt: string
17
+ [k: string]: unknown
18
+ }
19
+
20
+ export function isRecord(v: unknown): v is Record {
21
+ return (
22
+ isObj(v) &&
23
+ hasProp(v, '$type') &&
24
+ (v.$type === 'app.bsky.labeler.service#main' ||
25
+ v.$type === 'app.bsky.labeler.service')
26
+ )
27
+ }
28
+
29
+ export function validateRecord(v: unknown): ValidationResult {
30
+ return lexicons.validate('app.bsky.labeler.service#main', v)
31
+ }
@@ -497,6 +497,7 @@ export type SubjectReviewState =
497
497
  | 'lex:com.atproto.admin.defs#reviewOpen'
498
498
  | 'lex:com.atproto.admin.defs#reviewEscalated'
499
499
  | 'lex:com.atproto.admin.defs#reviewClosed'
500
+ | 'lex:com.atproto.admin.defs#reviewNone'
500
501
  | (string & {})
501
502
 
502
503
  /** Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator */
@@ -505,6 +506,8 @@ export const REVIEWOPEN = 'com.atproto.admin.defs#reviewOpen'
505
506
  export const REVIEWESCALATED = 'com.atproto.admin.defs#reviewEscalated'
506
507
  /** Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator */
507
508
  export const REVIEWCLOSED = 'com.atproto.admin.defs#reviewClosed'
509
+ /** 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 */
510
+ export const REVIEWNONE = 'com.atproto.admin.defs#reviewNone'
508
511
 
509
512
  /** Take down a subject permanently or temporarily */
510
513
  export interface ModEventTakedown {