@atproto/pds 0.4.193 → 0.4.195

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 (82) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/actor-store/blob/transactor.d.ts.map +1 -1
  3. package/dist/actor-store/blob/transactor.js +1 -0
  4. package/dist/actor-store/blob/transactor.js.map +1 -1
  5. package/dist/actor-store/record/reader.d.ts.map +1 -1
  6. package/dist/actor-store/record/reader.js +1 -0
  7. package/dist/actor-store/record/reader.js.map +1 -1
  8. package/dist/actor-store/record/transactor.d.ts.map +1 -1
  9. package/dist/actor-store/record/transactor.js +1 -0
  10. package/dist/actor-store/record/transactor.js.map +1 -1
  11. package/dist/api/com/atproto/repo/importRepo.d.ts.map +1 -1
  12. package/dist/api/com/atproto/repo/importRepo.js +1 -0
  13. package/dist/api/com/atproto/repo/importRepo.js.map +1 -1
  14. package/dist/lexicon/index.d.ts +11 -0
  15. package/dist/lexicon/index.d.ts.map +1 -1
  16. package/dist/lexicon/index.js +32 -1
  17. package/dist/lexicon/index.js.map +1 -1
  18. package/dist/lexicon/lexicons.d.ts +806 -6
  19. package/dist/lexicon/lexicons.d.ts.map +1 -1
  20. package/dist/lexicon/lexicons.js +425 -3
  21. package/dist/lexicon/lexicons.js.map +1 -1
  22. package/dist/lexicon/types/app/bsky/ageassurance/begin.d.ts +31 -0
  23. package/dist/lexicon/types/app/bsky/ageassurance/begin.d.ts.map +1 -0
  24. package/dist/lexicon/types/app/bsky/ageassurance/begin.js +7 -0
  25. package/dist/lexicon/types/app/bsky/ageassurance/begin.js.map +1 -0
  26. package/dist/lexicon/types/app/bsky/ageassurance/defs.d.ts +138 -0
  27. package/dist/lexicon/types/app/bsky/ageassurance/defs.d.ts.map +1 -0
  28. package/dist/lexicon/types/app/bsky/ageassurance/defs.js +115 -0
  29. package/dist/lexicon/types/app/bsky/ageassurance/defs.js.map +1 -0
  30. package/dist/lexicon/types/app/bsky/ageassurance/getConfig.d.ts +18 -0
  31. package/dist/lexicon/types/app/bsky/ageassurance/getConfig.d.ts.map +1 -0
  32. package/dist/lexicon/types/app/bsky/ageassurance/getConfig.js +7 -0
  33. package/dist/lexicon/types/app/bsky/ageassurance/getConfig.js.map +1 -0
  34. package/dist/lexicon/types/app/bsky/ageassurance/getState.d.ts +24 -0
  35. package/dist/lexicon/types/app/bsky/ageassurance/getState.d.ts.map +1 -0
  36. package/dist/lexicon/types/app/bsky/ageassurance/getState.js +7 -0
  37. package/dist/lexicon/types/app/bsky/ageassurance/getState.js.map +1 -0
  38. package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts +13 -2
  39. package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts.map +1 -1
  40. package/dist/lexicon/types/tools/ozone/moderation/defs.js.map +1 -1
  41. package/dist/lexicon/types/tools/ozone/moderation/queryStatuses.d.ts +1 -1
  42. package/dist/lexicon/types/tools/ozone/moderation/queryStatuses.d.ts.map +1 -1
  43. package/dist/lexicon/types/tools/ozone/moderation/queryStatuses.js.map +1 -1
  44. package/dist/lexicon/types/tools/ozone/moderation/scheduleAction.d.ts +10 -0
  45. package/dist/lexicon/types/tools/ozone/moderation/scheduleAction.d.ts.map +1 -1
  46. package/dist/lexicon/types/tools/ozone/moderation/scheduleAction.js.map +1 -1
  47. package/dist/repo/prepare.d.ts.map +1 -1
  48. package/dist/repo/prepare.js +1 -0
  49. package/dist/repo/prepare.js.map +1 -1
  50. package/dist/repo/types.d.ts.map +1 -1
  51. package/dist/repo/types.js +1 -0
  52. package/dist/repo/types.js.map +1 -1
  53. package/dist/sequencer/events.d.ts.map +1 -1
  54. package/dist/sequencer/events.js +1 -0
  55. package/dist/sequencer/events.js.map +1 -1
  56. package/dist/sequencer/sequencer.d.ts.map +1 -1
  57. package/dist/sequencer/sequencer.js +1 -0
  58. package/dist/sequencer/sequencer.js.map +1 -1
  59. package/package.json +18 -16
  60. package/src/actor-store/blob/transactor.ts +2 -0
  61. package/src/actor-store/record/reader.ts +2 -0
  62. package/src/actor-store/record/transactor.ts +2 -0
  63. package/src/api/com/atproto/repo/importRepo.ts +2 -0
  64. package/src/lexicon/index.ts +49 -0
  65. package/src/lexicon/lexicons.ts +458 -3
  66. package/src/lexicon/types/app/bsky/ageassurance/begin.ts +54 -0
  67. package/src/lexicon/types/app/bsky/ageassurance/defs.ts +301 -0
  68. package/src/lexicon/types/app/bsky/ageassurance/getConfig.ts +34 -0
  69. package/src/lexicon/types/app/bsky/ageassurance/getState.ts +42 -0
  70. package/src/lexicon/types/tools/ozone/moderation/defs.ts +13 -2
  71. package/src/lexicon/types/tools/ozone/moderation/queryStatuses.ts +6 -1
  72. package/src/lexicon/types/tools/ozone/moderation/scheduleAction.ts +10 -0
  73. package/src/repo/prepare.ts +2 -0
  74. package/src/repo/types.ts +2 -0
  75. package/src/sequencer/events.ts +2 -0
  76. package/src/sequencer/sequencer.ts +2 -0
  77. package/tests/crud.test.ts +2 -1
  78. package/tests/oauth.test.ts +3 -3
  79. package/tests/sequencer.test.ts +2 -0
  80. package/tests/sync/subscribe-repos.test.ts +3 -1
  81. package/tests/sync/sync.test.ts +2 -0
  82. package/tsconfig.build.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"defs.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/defs.ts"],"names":[],"mappings":";;;AAkEA,wCAEC;AAED,oDAEC;AA6CD,oDAEC;AAED,gEAEC;AAmDD,kDAEC;AAED,8DAEC;AAeD,sCAEC;AAED,kDAEC;AAmBD,wCAEC;AAED,oDAEC;AAyBD,wCAEC;AAED,oDAEC;AAiBD,0CAEC;AAED,sDAEC;AAsCD,gDAEC;AAED,4DAEC;AAiBD,8DAEC;AAED,0EAMC;AAWD,0DAEC;AAED,sEAEC;AAYD,8CAEC;AAED,0DAEC;AAaD,4CAEC;AAED,wDAEC;AAcD,0CAEC;AAED,sDAEC;AAWD,0DAEC;AAED,sEAEC;AAuBD,kDAEC;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E,EAAE,WAAW,CAAC,CAAA;AACrC,CAAC;AAED,SAAgB,eAAe,CAAI,CAAI;IACrC,OAAO,QAAQ,CAAc,CAAC,EAAE,EAAE,EAAE,WAAW,CAAC,CAAA;AAClD,CAAC;AAED,iEAAiE;AACpD,QAAA,sBAAsB,GAAG,GAAG,EAAE,yBAAyB,CAAA;AACpE,gEAAgE;AACnD,QAAA,yBAAyB,GAAG,GAAG,EAAE,4BAA4B,CAAA;AAC1E,oEAAoE;AACvD,QAAA,yBAAyB,GAAG,GAAG,EAAE,4BAA4B,CAAA;AAqC1E,MAAM,uBAAuB,GAAG,qBAAqB,CAAA;AAErD,SAAgB,qBAAqB,CAAI,CAAI;IAC3C,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAuB,CAAC,CAAA;AACjD,CAAC;AAED,SAAgB,2BAA2B,CAAI,CAAI;IACjD,OAAO,QAAQ,CAA0B,CAAC,EAAE,EAAE,EAAE,uBAAuB,CAAC,CAAA;AAC1E,CAAC","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as ComAtprotoAdminDefs from '../../../com/atproto/admin/defs.js'\nimport type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js'\nimport type * as ChatBskyConvoDefs from '../../../chat/bsky/convo/defs.js'\nimport type * as ComAtprotoModerationDefs from '../../../com/atproto/moderation/defs.js'\nimport type * as ComAtprotoServerDefs from '../../../com/atproto/server/defs.js'\nimport type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'tools.ozone.moderation.defs'\n\nexport interface ModEventView {\n $type?: 'tools.ozone.moderation.defs#modEventView'\n id: number\n event:\n | $Typed<ModEventTakedown>\n | $Typed<ModEventReverseTakedown>\n | $Typed<ModEventComment>\n | $Typed<ModEventReport>\n | $Typed<ModEventLabel>\n | $Typed<ModEventAcknowledge>\n | $Typed<ModEventEscalate>\n | $Typed<ModEventMute>\n | $Typed<ModEventUnmute>\n | $Typed<ModEventMuteReporter>\n | $Typed<ModEventUnmuteReporter>\n | $Typed<ModEventEmail>\n | $Typed<ModEventResolveAppeal>\n | $Typed<ModEventDivert>\n | $Typed<ModEventTag>\n | $Typed<AccountEvent>\n | $Typed<IdentityEvent>\n | $Typed<RecordEvent>\n | $Typed<ModEventPriorityScore>\n | $Typed<AgeAssuranceEvent>\n | $Typed<AgeAssuranceOverrideEvent>\n | $Typed<RevokeAccountCredentialsEvent>\n | $Typed<ScheduleTakedownEvent>\n | $Typed<CancelScheduledTakedownEvent>\n | { $type: string }\n subject:\n | $Typed<ComAtprotoAdminDefs.RepoRef>\n | $Typed<ComAtprotoRepoStrongRef.Main>\n | $Typed<ChatBskyConvoDefs.MessageRef>\n | { $type: string }\n subjectBlobCids: string[]\n createdBy: string\n createdAt: string\n creatorHandle?: string\n subjectHandle?: string\n modTool?: ModTool\n}\n\nconst hashModEventView = 'modEventView'\n\nexport function isModEventView<V>(v: V) {\n return is$typed(v, id, hashModEventView)\n}\n\nexport function validateModEventView<V>(v: V) {\n return validate<ModEventView & V>(v, id, hashModEventView)\n}\n\nexport interface ModEventViewDetail {\n $type?: 'tools.ozone.moderation.defs#modEventViewDetail'\n id: number\n event:\n | $Typed<ModEventTakedown>\n | $Typed<ModEventReverseTakedown>\n | $Typed<ModEventComment>\n | $Typed<ModEventReport>\n | $Typed<ModEventLabel>\n | $Typed<ModEventAcknowledge>\n | $Typed<ModEventEscalate>\n | $Typed<ModEventMute>\n | $Typed<ModEventUnmute>\n | $Typed<ModEventMuteReporter>\n | $Typed<ModEventUnmuteReporter>\n | $Typed<ModEventEmail>\n | $Typed<ModEventResolveAppeal>\n | $Typed<ModEventDivert>\n | $Typed<ModEventTag>\n | $Typed<AccountEvent>\n | $Typed<IdentityEvent>\n | $Typed<RecordEvent>\n | $Typed<ModEventPriorityScore>\n | $Typed<AgeAssuranceEvent>\n | $Typed<AgeAssuranceOverrideEvent>\n | $Typed<RevokeAccountCredentialsEvent>\n | $Typed<ScheduleTakedownEvent>\n | $Typed<CancelScheduledTakedownEvent>\n | { $type: string }\n subject:\n | $Typed<RepoView>\n | $Typed<RepoViewNotFound>\n | $Typed<RecordView>\n | $Typed<RecordViewNotFound>\n | { $type: string }\n subjectBlobs: BlobView[]\n createdBy: string\n createdAt: string\n modTool?: ModTool\n}\n\nconst hashModEventViewDetail = 'modEventViewDetail'\n\nexport function isModEventViewDetail<V>(v: V) {\n return is$typed(v, id, hashModEventViewDetail)\n}\n\nexport function validateModEventViewDetail<V>(v: V) {\n return validate<ModEventViewDetail & V>(v, id, hashModEventViewDetail)\n}\n\nexport interface SubjectStatusView {\n $type?: 'tools.ozone.moderation.defs#subjectStatusView'\n id: number\n subject:\n | $Typed<ComAtprotoAdminDefs.RepoRef>\n | $Typed<ComAtprotoRepoStrongRef.Main>\n | $Typed<ChatBskyConvoDefs.MessageRef>\n | { $type: string }\n hosting?: $Typed<AccountHosting> | $Typed<RecordHosting> | { $type: string }\n subjectBlobCids?: string[]\n subjectRepoHandle?: string\n /** Timestamp referencing when the last update was made to the moderation status of the subject */\n updatedAt: string\n /** Timestamp referencing the first moderation status impacting event was emitted on the subject */\n createdAt: string\n reviewState: SubjectReviewState\n /** Sticky comment on the subject. */\n comment?: string\n /** Numeric value representing the level of priority. Higher score means higher priority. */\n priorityScore?: number\n muteUntil?: string\n muteReportingUntil?: string\n lastReviewedBy?: string\n lastReviewedAt?: string\n lastReportedAt?: string\n /** Timestamp referencing when the author of the subject appealed a moderation action */\n lastAppealedAt?: string\n takendown?: boolean\n /** True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators. */\n appealed?: boolean\n suspendUntil?: string\n tags?: string[]\n accountStats?: AccountStats\n recordsStats?: RecordsStats\n accountStrike?: AccountStrike\n /** Current age assurance state of the subject. */\n ageAssuranceState?:\n | 'pending'\n | 'assured'\n | 'unknown'\n | 'reset'\n | 'blocked'\n | (string & {})\n /** Whether or not the last successful update to age assurance was made by the user or admin. */\n ageAssuranceUpdatedBy?: 'admin' | 'user' | (string & {})\n}\n\nconst hashSubjectStatusView = 'subjectStatusView'\n\nexport function isSubjectStatusView<V>(v: V) {\n return is$typed(v, id, hashSubjectStatusView)\n}\n\nexport function validateSubjectStatusView<V>(v: V) {\n return validate<SubjectStatusView & V>(v, id, hashSubjectStatusView)\n}\n\n/** Detailed view of a subject. For record subjects, the author's repo and profile will be returned. */\nexport interface SubjectView {\n $type?: 'tools.ozone.moderation.defs#subjectView'\n type: ComAtprotoModerationDefs.SubjectType\n subject: string\n status?: SubjectStatusView\n repo?: RepoViewDetail\n profile?: { $type: string }\n record?: RecordViewDetail\n}\n\nconst hashSubjectView = 'subjectView'\n\nexport function isSubjectView<V>(v: V) {\n return is$typed(v, id, hashSubjectView)\n}\n\nexport function validateSubjectView<V>(v: V) {\n return validate<SubjectView & V>(v, id, hashSubjectView)\n}\n\n/** Statistics about a particular account subject */\nexport interface AccountStats {\n $type?: 'tools.ozone.moderation.defs#accountStats'\n /** Total number of reports on the account */\n reportCount?: number\n /** Total number of appeals against a moderation action on the account */\n appealCount?: number\n /** Number of times the account was suspended */\n suspendCount?: number\n /** Number of times the account was escalated */\n escalateCount?: number\n /** Number of times the account was taken down */\n takedownCount?: number\n}\n\nconst hashAccountStats = 'accountStats'\n\nexport function isAccountStats<V>(v: V) {\n return is$typed(v, id, hashAccountStats)\n}\n\nexport function validateAccountStats<V>(v: V) {\n return validate<AccountStats & V>(v, id, hashAccountStats)\n}\n\n/** Statistics about a set of record subject items */\nexport interface RecordsStats {\n $type?: 'tools.ozone.moderation.defs#recordsStats'\n /** Cumulative sum of the number of reports on the items in the set */\n totalReports?: number\n /** Number of items that were reported at least once */\n reportedCount?: number\n /** Number of items that were escalated at least once */\n escalatedCount?: number\n /** Number of items that were appealed at least once */\n appealedCount?: number\n /** Total number of item in the set */\n subjectCount?: number\n /** Number of item currently in \"reviewOpen\" or \"reviewEscalated\" state */\n pendingCount?: number\n /** Number of item currently in \"reviewNone\" or \"reviewClosed\" state */\n processedCount?: number\n /** Number of item currently taken down */\n takendownCount?: number\n}\n\nconst hashRecordsStats = 'recordsStats'\n\nexport function isRecordsStats<V>(v: V) {\n return is$typed(v, id, hashRecordsStats)\n}\n\nexport function validateRecordsStats<V>(v: V) {\n return validate<RecordsStats & V>(v, id, hashRecordsStats)\n}\n\n/** Strike information for an account */\nexport interface AccountStrike {\n $type?: 'tools.ozone.moderation.defs#accountStrike'\n /** Current number of active strikes (excluding expired strikes) */\n activeStrikeCount?: number\n /** Total number of strikes ever received (including expired strikes) */\n totalStrikeCount?: number\n /** Timestamp of the first strike received */\n firstStrikeAt?: string\n /** Timestamp of the most recent strike received */\n lastStrikeAt?: string\n}\n\nconst hashAccountStrike = 'accountStrike'\n\nexport function isAccountStrike<V>(v: V) {\n return is$typed(v, id, hashAccountStrike)\n}\n\nexport function validateAccountStrike<V>(v: V) {\n return validate<AccountStrike & V>(v, id, hashAccountStrike)\n}\n\nexport type SubjectReviewState =\n | 'lex:tools.ozone.moderation.defs#reviewOpen'\n | 'lex:tools.ozone.moderation.defs#reviewEscalated'\n | 'lex:tools.ozone.moderation.defs#reviewClosed'\n | 'lex:tools.ozone.moderation.defs#reviewNone'\n | (string & {})\n\n/** Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator */\nexport const REVIEWOPEN = `${id}#reviewOpen`\n/** Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator */\nexport const REVIEWESCALATED = `${id}#reviewEscalated`\n/** Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator */\nexport const REVIEWCLOSED = `${id}#reviewClosed`\n/** 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 */\nexport const REVIEWNONE = `${id}#reviewNone`\n\n/** Take down a subject permanently or temporarily */\nexport interface ModEventTakedown {\n $type?: 'tools.ozone.moderation.defs#modEventTakedown'\n comment?: string\n /** Indicates how long the takedown should be in effect before automatically expiring. */\n durationInHours?: number\n /** If true, all other reports on content authored by this account will be resolved (acknowledged). */\n acknowledgeAccountSubjects?: boolean\n /** Names/Keywords of the policies that drove the decision. */\n policies?: string[]\n /** Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.). */\n severityLevel?: string\n /** Number of strikes to assign to the user for this violation. */\n strikeCount?: number\n /** When the strike should expire. If not provided, the strike never expires. */\n strikeExpiresAt?: string\n}\n\nconst hashModEventTakedown = 'modEventTakedown'\n\nexport function isModEventTakedown<V>(v: V) {\n return is$typed(v, id, hashModEventTakedown)\n}\n\nexport function validateModEventTakedown<V>(v: V) {\n return validate<ModEventTakedown & V>(v, id, hashModEventTakedown)\n}\n\n/** Revert take down action on a subject */\nexport interface ModEventReverseTakedown {\n $type?: 'tools.ozone.moderation.defs#modEventReverseTakedown'\n /** Describe reasoning behind the reversal. */\n comment?: string\n /** Names/Keywords of the policy infraction for which takedown is being reversed. */\n policies?: string[]\n /** Severity level of the violation. Usually set from the last policy infraction's severity. */\n severityLevel?: string\n /** Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity. */\n strikeCount?: number\n}\n\nconst hashModEventReverseTakedown = 'modEventReverseTakedown'\n\nexport function isModEventReverseTakedown<V>(v: V) {\n return is$typed(v, id, hashModEventReverseTakedown)\n}\n\nexport function validateModEventReverseTakedown<V>(v: V) {\n return validate<ModEventReverseTakedown & V>(\n v,\n id,\n hashModEventReverseTakedown,\n )\n}\n\n/** Resolve appeal on a subject */\nexport interface ModEventResolveAppeal {\n $type?: 'tools.ozone.moderation.defs#modEventResolveAppeal'\n /** Describe resolution. */\n comment?: string\n}\n\nconst hashModEventResolveAppeal = 'modEventResolveAppeal'\n\nexport function isModEventResolveAppeal<V>(v: V) {\n return is$typed(v, id, hashModEventResolveAppeal)\n}\n\nexport function validateModEventResolveAppeal<V>(v: V) {\n return validate<ModEventResolveAppeal & V>(v, id, hashModEventResolveAppeal)\n}\n\n/** Add a comment to a subject. An empty comment will clear any previously set sticky comment. */\nexport interface ModEventComment {\n $type?: 'tools.ozone.moderation.defs#modEventComment'\n comment?: string\n /** Make the comment persistent on the subject */\n sticky?: boolean\n}\n\nconst hashModEventComment = 'modEventComment'\n\nexport function isModEventComment<V>(v: V) {\n return is$typed(v, id, hashModEventComment)\n}\n\nexport function validateModEventComment<V>(v: V) {\n return validate<ModEventComment & V>(v, id, hashModEventComment)\n}\n\n/** Report a subject */\nexport interface ModEventReport {\n $type?: 'tools.ozone.moderation.defs#modEventReport'\n comment?: string\n /** Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject. */\n isReporterMuted?: boolean\n reportType: ComAtprotoModerationDefs.ReasonType\n}\n\nconst hashModEventReport = 'modEventReport'\n\nexport function isModEventReport<V>(v: V) {\n return is$typed(v, id, hashModEventReport)\n}\n\nexport function validateModEventReport<V>(v: V) {\n return validate<ModEventReport & V>(v, id, hashModEventReport)\n}\n\n/** Apply/Negate labels on a subject */\nexport interface ModEventLabel {\n $type?: 'tools.ozone.moderation.defs#modEventLabel'\n comment?: string\n createLabelVals: string[]\n negateLabelVals: string[]\n /** Indicates how long the label will remain on the subject. Only applies on labels that are being added. */\n durationInHours?: number\n}\n\nconst hashModEventLabel = 'modEventLabel'\n\nexport function isModEventLabel<V>(v: V) {\n return is$typed(v, id, hashModEventLabel)\n}\n\nexport function validateModEventLabel<V>(v: V) {\n return validate<ModEventLabel & V>(v, id, hashModEventLabel)\n}\n\n/** Set priority score of the subject. Higher score means higher priority. */\nexport interface ModEventPriorityScore {\n $type?: 'tools.ozone.moderation.defs#modEventPriorityScore'\n comment?: string\n score: number\n}\n\nconst hashModEventPriorityScore = 'modEventPriorityScore'\n\nexport function isModEventPriorityScore<V>(v: V) {\n return is$typed(v, id, hashModEventPriorityScore)\n}\n\nexport function validateModEventPriorityScore<V>(v: V) {\n return validate<ModEventPriorityScore & V>(v, id, hashModEventPriorityScore)\n}\n\n/** Age assurance info coming directly from users. Only works on DID subjects. */\nexport interface AgeAssuranceEvent {\n $type?: 'tools.ozone.moderation.defs#ageAssuranceEvent'\n /** The date and time of this write operation. */\n createdAt: string\n /** The status of the age assurance process. */\n status: 'unknown' | 'pending' | 'assured' | (string & {})\n /** The unique identifier for this instance of the age assurance flow, in UUID format. */\n attemptId: string\n /** The IP address used when initiating the AA flow. */\n initIp?: string\n /** The user agent used when initiating the AA flow. */\n initUa?: string\n /** The IP address used when completing the AA flow. */\n completeIp?: string\n /** The user agent used when completing the AA flow. */\n completeUa?: string\n}\n\nconst hashAgeAssuranceEvent = 'ageAssuranceEvent'\n\nexport function isAgeAssuranceEvent<V>(v: V) {\n return is$typed(v, id, hashAgeAssuranceEvent)\n}\n\nexport function validateAgeAssuranceEvent<V>(v: V) {\n return validate<AgeAssuranceEvent & V>(v, id, hashAgeAssuranceEvent)\n}\n\n/** Age assurance status override by moderators. Only works on DID subjects. */\nexport interface AgeAssuranceOverrideEvent {\n $type?: 'tools.ozone.moderation.defs#ageAssuranceOverrideEvent'\n /** The status to be set for the user decided by a moderator, overriding whatever value the user had previously. Use reset to default to original state. */\n status: 'assured' | 'reset' | 'blocked' | (string & {})\n /** Comment describing the reason for the override. */\n comment: string\n}\n\nconst hashAgeAssuranceOverrideEvent = 'ageAssuranceOverrideEvent'\n\nexport function isAgeAssuranceOverrideEvent<V>(v: V) {\n return is$typed(v, id, hashAgeAssuranceOverrideEvent)\n}\n\nexport function validateAgeAssuranceOverrideEvent<V>(v: V) {\n return validate<AgeAssuranceOverrideEvent & V>(\n v,\n id,\n hashAgeAssuranceOverrideEvent,\n )\n}\n\n/** Account credentials revocation by moderators. Only works on DID subjects. */\nexport interface RevokeAccountCredentialsEvent {\n $type?: 'tools.ozone.moderation.defs#revokeAccountCredentialsEvent'\n /** Comment describing the reason for the revocation. */\n comment: string\n}\n\nconst hashRevokeAccountCredentialsEvent = 'revokeAccountCredentialsEvent'\n\nexport function isRevokeAccountCredentialsEvent<V>(v: V) {\n return is$typed(v, id, hashRevokeAccountCredentialsEvent)\n}\n\nexport function validateRevokeAccountCredentialsEvent<V>(v: V) {\n return validate<RevokeAccountCredentialsEvent & V>(\n v,\n id,\n hashRevokeAccountCredentialsEvent,\n )\n}\n\nexport interface ModEventAcknowledge {\n $type?: 'tools.ozone.moderation.defs#modEventAcknowledge'\n comment?: string\n /** If true, all other reports on content authored by this account will be resolved (acknowledged). */\n acknowledgeAccountSubjects?: boolean\n}\n\nconst hashModEventAcknowledge = 'modEventAcknowledge'\n\nexport function isModEventAcknowledge<V>(v: V) {\n return is$typed(v, id, hashModEventAcknowledge)\n}\n\nexport function validateModEventAcknowledge<V>(v: V) {\n return validate<ModEventAcknowledge & V>(v, id, hashModEventAcknowledge)\n}\n\nexport interface ModEventEscalate {\n $type?: 'tools.ozone.moderation.defs#modEventEscalate'\n comment?: string\n}\n\nconst hashModEventEscalate = 'modEventEscalate'\n\nexport function isModEventEscalate<V>(v: V) {\n return is$typed(v, id, hashModEventEscalate)\n}\n\nexport function validateModEventEscalate<V>(v: V) {\n return validate<ModEventEscalate & V>(v, id, hashModEventEscalate)\n}\n\n/** Mute incoming reports on a subject */\nexport interface ModEventMute {\n $type?: 'tools.ozone.moderation.defs#modEventMute'\n comment?: string\n /** Indicates how long the subject should remain muted. */\n durationInHours: number\n}\n\nconst hashModEventMute = 'modEventMute'\n\nexport function isModEventMute<V>(v: V) {\n return is$typed(v, id, hashModEventMute)\n}\n\nexport function validateModEventMute<V>(v: V) {\n return validate<ModEventMute & V>(v, id, hashModEventMute)\n}\n\n/** Unmute action on a subject */\nexport interface ModEventUnmute {\n $type?: 'tools.ozone.moderation.defs#modEventUnmute'\n /** Describe reasoning behind the reversal. */\n comment?: string\n}\n\nconst hashModEventUnmute = 'modEventUnmute'\n\nexport function isModEventUnmute<V>(v: V) {\n return is$typed(v, id, hashModEventUnmute)\n}\n\nexport function validateModEventUnmute<V>(v: V) {\n return validate<ModEventUnmute & V>(v, id, hashModEventUnmute)\n}\n\n/** Mute incoming reports from an account */\nexport interface ModEventMuteReporter {\n $type?: 'tools.ozone.moderation.defs#modEventMuteReporter'\n comment?: string\n /** Indicates how long the account should remain muted. Falsy value here means a permanent mute. */\n durationInHours?: number\n}\n\nconst hashModEventMuteReporter = 'modEventMuteReporter'\n\nexport function isModEventMuteReporter<V>(v: V) {\n return is$typed(v, id, hashModEventMuteReporter)\n}\n\nexport function validateModEventMuteReporter<V>(v: V) {\n return validate<ModEventMuteReporter & V>(v, id, hashModEventMuteReporter)\n}\n\n/** Unmute incoming reports from an account */\nexport interface ModEventUnmuteReporter {\n $type?: 'tools.ozone.moderation.defs#modEventUnmuteReporter'\n /** Describe reasoning behind the reversal. */\n comment?: string\n}\n\nconst hashModEventUnmuteReporter = 'modEventUnmuteReporter'\n\nexport function isModEventUnmuteReporter<V>(v: V) {\n return is$typed(v, id, hashModEventUnmuteReporter)\n}\n\nexport function validateModEventUnmuteReporter<V>(v: V) {\n return validate<ModEventUnmuteReporter & V>(v, id, hashModEventUnmuteReporter)\n}\n\n/** Keep a log of outgoing email to a user */\nexport interface ModEventEmail {\n $type?: 'tools.ozone.moderation.defs#modEventEmail'\n /** The subject line of the email sent to the user. */\n subjectLine: string\n /** The content of the email sent to the user. */\n content?: string\n /** Additional comment about the outgoing comm. */\n comment?: string\n /** Names/Keywords of the policies that necessitated the email. */\n policies?: string[]\n /** Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense */\n severityLevel?: string\n /** Number of strikes to assign to the user for this violation. Normally 0 as an indicator of a warning and only added as a strike on a repeat offense. */\n strikeCount?: number\n /** When the strike should expire. If not provided, the strike never expires. */\n strikeExpiresAt?: string\n}\n\nconst hashModEventEmail = 'modEventEmail'\n\nexport function isModEventEmail<V>(v: V) {\n return is$typed(v, id, hashModEventEmail)\n}\n\nexport function validateModEventEmail<V>(v: V) {\n return validate<ModEventEmail & V>(v, id, hashModEventEmail)\n}\n\n/** Divert a record's blobs to a 3rd party service for further scanning/tagging */\nexport interface ModEventDivert {\n $type?: 'tools.ozone.moderation.defs#modEventDivert'\n comment?: string\n}\n\nconst hashModEventDivert = 'modEventDivert'\n\nexport function isModEventDivert<V>(v: V) {\n return is$typed(v, id, hashModEventDivert)\n}\n\nexport function validateModEventDivert<V>(v: V) {\n return validate<ModEventDivert & V>(v, id, hashModEventDivert)\n}\n\n/** Add/Remove a tag on a subject */\nexport interface ModEventTag {\n $type?: 'tools.ozone.moderation.defs#modEventTag'\n /** Tags to be added to the subject. If already exists, won't be duplicated. */\n add: string[]\n /** Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. */\n remove: string[]\n /** Additional comment about added/removed tags. */\n comment?: string\n}\n\nconst hashModEventTag = 'modEventTag'\n\nexport function isModEventTag<V>(v: V) {\n return is$typed(v, id, hashModEventTag)\n}\n\nexport function validateModEventTag<V>(v: V) {\n return validate<ModEventTag & V>(v, id, hashModEventTag)\n}\n\n/** Logs account status related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking. */\nexport interface AccountEvent {\n $type?: 'tools.ozone.moderation.defs#accountEvent'\n comment?: string\n /** Indicates that the account has a repository which can be fetched from the host that emitted this event. */\n active: boolean\n status?:\n | 'unknown'\n | 'deactivated'\n | 'deleted'\n | 'takendown'\n | 'suspended'\n | 'tombstoned'\n | (string & {})\n timestamp: string\n}\n\nconst hashAccountEvent = 'accountEvent'\n\nexport function isAccountEvent<V>(v: V) {\n return is$typed(v, id, hashAccountEvent)\n}\n\nexport function validateAccountEvent<V>(v: V) {\n return validate<AccountEvent & V>(v, id, hashAccountEvent)\n}\n\n/** Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking. */\nexport interface IdentityEvent {\n $type?: 'tools.ozone.moderation.defs#identityEvent'\n comment?: string\n handle?: string\n pdsHost?: string\n tombstone?: boolean\n timestamp: string\n}\n\nconst hashIdentityEvent = 'identityEvent'\n\nexport function isIdentityEvent<V>(v: V) {\n return is$typed(v, id, hashIdentityEvent)\n}\n\nexport function validateIdentityEvent<V>(v: V) {\n return validate<IdentityEvent & V>(v, id, hashIdentityEvent)\n}\n\n/** Logs lifecycle event on a record subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking. */\nexport interface RecordEvent {\n $type?: 'tools.ozone.moderation.defs#recordEvent'\n comment?: string\n op: 'create' | 'update' | 'delete' | (string & {})\n cid?: string\n timestamp: string\n}\n\nconst hashRecordEvent = 'recordEvent'\n\nexport function isRecordEvent<V>(v: V) {\n return is$typed(v, id, hashRecordEvent)\n}\n\nexport function validateRecordEvent<V>(v: V) {\n return validate<RecordEvent & V>(v, id, hashRecordEvent)\n}\n\n/** Logs a scheduled takedown action for an account. */\nexport interface ScheduleTakedownEvent {\n $type?: 'tools.ozone.moderation.defs#scheduleTakedownEvent'\n comment?: string\n executeAt?: string\n executeAfter?: string\n executeUntil?: string\n}\n\nconst hashScheduleTakedownEvent = 'scheduleTakedownEvent'\n\nexport function isScheduleTakedownEvent<V>(v: V) {\n return is$typed(v, id, hashScheduleTakedownEvent)\n}\n\nexport function validateScheduleTakedownEvent<V>(v: V) {\n return validate<ScheduleTakedownEvent & V>(v, id, hashScheduleTakedownEvent)\n}\n\n/** Logs cancellation of a scheduled takedown action for an account. */\nexport interface CancelScheduledTakedownEvent {\n $type?: 'tools.ozone.moderation.defs#cancelScheduledTakedownEvent'\n comment?: string\n}\n\nconst hashCancelScheduledTakedownEvent = 'cancelScheduledTakedownEvent'\n\nexport function isCancelScheduledTakedownEvent<V>(v: V) {\n return is$typed(v, id, hashCancelScheduledTakedownEvent)\n}\n\nexport function validateCancelScheduledTakedownEvent<V>(v: V) {\n return validate<CancelScheduledTakedownEvent & V>(\n v,\n id,\n hashCancelScheduledTakedownEvent,\n )\n}\n\nexport interface RepoView {\n $type?: 'tools.ozone.moderation.defs#repoView'\n did: string\n handle: string\n email?: string\n relatedRecords: { [_ in string]: unknown }[]\n indexedAt: string\n moderation: Moderation\n invitedBy?: ComAtprotoServerDefs.InviteCode\n invitesDisabled?: boolean\n inviteNote?: string\n deactivatedAt?: string\n threatSignatures?: ComAtprotoAdminDefs.ThreatSignature[]\n}\n\nconst hashRepoView = 'repoView'\n\nexport function isRepoView<V>(v: V) {\n return is$typed(v, id, hashRepoView)\n}\n\nexport function validateRepoView<V>(v: V) {\n return validate<RepoView & V>(v, id, hashRepoView)\n}\n\nexport interface RepoViewDetail {\n $type?: 'tools.ozone.moderation.defs#repoViewDetail'\n did: string\n handle: string\n email?: string\n relatedRecords: { [_ in string]: unknown }[]\n indexedAt: string\n moderation: ModerationDetail\n labels?: ComAtprotoLabelDefs.Label[]\n invitedBy?: ComAtprotoServerDefs.InviteCode\n invites?: ComAtprotoServerDefs.InviteCode[]\n invitesDisabled?: boolean\n inviteNote?: string\n emailConfirmedAt?: string\n deactivatedAt?: string\n threatSignatures?: ComAtprotoAdminDefs.ThreatSignature[]\n}\n\nconst hashRepoViewDetail = 'repoViewDetail'\n\nexport function isRepoViewDetail<V>(v: V) {\n return is$typed(v, id, hashRepoViewDetail)\n}\n\nexport function validateRepoViewDetail<V>(v: V) {\n return validate<RepoViewDetail & V>(v, id, hashRepoViewDetail)\n}\n\nexport interface RepoViewNotFound {\n $type?: 'tools.ozone.moderation.defs#repoViewNotFound'\n did: string\n}\n\nconst hashRepoViewNotFound = 'repoViewNotFound'\n\nexport function isRepoViewNotFound<V>(v: V) {\n return is$typed(v, id, hashRepoViewNotFound)\n}\n\nexport function validateRepoViewNotFound<V>(v: V) {\n return validate<RepoViewNotFound & V>(v, id, hashRepoViewNotFound)\n}\n\nexport interface RecordView {\n $type?: 'tools.ozone.moderation.defs#recordView'\n uri: string\n cid: string\n value: { [_ in string]: unknown }\n blobCids: string[]\n indexedAt: string\n moderation: Moderation\n repo: RepoView\n}\n\nconst hashRecordView = 'recordView'\n\nexport function isRecordView<V>(v: V) {\n return is$typed(v, id, hashRecordView)\n}\n\nexport function validateRecordView<V>(v: V) {\n return validate<RecordView & V>(v, id, hashRecordView)\n}\n\nexport interface RecordViewDetail {\n $type?: 'tools.ozone.moderation.defs#recordViewDetail'\n uri: string\n cid: string\n value: { [_ in string]: unknown }\n blobs: BlobView[]\n labels?: ComAtprotoLabelDefs.Label[]\n indexedAt: string\n moderation: ModerationDetail\n repo: RepoView\n}\n\nconst hashRecordViewDetail = 'recordViewDetail'\n\nexport function isRecordViewDetail<V>(v: V) {\n return is$typed(v, id, hashRecordViewDetail)\n}\n\nexport function validateRecordViewDetail<V>(v: V) {\n return validate<RecordViewDetail & V>(v, id, hashRecordViewDetail)\n}\n\nexport interface RecordViewNotFound {\n $type?: 'tools.ozone.moderation.defs#recordViewNotFound'\n uri: string\n}\n\nconst hashRecordViewNotFound = 'recordViewNotFound'\n\nexport function isRecordViewNotFound<V>(v: V) {\n return is$typed(v, id, hashRecordViewNotFound)\n}\n\nexport function validateRecordViewNotFound<V>(v: V) {\n return validate<RecordViewNotFound & V>(v, id, hashRecordViewNotFound)\n}\n\nexport interface Moderation {\n $type?: 'tools.ozone.moderation.defs#moderation'\n subjectStatus?: SubjectStatusView\n}\n\nconst hashModeration = 'moderation'\n\nexport function isModeration<V>(v: V) {\n return is$typed(v, id, hashModeration)\n}\n\nexport function validateModeration<V>(v: V) {\n return validate<Moderation & V>(v, id, hashModeration)\n}\n\nexport interface ModerationDetail {\n $type?: 'tools.ozone.moderation.defs#moderationDetail'\n subjectStatus?: SubjectStatusView\n}\n\nconst hashModerationDetail = 'moderationDetail'\n\nexport function isModerationDetail<V>(v: V) {\n return is$typed(v, id, hashModerationDetail)\n}\n\nexport function validateModerationDetail<V>(v: V) {\n return validate<ModerationDetail & V>(v, id, hashModerationDetail)\n}\n\nexport interface BlobView {\n $type?: 'tools.ozone.moderation.defs#blobView'\n cid: string\n mimeType: string\n size: number\n createdAt: string\n details?: $Typed<ImageDetails> | $Typed<VideoDetails> | { $type: string }\n moderation?: Moderation\n}\n\nconst hashBlobView = 'blobView'\n\nexport function isBlobView<V>(v: V) {\n return is$typed(v, id, hashBlobView)\n}\n\nexport function validateBlobView<V>(v: V) {\n return validate<BlobView & V>(v, id, hashBlobView)\n}\n\nexport interface ImageDetails {\n $type?: 'tools.ozone.moderation.defs#imageDetails'\n width: number\n height: number\n}\n\nconst hashImageDetails = 'imageDetails'\n\nexport function isImageDetails<V>(v: V) {\n return is$typed(v, id, hashImageDetails)\n}\n\nexport function validateImageDetails<V>(v: V) {\n return validate<ImageDetails & V>(v, id, hashImageDetails)\n}\n\nexport interface VideoDetails {\n $type?: 'tools.ozone.moderation.defs#videoDetails'\n width: number\n height: number\n length: number\n}\n\nconst hashVideoDetails = 'videoDetails'\n\nexport function isVideoDetails<V>(v: V) {\n return is$typed(v, id, hashVideoDetails)\n}\n\nexport function validateVideoDetails<V>(v: V) {\n return validate<VideoDetails & V>(v, id, hashVideoDetails)\n}\n\nexport interface AccountHosting {\n $type?: 'tools.ozone.moderation.defs#accountHosting'\n status:\n | 'takendown'\n | 'suspended'\n | 'deleted'\n | 'deactivated'\n | 'unknown'\n | (string & {})\n updatedAt?: string\n createdAt?: string\n deletedAt?: string\n deactivatedAt?: string\n reactivatedAt?: string\n}\n\nconst hashAccountHosting = 'accountHosting'\n\nexport function isAccountHosting<V>(v: V) {\n return is$typed(v, id, hashAccountHosting)\n}\n\nexport function validateAccountHosting<V>(v: V) {\n return validate<AccountHosting & V>(v, id, hashAccountHosting)\n}\n\nexport interface RecordHosting {\n $type?: 'tools.ozone.moderation.defs#recordHosting'\n status: 'deleted' | 'unknown' | (string & {})\n updatedAt?: string\n createdAt?: string\n deletedAt?: string\n}\n\nconst hashRecordHosting = 'recordHosting'\n\nexport function isRecordHosting<V>(v: V) {\n return is$typed(v, id, hashRecordHosting)\n}\n\nexport function validateRecordHosting<V>(v: V) {\n return validate<RecordHosting & V>(v, id, hashRecordHosting)\n}\n\nexport interface ReporterStats {\n $type?: 'tools.ozone.moderation.defs#reporterStats'\n did: string\n /** The total number of reports made by the user on accounts. */\n accountReportCount: number\n /** The total number of reports made by the user on records. */\n recordReportCount: number\n /** The total number of accounts reported by the user. */\n reportedAccountCount: number\n /** The total number of records reported by the user. */\n reportedRecordCount: number\n /** The total number of accounts taken down as a result of the user's reports. */\n takendownAccountCount: number\n /** The total number of records taken down as a result of the user's reports. */\n takendownRecordCount: number\n /** The total number of accounts labeled as a result of the user's reports. */\n labeledAccountCount: number\n /** The total number of records labeled as a result of the user's reports. */\n labeledRecordCount: number\n}\n\nconst hashReporterStats = 'reporterStats'\n\nexport function isReporterStats<V>(v: V) {\n return is$typed(v, id, hashReporterStats)\n}\n\nexport function validateReporterStats<V>(v: V) {\n return validate<ReporterStats & V>(v, id, hashReporterStats)\n}\n\n/** Moderation tool information for tracing the source of the action */\nexport interface ModTool {\n $type?: 'tools.ozone.moderation.defs#modTool'\n /** Name/identifier of the source (e.g., 'automod', 'ozone/workspace') */\n name: string\n /** Additional arbitrary metadata about the source */\n meta?: { [_ in string]: unknown }\n}\n\nconst hashModTool = 'modTool'\n\nexport function isModTool<V>(v: V) {\n return is$typed(v, id, hashModTool)\n}\n\nexport function validateModTool<V>(v: V) {\n return validate<ModTool & V>(v, id, hashModTool)\n}\n\n/** Moderation event timeline event for a PLC create operation */\nexport const TIMELINEEVENTPLCCREATE = `${id}#timelineEventPlcCreate`\n/** Moderation event timeline event for generic PLC operation */\nexport const TIMELINEEVENTPLCOPERATION = `${id}#timelineEventPlcOperation`\n/** Moderation event timeline event for a PLC tombstone operation */\nexport const TIMELINEEVENTPLCTOMBSTONE = `${id}#timelineEventPlcTombstone`\n\n/** View of a scheduled moderation action */\nexport interface ScheduledActionView {\n $type?: 'tools.ozone.moderation.defs#scheduledActionView'\n /** Auto-incrementing row ID */\n id: number\n /** Type of action to be executed */\n action: 'takedown' | (string & {})\n /** Serialized event object that will be propagated to the event when performed */\n eventData?: { [_ in string]: unknown }\n /** Subject DID for the action */\n did: string\n /** Exact time to execute the action */\n executeAt?: string\n /** Earliest time to execute the action (for randomized scheduling) */\n executeAfter?: string\n /** Latest time to execute the action (for randomized scheduling) */\n executeUntil?: string\n /** Whether execution time should be randomized within the specified range */\n randomizeExecution?: boolean\n /** DID of the user who created this scheduled action */\n createdBy: string\n /** When the scheduled action was created */\n createdAt: string\n /** When the scheduled action was last updated */\n updatedAt?: string\n /** Current status of the scheduled action */\n status: 'pending' | 'executed' | 'cancelled' | 'failed' | (string & {})\n /** When the action was last attempted to be executed */\n lastExecutedAt?: string\n /** Reason for the last execution failure */\n lastFailureReason?: string\n /** ID of the moderation event created when action was successfully executed */\n executionEventId?: number\n}\n\nconst hashScheduledActionView = 'scheduledActionView'\n\nexport function isScheduledActionView<V>(v: V) {\n return is$typed(v, id, hashScheduledActionView)\n}\n\nexport function validateScheduledActionView<V>(v: V) {\n return validate<ScheduledActionView & V>(v, id, hashScheduledActionView)\n}\n"]}
