ropegeo-common
v1.7.0
Published
Shared types and utilities for RopeGeo and WebScraper
Readme
ropegeo-common
Shared types and utilities for RopeGeo and WebScraper. Published to npm as ropegeo-common so both projects can depend on a single set of types instead of duplicating code.
What’s in this package
- Page preview types –
PagePreview,Difficulty, and related enums used by the route preview API (e.g. GET /route/{routeId}/preview).PagePreviewincludes optionalpermit(PermitStatusenum: Yes, No, Restricted, Closed, or null). - Page data source –
PageDataSourceenum (e.g. Ropewiki) used when linking routes to pages. - Ropewiki page view types –
RopewikiPageView,RopewikiBetaSectionView, andRopewikiImageViewfor the getRopewikiPageView API (full Ropewiki page with beta sections and images).BetaSectionImageincludesid,downloadBytes(DownloadBytes: preview/banner/full byte sizes), and page-based pagination –PaginationResults/MapDataTileKeysResults(e.g.GET /mapdata/{mapDataId}/tileswithtotal,page,totalBytes). - Routes (GET /routes) –
Route,RouteType,RouteGeoJsonFeature, andRoutesGeojsonfor the routes GeoJSON Feature Collection API.RoutesGeojson.fromRoutes(routes)builds the response shape from an array ofRoute. - Search API types –
SearchResults(paginated search response withresults: Preview[]andnextCursor: string),RegionPreview(region search hit with id, name, parents, imageUrl, source), andPagePreview(page search hit; same type as route preview).
Usage
npm install ropegeo-commonimport {
PagePreview,
PageDataSource,
Difficulty,
DifficultyTechnical,
DifficultyWater,
DifficultyTime,
DifficultyRisk,
PermitStatus,
Route,
RouteType,
RoutesGeojson,
type RopewikiPageView,
type RopewikiBetaSectionView,
type RopewikiImageView,
type RegionPreview,
type SearchResults,
DownloadBytes,
PaginationResults,
MapDataTileKeysResults,
PaginationResultType,
} from 'ropegeo-common';Related repos
- RopeGeo – Expo app for canyoneering maps and route data.
- WebScraper – Lambdas and jobs that scrape canyoneering sites (e.g. Ropewiki), parse data, and store it for the API.
