Skip to content

Commit 95b09f4

Browse files
chore: remove dependency on @atproto/api
1 parent 8252800 commit 95b09f4

File tree

30 files changed

+3381
-130
lines changed

30 files changed

+3381
-130
lines changed

app/components/Header/AuthModal.client.vue

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import { useAtproto } from '~/composables/atproto/useAtproto'
33
import { authRedirect } from '~/utils/atproto/helpers'
4-
import { ensureValidAtIdentifier } from '@atproto/syntax'
4+
import { isAtIdentifierString } from '@atproto/lex'
55
66
const handleInput = shallowRef('')
77
const errorMessage = shallowRef('')
@@ -28,20 +28,15 @@ async function handleCreateAccount() {
2828
2929
async function handleLogin() {
3030
if (handleInput.value) {
31-
// URLS to PDSs are valid for oauth redirects
32-
if (!handleInput.value.startsWith('https://')) {
33-
try {
34-
ensureValidAtIdentifier(handleInput.value)
35-
} catch (error) {
36-
errorMessage.value =
37-
error instanceof Error ? error.message : $t('auth.modal.default_input_error')
38-
return
39-
}
31+
// URLS to PDSs are valid for initiating oauth flows
32+
if (handleInput.value.startsWith('https://') || isAtIdentifierString(handleInput.value)) {
33+
await authRedirect(handleInput.value, {
34+
redirectTo: route.fullPath,
35+
locale: locale.value,
36+
})
37+
} else {
38+
errorMessage.value = $t('auth.modal.default_input_error')
4039
}
41-
await authRedirect(handleInput.value, {
42-
redirectTo: route.fullPath,
43-
locale: locale.value,
44-
})
4540
}
4641
}
4742

lexicons.json

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,116 @@
11
{
22
"version": 1,
3-
"lexicons": ["app.bsky.actor.profile", "site.standard.document"],
3+
"lexicons": [
4+
"app.bsky.actor.profile",
5+
"app.bsky.embed.external",
6+
"app.bsky.embed.images",
7+
"app.bsky.feed.defs",
8+
"app.bsky.feed.getLikes",
9+
"app.bsky.feed.getPostThread",
10+
"app.bsky.feed.getPosts",
11+
"app.bsky.feed.post",
12+
"site.standard.document"
13+
],
414
"resolutions": {
15+
"app.bsky.actor.defs": {
16+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.actor.defs",
17+
"cid": "bafyreigwqwhe2jxohagozazfbrf6dxgzphvkg3d3lg7uxdvepsimqyclka"
18+
},
519
"app.bsky.actor.profile": {
620
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.actor.profile",
721
"cid": "bafyreia6umzg3a6d7mjbow4p57tviey45muohklhgsvjoamcctoiusr4pe"
822
},
23+
"app.bsky.actor.status": {
24+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.actor.status",
25+
"cid": "bafyreifdg4b64wohpwkh5lydc6tckvol2rspnpni6dec6recy2rhvlnz4a"
26+
},
27+
"app.bsky.embed.defs": {
28+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.defs",
29+
"cid": "bafyreia42uud4qil67wknywzbxfyxc3b7woewsii54cakq2ould3ldetei"
30+
},
31+
"app.bsky.embed.external": {
32+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.external",
33+
"cid": "bafyreiblxmpzgwg4fbr45b4xzts3h4k72k7cdnrxy2ub2w5d7mnwzznkwi"
34+
},
35+
"app.bsky.embed.images": {
36+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.images",
37+
"cid": "bafyreifrntpx63uebiskpooozv6hji62swectq3pocw5h5gpkkqynmazdm"
38+
},
39+
"app.bsky.embed.record": {
40+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.record",
41+
"cid": "bafyreigdtmu53blwxoygphg5zh5zpmlftz64c3jyqpv2yqpx3nrichkyla"
42+
},
43+
"app.bsky.embed.recordWithMedia": {
44+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.recordWithMedia",
45+
"cid": "bafyreia7jrw2p73egm7vrunssgzeyj2rwmk3s4dymfhgzcavxjfaje3qfi"
46+
},
47+
"app.bsky.embed.video": {
48+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.video",
49+
"cid": "bafyreie3nug4ezpwodl6yrpgv5edkazzn22t7ea4yaeuun4rctyekkngai"
50+
},
51+
"app.bsky.feed.defs": {
52+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.defs",
53+
"cid": "bafyreiadwvxawxifsnm7ae6l56aq23qs7ndih7npgs6pxmkoin7gi3k6pu"
54+
},
55+
"app.bsky.feed.getLikes": {
56+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.getLikes",
57+
"cid": "bafyreib6ylalknwxizbtbwsdmja4rhjswwczut5ivjdavfgew27m7knqou"
58+
},
59+
"app.bsky.feed.getPostThread": {
60+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.getPostThread",
61+
"cid": "bafyreif37upfzfu7t4rv3pqzz3swu2oc4nrxdxfr3xqjsrrmgyckneitta"
62+
},
63+
"app.bsky.feed.getPosts": {
64+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.getPosts",
65+
"cid": "bafyreihy4tanaizkynghab46n3qztsspvoaqtbrkzinvxi4igeylg5ghji"
66+
},
67+
"app.bsky.feed.post": {
68+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.post",
69+
"cid": "bafyreidgbehqwweghrrddfu6jgj7lyr6fwhzgazhirnszdb5lvr7iynkiy"
70+
},
71+
"app.bsky.feed.postgate": {
72+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.postgate",
73+
"cid": "bafyreiai5efexyluyptv5tbl6kqbqlnneczqzexcqnxmitmulyjfaftgva"
74+
},
75+
"app.bsky.feed.threadgate": {
76+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.threadgate",
77+
"cid": "bafyreiht77wd6duduz4yqp62m6dwma5dy7gdihps4g2nd73acfzqlglvdi"
78+
},
79+
"app.bsky.graph.defs": {
80+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.graph.defs",
81+
"cid": "bafyreifcipomli7yggtl46xufgxlnrw7se6xmsdxmzgfcz2tiu76ljatxm"
82+
},
83+
"app.bsky.labeler.defs": {
84+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.labeler.defs",
85+
"cid": "bafyreicxx5i36v5dbqk5vvfzhnta5gajrvc544mnepux4wksrkid7mw3q4"
86+
},
87+
"app.bsky.notification.defs": {
88+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.notification.defs",
89+
"cid": "bafyreickbpnayydlyfakliahgf23jjuesllh6qrslyofk5yz5xizjavhui"
90+
},
91+
"app.bsky.richtext.facet": {
92+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.richtext.facet",
93+
"cid": "bafyreidg56eo7zynf6ihz4xb627vwoqf5idnevkmwp7sxc4tijg6xngbu4"
94+
},
995
"com.atproto.label.defs": {
1096
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.label.defs",
1197
"cid": "bafyreig4hmnb2xkecyg4aaqfhr2rrcxxb3gsr4xks4rqb7rscrycalbrji"
1298
},
99+
"com.atproto.moderation.defs": {
100+
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.moderation.defs",
101+
"cid": "bafyreideawy4rlpgces2oebk5q4kpurbonhb5qtl4pes7dvxsc5osaiksy"
102+
},
13103
"com.atproto.repo.strongRef": {
14104
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.strongRef",
15105
"cid": "bafyreifrkdbnkvfjujntdaeigolnrjj3srrs53tfixjhmacclps72qlov4"
16106
},
17107
"site.standard.document": {
18108
"uri": "at://did:plc:re3ebnp5v7ffagz6rb6xfei4/com.atproto.lexicon.schema/site.standard.document",
19109
"cid": "bafyreigdukg62hmel4jbdvghdsoaphslhrdktmahzdyokomuka6yejetwa"
110+
},
111+
"tools.ozone.report.defs": {
112+
"uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.report.defs",
113+
"cid": "bafyreic3l2rmh2ugirt3jz372wcvy333m7t2ynlyzj2k54oshijs6lxdfu"
20114
}
21115
}
22116
}

0 commit comments

Comments
 (0)