1
+ {"version":3,"file":"defs.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/defs.ts"],"names":[],"mappings":";;;AAmEA,wCAEC;AAED,oDAEC;AA6CD,oDAEC;AAED,gEAEC;AAmDD,kDAEC;AAED,8DAEC;AAeD,sCAEC;AAED,kDAEC;AAmBD,wCAEC;AAED,oDAEC;AAyBD,wCAEC;AAED,oDAEC;AAiBD,0CAEC;AAED,sDAEC;AAwCD,gDAEC;AAED,4DAEC;AAiBD,8DAEC;AAED,0EAMC;AAWD,0DAEC;AAED,sEAEC;AAYD,8CAEC;AAED,0DAEC;AAaD,4CAEC;AAED,wDAEC;AAcD,0CAEC;AAED,sDAEC;AAWD,0DAEC;AAED,sEAEC;AA4BD,kDAEC;AAED,8DAEC;AAcD,kEAEC;AAED,8EAMC;AAWD,0EAEC;AAED,sFAMC;AAWD,sDAEC;AAED,kEAEC;AASD,gDAEC;AAED,4DAEC;AAYD,wCAEC;AAED,oDAEC;AAWD,4CAEC;AAED,wDAEC;AAYD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AAA,sBAAsB,GAAG,GAAG,EAAE,yBAAyB,CAAA;AACpE,gEAAgE;AACnD,QAAA,yBAAyB,GAAG,GAAG,EAAE,4BAA4B,CAAA;AAC1E,oEAAoE;AACvD,QAAA,yBAAyB,GAAG,GAAG,EAAE,4BAA4B,CAAA;AAqC1E,MAAM,uBAAuB,GAAG,qBAAqB,CAAA;AAErD,SAAgB,qBAAqB,CAAI,CAAI;IAC3C,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAuB,CAAC,CAAA;AACjD,CAAC;AAED,SAAgB,2BAA2B,CAAI,CAAI;IACjD,OAAO,QAAQ,CAA0B,CAAC,EAAE,EAAE,EAAE,uBAAuB,CAAC,CAAA;AAC1E,CAAC","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as ComAtprotoAdminDefs from '../../../com/atproto/admin/defs.js'\nimport type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js'\nimport type * as ChatBskyConvoDefs from '../../../chat/bsky/convo/defs.js'\nimport type * as ComAtprotoModerationDefs from '../../../com/atproto/moderation/defs.js'\nimport type * as AppBskyAgeassuranceDefs from '../../../app/bsky/ageassurance/defs.js'\nimport type * as ComAtprotoServerDefs from '../../../com/atproto/server/defs.js'\nimport type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'tools.ozone.moderation.defs'\n\nexport interface ModEventView {\n $type?: 'tools.ozone.moderation.defs#modEventView'\n id: number\n event:\n | $Typed<ModEventTakedown>\n | $Typed<ModEventReverseTakedown>\n | $Typed<ModEventComment>\n | $Typed<ModEventReport>\n | $Typed<ModEventLabel>\n | $Typed<ModEventAcknowledge>\n | $Typed<ModEventEscalate>\n | $Typed<ModEventMute>\n | $Typed<ModEventUnmute>\n | $Typed<ModEventMuteReporter>\n | $Typed<ModEventUnmuteReporter>\n | $Typed<ModEventEmail>\n | $Typed<ModEventResolveAppeal>\n | $Typed<ModEventDivert>\n | $Typed<ModEventTag>\n | $Typed<AccountEvent>\n | $Typed<IdentityEvent>\n | $Typed<RecordEvent>\n | $Typed<ModEventPriorityScore>\n | $Typed<AgeAssuranceEvent>\n | $Typed<AgeAssuranceOverrideEvent>\n | $Typed<RevokeAccountCredentialsEvent>\n | $Typed<ScheduleTakedownEvent>\n | $Typed<CancelScheduledTakedownEvent>\n | { $type: string }\n subject:\n | $Typed<ComAtprotoAdminDefs.RepoRef>\n | $Typed<ComAtprotoRepoStrongRef.Main>\n | $Typed<ChatBskyConvoDefs.MessageRef>\n | { $type: string }\n subjectBlobCids: string[]\n createdBy: string\n createdAt: string\n creatorHandle?: string\n subjectHandle?: string\n modTool?: ModTool\n}\n\nconst hashModEventView = 'modEventView'\n\nexport function isModEventView<V>(v: V) {\n return is$typed(v, id, hashModEventView)\n}\n\nexport function validateModEventView<V>(v: V) {\n return validate<ModEventView & V>(v, id, hashModEventView)\n}\n\nexport interface ModEventViewDetail {\n $type?: 'tools.ozone.moderation.defs#modEventViewDetail'\n id: number\n event:\n | $Typed<ModEventTakedown>\n | $Typed<ModEventReverseTakedown>\n | $Typed<ModEventComment>\n | $Typed<ModEventReport>\n | $Typed<ModEventLabel>\n | $Typed<ModEventAcknowledge>\n | $Typed<ModEventEscalate>\n | $Typed<ModEventMute>\n | $Typed<ModEventUnmute>\n | $Typed<ModEventMuteReporter>\n | $Typed<ModEventUnmuteReporter>\n | $Typed<ModEventEmail>\n | $Typed<ModEventResolveAppeal>\n | $Typed<ModEventDivert>\n | $Typed<ModEventTag>\n | $Typed<AccountEvent>\n | $Typed<IdentityEvent>\n | $Typed<RecordEvent>\n | $Typed<ModEventPriorityScore>\n | $Typed<AgeAssuranceEvent>\n | $Typed<AgeAssuranceOverrideEvent>\n | $Typed<RevokeAccountCredentialsEvent>\n | $Typed<ScheduleTakedownEvent>\n | $Typed<CancelScheduledTakedownEvent>\n | { $type: string }\n subject:\n | $Typed<RepoView>\n | $Typed<RepoViewNotFound>\n | $Typed<RecordView>\n | $Typed<RecordViewNotFound>\n | { $type: string }\n subjectBlobs: BlobView[]\n createdBy: string\n createdAt: string\n modTool?: ModTool\n}\n\nconst hashModEventViewDetail = 'modEventViewDetail'\n\nexport function isModEventViewDetail<V>(v: V) {\n return is$typed(v, id, hashModEventViewDetail)\n}\n\nexport function validateModEventViewDetail<V>(v: V) {\n return validate<ModEventViewDetail & V>(v, id, hashModEventViewDetail)\n}\n\nexport interface SubjectStatusView {\n $type?: 'tools.ozone.moderation.defs#subjectStatusView'\n id: number\n subject:\n | $Typed<ComAtprotoAdminDefs.RepoRef>\n | $Typed<ComAtprotoRepoStrongRef.Main>\n | $Typed<ChatBskyConvoDefs.MessageRef>\n | { $type: string }\n hosting?: $Typed<AccountHosting> | $Typed<RecordHosting> | { $type: string }\n subjectBlobCids?: string[]\n subjectRepoHandle?: string\n /** Timestamp referencing when the last update was made to the moderation status of the subject */\n updatedAt: string\n /** Timestamp referencing the first moderation status impacting event was emitted on the subject */\n createdAt: string\n reviewState: SubjectReviewState\n /** Sticky comment on the subject. */\n comment?: string\n /** Numeric value representing the level of priority. Higher score means higher priority. */\n priorityScore?: number\n muteUntil?: string\n muteReportingUntil?: string\n lastReviewedBy?: string\n lastReviewedAt?: string\n lastReportedAt?: string\n /** Timestamp referencing when the author of the subject appealed a moderation action */\n lastAppealedAt?: string\n takendown?: boolean\n /** True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators. */\n appealed?: boolean\n suspendUntil?: string\n tags?: string[]\n accountStats?: AccountStats\n recordsStats?: RecordsStats\n accountStrike?: AccountStrike\n /** Current age assurance state of the subject. */\n ageAssuranceState?:\n | 'pending'\n | 'assured'\n | 'unknown'\n | 'reset'\n | 'blocked'\n | (string & {})\n /** Whether or not the last successful update to age assurance was made by the user or admin. */\n ageAssuranceUpdatedBy?: 'admin' | 'user' | (string & {})\n}\n\nconst hashSubjectStatusView = 'subjectStatusView'\n\nexport function isSubjectStatusView<V>(v: V) {\n return is$typed(v, id, hashSubjectStatusView)\n}\n\nexport function validateSubjectStatusView<V>(v: V) {\n return validate<SubjectStatusView & V>(v, id, hashSubjectStatusView)\n}\n\n/** Detailed view of a subject. For record subjects, the author's repo and profile will be returned. */\nexport interface SubjectView {\n $type?: 'tools.ozone.moderation.defs#subjectView'\n type: ComAtprotoModerationDefs.SubjectType\n subject: string\n status?: SubjectStatusView\n repo?: RepoViewDetail\n profile?: { $type: string }\n record?: RecordViewDetail\n}\n\nconst hashSubjectView = 'subjectView'\n\nexport function isSubjectView<V>(v: V) {\n return is$typed(v, id, hashSubjectView)\n}\n\nexport function validateSubjectView<V>(v: V) {\n return validate<SubjectView & V>(v, id, hashSubjectView)\n}\n\n/** Statistics about a particular account subject */\nexport interface AccountStats {\n $type?: 'tools.ozone.moderation.defs#accountStats'\n /** Total number of reports on the account */\n reportCount?: number\n /** Total number of appeals against a moderation action on the account */\n appealCount?: number\n /** Number of times the account was suspended */\n suspendCount?: number\n /** Number of times the account was escalated */\n escalateCount?: number\n /** Number of times the account was taken down */\n takedownCount?: number\n}\n\nconst hashAccountStats = 'accountStats'\n\nexport function isAccountStats<V>(v: V) {\n return is$typed(v, id, hashAccountStats)\n}\n\nexport function validateAccountStats<V>(v: V) {\n return validate<AccountStats & V>(v, id, hashAccountStats)\n}\n\n/** Statistics about a set of record subject items */\nexport interface RecordsStats {\n $type?: 'tools.ozone.moderation.defs#recordsStats'\n /** Cumulative sum of the number of reports on the items in the set */\n totalReports?: number\n /** Number of items that were reported at least once */\n reportedCount?: number\n /** Number of items that were escalated at least once */\n escalatedCount?: number\n /** Number of items that were appealed at least once */\n appealedCount?: number\n /** Total number of item in the set */\n subjectCount?: number\n /** Number of item currently in \"reviewOpen\" or \"reviewEscalated\" state */\n pendingCount?: number\n /** Number of item currently in \"reviewNone\" or \"reviewClosed\" state */\n processedCount?: number\n /** Number of item currently taken down */\n takendownCount?: number\n}\n\nconst hashRecordsStats = 'recordsStats'\n\nexport function isRecordsStats<V>(v: V) {\n return is$typed(v, id, hashRecordsStats)\n}\n\nexport function validateRecordsStats<V>(v: V) {\n return validate<RecordsStats & V>(v, id, hashRecordsStats)\n}\n\n/** Strike information for an account */\nexport interface AccountStrike {\n $type?: 'tools.ozone.moderation.defs#accountStrike'\n /** Current number of active strikes (excluding expired strikes) */\n activeStrikeCount?: number\n /** Total number of strikes ever received (including expired strikes) */\n totalStrikeCount?: number\n /** Timestamp of the first strike received */\n firstStrikeAt?: string\n /** Timestamp of the most recent strike received */\n lastStrikeAt?: string\n}\n\nconst hashAccountStrike = 'accountStrike'\n\nexport function isAccountStrike<V>(v: V) {\n return is$typed(v, id, hashAccountStrike)\n}\n\nexport function validateAccountStrike<V>(v: V) {\n return validate<AccountStrike & V>(v, id, hashAccountStrike)\n}\n\nexport type SubjectReviewState =\n | 'lex:tools.ozone.moderation.defs#reviewOpen'\n | 'lex:tools.ozone.moderation.defs#reviewEscalated'\n | 'lex:tools.ozone.moderation.defs#reviewClosed'\n | 'lex:tools.ozone.moderation.defs#reviewNone'\n | (string & {})\n\n/** Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator */\nexport const REVIEWOPEN = `${id}#reviewOpen`\n/** Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator */\nexport const REVIEWESCALATED = `${id}#reviewEscalated`\n/** Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator */\nexport const REVIEWCLOSED = `${id}#reviewClosed`\n/** 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 */\nexport const REVIEWNONE = `${id}#reviewNone`\n\n/** Take down a subject permanently or temporarily */\nexport interface ModEventTakedown {\n $type?: 'tools.ozone.moderation.defs#modEventTakedown'\n comment?: string\n /** Indicates how long the takedown should be in effect before automatically expiring. */\n durationInHours?: number\n /** If true, all other reports on content authored by this account will be resolved (acknowledged). */\n acknowledgeAccountSubjects?: boolean\n /** Names/Keywords of the policies that drove the decision. */\n policies?: string[]\n /** Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.). */\n severityLevel?: string\n /** List of services where the takedown should be applied. If empty or not provided, takedown is applied on all configured services. */\n targetServices?: ('appview' | 'pds' | (string & {}))[]\n /** Number of strikes to assign to the user for this violation. */\n strikeCount?: number\n /** When the strike should expire. If not provided, the strike never expires. */\n strikeExpiresAt?: string\n}\n\nconst hashModEventTakedown = 'modEventTakedown'\n\nexport function isModEventTakedown<V>(v: V) {\n return is$typed(v, id, hashModEventTakedown)\n}\n\nexport function validateModEventTakedown<V>(v: V) {\n return validate<ModEventTakedown & V>(v, id, hashModEventTakedown)\n}\n\n/** Revert take down action on a subject */\nexport interface ModEventReverseTakedown {\n $type?: 'tools.ozone.moderation.defs#modEventReverseTakedown'\n /** Describe reasoning behind the reversal. */\n comment?: string\n /** Names/Keywords of the policy infraction for which takedown is being reversed. */\n policies?: string[]\n /** Severity level of the violation. Usually set from the last policy infraction's severity. */\n severityLevel?: string\n /** Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity. */\n strikeCount?: number\n}\n\nconst hashModEventReverseTakedown = 'modEventReverseTakedown'\n\nexport function isModEventReverseTakedown<V>(v: V) {\n return is$typed(v, id, hashModEventReverseTakedown)\n}\n\nexport function validateModEventReverseTakedown<V>(v: V) {\n return validate<ModEventReverseTakedown & V>(\n v,\n id,\n hashModEventReverseTakedown,\n )\n}\n\n/** Resolve appeal on a subject */\nexport interface ModEventResolveAppeal {\n $type?: 'tools.ozone.moderation.defs#modEventResolveAppeal'\n /** Describe resolution. */\n comment?: string\n}\n\nconst hashModEventResolveAppeal = 'modEventResolveAppeal'\n\nexport function isModEventResolveAppeal<V>(v: V) {\n return is$typed(v, id, hashModEventResolveAppeal)\n}\n\nexport function validateModEventResolveAppeal<V>(v: V) {\n return validate<ModEventResolveAppeal & V>(v, id, hashModEventResolveAppeal)\n}\n\n/** Add a comment to a subject. An empty comment will clear any previously set sticky comment. */\nexport interface ModEventComment {\n $type?: 'tools.ozone.moderation.defs#modEventComment'\n comment?: string\n /** Make the comment persistent on the subject */\n sticky?: boolean\n}\n\nconst hashModEventComment = 'modEventComment'\n\nexport function isModEventComment<V>(v: V) {\n return is$typed(v, id, hashModEventComment)\n}\n\nexport function validateModEventComment<V>(v: V) {\n return validate<ModEventComment & V>(v, id, hashModEventComment)\n}\n\n/** Report a subject */\nexport interface ModEventReport {\n $type?: 'tools.ozone.moderation.defs#modEventReport'\n comment?: string\n /** Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject. */\n isReporterMuted?: boolean\n reportType: ComAtprotoModerationDefs.ReasonType\n}\n\nconst hashModEventReport = 'modEventReport'\n\nexport function isModEventReport<V>(v: V) {\n return is$typed(v, id, hashModEventReport)\n}\n\nexport function validateModEventReport<V>(v: V) {\n return validate<ModEventReport & V>(v, id, hashModEventReport)\n}\n\n/** Apply/Negate labels on a subject */\nexport interface ModEventLabel {\n $type?: 'tools.ozone.moderation.defs#modEventLabel'\n comment?: string\n createLabelVals: string[]\n negateLabelVals: string[]\n /** Indicates how long the label will remain on the subject. Only applies on labels that are being added. */\n durationInHours?: number\n}\n\nconst hashModEventLabel = 'modEventLabel'\n\nexport function isModEventLabel<V>(v: V) {\n return is$typed(v, id, hashModEventLabel)\n}\n\nexport function validateModEventLabel<V>(v: V) {\n return validate<ModEventLabel & V>(v, id, hashModEventLabel)\n}\n\n/** Set priority score of the subject. Higher score means higher priority. */\nexport interface ModEventPriorityScore {\n $type?: 'tools.ozone.moderation.defs#modEventPriorityScore'\n comment?: string\n score: number\n}\n\nconst hashModEventPriorityScore = 'modEventPriorityScore'\n\nexport function isModEventPriorityScore<V>(v: V) {\n return is$typed(v, id, hashModEventPriorityScore)\n}\n\nexport function validateModEventPriorityScore<V>(v: V) {\n return validate<ModEventPriorityScore & V>(v, id, hashModEventPriorityScore)\n}\n\n/** Age assurance info coming directly from users. Only works on DID subjects. */\nexport interface AgeAssuranceEvent {\n $type?: 'tools.ozone.moderation.defs#ageAssuranceEvent'\n /** The date and time of this write operation. */\n createdAt: string\n /** The unique identifier for this instance of the age assurance flow, in UUID format. */\n attemptId: string\n /** The status of the Age Assurance process. */\n status: 'unknown' | 'pending' | 'assured' | (string & {})\n access?: AppBskyAgeassuranceDefs.Access\n /** The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow. */\n countryCode?: string\n /** The ISO 3166-2 region code provided when beginning the Age Assurance flow. */\n regionCode?: string\n /** The IP address used when initiating the AA flow. */\n initIp?: string\n /** The user agent used when initiating the AA flow. */\n initUa?: string\n /** The IP address used when completing the AA flow. */\n completeIp?: string\n /** The user agent used when completing the AA flow. */\n completeUa?: string\n}\n\nconst hashAgeAssuranceEvent = 'ageAssuranceEvent'\n\nexport function isAgeAssuranceEvent<V>(v: V) {\n return is$typed(v, id, hashAgeAssuranceEvent)\n}\n\nexport function validateAgeAssuranceEvent<V>(v: V) {\n return validate<AgeAssuranceEvent & V>(v, id, hashAgeAssuranceEvent)\n}\n\n/** Age assurance status override by moderators. Only works on DID subjects. */\nexport interface AgeAssuranceOverrideEvent {\n $type?: 'tools.ozone.moderation.defs#ageAssuranceOverrideEvent'\n /** The status to be set for the user decided by a moderator, overriding whatever value the user had previously. Use reset to default to original state. */\n status: 'assured' | 'reset' | 'blocked' | (string & {})\n access?: AppBskyAgeassuranceDefs.Access\n /** Comment describing the reason for the override. */\n comment: string\n}\n\nconst hashAgeAssuranceOverrideEvent = 'ageAssuranceOverrideEvent'\n\nexport function isAgeAssuranceOverrideEvent<V>(v: V) {\n return is$typed(v, id, hashAgeAssuranceOverrideEvent)\n}\n\nexport function validateAgeAssuranceOverrideEvent<V>(v: V) {\n return validate<AgeAssuranceOverrideEvent & V>(\n v,\n id,\n hashAgeAssuranceOverrideEvent,\n )\n}\n\n/** Account credentials revocation by moderators. Only works on DID subjects. */\nexport interface RevokeAccountCredentialsEvent {\n $type?: 'tools.ozone.moderation.defs#revokeAccountCredentialsEvent'\n /** Comment describing the reason for the revocation. */\n comment: string\n}\n\nconst hashRevokeAccountCredentialsEvent = 'revokeAccountCredentialsEvent'\n\nexport function isRevokeAccountCredentialsEvent<V>(v: V) {\n return is$typed(v, id, hashRevokeAccountCredentialsEvent)\n}\n\nexport function validateRevokeAccountCredentialsEvent<V>(v: V) {\n return validate<RevokeAccountCredentialsEvent & V>(\n v,\n id,\n hashRevokeAccountCredentialsEvent,\n )\n}\n\nexport interface ModEventAcknowledge {\n $type?: 'tools.ozone.moderation.defs#modEventAcknowledge'\n comment?: string\n /** If true, all other reports on content authored by this account will be resolved (acknowledged). */\n acknowledgeAccountSubjects?: boolean\n}\n\nconst hashModEventAcknowledge = 'modEventAcknowledge'\n\nexport function isModEventAcknowledge<V>(v: V) {\n return is$typed(v, id, hashModEventAcknowledge)\n}\n\nexport function validateModEventAcknowledge<V>(v: V) {\n return validate<ModEventAcknowledge & V>(v, id, hashModEventAcknowledge)\n}\n\nexport interface ModEventEscalate {\n $type?: 'tools.ozone.moderation.defs#modEventEscalate'\n comment?: string\n}\n\nconst hashModEventEscalate = 'modEventEscalate'\n\nexport function isModEventEscalate<V>(v: V) {\n return is$typed(v, id, hashModEventEscalate)\n}\n\nexport function validateModEventEscalate<V>(v: V) {\n return validate<ModEventEscalate & V>(v, id, hashModEventEscalate)\n}\n\n/** Mute incoming reports on a subject */\nexport interface ModEventMute {\n $type?: 'tools.ozone.moderation.defs#modEventMute'\n comment?: string\n /** Indicates how long the subject should remain muted. */\n durationInHours: number\n}\n\nconst hashModEventMute = 'modEventMute'\n\nexport function isModEventMute<V>(v: V) {\n return is$typed(v, id, hashModEventMute)\n}\n\nexport function validateModEventMute<V>(v: V) {\n return validate<ModEventMute & V>(v, id, hashModEventMute)\n}\n\n/** Unmute action on a subject */\nexport interface ModEventUnmute {\n $type?: 'tools.ozone.moderation.defs#modEventUnmute'\n /** Describe reasoning behind the reversal. */\n comment?: string\n}\n\nconst hashModEventUnmute = 'modEventUnmute'\n\nexport function isModEventUnmute<V>(v: V) {\n return is$typed(v, id, hashModEventUnmute)\n}\n\nexport function validateModEventUnmute<V>(v: V) {\n return validate<ModEventUnmute & V>(v, id, hashModEventUnmute)\n}\n\n/** Mute incoming reports from an account */\nexport interface ModEventMuteReporter {\n $type?: 'tools.ozone.moderation.defs#modEventMuteReporter'\n comment?: string\n /** Indicates how long the account should remain muted. Falsy value here means a permanent mute. */\n durationInHours?: number\n}\n\nconst hashModEventMuteReporter = 'modEventMuteReporter'\n\nexport function isModEventMuteReporter<V>(v: V) {\n return is$typed(v, id, hashModEventMuteReporter)\n}\n\nexport function validateModEventMuteReporter<V>(v: V) {\n return validate<ModEventMuteReporter & V>(v, id, hashModEventMuteReporter)\n}\n\n/** Unmute incoming reports from an account */\nexport interface ModEventUnmuteReporter {\n $type?: 'tools.ozone.moderation.defs#modEventUnmuteReporter'\n /** Describe reasoning behind the reversal. */\n comment?: string\n}\n\nconst hashModEventUnmuteReporter = 'modEventUnmuteReporter'\n\nexport function isModEventUnmuteReporter<V>(v: V) {\n return is$typed(v, id, hashModEventUnmuteReporter)\n}\n\nexport function validateModEventUnmuteReporter<V>(v: V) {\n return validate<ModEventUnmuteReporter & V>(v, id, hashModEventUnmuteReporter)\n}\n\n/** Keep a log of outgoing email to a user */\nexport interface ModEventEmail {\n $type?: 'tools.ozone.moderation.defs#modEventEmail'\n /** The subject line of the email sent to the user. */\n subjectLine: string\n /** The content of the email sent to the user. */\n content?: string\n /** Additional comment about the outgoing comm. */\n comment?: string\n /** Names/Keywords of the policies that necessitated the email. */\n policies?: string[]\n /** Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense */\n severityLevel?: string\n /** Number of strikes to assign to the user for this violation. Normally 0 as an indicator of a warning and only added as a strike on a repeat offense. */\n strikeCount?: number\n /** When the strike should expire. If not provided, the strike never expires. */\n strikeExpiresAt?: string\n /** Indicates whether the email was successfully delivered to the user's inbox. */\n isDelivered?: boolean\n}\n\nconst hashModEventEmail = 'modEventEmail'\n\nexport function isModEventEmail<V>(v: V) {\n return is$typed(v, id, hashModEventEmail)\n}\n\nexport function validateModEventEmail<V>(v: V) {\n return validate<ModEventEmail & V>(v, id, hashModEventEmail)\n}\n\n/** Divert a record's blobs to a 3rd party service for further scanning/tagging */\nexport interface ModEventDivert {\n $type?: 'tools.ozone.moderation.defs#modEventDivert'\n comment?: string\n}\n\nconst hashModEventDivert = 'modEventDivert'\n\nexport function isModEventDivert<V>(v: V) {\n return is$typed(v, id, hashModEventDivert)\n}\n\nexport function validateModEventDivert<V>(v: V) {\n return validate<ModEventDivert & V>(v, id, hashModEventDivert)\n}\n\n/** Add/Remove a tag on a subject */\nexport interface ModEventTag {\n $type?: 'tools.ozone.moderation.defs#modEventTag'\n /** Tags to be added to the subject. If already exists, won't be duplicated. */\n add: string[]\n /** Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. */\n remove: string[]\n /** Additional comment about added/removed tags. */\n comment?: string\n}\n\nconst hashModEventTag = 'modEventTag'\n\nexport function isModEventTag<V>(v: V) {\n return is$typed(v, id, hashModEventTag)\n}\n\nexport function validateModEventTag<V>(v: V) {\n return validate<ModEventTag & V>(v, id, hashModEventTag)\n}\n\n/** Logs account status related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking. */\nexport interface AccountEvent {\n $type?: 'tools.ozone.moderation.defs#accountEvent'\n comment?: string\n /** Indicates that the account has a repository which can be fetched from the host that emitted this event. */\n active: boolean\n status?:\n | 'unknown'\n | 'deactivated'\n | 'deleted'\n | 'takendown'\n | 'suspended'\n | 'tombstoned'\n | (string & {})\n timestamp: string\n}\n\nconst hashAccountEvent = 'accountEvent'\n\nexport function isAccountEvent<V>(v: V) {\n return is$typed(v, id, hashAccountEvent)\n}\n\nexport function validateAccountEvent<V>(v: V) {\n return validate<AccountEvent & V>(v, id, hashAccountEvent)\n}\n\n/** Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking. */\nexport interface IdentityEvent {\n $type?: 'tools.ozone.moderation.defs#identityEvent'\n comment?: string\n handle?: string\n pdsHost?: string\n tombstone?: boolean\n timestamp: string\n}\n\nconst hashIdentityEvent = 'identityEvent'\n\nexport function isIdentityEvent<V>(v: V) {\n return is$typed(v, id, hashIdentityEvent)\n}\n\nexport function validateIdentityEvent<V>(v: V) {\n return validate<IdentityEvent & V>(v, id, hashIdentityEvent)\n}\n\n/** Logs lifecycle event on a record subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking. */\nexport interface RecordEvent {\n $type?: 'tools.ozone.moderation.defs#recordEvent'\n comment?: string\n op: 'create' | 'update' | 'delete' | (string & {})\n cid?: string\n timestamp: string\n}\n\nconst hashRecordEvent = 'recordEvent'\n\nexport function isRecordEvent<V>(v: V) {\n return is$typed(v, id, hashRecordEvent)\n}\n\nexport function validateRecordEvent<V>(v: V) {\n return validate<RecordEvent & V>(v, id, hashRecordEvent)\n}\n\n/** Logs a scheduled takedown action for an account. */\nexport interface ScheduleTakedownEvent {\n $type?: 'tools.ozone.moderation.defs#scheduleTakedownEvent'\n comment?: string\n executeAt?: string\n executeAfter?: string\n executeUntil?: string\n}\n\nconst hashScheduleTakedownEvent = 'scheduleTakedownEvent'\n\nexport function isScheduleTakedownEvent<V>(v: V) {\n return is$typed(v, id, hashScheduleTakedownEvent)\n}\n\nexport function validateScheduleTakedownEvent<V>(v: V) {\n return validate<ScheduleTakedownEvent & V>(v, id, hashScheduleTakedownEvent)\n}\n\n/** Logs cancellation of a scheduled takedown action for an account. */\nexport interface CancelScheduledTakedownEvent {\n $type?: 'tools.ozone.moderation.defs#cancelScheduledTakedownEvent'\n comment?: string\n}\n\nconst hashCancelScheduledTakedownEvent = 'cancelScheduledTakedownEvent'\n\nexport function isCancelScheduledTakedownEvent<V>(v: V) {\n return is$typed(v, id, hashCancelScheduledTakedownEvent)\n}\n\nexport function validateCancelScheduledTakedownEvent<V>(v: V) {\n return validate<CancelScheduledTakedownEvent & V>(\n v,\n id,\n hashCancelScheduledTakedownEvent,\n )\n}\n\nexport interface RepoView {\n $type?: 'tools.ozone.moderation.defs#repoView'\n did: string\n handle: string\n email?: string\n relatedRecords: { [_ in string]: unknown }[]\n indexedAt: string\n moderation: Moderation\n invitedBy?: ComAtprotoServerDefs.InviteCode\n invitesDisabled?: boolean\n inviteNote?: string\n deactivatedAt?: string\n threatSignatures?: ComAtprotoAdminDefs.ThreatSignature[]\n}\n\nconst hashRepoView = 'repoView'\n\nexport function isRepoView<V>(v: V) {\n return is$typed(v, id, hashRepoView)\n}\n\nexport function validateRepoView<V>(v: V) {\n return validate<RepoView & V>(v, id, hashRepoView)\n}\n\nexport interface RepoViewDetail {\n $type?: 'tools.ozone.moderation.defs#repoViewDetail'\n did: string\n handle: string\n email?: string\n relatedRecords: { [_ in string]: unknown }[]\n indexedAt: string\n moderation: ModerationDetail\n labels?: ComAtprotoLabelDefs.Label[]\n invitedBy?: ComAtprotoServerDefs.InviteCode\n invites?: ComAtprotoServerDefs.InviteCode[]\n invitesDisabled?: boolean\n inviteNote?: string\n emailConfirmedAt?: string\n deactivatedAt?: string\n threatSignatures?: ComAtprotoAdminDefs.ThreatSignature[]\n}\n\nconst hashRepoViewDetail = 'repoViewDetail'\n\nexport function isRepoViewDetail<V>(v: V) {\n return is$typed(v, id, hashRepoViewDetail)\n}\n\nexport function validateRepoViewDetail<V>(v: V) {\n return validate<RepoViewDetail & V>(v, id, hashRepoViewDetail)\n}\n\nexport interface RepoViewNotFound {\n $type?: 'tools.ozone.moderation.defs#repoViewNotFound'\n did: string\n}\n\nconst hashRepoViewNotFound = 'repoViewNotFound'\n\nexport function isRepoViewNotFound<V>(v: V) {\n return is$typed(v, id, hashRepoViewNotFound)\n}\n\nexport function validateRepoViewNotFound<V>(v: V) {\n return validate<RepoViewNotFound & V>(v, id, hashRepoViewNotFound)\n}\n\nexport interface RecordView {\n $type?: 'tools.ozone.moderation.defs#recordView'\n uri: string\n cid: string\n value: { [_ in string]: unknown }\n blobCids: string[]\n indexedAt: string\n moderation: Moderation\n repo: RepoView\n}\n\nconst hashRecordView = 'recordView'\n\nexport function isRecordView<V>(v: V) {\n return is$typed(v, id, hashRecordView)\n}\n\nexport function validateRecordView<V>(v: V) {\n return validate<RecordView & V>(v, id, hashRecordView)\n}\n\nexport interface RecordViewDetail {\n $type?: 'tools.ozone.moderation.defs#recordViewDetail'\n uri: string\n cid: string\n value: { [_ in string]: unknown }\n blobs: BlobView[]\n labels?: ComAtprotoLabelDefs.Label[]\n indexedAt: string\n moderation: ModerationDetail\n repo: RepoView\n}\n\nconst hashRecordViewDetail = 'recordViewDetail'\n\nexport function isRecordViewDetail<V>(v: V) {\n return is$typed(v, id, hashRecordViewDetail)\n}\n\nexport function validateRecordViewDetail<V>(v: V) {\n return validate<RecordViewDetail & V>(v, id, hashRecordViewDetail)\n}\n\nexport interface RecordViewNotFound {\n $type?: 'tools.ozone.moderation.defs#recordViewNotFound'\n uri: string\n}\n\nconst hashRecordViewNotFound = 'recordViewNotFound'\n\nexport function isRecordViewNotFound<V>(v: V) {\n return is$typed(v, id, hashRecordViewNotFound)\n}\n\nexport function validateRecordViewNotFound<V>(v: V) {\n return validate<RecordViewNotFound & V>(v, id, hashRecordViewNotFound)\n}\n\nexport interface Moderation {\n $type?: 'tools.ozone.moderation.defs#moderation'\n subjectStatus?: SubjectStatusView\n}\n\nconst hashModeration = 'moderation'\n\nexport function isModeration<V>(v: V) {\n return is$typed(v, id, hashModeration)\n}\n\nexport function validateModeration<V>(v: V) {\n return validate<Moderation & V>(v, id, hashModeration)\n}\n\nexport interface ModerationDetail {\n $type?: 'tools.ozone.moderation.defs#moderationDetail'\n subjectStatus?: SubjectStatusView\n}\n\nconst hashModerationDetail = 'moderationDetail'\n\nexport function isModerationDetail<V>(v: V) {\n return is$typed(v, id, hashModerationDetail)\n}\n\nexport function validateModerationDetail<V>(v: V) {\n return validate<ModerationDetail & V>(v, id, hashModerationDetail)\n}\n\nexport interface BlobView {\n $type?: 'tools.ozone.moderation.defs#blobView'\n cid: string\n mimeType: string\n size: number\n createdAt: string\n details?: $Typed<ImageDetails> | $Typed<VideoDetails> | { $type: string }\n moderation?: Moderation\n}\n\nconst hashBlobView = 'blobView'\n\nexport function isBlobView<V>(v: V) {\n return is$typed(v, id, hashBlobView)\n}\n\nexport function validateBlobView<V>(v: V) {\n return validate<BlobView & V>(v, id, hashBlobView)\n}\n\nexport interface ImageDetails {\n $type?: 'tools.ozone.moderation.defs#imageDetails'\n width: number\n height: number\n}\n\nconst hashImageDetails = 'imageDetails'\n\nexport function isImageDetails<V>(v: V) {\n return is$typed(v, id, hashImageDetails)\n}\n\nexport function validateImageDetails<V>(v: V) {\n return validate<ImageDetails & V>(v, id, hashImageDetails)\n}\n\nexport interface VideoDetails {\n $type?: 'tools.ozone.moderation.defs#videoDetails'\n width: number\n height: number\n length: number\n}\n\nconst hashVideoDetails = 'videoDetails'\n\nexport function isVideoDetails<V>(v: V) {\n return is$typed(v, id, hashVideoDetails)\n}\n\nexport function validateVideoDetails<V>(v: V) {\n return validate<VideoDetails & V>(v, id, hashVideoDetails)\n}\n\nexport interface AccountHosting {\n $type?: 'tools.ozone.moderation.defs#accountHosting'\n status:\n | 'takendown'\n | 'suspended'\n | 'deleted'\n | 'deactivated'\n | 'unknown'\n | (string & {})\n updatedAt?: string\n createdAt?: string\n deletedAt?: string\n deactivatedAt?: string\n reactivatedAt?: string\n}\n\nconst hashAccountHosting = 'accountHosting'\n\nexport function isAccountHosting<V>(v: V) {\n return is$typed(v, id, hashAccountHosting)\n}\n\nexport function validateAccountHosting<V>(v: V) {\n return validate<AccountHosting & V>(v, id, hashAccountHosting)\n}\n\nexport interface RecordHosting {\n $type?: 'tools.ozone.moderation.defs#recordHosting'\n status: 'deleted' | 'unknown' | (string & {})\n updatedAt?: string\n createdAt?: string\n deletedAt?: string\n}\n\nconst hashRecordHosting = 'recordHosting'\n\nexport function isRecordHosting<V>(v: V) {\n return is$typed(v, id, hashRecordHosting)\n}\n\nexport function validateRecordHosting<V>(v: V) {\n return validate<RecordHosting & V>(v, id, hashRecordHosting)\n}\n\nexport interface ReporterStats {\n $type?: 'tools.ozone.moderation.defs#reporterStats'\n did: string\n /** The total number of reports made by the user on accounts. */\n accountReportCount: number\n /** The total number of reports made by the user on records. */\n recordReportCount: number\n /** The total number of accounts reported by the user. */\n reportedAccountCount: number\n /** The total number of records reported by the user. */\n reportedRecordCount: number\n /** The total number of accounts taken down as a result of the user's reports. */\n takendownAccountCount: number\n /** The total number of records taken down as a result of the user's reports. */\n takendownRecordCount: number\n /** The total number of accounts labeled as a result of the user's reports. */\n labeledAccountCount: number\n /** The total number of records labeled as a result of the user's reports. */\n labeledRecordCount: number\n}\n\nconst hashReporterStats = 'reporterStats'\n\nexport function isReporterStats<V>(v: V) {\n return is$typed(v, id, hashReporterStats)\n}\n\nexport function validateReporterStats<V>(v: V) {\n return validate<ReporterStats & V>(v, id, hashReporterStats)\n}\n\n/** Moderation tool information for tracing the source of the action */\nexport interface ModTool {\n $type?: 'tools.ozone.moderation.defs#modTool'\n /** Name/identifier of the source (e.g., 'automod', 'ozone/workspace') */\n name: string\n /** Additional arbitrary metadata about the source */\n meta?: { [_ in string]: unknown }\n}\n\nconst hashModTool = 'modTool'\n\nexport function isModTool<V>(v: V) {\n return is$typed(v, id, hashModTool)\n}\n\nexport function validateModTool<V>(v: V) {\n return validate<ModTool & V>(v, id, hashModTool)\n}\n\n/** Moderation event timeline event for a PLC create operation */\nexport const TIMELINEEVENTPLCCREATE = `${id}#timelineEventPlcCreate`\n/** Moderation event timeline event for generic PLC operation */\nexport const TIMELINEEVENTPLCOPERATION = `${id}#timelineEventPlcOperation`\n/** Moderation event timeline event for a PLC tombstone operation */\nexport const TIMELINEEVENTPLCTOMBSTONE = `${id}#timelineEventPlcTombstone`\n\n/** View of a scheduled moderation action */\nexport interface ScheduledActionView {\n $type?: 'tools.ozone.moderation.defs#scheduledActionView'\n /** Auto-incrementing row ID */\n id: number\n /** Type of action to be executed */\n action: 'takedown' | (string & {})\n /** Serialized event object that will be propagated to the event when performed */\n eventData?: { [_ in string]: unknown }\n /** Subject DID for the action */\n did: string\n /** Exact time to execute the action */\n executeAt?: string\n /** Earliest time to execute the action (for randomized scheduling) */\n executeAfter?: string\n /** Latest time to execute the action (for randomized scheduling) */\n executeUntil?: string\n /** Whether execution time should be randomized within the specified range */\n randomizeExecution?: boolean\n /** DID of the user who created this scheduled action */\n createdBy: string\n /** When the scheduled action was created */\n createdAt: string\n /** When the scheduled action was last updated */\n updatedAt?: string\n /** Current status of the scheduled action */\n status: 'pending' | 'executed' | 'cancelled' | 'failed' | (string & {})\n /** When the action was last attempted to be executed */\n lastExecutedAt?: string\n /** Reason for the last execution failure */\n lastFailureReason?: string\n /** ID of the moderation event created when action was successfully executed */\n executionEventId?: number\n}\n\nconst hashScheduledActionView = 'scheduledActionView'\n\nexport function isScheduledActionView<V>(v: V) {\n return is$typed(v, id, hashScheduledActionView)\n}\n\nexport function validateScheduledActionView<V>(v: V) {\n return validate<ScheduledActionView & V>(v, id, hashScheduledActionView)\n}\n"]}
@@ -35,7 +35,7 @@ export type QueryParams = {
35
35
  /** When set to true, only muted subjects and reporters will be returned. */
36
36
  onlyMuted?: boolean;
37
37
  /** Specify when fetching subjects in a certain state */
38
- reviewState?: string;
38
+ reviewState?: 'tools.ozone.moderation.defs#reviewOpen' | 'tools.ozone.moderation.defs#reviewClosed' | 'tools.ozone.moderation.defs#reviewEscalated' | 'tools.ozone.moderation.defs#reviewNone' | (string & {});
39
39
  ignoreSubjects?: string[];
40
40
  /** Get all subject statuses that were reviewed by a specific moderator */
41
41
  lastReviewedBy?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"queryStatuses.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/queryStatuses.ts"],"names":[],"mapp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WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,CAAA"}
