An experimental TypeSpec syntax for Lexicon

yea

+828
+56
packages/emitter/test/integration/atproto/input/tools/ozone/moderation/emitEvent.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.moderation.emitEvent { 4 + model SubjectHasAction {} 5 + 6 + @doc("An event with the same external ID already exists for the subject.") 7 + model DuplicateExternalId {} 8 + 9 + @doc("Take a moderation action on an actor.") 10 + @procedure 11 + @errors(SubjectHasAction, DuplicateExternalId) 12 + op main(input: { 13 + @required 14 + event: ( 15 + | tools.ozone.moderation.defs.ModEventTakedown 16 + | tools.ozone.moderation.defs.ModEventAcknowledge 17 + | tools.ozone.moderation.defs.ModEventEscalate 18 + | tools.ozone.moderation.defs.ModEventComment 19 + | tools.ozone.moderation.defs.ModEventLabel 20 + | tools.ozone.moderation.defs.ModEventReport 21 + | tools.ozone.moderation.defs.ModEventMute 22 + | tools.ozone.moderation.defs.ModEventUnmute 23 + | tools.ozone.moderation.defs.ModEventMuteReporter 24 + | tools.ozone.moderation.defs.ModEventUnmuteReporter 25 + | tools.ozone.moderation.defs.ModEventReverseTakedown 26 + | tools.ozone.moderation.defs.ModEventResolveAppeal 27 + | tools.ozone.moderation.defs.ModEventEmail 28 + | tools.ozone.moderation.defs.ModEventDivert 29 + | tools.ozone.moderation.defs.ModEventTag 30 + | tools.ozone.moderation.defs.AccountEvent 31 + | tools.ozone.moderation.defs.IdentityEvent 32 + | tools.ozone.moderation.defs.RecordEvent 33 + | tools.ozone.moderation.defs.ModEventPriorityScore 34 + | tools.ozone.moderation.defs.AgeAssuranceEvent 35 + | tools.ozone.moderation.defs.AgeAssuranceOverrideEvent 36 + | tools.ozone.moderation.defs.RevokeAccountCredentialsEvent 37 + | unknown 38 + ); 39 + 40 + @required 41 + subject: ( 42 + | com.atproto.admin.defs.RepoRef 43 + | com.atproto.repo.strongRef.Main 44 + | unknown 45 + ); 46 + 47 + subjectBlobCids?: cid[]; 48 + 49 + @required createdBy: did; 50 + 51 + modTool?: tools.ozone.moderation.defs.ModTool; 52 + 53 + @doc("An optional external ID for the event, used to deduplicate events from external systems. Fails when an event of same type with the same external ID exists for the same subject.") 54 + externalId?: string; 55 + }): tools.ozone.moderation.defs.ModEventView; 56 + }
+57
packages/emitter/test/integration/atproto/input/tools/ozone/moderation/getAccountTimeline.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.moderation.getAccountTimeline { 4 + model RepoNotFound {} 5 + 6 + @doc("Get timeline of all available events of an account. This includes moderation events, account history and did history.") 7 + @query 8 + @errors(RepoNotFound) 9 + op main(@required did: did): { 10 + @required timeline: TimelineItem[]; 11 + }; 12 + 13 + model TimelineItem { 14 + @required day: string; 15 + 16 + @required summary: TimelineItemSummary[]; 17 + } 18 + 19 + model TimelineItemSummary { 20 + @required eventSubjectType: "account" | "record" | "chat" | string; 21 + 22 + @required 23 + eventType: 24 + | "tools.ozone.moderation.defs#modEventTakedown" 25 + | "tools.ozone.moderation.defs#modEventReverseTakedown" 26 + | "tools.ozone.moderation.defs#modEventComment" 27 + | "tools.ozone.moderation.defs#modEventReport" 28 + | "tools.ozone.moderation.defs#modEventLabel" 29 + | "tools.ozone.moderation.defs#modEventAcknowledge" 30 + | "tools.ozone.moderation.defs#modEventEscalate" 31 + | "tools.ozone.moderation.defs#modEventMute" 32 + | "tools.ozone.moderation.defs#modEventUnmute" 33 + | "tools.ozone.moderation.defs#modEventMuteReporter" 34 + | "tools.ozone.moderation.defs#modEventUnmuteReporter" 35 + | "tools.ozone.moderation.defs#modEventEmail" 36 + | "tools.ozone.moderation.defs#modEventResolveAppeal" 37 + | "tools.ozone.moderation.defs#modEventDivert" 38 + | "tools.ozone.moderation.defs#modEventTag" 39 + | "tools.ozone.moderation.defs#accountEvent" 40 + | "tools.ozone.moderation.defs#identityEvent" 41 + | "tools.ozone.moderation.defs#recordEvent" 42 + | "tools.ozone.moderation.defs#modEventPriorityScore" 43 + | "tools.ozone.moderation.defs#revokeAccountCredentialsEvent" 44 + | "tools.ozone.moderation.defs#ageAssuranceEvent" 45 + | "tools.ozone.moderation.defs#ageAssuranceOverrideEvent" 46 + | "tools.ozone.moderation.defs#timelineEventPlcCreate" 47 + | "tools.ozone.moderation.defs#timelineEventPlcOperation" 48 + | "tools.ozone.moderation.defs#timelineEventPlcTombstone" 49 + | "tools.ozone.hosting.getAccountHistory#accountCreated" 50 + | "tools.ozone.hosting.getAccountHistory#emailConfirmed" 51 + | "tools.ozone.hosting.getAccountHistory#passwordUpdated" 52 + | "tools.ozone.hosting.getAccountHistory#handleUpdated" 53 + | string; 54 + 55 + @required count: integer; 56 + } 57 + }
+7
packages/emitter/test/integration/atproto/input/tools/ozone/moderation/getEvent.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.moderation.getEvent { 4 + @doc("Get details about a moderation event.") 5 + @query 6 + op main(@required id: integer): tools.ozone.moderation.defs.ModEventViewDetail; 7 + }
+10
packages/emitter/test/integration/atproto/input/tools/ozone/moderation/getRecord.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.moderation.getRecord { 4 + model RecordNotFound {} 5 + 6 + @doc("Get details about a record.") 7 + @query 8 + @errors(RecordNotFound) 9 + op main(@required uri: atUri, cid?: cid): tools.ozone.moderation.defs.RecordViewDetail; 10 + }
+18
packages/emitter/test/integration/atproto/input/tools/ozone/moderation/getRecords.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.moderation.getRecords { 4 + @doc("Get details about some records.") 5 + @query 6 + op main( 7 + @maxItems(100) 8 + @required 9 + uris: atUri[] 10 + ): { 11 + @required 12 + records: ( 13 + | tools.ozone.moderation.defs.RecordViewDetail 14 + | tools.ozone.moderation.defs.RecordViewNotFound 15 + | unknown 16 + )[]; 17 + }; 18 + }
+10
packages/emitter/test/integration/atproto/input/tools/ozone/moderation/getRepo.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.moderation.getRepo { 4 + model RepoNotFound {} 5 + 6 + @doc("Get details about a repository.") 7 + @query 8 + @errors(RepoNotFound) 9 + op main(@required did: did): tools.ozone.moderation.defs.RepoViewDetail; 10 + }
+13
packages/emitter/test/integration/atproto/input/tools/ozone/moderation/getReporterStats.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.moderation.getReporterStats { 4 + @doc("Get reporter stats for a list of users.") 5 + @query 6 + op main( 7 + @maxItems(100) 8 + @required 9 + dids: did[] 10 + ): { 11 + @required stats: tools.ozone.moderation.defs.ReporterStats[]; 12 + }; 13 + }
+18
packages/emitter/test/integration/atproto/input/tools/ozone/moderation/getRepos.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.moderation.getRepos { 4 + @doc("Get details about some repositories.") 5 + @query 6 + op main( 7 + @maxItems(100) 8 + @required 9 + dids: did[] 10 + ): { 11 + @required 12 + repos: ( 13 + | tools.ozone.moderation.defs.RepoViewDetail 14 + | tools.ozone.moderation.defs.RepoViewNotFound 15 + | unknown 16 + )[]; 17 + }; 18 + }
+14
packages/emitter/test/integration/atproto/input/tools/ozone/moderation/getSubjects.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.moderation.getSubjects { 4 + @doc("Get details about subjects.") 5 + @query 6 + op main( 7 + @minItems(1) 8 + @maxItems(100) 9 + @required 10 + subjects: string[] 11 + ): { 12 + @required subjects: tools.ozone.moderation.defs.SubjectView[]; 13 + }; 14 + }
+82
packages/emitter/test/integration/atproto/input/tools/ozone/moderation/queryEvents.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.moderation.queryEvents { 4 + @closed 5 + @inline 6 + union SortDirection { 7 + "asc", 8 + "desc", 9 + } 10 + 11 + @doc("List moderation events related to a subject.") 12 + @query 13 + op main( 14 + @doc("The types of events (fully qualified string in the format of tools.ozone.moderation.defs#modEvent<name>) to filter by. If not specified, all events are returned.") 15 + types?: string[], 16 + 17 + createdBy?: did, 18 + 19 + @doc("Sort direction for the events. Defaults to descending order of created at timestamp.") 20 + sortDirection?: SortDirection = "desc", 21 + 22 + @doc("Retrieve events created after a given timestamp") 23 + createdAfter?: datetime, 24 + 25 + @doc("Retrieve events created before a given timestamp") 26 + createdBefore?: datetime, 27 + 28 + subject?: uri, 29 + 30 + @maxItems(20) 31 + @doc("If specified, only events where the subject belongs to the given collections will be returned. When subjectType is set to 'account', this will be ignored.") 32 + collections?: nsid[], 33 + 34 + @doc("If specified, only events where the subject is 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.") 35 + subjectType?: "account" | "record" | string, 36 + 37 + @doc("If true, events on all record types (posts, lists, profile etc.) or records from given 'collections' param, owned by the did are returned.") 38 + includeAllUserRecords?: boolean = false, 39 + 40 + @minValue(1) 41 + @maxValue(100) 42 + limit?: int32 = 50, 43 + 44 + @doc("If true, only events with comments are returned") 45 + hasComment?: boolean, 46 + 47 + @doc("If specified, only events with comments containing the keyword are returned. Apply || separator to use multiple keywords and match using OR condition.") 48 + comment?: string, 49 + 50 + @doc("If specified, only events where all of these labels were added are returned") 51 + addedLabels?: string[], 52 + 53 + @doc("If specified, only events where all of these labels were removed are returned") 54 + removedLabels?: string[], 55 + 56 + @doc("If specified, only events where all of these tags were added are returned") 57 + addedTags?: string[], 58 + 59 + @doc("If specified, only events where all of these tags were removed are returned") 60 + removedTags?: string[], 61 + 62 + reportTypes?: string[], 63 + 64 + @doc("If specified, only events where the action policies match any of the given policies are returned") 65 + policies?: string[], 66 + 67 + @doc("If specified, only events where the modTool name matches any of the given values are returned") 68 + modTool?: string[], 69 + 70 + @doc("If specified, only events where the batchId matches the given value are returned") 71 + batchId?: string, 72 + 73 + @doc("If specified, only events where the age assurance state matches the given value are returned") 74 + ageAssuranceState?: "pending" | "assured" | "unknown" | "reset" | "blocked" | string, 75 + 76 + cursor?: string 77 + ): { 78 + cursor?: string; 79 + 80 + @required events: tools.ozone.moderation.defs.ModEventView[]; 81 + }; 82 + }
+133
packages/emitter/test/integration/atproto/input/tools/ozone/moderation/queryStatuses.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.moderation.queryStatuses { 4 + @closed 5 + @inline 6 + union SortField { 7 + "lastReviewedAt", 8 + "lastReportedAt", 9 + "reportedRecordsCount", 10 + "takendownRecordsCount", 11 + "priorityScore", 12 + } 13 + 14 + @closed 15 + @inline 16 + union SortDirection { 17 + "asc", 18 + "desc", 19 + } 20 + 21 + @doc("View moderation statuses of subjects (record or repo).") 22 + @query 23 + op main( 24 + @doc("Number of queues being used by moderators. Subjects will be split among all queues.") 25 + queueCount?: integer, 26 + 27 + @doc("Index of the queue to fetch subjects from. Works only when queueCount value is specified.") 28 + queueIndex?: integer, 29 + 30 + @doc("A seeder to shuffle/balance the queue items.") 31 + queueSeed?: string, 32 + 33 + @doc("All subjects, or subjects from given 'collections' param, belonging to the account specified in the 'subject' param will be returned.") 34 + includeAllUserRecords?: boolean, 35 + 36 + @doc("The subject to get the status for.") 37 + subject?: uri, 38 + 39 + @doc("Search subjects by keyword from comments") 40 + comment?: string, 41 + 42 + @doc("Search subjects reported after a given timestamp") 43 + reportedAfter?: datetime, 44 + 45 + @doc("Search subjects reported before a given timestamp") 46 + reportedBefore?: datetime, 47 + 48 + @doc("Search subjects reviewed after a given timestamp") 49 + reviewedAfter?: datetime, 50 + 51 + @doc("Search subjects where the associated record/account was deleted after a given timestamp") 52 + hostingDeletedAfter?: datetime, 53 + 54 + @doc("Search subjects where the associated record/account was deleted before a given timestamp") 55 + hostingDeletedBefore?: datetime, 56 + 57 + @doc("Search subjects where the associated record/account was updated after a given timestamp") 58 + hostingUpdatedAfter?: datetime, 59 + 60 + @doc("Search subjects where the associated record/account was updated before a given timestamp") 61 + hostingUpdatedBefore?: datetime, 62 + 63 + @doc("Search subjects by the status of the associated record/account") 64 + hostingStatuses?: string[], 65 + 66 + @doc("Search subjects reviewed before a given timestamp") 67 + reviewedBefore?: datetime, 68 + 69 + @doc("By default, we don't include muted subjects in the results. Set this to true to include them.") 70 + includeMuted?: boolean, 71 + 72 + @doc("When set to true, only muted subjects and reporters will be returned.") 73 + onlyMuted?: boolean, 74 + 75 + @doc("Specify when fetching subjects in a certain state") 76 + reviewState?: string, 77 + 78 + ignoreSubjects?: uri[], 79 + 80 + @doc("Get all subject statuses that were reviewed by a specific moderator") 81 + lastReviewedBy?: did, 82 + 83 + sortField?: SortField = "lastReportedAt", 84 + 85 + sortDirection?: SortDirection = "desc", 86 + 87 + @doc("Get subjects that were taken down") 88 + takendown?: boolean, 89 + 90 + @doc("Get subjects in unresolved appealed status") 91 + appealed?: boolean, 92 + 93 + @minValue(1) 94 + @maxValue(100) 95 + limit?: int32 = 50, 96 + 97 + @doc("Items in this array are applied with OR filters. To apply AND filter, put all tags in the same string and separate using && characters") 98 + @maxItems(25) 99 + tags?: string[], 100 + 101 + excludeTags?: string[], 102 + 103 + cursor?: string, 104 + 105 + @maxItems(20) 106 + @doc("If specified, subjects belonging to the given collections will be returned. When subjectType is set to 'account', this will be ignored.") 107 + collections?: nsid[], 108 + 109 + @doc("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.") 110 + subjectType?: "account" | "record" | string, 111 + 112 + @doc("If specified, only subjects that belong to an account that has at least this many suspensions will be returned.") 113 + minAccountSuspendCount?: integer, 114 + 115 + @doc("If specified, only subjects that belong to an account that has at least this many reported records will be returned.") 116 + minReportedRecordsCount?: integer, 117 + 118 + @doc("If specified, only subjects that belong to an account that has at least this many taken down records will be returned.") 119 + minTakendownRecordsCount?: integer, 120 + 121 + @minValue(0) 122 + @maxValue(100) 123 + @doc("If specified, only subjects that have priority score value above the given value will be returned.") 124 + minPriorityScore?: integer, 125 + 126 + @doc("If specified, only subjects with the given age assurance state will be returned.") 127 + ageAssuranceState?: "pending" | "assured" | "unknown" | "reset" | "blocked" | string 128 + ): { 129 + cursor?: string; 130 + 131 + @required subjectStatuses: tools.ozone.moderation.defs.SubjectStatusView[]; 132 + }; 133 + }
+22
packages/emitter/test/integration/atproto/input/tools/ozone/moderation/searchRepos.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.moderation.searchRepos { 4 + @doc("Find repositories based on a search term.") 5 + @query 6 + op main( 7 + @doc("DEPRECATED: use 'q' instead") 8 + term?: string, 9 + 10 + q?: string, 11 + 12 + @minValue(1) 13 + @maxValue(100) 14 + limit?: int32 = 50, 15 + 16 + cursor?: string 17 + ): { 18 + cursor?: string; 19 + 20 + @required repos: tools.ozone.moderation.defs.RepoView[]; 21 + }; 22 + }
+30
packages/emitter/test/integration/atproto/input/tools/ozone/safelink/addRule.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.safelink.addRule { 4 + @doc("The provided URL is invalid") 5 + model InvalidUrl {} 6 + 7 + @doc("A rule for this URL/domain already exists") 8 + model RuleAlreadyExists {} 9 + 10 + @doc("Add a new URL safety rule") 11 + @procedure 12 + @errors(InvalidUrl, RuleAlreadyExists) 13 + op main(input: { 14 + @doc("The URL or domain to apply the rule to") 15 + @required 16 + url: string; 17 + 18 + @required pattern: tools.ozone.safelink.defs.PatternType; 19 + 20 + @required action: tools.ozone.safelink.defs.ActionType; 21 + 22 + @required reason: tools.ozone.safelink.defs.ReasonType; 23 + 24 + @doc("Optional comment about the decision") 25 + comment?: string; 26 + 27 + @doc("Author DID. Only respected when using admin auth") 28 + createdBy?: did; 29 + }): tools.ozone.safelink.defs.Event; 30 + }
+29
packages/emitter/test/integration/atproto/input/tools/ozone/safelink/queryEvents.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.safelink.queryEvents { 4 + @doc("Query URL safety audit events") 5 + @procedure 6 + op main(input: { 7 + @doc("Cursor for pagination") 8 + cursor?: string; 9 + 10 + @minValue(1) 11 + @maxValue(100) 12 + @doc("Maximum number of results to return") 13 + limit?: int32 = 50; 14 + 15 + @doc("Filter by specific URLs or domains") 16 + urls?: string[]; 17 + 18 + @doc("Filter by pattern type") 19 + patternType?: string; 20 + 21 + @doc("Sort direction") 22 + sortDirection?: "asc" | "desc" | string = "desc"; 23 + }): { 24 + @doc("Next cursor for pagination. Only present if there are more results.") 25 + cursor?: string; 26 + 27 + @required events: tools.ozone.safelink.defs.Event[]; 28 + }; 29 + }
+38
packages/emitter/test/integration/atproto/input/tools/ozone/safelink/queryRules.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.safelink.queryRules { 4 + @doc("Query URL safety rules") 5 + @procedure 6 + op main(input: { 7 + @doc("Cursor for pagination") 8 + cursor?: string; 9 + 10 + @minValue(1) 11 + @maxValue(100) 12 + @doc("Maximum number of results to return") 13 + limit?: int32 = 50; 14 + 15 + @doc("Filter by specific URLs or domains") 16 + urls?: string[]; 17 + 18 + @doc("Filter by pattern type") 19 + patternType?: string; 20 + 21 + @doc("Filter by action types") 22 + actions?: string[]; 23 + 24 + @doc("Filter by reason type") 25 + reason?: string; 26 + 27 + @doc("Filter by rule creator") 28 + createdBy?: did; 29 + 30 + @doc("Sort direction") 31 + sortDirection?: "asc" | "desc" | string = "desc"; 32 + }): { 33 + @doc("Next cursor for pagination. Only present if there are more results.") 34 + cursor?: string; 35 + 36 + @required rules: tools.ozone.safelink.defs.UrlRule[]; 37 + }; 38 + }
+23
packages/emitter/test/integration/atproto/input/tools/ozone/safelink/removeRule.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.safelink.removeRule { 4 + @doc("No active rule found for this URL/domain") 5 + model RuleNotFound {} 6 + 7 + @doc("Remove an existing URL safety rule") 8 + @procedure 9 + @errors(RuleNotFound) 10 + op main(input: { 11 + @doc("The URL or domain to remove the rule for") 12 + @required 13 + url: string; 14 + 15 + @required pattern: tools.ozone.safelink.defs.PatternType; 16 + 17 + @doc("Optional comment about why the rule is being removed") 18 + comment?: string; 19 + 20 + @doc("Optional DID of the user. Only respected when using admin auth.") 21 + createdBy?: did; 22 + }): tools.ozone.safelink.defs.Event; 23 + }
+27
packages/emitter/test/integration/atproto/input/tools/ozone/safelink/updateRule.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.safelink.updateRule { 4 + @doc("No active rule found for this URL/domain") 5 + model RuleNotFound {} 6 + 7 + @doc("Update an existing URL safety rule") 8 + @procedure 9 + @errors(RuleNotFound) 10 + op main(input: { 11 + @doc("The URL or domain to update the rule for") 12 + @required 13 + url: string; 14 + 15 + @required pattern: tools.ozone.safelink.defs.PatternType; 16 + 17 + @required action: tools.ozone.safelink.defs.ActionType; 18 + 19 + @required reason: tools.ozone.safelink.defs.ReasonType; 20 + 21 + @doc("Optional comment about the update") 22 + comment?: string; 23 + 24 + @doc("Optional DID to credit as the creator. Only respected for admin_token authentication.") 25 + createdBy?: did; 26 + }): tools.ozone.safelink.defs.Event; 27 + }
+17
packages/emitter/test/integration/atproto/input/tools/ozone/set/addValues.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.set.addValues { 4 + @doc("Add values to a specific set. Attempting to add values to a set that does not exist will result in an error.") 5 + @procedure 6 + op main(input: { 7 + @doc("Name of the set to add values to") 8 + @required 9 + name: string; 10 + 11 + @minItems(1) 12 + @maxItems(1000) 13 + @doc("Array of string values to add to the set") 14 + @required 15 + values: string[]; 16 + }): void; 17 + }
+15
packages/emitter/test/integration/atproto/input/tools/ozone/set/deleteSet.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.set.deleteSet { 4 + @doc("set with the given name does not exist") 5 + model SetNotFound {} 6 + 7 + @doc("Delete an entire set. Attempting to delete a set that does not exist will result in an error.") 8 + @procedure 9 + @errors(SetNotFound) 10 + op main(input: { 11 + @doc("Name of the set to delete") 12 + @required 13 + name: string; 14 + }): {}; 15 + }
+20
packages/emitter/test/integration/atproto/input/tools/ozone/set/deleteValues.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.set.deleteValues { 4 + @doc("set with the given name does not exist") 5 + model SetNotFound {} 6 + 7 + @doc("Delete values from a specific set. Attempting to delete values that are not in the set will not result in an error") 8 + @procedure 9 + @errors(SetNotFound) 10 + op main(input: { 11 + @doc("Name of the set to delete values from") 12 + @required 13 + name: string; 14 + 15 + @minItems(1) 16 + @doc("Array of string values to delete from the set") 17 + @required 18 + values: string[]; 19 + }): void; 20 + }
+25
packages/emitter/test/integration/atproto/input/tools/ozone/set/getValues.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.set.getValues { 4 + @doc("set with the given name does not exist") 5 + model SetNotFound {} 6 + 7 + @doc("Get a specific set and its values") 8 + @query 9 + @errors(SetNotFound) 10 + op main( 11 + @required name: string, 12 + 13 + @minValue(1) 14 + @maxValue(1000) 15 + limit?: int32 = 100, 16 + 17 + cursor?: string 18 + ): { 19 + @required set: tools.ozone.set.defs.SetView; 20 + 21 + @required values: string[]; 22 + 23 + cursor?: string; 24 + }; 25 + }
+39
packages/emitter/test/integration/atproto/input/tools/ozone/set/querySets.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.set.querySets { 4 + @closed 5 + @inline 6 + union SortBy { 7 + "name", 8 + "createdAt", 9 + "updatedAt", 10 + } 11 + 12 + @closed 13 + @inline 14 + union SortDirection { 15 + "asc", 16 + "desc", 17 + } 18 + 19 + @doc("Query available sets") 20 + @query 21 + op main( 22 + @minValue(1) 23 + @maxValue(100) 24 + limit?: int32 = 50, 25 + 26 + cursor?: string, 27 + 28 + namePrefix?: string, 29 + 30 + sortBy?: SortBy = "name", 31 + 32 + @doc("Defaults to ascending order of name field.") 33 + sortDirection?: SortDirection = "asc" 34 + ): { 35 + @required sets: tools.ozone.set.defs.SetView[]; 36 + 37 + cursor?: string; 38 + }; 39 + }
+7
packages/emitter/test/integration/atproto/input/tools/ozone/set/upsertSet.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.set.upsertSet { 4 + @doc("Create or update set metadata") 5 + @procedure 6 + op main(input: tools.ozone.set.defs.Set): tools.ozone.set.defs.SetView; 7 + }
+26
packages/emitter/test/integration/atproto/input/tools/ozone/setting/listOptions.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.setting.listOptions { 4 + @doc("List settings with optional filtering") 5 + @query 6 + op main( 7 + @minValue(1) 8 + @maxValue(100) 9 + limit?: int32 = 50, 10 + 11 + cursor?: string, 12 + 13 + scope?: "instance" | "personal" | string = "instance", 14 + 15 + @doc("Filter keys by prefix") 16 + prefix?: string, 17 + 18 + @maxItems(100) 19 + @doc("Filter for only the specified keys. Ignored if prefix is provided") 20 + keys?: nsid[] 21 + ): { 22 + cursor?: string; 23 + 24 + @required options: tools.ozone.setting.defs.Option[]; 25 + }; 26 + }
+14
packages/emitter/test/integration/atproto/input/tools/ozone/setting/removeOptions.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.setting.removeOptions { 4 + @doc("Delete settings by key") 5 + @procedure 6 + op main(input: { 7 + @minItems(1) 8 + @maxItems(200) 9 + @required 10 + keys: nsid[]; 11 + 12 + @required scope: "instance" | "personal" | string; 13 + }): {}; 14 + }
+25
packages/emitter/test/integration/atproto/input/tools/ozone/setting/upsertOption.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.setting.upsertOption { 4 + @doc("Create or update setting option") 5 + @procedure 6 + op main(input: { 7 + @required key: nsid; 8 + 9 + @required scope: "instance" | "personal" | string; 10 + 11 + @required value: unknown; 12 + 13 + @maxLength(2000) 14 + description?: string; 15 + 16 + managerRole?: 17 + | "tools.ozone.team.defs#roleModerator" 18 + | "tools.ozone.team.defs#roleTriage" 19 + | "tools.ozone.team.defs#roleVerifier" 20 + | "tools.ozone.team.defs#roleAdmin" 21 + | string; 22 + }): { 23 + @required option: tools.ozone.setting.defs.Option; 24 + }; 25 + }
+9
packages/emitter/test/integration/atproto/input/tools/ozone/signature/findCorrelation.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.signature.findCorrelation { 4 + @doc("Find all correlated threat signatures between 2 or more accounts.") 5 + @query 6 + op main(@required dids: did[]): { 7 + @required details: tools.ozone.signature.defs.SigDetail[]; 8 + }; 9 + }
+25
packages/emitter/test/integration/atproto/input/tools/ozone/signature/findRelatedAccounts.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.signature.findRelatedAccounts { 4 + @doc("Get accounts that share some matching threat signatures with the root account.") 5 + @query 6 + op main( 7 + @required did: did, 8 + 9 + cursor?: string, 10 + 11 + @minValue(1) 12 + @maxValue(100) 13 + limit?: int32 = 50 14 + ): { 15 + cursor?: string; 16 + 17 + @required accounts: RelatedAccount[]; 18 + }; 19 + 20 + model RelatedAccount { 21 + @required account: com.atproto.admin.defs.AccountView; 22 + 23 + similarities?: tools.ozone.signature.defs.SigDetail[]; 24 + } 25 + }
+19
packages/emitter/test/integration/atproto/input/tools/ozone/signature/searchAccounts.tsp
···
··· 1 + import "@tlex/emitter"; 2 + 3 + namespace tools.ozone.signature.searchAccounts { 4 + @doc("Search for accounts that match one or more threat signature values.") 5 + @query 6 + op main( 7 + @required values: string[], 8 + 9 + cursor?: string, 10 + 11 + @minValue(1) 12 + @maxValue(100) 13 + limit?: int32 = 50 14 + ): { 15 + cursor?: string; 16 + 17 + @required accounts: com.atproto.admin.defs.AccountView[]; 18 + }; 19 + }