tangled
alpha
login
or
join now
flo-bit.dev
/
svelte-atproto-client-oauth
6
fork
atom
simple atproto oauth for static svelte apps
flo-bit.dev/svelte-atproto-client-oauth/
6
fork
atom
overview
issues
pulls
pipelines
refactor
Florian
1 month ago
9cf3e0c9
f8d90ddc
+27
-11
10 changed files
expand all
collapse all
unified
split
src
lib
UI
HandleInput.svelte
LoginModal.svelte
atproto
auth.svelte.ts
index.ts
metadata.ts
methods.ts
settings.ts
oauth
index.ts
routes
+layout.svelte
+page.svelte
+1
-1
src/lib/UI/HandleInput.svelte
···
1
1
<script lang="ts">
2
2
import { AppBskyActorDefs } from '@atcute/bluesky';
3
3
import { Combobox } from 'bits-ui';
4
4
-
import { searchActorsTypeahead } from '$lib/oauth/atproto';
4
4
+
import { searchActorsTypeahead } from '$lib/atproto';
5
5
import Avatar from './Avatar.svelte';
6
6
7
7
let results: AppBskyActorDefs.ProfileViewBasic[] = $state([]);
+1
-1
src/lib/UI/LoginModal.svelte
···
7
7
</script>
8
8
9
9
<script lang="ts">
10
10
-
import { login, signup } from '$lib/oauth/auth.svelte';
10
10
+
import { login, signup } from '$lib/atproto';
11
11
import type { ActorIdentifier, Did } from '@atcute/lexicons';
12
12
import Button from './Button.svelte';
13
13
import { onMount, tick } from 'svelte';
+19
src/lib/atproto/index.ts
···
1
1
+
export { user, login, signup, logout, initClient } from './auth.svelte';
2
2
+
export { metadata } from './metadata';
3
3
+
4
4
+
export {
5
5
+
parseUri,
6
6
+
resolveHandle,
7
7
+
getPDS,
8
8
+
getDetailedProfile,
9
9
+
getClient,
10
10
+
listRecords,
11
11
+
getRecord,
12
12
+
putRecord,
13
13
+
deleteRecord,
14
14
+
uploadBlob,
15
15
+
describeRepo,
16
16
+
getBlobURL,
17
17
+
getImageBlobUrl,
18
18
+
searchActorsTypeahead
19
19
+
} from './methods';
+1
-1
src/lib/oauth/atproto.ts
src/lib/atproto/methods.ts
···
118
118
});
119
119
120
120
if (!response.ok) {
121
121
-
return;
121
121
+
return allRecords;
122
122
}
123
123
124
124
allRecords.push(...response.data.records);
+3
-4
src/lib/oauth/auth.svelte.ts
src/lib/atproto/auth.svelte.ts
···
8
8
} from '@atcute/oauth-browser-client';
9
9
import { AppBskyActorDefs } from '@atcute/bluesky';
10
10
import type { ActorIdentifier, Did } from '@atcute/lexicons';
11
11
-
12
11
import {
13
12
CompositeDidDocumentResolver,
14
13
CompositeHandleResolver,
···
18
17
WebDidDocumentResolver,
19
18
WellKnownHandleResolver
20
19
} from '@atcute/identity-resolver';
21
21
-
22
20
import { Client } from '@atcute/client';
23
21
24
22
import { dev } from '$app/environment';
25
25
-
import { metadata } from './metadata';
26
23
import { replaceState } from '$app/navigation';
27
27
-
import { getDetailedProfile } from './atproto';
24
24
+
25
25
+
import { metadata } from './metadata';
26
26
+
import { getDetailedProfile } from './methods';
28
27
import { signUpPDS } from './settings';
29
28
30
29
export const user = $state({
-2
src/lib/oauth/index.ts
···
1
1
-
export { user, login, signup, logout, initClient } from './auth.svelte';
2
2
-
export { metadata } from './metadata';
src/lib/oauth/metadata.ts
src/lib/atproto/metadata.ts
src/lib/oauth/settings.ts
src/lib/atproto/settings.ts
+1
-1
src/routes/+layout.svelte
···
2
2
import '../app.css';
3
3
4
4
import { onMount } from 'svelte';
5
5
-
import { initClient } from '$lib/oauth';
5
5
+
import { initClient } from '$lib/atproto';
6
6
import LoginModal from '$lib/UI/LoginModal.svelte';
7
7
8
8
let { children } = $props();
+1
-1
src/routes/+page.svelte
···
1
1
<script lang="ts">
2
2
-
import { user, logout } from '$lib/oauth';
2
2
+
import { user, logout } from '$lib/atproto';
3
3
import Avatar from '$lib/UI/Avatar.svelte';
4
4
import Button from '$lib/UI/Button.svelte';
5
5
import { loginModalState } from '$lib/UI/LoginModal.svelte';