1
+ {"version":3,"file":"queryStatuses.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/queryStatuses.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,KAAK,wBAAwB,MAAM,WAAW,CAAA;AAM1D,MAAM,MAAM,WAAW,GAAG;IACxB,0FAA0F;IAC1F,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4IAA4I;IAC5I,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,8FAA8F;IAC9F,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,+FAA+F;IAC/F,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,8FAA8F;IAC9F,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,+FAA+F;IAC/F,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,oGAAoG;IACpG,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,wDAAw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,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,wBAAwB,CAAC,iBAAiB,EAAE,CAAA;CAC9D;AAED,MAAM,MAAM,YAAY,GAAG,IAAI,CAAA;AAE/B,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"queryStatuses.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/queryStatuses.ts"],"names":[],"mappings":";;AAKA,mDAA4D;AAC5D,2CAIyB;AAGzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,sCAAsC,CAAA","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as ToolsOzoneModerationDefs from './defs.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'tools.ozone.moderation.queryStatuses'\n\nexport type QueryParams = {\n /** Number of queues being used by moderators. Subjects will be split among all queues. */\n queueCount?: number\n /** Index of the queue to fetch subjects from. Works only when queueCount value is specified. */\n queueIndex?: number\n /** A seeder to shuffle/balance the queue items. */\n queueSeed?: string\n /** All subjects, or subjects from given 'collections' param, belonging to the account specified in the 'subject' param will be returned. */\n includeAllUserRecords?: boolean\n /** The subject to get the status for. */\n subject?: string\n /** Search subjects by keyword from comments */\n comment?: string\n /** Search subjects reported after a given timestamp */\n reportedAfter?: string\n /** Search subjects reported before a given timestamp */\n reportedBefore?: string\n /** Search subjects reviewed after a given timestamp */\n reviewedAfter?: string\n /** Search subjects where the associated record/account was deleted after a given timestamp */\n hostingDeletedAfter?: string\n /** Search subjects where the associated record/account was deleted before a given timestamp */\n hostingDeletedBefore?: string\n /** Search subjects where the associated record/account was updated after a given timestamp */\n hostingUpdatedAfter?: string\n /** Search subjects where the associated record/account was updated before a given timestamp */\n hostingUpdatedBefore?: string\n /** Search subjects by the status of the associated record/account */\n hostingStatuses?: string[]\n /** Search subjects reviewed before a given timestamp */\n reviewedBefore?: string\n /** By default, we don't include muted subjects in the results. Set this to true to include them. */\n includeMuted?: boolean\n /** When set to true, only muted subjects and reporters will be returned. */\n onlyMuted?: boolean\n /** Specify when fetching subjects in a certain state */\n reviewState?: string\n ignoreSubjects?: string[]\n /** Get all subject statuses that were reviewed by a specific moderator */\n lastReviewedBy?: string\n sortField:\n | 'lastReviewedAt'\n | 'lastReportedAt'\n | 'reportedRecordsCount'\n | 'takendownRecordsCount'\n | 'priorityScore'\n sortDirection: 'asc' | 'desc'\n /** Get subjects that were taken down */\n takendown?: boolean\n /** Get subjects in unresolved appealed status */\n appealed?: boolean\n limit: number\n tags?: string[]\n excludeTags?: string[]\n cursor?: string\n /** If specified, subjects belonging to the given collections will be returned. When subjectType is set to 'account', this will be ignored. */\n collections?: string[]\n /** If specified, subjects of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored. */\n subjectType?: 'account' | 'record' | (string & {})\n /** If specified, only subjects that belong to an account that has at least this many suspensions will be returned. */\n minAccountSuspendCount?: number\n /** If specified, only subjects that belong to an account that has at least this many reported records will be returned. */\n minReportedRecordsCount?: number\n /** If specified, only subjects that belong to an account that has at least this many taken down records will be returned. */\n minTakendownRecordsCount?: number\n /** If specified, only subjects that have priority score value above the given value will be returned. */\n minPriorityScore?: number\n /** If specified, only subjects that belong to an account that has at least this many active strikes will be returned. */\n minStrikeCount?: number\n /** If specified, only subjects with the given age assurance state will be returned. */\n ageAssuranceState?:\n | 'pending'\n | 'assured'\n | 'unknown'\n | 'reset'\n | 'blocked'\n | (string & {})\n}\nexport type InputSchema = undefined\n\nexport interface OutputSchema {\n cursor?: string\n subjectStatuses: ToolsOzoneModerationDefs.SubjectStatusView[]\n}\n\nexport type HandlerInput = void\n\nexport interface HandlerSuccess {\n encoding: 'application/json'\n body: OutputSchema\n headers?: { [key: string]: string }\n}\n\nexport interface HandlerError {\n status: number\n message?: string\n}\n\nexport type HandlerOutput = HandlerError | HandlerSuccess\n"]}
1
+ {"version":3,"file":"queryStatuses.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/queryStatuses.ts"],"names":[],"mappings":";;AAKA,mDAA4D;AAC5D,2CAIyB;AAGzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,sCAAsC,CAAA","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as ToolsOzoneModerationDefs from './defs.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'tools.ozone.moderation.queryStatuses'\n\nexport type QueryParams = {\n /** Number of queues being used by moderators. Subjects will be split among all queues. */\n queueCount?: number\n /** Index of the queue to fetch subjects from. Works only when queueCount value is specified. */\n queueIndex?: number\n /** A seeder to shuffle/balance the queue items. */\n queueSeed?: string\n /** All subjects, or subjects from given 'collections' param, belonging to the account specified in the 'subject' param will be returned. */\n includeAllUserRecords?: boolean\n /** The subject to get the status for. */\n subject?: string\n /** Search subjects by keyword from comments */\n comment?: string\n /** Search subjects reported after a given timestamp */\n reportedAfter?: string\n /** Search subjects reported before a given timestamp */\n reportedBefore?: string\n /** Search subjects reviewed after a given timestamp */\n reviewedAfter?: string\n /** Search subjects where the associated record/account was deleted after a given timestamp */\n hostingDeletedAfter?: string\n /** Search subjects where the associated record/account was deleted before a given timestamp */\n hostingDeletedBefore?: string\n /** Search subjects where the associated record/account was updated after a given timestamp */\n hostingUpdatedAfter?: string\n /** Search subjects where the associated record/account was updated before a given timestamp */\n hostingUpdatedBefore?: string\n /** Search subjects by the status of the associated record/account */\n hostingStatuses?: string[]\n /** Search subjects reviewed before a given timestamp */\n reviewedBefore?: string\n /** By default, we don't include muted subjects in the results. Set this to true to include them. */\n includeMuted?: boolean\n /** When set to true, only muted subjects and reporters will be returned. */\n onlyMuted?: boolean\n /** Specify when fetching subjects in a certain state */\n reviewState?:\n | 'tools.ozone.moderation.defs#reviewOpen'\n | 'tools.ozone.moderation.defs#reviewClosed'\n | 'tools.ozone.moderation.defs#reviewEscalated'\n | 'tools.ozone.moderation.defs#reviewNone'\n | (string & {})\n ignoreSubjects?: string[]\n /** Get all subject statuses that were reviewed by a specific moderator */\n lastReviewedBy?: string\n sortField:\n | 'lastReviewedAt'\n | 'lastReportedAt'\n | 'reportedRecordsCount'\n | 'takendownRecordsCount'\n | 'priorityScore'\n sortDirection: 'asc' | 'desc'\n /** Get subjects that were taken down */\n takendown?: boolean\n /** Get subjects in unresolved appealed status */\n appealed?: boolean\n limit: number\n tags?: string[]\n excludeTags?: string[]\n cursor?: string\n /** If specified, subjects belonging to the given collections will be returned. When subjectType is set to 'account', this will be ignored. */\n collections?: string[]\n /** If specified, subjects of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored. */\n subjectType?: 'account' | 'record' | (string & {})\n /** If specified, only subjects that belong to an account that has at least this many suspensions will be returned. */\n minAccountSuspendCount?: number\n /** If specified, only subjects that belong to an account that has at least this many reported records will be returned. */\n minReportedRecordsCount?: number\n /** If specified, only subjects that belong to an account that has at least this many taken down records will be returned. */\n minTakendownRecordsCount?: number\n /** If specified, only subjects that have priority score value above the given value will be returned. */\n minPriorityScore?: number\n /** If specified, only subjects that belong to an account that has at least this many active strikes will be returned. */\n minStrikeCount?: number\n /** If specified, only subjects with the given age assurance state will be returned. */\n ageAssuranceState?:\n | 'pending'\n | 'assured'\n | 'unknown'\n | 'reset'\n | 'blocked'\n | (string & {})\n}\nexport type InputSchema = undefined\n\nexport interface OutputSchema {\n cursor?: string\n subjectStatuses: ToolsOzoneModerationDefs.SubjectStatusView[]\n}\n\nexport type HandlerInput = void\n\nexport interface HandlerSuccess {\n encoding: 'application/json'\n body: OutputSchema\n headers?: { [key: string]: string }\n}\n\nexport interface HandlerError {\n status: number\n message?: string\n}\n\nexport type HandlerOutput = HandlerError | HandlerSuccess\n"]}
@@ -42,6 +42,16 @@ export interface Takedown {
42
42
  acknowledgeAccountSubjects?: boolean;
43
43
  /** Names/Keywords of the policies that drove the decision. */
44
44
  policies?: string[];
45
+ /** Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.). */
46
+ severityLevel?: string;
47
+ /** Number of strikes to assign to the user when takedown is applied. */
48
+ strikeCount?: number;
49
+ /** When the strike should expire. If not provided, the strike never expires. */
50
+ strikeExpiresAt?: string;
51
+ /** Email content to be sent to the user upon takedown. */
52
+ emailContent?: string;
53
+ /** Subject of the email to be sent to the user upon takedown. */
54
+ emailSubject?: string;
45
55
  }
