Skip to content

Commit

Permalink
rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
notjuliet committed Oct 15, 2024
1 parent 1d3a41d commit eac32ba
Show file tree
Hide file tree
Showing 19 changed files with 672 additions and 370 deletions.
3 changes: 0 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
NODE_ENV="test"
PORT=3000
DB_PATH=":memory:"
DID="did:example:123"
PASSWORD="password"
SERVICE="https://bsky.social"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
dist
.env
*.db*
cursor.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
{
"lexicon": 1,
"id": "social.psky.feed.post",
"id": "social.psky.chat.message",
"defs": {
"main": {
"type": "record",
"description": "A Picosky post containing at most 256 graphemes.",
"description": "A Picosky message containing at most 2048 graphemes.",
"key": "tid",
"record": {
"type": "object",
"required": [
"text"
],
"required": ["content", "room"],
"properties": {
"text": {
"content": {
"type": "string",
"maxLength": 2560,
"maxGraphemes": 256,
"maxLength": 20480,
"maxGraphemes": 2048,
"description": "Text content."
},
"room": {
"type": "string",
"format": "at-uri"
},
"facets": {
"type": "array",
"description": "Annotations of text (mentions, URLs, hashtags, etc)",
Expand Down
59 changes: 59 additions & 0 deletions lexicons/social/psky/chat/room.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"lexicon": 1,
"id": "social.psky.chat.room",
"defs": {
"main": {
"type": "record",
"description": "A Picosky room belonging to the user.",
"key": "tid",
"record": {
"type": "object",
"required": ["name"],
"properties": {
"name": {
"type": "string",
"maxGraphemes": 32,
"maxLength": 320
},
"languages": {
"type": "array",
"maxLength": 3,
"items": { "type": "string", "format": "language" }
},
"topic": {
"type": "string",
"maxLength": 2560,
"maxGraphemes": 256,
"description": "Topic title of the room."
},
"tags": {
"type": "array",
"maxLength": 20,
"items": { "type": "string" }
},
"allowlist": {
"type": "ref",
"ref": "#modlistRef",
"description": "List of users allowed to send messages in the room."
},
"denylist": {
"type": "ref",
"ref": "#modlistRef",
"description": "List of users disallowed to send messages in the room."
}
}
}
},
"modlistRef": {
"type": "object",
"required": ["active", "users"],
"properties": {
"active": { "type": "boolean", "default": false },
"users": {
"type": "array",
"items": { "type": "string", "format": "did" }
}
}
}
}
}
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"lex": "npx lex-cli generate ./lexicons/social/psky/**/*.json -o ./src/lib/lexicon.ts"
},
"dependencies": {
"@atcute/client": "^2.0.3",
"@fastify/cors": "^10.0.1",
"@fastify/rate-limit": "^10.1.0",
"@fastify/websocket": "^11.0.1",
Expand Down
135 changes: 0 additions & 135 deletions src/db.ts

This file was deleted.

Loading

0 comments on commit eac32ba

Please sign in to comment.