TypeScript types for consuming the ts-mapped REST API.
Note: This package is automatically generated from the ts-mapped repository. Do not edit directly.
npm install github:commonknowledge/ts-mapped-sdk
# or if published to npm:
npm install @commonknowledge/ts-mapped-sdkimport type {
GeoJSONAPIResponse,
GeoJSONAPIFeature,
GeoJSONFeatureProperties,
APIRecordFilter,
APIRecordSort,
APIFilterOperator,
APIFilterType,
} from '@commonknowledge/ts-mapped-sdk';
// Fetch data with proper typing
async function fetchGeoJSON(dataSourceId: string): Promise<GeoJSONAPIResponse> {
const response = await fetch(
`https://your-instance.com/api/rest/data-sources/${dataSourceId}/geojson`,
{
headers: {
'Authorization': `Basic ${btoa('email:password')}`,
},
}
);
return response.json();
}GeoJSONAPIResponse- Main response type from the GeoJSON endpointGeoJSONAPIFeature- Individual feature in the responseGeoJSONFeatureProperties- Properties object for each featureAPIRecordFilter- Filter configuration for queryingAPIRecordSort- Sort configurationAPIFilterOperator-AND/ORoperatorsAPIFilterType-GEO/MULTI/TEXTfilter typesAPIPoint- Geographic coordinates (lat/lng)APIGeocodeResult- Geocoding metadataGeoJSONAPIErrorResponse- Error response structure
For detailed usage examples, see the API documentation.
MIT