+6
-61
@@ -661,68 +661,13 @@ interface Pagination { | ||
| /** | ||
| * Gets economic indicators for a municipality. | ||
| * | ||
| * Retrieves detailed economic data including PIB breakdown by sector | ||
| * (agriculture, industry, services) and tax revenue. | ||
| * | ||
| * @param ibgeCode - The 7-digit IBGE municipality code | ||
| * @param options - Request options (timeout, AbortSignal) | ||
| * @returns Economic data for the municipality | ||
| * @throws {NotFoundError} If the municipality is not found | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * const economic = await client.getMunicipalityEconomic('3550308'); | ||
| * console.log(`PIB: R$ ${economic.pib.toLocaleString()}`); | ||
| * console.log(`Services: ${(economic.services / economic.pib * 100).toFixed(1)}%`); | ||
| * ``` | ||
| * @deprecated This endpoint does not exist in the API. Use getMunicipality() instead. | ||
| */ | ||
| getMunicipalityEconomic(ibgeCode: string, options?: RequestOptions): Promise<EconomicData>; | ||
| getMunicipalityEconomic(ibgeCode: string, _options?: RequestOptions): Promise<EconomicData>; | ||
| /** | ||
| * Gets infrastructure indicators for a municipality. | ||
| * | ||
| * Retrieves infrastructure data including water coverage, sewage treatment, | ||
| * water loss rates, and internet/fiber coverage. | ||
| * | ||
| * @param ibgeCode - The 7-digit IBGE municipality code | ||
| * @param options - Request options (timeout, AbortSignal) | ||
| * @returns Infrastructure data for the municipality | ||
| * @throws {NotFoundError} If the municipality is not found | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * const infra = await client.getMunicipalityInfrastructure('3550308'); | ||
| * console.log(`Water coverage: ${infra.water_coverage}%`); | ||
| * console.log(`Water loss: ${infra.water_loss}%`); | ||
| * ``` | ||
| * @deprecated This endpoint does not exist in the API. Use getMunicipality() instead. | ||
| */ | ||
| getMunicipalityInfrastructure(ibgeCode: string, options?: RequestOptions): Promise<InfrastructureData>; | ||
| getMunicipalityInfrastructure(ibgeCode: string, _options?: RequestOptions): Promise<InfrastructureData>; | ||
| /** | ||
| * Gets a ranking of municipalities by a specific indicator. | ||
| * | ||
| * Returns municipalities ranked by indicators such as PIB per capita, | ||
| * population, or infrastructure metrics. | ||
| * | ||
| * @param indicator - The indicator to rank by (e.g., "pib_per_capita", "population") | ||
| * @param params - Filter and pagination parameters | ||
| * @param params.state - Filter by state UF code | ||
| * @param params.year - Filter by year | ||
| * @param params.limit - Maximum results (default: 10) | ||
| * @param params.order - Sort order: "asc" or "desc" (default: "desc") | ||
| * @param options - Request options (timeout, AbortSignal) | ||
| * @returns Array of ranking entries with position, municipality, and value | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * // Get top 5 cities by PIB per capita in SP | ||
| * const ranking = await client.getIndicatorsRanking('pib_per_capita', { | ||
| * state: 'SP', | ||
| * limit: 5, | ||
| * order: 'desc', | ||
| * }); | ||
| * ranking.forEach(entry => { | ||
| * console.log(`${entry.position}. ${entry.name}: R$ ${entry.value}`); | ||
| * }); | ||
| * ``` | ||
| * @deprecated This endpoint does not exist in the API. | ||
| */ | ||
| getIndicatorsRanking(indicator: string, params?: RankingParams, options?: RequestOptions): Promise<RankingEntry[]>; | ||
| getIndicatorsRanking(_indicator: string, _params?: RankingParams, _options?: RequestOptions): Promise<RankingEntry[]>; | ||
| /** | ||
@@ -729,0 +674,0 @@ * Gets an overview of Brazilian agricultural exports (COMEX data). |
+6
-61
@@ -661,68 +661,13 @@ interface Pagination { | ||
| /** | ||
| * Gets economic indicators for a municipality. | ||
| * | ||
| * Retrieves detailed economic data including PIB breakdown by sector | ||
| * (agriculture, industry, services) and tax revenue. | ||
| * | ||
| * @param ibgeCode - The 7-digit IBGE municipality code | ||
| * @param options - Request options (timeout, AbortSignal) | ||
| * @returns Economic data for the municipality | ||
| * @throws {NotFoundError} If the municipality is not found | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * const economic = await client.getMunicipalityEconomic('3550308'); | ||
| * console.log(`PIB: R$ ${economic.pib.toLocaleString()}`); | ||
| * console.log(`Services: ${(economic.services / economic.pib * 100).toFixed(1)}%`); | ||
| * ``` | ||
| * @deprecated This endpoint does not exist in the API. Use getMunicipality() instead. | ||
| */ | ||
| getMunicipalityEconomic(ibgeCode: string, options?: RequestOptions): Promise<EconomicData>; | ||
| getMunicipalityEconomic(ibgeCode: string, _options?: RequestOptions): Promise<EconomicData>; | ||
| /** | ||
| * Gets infrastructure indicators for a municipality. | ||
| * | ||
| * Retrieves infrastructure data including water coverage, sewage treatment, | ||
| * water loss rates, and internet/fiber coverage. | ||
| * | ||
| * @param ibgeCode - The 7-digit IBGE municipality code | ||
| * @param options - Request options (timeout, AbortSignal) | ||
| * @returns Infrastructure data for the municipality | ||
| * @throws {NotFoundError} If the municipality is not found | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * const infra = await client.getMunicipalityInfrastructure('3550308'); | ||
| * console.log(`Water coverage: ${infra.water_coverage}%`); | ||
| * console.log(`Water loss: ${infra.water_loss}%`); | ||
| * ``` | ||
| * @deprecated This endpoint does not exist in the API. Use getMunicipality() instead. | ||
| */ | ||
| getMunicipalityInfrastructure(ibgeCode: string, options?: RequestOptions): Promise<InfrastructureData>; | ||
| getMunicipalityInfrastructure(ibgeCode: string, _options?: RequestOptions): Promise<InfrastructureData>; | ||
| /** | ||
| * Gets a ranking of municipalities by a specific indicator. | ||
| * | ||
| * Returns municipalities ranked by indicators such as PIB per capita, | ||
| * population, or infrastructure metrics. | ||
| * | ||
| * @param indicator - The indicator to rank by (e.g., "pib_per_capita", "population") | ||
| * @param params - Filter and pagination parameters | ||
| * @param params.state - Filter by state UF code | ||
| * @param params.year - Filter by year | ||
| * @param params.limit - Maximum results (default: 10) | ||
| * @param params.order - Sort order: "asc" or "desc" (default: "desc") | ||
| * @param options - Request options (timeout, AbortSignal) | ||
| * @returns Array of ranking entries with position, municipality, and value | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * // Get top 5 cities by PIB per capita in SP | ||
| * const ranking = await client.getIndicatorsRanking('pib_per_capita', { | ||
| * state: 'SP', | ||
| * limit: 5, | ||
| * order: 'desc', | ||
| * }); | ||
| * ranking.forEach(entry => { | ||
| * console.log(`${entry.position}. ${entry.name}: R$ ${entry.value}`); | ||
| * }); | ||
| * ``` | ||
| * @deprecated This endpoint does not exist in the API. | ||
| */ | ||
| getIndicatorsRanking(indicator: string, params?: RankingParams, options?: RequestOptions): Promise<RankingEntry[]>; | ||
| getIndicatorsRanking(_indicator: string, _params?: RankingParams, _options?: RequestOptions): Promise<RankingEntry[]>; | ||
| /** | ||
@@ -729,0 +674,0 @@ * Gets an overview of Brazilian agricultural exports (COMEX data). |
+21
-74
@@ -173,3 +173,3 @@ "use strict"; | ||
| // src/client.ts | ||
| var SDK_VERSION = "1.0.0"; | ||
| var SDK_VERSION = "1.2.0"; | ||
| var DEFAULT_BASE_URL = "https://api.infomance.com.br"; | ||
@@ -439,3 +439,3 @@ var InfomanceClient = class { | ||
| return this.request( | ||
| `/api/v1/indicators/municipalities${this.buildQuery(params || {})}`, | ||
| `/api/v1/geo/municipalities${this.buildQuery(params || {})}`, | ||
| options | ||
@@ -465,3 +465,3 @@ ); | ||
| return this.request( | ||
| `/api/v1/indicators/municipalities/${ibgeCode}`, | ||
| `/api/v1/cities/${ibgeCode}/profile`, | ||
| options | ||
@@ -471,82 +471,29 @@ ); | ||
| /** | ||
| * Gets economic indicators for a municipality. | ||
| * | ||
| * Retrieves detailed economic data including PIB breakdown by sector | ||
| * (agriculture, industry, services) and tax revenue. | ||
| * | ||
| * @param ibgeCode - The 7-digit IBGE municipality code | ||
| * @param options - Request options (timeout, AbortSignal) | ||
| * @returns Economic data for the municipality | ||
| * @throws {NotFoundError} If the municipality is not found | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * const economic = await client.getMunicipalityEconomic('3550308'); | ||
| * console.log(`PIB: R$ ${economic.pib.toLocaleString()}`); | ||
| * console.log(`Services: ${(economic.services / economic.pib * 100).toFixed(1)}%`); | ||
| * ``` | ||
| * @deprecated This endpoint does not exist in the API. Use getMunicipality() instead. | ||
| */ | ||
| async getMunicipalityEconomic(ibgeCode, options) { | ||
| return this.request( | ||
| `/api/v1/indicators/municipalities/${ibgeCode}/economic`, | ||
| options | ||
| async getMunicipalityEconomic(ibgeCode, _options) { | ||
| console.warn( | ||
| "getMunicipalityEconomic() is deprecated - endpoint does not exist. Use getMunicipality() instead." | ||
| ); | ||
| throw new NotFoundError( | ||
| "This endpoint does not exist. Use getMunicipality() for city profile data." | ||
| ); | ||
| } | ||
| /** | ||
| * Gets infrastructure indicators for a municipality. | ||
| * | ||
| * Retrieves infrastructure data including water coverage, sewage treatment, | ||
| * water loss rates, and internet/fiber coverage. | ||
| * | ||
| * @param ibgeCode - The 7-digit IBGE municipality code | ||
| * @param options - Request options (timeout, AbortSignal) | ||
| * @returns Infrastructure data for the municipality | ||
| * @throws {NotFoundError} If the municipality is not found | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * const infra = await client.getMunicipalityInfrastructure('3550308'); | ||
| * console.log(`Water coverage: ${infra.water_coverage}%`); | ||
| * console.log(`Water loss: ${infra.water_loss}%`); | ||
| * ``` | ||
| * @deprecated This endpoint does not exist in the API. Use getMunicipality() instead. | ||
| */ | ||
| async getMunicipalityInfrastructure(ibgeCode, options) { | ||
| return this.request( | ||
| `/api/v1/indicators/municipalities/${ibgeCode}/infrastructure`, | ||
| options | ||
| async getMunicipalityInfrastructure(ibgeCode, _options) { | ||
| console.warn( | ||
| "getMunicipalityInfrastructure() is deprecated - endpoint does not exist. Use getMunicipality() instead." | ||
| ); | ||
| throw new NotFoundError( | ||
| "This endpoint does not exist. Use getMunicipality() for city profile data." | ||
| ); | ||
| } | ||
| /** | ||
| * Gets a ranking of municipalities by a specific indicator. | ||
| * | ||
| * Returns municipalities ranked by indicators such as PIB per capita, | ||
| * population, or infrastructure metrics. | ||
| * | ||
| * @param indicator - The indicator to rank by (e.g., "pib_per_capita", "population") | ||
| * @param params - Filter and pagination parameters | ||
| * @param params.state - Filter by state UF code | ||
| * @param params.year - Filter by year | ||
| * @param params.limit - Maximum results (default: 10) | ||
| * @param params.order - Sort order: "asc" or "desc" (default: "desc") | ||
| * @param options - Request options (timeout, AbortSignal) | ||
| * @returns Array of ranking entries with position, municipality, and value | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * // Get top 5 cities by PIB per capita in SP | ||
| * const ranking = await client.getIndicatorsRanking('pib_per_capita', { | ||
| * state: 'SP', | ||
| * limit: 5, | ||
| * order: 'desc', | ||
| * }); | ||
| * ranking.forEach(entry => { | ||
| * console.log(`${entry.position}. ${entry.name}: R$ ${entry.value}`); | ||
| * }); | ||
| * ``` | ||
| * @deprecated This endpoint does not exist in the API. | ||
| */ | ||
| async getIndicatorsRanking(indicator, params, options) { | ||
| return this.request( | ||
| `/api/v1/indicators/ranking/${indicator}${this.buildQuery(params || {})}`, | ||
| options | ||
| ); | ||
| async getIndicatorsRanking(_indicator, _params, _options) { | ||
| console.warn("getIndicatorsRanking() is deprecated - endpoint does not exist."); | ||
| throw new NotFoundError("This endpoint does not exist."); | ||
| } | ||
@@ -553,0 +500,0 @@ // ============================================ |
+21
-74
@@ -133,3 +133,3 @@ // src/errors.ts | ||
| // src/client.ts | ||
| var SDK_VERSION = "1.0.0"; | ||
| var SDK_VERSION = "1.2.0"; | ||
| var DEFAULT_BASE_URL = "https://api.infomance.com.br"; | ||
@@ -399,3 +399,3 @@ var InfomanceClient = class { | ||
| return this.request( | ||
| `/api/v1/indicators/municipalities${this.buildQuery(params || {})}`, | ||
| `/api/v1/geo/municipalities${this.buildQuery(params || {})}`, | ||
| options | ||
@@ -425,3 +425,3 @@ ); | ||
| return this.request( | ||
| `/api/v1/indicators/municipalities/${ibgeCode}`, | ||
| `/api/v1/cities/${ibgeCode}/profile`, | ||
| options | ||
@@ -431,82 +431,29 @@ ); | ||
| /** | ||
| * Gets economic indicators for a municipality. | ||
| * | ||
| * Retrieves detailed economic data including PIB breakdown by sector | ||
| * (agriculture, industry, services) and tax revenue. | ||
| * | ||
| * @param ibgeCode - The 7-digit IBGE municipality code | ||
| * @param options - Request options (timeout, AbortSignal) | ||
| * @returns Economic data for the municipality | ||
| * @throws {NotFoundError} If the municipality is not found | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * const economic = await client.getMunicipalityEconomic('3550308'); | ||
| * console.log(`PIB: R$ ${economic.pib.toLocaleString()}`); | ||
| * console.log(`Services: ${(economic.services / economic.pib * 100).toFixed(1)}%`); | ||
| * ``` | ||
| * @deprecated This endpoint does not exist in the API. Use getMunicipality() instead. | ||
| */ | ||
| async getMunicipalityEconomic(ibgeCode, options) { | ||
| return this.request( | ||
| `/api/v1/indicators/municipalities/${ibgeCode}/economic`, | ||
| options | ||
| async getMunicipalityEconomic(ibgeCode, _options) { | ||
| console.warn( | ||
| "getMunicipalityEconomic() is deprecated - endpoint does not exist. Use getMunicipality() instead." | ||
| ); | ||
| throw new NotFoundError( | ||
| "This endpoint does not exist. Use getMunicipality() for city profile data." | ||
| ); | ||
| } | ||
| /** | ||
| * Gets infrastructure indicators for a municipality. | ||
| * | ||
| * Retrieves infrastructure data including water coverage, sewage treatment, | ||
| * water loss rates, and internet/fiber coverage. | ||
| * | ||
| * @param ibgeCode - The 7-digit IBGE municipality code | ||
| * @param options - Request options (timeout, AbortSignal) | ||
| * @returns Infrastructure data for the municipality | ||
| * @throws {NotFoundError} If the municipality is not found | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * const infra = await client.getMunicipalityInfrastructure('3550308'); | ||
| * console.log(`Water coverage: ${infra.water_coverage}%`); | ||
| * console.log(`Water loss: ${infra.water_loss}%`); | ||
| * ``` | ||
| * @deprecated This endpoint does not exist in the API. Use getMunicipality() instead. | ||
| */ | ||
| async getMunicipalityInfrastructure(ibgeCode, options) { | ||
| return this.request( | ||
| `/api/v1/indicators/municipalities/${ibgeCode}/infrastructure`, | ||
| options | ||
| async getMunicipalityInfrastructure(ibgeCode, _options) { | ||
| console.warn( | ||
| "getMunicipalityInfrastructure() is deprecated - endpoint does not exist. Use getMunicipality() instead." | ||
| ); | ||
| throw new NotFoundError( | ||
| "This endpoint does not exist. Use getMunicipality() for city profile data." | ||
| ); | ||
| } | ||
| /** | ||
| * Gets a ranking of municipalities by a specific indicator. | ||
| * | ||
| * Returns municipalities ranked by indicators such as PIB per capita, | ||
| * population, or infrastructure metrics. | ||
| * | ||
| * @param indicator - The indicator to rank by (e.g., "pib_per_capita", "population") | ||
| * @param params - Filter and pagination parameters | ||
| * @param params.state - Filter by state UF code | ||
| * @param params.year - Filter by year | ||
| * @param params.limit - Maximum results (default: 10) | ||
| * @param params.order - Sort order: "asc" or "desc" (default: "desc") | ||
| * @param options - Request options (timeout, AbortSignal) | ||
| * @returns Array of ranking entries with position, municipality, and value | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * // Get top 5 cities by PIB per capita in SP | ||
| * const ranking = await client.getIndicatorsRanking('pib_per_capita', { | ||
| * state: 'SP', | ||
| * limit: 5, | ||
| * order: 'desc', | ||
| * }); | ||
| * ranking.forEach(entry => { | ||
| * console.log(`${entry.position}. ${entry.name}: R$ ${entry.value}`); | ||
| * }); | ||
| * ``` | ||
| * @deprecated This endpoint does not exist in the API. | ||
| */ | ||
| async getIndicatorsRanking(indicator, params, options) { | ||
| return this.request( | ||
| `/api/v1/indicators/ranking/${indicator}${this.buildQuery(params || {})}`, | ||
| options | ||
| ); | ||
| async getIndicatorsRanking(_indicator, _params, _options) { | ||
| console.warn("getIndicatorsRanking() is deprecated - endpoint does not exist."); | ||
| throw new NotFoundError("This endpoint does not exist."); | ||
| } | ||
@@ -513,0 +460,0 @@ // ============================================ |
+1
-1
| { | ||
| "name": "infomance", | ||
| "version": "1.1.0", | ||
| "version": "1.2.0", | ||
| "description": "SDK oficial para a Infomance API - Dados socioeconômicos de municípios brasileiros", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
184516
-4.31%3762
-4.1%