Bluesky app fork with some witchin' additions 馃挮
witchsky.app
bluesky
fork
client
1import {
2 ageAssuranceRuleIDs as ids,
3 type AppBskyAgeassuranceDefs,
4 type AppBskyAgeassuranceGetState,
5} from '@atproto/api'
6
7import {type OtherRequiredData} from '#/ageAssurance/data'
8import {IS_DEV, IS_E2E} from '#/env'
9import {type Geolocation} from '#/geolocation'
10
11export const enabled = (IS_DEV && false) || IS_E2E
12
13export const geolocation: Geolocation | undefined = enabled
14 ? {
15 countryCode: 'AA',
16 regionCode: undefined,
17 }
18 : undefined
19
20const deviceGeolocationEnabled = false || IS_E2E
21export const deviceGeolocation: Geolocation | undefined =
22 enabled && deviceGeolocationEnabled
23 ? {
24 countryCode: 'AA',
25 regionCode: undefined,
26 }
27 : undefined
28
29export const config: AppBskyAgeassuranceDefs.Config = {
30 regions: [
31 {
32 countryCode: 'AA',
33 regionCode: undefined,
34 minAccessAge: 13,
35 rules: [
36 {
37 $type: ids.Default,
38 access: 'full',
39 },
40 ],
41 },
42 {
43 countryCode: 'BB',
44 regionCode: undefined,
45 minAccessAge: 16,
46 rules: [
47 {
48 $type: ids.Default,
49 access: 'full',
50 },
51 ],
52 },
53 ],
54}
55
56export const otherRequiredData: OtherRequiredData = {
57 birthdate: new Date(2000, 1, 1).toISOString(),
58}
59
60const serverStateEnabled = false
61export const serverState: AppBskyAgeassuranceGetState.OutputSchema | undefined =
62 serverStateEnabled
63 ? {
64 state: {
65 lastInitiatedAt: new Date(2025, 1, 1).toISOString(),
66 status: 'assured',
67 access: 'full',
68 },
69 metadata: {
70 accountCreatedAt: new Date(2023, 1, 1).toISOString(),
71 },
72 }
73 : undefined
74
75export async function resolve<T>(data: T) {
76 await new Promise(y => setTimeout(y, 500)) // simulate network
77 return data
78}