Skip to content

Commit ede1b59

Browse files
fix(deps): remove dependency on @atproto/api (#1295)
Co-authored-by: Daniel Roe <daniel@roe.dev>
1 parent f431b91 commit ede1b59

36 files changed

+3525
-156
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: 105 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,126 @@
11
{
22
"version": 1,
3-
"lexicons": ["app.bsky.actor.profile", "site.standard.document"],
3+
"lexicons": [
4+
"app.bsky.actor.getProfiles",
5+
"app.bsky.actor.profile",
6+
"app.bsky.embed.external",
7+
"app.bsky.embed.images",
8+
"app.bsky.feed.defs",
9+
"app.bsky.feed.getLikes",
10+
"app.bsky.feed.getPostThread",
11+
"app.bsky.feed.getPosts",
12+
"app.bsky.feed.post",
13+
"com.bad-example.identity.resolveMiniDoc",
14+
"site.standard.document"
15+
],
416
"resolutions": {
17+
"app.bsky.actor.defs": {
18+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.actor.defs",
19+
"cid": "bafyreigwqwhe2jxohagozazfbrf6dxgzphvkg3d3lg7uxdvepsimqyclka"
20+
},
21+
"app.bsky.actor.getProfiles": {
22+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.actor.getProfiles",
23+
"cid": "bafyreihphrndnt2cvnv3nk442f6kohdnpagk4xip74f2jn36uoal25vhta"
24+
},
525
"app.bsky.actor.profile": {
626
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.actor.profile",
727
"cid": "bafyreia6umzg3a6d7mjbow4p57tviey45muohklhgsvjoamcctoiusr4pe"
828
},
29+
"app.bsky.actor.status": {
30+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.actor.status",
31+
"cid": "bafyreifdg4b64wohpwkh5lydc6tckvol2rspnpni6dec6recy2rhvlnz4a"
32+
},
33+
"app.bsky.embed.defs": {
34+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.defs",
35+
"cid": "bafyreia42uud4qil67wknywzbxfyxc3b7woewsii54cakq2ould3ldetei"
36+
},
37+
"app.bsky.embed.external": {
38+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.external",
39+
"cid": "bafyreiblxmpzgwg4fbr45b4xzts3h4k72k7cdnrxy2ub2w5d7mnwzznkwi"
40+
},
41+
"app.bsky.embed.images": {
42+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.images",
43+
"cid": "bafyreifrntpx63uebiskpooozv6hji62swectq3pocw5h5gpkkqynmazdm"
44+
},
45+
"app.bsky.embed.record": {
46+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.record",
47+
"cid": "bafyreigdtmu53blwxoygphg5zh5zpmlftz64c3jyqpv2yqpx3nrichkyla"
48+
},
49+
"app.bsky.embed.recordWithMedia": {
50+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.recordWithMedia",
51+
"cid": "bafyreia7jrw2p73egm7vrunssgzeyj2rwmk3s4dymfhgzcavxjfaje3qfi"
52+
},
53+
"app.bsky.embed.video": {
54+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.video",
55+
"cid": "bafyreie3nug4ezpwodl6yrpgv5edkazzn22t7ea4yaeuun4rctyekkngai"
56+
},
57+
"app.bsky.feed.defs": {
58+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.defs",
59+
"cid": "bafyreiadwvxawxifsnm7ae6l56aq23qs7ndih7npgs6pxmkoin7gi3k6pu"
60+
},
61+
"app.bsky.feed.getLikes": {
62+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.getLikes",
63+
"cid": "bafyreib6ylalknwxizbtbwsdmja4rhjswwczut5ivjdavfgew27m7knqou"
64+
},
65+
"app.bsky.feed.getPostThread": {
66+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.getPostThread",
67+
"cid": "bafyreif37upfzfu7t4rv3pqzz3swu2oc4nrxdxfr3xqjsrrmgyckneitta"
68+
},
69+
"app.bsky.feed.getPosts": {
70+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.getPosts",
71+
"cid": "bafyreihy4tanaizkynghab46n3qztsspvoaqtbrkzinvxi4igeylg5ghji"
72+
},
73+
"app.bsky.feed.post": {
74+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.post",
75+
"cid": "bafyreidgbehqwweghrrddfu6jgj7lyr6fwhzgazhirnszdb5lvr7iynkiy"
76+
},
77+
"app.bsky.feed.postgate": {
78+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.postgate",
79+
"cid": "bafyreiai5efexyluyptv5tbl6kqbqlnneczqzexcqnxmitmulyjfaftgva"
80+
},
81+
"app.bsky.feed.threadgate": {
82+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.threadgate",
83+
"cid": "bafyreiht77wd6duduz4yqp62m6dwma5dy7gdihps4g2nd73acfzqlglvdi"
84+
},
85+
"app.bsky.graph.defs": {
86+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.graph.defs",
87+
"cid": "bafyreifcipomli7yggtl46xufgxlnrw7se6xmsdxmzgfcz2tiu76ljatxm"
88+
},
89+
"app.bsky.labeler.defs": {
90+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.labeler.defs",
91+
"cid": "bafyreicxx5i36v5dbqk5vvfzhnta5gajrvc544mnepux4wksrkid7mw3q4"
92+
},
93+
"app.bsky.notification.defs": {
94+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.notification.defs",
95+
"cid": "bafyreickbpnayydlyfakliahgf23jjuesllh6qrslyofk5yz5xizjavhui"
96+
},
97+
"app.bsky.richtext.facet": {
98+
"uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.richtext.facet",
99+
"cid": "bafyreidg56eo7zynf6ihz4xb627vwoqf5idnevkmwp7sxc4tijg6xngbu4"
100+
},
9101
"com.atproto.label.defs": {
10102
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.label.defs",
11103
"cid": "bafyreig4hmnb2xkecyg4aaqfhr2rrcxxb3gsr4xks4rqb7rscrycalbrji"
12104
},
105+
"com.atproto.moderation.defs": {
106+
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.moderation.defs",
107+
"cid": "bafyreideawy4rlpgces2oebk5q4kpurbonhb5qtl4pes7dvxsc5osaiksy"
108+
},
13109
"com.atproto.repo.strongRef": {
14110
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.strongRef",
15111
"cid": "bafyreifrkdbnkvfjujntdaeigolnrjj3srrs53tfixjhmacclps72qlov4"
16112
},
113+
"com.bad-example.identity.resolveMiniDoc": {
114+
"uri": "at://did:plc:hdhoaan3xa3jiuq4fg4mefid/com.atproto.lexicon.schema/com.bad-example.identity.resolveMiniDoc",
115+
"cid": "bafyreihqq4ud3ihj63op2ety24nziyyh7axibm65mnde5bdeai2z6adety"
116+
},
17117
"site.standard.document": {
18118
"uri": "at://did:plc:re3ebnp5v7ffagz6rb6xfei4/com.atproto.lexicon.schema/site.standard.document",
19119
"cid": "bafyreigdukg62hmel4jbdvghdsoaphslhrdktmahzdyokomuka6yejetwa"
120+
},
121+
"tools.ozone.report.defs": {
122+
"uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.report.defs",
123+
"cid": "bafyreic3l2rmh2ugirt3jz372wcvy333m7t2ynlyzj2k54oshijs6lxdfu"
20124
}
21125
}
22126
}

0 commit comments

Comments
 (0)