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 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -94,7 +94,7 @@
|
|||||||
"update-actions": "pnpm dlx actions-up --min-age 7"
|
"update-actions": "pnpm dlx actions-up --min-age 7"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@atproto/api": "0.20.15",
|
"@atproto/api": "0.20.23",
|
||||||
"@atproto/syntax": "0.6.1",
|
"@atproto/syntax": "0.6.1",
|
||||||
"@bitdrift/react-native": "^0.6.8",
|
"@bitdrift/react-native": "^0.6.8",
|
||||||
"@braintree/sanitize-url": "^6.0.2",
|
"@braintree/sanitize-url": "^6.0.2",
|
||||||
|
|||||||
Generated
+40
-31
@@ -242,8 +242,8 @@ importers:
|
|||||||
.:
|
.:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@atproto/api':
|
'@atproto/api':
|
||||||
specifier: 0.20.15
|
specifier: 0.20.23
|
||||||
version: 0.20.15
|
version: 0.20.23
|
||||||
'@atproto/syntax':
|
'@atproto/syntax':
|
||||||
specifier: 0.6.1
|
specifier: 0.6.1
|
||||||
version: 0.6.1
|
version: 0.6.1
|
||||||
@@ -877,32 +877,36 @@ packages:
|
|||||||
graphql:
|
graphql:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@atproto/api@0.20.15':
|
'@atproto/api@0.20.23':
|
||||||
resolution: {integrity: sha512-b9TuVNY9iWIaRXAeKegNCqRsK9tSpB68DE/j/ytVTxEMK+/m43B0DycJND9tnhRiNIY+i7MhwLqNHPak9YaDJg==}
|
resolution: {integrity: sha512-0m484Sm9+Dr+52qgb63ARnq5sjK6DlzuBYnHh9f27jTxpNdY9NzLkejVrb5QZef3gr5mSgL4aRRQ3s4rBP1ZGQ==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@atproto/common-web@0.5.0':
|
'@atproto/common-web@0.5.2':
|
||||||
resolution: {integrity: sha512-ReWnkuZdDU/74/I47gaI26uxQjHmpq4edp41NnZZQ5vIIKGb7Ei6pZHzDTUD9JURo109SKrPx9RMP2IQm0fOKA==}
|
resolution: {integrity: sha512-oO0JEvM7MM7iXMngq6V51IJlzBZFhFJoDjnGnQT75EO94/8Q5hnM/LP+a8KyWjcBcpcSZwQ0bukNv9phZONdGA==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@atproto/lex-data@0.1.1':
|
'@atproto/lex-data@0.1.3':
|
||||||
resolution: {integrity: sha512-/xza8nU/YhtzhETnHL3QKKofaJ28/0NCzhT7LaYoUkm8EgypWp5ykEtmW52yLhQM2JF6fVa25g1soQmNTGqtSg==}
|
resolution: {integrity: sha512-ysqMYW6cIKce52/+EIbTa+I4pLqZQSBP9aGImN88vAQtd1oZBKPmut6dQk00xSQ8PW9REJRuIHNSFAF4HD+fsw==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@atproto/lex-json@0.1.0':
|
'@atproto/lex-json@0.1.2':
|
||||||
resolution: {integrity: sha512-oWUrRMwFyWpmi/5k1Se3xBTbP06XdxBS5iFuUz9LmqItaPXwrWRD87a9ldPvINQ/A2/mn7J6/qug8sDVlhD+vQ==}
|
resolution: {integrity: sha512-58nIjoWX0c8T5fcoPPmIaShxKZgfPMhNmrprtR7GuN4PzyMwm59A3CLlKAzzR+vjI3IidEMU+enpLuwUT8L+Nw==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@atproto/lexicon@0.7.1':
|
'@atproto/lexicon@0.7.3':
|
||||||
resolution: {integrity: sha512-voNfNED5KUxn3vpo7N5DMRblBDfWf7kSfdKhJFC1RrLCxg38YbBzzURNVQJ32bp13Oot8kYfyXBWxTgtKLvw8w==}
|
resolution: {integrity: sha512-WP6ct2rjNCKSJN/VFc+8x6JQ7PvRMlfHUlmQM5hzvE3a6nOjm6kwSicjSIV/QldurdRGJ4FCQZ3uZu9Wqt4SxQ==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@atproto/syntax@0.6.1':
|
'@atproto/syntax@0.6.1':
|
||||||
resolution: {integrity: sha512-kA4dQDoMPpWCH8N0Q4KoSq024u5MkVfDVa8DdhyLjGA72z/khbOf1jXKPv7NIL2oEc9aj7geKELdvqyf4ogopA==}
|
resolution: {integrity: sha512-kA4dQDoMPpWCH8N0Q4KoSq024u5MkVfDVa8DdhyLjGA72z/khbOf1jXKPv7NIL2oEc9aj7geKELdvqyf4ogopA==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@atproto/xrpc@0.8.0':
|
'@atproto/syntax@0.6.3':
|
||||||
resolution: {integrity: sha512-NJy02bIKrWlE2NQkRV1kT0Cj0ixbuxlF/MejBdo4cPWAa9v3oZexvAcjjb0zaOYeABkaU14iyIhvn2G4e/oLpw==}
|
resolution: {integrity: sha512-io7Ck4o+40iFXhetHYoEtok2gZ8cWcJ1yRftEHe5AmAF0dSGcYmclbx5GatVew59taw+eSG7Ty5D3llop/0BhA==}
|
||||||
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
|
'@atproto/xrpc@0.8.2':
|
||||||
|
resolution: {integrity: sha512-geLqJwazZuCGnae68KZppciS8DujhGvYtpc/aAj16XpHkUCf5Ds64H1IPrV0uv7SFvd/IAuMZAXZS4GIpfp1iw==}
|
||||||
engines: {node: '>=22'}
|
engines: {node: '>=22'}
|
||||||
|
|
||||||
'@babel/code-frame@7.10.4':
|
'@babel/code-frame@7.10.4':
|
||||||
@@ -9470,40 +9474,40 @@ snapshots:
|
|||||||
|
|
||||||
'@0no-co/graphql.web@1.2.0': {}
|
'@0no-co/graphql.web@1.2.0': {}
|
||||||
|
|
||||||
'@atproto/api@0.20.15':
|
'@atproto/api@0.20.23':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@atproto/common-web': 0.5.0
|
'@atproto/common-web': 0.5.2
|
||||||
'@atproto/lexicon': 0.7.1
|
'@atproto/lexicon': 0.7.3
|
||||||
'@atproto/syntax': 0.6.1
|
'@atproto/syntax': 0.6.3
|
||||||
'@atproto/xrpc': 0.8.0
|
'@atproto/xrpc': 0.8.2
|
||||||
await-lock: 3.0.0
|
await-lock: 3.0.0
|
||||||
multiformats: 13.4.2
|
multiformats: 13.4.2
|
||||||
tlds: 1.261.0
|
tlds: 1.261.0
|
||||||
zod: 3.25.76
|
zod: 3.25.76
|
||||||
|
|
||||||
'@atproto/common-web@0.5.0':
|
'@atproto/common-web@0.5.2':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@atproto/lex-data': 0.1.1
|
'@atproto/lex-data': 0.1.3
|
||||||
'@atproto/lex-json': 0.1.0
|
'@atproto/lex-json': 0.1.2
|
||||||
'@atproto/syntax': 0.6.1
|
'@atproto/syntax': 0.6.3
|
||||||
zod: 3.25.76
|
zod: 3.25.76
|
||||||
|
|
||||||
'@atproto/lex-data@0.1.1':
|
'@atproto/lex-data@0.1.3':
|
||||||
dependencies:
|
dependencies:
|
||||||
multiformats: 13.4.2
|
multiformats: 13.4.2
|
||||||
tslib: 2.8.1
|
tslib: 2.8.1
|
||||||
uint8arrays: 5.1.1
|
uint8arrays: 5.1.1
|
||||||
unicode-segmenter: 0.14.5
|
unicode-segmenter: 0.14.5
|
||||||
|
|
||||||
'@atproto/lex-json@0.1.0':
|
'@atproto/lex-json@0.1.2':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@atproto/lex-data': 0.1.1
|
'@atproto/lex-data': 0.1.3
|
||||||
tslib: 2.8.1
|
tslib: 2.8.1
|
||||||
|
|
||||||
'@atproto/lexicon@0.7.1':
|
'@atproto/lexicon@0.7.3':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@atproto/common-web': 0.5.0
|
'@atproto/common-web': 0.5.2
|
||||||
'@atproto/syntax': 0.6.1
|
'@atproto/syntax': 0.6.3
|
||||||
multiformats: 13.4.2
|
multiformats: 13.4.2
|
||||||
zod: 3.25.76
|
zod: 3.25.76
|
||||||
|
|
||||||
@@ -9512,9 +9516,14 @@ snapshots:
|
|||||||
iso-datestring-validator: 2.2.2
|
iso-datestring-validator: 2.2.2
|
||||||
tslib: 2.8.1
|
tslib: 2.8.1
|
||||||
|
|
||||||
'@atproto/xrpc@0.8.0':
|
'@atproto/syntax@0.6.3':
|
||||||
dependencies:
|
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
|
zod: 3.25.76
|
||||||
|
|
||||||
'@babel/code-frame@7.10.4':
|
'@babel/code-frame@7.10.4':
|
||||||
|
|||||||
@@ -1,24 +1,14 @@
|
|||||||
import type * as AgeRange from 'expo-age-range'
|
import type * as AgeRange from 'expo-age-range'
|
||||||
import {
|
import {
|
||||||
ageAssuranceRuleIDs as ids,
|
ageAssuranceRuleIDs as ids,
|
||||||
|
type AppBskyAgeassuranceDefs,
|
||||||
type AppBskyAgeassuranceGetState,
|
type AppBskyAgeassuranceGetState,
|
||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
|
|
||||||
import {type OtherRequiredData} from '#/ageAssurance/data'
|
import {type OtherRequiredData} from '#/ageAssurance/data'
|
||||||
import {type AgeAssuranceConfigRegion} from '#/ageAssurance/types'
|
|
||||||
import {IS_DEV, IS_E2E} from '#/env'
|
import {IS_DEV, IS_E2E} from '#/env'
|
||||||
import {type Geolocation} from '#/geolocation'
|
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 enabled = (IS_DEV && false) || IS_E2E
|
||||||
|
|
||||||
export const geolocation: Geolocation | undefined = enabled
|
export const geolocation: Geolocation | undefined = enabled
|
||||||
@@ -57,7 +47,7 @@ export const serverState: AppBskyAgeassuranceGetState.OutputSchema | undefined =
|
|||||||
}
|
}
|
||||||
: undefined
|
: undefined
|
||||||
|
|
||||||
export const config: DebugConfig = {
|
export const config: AppBskyAgeassuranceDefs.Config = {
|
||||||
regions: [
|
regions: [
|
||||||
{
|
{
|
||||||
countryCode: 'AA',
|
countryCode: 'AA',
|
||||||
|
|||||||
@@ -1,36 +1,8 @@
|
|||||||
import type * as AgeRange from 'expo-age-range'
|
import type * as AgeRange from 'expo-age-range'
|
||||||
import {
|
import {type computeAgeAssuranceRegionAccess} from '@atproto/api'
|
||||||
type AppBskyAgeassuranceDefs,
|
|
||||||
type computeAgeAssuranceRegionAccess,
|
|
||||||
} from '@atproto/api'
|
|
||||||
|
|
||||||
import {logger} from '#/ageAssurance/logger'
|
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]`
|
* Native on-device age signals, keyed by the region (a `country[-region]`
|
||||||
* string, see `createRegionKey`) they were captured in. We keep one entry per
|
* string, see `createRegionKey`) they were captured in. We keep one entry per
|
||||||
|
|||||||
@@ -12,11 +12,9 @@ import {FALLBACK_REGION_CONFIG, MIN_ACCESS_AGE} from '#/ageAssurance/const'
|
|||||||
import {useAgeAssuranceServerDataContext} from '#/ageAssurance/data'
|
import {useAgeAssuranceServerDataContext} from '#/ageAssurance/data'
|
||||||
import {
|
import {
|
||||||
AgeAssuranceAccess,
|
AgeAssuranceAccess,
|
||||||
type AgeAssuranceConfigRegion,
|
|
||||||
type AgeAssuranceFlags,
|
type AgeAssuranceFlags,
|
||||||
type AgeAssuranceMetadata,
|
type AgeAssuranceMetadata,
|
||||||
type AgeAssuranceState,
|
type AgeAssuranceState,
|
||||||
type AgeAssuranceVerificationMethod,
|
|
||||||
} from '#/ageAssurance/types'
|
} from '#/ageAssurance/types'
|
||||||
import {type Geolocation, useGeolocation} from '#/geolocation'
|
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
|
* 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
|
* always-supported KWS flow. Empty when the region doesn't specify any (the
|
||||||
* historical KWS-only behavior).
|
* 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(
|
export function getRegionAdditionalVerificationMethods(
|
||||||
region: AppBskyAgeassuranceDefs.ConfigRegion,
|
region: AppBskyAgeassuranceDefs.ConfigRegion,
|
||||||
): AgeAssuranceVerificationMethod[] {
|
): NonNullable<
|
||||||
return (
|
AppBskyAgeassuranceDefs.ConfigRegion['additionalVerificationMethods']
|
||||||
(region as AgeAssuranceConfigRegion).additionalVerificationMethods ?? []
|
> {
|
||||||
)
|
return region.additionalVerificationMethods ?? []
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user