da2bab21e5
Defense-in-depth banned-country gate covering every entry point that could set a location Feeld's policy disallows (~60 countries from their support article): - New src/config/bannedCountries.ts — single source of truth (ISO codes + aliases) - New src/utils/reverseGeocode.ts — Nominatim reverse lookup w/ localStorage cache - New src/api/links/bannedCountryLink.ts — Apollo link chokepoint; intercepts every DeviceLocationUpdate mutation and refuses to forward if reverse-geocode resolves to a banned country. Catches Settings, Discover, Likes scanner, and ApiExplorer raw GraphQL alike. - useLocation.tsx — setLocation throws BannedCountryError; saveLocation gate; sanitize banned entries on localStorage and server hydration - Settings.tsx — block at search, saved-location pick, and save-current - Likes.tsx — skip banned saved locations in scanForLikes and "Fuck It" scan - server/index.js — PUT /api/saved-locations filters; readSavedLocations filters legacy banned entries so rotation cron is safe too - nginx.conf — route additions for new backend endpoints Plus the broader rc/realign-graphql-ops session work: GraphQL query/mutation realignment after Feeld API changes, ApiExplorer updates, Profile/Discover/Likes refinements, useFavorites hook, dataSync extensions, vite proxy adjustments. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
74 lines
1.8 KiB
TypeScript
Executable File
74 lines
1.8 KiB
TypeScript
Executable File
import { gql } from '@apollo/client/core';
|
|
import {
|
|
DISCOVERY_ANALYTICS_METADATA_FRAGMENT,
|
|
LIKES_PROFILE_FRAGMENT,
|
|
PICTURE_FRAGMENT,
|
|
} from './queries';
|
|
|
|
// pastLikes / pastDislikes — shapes verbatim from live app v8.11.0.
|
|
// LikesProfileFragment lives in queries.ts (single source of truth, also used
|
|
// by FilteredWhoLikesMe / FilteredWhoPingsMe mutations).
|
|
|
|
export const PAST_LIKES_QUERY = gql`
|
|
${LIKES_PROFILE_FRAGMENT}
|
|
${DISCOVERY_ANALYTICS_METADATA_FRAGMENT}
|
|
${PICTURE_FRAGMENT}
|
|
query pastLikes($cursor: String, $input: PastLikesQueryInput!, $limit: Int) {
|
|
pastLikes(cursor: $cursor, input: $input, limit: $limit) {
|
|
nodes {
|
|
isPing
|
|
interactionSentAt
|
|
profile {
|
|
...LikesProfileFragment
|
|
...DiscoveryAnalyticsMetadata
|
|
photos {
|
|
...GetPictureUrlFragment
|
|
__typename
|
|
}
|
|
__typename
|
|
}
|
|
__typename
|
|
}
|
|
pageInfo {
|
|
hasNextPage
|
|
nextPageCursor
|
|
total
|
|
unfilteredTotal
|
|
__typename
|
|
}
|
|
__typename
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const PAST_DISLIKES_QUERY = gql`
|
|
${LIKES_PROFILE_FRAGMENT}
|
|
${DISCOVERY_ANALYTICS_METADATA_FRAGMENT}
|
|
${PICTURE_FRAGMENT}
|
|
query pastDislikes($cursor: String, $input: PastDislikesQueryInput!, $limit: Int) {
|
|
pastDislikes(cursor: $cursor, input: $input, limit: $limit) {
|
|
nodes {
|
|
interactionSentAt
|
|
profile {
|
|
...LikesProfileFragment
|
|
...DiscoveryAnalyticsMetadata
|
|
photos {
|
|
...GetPictureUrlFragment
|
|
__typename
|
|
}
|
|
__typename
|
|
}
|
|
__typename
|
|
}
|
|
pageInfo {
|
|
hasNextPage
|
|
nextPageCursor
|
|
total
|
|
unfilteredTotal
|
|
__typename
|
|
}
|
|
__typename
|
|
}
|
|
}
|
|
`;
|