TypeScript SDK 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,
type GeoJSONAPIFeature,
type GeoJSONFeatureProperties,
type APIRecordFilter,
type 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();
}
// Use enums for filter operators
const filter: APIRecordFilter = {
type: APIFilterType.TEXT,
column: 'name',
search: 'example',
operator: APIFilterOperator.AND,
};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/ORoperators (enum)APIFilterType-GEO/MULTI/TEXTfilter types (enum)APIPoint- Geographic coordinates (lat/lng)APIGeocodeResult- Geocoding metadataGeoJSONAPIErrorResponse- Error response structure
For detailed usage examples, see the API documentation.
MIT