hubeau-api
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -5,8 +5,8 @@ import { HubeauResponse } from '../types/communs'; | ||
codeEspecePoisson: (params?: CodeEspecePoissonParams | undefined) => Promise<HubeauResponse>; | ||
codeEspecePoissonCsv: (params?: CodeEspecePoissonParams | undefined) => Promise<HubeauResponse>; | ||
codeEspecePoissonCsv: (params?: CodeEspecePoissonParams | undefined) => Promise<string>; | ||
lieuxPeche: (params?: LieuxPecheParams | undefined) => Promise<HubeauResponse>; | ||
lieuxPecheCsv: (params?: LieuxPecheParams | undefined) => Promise<HubeauResponse>; | ||
lieuxPecheCsv: (params?: LieuxPecheParams | undefined) => Promise<string>; | ||
poissons: (params?: PoissonsParams | undefined) => Promise<HubeauResponse>; | ||
poissonsCsv: (params?: PoissonsParams | undefined) => Promise<HubeauResponse>; | ||
poissonsCsv: (params?: PoissonsParams | undefined) => Promise<string>; | ||
}; | ||
export default etatPiscicole; |
@@ -38,8 +38,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constants_1 = require("../constants"); | ||
var http_1 = __importDefault(require("../http")); | ||
var http_1 = require("../http"); | ||
var utils_1 = require("../utils/utils"); | ||
@@ -53,3 +50,3 @@ var etatPiscicole = { | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.etatPiscicole, "/code_espece_poisson?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.etatPiscicole, "/code_espece_poisson?".concat(formattedParams))]; | ||
case 1: | ||
@@ -67,3 +64,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.etatPiscicole, "/code_espece_poisson.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.etatPiscicole, "/code_espece_poisson.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -81,3 +78,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.etatPiscicole, "/lieux_peche?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.etatPiscicole, "/lieux_peche?".concat(formattedParams))]; | ||
case 1: | ||
@@ -95,3 +92,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.etatPiscicole, "/lieux_peche.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.etatPiscicole, "/lieux_peche.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -109,3 +106,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.etatPiscicole, "/poissons?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.etatPiscicole, "/poissons?".concat(formattedParams))]; | ||
case 1: | ||
@@ -123,3 +120,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.etatPiscicole, "/poissons.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.etatPiscicole, "/poissons.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -126,0 +123,0 @@ datas = _a.sent(); |
@@ -5,8 +5,8 @@ import { HubeauResponse } from '../types/communs'; | ||
indices: (params?: IndicesParams | undefined) => Promise<HubeauResponse>; | ||
indicesCsv: (params?: IndicesParams | undefined) => Promise<HubeauResponse>; | ||
indicesCsv: (params?: IndicesParams | undefined) => Promise<string>; | ||
stationsHydrobio: (params?: StationsHydrobioParams | undefined) => Promise<HubeauResponse>; | ||
stationsHydrobioCsv: (params?: StationsHydrobioParams | undefined) => Promise<HubeauResponse>; | ||
stationsHydrobioCsv: (params?: StationsHydrobioParams | undefined) => Promise<string>; | ||
taxons: (params?: TaxonssParams | undefined) => Promise<HubeauResponse>; | ||
taxonsCsv: (params?: TaxonssParams | undefined) => Promise<HubeauResponse>; | ||
taxonsCsv: (params?: TaxonssParams | undefined) => Promise<string>; | ||
}; | ||
export default hydrobio; |
@@ -38,8 +38,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constants_1 = require("../constants"); | ||
var http_1 = __importDefault(require("../http")); | ||
var http_1 = require("../http"); | ||
var utils_1 = require("../utils/utils"); | ||
@@ -53,3 +50,3 @@ var hydrobio = { | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrobio, "/indices?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.hydrobio, "/indices?".concat(formattedParams))]; | ||
case 1: | ||
@@ -67,3 +64,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrobio, "/indices.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.hydrobio, "/indices.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -81,3 +78,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrobio, "/stations_hydrobio?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.hydrobio, "/stations_hydrobio?".concat(formattedParams))]; | ||
case 1: | ||
@@ -95,3 +92,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrobio, "/stations_hydrobio.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.hydrobio, "/stations_hydrobio.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -109,3 +106,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrobio, "/taxons?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.hydrobio, "/taxons?".concat(formattedParams))]; | ||
case 1: | ||
@@ -123,3 +120,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrobio, "/taxons.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.hydrobio, "/taxons.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -126,0 +123,0 @@ datas = _a.sent(); |
@@ -5,13 +5,13 @@ import { HubeauResponse } from '../types/communs'; | ||
obsElab: (params?: ObsElabParams | undefined) => Promise<HubeauResponse>; | ||
obsElabCsv: (params?: ObsElabParams | undefined) => Promise<HubeauResponse>; | ||
obsElabCsv: (params?: ObsElabParams | undefined) => Promise<string>; | ||
observationsTr: (params?: ObservationsTrParams | undefined) => Promise<HubeauResponse>; | ||
observationsTrCsv: (params?: ObservationsTrParams | undefined) => Promise<HubeauResponse>; | ||
observationsTrXml: (params?: ObservationsTrParams | undefined) => Promise<HubeauResponse>; | ||
observationsTrCsv: (params?: ObservationsTrParams | undefined) => Promise<string>; | ||
observationsTrXml: (params?: ObservationsTrParams | undefined) => Promise<string>; | ||
referentielSites: (params?: ReferentielSitesParams | undefined) => Promise<HubeauResponse>; | ||
referentielSitesCsv: (params?: ReferentielSitesParams | undefined) => Promise<HubeauResponse>; | ||
referentielSitesXml: (params?: ReferentielSitesParams | undefined) => Promise<HubeauResponse>; | ||
referentielSitesCsv: (params?: ReferentielSitesParams | undefined) => Promise<string>; | ||
referentielSitesXml: (params?: ReferentielSitesParams | undefined) => Promise<string>; | ||
referentielStations: (params?: ReferentielStationsParams | undefined) => Promise<HubeauResponse>; | ||
referentielStationsCsv: (params?: ReferentielStationsParams | undefined) => Promise<HubeauResponse>; | ||
referentielStationsXml: (params?: ReferentielStationsParams | undefined) => Promise<HubeauResponse>; | ||
referentielStationsCsv: (params?: ReferentielStationsParams | undefined) => Promise<string>; | ||
referentielStationsXml: (params?: ReferentielStationsParams | undefined) => Promise<string>; | ||
}; | ||
export default hydrometrie; |
@@ -38,8 +38,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constants_1 = require("../constants"); | ||
var http_1 = __importDefault(require("../http")); | ||
var http_1 = require("../http"); | ||
var utils_1 = require("../utils/utils"); | ||
@@ -53,3 +50,3 @@ var hydrometrie = { | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrometrie, "/obs_elab?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.hydrometrie, "/obs_elab?".concat(formattedParams))]; | ||
case 1: | ||
@@ -67,3 +64,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrometrie, "/obs_elab.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.hydrometrie, "/obs_elab.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -81,3 +78,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrometrie, "/observations_tr?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.hydrometrie, "/observations_tr?".concat(formattedParams))]; | ||
case 1: | ||
@@ -95,3 +92,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrometrie, "/observations_tr.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.hydrometrie, "/observations_tr.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -109,3 +106,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrometrie, "/observations_tr.xml?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestXml)(constants_1.entryPoints.hydrometrie, "/observations_tr.xml?".concat(formattedParams))]; | ||
case 1: | ||
@@ -123,3 +120,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrometrie, "/referentiel/sites?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.hydrometrie, "/referentiel/sites?".concat(formattedParams))]; | ||
case 1: | ||
@@ -137,3 +134,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrometrie, "/referentiel/sites.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.hydrometrie, "/referentiel/sites.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -151,3 +148,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrometrie, "/referentiel/sites.xml?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestXml)(constants_1.entryPoints.hydrometrie, "/referentiel/sites.xml?".concat(formattedParams))]; | ||
case 1: | ||
@@ -165,3 +162,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrometrie, "/referentiel/sites?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.hydrometrie, "/referentiel/sites?".concat(formattedParams))]; | ||
case 1: | ||
@@ -179,3 +176,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrometrie, "/referentiel/sites.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.hydrometrie, "/referentiel/sites.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -193,3 +190,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.hydrometrie, "/referentiel/sites.xml?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.hydrometrie, "/referentiel/sites.xml?".concat(formattedParams))]; | ||
case 1: | ||
@@ -196,0 +193,0 @@ datas = _a.sent(); |
@@ -5,8 +5,8 @@ import { HubeauResponse } from '../types/communs'; | ||
communes: (params?: CommunesParams | undefined) => Promise<HubeauResponse>; | ||
communesCsv: (params?: CommunesParams | undefined) => Promise<HubeauResponse>; | ||
communesCsv: (params?: CommunesParams | undefined) => Promise<string>; | ||
indicateurs: (params?: IndicateursParams | undefined) => Promise<HubeauResponse>; | ||
indicateursCsv: (params?: IndicateursParams | undefined) => Promise<HubeauResponse>; | ||
indicateursCsv: (params?: IndicateursParams | undefined) => Promise<string>; | ||
services: (params?: ServicesParams | undefined) => Promise<HubeauResponse>; | ||
servicesCsv: (params?: ServicesParams | undefined) => Promise<HubeauResponse>; | ||
servicesCsv: (params?: ServicesParams | undefined) => Promise<string>; | ||
}; | ||
export default indicateursServices; |
@@ -38,8 +38,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constants_1 = require("../constants"); | ||
var http_1 = __importDefault(require("../http")); | ||
var http_1 = require("../http"); | ||
var utils_1 = require("../utils/utils"); | ||
@@ -53,3 +50,3 @@ var indicateursServices = { | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.indicateursServices, "/communes?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.indicateursServices, "/communes?".concat(formattedParams))]; | ||
case 1: | ||
@@ -67,3 +64,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.indicateursServices, "/communes.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.indicateursServices, "/communes.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -81,3 +78,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.indicateursServices, "/indicateurs?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.indicateursServices, "/indicateurs?".concat(formattedParams))]; | ||
case 1: | ||
@@ -95,3 +92,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.indicateursServices, "/indicateurs.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.indicateursServices, "/indicateurs.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -109,3 +106,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.indicateursServices, "/services?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.indicateursServices, "/services?".concat(formattedParams))]; | ||
case 1: | ||
@@ -123,3 +120,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.indicateursServices, "/services.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.indicateursServices, "/services.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -126,0 +123,0 @@ datas = _a.sent(); |
@@ -5,8 +5,8 @@ import { HubeauResponse } from '../types/communs'; | ||
chroniques: (params?: ChroniquesParams | undefined) => Promise<HubeauResponse>; | ||
chroniquesCsv: (params?: ChroniquesParams | undefined) => Promise<HubeauResponse>; | ||
chroniquesCsv: (params?: ChroniquesParams | undefined) => Promise<string>; | ||
chroniquesTr: (params?: ChroniquesTrParams | undefined) => Promise<HubeauResponse>; | ||
chroniquesTrCsv: (params?: ChroniquesTrParams | undefined) => Promise<HubeauResponse>; | ||
chroniquesTrCsv: (params?: ChroniquesTrParams | undefined) => Promise<string>; | ||
stations: (params?: StationsParams | undefined) => Promise<HubeauResponse>; | ||
stationsCsv: (params?: StationsParams | undefined) => Promise<HubeauResponse>; | ||
stationsCsv: (params?: StationsParams | undefined) => Promise<string>; | ||
}; | ||
export default piezometrie; |
@@ -38,8 +38,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constants_1 = require("../constants"); | ||
var http_1 = __importDefault(require("../http")); | ||
var http_1 = require("../http"); | ||
var utils_1 = require("../utils/utils"); | ||
@@ -53,3 +50,3 @@ var piezometrie = { | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.piezometrie, "/chroniques?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.piezometrie, "/chroniques?".concat(formattedParams))]; | ||
case 1: | ||
@@ -67,3 +64,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.piezometrie, "/chroniques.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.piezometrie, "/chroniques.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -81,3 +78,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.piezometrie, "/chroniques_tr?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.piezometrie, "/chroniques_tr?".concat(formattedParams))]; | ||
case 1: | ||
@@ -95,3 +92,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.piezometrie, "/chroniques_tr.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.piezometrie, "/chroniques_tr.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -109,3 +106,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.piezometrie, "/stations?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.piezometrie, "/stations?".concat(formattedParams))]; | ||
case 1: | ||
@@ -123,3 +120,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.piezometrie, "/stations.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.piezometrie, "/stations.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -126,0 +123,0 @@ datas = _a.sent(); |
@@ -5,8 +5,8 @@ import { HubeauResponse } from '../types/communs'; | ||
chroniques: (params?: ChroniquesParams | undefined) => Promise<HubeauResponse>; | ||
chroniquesCsv: (params?: ChroniquesParams | undefined) => Promise<HubeauResponse>; | ||
chroniquesCsv: (params?: ChroniquesParams | undefined) => Promise<string>; | ||
referentielOuvrages: (params?: ReferentielOuvragesParams | undefined) => Promise<HubeauResponse>; | ||
referentielOuvragesCsv: (params?: ReferentielOuvragesParams | undefined) => Promise<HubeauResponse>; | ||
referentielOuvragesCsv: (params?: ReferentielOuvragesParams | undefined) => Promise<string>; | ||
referentielPointsPrelevement: (params?: ReferentielPointsPrelevementParams | undefined) => Promise<HubeauResponse>; | ||
referentielPointsPrelevementCsv: (params?: ReferentielPointsPrelevementParams | undefined) => Promise<HubeauResponse>; | ||
referentielPointsPrelevementCsv: (params?: ReferentielPointsPrelevementParams | undefined) => Promise<string>; | ||
}; | ||
export default prelevements; |
@@ -38,8 +38,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constants_1 = require("../constants"); | ||
var http_1 = __importDefault(require("../http")); | ||
var http_1 = require("../http"); | ||
var utils_1 = require("../utils/utils"); | ||
@@ -53,3 +50,3 @@ var prelevements = { | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.prelevements, "/chroniques?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.prelevements, "/chroniques?".concat(formattedParams))]; | ||
case 1: | ||
@@ -67,3 +64,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.prelevements, "/chroniques.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.prelevements, "/chroniques.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -81,3 +78,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.prelevements, "/referentiel/ouvrages?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.prelevements, "/referentiel/ouvrages?".concat(formattedParams))]; | ||
case 1: | ||
@@ -95,3 +92,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.prelevements, "/referentiel/ouvrages.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.prelevements, "/referentiel/ouvrages.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -109,3 +106,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.prelevements, "/referentiel/points_prelevement?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.prelevements, "/referentiel/points_prelevement?".concat(formattedParams))]; | ||
case 1: | ||
@@ -123,3 +120,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.prelevements, "/referentiel/points_prelevement.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.prelevements, "/referentiel/points_prelevement.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -126,0 +123,0 @@ datas = _a.sent(); |
@@ -5,6 +5,6 @@ import { HubeauResponse } from '../types/communs'; | ||
communesUdi: (params?: CommunesUdiParams | undefined) => Promise<HubeauResponse>; | ||
communesUdiCsv: (params?: CommunesUdiParams | undefined) => Promise<HubeauResponse>; | ||
communesUdiCsv: (params?: CommunesUdiParams | undefined) => Promise<string>; | ||
resultatsDis: (params?: ResultatsDisParams | undefined) => Promise<HubeauResponse>; | ||
resultatsDisCsv: (params?: ResultatsDisParams | undefined) => Promise<HubeauResponse>; | ||
resultatsDisCsv: (params?: ResultatsDisParams | undefined) => Promise<string>; | ||
}; | ||
export default qualiteEauPotable; |
@@ -38,8 +38,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constants_1 = require("../constants"); | ||
var http_1 = __importDefault(require("../http")); | ||
var http_1 = require("../http"); | ||
var utils_1 = require("../utils/utils"); | ||
@@ -53,3 +50,3 @@ var qualiteEauPotable = { | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteEauPotable, "/communes_udi?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.qualiteEauPotable, "/communes_udi?".concat(formattedParams))]; | ||
case 1: | ||
@@ -67,3 +64,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteEauPotable, "/communes_udi.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.qualiteEauPotable, "/communes_udi.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -81,3 +78,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteEauPotable, "/resultats_dis?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.qualiteEauPotable, "/resultats_dis?".concat(formattedParams))]; | ||
case 1: | ||
@@ -95,3 +92,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteEauPotable, "/resultats_dis.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.qualiteEauPotable, "/resultats_dis.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -98,0 +95,0 @@ datas = _a.sent(); |
@@ -5,6 +5,6 @@ import { HubeauResponse } from '../types/communs'; | ||
analyses: (params?: AnalysesParams | undefined) => Promise<HubeauResponse>; | ||
analysesCsv: (params?: AnalysesParams | undefined) => Promise<HubeauResponse>; | ||
analysesCsv: (params?: AnalysesParams | undefined) => Promise<string>; | ||
stations: (params?: StationsParams | undefined) => Promise<HubeauResponse>; | ||
stationsCsv: (params?: StationsParams | undefined) => Promise<HubeauResponse>; | ||
stationsCsv: (params?: StationsParams | undefined) => Promise<string>; | ||
}; | ||
export default qualiteNappes; |
@@ -38,8 +38,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constants_1 = require("../constants"); | ||
var http_1 = __importDefault(require("../http")); | ||
var http_1 = require("../http"); | ||
var utils_1 = require("../utils/utils"); | ||
@@ -53,3 +50,3 @@ var qualiteNappes = { | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteNappes, "/analyses?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.qualiteNappes, "/analyses?".concat(formattedParams))]; | ||
case 1: | ||
@@ -67,3 +64,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteNappes, "/analyses.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.qualiteNappes, "/analyses.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -81,3 +78,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteNappes, "/stations?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.qualiteNappes, "/stations?".concat(formattedParams))]; | ||
case 1: | ||
@@ -95,3 +92,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteNappes, "/stations.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.qualiteNappes, "/stations.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -98,0 +95,0 @@ datas = _a.sent(); |
@@ -5,10 +5,10 @@ import { HubeauResponse } from '../types/communs'; | ||
analysePc: (params?: AnalysePcParams | undefined) => Promise<HubeauResponse>; | ||
analysePcCsv: (params?: AnalysePcParams | undefined) => Promise<HubeauResponse>; | ||
analysePcCsv: (params?: AnalysePcParams | undefined) => Promise<string>; | ||
stationPc: (params?: StationPcParams | undefined) => Promise<HubeauResponse>; | ||
stationPcCsv: (params?: StationPcParams | undefined) => Promise<HubeauResponse>; | ||
stationPcCsv: (params?: StationPcParams | undefined) => Promise<string>; | ||
operationPc: (params?: OperationPcParams | undefined) => Promise<HubeauResponse>; | ||
operationPcCsv: (params?: OperationPcParams | undefined) => Promise<HubeauResponse>; | ||
operationPcCsv: (params?: OperationPcParams | undefined) => Promise<string>; | ||
conditionEnvironnementalePc: (params?: ConditionEnvironnementaleParams | undefined) => Promise<HubeauResponse>; | ||
conditionEnvironnementalePcCsv: (params?: ConditionEnvironnementaleParams | undefined) => Promise<HubeauResponse>; | ||
conditionEnvironnementalePcCsv: (params?: ConditionEnvironnementaleParams | undefined) => Promise<string>; | ||
}; | ||
export default qualiteRivieres; |
@@ -38,8 +38,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constants_1 = require("../constants"); | ||
var http_1 = __importDefault(require("../http")); | ||
var http_1 = require("../http"); | ||
var utils_1 = require("../utils/utils"); | ||
@@ -53,3 +50,3 @@ var qualiteRivieres = { | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteRivieres, "/analyse_pc?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.qualiteRivieres, "/analyse_pc?".concat(formattedParams))]; | ||
case 1: | ||
@@ -67,3 +64,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteRivieres, "/analyse_pc.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.qualiteRivieres, "/analyse_pc.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -81,3 +78,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteRivieres, "/station_pc?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.qualiteRivieres, "/station_pc?".concat(formattedParams))]; | ||
case 1: | ||
@@ -95,3 +92,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteRivieres, "/station_pc.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.qualiteRivieres, "/station_pc.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -109,3 +106,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteRivieres, "/operation_pc?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.qualiteRivieres, "/operation_pc?".concat(formattedParams))]; | ||
case 1: | ||
@@ -123,3 +120,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteRivieres, "/operation_pc.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.qualiteRivieres, "/operation_pc.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -137,3 +134,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteRivieres, "/condition_environnementale_pc?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.qualiteRivieres, "/condition_environnementale_pc?".concat(formattedParams))]; | ||
case 1: | ||
@@ -151,3 +148,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.qualiteRivieres, "/condition_environnementale_pc.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.qualiteRivieres, "/condition_environnementale_pc.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -154,0 +151,0 @@ datas = _a.sent(); |
@@ -5,6 +5,6 @@ import { HubeauResponse } from '../types/communs'; | ||
contaminantsChimiques: (params?: ContaminantsChimiquesParams | undefined) => Promise<HubeauResponse>; | ||
contaminantsChimiquesCsv: (params?: ContaminantsChimiquesParams | undefined) => Promise<HubeauResponse>; | ||
contaminantsChimiquesCsv: (params?: ContaminantsChimiquesParams | undefined) => Promise<string>; | ||
lieuxSurv: (params?: LieuxSurvParams | undefined) => Promise<HubeauResponse>; | ||
lieuxSurvCsv: (params?: LieuxSurvParams | undefined) => Promise<HubeauResponse>; | ||
lieuxSurvCsv: (params?: LieuxSurvParams | undefined) => Promise<string>; | ||
}; | ||
export default surveillanceLittoral; |
@@ -38,8 +38,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constants_1 = require("../constants"); | ||
var http_1 = __importDefault(require("../http")); | ||
var http_1 = require("../http"); | ||
var utils_1 = require("../utils/utils"); | ||
@@ -53,3 +50,3 @@ var surveillanceLittoral = { | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.surveillanceLittoral, "/contaminants_chimiques?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.surveillanceLittoral, "/contaminants_chimiques?".concat(formattedParams))]; | ||
case 1: | ||
@@ -67,3 +64,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.surveillanceLittoral, "/contaminants_chimiques.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.surveillanceLittoral, "/contaminants_chimiques.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -81,3 +78,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.surveillanceLittoral, "/lieux_surv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.surveillanceLittoral, "/lieux_surv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -95,3 +92,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.surveillanceLittoral, "/lieux_surv.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.surveillanceLittoral, "/lieux_surv.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -98,0 +95,0 @@ datas = _a.sent(); |
@@ -5,6 +5,6 @@ import { HubeauResponse } from '../types/communs'; | ||
chronique: (params?: ChroniqueParams | undefined) => Promise<HubeauResponse>; | ||
chroniqueCsv: (params?: ChroniqueParams | undefined) => Promise<HubeauResponse>; | ||
chroniqueCsv: (params?: ChroniqueParams | undefined) => Promise<string>; | ||
station: (params?: StationParams | undefined) => Promise<HubeauResponse>; | ||
stationCsv: (params?: StationParams | undefined) => Promise<HubeauResponse>; | ||
stationCsv: (params?: StationParams | undefined) => Promise<string>; | ||
}; | ||
export default temperature; |
@@ -38,8 +38,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constants_1 = require("../constants"); | ||
var http_1 = __importDefault(require("../http")); | ||
var http_1 = require("../http"); | ||
var utils_1 = require("../utils/utils"); | ||
@@ -53,3 +50,3 @@ var temperature = { | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.temperature, "/chronique?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.temperature, "/chronique?".concat(formattedParams))]; | ||
case 1: | ||
@@ -67,3 +64,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.temperature, "/chronique.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.temperature, "/chronique.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -81,3 +78,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.temperature, "/station?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequest)(constants_1.entryPoints.temperature, "/station?".concat(formattedParams))]; | ||
case 1: | ||
@@ -95,3 +92,3 @@ datas = _a.sent(); | ||
formattedParams = params ? (0, utils_1.objectToStringParameters)(params) : ''; | ||
return [4 /*yield*/, (0, http_1.default)(constants_1.entryPoints.temperature, "/station.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, (0, http_1.getRequestCsv)(constants_1.entryPoints.temperature, "/station.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -98,0 +95,0 @@ datas = _a.sent(); |
@@ -1,2 +0,4 @@ | ||
declare function getRequest(entryPoint: string, args: string | undefined): Promise<string>; | ||
export default getRequest; | ||
import { HubeauResponse } from '../types/communs'; | ||
export declare function getRequest(entryPoint: string, args: string | undefined): Promise<HubeauResponse>; | ||
export declare function getRequestCsv(entryPoint: string, args: string | undefined): Promise<string>; | ||
export declare function getRequestXml(entryPoint: string, args: string | undefined): Promise<string>; |
@@ -42,2 +42,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getRequestXml = exports.getRequestCsv = exports.getRequest = void 0; | ||
var superagent_1 = __importDefault(require("superagent")); | ||
@@ -55,6 +56,6 @@ var constants_1 = require("../constants"); | ||
res = _a.sent(); | ||
return [2 /*return*/, res.text]; | ||
return [2 /*return*/, JSON.parse(res.text)]; | ||
case 2: | ||
err_1 = _a.sent(); | ||
return [2 /*return*/, err_1.toString()]; | ||
return [2 /*return*/, JSON.parse(err_1)]; | ||
case 3: return [2 /*return*/]; | ||
@@ -65,2 +66,42 @@ } | ||
} | ||
exports.default = getRequest; | ||
exports.getRequest = getRequest; | ||
function getRequestCsv(entryPoint, args) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var res, err_2; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 2, , 3]); | ||
return [4 /*yield*/, superagent_1.default.get("".concat(constants_1.hostname).concat(entryPoint).concat(args))]; | ||
case 1: | ||
res = _a.sent(); | ||
return [2 /*return*/, res.text]; | ||
case 2: | ||
err_2 = _a.sent(); | ||
return [2 /*return*/, err_2.toString()]; | ||
case 3: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
} | ||
exports.getRequestCsv = getRequestCsv; | ||
function getRequestXml(entryPoint, args) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var res, err_3; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 2, , 3]); | ||
return [4 /*yield*/, superagent_1.default.get("".concat(constants_1.hostname).concat(entryPoint).concat(args))]; | ||
case 1: | ||
res = _a.sent(); | ||
return [2 /*return*/, res.text]; | ||
case 2: | ||
err_3 = _a.sent(); | ||
return [2 /*return*/, err_3.toString()]; | ||
case 3: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
} | ||
exports.getRequestXml = getRequestXml; |
declare type NestedObject = { | ||
[key: string]: string | number | boolean | string[] | number[]; | ||
}; | ||
declare type Response = { | ||
export declare type HubeauResponseJson = { | ||
count: number; | ||
@@ -12,3 +12,3 @@ prev: string; | ||
}; | ||
export declare type HubeauResponse = string | Response; | ||
export declare type HubeauResponse = any; | ||
export declare type Mois = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; | ||
@@ -15,0 +15,0 @@ export declare type Format = 'json' | 'geojson'; |
@@ -5,8 +5,8 @@ import { HubeauResponse } from '../types/communs'; | ||
codeEspecePoisson: (params?: CodeEspecePoissonParams | undefined) => Promise<HubeauResponse>; | ||
codeEspecePoissonCsv: (params?: CodeEspecePoissonParams | undefined) => Promise<HubeauResponse>; | ||
codeEspecePoissonCsv: (params?: CodeEspecePoissonParams | undefined) => Promise<string>; | ||
lieuxPeche: (params?: LieuxPecheParams | undefined) => Promise<HubeauResponse>; | ||
lieuxPecheCsv: (params?: LieuxPecheParams | undefined) => Promise<HubeauResponse>; | ||
lieuxPecheCsv: (params?: LieuxPecheParams | undefined) => Promise<string>; | ||
poissons: (params?: PoissonsParams | undefined) => Promise<HubeauResponse>; | ||
poissonsCsv: (params?: PoissonsParams | undefined) => Promise<HubeauResponse>; | ||
poissonsCsv: (params?: PoissonsParams | undefined) => Promise<string>; | ||
}; | ||
export default etatPiscicole; |
@@ -38,3 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import { getRequest, getRequestCsv } from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -61,3 +61,3 @@ var etatPiscicole = { | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.etatPiscicole, "/code_espece_poisson.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.etatPiscicole, "/code_espece_poisson.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -88,3 +88,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.etatPiscicole, "/lieux_peche.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.etatPiscicole, "/lieux_peche.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -115,3 +115,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.etatPiscicole, "/poissons.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.etatPiscicole, "/poissons.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -118,0 +118,0 @@ datas = _a.sent(); |
@@ -5,8 +5,8 @@ import { HubeauResponse } from '../types/communs'; | ||
indices: (params?: IndicesParams | undefined) => Promise<HubeauResponse>; | ||
indicesCsv: (params?: IndicesParams | undefined) => Promise<HubeauResponse>; | ||
indicesCsv: (params?: IndicesParams | undefined) => Promise<string>; | ||
stationsHydrobio: (params?: StationsHydrobioParams | undefined) => Promise<HubeauResponse>; | ||
stationsHydrobioCsv: (params?: StationsHydrobioParams | undefined) => Promise<HubeauResponse>; | ||
stationsHydrobioCsv: (params?: StationsHydrobioParams | undefined) => Promise<string>; | ||
taxons: (params?: TaxonssParams | undefined) => Promise<HubeauResponse>; | ||
taxonsCsv: (params?: TaxonssParams | undefined) => Promise<HubeauResponse>; | ||
taxonsCsv: (params?: TaxonssParams | undefined) => Promise<string>; | ||
}; | ||
export default hydrobio; |
@@ -38,3 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import { getRequest, getRequestCsv } from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -61,3 +61,3 @@ var hydrobio = { | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.hydrobio, "/indices.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.hydrobio, "/indices.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -88,3 +88,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.hydrobio, "/stations_hydrobio.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.hydrobio, "/stations_hydrobio.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -115,3 +115,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.hydrobio, "/taxons.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.hydrobio, "/taxons.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -118,0 +118,0 @@ datas = _a.sent(); |
@@ -5,13 +5,13 @@ import { HubeauResponse } from '../types/communs'; | ||
obsElab: (params?: ObsElabParams | undefined) => Promise<HubeauResponse>; | ||
obsElabCsv: (params?: ObsElabParams | undefined) => Promise<HubeauResponse>; | ||
obsElabCsv: (params?: ObsElabParams | undefined) => Promise<string>; | ||
observationsTr: (params?: ObservationsTrParams | undefined) => Promise<HubeauResponse>; | ||
observationsTrCsv: (params?: ObservationsTrParams | undefined) => Promise<HubeauResponse>; | ||
observationsTrXml: (params?: ObservationsTrParams | undefined) => Promise<HubeauResponse>; | ||
observationsTrCsv: (params?: ObservationsTrParams | undefined) => Promise<string>; | ||
observationsTrXml: (params?: ObservationsTrParams | undefined) => Promise<string>; | ||
referentielSites: (params?: ReferentielSitesParams | undefined) => Promise<HubeauResponse>; | ||
referentielSitesCsv: (params?: ReferentielSitesParams | undefined) => Promise<HubeauResponse>; | ||
referentielSitesXml: (params?: ReferentielSitesParams | undefined) => Promise<HubeauResponse>; | ||
referentielSitesCsv: (params?: ReferentielSitesParams | undefined) => Promise<string>; | ||
referentielSitesXml: (params?: ReferentielSitesParams | undefined) => Promise<string>; | ||
referentielStations: (params?: ReferentielStationsParams | undefined) => Promise<HubeauResponse>; | ||
referentielStationsCsv: (params?: ReferentielStationsParams | undefined) => Promise<HubeauResponse>; | ||
referentielStationsXml: (params?: ReferentielStationsParams | undefined) => Promise<HubeauResponse>; | ||
referentielStationsCsv: (params?: ReferentielStationsParams | undefined) => Promise<string>; | ||
referentielStationsXml: (params?: ReferentielStationsParams | undefined) => Promise<string>; | ||
}; | ||
export default hydrometrie; |
@@ -38,3 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import { getRequest, getRequestCsv, getRequestXml } from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -61,3 +61,3 @@ var hydrometrie = { | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.hydrometrie, "/obs_elab.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.hydrometrie, "/obs_elab.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -88,3 +88,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.hydrometrie, "/observations_tr.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.hydrometrie, "/observations_tr.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -102,3 +102,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.hydrometrie, "/observations_tr.xml?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestXml(entryPoints.hydrometrie, "/observations_tr.xml?".concat(formattedParams))]; | ||
case 1: | ||
@@ -129,3 +129,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.hydrometrie, "/referentiel/sites.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.hydrometrie, "/referentiel/sites.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -143,3 +143,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.hydrometrie, "/referentiel/sites.xml?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestXml(entryPoints.hydrometrie, "/referentiel/sites.xml?".concat(formattedParams))]; | ||
case 1: | ||
@@ -170,3 +170,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.hydrometrie, "/referentiel/sites.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.hydrometrie, "/referentiel/sites.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -184,3 +184,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.hydrometrie, "/referentiel/sites.xml?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.hydrometrie, "/referentiel/sites.xml?".concat(formattedParams))]; | ||
case 1: | ||
@@ -187,0 +187,0 @@ datas = _a.sent(); |
@@ -5,8 +5,8 @@ import { HubeauResponse } from '../types/communs'; | ||
communes: (params?: CommunesParams | undefined) => Promise<HubeauResponse>; | ||
communesCsv: (params?: CommunesParams | undefined) => Promise<HubeauResponse>; | ||
communesCsv: (params?: CommunesParams | undefined) => Promise<string>; | ||
indicateurs: (params?: IndicateursParams | undefined) => Promise<HubeauResponse>; | ||
indicateursCsv: (params?: IndicateursParams | undefined) => Promise<HubeauResponse>; | ||
indicateursCsv: (params?: IndicateursParams | undefined) => Promise<string>; | ||
services: (params?: ServicesParams | undefined) => Promise<HubeauResponse>; | ||
servicesCsv: (params?: ServicesParams | undefined) => Promise<HubeauResponse>; | ||
servicesCsv: (params?: ServicesParams | undefined) => Promise<string>; | ||
}; | ||
export default indicateursServices; |
@@ -38,3 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import { getRequest, getRequestCsv } from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -61,3 +61,3 @@ var indicateursServices = { | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.indicateursServices, "/communes.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.indicateursServices, "/communes.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -88,3 +88,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.indicateursServices, "/indicateurs.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.indicateursServices, "/indicateurs.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -115,3 +115,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.indicateursServices, "/services.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.indicateursServices, "/services.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -118,0 +118,0 @@ datas = _a.sent(); |
@@ -5,8 +5,8 @@ import { HubeauResponse } from '../types/communs'; | ||
chroniques: (params?: ChroniquesParams | undefined) => Promise<HubeauResponse>; | ||
chroniquesCsv: (params?: ChroniquesParams | undefined) => Promise<HubeauResponse>; | ||
chroniquesCsv: (params?: ChroniquesParams | undefined) => Promise<string>; | ||
chroniquesTr: (params?: ChroniquesTrParams | undefined) => Promise<HubeauResponse>; | ||
chroniquesTrCsv: (params?: ChroniquesTrParams | undefined) => Promise<HubeauResponse>; | ||
chroniquesTrCsv: (params?: ChroniquesTrParams | undefined) => Promise<string>; | ||
stations: (params?: StationsParams | undefined) => Promise<HubeauResponse>; | ||
stationsCsv: (params?: StationsParams | undefined) => Promise<HubeauResponse>; | ||
stationsCsv: (params?: StationsParams | undefined) => Promise<string>; | ||
}; | ||
export default piezometrie; |
@@ -38,3 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import { getRequest, getRequestCsv } from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -61,3 +61,3 @@ var piezometrie = { | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.piezometrie, "/chroniques.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.piezometrie, "/chroniques.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -88,3 +88,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.piezometrie, "/chroniques_tr.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.piezometrie, "/chroniques_tr.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -115,3 +115,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.piezometrie, "/stations.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.piezometrie, "/stations.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -118,0 +118,0 @@ datas = _a.sent(); |
@@ -5,8 +5,8 @@ import { HubeauResponse } from '../types/communs'; | ||
chroniques: (params?: ChroniquesParams | undefined) => Promise<HubeauResponse>; | ||
chroniquesCsv: (params?: ChroniquesParams | undefined) => Promise<HubeauResponse>; | ||
chroniquesCsv: (params?: ChroniquesParams | undefined) => Promise<string>; | ||
referentielOuvrages: (params?: ReferentielOuvragesParams | undefined) => Promise<HubeauResponse>; | ||
referentielOuvragesCsv: (params?: ReferentielOuvragesParams | undefined) => Promise<HubeauResponse>; | ||
referentielOuvragesCsv: (params?: ReferentielOuvragesParams | undefined) => Promise<string>; | ||
referentielPointsPrelevement: (params?: ReferentielPointsPrelevementParams | undefined) => Promise<HubeauResponse>; | ||
referentielPointsPrelevementCsv: (params?: ReferentielPointsPrelevementParams | undefined) => Promise<HubeauResponse>; | ||
referentielPointsPrelevementCsv: (params?: ReferentielPointsPrelevementParams | undefined) => Promise<string>; | ||
}; | ||
export default prelevements; |
@@ -38,3 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import { getRequest, getRequestCsv } from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -61,3 +61,3 @@ var prelevements = { | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.prelevements, "/chroniques.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.prelevements, "/chroniques.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -88,3 +88,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.prelevements, "/referentiel/ouvrages.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.prelevements, "/referentiel/ouvrages.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -115,3 +115,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.prelevements, "/referentiel/points_prelevement.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.prelevements, "/referentiel/points_prelevement.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -118,0 +118,0 @@ datas = _a.sent(); |
@@ -5,6 +5,6 @@ import { HubeauResponse } from '../types/communs'; | ||
communesUdi: (params?: CommunesUdiParams | undefined) => Promise<HubeauResponse>; | ||
communesUdiCsv: (params?: CommunesUdiParams | undefined) => Promise<HubeauResponse>; | ||
communesUdiCsv: (params?: CommunesUdiParams | undefined) => Promise<string>; | ||
resultatsDis: (params?: ResultatsDisParams | undefined) => Promise<HubeauResponse>; | ||
resultatsDisCsv: (params?: ResultatsDisParams | undefined) => Promise<HubeauResponse>; | ||
resultatsDisCsv: (params?: ResultatsDisParams | undefined) => Promise<string>; | ||
}; | ||
export default qualiteEauPotable; |
@@ -38,3 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import { getRequest, getRequestCsv } from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -61,3 +61,3 @@ var qualiteEauPotable = { | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.qualiteEauPotable, "/communes_udi.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.qualiteEauPotable, "/communes_udi.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -88,3 +88,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.qualiteEauPotable, "/resultats_dis.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.qualiteEauPotable, "/resultats_dis.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -91,0 +91,0 @@ datas = _a.sent(); |
@@ -5,6 +5,6 @@ import { HubeauResponse } from '../types/communs'; | ||
analyses: (params?: AnalysesParams | undefined) => Promise<HubeauResponse>; | ||
analysesCsv: (params?: AnalysesParams | undefined) => Promise<HubeauResponse>; | ||
analysesCsv: (params?: AnalysesParams | undefined) => Promise<string>; | ||
stations: (params?: StationsParams | undefined) => Promise<HubeauResponse>; | ||
stationsCsv: (params?: StationsParams | undefined) => Promise<HubeauResponse>; | ||
stationsCsv: (params?: StationsParams | undefined) => Promise<string>; | ||
}; | ||
export default qualiteNappes; |
@@ -38,3 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import { getRequest, getRequestCsv } from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -61,3 +61,3 @@ var qualiteNappes = { | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.qualiteNappes, "/analyses.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.qualiteNappes, "/analyses.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -88,3 +88,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.qualiteNappes, "/stations.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.qualiteNappes, "/stations.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -91,0 +91,0 @@ datas = _a.sent(); |
@@ -5,10 +5,10 @@ import { HubeauResponse } from '../types/communs'; | ||
analysePc: (params?: AnalysePcParams | undefined) => Promise<HubeauResponse>; | ||
analysePcCsv: (params?: AnalysePcParams | undefined) => Promise<HubeauResponse>; | ||
analysePcCsv: (params?: AnalysePcParams | undefined) => Promise<string>; | ||
stationPc: (params?: StationPcParams | undefined) => Promise<HubeauResponse>; | ||
stationPcCsv: (params?: StationPcParams | undefined) => Promise<HubeauResponse>; | ||
stationPcCsv: (params?: StationPcParams | undefined) => Promise<string>; | ||
operationPc: (params?: OperationPcParams | undefined) => Promise<HubeauResponse>; | ||
operationPcCsv: (params?: OperationPcParams | undefined) => Promise<HubeauResponse>; | ||
operationPcCsv: (params?: OperationPcParams | undefined) => Promise<string>; | ||
conditionEnvironnementalePc: (params?: ConditionEnvironnementaleParams | undefined) => Promise<HubeauResponse>; | ||
conditionEnvironnementalePcCsv: (params?: ConditionEnvironnementaleParams | undefined) => Promise<HubeauResponse>; | ||
conditionEnvironnementalePcCsv: (params?: ConditionEnvironnementaleParams | undefined) => Promise<string>; | ||
}; | ||
export default qualiteRivieres; |
@@ -38,3 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import { getRequest, getRequestCsv } from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -61,3 +61,3 @@ var qualiteRivieres = { | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.qualiteRivieres, "/analyse_pc.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.qualiteRivieres, "/analyse_pc.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -88,3 +88,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.qualiteRivieres, "/station_pc.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.qualiteRivieres, "/station_pc.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -115,3 +115,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.qualiteRivieres, "/operation_pc.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.qualiteRivieres, "/operation_pc.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -142,3 +142,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.qualiteRivieres, "/condition_environnementale_pc.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.qualiteRivieres, "/condition_environnementale_pc.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -145,0 +145,0 @@ datas = _a.sent(); |
@@ -5,6 +5,6 @@ import { HubeauResponse } from '../types/communs'; | ||
contaminantsChimiques: (params?: ContaminantsChimiquesParams | undefined) => Promise<HubeauResponse>; | ||
contaminantsChimiquesCsv: (params?: ContaminantsChimiquesParams | undefined) => Promise<HubeauResponse>; | ||
contaminantsChimiquesCsv: (params?: ContaminantsChimiquesParams | undefined) => Promise<string>; | ||
lieuxSurv: (params?: LieuxSurvParams | undefined) => Promise<HubeauResponse>; | ||
lieuxSurvCsv: (params?: LieuxSurvParams | undefined) => Promise<HubeauResponse>; | ||
lieuxSurvCsv: (params?: LieuxSurvParams | undefined) => Promise<string>; | ||
}; | ||
export default surveillanceLittoral; |
@@ -38,3 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import { getRequest, getRequestCsv } from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -61,3 +61,3 @@ var surveillanceLittoral = { | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.surveillanceLittoral, "/contaminants_chimiques.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.surveillanceLittoral, "/contaminants_chimiques.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -88,3 +88,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.surveillanceLittoral, "/lieux_surv.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.surveillanceLittoral, "/lieux_surv.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -91,0 +91,0 @@ datas = _a.sent(); |
@@ -5,6 +5,6 @@ import { HubeauResponse } from '../types/communs'; | ||
chronique: (params?: ChroniqueParams | undefined) => Promise<HubeauResponse>; | ||
chroniqueCsv: (params?: ChroniqueParams | undefined) => Promise<HubeauResponse>; | ||
chroniqueCsv: (params?: ChroniqueParams | undefined) => Promise<string>; | ||
station: (params?: StationParams | undefined) => Promise<HubeauResponse>; | ||
stationCsv: (params?: StationParams | undefined) => Promise<HubeauResponse>; | ||
stationCsv: (params?: StationParams | undefined) => Promise<string>; | ||
}; | ||
export default temperature; |
@@ -38,3 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import { getRequest, getRequestCsv } from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -61,3 +61,3 @@ var temperature = { | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.temperature, "/chronique.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.temperature, "/chronique.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -88,3 +88,3 @@ datas = _a.sent(); | ||
formattedParams = params ? objectToStringParameters(params) : ''; | ||
return [4 /*yield*/, getRequest(entryPoints.temperature, "/station.csv?".concat(formattedParams))]; | ||
return [4 /*yield*/, getRequestCsv(entryPoints.temperature, "/station.csv?".concat(formattedParams))]; | ||
case 1: | ||
@@ -91,0 +91,0 @@ datas = _a.sent(); |
@@ -1,2 +0,4 @@ | ||
declare function getRequest(entryPoint: string, args: string | undefined): Promise<string>; | ||
export default getRequest; | ||
import { HubeauResponse } from '../types/communs'; | ||
export declare function getRequest(entryPoint: string, args: string | undefined): Promise<HubeauResponse>; | ||
export declare function getRequestCsv(entryPoint: string, args: string | undefined): Promise<string>; | ||
export declare function getRequestXml(entryPoint: string, args: string | undefined): Promise<string>; |
@@ -39,3 +39,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { hostname } from '../constants'; | ||
function getRequest(entryPoint, args) { | ||
export function getRequest(entryPoint, args) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -50,6 +50,6 @@ var res, err_1; | ||
res = _a.sent(); | ||
return [2 /*return*/, res.text]; | ||
return [2 /*return*/, JSON.parse(res.text)]; | ||
case 2: | ||
err_1 = _a.sent(); | ||
return [2 /*return*/, err_1.toString()]; | ||
return [2 /*return*/, JSON.parse(err_1)]; | ||
case 3: return [2 /*return*/]; | ||
@@ -60,2 +60,39 @@ } | ||
} | ||
export default getRequest; | ||
export function getRequestCsv(entryPoint, args) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var res, err_2; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 2, , 3]); | ||
return [4 /*yield*/, superagent.get("".concat(hostname).concat(entryPoint).concat(args))]; | ||
case 1: | ||
res = _a.sent(); | ||
return [2 /*return*/, res.text]; | ||
case 2: | ||
err_2 = _a.sent(); | ||
return [2 /*return*/, err_2.toString()]; | ||
case 3: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
} | ||
export function getRequestXml(entryPoint, args) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var res, err_3; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 2, , 3]); | ||
return [4 /*yield*/, superagent.get("".concat(hostname).concat(entryPoint).concat(args))]; | ||
case 1: | ||
res = _a.sent(); | ||
return [2 /*return*/, res.text]; | ||
case 2: | ||
err_3 = _a.sent(); | ||
return [2 /*return*/, err_3.toString()]; | ||
case 3: return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
} |
declare type NestedObject = { | ||
[key: string]: string | number | boolean | string[] | number[]; | ||
}; | ||
declare type Response = { | ||
export declare type HubeauResponseJson = { | ||
count: number; | ||
@@ -12,3 +12,3 @@ prev: string; | ||
}; | ||
export declare type HubeauResponse = string | Response; | ||
export declare type HubeauResponse = any; | ||
export declare type Mois = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; | ||
@@ -15,0 +15,0 @@ export declare type Format = 'json' | 'geojson'; |
{ | ||
"name": "hubeau-api", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "hubeau api wrapper in javascript", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import {getRequest,getRequestCsv} from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -24,5 +24,5 @@ import { HubeauResponse } from '../types/communs'; | ||
params?: CodeEspecePoissonParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.etatPiscicole, | ||
@@ -41,5 +41,5 @@ `/code_espece_poisson.csv?${formattedParams}`, | ||
}, | ||
lieuxPecheCsv: async (params?: LieuxPecheParams): Promise<HubeauResponse> => { | ||
lieuxPecheCsv: async (params?: LieuxPecheParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.etatPiscicole, | ||
@@ -58,5 +58,5 @@ `/lieux_peche.csv?${formattedParams}`, | ||
}, | ||
poissonsCsv: async (params?: PoissonsParams): Promise<HubeauResponse> => { | ||
poissonsCsv: async (params?: PoissonsParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.etatPiscicole, | ||
@@ -63,0 +63,0 @@ `/poissons.csv?${formattedParams}`, |
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import {getRequest,getRequestCsv} from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -16,5 +16,5 @@ import { HubeauResponse } from '../types/communs'; | ||
}, | ||
indicesCsv: async (params?: IndicesParams): Promise<HubeauResponse> => { | ||
indicesCsv: async (params?: IndicesParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.hydrobio, | ||
@@ -37,5 +37,5 @@ `/indices.csv?${formattedParams}`, | ||
params?: StationsHydrobioParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.hydrobio, | ||
@@ -54,5 +54,5 @@ `/stations_hydrobio.csv?${formattedParams}`, | ||
}, | ||
taxonsCsv: async (params?: TaxonssParams): Promise<HubeauResponse> => { | ||
taxonsCsv: async (params?: TaxonssParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.hydrobio, | ||
@@ -59,0 +59,0 @@ `/taxons.csv?${formattedParams}`, |
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import {getRequest,getRequestCsv, getRequestXml} from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -21,5 +21,5 @@ import { HubeauResponse } from '../types/communs'; | ||
}, | ||
obsElabCsv: async (params?: ObsElabParams): Promise<HubeauResponse> => { | ||
obsElabCsv: async (params?: ObsElabParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.hydrometrie, | ||
@@ -42,5 +42,5 @@ `/obs_elab.csv?${formattedParams}`, | ||
params?: ObservationsTrParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.hydrometrie, | ||
@@ -53,5 +53,5 @@ `/observations_tr.csv?${formattedParams}`, | ||
params?: ObservationsTrParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestXml( | ||
entryPoints.hydrometrie, | ||
@@ -74,5 +74,5 @@ `/observations_tr.xml?${formattedParams}`, | ||
params?: ReferentielSitesParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.hydrometrie, | ||
@@ -85,5 +85,5 @@ `/referentiel/sites.csv?${formattedParams}`, | ||
params?: ReferentielSitesParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestXml( | ||
entryPoints.hydrometrie, | ||
@@ -106,5 +106,5 @@ `/referentiel/sites.xml?${formattedParams}`, | ||
params?: ReferentielStationsParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.hydrometrie, | ||
@@ -117,5 +117,5 @@ `/referentiel/sites.csv?${formattedParams}`, | ||
params?: ReferentielStationsParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.hydrometrie, | ||
@@ -122,0 +122,0 @@ `/referentiel/sites.xml?${formattedParams}`, |
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import {getRequest,getRequestCsv} from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -20,5 +20,5 @@ import { HubeauResponse } from '../types/communs'; | ||
}, | ||
communesCsv: async (params?: CommunesParams): Promise<HubeauResponse> => { | ||
communesCsv: async (params?: CommunesParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.indicateursServices, | ||
@@ -39,5 +39,5 @@ `/communes.csv?${formattedParams}`, | ||
params?: IndicateursParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.indicateursServices, | ||
@@ -56,5 +56,5 @@ `/indicateurs.csv?${formattedParams}`, | ||
}, | ||
servicesCsv: async (params?: ServicesParams): Promise<HubeauResponse> => { | ||
servicesCsv: async (params?: ServicesParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.indicateursServices, | ||
@@ -61,0 +61,0 @@ `/services.csv?${formattedParams}`, |
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import {getRequest,getRequestCsv} from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -20,5 +20,5 @@ import { HubeauResponse } from '../types/communs'; | ||
}, | ||
chroniquesCsv: async (params?: ChroniquesParams): Promise<HubeauResponse> => { | ||
chroniquesCsv: async (params?: ChroniquesParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.piezometrie, | ||
@@ -41,5 +41,5 @@ `/chroniques.csv?${formattedParams}`, | ||
params?: ChroniquesTrParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.piezometrie, | ||
@@ -58,5 +58,5 @@ `/chroniques_tr.csv?${formattedParams}`, | ||
}, | ||
stationsCsv: async (params?: StationsParams): Promise<HubeauResponse> => { | ||
stationsCsv: async (params?: StationsParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.piezometrie, | ||
@@ -63,0 +63,0 @@ `/stations.csv?${formattedParams}`, |
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import {getRequest,getRequestCsv} from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -20,5 +20,5 @@ import { HubeauResponse } from '../types/communs'; | ||
}, | ||
chroniquesCsv: async (params?: ChroniquesParams): Promise<HubeauResponse> => { | ||
chroniquesCsv: async (params?: ChroniquesParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.prelevements, | ||
@@ -41,5 +41,5 @@ `/chroniques.csv?${formattedParams}`, | ||
params?: ReferentielOuvragesParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.prelevements, | ||
@@ -62,5 +62,5 @@ `/referentiel/ouvrages.csv?${formattedParams}`, | ||
params?: ReferentielPointsPrelevementParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.prelevements, | ||
@@ -67,0 +67,0 @@ `/referentiel/points_prelevement.csv?${formattedParams}`, |
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import { getRequest, getRequestCsv } from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
import { HubeauResponse } from '../types/communs'; | ||
import { CommunesUdiParams, ResultatsDisParams } from '../types/qualiteEauPotable'; | ||
import { | ||
CommunesUdiParams, | ||
ResultatsDisParams, | ||
} from '../types/qualiteEauPotable'; | ||
@@ -16,5 +19,5 @@ const qualiteEauPotable = { | ||
}, | ||
communesUdiCsv: async (params?: CommunesUdiParams): Promise<HubeauResponse> => { | ||
communesUdiCsv: async (params?: CommunesUdiParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.qualiteEauPotable, | ||
@@ -25,3 +28,5 @@ `/communes_udi.csv?${formattedParams}`, | ||
}, | ||
resultatsDis: async (params?: ResultatsDisParams): Promise<HubeauResponse> => { | ||
resultatsDis: async ( | ||
params?: ResultatsDisParams, | ||
): Promise<HubeauResponse> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
@@ -34,5 +39,5 @@ const datas = await getRequest( | ||
}, | ||
resultatsDisCsv: async (params?: ResultatsDisParams): Promise<HubeauResponse> => { | ||
resultatsDisCsv: async (params?: ResultatsDisParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.qualiteEauPotable, | ||
@@ -39,0 +44,0 @@ `/resultats_dis.csv?${formattedParams}`, |
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import {getRequest,getRequestCsv} from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -16,5 +16,5 @@ import { HubeauResponse } from '../types/communs'; | ||
}, | ||
analysesCsv: async (params?: AnalysesParams): Promise<HubeauResponse> => { | ||
analysesCsv: async (params?: AnalysesParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.qualiteNappes, | ||
@@ -33,5 +33,5 @@ `/analyses.csv?${formattedParams}`, | ||
}, | ||
stationsCsv: async (params?: StationsParams): Promise<HubeauResponse> => { | ||
stationsCsv: async (params?: StationsParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.qualiteNappes, | ||
@@ -38,0 +38,0 @@ `/stations.csv?${formattedParams}`, |
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import { getRequest, getRequestCsv } from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -21,5 +21,5 @@ import { HubeauResponse } from '../types/communs'; | ||
}, | ||
analysePcCsv: async (params?: AnalysePcParams): Promise<HubeauResponse> => { | ||
analysePcCsv: async (params?: AnalysePcParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.qualiteRivieres, | ||
@@ -38,5 +38,5 @@ `/analyse_pc.csv?${formattedParams}`, | ||
}, | ||
stationPcCsv: async (params?: StationPcParams): Promise<HubeauResponse> => { | ||
stationPcCsv: async (params?: StationPcParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.qualiteRivieres, | ||
@@ -55,7 +55,5 @@ `/station_pc.csv?${formattedParams}`, | ||
}, | ||
operationPcCsv: async ( | ||
params?: OperationPcParams, | ||
): Promise<HubeauResponse> => { | ||
operationPcCsv: async (params?: OperationPcParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.qualiteRivieres, | ||
@@ -78,5 +76,5 @@ `/operation_pc.csv?${formattedParams}`, | ||
params?: ConditionEnvironnementaleParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.qualiteRivieres, | ||
@@ -83,0 +81,0 @@ `/condition_environnementale_pc.csv?${formattedParams}`, |
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import {getRequest,getRequestCsv} from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -23,5 +23,5 @@ import { HubeauResponse } from '../types/communs'; | ||
params?: ContaminantsChimiquesParams, | ||
): Promise<HubeauResponse> => { | ||
): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.surveillanceLittoral, | ||
@@ -40,5 +40,5 @@ `/contaminants_chimiques.csv?${formattedParams}`, | ||
}, | ||
lieuxSurvCsv: async (params?: LieuxSurvParams): Promise<HubeauResponse> => { | ||
lieuxSurvCsv: async (params?: LieuxSurvParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.surveillanceLittoral, | ||
@@ -45,0 +45,0 @@ `/lieux_surv.csv?${formattedParams}`, |
import { entryPoints } from '../constants'; | ||
import getRequest from '../http'; | ||
import {getRequest,getRequestCsv} from '../http'; | ||
import { objectToStringParameters } from '../utils/utils'; | ||
@@ -16,5 +16,5 @@ import { HubeauResponse } from '../types/communs'; | ||
}, | ||
chroniqueCsv: async (params?: ChroniqueParams): Promise<HubeauResponse> => { | ||
chroniqueCsv: async (params?: ChroniqueParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.temperature, | ||
@@ -33,5 +33,5 @@ `/chronique.csv?${formattedParams}`, | ||
}, | ||
stationCsv: async (params?: StationParams): Promise<HubeauResponse> => { | ||
stationCsv: async (params?: StationParams): Promise<string> => { | ||
const formattedParams = params ? objectToStringParameters(params) : ''; | ||
const datas = await getRequest( | ||
const datas = await getRequestCsv( | ||
entryPoints.temperature, | ||
@@ -38,0 +38,0 @@ `/station.csv?${formattedParams}`, |
import superagent from 'superagent'; | ||
import { hostname } from '../constants'; | ||
import { HubeauResponse } from '../types/communs'; | ||
async function getRequest( | ||
export async function getRequest( | ||
entryPoint: string, | ||
args: string | undefined, | ||
): Promise<HubeauResponse> { | ||
try { | ||
const res = await superagent.get(`${hostname}${entryPoint}${args}`); | ||
return JSON.parse(res.text); | ||
} catch (err: any) { | ||
return JSON.parse(err); | ||
} | ||
} | ||
export async function getRequestCsv( | ||
entryPoint: string, | ||
args: string | undefined, | ||
): Promise<string> { | ||
@@ -16,2 +28,12 @@ try { | ||
export default getRequest; | ||
export async function getRequestXml( | ||
entryPoint: string, | ||
args: string | undefined, | ||
): Promise<string> { | ||
try { | ||
const res = await superagent.get(`${hostname}${entryPoint}${args}`); | ||
return res.text; | ||
} catch (err: any) { | ||
return err.toString(); | ||
} | ||
} |
type NestedObject = { | ||
[key: string]: string | number | boolean | string[] | number[]; | ||
}; | ||
type Response = { | ||
export type HubeauResponseJson = { | ||
count: number; | ||
@@ -18,3 +19,3 @@ prev: string; | ||
}; | ||
export type HubeauResponse = string | Response; | ||
export type HubeauResponse = any; | ||
export type Mois = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; | ||
@@ -21,0 +22,0 @@ export type Format = 'json' | 'geojson'; |
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
353476
8007