Bluesky app fork with some witchin' additions 馃挮
at main 64 lines 1.5 kB view raw
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 20export const deviceGeolocation: Geolocation | undefined = enabled 21 ? { 22 countryCode: 'AA', 23 regionCode: undefined, 24 } 25 : undefined 26 27export const config: AppBskyAgeassuranceDefs.Config = { 28 regions: [ 29 { 30 countryCode: 'AA', 31 regionCode: undefined, 32 rules: [ 33 { 34 $type: ids.Default, 35 access: 'full', 36 }, 37 ], 38 }, 39 ], 40} 41 42export const otherRequiredData: OtherRequiredData = { 43 birthdate: new Date(2000, 1, 1).toISOString(), 44} 45 46const serverStateEnabled = false 47export const serverState: AppBskyAgeassuranceGetState.OutputSchema | undefined = 48 serverStateEnabled 49 ? { 50 state: { 51 lastInitiatedAt: new Date(2025, 1, 1).toISOString(), 52 status: 'assured', 53 access: 'full', 54 }, 55 metadata: { 56 accountCreatedAt: new Date(2023, 1, 1).toISOString(), 57 }, 58 } 59 : undefined 60 61export async function resolve<T>(data: T) { 62 await new Promise(y => setTimeout(y, 500)) // simulate network 63 return data 64}