Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grdf_konnector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
grdf_konnector
Commits
0e40abfb
Commit
0e40abfb
authored
1 year ago
by
Bastien DUMONT
Browse files
Options
Downloads
Patches
Plain Diff
chore(type): add response types
parent
ee88bec0
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!32
2.0 Release
,
!29
chore(type): add response types
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.vscode/settings.json
+4
-1
4 additions, 1 deletion
.vscode/settings.json
src/index.js
+2
-1
2 additions, 1 deletion
src/index.js
src/types.ts
+47
-0
47 additions, 0 deletions
src/types.ts
with
53 additions
and
2 deletions
.vscode/settings.json
+
4
−
1
View file @
0e40abfb
...
@@ -39,9 +39,11 @@
...
@@ -39,9 +39,11 @@
"energie"
,
"energie"
,
"etat"
,
"etat"
,
"firstname"
,
"firstname"
,
"gaziere"
,
"grandlyon"
,
"grandlyon"
,
"grdf"
,
"grdf"
,
"grdfgrandlyon"
,
"grdfgrandlyon"
,
"journee"
,
"konnector"
,
"konnector"
,
"konnectors"
,
"konnectors"
,
"lastname"
,
"lastname"
,
...
@@ -49,7 +51,8 @@
...
@@ -49,7 +51,8 @@
"numero"
,
"numero"
,
"perim"
,
"perim"
,
"periode"
,
"periode"
,
"publiees"
"publiees"
,
"releve"
],
],
"prettier.semi"
:
true
"prettier.semi"
:
true
}
}
This diff is collapsed.
Click to expand it.
src/index.js
+
2
−
1
View file @
0e40abfb
...
@@ -188,7 +188,8 @@ async function getData(token, idPCE, startDate, endDate) {
...
@@ -188,7 +188,8 @@ async function getData(token, idPCE, startDate, endDate) {
})
})
.
then
(
result
=>
{
.
then
(
result
=>
{
return
result
.
match
(
/.+/g
).
map
(
s
=>
{
return
result
.
match
(
/.+/g
).
map
(
s
=>
{
result
=
JSON
.
parse
(
s
)
/** @type {import('./types').GRDFDataRange} */
const
result
=
JSON
.
parse
(
s
)
if
(
result
.
statut_restitution
!==
null
)
{
if
(
result
.
statut_restitution
!==
null
)
{
/**
/**
* Handle no data issue when retrieving grdf data.
* Handle no data issue when retrieving grdf data.
...
...
This diff is collapsed.
Click to expand it.
src/types.ts
+
47
−
0
View file @
0e40abfb
...
@@ -65,3 +65,50 @@ export type Account = {
...
@@ -65,3 +65,50 @@ export type Account = {
export
type
AccountData
=
{
export
type
AccountData
=
{
consentId
:
string
|
undefined
consentId
:
string
|
undefined
}
}
/** Data response for donnees_consos_informatives?date_debut=2023-05-03&date_fin=2024-05-03 */
export
type
GRDFDataRange
=
{
pce
:
{
id_pce
:
string
}
periode
:
{
valeur
:
null
date_debut
:
Date
date_fin
:
Date
}
releve_debut
:
{
date_releve
:
Date
index_brut_debut
:
Index
index_converti_debut
:
Index
}
releve_fin
:
{
date_releve
:
Date
index_brut_fin
:
Index
index_converti_fin
:
Index
}
consommation
:
{
date_debut_consommation
:
Date
date_fin_consommation
:
Date
flag_retour_zero
:
boolean
volume_brut
:
number
coeff_calcul
:
{
coeff_pta
:
null
valeur_pcs
:
null
coeff_conversion
:
number
}
volume_converti
:
number
energie
:
number
type_qualif_conso
:
string
sens_flux_gaz
:
string
statut_conso
:
string
journee_gaziere
:
Date
type_conso
:
string
}
statut_restitution
:
n
ull
|
{
code
:
string
message
:
string
}
}
type
Index
=
{
valeur_index
:
number
horodate_Index
:
Date
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment