diff --git a/.tangled/workflows/deno-deploy.yaml b/.tangled/workflows/deno-deploy.yaml new file mode 100644 index 0000000..e69de29 diff --git a/deno.json b/deno.json index 48aeb1d..05e285d 100644 --- a/deno.json +++ b/deno.json @@ -1,5 +1,6 @@ { "imports": { + "@atproto/lex": "npm:@atproto/lex@^0.0.19", "@tijs/atproto-oauth": "jsr:@tijs/atproto-oauth@^2.9.0", "@tijs/atproto-storage": "jsr:@tijs/atproto-storage@^1.0.0", "hono": "jsr:@hono/hono@^4.11.9" diff --git a/deno.lock b/deno.lock index 2ea02d6..4498bb1 100644 --- a/deno.lock +++ b/deno.lock @@ -11,6 +11,7 @@ "jsr:@tijs/atproto-storage@1": "1.0.0", "jsr:@tijs/oauth-client-deno@4.0.2": "4.0.2", "jsr:@tijs/oauth-client-deno@5.1.0": "5.1.0", + "npm:@atproto/lex@^0.0.19": "0.0.19", "npm:@atproto/syntax@0.3.0": "0.3.0", "npm:@atproto/syntax@0.4.0": "0.4.0", "npm:iron-session@8.0.4": "8.0.4" @@ -67,15 +68,327 @@ } }, "npm": { + "@atproto-labs/did-resolver@0.2.6": { + "integrity": "sha512-2K1bC04nI2fmgNcvof+yA28IhGlpWn2JKYlPa7To9JTKI45FINCGkQSGiL2nyXlyzDJJ34fZ1aq6/IRFIOIiqg==", + "dependencies": [ + "@atproto-labs/fetch", + "@atproto-labs/pipe", + "@atproto-labs/simple-store", + "@atproto-labs/simple-store-memory", + "@atproto/did", + "zod" + ] + }, + "@atproto-labs/fetch@0.2.3": { + "integrity": "sha512-NZtbJOCbxKUFRFKMpamT38PUQMY0hX0p7TG5AEYOPhZKZEP7dHZ1K2s1aB8MdVH0qxmqX7nQleNrrvLf09Zfdw==", + "dependencies": [ + "@atproto-labs/pipe" + ] + }, + "@atproto-labs/pipe@0.1.1": { + "integrity": "sha512-hdNw2oUs2B6BN1lp+32pF7cp8EMKuIN5Qok2Vvv/aOpG/3tNSJ9YkvfI0k6Zd188LeDDYRUpYpxcoFIcGH/FNg==" + }, + "@atproto-labs/simple-store-memory@0.1.4": { + "integrity": "sha512-3mKY4dP8I7yKPFj9VKpYyCRzGJOi5CEpOLPlRhoJyLmgs3J4RzDrjn323Oakjz2Aj2JzRU/AIvWRAZVhpYNJHw==", + "dependencies": [ + "@atproto-labs/simple-store", + "lru-cache" + ] + }, + "@atproto-labs/simple-store@0.3.0": { + "integrity": "sha512-nOb6ONKBRJHRlukW1sVawUkBqReLlLx6hT35VS3imaNPwiXDxLnTK7lxw3Lrl9k5yugSBDQAkZAq3MPTEFSUBQ==" + }, + "@atproto/common-web@0.4.17": { + "integrity": "sha512-sfxD8NGxyoxhxmM9EUshEFbWcJ3+JHEOZF4Quk6HsCh1UxpHBmLabT/vEsAkDWl+C/8U0ine0+c/gHyE/OZiQQ==", + "dependencies": [ + "@atproto/lex-data", + "@atproto/lex-json", + "@atproto/syntax@0.4.3", + "zod" + ] + }, + "@atproto/common@0.5.13": { + "integrity": "sha512-+5c3wlvZVCCReoPSwvkPhKz3Y2FZlJzm69BrfkHMccAH0Rs0KLwnWtoE34zyzTLNH7hhy5okx5qJS6+ZlgE9Sg==", + "dependencies": [ + "@atproto/common-web", + "@atproto/lex-cbor", + "@atproto/lex-data", + "iso-datestring-validator", + "multiformats", + "pino" + ] + }, + "@atproto/crypto@0.4.5": { + "integrity": "sha512-n40aKkMoCatP0u9Yvhrdk6fXyOHFDDbkdm4h4HCyWW+KlKl8iXfD5iV+ECq+w5BM+QH25aIpt3/j6EUNerhLxw==", + "dependencies": [ + "@noble/curves", + "@noble/hashes", + "uint8arrays" + ] + }, + "@atproto/did@0.3.0": { + "integrity": "sha512-raUPzUGegtW/6OxwCmM8bhZvuIMzxG5t9oWsth6Tp91Kb5fTnHV2h/KKNF1C82doeA4BdXCErTyg7ISwLbQkzA==", + "dependencies": [ + "zod" + ] + }, + "@atproto/lex-builder@0.0.16": { + "integrity": "sha512-z9h6kLiifyL0mBVzlHJ3cK3XwhHRttSePmk2XmhQ1gC0tfa7exUhvCMp9YpEv2N5oUVMItl00L8SLBsVsuMMtg==", + "dependencies": [ + "@atproto/lex-document", + "@atproto/lex-schema", + "prettier", + "ts-morph", + "tslib" + ] + }, + "@atproto/lex-cbor@0.0.13": { + "integrity": "sha512-63nbzXJnQwV02XGpEa8WZxt7Zu87dnbzrUVL0Mqr55S1EGCzEF9U7Dauc9tKKLoZ88GmYrJN0irBsXtSi0VeWg==", + "dependencies": [ + "@atproto/lex-data", + "tslib" + ] + }, + "@atproto/lex-client@0.0.14": { + "integrity": "sha512-AZBk1+/zN7NiLG+IFpn4tL8QjCJ/hWp8rPOIEjFZL0/roEfWxM1rVkWI5WFyDUbqCHF6S6mBjm27QEgj8k3APA==", + "dependencies": [ + "@atproto/lex-data", + "@atproto/lex-json", + "@atproto/lex-schema", + "tslib" + ] + }, + "@atproto/lex-data@0.0.12": { + "integrity": "sha512-aekJudcK1p6sbTqUv2bJMJBAGZaOJS0mgDclpK3U6VuBREK/au4B6ffunBFWgrDfg0Vwj2JGyEA7E51WZkJcRw==", + "dependencies": [ + "multiformats", + "tslib", + "uint8arrays", + "unicode-segmenter" + ] + }, + "@atproto/lex-document@0.0.14": { + "integrity": "sha512-BaCSZOZUIv3kQ23b3Lhe4sprJYHc0spSeWS3TLaMoVi6bFZ3RzeM8n7ROTzVP3BTNYxpRHPHtOarx9A8ZAAC4w==", + "dependencies": [ + "@atproto/lex-schema", + "core-js", + "tslib" + ] + }, + "@atproto/lex-installer@0.0.19": { + "integrity": "sha512-Qz7/1+q469enllsiV7AGie/pPiYML008w89tvnatHQPoZNhLNyCNlJKW7JKZ42XkS9SZGce4TebtkMaV/7zTIg==", + "dependencies": [ + "@atproto/lex-builder", + "@atproto/lex-cbor", + "@atproto/lex-data", + "@atproto/lex-document", + "@atproto/lex-resolver", + "@atproto/lex-schema", + "@atproto/syntax@0.4.3", + "tslib" + ] + }, + "@atproto/lex-json@0.0.12": { + "integrity": "sha512-XlEpnWWZdDJ5BIgG25GyH+6iBfyrFL18BI5JSE6rUfMObbFMrQRaCuRLQfryRXNysVz3L3U+Qb9y8KcXbE8AcA==", + "dependencies": [ + "@atproto/lex-data", + "tslib" + ] + }, + "@atproto/lex-resolver@0.0.16": { + "integrity": "sha512-N3Jag6uJ+sq2XIRxwtbzwWdE70oFZBi5s3tscWsU6qLPL6RzdO9/a3wtbCeNQh0uO2UlaajZTNf/UQSdjufBHg==", + "dependencies": [ + "@atproto-labs/did-resolver", + "@atproto/crypto", + "@atproto/lex-client", + "@atproto/lex-data", + "@atproto/lex-document", + "@atproto/lex-schema", + "@atproto/repo", + "@atproto/syntax@0.4.3", + "tslib" + ] + }, + "@atproto/lex-schema@0.0.13": { + "integrity": "sha512-FeY4YBesEUO4Ey3BJhDRma0cZt6XxunSZPXny5Q/6ltc7pvyJGXXtJ8D7mHl7p5EXPwylEYOQkM6ck4IyfMP0A==", + "dependencies": [ + "@atproto/lex-data", + "@atproto/syntax@0.4.3", + "tslib" + ] + }, + "@atproto/lex@0.0.19": { + "integrity": "sha512-jCd4cNIcxJk/ZSWF6dLiIFeGkoockaLbTUBUIjVkFTEz3UmeqBX2Bg6MwLLWxVqjzBTge0BLeqmrnu/cRZwl1g==", + "dependencies": [ + "@atproto/lex-builder", + "@atproto/lex-client", + "@atproto/lex-data", + "@atproto/lex-installer", + "@atproto/lex-json", + "@atproto/lex-schema", + "tslib", + "yargs" + ], + "bin": true + }, + "@atproto/lexicon@0.6.1": { + "integrity": "sha512-/vI1kVlY50Si+5MXpvOucelnYwb0UJ6Qto5mCp+7Q5C+Jtp+SoSykAPVvjVtTnQUH2vrKOFOwpb3C375vSKzXw==", + "dependencies": [ + "@atproto/common-web", + "@atproto/syntax@0.4.3", + "iso-datestring-validator", + "multiformats", + "zod" + ] + }, + "@atproto/repo@0.8.12": { + "integrity": "sha512-QpVTVulgfz5PUiCTELlDBiRvnsnwrFWi+6CfY88VwXzrRHd9NE8GItK7sfxQ6U65vD/idH8ddCgFrlrsn1REPQ==", + "dependencies": [ + "@atproto/common", + "@atproto/common-web", + "@atproto/crypto", + "@atproto/lexicon", + "@ipld/dag-cbor", + "multiformats", + "uint8arrays", + "varint", + "zod" + ] + }, "@atproto/syntax@0.3.0": { "integrity": "sha512-Weq0ZBxffGHDXHl9U7BQc2BFJi/e23AL+k+i5+D9hUq/bzT4yjGsrCejkjq0xt82xXDjmhhvQSZ0LqxyZ5woxA==" }, "@atproto/syntax@0.4.0": { "integrity": "sha512-b9y5ceHS8YKOfP3mdKmwAx5yVj9294UN7FG2XzP6V5aKUdFazEYRnR9m5n5ZQFKa3GNvz7de9guZCJ/sUTcOAA==" }, + "@atproto/syntax@0.4.3": { + "integrity": "sha512-YoZUz40YAJr5nPwvCDWgodEOlt5IftZqPJvA0JDWjuZKD8yXddTwSzXSaKQAzGOpuM+/A3uXRtPzJJqlScc+iA==", + "dependencies": [ + "tslib" + ] + }, + "@ipld/dag-cbor@7.0.3": { + "integrity": "sha512-1VVh2huHsuohdXC1bGJNE8WR72slZ9XE2T3wbBBq31dm7ZBatmKLLxrB+XAqafxfRFjv08RZmj/W/ZqaM13AuA==", + "dependencies": [ + "cborg", + "multiformats" + ] + }, + "@noble/curves@1.9.7": { + "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==", + "dependencies": [ + "@noble/hashes" + ] + }, + "@noble/hashes@1.8.0": { + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==" + }, + "@ts-morph/common@0.28.1": { + "integrity": "sha512-W74iWf7ILp1ZKNYXY5qbddNaml7e9Sedv5lvU1V8lftlitkc9Pq1A+jlH23ltDgWYeZFFEqGCD1Ies9hqu3O+g==", + "dependencies": [ + "minimatch", + "path-browserify", + "tinyglobby" + ] + }, + "abort-controller@3.0.0": { + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dependencies": [ + "event-target-shim" + ] + }, + "ansi-regex@5.0.1": { + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles@4.3.0": { + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": [ + "color-convert" + ] + }, + "atomic-sleep@1.0.0": { + "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==" + }, + "balanced-match@4.0.4": { + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==" + }, + "base64-js@1.5.1": { + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "brace-expansion@5.0.4": { + "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", + "dependencies": [ + "balanced-match" + ] + }, + "buffer@6.0.3": { + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dependencies": [ + "base64-js", + "ieee754" + ] + }, + "cborg@1.10.2": { + "integrity": "sha512-b3tFPA9pUr2zCUiCfRd2+wok2/LBSNUMKOuRRok+WlvvAgEt/PlbgPTsZUcwCOs53IJvLgTp0eotwtosE6njug==", + "bin": true + }, + "cliui@8.0.1": { + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": [ + "string-width", + "strip-ansi", + "wrap-ansi" + ] + }, + "code-block-writer@13.0.3": { + "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==" + }, + "color-convert@2.0.1": { + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": [ + "color-name" + ] + }, + "color-name@1.1.4": { + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, "cookie@0.7.2": { "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==" }, + "core-js@3.48.0": { + "integrity": "sha512-zpEHTy1fjTMZCKLHUZoVeylt9XrzaIN2rbPXEt0k+q7JE5CkCZdo6bNq55bn24a69CH7ErAVLKijxJja4fw+UQ==", + "scripts": true + }, + "emoji-regex@8.0.0": { + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "escalade@3.2.0": { + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==" + }, + "event-target-shim@5.0.1": { + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, + "events@3.3.0": { + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" + }, + "fast-redact@3.5.0": { + "integrity": "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==" + }, + "fdir@6.5.0_picomatch@4.0.3": { + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dependencies": [ + "picomatch" + ], + "optionalPeers": [ + "picomatch" + ] + }, + "get-caller-file@2.0.5": { + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "ieee754@1.2.1": { + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, "iron-session@8.0.4": { "integrity": "sha512-9ivNnaKOd08osD0lJ3i6If23GFS2LsxyMU8Gf/uBUEgm8/8CC1hrrCHFDpMo3IFbpBgwoo/eairRsaD3c5itxA==", "dependencies": [ @@ -87,15 +400,198 @@ "iron-webcrypto@1.2.1": { "integrity": "sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==" }, + "is-fullwidth-code-point@3.0.0": { + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "iso-datestring-validator@2.2.2": { + "integrity": "sha512-yLEMkBbLZTlVQqOnQ4FiMujR6T4DEcCb1xizmvXS+OxuhwcbtynoosRzdMA69zZCShCNAbi+gJ71FxZBBXx1SA==" + }, + "lru-cache@10.4.3": { + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" + }, + "minimatch@10.2.4": { + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "dependencies": [ + "brace-expansion" + ] + }, + "multiformats@9.9.0": { + "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" + }, + "on-exit-leak-free@2.1.2": { + "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==" + }, + "path-browserify@1.0.1": { + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + }, + "picomatch@4.0.3": { + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==" + }, + "pino-abstract-transport@1.2.0": { + "integrity": "sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==", + "dependencies": [ + "readable-stream", + "split2" + ] + }, + "pino-std-serializers@6.2.2": { + "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==" + }, + "pino@8.21.0": { + "integrity": "sha512-ip4qdzjkAyDDZklUaZkcRFb2iA118H9SgRh8yzTkSQK8HilsOJF7rSY8HoW5+I0M46AZgX/pxbprf2vvzQCE0Q==", + "dependencies": [ + "atomic-sleep", + "fast-redact", + "on-exit-leak-free", + "pino-abstract-transport", + "pino-std-serializers", + "process-warning", + "quick-format-unescaped", + "real-require", + "safe-stable-stringify", + "sonic-boom", + "thread-stream" + ], + "bin": true + }, + "prettier@3.8.1": { + "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", + "bin": true + }, + "process-warning@3.0.0": { + "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==" + }, + "process@0.11.10": { + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==" + }, + "quick-format-unescaped@4.0.4": { + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" + }, + "readable-stream@4.7.0": { + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", + "dependencies": [ + "abort-controller", + "buffer", + "events", + "process", + "string_decoder" + ] + }, + "real-require@0.2.0": { + "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==" + }, + "require-directory@2.1.1": { + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, + "safe-buffer@5.2.1": { + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "safe-stable-stringify@2.5.0": { + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==" + }, + "sonic-boom@3.8.1": { + "integrity": "sha512-y4Z8LCDBuum+PBP3lSV7RHrXscqksve/bi0as7mhwVnBW+/wUqKT/2Kb7um8yqcFy0duYbbPxzt89Zy2nOCaxg==", + "dependencies": [ + "atomic-sleep" + ] + }, + "split2@4.2.0": { + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==" + }, + "string-width@4.2.3": { + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": [ + "emoji-regex", + "is-fullwidth-code-point", + "strip-ansi" + ] + }, + "string_decoder@1.3.0": { + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": [ + "safe-buffer" + ] + }, + "strip-ansi@6.0.1": { + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": [ + "ansi-regex" + ] + }, + "thread-stream@2.7.0": { + "integrity": "sha512-qQiRWsU/wvNolI6tbbCKd9iKaTnCXsTwVxhhKM6nctPdujTyztjlbUkUTUymidWcMnZ5pWR0ej4a0tjsW021vw==", + "dependencies": [ + "real-require" + ] + }, + "tinyglobby@0.2.15_picomatch@4.0.3": { + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dependencies": [ + "fdir", + "picomatch" + ] + }, + "ts-morph@27.0.2": { + "integrity": "sha512-fhUhgeljcrdZ+9DZND1De1029PrE+cMkIP7ooqkLRTrRLTqcki2AstsyJm0vRNbTbVCNJ0idGlbBrfqc7/nA8w==", + "dependencies": [ + "@ts-morph/common", + "code-block-writer" + ] + }, + "tslib@2.8.1": { + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + }, + "uint8arrays@3.0.0": { + "integrity": "sha512-HRCx0q6O9Bfbp+HHSfQQKD7wU70+lydKVt4EghkdOvlK/NlrF90z+eXV34mUd48rNvVJXwkrMSPpCATkct8fJA==", + "dependencies": [ + "multiformats" + ] + }, "uncrypto@0.1.3": { "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==" + }, + "unicode-segmenter@0.14.5": { + "integrity": "sha512-jHGmj2LUuqDcX3hqY12Ql+uhUTn8huuxNZGq7GvtF6bSybzH3aFgedYu/KTzQStEgt1Ra2F3HxadNXsNjb3m3g==" + }, + "varint@6.0.0": { + "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==" + }, + "wrap-ansi@7.0.0": { + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": [ + "ansi-styles", + "string-width", + "strip-ansi" + ] + }, + "y18n@5.0.8": { + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yargs-parser@21.1.1": { + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" + }, + "yargs@17.7.2": { + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": [ + "cliui", + "escalade", + "get-caller-file", + "require-directory", + "string-width", + "y18n", + "yargs-parser" + ] + }, + "zod@3.25.76": { + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==" } }, "workspace": { "dependencies": [ "jsr:@hono/hono@^4.11.9", "jsr:@tijs/atproto-oauth@^2.9.0", - "jsr:@tijs/atproto-storage@1" + "jsr:@tijs/atproto-storage@1", + "npm:@atproto/lex@^0.0.19" ] } } diff --git a/lexicons/app.ts b/lexicons/app.ts new file mode 100644 index 0000000..2cd3e3e --- /dev/null +++ b/lexicons/app.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as bsky from './app/bsky.js' diff --git a/lexicons/app/bsky.ts b/lexicons/app/bsky.ts new file mode 100644 index 0000000..fe075d6 --- /dev/null +++ b/lexicons/app/bsky.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as richtext from './bsky/richtext.js' diff --git a/lexicons/app/bsky/richtext.ts b/lexicons/app/bsky/richtext.ts new file mode 100644 index 0000000..ce3591a --- /dev/null +++ b/lexicons/app/bsky/richtext.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as facet from './richtext/facet.js' diff --git a/lexicons/app/bsky/richtext/facet.defs.ts b/lexicons/app/bsky/richtext/facet.defs.ts new file mode 100644 index 0000000..1bfe28b --- /dev/null +++ b/lexicons/app/bsky/richtext/facet.defs.ts @@ -0,0 +1,120 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'app.bsky.richtext.facet' + +export { $nsid } + +/** Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags'). */ +type Tag = { $type?: 'app.bsky.richtext.facet#tag'; tag: string } + +export type { Tag } + +/** Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags'). */ +const tag = l.typedObject( + $nsid, + 'tag', + l.object({ tag: l.string({ maxLength: 640, maxGraphemes: 64 }) }), +) + +export { tag } + +/** Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. */ +type Link = { $type?: 'app.bsky.richtext.facet#link'; uri: l.UriString } + +export type { Link } + +/** Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. */ +const link = l.typedObject( + $nsid, + 'link', + l.object({ uri: l.string({ format: 'uri' }) }), +) + +export { link } + +/** Annotation of a sub-string within rich text. */ +type Main = { + $type?: 'app.bsky.richtext.facet' + index: ByteSlice + features: ( + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + )[] +} + +export type { Main } + +/** Annotation of a sub-string within rich text. */ +const main = l.typedObject
( + $nsid, + 'main', + l.object({ + index: l.ref((() => byteSlice) as any), + features: l.array( + l.typedUnion( + [ + l.typedRef((() => mention) as any), + l.typedRef((() => link) as any), + l.typedRef((() => tag) as any), + ], + false, + ), + ), + }), +) + +export { main } + +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main), + $build = /*#__PURE__*/ main.build.bind(main), + $type = /*#__PURE__*/ main.$type +export const $assert = /*#__PURE__*/ main.assert.bind(main), + $check = /*#__PURE__*/ main.check.bind(main), + $cast = /*#__PURE__*/ main.cast.bind(main), + $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main), + $matches = /*#__PURE__*/ main.matches.bind(main), + $parse = /*#__PURE__*/ main.parse.bind(main), + $safeParse = /*#__PURE__*/ main.safeParse.bind(main), + $validate = /*#__PURE__*/ main.validate.bind(main), + $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) + +/** Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. */ +type Mention = { $type?: 'app.bsky.richtext.facet#mention'; did: l.DidString } + +export type { Mention } + +/** Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. */ +const mention = l.typedObject( + $nsid, + 'mention', + l.object({ did: l.string({ format: 'did' }) }), +) + +export { mention } + +/** Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets. */ +type ByteSlice = { + $type?: 'app.bsky.richtext.facet#byteSlice' + byteEnd: number + byteStart: number +} + +export type { ByteSlice } + +/** Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets. */ +const byteSlice = l.typedObject( + $nsid, + 'byteSlice', + l.object({ + byteEnd: l.integer({ minimum: 0 }), + byteStart: l.integer({ minimum: 0 }), + }), +) + +export { byteSlice } diff --git a/lexicons/app/bsky/richtext/facet.json b/lexicons/app/bsky/richtext/facet.json new file mode 100644 index 0000000..39b039b --- /dev/null +++ b/lexicons/app/bsky/richtext/facet.json @@ -0,0 +1,90 @@ +{ + "id": "app.bsky.richtext.facet", + "defs": { + "tag": { + "type": "object", + "required": [ + "tag" + ], + "properties": { + "tag": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + } + }, + "description": "Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags')." + }, + "link": { + "type": "object", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "format": "uri" + } + }, + "description": "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL." + }, + "main": { + "type": "object", + "required": [ + "index", + "features" + ], + "properties": { + "index": { + "ref": "#byteSlice", + "type": "ref" + }, + "features": { + "type": "array", + "items": { + "refs": [ + "#mention", + "#link", + "#tag" + ], + "type": "union" + } + } + }, + "description": "Annotation of a sub-string within rich text." + }, + "mention": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + }, + "description": "Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID." + }, + "byteSlice": { + "type": "object", + "required": [ + "byteStart", + "byteEnd" + ], + "properties": { + "byteEnd": { + "type": "integer", + "minimum": 0 + }, + "byteStart": { + "type": "integer", + "minimum": 0 + } + }, + "description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/app/bsky/richtext/facet.ts b/lexicons/app/bsky/richtext/facet.ts new file mode 100644 index 0000000..13de191 --- /dev/null +++ b/lexicons/app/bsky/richtext/facet.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './facet.defs.js' +export * as $defs from './facet.defs.js' diff --git a/lexicons/com.ts b/lexicons/com.ts new file mode 100644 index 0000000..6b6c956 --- /dev/null +++ b/lexicons/com.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as atproto from './com/atproto.js' diff --git a/lexicons/com/atproto.ts b/lexicons/com/atproto.ts new file mode 100644 index 0000000..d25e80d --- /dev/null +++ b/lexicons/com/atproto.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as repo from './atproto/repo.js' diff --git a/lexicons/com/atproto/repo.ts b/lexicons/com/atproto/repo.ts new file mode 100644 index 0000000..3a22bb9 --- /dev/null +++ b/lexicons/com/atproto/repo.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as strongRef from './repo/strongRef.js' diff --git a/lexicons/com/atproto/repo/strongRef.defs.ts b/lexicons/com/atproto/repo/strongRef.defs.ts new file mode 100644 index 0000000..b8b244c --- /dev/null +++ b/lexicons/com/atproto/repo/strongRef.defs.ts @@ -0,0 +1,41 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'com.atproto.repo.strongRef' + +export { $nsid } + +type Main = { + $type?: 'com.atproto.repo.strongRef' + cid: l.CidString + uri: l.AtUriString +} + +export type { Main } + +const main = l.typedObject
( + $nsid, + 'main', + l.object({ + cid: l.string({ format: 'cid' }), + uri: l.string({ format: 'at-uri' }), + }), +) + +export { main } + +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main), + $build = /*#__PURE__*/ main.build.bind(main), + $type = /*#__PURE__*/ main.$type +export const $assert = /*#__PURE__*/ main.assert.bind(main), + $check = /*#__PURE__*/ main.check.bind(main), + $cast = /*#__PURE__*/ main.cast.bind(main), + $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main), + $matches = /*#__PURE__*/ main.matches.bind(main), + $parse = /*#__PURE__*/ main.parse.bind(main), + $safeParse = /*#__PURE__*/ main.safeParse.bind(main), + $validate = /*#__PURE__*/ main.validate.bind(main), + $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) diff --git a/lexicons/com/atproto/repo/strongRef.json b/lexicons/com/atproto/repo/strongRef.json new file mode 100644 index 0000000..f45cca3 --- /dev/null +++ b/lexicons/com/atproto/repo/strongRef.json @@ -0,0 +1,25 @@ +{ + "id": "com.atproto.repo.strongRef", + "defs": { + "main": { + "type": "object", + "required": [ + "uri", + "cid" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1, + "description": "A URI with a content-hash fingerprint." +} diff --git a/lexicons/com/atproto/repo/strongRef.ts b/lexicons/com/atproto/repo/strongRef.ts new file mode 100644 index 0000000..06b4939 --- /dev/null +++ b/lexicons/com/atproto/repo/strongRef.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './strongRef.defs.js' +export * as $defs from './strongRef.defs.js' diff --git a/lexicons/vote.ts b/lexicons/vote.ts new file mode 100644 index 0000000..89d60a2 --- /dev/null +++ b/lexicons/vote.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as pedro from './vote/pedro.js' diff --git a/lexicons/vote/pedro.ts b/lexicons/vote/pedro.ts new file mode 100644 index 0000000..4db00cd --- /dev/null +++ b/lexicons/vote/pedro.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as qa from './pedro/qa.js' diff --git a/lexicons/vote/pedro/qa.ts b/lexicons/vote/pedro/qa.ts new file mode 100644 index 0000000..7ebdffe --- /dev/null +++ b/lexicons/vote/pedro/qa.ts @@ -0,0 +1,7 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as answer from './qa/answer.js' +export * as question from './qa/question.js' +export * as upvote from './qa/upvote.js' diff --git a/lexicons/vote/pedro/qa/answer.defs.ts b/lexicons/vote/pedro/qa/answer.defs.ts new file mode 100644 index 0000000..a6da371 --- /dev/null +++ b/lexicons/vote/pedro/qa/answer.defs.ts @@ -0,0 +1,55 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as RichtextFacet from '../../../app/bsky/richtext/facet.defs.js' +import * as RepoStrongRef from '../../../com/atproto/repo/strongRef.defs.js' + +const $nsid = 'vote.pedro.qa.answer' + +export { $nsid } + +/** A user generated answer to a referenced question */ +type Main = { + $type: 'vote.pedro.qa.answer' + description: string + + /** + * Annotations of text (mentions, URLs, etc.) for the description + */ + facets?: RichtextFacet.Main[] + question: RepoStrongRef.Main + createdAt: l.DatetimeString +} + +export type { Main } + +/** A user generated answer to a referenced question */ +const main = l.record<'tid', Main>( + 'tid', + $nsid, + l.object({ + description: l.string(), + facets: l.optional( + l.array(l.ref((() => RichtextFacet.main) as any)), + ), + question: l.ref((() => RepoStrongRef.main) as any), + createdAt: l.string({ format: 'datetime' }), + }), +) + +export { main } + +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main), + $build = /*#__PURE__*/ main.build.bind(main), + $type = /*#__PURE__*/ main.$type +export const $assert = /*#__PURE__*/ main.assert.bind(main), + $check = /*#__PURE__*/ main.check.bind(main), + $cast = /*#__PURE__*/ main.cast.bind(main), + $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main), + $matches = /*#__PURE__*/ main.matches.bind(main), + $parse = /*#__PURE__*/ main.parse.bind(main), + $safeParse = /*#__PURE__*/ main.safeParse.bind(main), + $validate = /*#__PURE__*/ main.validate.bind(main), + $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) diff --git a/lexicons/vote/pedro/qa/answer.json b/lexicons/vote/pedro/qa/answer.json new file mode 100644 index 0000000..cdb00ea --- /dev/null +++ b/lexicons/vote/pedro/qa/answer.json @@ -0,0 +1,41 @@ +{ + "lexicon": 1, + "$type": "com.atproto.lexicon.schema", + "id": "vote.pedro.qa.answer", + "defs": { + "main": { + "description": "A user generated answer to a referenced question", + "key": "tid", + "type": "record", + "record": { + "type": "object", + "required": [ + "description", + "question", + "createdAt" + ], + "properties": { + "description": { + "type": "string" + }, + "facets": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.richtext.facet" + }, + "description": "Annotations of text (mentions, URLs, etc.) for the description" + }, + "question": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "createdAt": { + "type": "string", + "format": "datetime" + } + } + } + } + } +} diff --git a/lexicons/vote/pedro/qa/answer.ts b/lexicons/vote/pedro/qa/answer.ts new file mode 100644 index 0000000..7e15adf --- /dev/null +++ b/lexicons/vote/pedro/qa/answer.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './answer.defs.js' +export * as $defs from './answer.defs.js' diff --git a/lexicons/vote/pedro/qa/question.defs.ts b/lexicons/vote/pedro/qa/question.defs.ts new file mode 100644 index 0000000..46ef5e0 --- /dev/null +++ b/lexicons/vote/pedro/qa/question.defs.ts @@ -0,0 +1,61 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as RichtextFacet from '../../../app/bsky/richtext/facet.defs.js' +import * as RepoStrongRef from '../../../com/atproto/repo/strongRef.defs.js' + +const $nsid = 'vote.pedro.qa.question' + +export { $nsid } + +/** A user generated question that others can answer to */ +type Main = { + $type: 'vote.pedro.qa.question' + title: string + description?: string + + /** + * Annotations of text (mentions, URLs, etc.) for the description + */ + facets?: RichtextFacet.Main[] + tags?: string[] + createdAt: l.DatetimeString + highlightedAnswers?: RepoStrongRef.Main[] +} + +export type { Main } + +/** A user generated question that others can answer to */ +const main = l.record<'tid', Main>( + 'tid', + $nsid, + l.object({ + title: l.string({ minLength: 1, maxLength: 150 }), + description: l.optional(l.string()), + facets: l.optional( + l.array(l.ref((() => RichtextFacet.main) as any)), + ), + tags: l.optional(l.array(l.string())), + createdAt: l.string({ format: 'datetime' }), + highlightedAnswers: l.optional( + l.array(l.ref((() => RepoStrongRef.main) as any)), + ), + }), +) + +export { main } + +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main), + $build = /*#__PURE__*/ main.build.bind(main), + $type = /*#__PURE__*/ main.$type +export const $assert = /*#__PURE__*/ main.assert.bind(main), + $check = /*#__PURE__*/ main.check.bind(main), + $cast = /*#__PURE__*/ main.cast.bind(main), + $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main), + $matches = /*#__PURE__*/ main.matches.bind(main), + $parse = /*#__PURE__*/ main.parse.bind(main), + $safeParse = /*#__PURE__*/ main.safeParse.bind(main), + $validate = /*#__PURE__*/ main.validate.bind(main), + $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) diff --git a/lexicons/vote/pedro/qa/question.json b/lexicons/vote/pedro/qa/question.json new file mode 100644 index 0000000..8566ecb --- /dev/null +++ b/lexicons/vote/pedro/qa/question.json @@ -0,0 +1,54 @@ +{ + "lexicon": 1, + "$type": "com.atproto.lexicon.schema", + "id": "vote.pedro.qa.question", + "defs": { + "main": { + "description": "A user generated question that others can answer to", + "key": "tid", + "type": "record", + "record": { + "type": "object", + "required": [ + "title", + "createdAt" + ], + "properties": { + "title": { + "type": "string", + "minLength": 1, + "maxLength": 150 + }, + "description": { + "type": "string" + }, + "facets": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.richtext.facet" + }, + "description": "Annotations of text (mentions, URLs, etc.) for the description" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "highlightedAnswers": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + } + } + } + } + } +} diff --git a/lexicons/vote/pedro/qa/question.ts b/lexicons/vote/pedro/qa/question.ts new file mode 100644 index 0000000..236d338 --- /dev/null +++ b/lexicons/vote/pedro/qa/question.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './question.defs.js' +export * as $defs from './question.defs.js' diff --git a/lexicons/vote/pedro/qa/upvote.defs.ts b/lexicons/vote/pedro/qa/upvote.defs.ts new file mode 100644 index 0000000..8b6c7c8 --- /dev/null +++ b/lexicons/vote/pedro/qa/upvote.defs.ts @@ -0,0 +1,44 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as RepoStrongRef from '../../../com/atproto/repo/strongRef.defs.js' + +const $nsid = 'vote.pedro.qa.upvote' + +export { $nsid } + +/** An upvote to a question or answer */ +type Main = { + $type: 'vote.pedro.qa.upvote' + reference: RepoStrongRef.Main + createdAt: l.DatetimeString +} + +export type { Main } + +/** An upvote to a question or answer */ +const main = l.record<'tid', Main>( + 'tid', + $nsid, + l.object({ + reference: l.ref((() => RepoStrongRef.main) as any), + createdAt: l.string({ format: 'datetime' }), + }), +) + +export { main } + +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main), + $build = /*#__PURE__*/ main.build.bind(main), + $type = /*#__PURE__*/ main.$type +export const $assert = /*#__PURE__*/ main.assert.bind(main), + $check = /*#__PURE__*/ main.check.bind(main), + $cast = /*#__PURE__*/ main.cast.bind(main), + $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main), + $matches = /*#__PURE__*/ main.matches.bind(main), + $parse = /*#__PURE__*/ main.parse.bind(main), + $safeParse = /*#__PURE__*/ main.safeParse.bind(main), + $validate = /*#__PURE__*/ main.validate.bind(main), + $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) diff --git a/lexicons/vote/pedro/qa/upvote.json b/lexicons/vote/pedro/qa/upvote.json new file mode 100644 index 0000000..7b70e25 --- /dev/null +++ b/lexicons/vote/pedro/qa/upvote.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "$type": "com.atproto.lexicon.schema", + "id": "vote.pedro.qa.upvote", + "defs": { + "main": { + "description": "An upvote to a question or answer", + "key": "tid", + "type": "record", + "record": { + "type": "object", + "required": [ + "reference", + "createdAt" + ], + "properties": { + "reference": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "createdAt": { + "type": "string", + "format": "datetime" + } + } + } + } + } +} diff --git a/lexicons/vote/pedro/qa/upvote.ts b/lexicons/vote/pedro/qa/upvote.ts new file mode 100644 index 0000000..84b03fb --- /dev/null +++ b/lexicons/vote/pedro/qa/upvote.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './upvote.defs.js' +export * as $defs from './upvote.defs.js' diff --git a/main.tsx b/main.tsx index cf4ca9b..8ed3d4b 100644 --- a/main.tsx +++ b/main.tsx @@ -38,6 +38,14 @@ app.get("/", (c) => { ) }); +app.get("/new", (c) => { + return c.html( + +

Create a new question

+
+ ) +}); + // Protected route example app.get("/profile", async (c) => { const { session, error } = await oauth.getSessionFromRequest(