hubeau-api
Advanced tools
Comparing version 0.0.6 to 0.0.7
export declare const hostname = "hubeau.eaufrance.fr"; | ||
export declare const entryPoints: { | ||
etatPiscicole: string; | ||
indicateursServices: string; | ||
}; |
@@ -7,2 +7,3 @@ "use strict"; | ||
etatPiscicole: '/api/v0/etat_piscicole/', | ||
indicateursServices: '/api/v0/indicateurs_services/', | ||
}; |
@@ -6,8 +6,10 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const etatPiscicole_1 = __importDefault(require("./commands/etatPiscicole/etatPiscicole")); | ||
const etatPiscicole_1 = __importDefault(require("./commands/etatPiscicole")); | ||
const indicateursServices_1 = __importDefault(require("./commands/indicateursServices")); | ||
class HubeauApi { | ||
constructor() { | ||
this.etatPiscicole = (0, etatPiscicole_1.default)(); | ||
this.indicateursServices = (0, indicateursServices_1.default)(); | ||
} | ||
} | ||
module.exports = HubeauApi; |
@@ -1,3 +0,2 @@ | ||
declare type Mois = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; | ||
declare type Format = 'json' | 'geojson'; | ||
import { Format, Mois } from './communs'; | ||
export declare type CodeEspecePoissonParams = { | ||
@@ -36,2 +35,1 @@ code?: string; | ||
}; | ||
export {}; |
declare type Params = { | ||
[key: string]: string | string[] | number | number[]; | ||
[key: string]: string | string[] | number | number[] | boolean; | ||
}; | ||
export declare function objectToStringParameters(params: Params): string; | ||
export {}; |
{ | ||
"name": "hubeau-api", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "hubeau api wrapper in javascript", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -119,1 +119,33 @@ # HUBEAU API wrapper | ||
} | ||
### Indicateurs services | ||
_communes_ | ||
async function communes() { | ||
const params = { | ||
annee: 2019, | ||
page: 1, | ||
type_service: 'AEP', | ||
}; | ||
try { | ||
const results = await hubeauApi.indicateursServices.communes(params); | ||
console.log(results); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
} | ||
async function communesCsv() { | ||
const params = { | ||
annee: 2019, | ||
page: 1, | ||
type_service: 'AEP', | ||
}; | ||
try { | ||
const results = await hubeauApi.indicateursServices.communesCsv(params); | ||
console.log(results); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
} |
export const hostname = 'hubeau.eaufrance.fr'; | ||
export const entryPoints = { | ||
etatPiscicole: '/api/v0/etat_piscicole/', | ||
indicateursServices: '/api/v0/indicateurs_services/', | ||
}; |
@@ -1,12 +0,12 @@ | ||
import etatPiscicole from './commands/etatPiscicole/etatPiscicole'; | ||
import etatPiscicole from './commands/etatPiscicole'; | ||
import indicateursServices from './commands/indicateursServices'; | ||
import { IHubeauApi } from './types/hubeauApi'; | ||
class HubeauApi implements IHubeauApi { | ||
class HubeauApi { | ||
etatPiscicole; | ||
indicateursServices; | ||
constructor() { | ||
this.etatPiscicole = etatPiscicole(); | ||
this.indicateursServices = indicateursServices(); | ||
} | ||
} | ||
module.exports = HubeauApi; |
@@ -1,3 +0,2 @@ | ||
type Mois = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; | ||
type Format = 'json' | 'geojson'; | ||
import { Format, Mois } from './communs'; | ||
@@ -4,0 +3,0 @@ export type CodeEspecePoissonParams = { |
type Params = { | ||
[key: string]: string | string[] | number | number[]; | ||
[key: string]: string | string[] | number | number[] | boolean; | ||
}; | ||
@@ -4,0 +4,0 @@ export function objectToStringParameters(params: Params): string { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68172
50
682
151