From d683a03a86650c067ac462f42d69649947168517 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 29 Jun 2026 19:26:18 -0500 Subject: [PATCH] Bump @atproto/api to 0.20.23, drop temporary AA config types 0.20.23 ships `additionalVerificationMethods` on the generated ConfigRegion type, so the client-side AgeAssuranceConfigRegion intersection and AgeAssuranceVerificationMethod alias are no longer needed. Read the field directly off the generated type and type the debug config as AppBskyAgeassuranceDefs.Config. Co-Authored-By: Claude Opus 4.8 --- package.json | 2 +- pnpm-lock.yaml | 71 ++++++++++++++++++++++----------------- src/ageAssurance/debug.ts | 14 ++------ src/ageAssurance/types.ts | 30 +---------------- src/ageAssurance/util.ts | 14 +++----- 5 files changed, 48 insertions(+), 83 deletions(-) diff --git a/package.json b/package.json index 02c01115fd..2aab97de32 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "update-actions": "pnpm dlx actions-up --min-age 7" }, "dependencies": { - "@atproto/api": "0.20.15", + "@atproto/api": "0.20.23", "@atproto/syntax": "0.6.1", "@bitdrift/react-native": "^0.6.8", "@braintree/sanitize-url": "^6.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e68525408..db9a694051 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -242,8 +242,8 @@ importers: .: dependencies: '@atproto/api': - specifier: 0.20.15 - version: 0.20.15 + specifier: 0.20.23 + version: 0.20.23 '@atproto/syntax': specifier: 0.6.1 version: 0.6.1 @@ -877,32 +877,36 @@ packages: graphql: optional: true - '@atproto/api@0.20.15': - resolution: {integrity: sha512-b9TuVNY9iWIaRXAeKegNCqRsK9tSpB68DE/j/ytVTxEMK+/m43B0DycJND9tnhRiNIY+i7MhwLqNHPak9YaDJg==} + '@atproto/api@0.20.23': + resolution: {integrity: sha512-0m484Sm9+Dr+52qgb63ARnq5sjK6DlzuBYnHh9f27jTxpNdY9NzLkejVrb5QZef3gr5mSgL4aRRQ3s4rBP1ZGQ==} engines: {node: '>=22'} - '@atproto/common-web@0.5.0': - resolution: {integrity: sha512-ReWnkuZdDU/74/I47gaI26uxQjHmpq4edp41NnZZQ5vIIKGb7Ei6pZHzDTUD9JURo109SKrPx9RMP2IQm0fOKA==} + '@atproto/common-web@0.5.2': + resolution: {integrity: sha512-oO0JEvM7MM7iXMngq6V51IJlzBZFhFJoDjnGnQT75EO94/8Q5hnM/LP+a8KyWjcBcpcSZwQ0bukNv9phZONdGA==} engines: {node: '>=22'} - '@atproto/lex-data@0.1.1': - resolution: {integrity: sha512-/xza8nU/YhtzhETnHL3QKKofaJ28/0NCzhT7LaYoUkm8EgypWp5ykEtmW52yLhQM2JF6fVa25g1soQmNTGqtSg==} + '@atproto/lex-data@0.1.3': + resolution: {integrity: sha512-ysqMYW6cIKce52/+EIbTa+I4pLqZQSBP9aGImN88vAQtd1oZBKPmut6dQk00xSQ8PW9REJRuIHNSFAF4HD+fsw==} engines: {node: '>=22'} - '@atproto/lex-json@0.1.0': - resolution: {integrity: sha512-oWUrRMwFyWpmi/5k1Se3xBTbP06XdxBS5iFuUz9LmqItaPXwrWRD87a9ldPvINQ/A2/mn7J6/qug8sDVlhD+vQ==} + '@atproto/lex-json@0.1.2': + resolution: {integrity: sha512-58nIjoWX0c8T5fcoPPmIaShxKZgfPMhNmrprtR7GuN4PzyMwm59A3CLlKAzzR+vjI3IidEMU+enpLuwUT8L+Nw==} engines: {node: '>=22'} - '@atproto/lexicon@0.7.1': - resolution: {integrity: sha512-voNfNED5KUxn3vpo7N5DMRblBDfWf7kSfdKhJFC1RrLCxg38YbBzzURNVQJ32bp13Oot8kYfyXBWxTgtKLvw8w==} + '@atproto/lexicon@0.7.3': + resolution: {integrity: sha512-WP6ct2rjNCKSJN/VFc+8x6JQ7PvRMlfHUlmQM5hzvE3a6nOjm6kwSicjSIV/QldurdRGJ4FCQZ3uZu9Wqt4SxQ==} engines: {node: '>=22'} '@atproto/syntax@0.6.1': resolution: {integrity: sha512-kA4dQDoMPpWCH8N0Q4KoSq024u5MkVfDVa8DdhyLjGA72z/khbOf1jXKPv7NIL2oEc9aj7geKELdvqyf4ogopA==} engines: {node: '>=22'} - '@atproto/xrpc@0.8.0': - resolution: {integrity: sha512-NJy02bIKrWlE2NQkRV1kT0Cj0ixbuxlF/MejBdo4cPWAa9v3oZexvAcjjb0zaOYeABkaU14iyIhvn2G4e/oLpw==} + '@atproto/syntax@0.6.3': + resolution: {integrity: sha512-io7Ck4o+40iFXhetHYoEtok2gZ8cWcJ1yRftEHe5AmAF0dSGcYmclbx5GatVew59taw+eSG7Ty5D3llop/0BhA==} + engines: {node: '>=22'} + + '@atproto/xrpc@0.8.2': + resolution: {integrity: sha512-geLqJwazZuCGnae68KZppciS8DujhGvYtpc/aAj16XpHkUCf5Ds64H1IPrV0uv7SFvd/IAuMZAXZS4GIpfp1iw==} engines: {node: '>=22'} '@babel/code-frame@7.10.4': @@ -9470,40 +9474,40 @@ snapshots: '@0no-co/graphql.web@1.2.0': {} - '@atproto/api@0.20.15': + '@atproto/api@0.20.23': dependencies: - '@atproto/common-web': 0.5.0 - '@atproto/lexicon': 0.7.1 - '@atproto/syntax': 0.6.1 - '@atproto/xrpc': 0.8.0 + '@atproto/common-web': 0.5.2 + '@atproto/lexicon': 0.7.3 + '@atproto/syntax': 0.6.3 + '@atproto/xrpc': 0.8.2 await-lock: 3.0.0 multiformats: 13.4.2 tlds: 1.261.0 zod: 3.25.76 - '@atproto/common-web@0.5.0': + '@atproto/common-web@0.5.2': dependencies: - '@atproto/lex-data': 0.1.1 - '@atproto/lex-json': 0.1.0 - '@atproto/syntax': 0.6.1 + '@atproto/lex-data': 0.1.3 + '@atproto/lex-json': 0.1.2 + '@atproto/syntax': 0.6.3 zod: 3.25.76 - '@atproto/lex-data@0.1.1': + '@atproto/lex-data@0.1.3': dependencies: multiformats: 13.4.2 tslib: 2.8.1 uint8arrays: 5.1.1 unicode-segmenter: 0.14.5 - '@atproto/lex-json@0.1.0': + '@atproto/lex-json@0.1.2': dependencies: - '@atproto/lex-data': 0.1.1 + '@atproto/lex-data': 0.1.3 tslib: 2.8.1 - '@atproto/lexicon@0.7.1': + '@atproto/lexicon@0.7.3': dependencies: - '@atproto/common-web': 0.5.0 - '@atproto/syntax': 0.6.1 + '@atproto/common-web': 0.5.2 + '@atproto/syntax': 0.6.3 multiformats: 13.4.2 zod: 3.25.76 @@ -9512,9 +9516,14 @@ snapshots: iso-datestring-validator: 2.2.2 tslib: 2.8.1 - '@atproto/xrpc@0.8.0': + '@atproto/syntax@0.6.3': dependencies: - '@atproto/lexicon': 0.7.1 + iso-datestring-validator: 2.2.2 + tslib: 2.8.1 + + '@atproto/xrpc@0.8.2': + dependencies: + '@atproto/lexicon': 0.7.3 zod: 3.25.76 '@babel/code-frame@7.10.4': diff --git a/src/ageAssurance/debug.ts b/src/ageAssurance/debug.ts index d1b9997fa2..49a2269351 100644 --- a/src/ageAssurance/debug.ts +++ b/src/ageAssurance/debug.ts @@ -1,24 +1,14 @@ import type * as AgeRange from 'expo-age-range' import { ageAssuranceRuleIDs as ids, + type AppBskyAgeassuranceDefs, type AppBskyAgeassuranceGetState, } from '@atproto/api' import {type OtherRequiredData} from '#/ageAssurance/data' -import {type AgeAssuranceConfigRegion} from '#/ageAssurance/types' import {IS_DEV, IS_E2E} from '#/env' import {type Geolocation} from '#/geolocation' -/** - * Debug-only config shape. Mirrors {@link AppBskyAgeassuranceDefs.Config} but - * uses {@link AgeAssuranceConfigRegion}, which carries the not-yet-in-lexicon - * `additionalVerificationMethods` field so we can prototype on-device - * verification. - */ -export type DebugConfig = { - regions: AgeAssuranceConfigRegion[] -} - export const enabled = (IS_DEV && false) || IS_E2E export const geolocation: Geolocation | undefined = enabled @@ -57,7 +47,7 @@ export const serverState: AppBskyAgeassuranceGetState.OutputSchema | undefined = } : undefined -export const config: DebugConfig = { +export const config: AppBskyAgeassuranceDefs.Config = { regions: [ { countryCode: 'AA', diff --git a/src/ageAssurance/types.ts b/src/ageAssurance/types.ts index adf536b66b..9c132295b4 100644 --- a/src/ageAssurance/types.ts +++ b/src/ageAssurance/types.ts @@ -1,36 +1,8 @@ import type * as AgeRange from 'expo-age-range' -import { - type AppBskyAgeassuranceDefs, - type computeAgeAssuranceRegionAccess, -} from '@atproto/api' +import {type computeAgeAssuranceRegionAccess} from '@atproto/api' import {logger} from '#/ageAssurance/logger' -/** - * Verification methods permitted in a region *in addition to* the third-party - * (KWS) flow, which is always supported. We deliberately don't model `kws` here - * so a region can never be configured as device-only (which would lock out web - * and any platform without the native age API). - * - * - `device`: native on-device age APIs (Apple Declared Age Range / Google - * Play Age Signals), surfaced via `expo-age-range`. - * - * NOTE: this is not yet part of the `app.bsky.ageassurance` lexicon. It's - * modeled client-side (see {@link AgeAssuranceConfigRegion}) while we prototype - * the shape. Once the lexicon adds `additionalVerificationMethods`, this can be - * removed in favor of the generated type. - */ -export type AgeAssuranceVerificationMethod = 'device' - -/** - * A region config extended with the (not-yet-in-lexicon) - * `additionalVerificationMethods` field. Regions without the field support only - * the always-available KWS flow. - */ -export type AgeAssuranceConfigRegion = AppBskyAgeassuranceDefs.ConfigRegion & { - additionalVerificationMethods?: AgeAssuranceVerificationMethod[] -} - /** * Native on-device age signals, keyed by the region (a `country[-region]` * string, see `createRegionKey`) they were captured in. We keep one entry per diff --git a/src/ageAssurance/util.ts b/src/ageAssurance/util.ts index dc80dd88eb..2c5ff860ba 100644 --- a/src/ageAssurance/util.ts +++ b/src/ageAssurance/util.ts @@ -12,11 +12,9 @@ import {FALLBACK_REGION_CONFIG, MIN_ACCESS_AGE} from '#/ageAssurance/const' import {useAgeAssuranceServerDataContext} from '#/ageAssurance/data' import { AgeAssuranceAccess, - type AgeAssuranceConfigRegion, type AgeAssuranceFlags, type AgeAssuranceMetadata, type AgeAssuranceState, - type AgeAssuranceVerificationMethod, } from '#/ageAssurance/types' import {type Geolocation, useGeolocation} from '#/geolocation' @@ -43,17 +41,13 @@ export function getAgeAssuranceRegionConfigWithFallback( * Returns the verification methods permitted for a region *in addition to* the * always-supported KWS flow. Empty when the region doesn't specify any (the * historical KWS-only behavior). - * - * NOTE: `additionalVerificationMethods` is not yet part of the lexicon, so we - * read it via {@link AgeAssuranceConfigRegion}. See that type for the migration - * note. */ export function getRegionAdditionalVerificationMethods( region: AppBskyAgeassuranceDefs.ConfigRegion, -): AgeAssuranceVerificationMethod[] { - return ( - (region as AgeAssuranceConfigRegion).additionalVerificationMethods ?? [] - ) +): NonNullable< + AppBskyAgeassuranceDefs.ConfigRegion['additionalVerificationMethods'] +> { + return region.additionalVerificationMethods ?? [] } /**