psgc-mcp
Version:
Philippine Standard Geographic Code MCP Server - provides hierarchical geographic data for the Philippines
97 lines • 4.3 kB
TypeScript
/**
* Shared constants and configuration for PSGC API
*/
export declare const API_CONFIG: {
/** Base URL for PSGC API */
readonly BASE_URL: "https://psgc.gitlab.io/api";
/** Default timeout for API requests (in milliseconds) */
readonly DEFAULT_TIMEOUT: 30000;
/** Maximum retry attempts for failed requests */
readonly MAX_RETRIES: 3;
/** Retry delay (in milliseconds) */
readonly RETRY_DELAY: 1000;
/** Cache TTL (in milliseconds) */
readonly CACHE_TTL: number;
};
export declare const GEOGRAPHIC_CODES: {
/** Valid island group codes */
readonly ISLAND_GROUPS: readonly ["luzon", "visayas", "mindanao"];
/** Code pattern constants */
readonly PATTERNS: {
/** 9-digit numeric code */
readonly NINE_DIGIT: RegExp;
/** 9-digit code ending with 6 zeros (regions, provinces, districts) */
readonly SIX_ZEROS: RegExp;
/** 9-digit code ending with 3 zeros (cities, municipalities, sub-municipalities) */
readonly THREE_ZEROS: RegExp;
/** 9-digit code with no specific pattern (barangays) */
readonly BARANGAY: RegExp;
};
};
export declare const ENTITY_TYPES: {
readonly ISLAND_GROUP: "island-group";
readonly REGION: "region";
readonly PROVINCE: "province";
readonly DISTRICT: "district";
readonly CITY: "city";
readonly MUNICIPALITY: "municipality";
readonly CITY_MUNICIPALITY: "city-municipality";
readonly SUB_MUNICIPALITY: "sub-municipality";
readonly BARANGAY: "barangay";
};
export declare const API_ENDPOINTS: {
readonly ISLAND_GROUPS: "/island-groups.json";
readonly REGIONS: "/regions.json";
readonly PROVINCES: "/provinces.json";
readonly DISTRICTS: "/districts.json";
readonly CITIES: "/cities.json";
readonly MUNICIPALITIES: "/municipalities.json";
readonly SUB_MUNICIPALITIES: "/sub-municipalities.json";
readonly CITIES_MUNICIPALITIES: "/cities-municipalities.json";
readonly BARANGAYS: "/barangays.json";
};
export declare const ERROR_MESSAGES: {
readonly INVALID_CODE_FORMAT: "Invalid code format";
readonly INVALID_ISLAND_GROUP: "Invalid island group code. Must be one of: luzon, visayas, mindanao";
readonly INVALID_REGION_CODE: "Invalid region code format. Must be 9 digits ending with 6 zeros";
readonly INVALID_PROVINCE_CODE: "Invalid province code format. Must be 9 digits ending with 6 zeros";
readonly INVALID_DISTRICT_CODE: "Invalid district code format. Must be 9 digits ending with 6 zeros";
readonly INVALID_CITY_CODE: "Invalid city code format. Must be 9 digits ending with 3 zeros";
readonly INVALID_MUNICIPALITY_CODE: "Invalid municipality code format. Must be 9 digits ending with 3 zeros";
readonly INVALID_SUB_MUNICIPALITY_CODE: "Invalid sub-municipality code format. Must be 9 digits ending with 3 zeros";
readonly INVALID_CITY_MUNICIPALITY_CODE: "Invalid city/municipality code format. Must be 9 digits ending with 3 zeros";
readonly INVALID_BARANGAY_CODE: "Invalid barangay code format. Must be exactly 9 digits";
readonly EMPTY_SEARCH_NAME: "Search name cannot be empty";
readonly EMPTY_CODE: "Code cannot be empty";
readonly API_TIMEOUT: "API request timed out";
readonly API_ERROR: "API request failed";
readonly NETWORK_ERROR: "Network error occurred";
readonly NOT_FOUND: "Entity not found";
};
export declare const CONTENT_TYPES: {
readonly JSON: "application/json";
readonly HTML: "text/html";
};
export declare const CACHE_KEYS: {
readonly ISLAND_GROUPS: "island-groups";
readonly REGIONS: "regions";
readonly PROVINCES: "provinces";
readonly DISTRICTS: "districts";
readonly CITIES: "cities";
readonly MUNICIPALITIES: "municipalities";
readonly SUB_MUNICIPALITIES: "sub-municipalities";
readonly CITIES_MUNICIPALITIES: "cities-municipalities";
readonly BARANGAYS: "barangays";
};
export declare const RATE_LIMITS: {
/** Maximum requests per minute */
readonly MAX_REQUESTS_PER_MINUTE: 60;
/** Maximum concurrent requests */
readonly MAX_CONCURRENT_REQUESTS: 10;
};
export declare const PAGINATION: {
readonly DEFAULT_LIMIT: 50;
readonly MAX_LIMIT: 100;
readonly DEFAULT_OFFSET: 0;
};
//# sourceMappingURL=constants.d.ts.map