a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm
101
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(lexicon-community): initial commit

Mary b9457952 0f9a1da7

+1011
+1
README.md
··· 46 46 | [`bluemoji`](./packages/definitions/bluemoji): `blue.moji.*` schema definitions | 47 47 | [`bluesky`](./packages/definitions/bluesky): `app.bsky.*` and `chat.bsky.*` schema definitions | 48 48 | [`frontpage`](./packages/definitions/frontpage): `fyi.unravel.frontpage.*` schema definitions | 49 + | [`lexicon-community`](./packages/definitions/lexicon-community): `community.lexicon.*` schema definitions | 49 50 | [`ozone`](./packages/definitions/ozone): `tools.ozone.*` schema definitions | 50 51 | [`tangled`](./packages/definitions/tangled): `sh.tangled.*` schema definitions | 51 52 | [`whitewind`](./packages/definitions/whitewind): `com.whtwnd.*` schema definitions |
+1
lexdocs/lexcom/README.md
··· 1 + https://github.com/lexicon-community/lexicon/tree/1a8b319c00b2b57bf2cd5b011e7c0ce9bcafac0e/schema
+32
lexdocs/lexcom/bookmarks/bookmark.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "community.lexicon.bookmarks.bookmark", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Record bookmarking a link to come back to later.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["subject", "createdAt"], 12 + "properties": { 13 + "subject": { 14 + "type": "string", 15 + "format": "uri" 16 + }, 17 + "createdAt": { 18 + "type": "string", 19 + "format": "datetime" 20 + }, 21 + "tags": { 22 + "type": "array", 23 + "description": "Tags for content the bookmark may be related to, for example 'news' or 'funny videos'", 24 + "items": { 25 + "type": "string" 26 + } 27 + } 28 + } 29 + } 30 + } 31 + } 32 + }
+49
lexdocs/lexcom/bookmarks/getActorBookmarks.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "community.lexicon.bookmarks.getActorBookmarks", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get a list of bookmarks by actor. Optionally add a list of tags to include, default will be all bookmarks. Requires auth, actor must be the requesting account.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "tags": { 12 + "type": "array", 13 + "items": { 14 + "type": "string" 15 + } 16 + }, 17 + "limit": { 18 + "type": "integer", 19 + "minimum": 1, 20 + "maximum": 100, 21 + "default": 50 22 + }, 23 + "cursor": { 24 + "type": "string" 25 + } 26 + } 27 + }, 28 + "output": { 29 + "encoding": "application/json", 30 + "schema": { 31 + "type": "object", 32 + "required": ["bookmarks"], 33 + "properties": { 34 + "cursor": { 35 + "type": "string" 36 + }, 37 + "bookmarks": { 38 + "type": "array", 39 + "items": { 40 + "type": "ref", 41 + "ref": "community.lexicon.bookmarks.bookmark" 42 + } 43 + } 44 + } 45 + } 46 + } 47 + } 48 + } 49 + }
+141
lexdocs/lexcom/calendar/event.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "community.lexicon.calendar.event", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A calendar event.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["createdAt", "name"], 12 + "properties": { 13 + "name": { 14 + "type": "string", 15 + "description": "The name of the event." 16 + }, 17 + "description": { 18 + "type": "string", 19 + "description": "The description of the event." 20 + }, 21 + "createdAt": { 22 + "type": "string", 23 + "format": "datetime", 24 + "description": "Client-declared timestamp when the event was created." 25 + }, 26 + "startsAt": { 27 + "type": "string", 28 + "format": "datetime", 29 + "description": "Client-declared timestamp when the event starts." 30 + }, 31 + "endsAt": { 32 + "type": "string", 33 + "format": "datetime", 34 + "description": "Client-declared timestamp when the event ends." 35 + }, 36 + "mode": { 37 + "type": "ref", 38 + "ref": "community.lexicon.calendar.event#mode", 39 + "description": "The attendance mode of the event." 40 + }, 41 + "status": { 42 + "type": "ref", 43 + "ref": "community.lexicon.calendar.event#status", 44 + "description": "The status of the event." 45 + }, 46 + "locations": { 47 + "type": "array", 48 + "description": "The locations where the event takes place.", 49 + "items": { 50 + "type": "union", 51 + "refs": [ 52 + "community.lexicon.calendar.event#uri", 53 + "community.lexicon.location.address", 54 + "community.lexicon.location.fsq", 55 + "community.lexicon.location.geo", 56 + "community.lexicon.location.hthree" 57 + ] 58 + } 59 + }, 60 + "uris": { 61 + "type": "array", 62 + "description": "URIs associated with the event.", 63 + "items": { 64 + "type": "ref", 65 + "ref": "community.lexicon.calendar.event#uri" 66 + } 67 + } 68 + } 69 + } 70 + }, 71 + "mode": { 72 + "type": "string", 73 + "description": "The mode of the event.", 74 + "default": "community.lexicon.calendar.event#inperson", 75 + "knownValues": [ 76 + "community.lexicon.calendar.event#hybrid", 77 + "community.lexicon.calendar.event#inperson", 78 + "community.lexicon.calendar.event#virtual" 79 + ] 80 + }, 81 + "virtual": { 82 + "type": "token", 83 + "description": "A virtual event that takes place online." 84 + }, 85 + "inperson": { 86 + "type": "token", 87 + "description": "An in-person event that takes place offline." 88 + }, 89 + "hybrid": { 90 + "type": "token", 91 + "description": "A hybrid event that takes place both online and offline." 92 + }, 93 + "status": { 94 + "type": "string", 95 + "description": "The status of the event.", 96 + "default": "community.lexicon.calendar.event#scheduled", 97 + "knownValues": [ 98 + "community.lexicon.calendar.event#cancelled", 99 + "community.lexicon.calendar.event#planned", 100 + "community.lexicon.calendar.event#postponed", 101 + "community.lexicon.calendar.event#rescheduled", 102 + "community.lexicon.calendar.event#scheduled" 103 + ] 104 + }, 105 + "planned": { 106 + "type": "token", 107 + "description": "The event has been created, but not finalized." 108 + }, 109 + "scheduled": { 110 + "type": "token", 111 + "description": "The event has been created and scheduled." 112 + }, 113 + "rescheduled": { 114 + "type": "token", 115 + "description": "The event has been rescheduled." 116 + }, 117 + "cancelled": { 118 + "type": "token", 119 + "description": "The event has been cancelled." 120 + }, 121 + "postponed": { 122 + "type": "token", 123 + "description": "The event has been postponed and a new start date has not been set." 124 + }, 125 + "uri": { 126 + "type": "object", 127 + "description": "A URI associated with the event.", 128 + "required": ["uri"], 129 + "properties": { 130 + "uri": { 131 + "type": "string", 132 + "format": "uri" 133 + }, 134 + "name": { 135 + "type": "string", 136 + "description": "The display name of the URI." 137 + } 138 + } 139 + } 140 + } 141 + }
+42
lexdocs/lexcom/calendar/rsvp.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "community.lexicon.calendar.rsvp", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "An RSVP for an event.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["subject", "status"], 12 + "properties": { 13 + "subject": { 14 + "type": "ref", 15 + "ref": "com.atproto.repo.strongRef" 16 + }, 17 + "status": { 18 + "type": "string", 19 + "default": "community.lexicon.calendar.rsvp#going", 20 + "knownValues": [ 21 + "community.lexicon.calendar.rsvp#interested", 22 + "community.lexicon.calendar.rsvp#going", 23 + "community.lexicon.calendar.rsvp#notgoing" 24 + ] 25 + } 26 + } 27 + } 28 + }, 29 + "interested": { 30 + "type": "token", 31 + "description": "Interested in the event" 32 + }, 33 + "going": { 34 + "type": "token", 35 + "description": "Going to the event" 36 + }, 37 + "notgoing": { 38 + "type": "token", 39 + "description": "Not going to the event" 40 + } 41 + } 42 + }
+25
lexdocs/lexcom/interaction/like.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "community.lexicon.interaction.like", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A 'like' interaction with another AT Protocol record.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": ["subject", "createdAt"], 12 + "properties": { 13 + "subject": { 14 + "type": "ref", 15 + "ref": "com.atproto.repo.strongRef" 16 + }, 17 + "createdAt": { 18 + "type": "string", 19 + "format": "datetime" 20 + } 21 + } 22 + } 23 + } 24 + } 25 + }
+39
lexdocs/lexcom/location/address.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "community.lexicon.location.address", 4 + "defs": { 5 + "main": { 6 + "type": "object", 7 + "description": "A physical location in the form of a street address.", 8 + "required": ["country"], 9 + "properties": { 10 + "country": { 11 + "type": "string", 12 + "description": "The ISO 3166 country code. Preferably the 2-letter code.", 13 + "minLength": 2, 14 + "maxLength": 10 15 + }, 16 + "postalCode": { 17 + "type": "string", 18 + "description": "The postal code of the location." 19 + }, 20 + "region": { 21 + "type": "string", 22 + "description": "The administrative region of the country. For example, a state in the USA." 23 + }, 24 + "locality": { 25 + "type": "string", 26 + "description": "The locality of the region. For example, a city in the USA." 27 + }, 28 + "street": { 29 + "type": "string", 30 + "description": "The street address." 31 + }, 32 + "name": { 33 + "type": "string", 34 + "description": "The name of the location." 35 + } 36 + } 37 + } 38 + } 39 + }
+27
lexdocs/lexcom/location/fsq.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "community.lexicon.location.fsq", 4 + "defs": { 5 + "main": { 6 + "type": "object", 7 + "description": "A physical location contained in the Foursquare Open Source Places dataset.", 8 + "required": ["fsq_place_id"], 9 + "properties": { 10 + "fsq_place_id": { 11 + "type": "string", 12 + "description": "The unique identifier of a Foursquare POI." 13 + }, 14 + "latitude": { 15 + "type": "string" 16 + }, 17 + "longitude": { 18 + "type": "string" 19 + }, 20 + "name": { 21 + "type": "string", 22 + "description": "The name of the location." 23 + } 24 + } 25 + } 26 + } 27 + }
+26
lexdocs/lexcom/location/geo.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "community.lexicon.location.geo", 4 + "defs": { 5 + "main": { 6 + "type": "object", 7 + "description": "A physical location in the form of a WGS84 coordinate.", 8 + "required": ["latitude", "longitude"], 9 + "properties": { 10 + "latitude": { 11 + "type": "string" 12 + }, 13 + "longitude": { 14 + "type": "string" 15 + }, 16 + "altitude": { 17 + "type": "string" 18 + }, 19 + "name": { 20 + "type": "string", 21 + "description": "The name of the location." 22 + } 23 + } 24 + } 25 + } 26 + }
+21
lexdocs/lexcom/location/hthree.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "community.lexicon.location.hthree", 4 + "defs": { 5 + "main": { 6 + "type": "object", 7 + "description": "A physical location in the form of a H3 encoded location.", 8 + "required": ["value"], 9 + "properties": { 10 + "value": { 11 + "type": "string", 12 + "description": "The h3 encoded location." 13 + }, 14 + "name": { 15 + "type": "string", 16 + "description": "The name of the location." 17 + } 18 + } 19 + } 20 + } 21 + }
+1
package.json
··· 5 5 "pull": "node ./scripts/pull-lexicons.js", 6 6 "pull:bluemoji": "node ./scripts/pull-bluemoji-lexicons.js", 7 7 "pull:frontpage": "node ./scripts/pull-frontpage-lexicons.js", 8 + "pull:lexcom": "node ./scripts/pull-lexcom-lexicons.js", 8 9 "pull:tangled": "node ./scripts/pull-tangled-lexicons.js", 9 10 "pull:whtwnd": "node ./scripts/pull-whtwnd-lexicons.js", 10 11 "fmt": "prettier --cache --write ."
+60
packages/definitions/lexicon-community/README.md
··· 1 + # @atcute/lexicon-community 2 + 3 + [Lexicon Community](https://github.com/lexicon-community/lexicon) (community.lexicon.\*) schema 4 + definitions 5 + 6 + ## usage 7 + 8 + ```ts 9 + import { CommunityLexiconCalendarEvent } from '@atcute/lexicon-community'; 10 + import { is } from '@atcute/lexicons'; 11 + 12 + const record: CommunityLexiconCalendarEvent.Main = { 13 + $type: 'community.lexicon.calendar.event', 14 + name: 'DoD Stammtisch May 2025', 15 + description: 'The last Stammtisch before @protocol.berlin v2', 16 + status: 'community.lexicon.calendar.event#scheduled', 17 + mode: 'community.lexicon.calendar.event#inperson', 18 + startsAt: '2025-05-21T17:00:00.000Z', 19 + createdAt: '2025-05-14T23:13:18.129Z', 20 + locations: [ 21 + { 22 + $type: 'community.lexicon.location.address', 23 + name: '@c-base.org', 24 + country: 'DE', 25 + locality: 'Berlin', 26 + region: 'Berlin', 27 + street: 'Rungestrasse 20', 28 + postalCode: '10179', 29 + }, 30 + ], 31 + }; 32 + 33 + is(CommunityLexiconCalendarEvent.mainSchema, record); 34 + // -> true 35 + ``` 36 + 37 + ### with `@atcute/client` 38 + 39 + pick either one of these 3 options to register the ambient declarations 40 + 41 + ```jsonc 42 + // tsconfig.json 43 + { 44 + "compilerOptions": { 45 + "types": ["@atcute/lexicon-community"], 46 + }, 47 + } 48 + ``` 49 + 50 + ```ts 51 + // env.d.ts 52 + /// <reference types="@atcute/lexicon-community" /> 53 + ``` 54 + 55 + ```ts 56 + // index.ts 57 + import type {} from '@atcute/lexicon-community'; 58 + ``` 59 + 60 + now all the XRPC operations should be visible in the client
+15
packages/definitions/lexicon-community/lex.config.js
··· 1 + import { defineLexiconConfig } from '@atcute/lex-cli'; 2 + 3 + export default defineLexiconConfig({ 4 + files: ['../../../lexdocs/lexcom/**/*.json'], 5 + outdir: 'lib/lexicons/', 6 + mappings: [ 7 + { 8 + nsid: ['com.atproto.*'], 9 + imports: (nsid) => { 10 + const specifier = nsid.slice('com.atproto.'.length).replaceAll('.', '/'); 11 + return { type: 'namespace', from: `@atcute/atproto/types/${specifier}` }; 12 + }, 13 + }, 14 + ], 15 + });
+1
packages/definitions/lexicon-community/lib/index.ts
··· 1 + export * from './lexicons/index.js';
+9
packages/definitions/lexicon-community/lib/lexicons/index.ts
··· 1 + export * as CommunityLexiconBookmarksBookmark from './types/community/lexicon/bookmarks/bookmark.js'; 2 + export * as CommunityLexiconBookmarksGetActorBookmarks from './types/community/lexicon/bookmarks/getActorBookmarks.js'; 3 + export * as CommunityLexiconCalendarEvent from './types/community/lexicon/calendar/event.js'; 4 + export * as CommunityLexiconCalendarRsvp from './types/community/lexicon/calendar/rsvp.js'; 5 + export * as CommunityLexiconInteractionLike from './types/community/lexicon/interaction/like.js'; 6 + export * as CommunityLexiconLocationAddress from './types/community/lexicon/location/address.js'; 7 + export * as CommunityLexiconLocationFsq from './types/community/lexicon/location/fsq.js'; 8 + export * as CommunityLexiconLocationGeo from './types/community/lexicon/location/geo.js'; 9 + export * as CommunityLexiconLocationHthree from './types/community/lexicon/location/hthree.js';
+27
packages/definitions/lexicon-community/lib/lexicons/types/community/lexicon/bookmarks/bookmark.ts
··· 1 + import type {} from '@atcute/lexicons'; 2 + import * as v from '@atcute/lexicons/validations'; 3 + import type {} from '@atcute/lexicons/ambient'; 4 + 5 + const _mainSchema = /*#__PURE__*/ v.record( 6 + /*#__PURE__*/ v.tidString(), 7 + /*#__PURE__*/ v.object({ 8 + $type: /*#__PURE__*/ v.literal('community.lexicon.bookmarks.bookmark'), 9 + subject: /*#__PURE__*/ v.genericUriString(), 10 + createdAt: /*#__PURE__*/ v.datetimeString(), 11 + tags: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.array(/*#__PURE__*/ v.string())), 12 + }), 13 + ); 14 + 15 + type main$schematype = typeof _mainSchema; 16 + 17 + export interface mainSchema extends main$schematype {} 18 + 19 + export const mainSchema = _mainSchema as mainSchema; 20 + 21 + export interface Main extends v.InferInput<typeof mainSchema> {} 22 + 23 + declare module '@atcute/lexicons/ambient' { 24 + interface Records { 25 + 'community.lexicon.bookmarks.bookmark': mainSchema; 26 + } 27 + }
+36
packages/definitions/lexicon-community/lib/lexicons/types/community/lexicon/bookmarks/getActorBookmarks.ts
··· 1 + import type {} from '@atcute/lexicons'; 2 + import * as v from '@atcute/lexicons/validations'; 3 + import type {} from '@atcute/lexicons/ambient'; 4 + import * as CommunityLexiconBookmarksBookmark from './bookmark.js'; 5 + 6 + const _mainSchema = /*#__PURE__*/ v.query('community.lexicon.bookmarks.getActorBookmarks', { 7 + params: /*#__PURE__*/ v.object({ 8 + tags: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.array(/*#__PURE__*/ v.string())), 9 + limit: /*#__PURE__*/ v.optional( 10 + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [/*#__PURE__*/ v.integerRange(1, 100)]), 11 + 50, 12 + ), 13 + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 14 + }), 15 + output: { 16 + type: 'lex', 17 + schema: /*#__PURE__*/ v.object({ 18 + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 19 + get bookmarks() { 20 + return /*#__PURE__*/ v.array(CommunityLexiconBookmarksBookmark.mainSchema); 21 + }, 22 + }), 23 + }, 24 + }); 25 + 26 + type main$schematype = typeof _mainSchema; 27 + 28 + export interface mainSchema extends main$schematype {} 29 + 30 + export const mainSchema = _mainSchema as mainSchema; 31 + 32 + declare module '@atcute/lexicons/ambient' { 33 + interface XRPCQueries { 34 + 'community.lexicon.bookmarks.getActorBookmarks': mainSchema; 35 + } 36 + }
+132
packages/definitions/lexicon-community/lib/lexicons/types/community/lexicon/calendar/event.ts
··· 1 + import type {} from '@atcute/lexicons'; 2 + import * as v from '@atcute/lexicons/validations'; 3 + import type {} from '@atcute/lexicons/ambient'; 4 + import * as CommunityLexiconLocationAddress from '../location/address.js'; 5 + import * as CommunityLexiconLocationFsq from '../location/fsq.js'; 6 + import * as CommunityLexiconLocationGeo from '../location/geo.js'; 7 + import * as CommunityLexiconLocationHthree from '../location/hthree.js'; 8 + 9 + const _cancelledSchema = /*#__PURE__*/ v.literal('community.lexicon.calendar.event#cancelled'); 10 + const _hybridSchema = /*#__PURE__*/ v.literal('community.lexicon.calendar.event#hybrid'); 11 + const _inpersonSchema = /*#__PURE__*/ v.literal('community.lexicon.calendar.event#inperson'); 12 + const _mainSchema = /*#__PURE__*/ v.record( 13 + /*#__PURE__*/ v.tidString(), 14 + /*#__PURE__*/ v.object({ 15 + $type: /*#__PURE__*/ v.literal('community.lexicon.calendar.event'), 16 + name: /*#__PURE__*/ v.string(), 17 + description: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 18 + createdAt: /*#__PURE__*/ v.datetimeString(), 19 + startsAt: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.datetimeString()), 20 + endsAt: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.datetimeString()), 21 + get mode() { 22 + return /*#__PURE__*/ v.optional(modeSchema); 23 + }, 24 + get status() { 25 + return /*#__PURE__*/ v.optional(statusSchema); 26 + }, 27 + get locations() { 28 + return /*#__PURE__*/ v.optional( 29 + /*#__PURE__*/ v.array( 30 + /*#__PURE__*/ v.variant([ 31 + uriSchema, 32 + CommunityLexiconLocationAddress.mainSchema, 33 + CommunityLexiconLocationFsq.mainSchema, 34 + CommunityLexiconLocationGeo.mainSchema, 35 + CommunityLexiconLocationHthree.mainSchema, 36 + ]), 37 + ), 38 + ); 39 + }, 40 + get uris() { 41 + return /*#__PURE__*/ v.optional(/*#__PURE__*/ v.array(uriSchema)); 42 + }, 43 + }), 44 + ); 45 + const _modeSchema = /*#__PURE__*/ v.optional( 46 + /*#__PURE__*/ v.string< 47 + | 'community.lexicon.calendar.event#hybrid' 48 + | 'community.lexicon.calendar.event#inperson' 49 + | 'community.lexicon.calendar.event#virtual' 50 + | (string & {}) 51 + >(), 52 + 'community.lexicon.calendar.event#inperson', 53 + ); 54 + const _plannedSchema = /*#__PURE__*/ v.literal('community.lexicon.calendar.event#planned'); 55 + const _postponedSchema = /*#__PURE__*/ v.literal('community.lexicon.calendar.event#postponed'); 56 + const _rescheduledSchema = /*#__PURE__*/ v.literal('community.lexicon.calendar.event#rescheduled'); 57 + const _scheduledSchema = /*#__PURE__*/ v.literal('community.lexicon.calendar.event#scheduled'); 58 + const _statusSchema = /*#__PURE__*/ v.optional( 59 + /*#__PURE__*/ v.string< 60 + | 'community.lexicon.calendar.event#cancelled' 61 + | 'community.lexicon.calendar.event#planned' 62 + | 'community.lexicon.calendar.event#postponed' 63 + | 'community.lexicon.calendar.event#rescheduled' 64 + | 'community.lexicon.calendar.event#scheduled' 65 + | (string & {}) 66 + >(), 67 + 'community.lexicon.calendar.event#scheduled', 68 + ); 69 + const _uriSchema = /*#__PURE__*/ v.object({ 70 + $type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('community.lexicon.calendar.event#uri')), 71 + uri: /*#__PURE__*/ v.genericUriString(), 72 + name: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 73 + }); 74 + const _virtualSchema = /*#__PURE__*/ v.literal('community.lexicon.calendar.event#virtual'); 75 + 76 + type cancelled$schematype = typeof _cancelledSchema; 77 + type hybrid$schematype = typeof _hybridSchema; 78 + type inperson$schematype = typeof _inpersonSchema; 79 + type main$schematype = typeof _mainSchema; 80 + type mode$schematype = typeof _modeSchema; 81 + type planned$schematype = typeof _plannedSchema; 82 + type postponed$schematype = typeof _postponedSchema; 83 + type rescheduled$schematype = typeof _rescheduledSchema; 84 + type scheduled$schematype = typeof _scheduledSchema; 85 + type status$schematype = typeof _statusSchema; 86 + type uri$schematype = typeof _uriSchema; 87 + type virtual$schematype = typeof _virtualSchema; 88 + 89 + export interface cancelledSchema extends cancelled$schematype {} 90 + export interface hybridSchema extends hybrid$schematype {} 91 + export interface inpersonSchema extends inperson$schematype {} 92 + export interface mainSchema extends main$schematype {} 93 + export interface modeSchema extends mode$schematype {} 94 + export interface plannedSchema extends planned$schematype {} 95 + export interface postponedSchema extends postponed$schematype {} 96 + export interface rescheduledSchema extends rescheduled$schematype {} 97 + export interface scheduledSchema extends scheduled$schematype {} 98 + export interface statusSchema extends status$schematype {} 99 + export interface uriSchema extends uri$schematype {} 100 + export interface virtualSchema extends virtual$schematype {} 101 + 102 + export const cancelledSchema = _cancelledSchema as cancelledSchema; 103 + export const hybridSchema = _hybridSchema as hybridSchema; 104 + export const inpersonSchema = _inpersonSchema as inpersonSchema; 105 + export const mainSchema = _mainSchema as mainSchema; 106 + export const modeSchema = _modeSchema as modeSchema; 107 + export const plannedSchema = _plannedSchema as plannedSchema; 108 + export const postponedSchema = _postponedSchema as postponedSchema; 109 + export const rescheduledSchema = _rescheduledSchema as rescheduledSchema; 110 + export const scheduledSchema = _scheduledSchema as scheduledSchema; 111 + export const statusSchema = _statusSchema as statusSchema; 112 + export const uriSchema = _uriSchema as uriSchema; 113 + export const virtualSchema = _virtualSchema as virtualSchema; 114 + 115 + export type Cancelled = v.InferInput<typeof cancelledSchema>; 116 + export type Hybrid = v.InferInput<typeof hybridSchema>; 117 + export type Inperson = v.InferInput<typeof inpersonSchema>; 118 + export interface Main extends v.InferInput<typeof mainSchema> {} 119 + export type Mode = v.InferInput<typeof modeSchema>; 120 + export type Planned = v.InferInput<typeof plannedSchema>; 121 + export type Postponed = v.InferInput<typeof postponedSchema>; 122 + export type Rescheduled = v.InferInput<typeof rescheduledSchema>; 123 + export type Scheduled = v.InferInput<typeof scheduledSchema>; 124 + export type Status = v.InferInput<typeof statusSchema>; 125 + export interface Uri extends v.InferInput<typeof uriSchema> {} 126 + export type Virtual = v.InferInput<typeof virtualSchema>; 127 + 128 + declare module '@atcute/lexicons/ambient' { 129 + interface Records { 130 + 'community.lexicon.calendar.event': mainSchema; 131 + } 132 + }
+52
packages/definitions/lexicon-community/lib/lexicons/types/community/lexicon/calendar/rsvp.ts
··· 1 + import type {} from '@atcute/lexicons'; 2 + import * as v from '@atcute/lexicons/validations'; 3 + import type {} from '@atcute/lexicons/ambient'; 4 + import * as ComAtprotoRepoStrongRef from '@atcute/atproto/types/repo/strongRef'; 5 + 6 + const _goingSchema = /*#__PURE__*/ v.literal('community.lexicon.calendar.rsvp#going'); 7 + const _interestedSchema = /*#__PURE__*/ v.literal('community.lexicon.calendar.rsvp#interested'); 8 + const _mainSchema = /*#__PURE__*/ v.record( 9 + /*#__PURE__*/ v.tidString(), 10 + /*#__PURE__*/ v.object({ 11 + $type: /*#__PURE__*/ v.literal('community.lexicon.calendar.rsvp'), 12 + get subject() { 13 + return ComAtprotoRepoStrongRef.mainSchema; 14 + }, 15 + status: /*#__PURE__*/ v.optional( 16 + /*#__PURE__*/ v.string< 17 + | 'community.lexicon.calendar.rsvp#interested' 18 + | 'community.lexicon.calendar.rsvp#going' 19 + | 'community.lexicon.calendar.rsvp#notgoing' 20 + | (string & {}) 21 + >(), 22 + 'community.lexicon.calendar.rsvp#going', 23 + ), 24 + }), 25 + ); 26 + const _notgoingSchema = /*#__PURE__*/ v.literal('community.lexicon.calendar.rsvp#notgoing'); 27 + 28 + type going$schematype = typeof _goingSchema; 29 + type interested$schematype = typeof _interestedSchema; 30 + type main$schematype = typeof _mainSchema; 31 + type notgoing$schematype = typeof _notgoingSchema; 32 + 33 + export interface goingSchema extends going$schematype {} 34 + export interface interestedSchema extends interested$schematype {} 35 + export interface mainSchema extends main$schematype {} 36 + export interface notgoingSchema extends notgoing$schematype {} 37 + 38 + export const goingSchema = _goingSchema as goingSchema; 39 + export const interestedSchema = _interestedSchema as interestedSchema; 40 + export const mainSchema = _mainSchema as mainSchema; 41 + export const notgoingSchema = _notgoingSchema as notgoingSchema; 42 + 43 + export type Going = v.InferInput<typeof goingSchema>; 44 + export type Interested = v.InferInput<typeof interestedSchema>; 45 + export interface Main extends v.InferInput<typeof mainSchema> {} 46 + export type Notgoing = v.InferInput<typeof notgoingSchema>; 47 + 48 + declare module '@atcute/lexicons/ambient' { 49 + interface Records { 50 + 'community.lexicon.calendar.rsvp': mainSchema; 51 + } 52 + }
+29
packages/definitions/lexicon-community/lib/lexicons/types/community/lexicon/interaction/like.ts
··· 1 + import type {} from '@atcute/lexicons'; 2 + import * as v from '@atcute/lexicons/validations'; 3 + import type {} from '@atcute/lexicons/ambient'; 4 + import * as ComAtprotoRepoStrongRef from '@atcute/atproto/types/repo/strongRef'; 5 + 6 + const _mainSchema = /*#__PURE__*/ v.record( 7 + /*#__PURE__*/ v.tidString(), 8 + /*#__PURE__*/ v.object({ 9 + $type: /*#__PURE__*/ v.literal('community.lexicon.interaction.like'), 10 + get subject() { 11 + return ComAtprotoRepoStrongRef.mainSchema; 12 + }, 13 + createdAt: /*#__PURE__*/ v.datetimeString(), 14 + }), 15 + ); 16 + 17 + type main$schematype = typeof _mainSchema; 18 + 19 + export interface mainSchema extends main$schematype {} 20 + 21 + export const mainSchema = _mainSchema as mainSchema; 22 + 23 + export interface Main extends v.InferInput<typeof mainSchema> {} 24 + 25 + declare module '@atcute/lexicons/ambient' { 26 + interface Records { 27 + 'community.lexicon.interaction.like': mainSchema; 28 + } 29 + }
+20
packages/definitions/lexicon-community/lib/lexicons/types/community/lexicon/location/address.ts
··· 1 + import type {} from '@atcute/lexicons'; 2 + import * as v from '@atcute/lexicons/validations'; 3 + 4 + const _mainSchema = /*#__PURE__*/ v.object({ 5 + $type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('community.lexicon.location.address')), 6 + country: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [/*#__PURE__*/ v.stringLength(2, 10)]), 7 + postalCode: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 8 + region: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 9 + locality: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 10 + street: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 11 + name: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 12 + }); 13 + 14 + type main$schematype = typeof _mainSchema; 15 + 16 + export interface mainSchema extends main$schematype {} 17 + 18 + export const mainSchema = _mainSchema as mainSchema; 19 + 20 + export interface Main extends v.InferInput<typeof mainSchema> {}
+18
packages/definitions/lexicon-community/lib/lexicons/types/community/lexicon/location/fsq.ts
··· 1 + import type {} from '@atcute/lexicons'; 2 + import * as v from '@atcute/lexicons/validations'; 3 + 4 + const _mainSchema = /*#__PURE__*/ v.object({ 5 + $type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('community.lexicon.location.fsq')), 6 + fsq_place_id: /*#__PURE__*/ v.string(), 7 + latitude: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 8 + longitude: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 9 + name: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 10 + }); 11 + 12 + type main$schematype = typeof _mainSchema; 13 + 14 + export interface mainSchema extends main$schematype {} 15 + 16 + export const mainSchema = _mainSchema as mainSchema; 17 + 18 + export interface Main extends v.InferInput<typeof mainSchema> {}
+18
packages/definitions/lexicon-community/lib/lexicons/types/community/lexicon/location/geo.ts
··· 1 + import type {} from '@atcute/lexicons'; 2 + import * as v from '@atcute/lexicons/validations'; 3 + 4 + const _mainSchema = /*#__PURE__*/ v.object({ 5 + $type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('community.lexicon.location.geo')), 6 + latitude: /*#__PURE__*/ v.string(), 7 + longitude: /*#__PURE__*/ v.string(), 8 + altitude: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 9 + name: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 10 + }); 11 + 12 + type main$schematype = typeof _mainSchema; 13 + 14 + export interface mainSchema extends main$schematype {} 15 + 16 + export const mainSchema = _mainSchema as mainSchema; 17 + 18 + export interface Main extends v.InferInput<typeof mainSchema> {}
+16
packages/definitions/lexicon-community/lib/lexicons/types/community/lexicon/location/hthree.ts
··· 1 + import type {} from '@atcute/lexicons'; 2 + import * as v from '@atcute/lexicons/validations'; 3 + 4 + const _mainSchema = /*#__PURE__*/ v.object({ 5 + $type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('community.lexicon.location.hthree')), 6 + value: /*#__PURE__*/ v.string(), 7 + name: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), 8 + }); 9 + 10 + type main$schematype = typeof _mainSchema; 11 + 12 + export interface mainSchema extends main$schematype {} 13 + 14 + export const mainSchema = _mainSchema as mainSchema; 15 + 16 + export interface Main extends v.InferInput<typeof mainSchema> {}
+34
packages/definitions/lexicon-community/package.json
··· 1 + { 2 + "type": "module", 3 + "name": "@atcute/lexicon-community", 4 + "version": "1.0.0", 5 + "description": "Lexicon Community (community.lexicon.*) schema definitions", 6 + "license": "MIT", 7 + "repository": { 8 + "url": "https://github.com/mary-ext/atcute", 9 + "directory": "packages/definitions/lexicon-community" 10 + }, 11 + "files": [ 12 + "dist/", 13 + "lib/", 14 + "!lib/**/*.bench.ts", 15 + "!lib/**/*.test.ts" 16 + ], 17 + "exports": { 18 + ".": "./dist/index.js", 19 + "./types/": "./dist/lexicons/types/community/lexicon/*.js" 20 + }, 21 + "scripts": { 22 + "build": "tsc", 23 + "generate": "rm -r ./lib/lexicons/; lex-cli generate -c ./lex.config.js", 24 + "prepublish": "rm -rf dist; pnpm run build" 25 + }, 26 + "dependencies": { 27 + "@atcute/atproto": "workspace:^", 28 + "@atcute/lexicons": "workspace:^" 29 + }, 30 + "devDependencies": { 31 + "@atcute/lexicon-community": "file:", 32 + "@atcute/lex-cli": "workspace:^" 33 + } 34 + }
+22
packages/definitions/lexicon-community/tsconfig.json
··· 1 + { 2 + "compilerOptions": { 3 + "outDir": "dist/", 4 + "esModuleInterop": true, 5 + "skipLibCheck": true, 6 + "target": "ESNext", 7 + "allowJs": true, 8 + "resolveJsonModule": true, 9 + "moduleDetection": "force", 10 + "isolatedModules": true, 11 + "verbatimModuleSyntax": true, 12 + "strict": true, 13 + "noImplicitOverride": true, 14 + "noUnusedLocals": true, 15 + "noUnusedParameters": true, 16 + "noFallthroughCasesInSwitch": true, 17 + "module": "NodeNext", 18 + "sourceMap": true, 19 + "declaration": true, 20 + }, 21 + "include": ["lib"], 22 + }
+24
pnpm-lock.yaml
··· 247 247 specifier: ^3.1.3 248 248 version: 3.1.3(@types/node@22.15.17) 249 249 250 + packages/definitions/lexicon-community: 251 + dependencies: 252 + '@atcute/atproto': 253 + specifier: workspace:^ 254 + version: link:../atproto 255 + '@atcute/lexicons': 256 + specifier: workspace:^ 257 + version: link:../../lexicons/lexicons 258 + devDependencies: 259 + '@atcute/lex-cli': 260 + specifier: workspace:^ 261 + version: link:../../lexicons/lex-cli 262 + '@atcute/lexicon-community': 263 + specifier: 'file:' 264 + version: file:packages/definitions/lexicon-community 265 + 250 266 packages/definitions/ozone: 251 267 dependencies: 252 268 '@atcute/atproto': ··· 613 629 614 630 '@atcute/frontpage@file:packages/definitions/frontpage': 615 631 resolution: {directory: packages/definitions/frontpage, type: directory} 632 + 633 + '@atcute/lexicon-community@file:packages/definitions/lexicon-community': 634 + resolution: {directory: packages/definitions/lexicon-community, type: directory} 616 635 617 636 '@atcute/ozone@file:packages/definitions/ozone': 618 637 resolution: {directory: packages/definitions/ozone, type: directory} ··· 3342 3361 '@atcute/lexicons': link:packages/lexicons/lexicons 3343 3362 3344 3363 '@atcute/frontpage@file:packages/definitions/frontpage': 3364 + dependencies: 3365 + '@atcute/atproto': link:packages/definitions/atproto 3366 + '@atcute/lexicons': link:packages/lexicons/lexicons 3367 + 3368 + '@atcute/lexicon-community@file:packages/definitions/lexicon-community': 3345 3369 dependencies: 3346 3370 '@atcute/atproto': link:packages/definitions/atproto 3347 3371 '@atcute/lexicons': link:packages/lexicons/lexicons
+93
scripts/pull-lexcom-lexicons.js
··· 1 + import * as path from 'node:path'; 2 + import * as fs from 'node:fs/promises'; 3 + 4 + import { untar } from '@mary/tar'; 5 + import prettier from 'prettier'; 6 + 7 + const repo = `lexicon-community/lexicon`; 8 + 9 + async function main() { 10 + const config = await prettier.resolveConfig(process.cwd() + '/foo', { editorconfig: true }); 11 + 12 + let sha; 13 + { 14 + console.log(`retrieving latest commit`); 15 + const response = await fetch(`https://api.github.com/repos/${repo}/commits?path=community/lexicon/`); 16 + 17 + if (!response.ok) { 18 + console.log(` response error ${response.status}`); 19 + return; 20 + } 21 + 22 + const json = await response.json(); 23 + const latest = json[0]; 24 + 25 + if (!latest) { 26 + console.log(` latest commit missing?`); 27 + return; 28 + } 29 + 30 + sha = latest.sha; 31 + console.log(` got ${sha}`); 32 + } 33 + 34 + const tmpdir = `lexicons-tmp/`; 35 + 36 + { 37 + console.log(`retrieving zip file`); 38 + const response = await fetch(`https://github.com/${repo}/archive/${sha}.tar.gz`); 39 + 40 + if (!response.ok) { 41 + console.log(` response error ${response.status}`); 42 + return; 43 + } 44 + 45 + const basename = `lexicon-${sha}/community/lexicon/`; 46 + 47 + const ds = new DecompressionStream('gzip'); 48 + const stream = response.body.pipeThrough(ds); 49 + 50 + const promises = []; 51 + 52 + console.log(` reading`); 53 + for await (const entry of untar(stream)) { 54 + if (entry.type === 'file' && entry.name.startsWith(basename) && entry.name.endsWith('.json')) { 55 + const name = entry.name.slice(basename.length); 56 + const basedir = tmpdir + path.dirname(name); 57 + 58 + const code = await entry.text(); 59 + 60 + const promise = (async () => { 61 + const formatted = await prettier.format(code, { ...config, parser: 'json' }); 62 + 63 + await fs.mkdir(basedir, { recursive: true }); 64 + await fs.writeFile(tmpdir + name, formatted); 65 + })(); 66 + 67 + promises.push(promise); 68 + } 69 + } 70 + 71 + console.log(` flushing writes`); 72 + await Promise.all(promises); 73 + } 74 + 75 + { 76 + const source = `https://github.com/${repo}/tree/${sha}/schema\n`; 77 + 78 + console.log(`writing readme file`); 79 + 80 + await fs.writeFile(tmpdir + `README.md`, source); 81 + } 82 + 83 + { 84 + const dest = `lexdocs/lexcom/`; 85 + 86 + console.log(`moving folder`); 87 + 88 + await fs.rm(dest, { recursive: true, force: true }); 89 + await fs.rename(tmpdir, dest); 90 + } 91 + } 92 + 93 + await main();