46
56
  export declare function isTakedown<V>(v: V): v is import("../../../../util").$TypedObject<V, "tools.ozone.moderation.scheduleAction", "takedown">;
47
57
  export declare function validateTakedown<V>(v: V): ValidationResult<Takedown & V>;
@@ -1 +1 @@
1
- {"version":3,"file":"scheduleAction.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/scheduleAction.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,gBAAgB,EAAW,MA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,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,wGAEjC;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,kCAEvC;AAED,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,wDAAwD,CAAA;IAChE,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAID,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,gHAEzC;AAED,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,0CAE/C;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,8DAA8D,CAAA;IACtE,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,MAAM,EAAE,gBAAgB,EAAE,CAAA;CAC3B;AAID,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,sHAE/C;AAED,wBAAgB,8BAA8B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,gDAErD;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,wDAAwD,CAAA;IAChE,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAID,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,gHAEzC;AAED,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,0CAE/C"}
1
+ {"version":3,"file":"scheduleAction.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/scheduleAction.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,kBAAkB,CAA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ED,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,0CAE/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"scheduleAction.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/scheduleAction.ts"],"names":[],"mappings":";;AA8DA,gCAEC;AAED,4CAEC;AAeD,gDAEC;AAED,4DAEC;AAUD,4DAEC;AAED,wEAEC;AAWD,gDAEC;AAED,4DAEC;AArHD,mDAA4D;AAC5D,2CAIyB;AAGzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,CAAA;AACtB,MAAM,EAAE,GAAG,uCAAuC,CAAA;AA6ClD,MAAM,YAAY,GAAG,UAAU,CAAA;AAE/B,SAAgB,UAAU,CAAI,CAAI;IAChC,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,CAAA;AACtC,CAAC;AAED,SAAgB,gBAAgB,CAAI,CAAI;IACtC,OAAO,QAAQ,CAAe,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,CAAA;AACpD,CAAC;AAaD,MAAM,oBAAoB,GAAG,kBAAkB,CAAA;AAE/C,SAAgB,kBAAkB,CAAI,CAAI;IACxC,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,oBAAoB,CAAC,CAAA;AAC9C,CAAC;AAED,SAAgB,wBAAwB,CAAI,CAAI;IAC9C,OAAO,QAAQ,CAAuB,CAAC,EAAE,EAAE,EAAE,oBAAoB,CAAC,CAAA;AACpE,CAAC;AAQD,MAAM,0BAA0B,GAAG,wBAAwB,CAAA;AAE3D,SAAgB,wBAAwB,CAAI,CAAI;IAC9C,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,0BAA0B,CAAC,CAAA;AACpD,CAAC;AAED,SAAgB,8BAA8B,CAAI,CAAI;IACpD,OAAO,QAAQ,CAA6B,CAAC,EAAE,EAAE,EAAE,0BAA0B,CAAC,CAAA;AAChF,CAAC;AASD,MAAM,oBAAoB,GAAG,kBAAkB,CAAA;AAE/C,SAAgB,kBAAkB,CAAI,CAAI;IACxC,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,oBAAoB,CAAC,CAAA;AAC9C,CAAC;AAED,SAAgB,wBAAwB,CAAI,CAAI;IAC9C,OAAO,QAAQ,CAAuB,CAAC,EAAE,EAAE,EAAE,oBAAoB,CAAC,CAAA;AACpE,CAAC","sourcesContent":["/**\n * GENERATED CODE - DO NOT MODIFY\n */\nimport { type ValidationResult, BlobRef } from '@atproto/lexicon'\nimport { CID } from 'multiformats/cid'\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as ToolsOzoneModerationDefs from './defs.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'tools.ozone.moderation.scheduleAction'\n\nexport type QueryParams = {}\n\nexport interface InputSchema {\n action: $Typed<Takedown> | { $type: string }\n /** Array of DID subjects to schedule the action for */\n subjects: string[]\n createdBy: string\n scheduling: SchedulingConfig\n modTool?: ToolsOzoneModerationDefs.ModTool\n}\n\nexport type OutputSchema = ScheduledActionResults\n\nexport interface HandlerInput {\n encoding: 'application/json'\n body: InputSchema\n}\n\nexport interface HandlerSuccess {\n encoding: 'application/json'\n body: OutputSchema\n headers?: { [key: string]: string }\n}\n\nexport interface HandlerError {\n status: number\n message?: string\n}\n\nexport type HandlerOutput = HandlerError | HandlerSuccess\n\n/** Schedule a takedown action */\nexport interface Takedown {\n $type?: 'tools.ozone.moderation.scheduleAction#takedown'\n comment?: string\n /** Indicates how long the takedown should be in effect before automatically expiring. */\n durationInHours?: number\n /** If true, all other reports on content authored by this account will be resolved (acknowledged). */\n acknowledgeAccountSubjects?: boolean\n /** Names/Keywords of the policies that drove the decision. */\n policies?: string[]\n}\n\nconst hashTakedown = 'takedown'\n\nexport function isTakedown<V>(v: V) {\n return is$typed(v, id, hashTakedown)\n}\n\nexport function validateTakedown<V>(v: V) {\n return validate<Takedown & V>(v, id, hashTakedown)\n}\n\n/** Configuration for when the action should be executed */\nexport interface SchedulingConfig {\n $type?: 'tools.ozone.moderation.scheduleAction#schedulingConfig'\n /** Exact time to execute the action */\n executeAt?: string\n /** Earliest time to execute the action (for randomized scheduling) */\n executeAfter?: string\n /** Latest time to execute the action (for randomized scheduling) */\n executeUntil?: string\n}\n\nconst hashSchedulingConfig = 'schedulingConfig'\n\nexport function isSchedulingConfig<V>(v: V) {\n return is$typed(v, id, hashSchedulingConfig)\n}\n\nexport function validateSchedulingConfig<V>(v: V) {\n return validate<SchedulingConfig & V>(v, id, hashSchedulingConfig)\n}\n\nexport interface ScheduledActionResults {\n $type?: 'tools.ozone.moderation.scheduleAction#scheduledActionResults'\n succeeded: string[]\n failed: FailedScheduling[]\n}\n\nconst hashScheduledActionResults = 'scheduledActionResults'\n\nexport function isScheduledActionResults<V>(v: V) {\n return is$typed(v, id, hashScheduledActionResults)\n}\n\nexport function validateScheduledActionResults<V>(v: V) {\n return validate<ScheduledActionResults & V>(v, id, hashScheduledActionResults)\n}\n\nexport interface FailedScheduling {\n $type?: 'tools.ozone.moderation.scheduleAction#failedScheduling'\n subject: string\n error: string\n errorCode?: string\n}\n\nconst hashFailedScheduling = 'failedScheduling'\n\nexport function isFailedScheduling<V>(v: V) {\n return is$typed(v, id, hashFailedScheduling)\n}\n\nexport function validateFailedScheduling<V>(v: V) {\n return validate<FailedScheduling & V>(v, id, hashFailedScheduling)\n}\n"]}
1
+ {"version":3,"file":"scheduleAction.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/moderation/scheduleAction.ts"],"names":[],"mappings":";;AAwEA,gCAEC;AAED,4CAEC;AAeD,gDAEC;AAED,4DAEC;AAUD,4DAEC;AAED,wEAEC;AAWD,gDAEC;AAED,4DAEC;AA/HD,mDAA4D;AAC5D,2CAIyB;AAGzB,MAAM,QAAQ,GAAG,eAAS,EACxB,QAAQ,GAAG,mBAAS,C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\nimport { validate as _validate } from '../../../../lexicons'\nimport {\n type $Typed,\n is$typed as _is$typed,\n type OmitKey,\n} from '../../../../util'\nimport type * as ToolsOzoneModerationDefs from './defs.js'\n\nconst is$typed = _is$typed,\n validate = _validate\nconst id = 'tools.ozone.moderation.scheduleAction'\n\nexport type QueryParams = {}\n\nexport interface InputSchema {\n action: $Typed<Takedown> | { $type: string }\n /** Array of DID subjects to schedule the action for */\n subjects: string[]\n createdBy: string\n scheduling: SchedulingConfig\n modTool?: ToolsOzoneModerationDefs.ModTool\n}\n\nexport type OutputSchema = ScheduledActionResults\n\nexport interface HandlerInput {\n encoding: 'application/json'\n body: InputSchema\n}\n\nexport interface HandlerSuccess {\n encoding: 'application/json'\n body: OutputSchema\n headers?: { [key: string]: string }\n}\n\nexport interface HandlerError {\n status: number\n message?: string\n}\n\nexport type HandlerOutput = HandlerError | HandlerSuccess\n\n/** Schedule a takedown action */\nexport interface Takedown {\n $type?: 'tools.ozone.moderation.scheduleAction#takedown'\n comment?: string\n /** Indicates how long the takedown should be in effect before automatically expiring. */\n durationInHours?: number\n /** If true, all other reports on content authored by this account will be resolved (acknowledged). */\n acknowledgeAccountSubjects?: boolean\n /** Names/Keywords of the policies that drove the decision. */\n policies?: string[]\n /** Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.). */\n severityLevel?: string\n /** Number of strikes to assign to the user when takedown is applied. */\n strikeCount?: number\n /** When the strike should expire. If not provided, the strike never expires. */\n strikeExpiresAt?: string\n /** Email content to be sent to the user upon takedown. */\n emailContent?: string\n /** Subject of the email to be sent to the user upon takedown. */\n emailSubject?: string\n}\n\nconst hashTakedown = 'takedown'\n\nexport function isTakedown<V>(v: V) {\n return is$typed(v, id, hashTakedown)\n}\n\nexport function validateTakedown<V>(v: V) {\n return validate<Takedown & V>(v, id, hashTakedown)\n}\n\n/** Configuration for when the action should be executed */\nexport interface SchedulingConfig {\n $type?: 'tools.ozone.moderation.scheduleAction#schedulingConfig'\n /** Exact time to execute the action */\n executeAt?: string\n /** Earliest time to execute the action (for randomized scheduling) */\n executeAfter?: string\n /** Latest time to execute the action (for randomized scheduling) */\n executeUntil?: string\n}\n\nconst hashSchedulingConfig = 'schedulingConfig'\n\nexport function isSchedulingConfig<V>(v: V) {\n return is$typed(v, id, hashSchedulingConfig)\n}\n\nexport function validateSchedulingConfig<V>(v: V) {\n return validate<SchedulingConfig & V>(v, id, hashSchedulingConfig)\n}\n\nexport interface ScheduledActionResults {\n $type?: 'tools.ozone.moderation.scheduleAction#scheduledActionResults'\n succeeded: string[]\n failed: FailedScheduling[]\n}\n\nconst hashScheduledActionResults = 'scheduledActionResults'\n\nexport function isScheduledActionResults<V>(v: V) {\n return is$typed(v, id, hashScheduledActionResults)\n}\n\nexport function validateScheduledActionResults<V>(v: V) {\n return validate<ScheduledActionResults & V>(v, id, hashScheduledActionResults)\n}\n\nexport interface FailedScheduling {\n $type?: 'tools.ozone.moderation.scheduleAction#failedScheduling'\n subject: string\n error: string\n errorCode?: string\n}\n\nconst hashFailedScheduling = 'failedScheduling'\n\nexport function isFailedScheduling<V>(v: V) {\n return is$typed(v, id, hashFailedScheduling)\n}\n\nexport function validateFailedScheduling<V>(v: V) {\n return validate<FailedScheduling & V>(v, id, hashFailedScheduling)\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../src/repo/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAEtC,OAAO,EACL,OAAO,EACP,QAAQ,EAER,UAAU,EAIX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,EAGd,MAAM,eAAe,CAAA;AAetB,OAAO,EAEL,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAQhB,eAAO,MAAM,2BAA2B,GACtC,QAAQ,MAA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(Object.create ? (function(o, m, k, k2) {
3
4
  if (k2 === undefined) k2 = k;
4
5
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -1 +1 @@
1
- {"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../src/repo/prepare.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAsC;AACtC,4CAA6D;AAC7D,8CAQyB;AACzB,wCAOsB;AACtB,4CAIwB;AACxB,6DAA0D;AAC1D,yDAA0C;AAC1C,6FAA8E;AAC9E,+FAAgF;AAChF,qFAAsE;AACtE,uFAAwE;AACxE,qGAAsF;AACtF,oEAAgE;AAChE,0CAA6C;AAC7C,mCAQgB;AAEhB,MAAM,oBAAoB,GAAG,IAAA,kBAAW,EAAC,oBAAoB,CAAC,cAAc,CAAC,CAAA;AAC7E,MAAM,kBAAkB,GAAG,IAAA,kBAAW,EAAC,uBAAuB,CAAC,cAAc,CAAC,CAAA;AAC9E,MAAM,WAAW,GAAG,IAAA,kBAAW,EAAC,eAAe,CAAC,cAAc,CAAC,CAAA;AAC/D,MAAM,WAAW,GAAG,IAAA,kBAAW,EAAC,gBAAgB,CAAC,cAAc,CAAC,CAAA;AAChE,MAAM,cAAc,GAAG,IAAA,kBAAW,EAAC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AAE/D,MAAM,2BAA2B,GAAG,CACzC,MAA+B,EAC/B,IAAiC,EACf,EAAE;IACpB,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrC,MAAM,IAAI,0BAAkB,CAAC,mBAAmB,CAAC,CAAA;IACnD,CAAC;IACD,IAAI,CAAC;QACH,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QACpD,IAAA,4BAAoB,EAAC,MAAM,CAAC,CAAA;IAC9B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,i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,EAAE;QAC7B,MAAM,EACJ,GAAG,CAAC,UAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM;QACvE,MAAM,EACJ,GAAG,CAAC,UAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM;KACxE;IACD,CAAC,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE;QAC9B,MAAM,EACJ,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM;KACzE;IACD,CAAC,GAAG,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;QAC1B,MAAM,EAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM;KAC3E;IACD,CAAC,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE;QACzB,oBAAoB,EAClB,GAAG,CAAC,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK;QAC/D,sBAAsB,EACpB,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK;QACpE,0BAA0B,EACxB,GAAG,CAAC,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK;QAC/D,4BAA4B,EAC1B,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK;KACrE;CACF,CAAA","sourcesContent":["import { CID } from 'multiformats/cid'\nimport { TID, check, dataToCborBlock } from '@atproto/common'\nimport {\n BlobRef,\n LexValue,\n LexiconDefNotFoundError,\n RepoRecord,\n ValidationError,\n lexToIpld,\n untypedJsonBlobRef,\n} from '@atproto/lexicon'\nimport {\n RecordCreateOp,\n RecordDeleteOp,\n RecordUpdateOp,\n RecordWriteOp,\n WriteOpAction,\n cborToLex,\n} from '@atproto/repo'\nimport {\n AtUri,\n ensureValidDatetime,\n ensureValidRecordKey,\n} from '@atproto/syntax'\nimport { hasExplicitSlur } from '../handle/explicit-slurs'\nimport * as lex from '../lexicon/lexicons'\nimport * as AppBskyActorProfile from '../lexicon/types/app/bsky/actor/profile'\nimport * as AppBskyFeedGenerator from '../lexicon/types/app/bsky/feed/generator'\nimport * as AppBskyFeedPost from '../lexicon/types/app/bsky/feed/post'\nimport * as AppBskyGraphList from '../lexicon/types/app/bsky/graph/list'\nimport * as AppBskyGraphStarterpack from '../lexicon/types/app/bsky/graph/starterpack'\nimport { isTag } from '../lexicon/types/app/bsky/richtext/facet'\nimport { asPredicate } from '../lexicon/util'\nimport {\n InvalidRecordError,\n PreparedBlobRef,\n PreparedCreate,\n PreparedDelete,\n PreparedUpdate,\n PreparedWrite,\n ValidationStatus,\n} from './types'\n\nconst isValidFeedGenerator = asPredicate(AppBskyFeedGenerator.validateRecord)\nconst isValidStarterPack = asPredicate(AppBskyGraphStarterpack.validateRecord)\nconst isValidPost = asPredicate(AppBskyFeedPost.validateRecord)\nconst isValidList = asPredicate(AppBskyGraphList.validateRecord)\nconst isValidProfile = asPredicate(AppBskyActorProfile.validateRecord)\n\nexport const assertValidRecordWithStatus = (\n record: Record<string, unknown>,\n opts: { requireLexicon: boolean },\n): ValidationStatus => {\n if (typeof record.$type !== 'string') {\n throw new InvalidRecordError('No $type provided')\n }\n try {\n lex.lexicons.assertValidRecord(record.$type, record)\n assertValidCreatedAt(record)\n } catch (e) {\n if (e instanceof LexiconDefNotFoundError) {\n if (opts.requireLexicon) {\n throw new InvalidRecordError(e.message)\n } else {\n return 'unknown'\n }\n }\n throw new InvalidRecordError(\n `Invalid ${record.$type} record: ${\n e instanceof Error ? e.message : String(e)\n }`,\n )\n }\n return 'valid'\n}\n\n// additional more rigorous check on datetimes\n// this check will eventually be in the lex sdk, but this will stop the bleed until then\nexport const assertValidCreatedAt = (record: Record<string, unknown>) => {\n const createdAt = record['createdAt']\n if (typeof createdAt !== 'string') {\n return\n }\n try {\n ensureValidDatetime(createdAt)\n } catch {\n throw new ValidationError(\n 'createdAt must be an valid atproto datetime (both RFC-3339 and ISO-8601)',\n )\n }\n}\n\nexport const setCollectionName = (\n collection: string,\n record: RepoRecord,\n validate: boolean,\n) => {\n if (!record.$type) {\n record.$type = collection\n }\n if (validate && record.$type !== collection) {\n throw new InvalidRecordError(\n `Invalid $type: expected ${collection}, got ${record.$type}`,\n )\n }\n return record\n}\n\nexport const prepareCreate = async (opts: {\n did: string\n collection: string\n rkey?: string\n swapCid?: CID | null\n record: RepoRecord\n validate?: boolean\n}): Promise<PreparedCreate> => {\n const { did, collection, swapCid, validate } = opts\n const maybeValidate = validate !== false\n const record = setCollectionName(collection, opts.record, maybeValidate)\n let validationStatus: ValidationStatus\n if (maybeValidate) {\n validationStatus = assertValidRecordWithStatus(record, {\n requireLexicon: validate === true,\n })\n }\n const nextRkey = TID.next()\n const rkey = opts.rkey || nextRkey.toString()\n // @TODO: validate against Lexicon record 'key' type, not just overall recordkey syntax\n ensureValidRecordKey(rkey)\n assertNoExplicitSlurs(rkey, record)\n return {\n action: WriteOpAction.Create,\n uri: AtUri.make(did, collection, rkey),\n cid: await cidForSafeRecord(record),\n swapCid,\n record,\n blobs: blobsForWrite(record, maybeValidate),\n validationStatus,\n }\n}\n\nexport const prepareUpdate = async (opts: {\n did: string\n collection: string\n rkey: string\n swapCid?: CID | null\n record: RepoRecord\n validate?: boolean\n}): Promise<PreparedUpdate> => {\n const { did, collection, rkey, swapCid, validate } = opts\n const maybeValidate = validate !== false\n const record = setCollectionName(collection, opts.record, maybeValidate)\n let validationStatus: ValidationStatus\n if (maybeValidate) {\n validationStatus = assertValidRecordWithStatus(record, {\n requireLexicon: validate === true,\n })\n }\n assertNoExplicitSlurs(rkey, record)\n return {\n action: WriteOpAction.Update,\n uri: AtUri.make(did, collection, rkey),\n cid: await cidForSafeRecord(record),\n swapCid,\n record,\n blobs: blobsForWrite(record, maybeValidate),\n validationStatus,\n }\n}\n\nexport const prepareDelete = (opts: {\n did: string\n collection: string\n rkey: string\n swapCid?: CID | null\n}): PreparedDelete => {\n const { did, collection, rkey, swapCid } = opts\n return {\n action: WriteOpAction.Delete,\n uri: AtUri.make(did, collection, rkey),\n swapCid,\n }\n}\n\nexport const createWriteToOp = (write: PreparedCreate): RecordCreateOp => ({\n action: WriteOpAction.Create,\n collection: write.uri.collection,\n rkey: write.uri.rkey,\n record: write.record,\n})\n\nexport const updateWriteToOp = (write: PreparedUpdate): RecordUpdateOp => ({\n action: WriteOpAction.Update,\n collection: write.uri.collection,\n rkey: write.uri.rkey,\n record: write.record,\n})\n\nexport const deleteWriteToOp = (write: PreparedDelete): RecordDeleteOp => ({\n action: WriteOpAction.Delete,\n collection: write.uri.collection,\n rkey: write.uri.rkey,\n})\n\nexport const writeToOp = (write: PreparedWrite): RecordWriteOp => {\n switch (write.action) {\n case WriteOpAction.Create:\n return createWriteToOp(write)\n case WriteOpAction.Update:\n return updateWriteToOp(write)\n case WriteOpAction.Delete:\n return deleteWriteToOp(write)\n default:\n throw new Error(`Unrecognized action: ${write}`)\n }\n}\n\nasync function cidForSafeRecord(record: RepoRecord) {\n try {\n const block = await dataToCborBlock(lexToIpld(record))\n cborToLex(block.bytes)\n return block.cid\n } catch (err) {\n // Block does not properly transform between lex and cbor\n const badRecordErr = new InvalidRecordError('Bad record')\n badRecordErr.cause = err\n throw badRecordErr\n }\n}\n\nfunction assertNoExplicitSlurs(rkey: string, record: RepoRecord) {\n const toCheck: string[] = []\n\n if (isValidProfile(record)) {\n if (record.displayName) toCheck.push(record.displayName)\n } else if (isValidList(record)) {\n toCheck.push(record.name)\n } else if (isValidStarterPack(record)) {\n toCheck.push(record.name)\n } else if (isValidFeedGenerator(record)) {\n toCheck.push(rkey)\n toCheck.push(record.displayName)\n } else if (isValidPost(record)) {\n if (record.tags) {\n toCheck.push(...record.tags)\n }\n\n for (const facet of record.facets || []) {\n for (const feat of facet.features) {\n if (isTag(feat)) {\n toCheck.push(feat.tag)\n }\n }\n }\n }\n if (hasExplicitSlur(toCheck.join(' '))) {\n throw new InvalidRecordError('Unacceptable slur in record')\n }\n}\n\ntype FoundBlobRef = {\n ref: BlobRef\n path: string[]\n}\n\nexport const blobsForWrite = (\n record: RepoRecord,\n validate: boolean,\n): PreparedBlobRef[] => {\n const refs = findBlobRefs(record)\n const recordType =\n typeof record['$type'] === 'string' ? record['$type'] : undefined\n\n for (const ref of refs) {\n if (check.is(ref.ref.original, untypedJsonBlobRef)) {\n throw new InvalidRecordError(`Legacy blob ref at '${ref.path.join('/')}'`)\n }\n }\n\n return refs.map(({ ref, path }) => ({\n size: ref.size,\n cid: ref.ref,\n mimeType: ref.mimeType,\n constraints:\n validate && recordType\n ? CONSTRAINTS[recordType]?.[path.join('/')] ?? {}\n : {},\n }))\n}\n\nexport const findBlobRefs = (\n val: LexValue,\n path: string[] = [],\n layer = 0,\n): FoundBlobRef[] => {\n if (layer > 32) {\n return []\n }\n // walk arrays\n if (Array.isArray(val)) {\n return val.flatMap((item) => findBlobRefs(item, path, layer + 1))\n }\n // objects\n if (val && typeof val === 'object') {\n // convert blobs, leaving the original encoding so that we don't change CIDs on re-encode\n if (val instanceof BlobRef) {\n return [\n {\n ref: val,\n path,\n },\n ]\n }\n // retain cids & bytes\n if (CID.asCID(val) || val instanceof Uint8Array) {\n return []\n }\n return Object.entries(val).flatMap(([key, item]) =>\n findBlobRefs(item, [...path, key], layer + 1),\n )\n }\n // pass through\n return []\n}\n\nconst CONSTRAINTS = {\n [lex.ids.AppBskyActorProfile]: {\n avatar:\n lex.schemaDict.AppBskyActorProfile.defs.main.record.properties.avatar,\n banner:\n lex.schemaDict.AppBskyActorProfile.defs.main.record.properties.banner,\n },\n [lex.ids.AppBskyFeedGenerator]: {\n avatar:\n lex.schemaDict.AppBskyFeedGenerator.defs.main.record.properties.avatar,\n },\n [lex.ids.AppBskyGraphList]: {\n avatar: lex.schemaDict.AppBskyGraphList.defs.main.record.properties.avatar,\n },\n [lex.ids.AppBskyFeedPost]: {\n 'embed/images/image':\n lex.schemaDict.AppBskyEmbedImages.defs.image.properties.image,\n 'embed/external/thumb':\n lex.schemaDict.AppBskyEmbedExternal.defs.external.properties.thumb,\n 'embed/media/images/image':\n lex.schemaDict.AppBskyEmbedImages.defs.image.properties.image,\n 'embed/media/external/thumb':\n lex.schemaDict.AppBskyEmbedExternal.defs.external.properties.thumb,\n },\n}\n"]}
1
+ {"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../src/repo/prepare.ts"],"names":[],"mappings":";AAAA,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzC,0CAAsC;AACtC,4CAA6D;AAC7D,8CAQyB;AACzB,wCAOsB;AACtB,4CAIwB;AACxB,6DAA0D;AAC1D,yDAA0C;AAC1C,6FAA8E;AAC9E,+FAAgF;AAChF,qFAAsE;AACtE,uFAAwE;AACxE,qGAAsF;AACtF,oEAAgE;AAChE,0CAA6C;AAC7C,mCAQgB;AAEhB,MAAM,oBAAoB,GAAG,IAAA,kBAAW,EAAC,oBAAoB,CAAC,cAAc,CAAC,CAAA;AAC7E,MAAM,kBAAkB,GAAG,IAAA,kBAAW,EAAC,uBAAuB,CAAC,cAAc,CAAC,CAAA;AAC9E,MAAM,WAAW,GAAG,IAAA,kBAAW,EAAC,eAAe,CAAC,cAAc,CAAC,CAAA;AAC/D,MAAM,WAAW,GAAG,IAAA,kBAAW,EAAC,gBAAgB,CAAC,cAAc,CAAC,CAAA;AAChE,MAAM,cAAc,GAAG,IAAA,kBAAW,EAAC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AAE/D,MAAM,2BAA2B,GAAG,CACzC,MAA+B,EAC/B,IAAiC,EACf,EAAE;IACpB,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE,CA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,4BAA4B,EAC1B,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK;KACrE;CACF,CAAA","sourcesContent":["/* eslint-disable import/no-deprecated */\n\nimport { CID } from 'multiformats/cid'\nimport { TID, check, dataToCborBlock } from '@atproto/common'\nimport {\n BlobRef,\n LexValue,\n LexiconDefNotFoundError,\n RepoRecord,\n ValidationError,\n lexToIpld,\n untypedJsonBlobRef,\n} from '@atproto/lexicon'\nimport {\n RecordCreateOp,\n RecordDeleteOp,\n RecordUpdateOp,\n RecordWriteOp,\n WriteOpAction,\n cborToLex,\n} from '@atproto/repo'\nimport {\n AtUri,\n ensureValidDatetime,\n ensureValidRecordKey,\n} from '@atproto/syntax'\nimport { hasExplicitSlur } from '../handle/explicit-slurs'\nimport * as lex from '../lexicon/lexicons'\nimport * as AppBskyActorProfile from '../lexicon/types/app/bsky/actor/profile'\nimport * as AppBskyFeedGenerator from '../lexicon/types/app/bsky/feed/generator'\nimport * as AppBskyFeedPost from '../lexicon/types/app/bsky/feed/post'\nimport * as AppBskyGraphList from '../lexicon/types/app/bsky/graph/list'\nimport * as AppBskyGraphStarterpack from '../lexicon/types/app/bsky/graph/starterpack'\nimport { isTag } from '../lexicon/types/app/bsky/richtext/facet'\nimport { asPredicate } from '../lexicon/util'\nimport {\n InvalidRecordError,\n PreparedBlobRef,\n PreparedCreate,\n PreparedDelete,\n PreparedUpdate,\n PreparedWrite,\n ValidationStatus,\n} from './types'\n\nconst isValidFeedGenerator = asPredicate(AppBskyFeedGenerator.validateRecord)\nconst isValidStarterPack = asPredicate(AppBskyGraphStarterpack.validateRecord)\nconst isValidPost = asPredicate(AppBskyFeedPost.validateRecord)\nconst isValidList = asPredicate(AppBskyGraphList.validateRecord)\nconst isValidProfile = asPredicate(AppBskyActorProfile.validateRecord)\n\nexport const assertValidRecordWithStatus = (\n record: Record<string, unknown>,\n opts: { requireLexicon: boolean },\n): ValidationStatus => {\n if (typeof record.$type !== 'string') {\n throw new InvalidRecordError('No $type provided')\n }\n try {\n lex.lexicons.assertValidRecord(record.$type, record)\n assertValidCreatedAt(record)\n } catch (e) {\n if (e instanceof LexiconDefNotFoundError) {\n if (opts.requireLexicon) {\n throw new InvalidRecordError(e.message)\n } else {\n return 'unknown'\n }\n }\n throw new InvalidRecordError(\n `Invalid ${record.$type} record: ${\n e instanceof Error ? e.message : String(e)\n }`,\n )\n }\n return 'valid'\n}\n\n// additional more rigorous check on datetimes\n// this check will eventually be in the lex sdk, but this will stop the bleed until then\nexport const assertValidCreatedAt = (record: Record<string, unknown>) => {\n const createdAt = record['createdAt']\n if (typeof createdAt !== 'string') {\n return\n }\n try {\n ensureValidDatetime(createdAt)\n } catch {\n throw new ValidationError(\n 'createdAt must be an valid atproto datetime (both RFC-3339 and ISO-8601)',\n )\n }\n}\n\nexport const setCollectionName = (\n collection: string,\n record: RepoRecord,\n validate: boolean,\n) => {\n if (!record.$type) {\n record.$type = collection\n }\n if (validate && record.$type !== collection) {\n throw new InvalidRecordError(\n `Invalid $type: expected ${collection}, got ${record.$type}`,\n )\n }\n return record\n}\n\nexport const prepareCreate = async (opts: {\n did: string\n collection: string\n rkey?: string\n swapCid?: CID | null\n record: RepoRecord\n validate?: boolean\n}): Promise<PreparedCreate> => {\n const { did, collection, swapCid, validate } = opts\n const maybeValidate = validate !== false\n const record = setCollectionName(collection, opts.record, maybeValidate)\n let validationStatus: ValidationStatus\n if (maybeValidate) {\n validationStatus = assertValidRecordWithStatus(record, {\n requireLexicon: validate === true,\n })\n }\n const nextRkey = TID.next()\n const rkey = opts.rkey || nextRkey.toString()\n // @TODO: validate against Lexicon record 'key' type, not just overall recordkey syntax\n ensureValidRecordKey(rkey)\n assertNoExplicitSlurs(rkey, record)\n return {\n action: WriteOpAction.Create,\n uri: AtUri.make(did, collection, rkey),\n cid: await cidForSafeRecord(record),\n swapCid,\n record,\n blobs: blobsForWrite(record, maybeValidate),\n validationStatus,\n }\n}\n\nexport const prepareUpdate = async (opts: {\n did: string\n collection: string\n rkey: string\n swapCid?: CID | null\n record: RepoRecord\n validate?: boolean\n}): Promise<PreparedUpdate> => {\n const { did, collection, rkey, swapCid, validate } = opts\n const maybeValidate = validate !== false\n const record = setCollectionName(collection, opts.record, maybeValidate)\n let validationStatus: ValidationStatus\n if (maybeValidate) {\n validationStatus = assertValidRecordWithStatus(record, {\n requireLexicon: validate === true,\n })\n }\n assertNoExplicitSlurs(rkey, record)\n return {\n action: WriteOpAction.Update,\n uri: AtUri.make(did, collection, rkey),\n cid: await cidForSafeRecord(record),\n swapCid,\n record,\n blobs: blobsForWrite(record, maybeValidate),\n validationStatus,\n }\n}\n\nexport const prepareDelete = (opts: {\n did: string\n collection: string\n rkey: string\n swapCid?: CID | null\n}): PreparedDelete => {\n const { did, collection, rkey, swapCid } = opts\n return {\n action: WriteOpAction.Delete,\n uri: AtUri.make(did, collection, rkey),\n swapCid,\n }\n}\n\nexport const createWriteToOp = (write: PreparedCreate): RecordCreateOp => ({\n action: WriteOpAction.Create,\n collection: write.uri.collection,\n rkey: write.uri.rkey,\n record: write.record,\n})\n\nexport const updateWriteToOp = (write: PreparedUpdate): RecordUpdateOp => ({\n action: WriteOpAction.Update,\n collection: write.uri.collection,\n rkey: write.uri.rkey,\n record: write.record,\n})\n\nexport const deleteWriteToOp = (write: PreparedDelete): RecordDeleteOp => ({\n action: WriteOpAction.Delete,\n collection: write.uri.collection,\n rkey: write.uri.rkey,\n})\n\nexport const writeToOp = (write: PreparedWrite): RecordWriteOp => {\n switch (write.action) {\n case WriteOpAction.Create:\n return createWriteToOp(write)\n case WriteOpAction.Update:\n return updateWriteToOp(write)\n case WriteOpAction.Delete:\n return deleteWriteToOp(write)\n default:\n throw new Error(`Unrecognized action: ${write}`)\n }\n}\n\nasync function cidForSafeRecord(record: RepoRecord) {\n try {\n const block = await dataToCborBlock(lexToIpld(record))\n cborToLex(block.bytes)\n return block.cid\n } catch (err) {\n // Block does not properly transform between lex and cbor\n const badRecordErr = new InvalidRecordError('Bad record')\n badRecordErr.cause = err\n throw badRecordErr\n }\n}\n\nfunction assertNoExplicitSlurs(rkey: string, record: RepoRecord) {\n const toCheck: string[] = []\n\n if (isValidProfile(record)) {\n if (record.displayName) toCheck.push(record.displayName)\n } else if (isValidList(record)) {\n toCheck.push(record.name)\n } else if (isValidStarterPack(record)) {\n toCheck.push(record.name)\n } else if (isValidFeedGenerator(record)) {\n toCheck.push(rkey)\n toCheck.push(record.displayName)\n } else if (isValidPost(record)) {\n if (record.tags) {\n toCheck.push(...record.tags)\n }\n\n for (const facet of record.facets || []) {\n for (const feat of facet.features) {\n if (isTag(feat)) {\n toCheck.push(feat.tag)\n }\n }\n }\n }\n if (hasExplicitSlur(toCheck.join(' '))) {\n throw new InvalidRecordError('Unacceptable slur in record')\n }\n}\n\ntype FoundBlobRef = {\n ref: BlobRef\n path: string[]\n}\n\nexport const blobsForWrite = (\n record: RepoRecord,\n validate: boolean,\n): PreparedBlobRef[] => {\n const refs = findBlobRefs(record)\n const recordType =\n typeof record['$type'] === 'string' ? record['$type'] : undefined\n\n for (const ref of refs) {\n if (check.is(ref.ref.original, untypedJsonBlobRef)) {\n throw new InvalidRecordError(`Legacy blob ref at '${ref.path.join('/')}'`)\n }\n }\n\n return refs.map(({ ref, path }) => ({\n size: ref.size,\n cid: ref.ref,\n mimeType: ref.mimeType,\n constraints:\n validate && recordType\n ? CONSTRAINTS[recordType]?.[path.join('/')] ?? {}\n : {},\n }))\n}\n\nexport const findBlobRefs = (\n val: LexValue,\n path: string[] = [],\n layer = 0,\n): FoundBlobRef[] => {\n if (layer > 32) {\n return []\n }\n // walk arrays\n if (Array.isArray(val)) {\n return val.flatMap((item) => findBlobRefs(item, path, layer + 1))\n }\n // objects\n if (val && typeof val === 'object') {\n // convert blobs, leaving the original encoding so that we don't change CIDs on re-encode\n if (val instanceof BlobRef) {\n return [\n {\n ref: val,\n path,\n },\n ]\n }\n // retain cids & bytes\n if (CID.asCID(val) || val instanceof Uint8Array) {\n return []\n }\n return Object.entries(val).flatMap(([key, item]) =>\n findBlobRefs(item, [...path, key], layer + 1),\n )\n }\n // pass through\n return []\n}\n\nconst CONSTRAINTS = {\n [lex.ids.AppBskyActorProfile]: {\n avatar:\n lex.schemaDict.AppBskyActorProfile.defs.main.record.properties.avatar,\n banner:\n lex.schemaDict.AppBskyActorProfile.defs.main.record.properties.banner,\n },\n [lex.ids.AppBskyFeedGenerator]: {\n avatar:\n lex.schemaDict.AppBskyFeedGenerator.defs.main.record.properties.avatar,\n },\n [lex.ids.AppBskyGraphList]: {\n avatar: lex.schemaDict.AppBskyGraphList.defs.main.record.properties.avatar,\n },\n [lex.ids.AppBskyFeedPost]: {\n 'embed/images/image':\n lex.schemaDict.AppBskyEmbedImages.defs.image.properties.image,\n 'embed/external/thumb':\n lex.schemaDict.AppBskyEmbedExternal.defs.external.properties.thumb,\n 'embed/media/images/image':\n lex.schemaDict.AppBskyEmbedImages.defs.image.properties.image,\n 'embed/media/external/thumb':\n lex.schemaDict.AppBskyEmbedExternal.defs.external.properties.thumb,\n },\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/repo/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;AAE9D,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,M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AAG,EAAE,GAAG;CAG5B;AAED,qBAAa,kBAAmB,SAAQ,KAAK;IACxB,GAAG,EAAE,GAAG,GAAG,IAAI;gBAAf,GAAG,EAAE,GAAG,GAAG,IAAI;CAGnC"}
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ /* eslint-disable import/no-deprecated */
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.BadRecordSwapError = exports.BadCommitSwapError = exports.InvalidRecordError = void 0;
4
5
  class InvalidRecordError extends Error {
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/repo/types.ts"],"names":[],"mappings":";;;AAiEA,MAAa,kBAAmB,SAAQ,KAAK;CAAG;AAAhD,gDAAgD;AAEhD,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAAmB,GAAQ;QACzB,KAAK,CAAC,iBAAiB,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;QAD9B;;;;mBAAO,GAAG;WAAK;IAE3B,CAAC;CACF;AAJD,gDAIC;AAED,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAAmB,GAAe;QAChC,KAAK,CAAC,iBAAiB,GAAG,EAAE,QAAQ,EAAE,IAAI,MAAM,EAAE,CAAC,CAAA;QADzC;;;;mBAAO,GAAG;WAAY;IAElC,CAAC;CACF;AAJD,gDAIC","sourcesContent":["import { CID } from 'multiformats/cid'\nimport { RepoRecord } from '@atproto/lexicon'\nimport { BlockMap, CommitData, WriteOpAction } from '@atproto/repo'\nimport { AtUri } from '@atproto/syntax'\n\nexport type ValidationStatus = 'valid' | 'unknown' | undefined\n\nexport type BlobConstraint = {\n accept?: string[]\n maxSize?: number\n}\n\nexport type PreparedBlobRef = {\n size: number\n cid: CID\n mimeType: string\n constraints: BlobConstraint\n}\n\nexport type PreparedCreate = {\n action: WriteOpAction.Create\n uri: AtUri\n cid: CID\n swapCid?: CID | null\n record: RepoRecord\n blobs: PreparedBlobRef[]\n validationStatus: ValidationStatus\n}\n\nexport type PreparedUpdate = {\n action: WriteOpAction.Update\n uri: AtUri\n cid: CID\n swapCid?: CID | null\n record: RepoRecord\n blobs: PreparedBlobRef[]\n validationStatus: ValidationStatus\n}\n\nexport type PreparedDelete = {\n action: WriteOpAction.Delete\n uri: AtUri\n swapCid?: CID | null\n}\n\nexport type CommitOp = {\n action: 'create' | 'update' | 'delete'\n path: string\n cid: CID | null\n prev?: CID\n}\n\nexport type CommitDataWithOps = CommitData & {\n ops: CommitOp[]\n prevData: CID | null\n}\n\nexport type PreparedWrite = PreparedCreate | PreparedUpdate | PreparedDelete\n\nexport type SyncEvtData = {\n cid: CID\n rev: string\n blocks: BlockMap\n}\n\nexport class InvalidRecordError extends Error {}\n\nexport class BadCommitSwapError extends Error {\n constructor(public cid: CID) {\n super(`Commit was at ${cid.toString()}`)\n }\n}\n\nexport class BadRecordSwapError extends Error {\n constructor(public cid: CID | null) {\n super(`Record was at ${cid?.toString() ?? 'null'}`)\n }\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/repo/types.ts"],"names":[],"mappings":";AAAA,yCAAyC;;;AAmEzC,MAAa,kBAAmB,SAAQ,KAAK;CAAG;AAAhD,gDAAgD;AAEhD,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAAmB,GAAQ;QACzB,KAAK,CAAC,iBAAiB,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;QAD9B;;;;mBAAO,GAAG;WAAK;IAE3B,CAAC;CACF;AAJD,gDAIC;AAED,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAAmB,GAAe;QAChC,KAAK,CAAC,iBAAiB,GAAG,EAAE,QAAQ,EAAE,IAAI,MAAM,EAAE,CAAC,CAAA;QADzC;;;;mBAAO,GAAG;WAAY;IAElC,CAAC;CACF;AAJD,gDAIC","sourcesContent":["/* eslint-disable import/no-deprecated */\n\nimport { CID } from 'multiformats/cid'\nimport { RepoRecord } from '@atproto/lexicon'\nimport { BlockMap, CommitData, WriteOpAction } from '@atproto/repo'\nimport { AtUri } from '@atproto/syntax'\n\nexport type ValidationStatus = 'valid' | 'unknown' | undefined\n\nexport type BlobConstraint = {\n accept?: string[]\n maxSize?: number\n}\n\nexport type PreparedBlobRef = {\n size: number\n cid: CID\n mimeType: string\n constraints: BlobConstraint\n}\n\nexport type PreparedCreate = {\n action: WriteOpAction.Create\n uri: AtUri\n cid: CID\n swapCid?: CID | null\n record: RepoRecord\n blobs: PreparedBlobRef[]\n validationStatus: ValidationStatus\n}\n\nexport type PreparedUpdate = {\n action: WriteOpAction.Update\n uri: AtUri\n cid: CID\n swapCid?: CID | null\n record: RepoRecord\n blobs: PreparedBlobRef[]\n validationStatus: ValidationStatus\n}\n\nexport type PreparedDelete = {\n action: WriteOpAction.Delete\n uri: AtUri\n swapCid?: CID | null\n}\n\nexport type CommitOp = {\n action: 'create' | 'update' | 'delete'\n path: string\n cid: CID | null\n prev?: CID\n}\n\nexport type CommitDataWithOps = CommitData & {\n ops: CommitOp[]\n prevData: CID | null\n}\n\nexport type PreparedWrite = PreparedCreate | PreparedUpdate | PreparedDelete\n\nexport type SyncEvtData = {\n cid: CID\n rev: string\n blocks: BlockMap\n}\n\nexport class InvalidRecordError extends Error {}\n\nexport class BadCommitSwapError extends Error {\n constructor(public cid: CID) {\n super(`Commit was at ${cid.toString()}`)\n }\n}\n\nexport class BadRecordSwapError extends Error {\n constructor(public cid: CID | null) {\n super(`Record was at ${cid?.toString() ?? 'null'}`)\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/sequencer/events.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AAEpC,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CAAA;IACZ,GAAG,EAAE,WAAW,CAAA;CACjB,CAAA;AACD,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,SAAS,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,UAAU,CAAA;CAChB,CAAA;AACD,MAAM,MAAM,MAAM,GACd,cAAc,GACd,YAAY,GACZ,gBAAgB,GAChB,eAAe,CAAA"}
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ /* eslint-disable import/no-deprecated */
2
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/sequencer/events.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAgC;AAChC,6BAAuB;AACvB,4CAAqE;AACrE,wCAAyD;AACzD,wEAAkE;AAI3D,MAAM,eAAe,GAAG,KAAK,EAClC,GAAW,EACX,UAA6B,EACL,EAAE;IAC1B,MAAM,YAAY,GAAG,IAAI,eAAQ,EAAE,CAAA;IACnC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;IACzC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,CAAA;IAE9C,MAAM,GAAG,GAAG;QACV,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,UAAU,CAAC,GAAG;QACtB,GAAG,EAAE,UAAU,CAAC,GAAG;QACnB,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,MAAM,EAAE,MAAM,IAAA,sBAAe,EAAC,UAAU,CAAC,GAAG,EAAE,YAAY,CAAC;QAC3D,GAAG,EAAE,UAAU,CAAC,GAAG;QACnB,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,SAAS;QAC1C,yCAAyC;QACzC,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,EAAE;KACV,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nimport { BlockMap, blocksToCarFile } from '@atproto/repo'\nimport { AccountStatus } from '../account-manager/account-manager'\nimport { CommitDataWithOps, SyncEvtData } from '../repo'\nimport { RepoSeqInsert } from './db'\n\nexport const formatSeqCommit = async (\n did: string,\n commitData: CommitDataWithOps,\n): Promise<RepoSeqInsert> => {\n const blocksToSend = new BlockMap()\n blocksToSend.addMap(commitData.newBlocks)\n blocksToSend.addMap(commitData.relevantBlocks)\n\n const evt = {\n repo: did,\n commit: commitData.cid,\n rev: commitData.rev,\n since: commitData.since,\n blocks: await blocksToCarFile(commitData.cid, blocksToSend),\n ops: commitData.ops,\n prevData: commitData.prevData ?? undefined,\n // deprecated (but still required) fields\n rebase: false,\n tooBig: false,\n blobs: [],\n }\n\n return {\n did,\n eventType: 'append' as const,\n event: cborEncode(noUndefinedVals(evt)),\n sequencedAt: new Date().toISOString(),\n }\n}\n\nexport const formatSeqSyncEvt = async (\n did: string,\n data: SyncEvtData,\n): Promise<RepoSeqInsert> => {\n const blocks = await blocksToCarFile(data.cid, data.blocks)\n const evt: SyncEvt = {\n did,\n rev: data.rev,\n blocks,\n }\n return {\n did,\n eventType: 'sync',\n event: cborEncode(evt),\n sequencedAt: new Date().toISOString(),\n }\n}\n\nexport const syncEvtDataFromCommit = (\n commitData: CommitDataWithOps,\n): SyncEvtData => {\n const { blocks, missing } = commitData.relevantBlocks.getMany([\n commitData.cid,\n ])\n assert(\n !missing.length,\n 'commit block was not found, could not build sync event',\n )\n return {\n rev: commitData.rev,\n cid: commitData.cid,\n blocks,\n }\n}\n\nexport const formatSeqIdentityEvt = async (\n did: string,\n handle?: string,\n): Promise<RepoSeqInsert> => {\n const evt: IdentityEvt = {\n did,\n }\n if (handle) {\n evt.handle = handle\n }\n return {\n did,\n eventType: 'identity',\n event: cborEncode(evt),\n sequencedAt: new Date().toISOString(),\n }\n}\n\nexport const formatSeqAccountEvt = async (\n did: string,\n status: AccountStatus,\n): Promise<RepoSeqInsert> => {\n const evt: AccountEvt = {\n did,\n active: status === 'active',\n }\n if (status !== AccountStatus.Active) {\n evt.status = status\n }\n\n return {\n did,\n eventType: 'account',\n event: cborEncode(evt),\n sequencedAt: new Date().toISOString(),\n }\n}\n\nexport const commitEvtOp = z.object({\n action: z.union([\n z.literal('create'),\n z.literal('update'),\n z.literal('delete'),\n ]),\n path: z.string(),\n cid: schema.cid.nullable(),\n prev: schema.cid.optional(),\n})\nexport type CommitEvtOp = z.infer<typeof commitEvtOp>\n\nexport const commitEvt = z.object({\n rebase: z.boolean(),\n tooBig: z.boolean(),\n repo: z.string(),\n commit: schema.cid,\n rev: z.string(),\n since: z.string().nullable(),\n blocks: schema.bytes,\n ops: z.array(commitEvtOp),\n blobs: z.array(schema.cid),\n prevData: schema.cid.optional(),\n})\nexport type CommitEvt = z.infer<typeof commitEvt>\n\nexport const syncEvt = z.object({\n did: z.string(),\n blocks: schema.bytes,\n rev: z.string(),\n})\nexport type SyncEvt = z.infer<typeof syncEvt>\n\nexport const identityEvt = z.object({\n did: z.string(),\n handle: z.string().optional(),\n})\nexport type IdentityEvt = z.infer<typeof identityEvt>\n\nexport const accountEvt = z.object({\n did: z.string(),\n active: z.boolean(),\n status: z\n .enum([\n AccountStatus.Takendown,\n AccountStatus.Suspended,\n AccountStatus.Deleted,\n AccountStatus.Deactivated,\n ])\n .optional(),\n})\nexport type AccountEvt = z.infer<typeof accountEvt>\n\ntype TypedCommitEvt = {\n type: 'commit'\n seq: number\n time: string\n evt: CommitEvt\n}\ntype TypedSyncEvt = {\n type: 'sync'\n seq: number\n time: string\n evt: SyncEvt\n}\ntype TypedIdentityEvt = {\n type: 'identity'\n seq: number\n time: string\n evt: IdentityEvt\n}\ntype TypedAccountEvt = {\n type: 'account'\n seq: number\n time: string\n evt: AccountEvt\n}\nexport type SeqEvt =\n | TypedCommitEvt\n | TypedSyncEvt\n | TypedIdentityEvt\n | TypedAccountEvt\n"]}
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/sequencer/events.ts"],"names":[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W,QAAA,OAAO,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,MAAM,EAAE,eAAM,CAAC,KAAK;IACpB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;CAChB,CAAC,CAAA;AAGW,QAAA,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAA;AAGW,QAAA,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC;IACjC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,MAAM,EAAE,OAAC,CAAC,OAAO,EAAE;IACnB,MAAM,EAAE,OAAC;SACN,IAAI,CAAC;QACJ,+BAAa,CAAC,SAAS;QACvB,+BAAa,CAAC,SAAS;QACvB,+BAAa,CAAC,OAAO;QACrB,+BAAa,CAAC,WAAW;KAC1B,CAAC;SACD,QAAQ,EAAE;CACd,CAAC,CAAA","sourcesContent":["/* eslint-disable import/no-deprecated */\n\nimport assert from 'node:assert'\nimport { z } from 'zod'\nimport { cborEncode, noUndefinedVals, schema } from '@atproto/common'\nimport { BlockMap, blocksToCarFile } from '@atproto/repo'\nimport { AccountStatus } from '../account-manager/account-manager'\nimport { CommitDataWithOps, SyncEvtData } from '../repo'\nimport { RepoSeqInsert } from './db'\n\nexport const formatSeqCommit = async (\n did: string,\n commitData: CommitDataWithOps,\n): Promise<RepoSeqInsert> => {\n const blocksToSend = new BlockMap()\n blocksToSend.addMap(commitData.newBlocks)\n blocksToSend.addMap(commitData.relevantBlocks)\n\n const evt = {\n repo: did,\n commit: commitData.cid,\n rev: commitData.rev,\n since: commitData.since,\n blocks: await blocksToCarFile(commitData.cid, blocksToSend),\n ops: commitData.ops,\n prevData: commitData.prevData ?? undefined,\n // deprecated (but still required) fields\n rebase: false,\n tooBig: false,\n blobs: [],\n }\n\n return {\n did,\n eventType: 'append' as const,\n event: cborEncode(noUndefinedVals(evt)),\n sequencedAt: new Date().toISOString(),\n }\n}\n\nexport const formatSeqSyncEvt = async (\n did: string,\n data: SyncEvtData,\n): Promise<RepoSeqInsert> => {\n const blocks = await blocksToCarFile(data.cid, data.blocks)\n const evt: SyncEvt = {\n did,\n rev: data.rev,\n blocks,\n }\n return {\n did,\n eventType: 'sync',\n event: cborEncode(evt),\n sequencedAt: new Date().toISOString(),\n }\n}\n\nexport const syncEvtDataFromCommit = (\n commitData: CommitDataWithOps,\n): SyncEvtData => {\n const { blocks, missing } = commitData.relevantBlocks.getMany([\n commitData.cid,\n ])\n assert(\n !missing.length,\n 'commit block was not found, could not build sync event',\n )\n return {\n rev: commitData.rev,\n cid: commitData.cid,\n blocks,\n }\n}\n\nexport const formatSeqIdentityEvt = async (\n did: string,\n handle?: string,\n): Promise<RepoSeqInsert> => {\n const evt: IdentityEvt = {\n did,\n }\n if (handle) {\n evt.handle = handle\n }\n return {\n did,\n eventType: 'identity',\n event: cborEncode(evt),\n sequencedAt: new Date().toISOString(),\n }\n}\n\nexport const formatSeqAccountEvt = async (\n did: string,\n status: AccountStatus,\n): Promise<RepoSeqInsert> => {\n const evt: AccountEvt = {\n did,\n active: status === 'active',\n }\n if (status !== AccountStatus.Active) {\n evt.status = status\n }\n\n return {\n did,\n eventType: 'account',\n event: cborEncode(evt),\n sequencedAt: new Date().toISOString(),\n }\n}\n\nexport const commitEvtOp = z.object({\n action: z.union([\n z.literal('create'),\n z.literal('update'),\n z.literal('delete'),\n ]),\n path: z.string(),\n cid: schema.cid.nullable(),\n prev: schema.cid.optional(),\n})\nexport type CommitEvtOp = z.infer<typeof commitEvtOp>\n\nexport const commitEvt = z.object({\n rebase: z.boolean(),\n tooBig: z.boolean(),\n repo: z.string(),\n commit: schema.cid,\n rev: z.string(),\n since: z.string().nullable(),\n blocks: schema.bytes,\n ops: z.array(commitEvtOp),\n blobs: z.array(schema.cid),\n prevData: schema.cid.optional(),\n})\nexport type CommitEvt = z.infer<typeof commitEvt>\n\nexport const syncEvt = z.object({\n did: z.string(),\n blocks: schema.bytes,\n rev: z.string(),\n})\nexport type SyncEvt = z.infer<typeof syncEvt>\n\nexport const identityEvt = z.object({\n did: z.string(),\n handle: z.string().optional(),\n})\nexport type IdentityEvt = z.infer<typeof identityEvt>\n\nexport const accountEvt = z.object({\n did: z.string(),\n active: z.boolean(),\n status: z\n .enum([\n AccountStatus.Takendown,\n AccountStatus.Suspended,\n AccountStatus.Deleted,\n AccountStatus.Deactivated,\n ])\n .optional(),\n})\nexport type AccountEvt = z.infer<typeof accountEvt>\n\ntype TypedCommitEvt = {\n type: 'commit'\n seq: number\n time: string\n evt: CommitEvt\n}\ntype TypedSyncEvt = {\n type: 'sync'\n seq: number\n time: string\n evt: SyncEvt\n}\ntype TypedIdentityEvt = {\n type: 'identity'\n seq: number\n time: string\n evt: IdentityEvt\n}\ntype TypedAccountEvt = {\n type: 'account'\n seq: number\n time: string\n evt: AccountEvt\n}\nexport type SeqEvt =\n | TypedCommitEvt\n | TypedSyncEvt\n | TypedIdentityEvt\n | TypedAccountEvt\n"]}