Commit b1bf471d authored by Emmanuel Raviart's avatar Emmanuel Raviart

Revert to previous name Deliasse.

parent b504f779
> Tricoteuses-API -- A GraphQL server for French Parliament open data
> Deliasse-API -- A GraphQL server for French Parliament open data
> By: Emmanuel Raviart <emmanuel@raviart.com>
>
> Copyright (C) 2018 Paula Forteza & Emmanuel Raviart
> https://framagit.org/parlement-ouvert/tricoteuses-api
> https://framagit.org/parlement-ouvert/deliasse-api
>
> Tricoteuses-API is free software; you can redistribute it and/or modify
> Deliasse-API is free software; you can redistribute it and/or modify
> it under the terms of the GNU Affero General Public License as
> published by the Free Software Foundation, either version 3 of the
> License, or (at your option) any later version.
>
> Tricoteuses-API is distributed in the hope that it will be useful,
> Deliasse-API is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> GNU Affero General Public License for more details.
......
# Tricoteuses-API
# Deliasse-API
> Tricoteuses-API is a GraphQL server for French Parliament open data.
> Deliasse-API is a GraphQL server for French Parliament open data.
[Eliasse](http://eliasse.assemblee-nationale.fr/) is a web application developed by the French National Assembly, that allows real-time monitoring of amendments.
Tricoteuses-API is a module of the french [Open Parliament Platform](https://parlement-ouvert.fr).
Deliasse-API is a module of the french [Open Parliament Platform](https://parlement-ouvert.fr).
Tricoteuses-API is free and open source software, developped by the french Member of Parliament [Paula Forteza](https://forteza.fr) and her team.
Deliasse-API is free and open source software, developped by the french Member of Parliament [Paula Forteza](https://forteza.fr) and her team.
## Usage
......
/**
* Tricoteuses-API -- A GraphQL server for French Parliament open data
* Deliasse-API -- A GraphQL server for French Parliament open data
* By: Emmanuel Raviart <emmanuel@raviart.com>
*
* Copyright (C) 2018 Paula Forteza & Emmanuel Raviart
* https://framagit.org/parlement-ouvert/tricoteuses-api
* https://framagit.org/parlement-ouvert/deliasse-api
*
* Tricoteuses-API is free software; you can redistribute it and/or modify
* Deliasse-API is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Tricoteuses-API is distributed in the hope that it will be useful,
* Deliasse-API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
......@@ -22,7 +22,7 @@
import config from "./global"
Object.assign(config, {
title: "Tricoteuses-API (dev)",
title: "Deliasse-API (dev)",
})
export default config
/**
* Tricoteuses-API -- A GraphQL server for French Parliament open data
* Deliasse-API -- A GraphQL server for French Parliament open data
* By: Emmanuel Raviart <emmanuel@raviart.com>
*
* Copyright (C) 2018 Paula Forteza & Emmanuel Raviart
* https://framagit.org/parlement-ouvert/tricoteuses-api
* https://framagit.org/parlement-ouvert/deliasse-api
*
* Tricoteuses-API is free software; you can redistribute it and/or modify
* Deliasse-API is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Tricoteuses-API is distributed in the hope that it will be useful,
* Deliasse-API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
......@@ -38,7 +38,7 @@ export default {
},
contact: {
// email:
name: process.env.TRICOTEUSES_CONTACT || "Tricoteuses-API Team",
name: process.env.TRICOTEUSES_CONTACT || "Deliasse-API Team",
// url:
},
data: process.env.TRICOTEUSES_DATA || "data",
......@@ -54,6 +54,6 @@ export default {
},
port: process.env.TRICOTEUSES_PORT || 2048,
proxy: process.env.TRICOTEUSES_PROXY || false, // Is this application used behind a trusted proxy?
title: process.env.TRICOTEUSES_TITLE || "Tricoteuses-API",
title: process.env.TRICOTEUSES_TITLE || "Deliasse-API",
wsUrl: process.env.TRICOTEUSES_WS || "ws://localhost:2048",
}
/**
* Tricoteuses-API -- A GraphQL server for French Parliament open data
* Deliasse-API -- A GraphQL server for French Parliament open data
* By: Emmanuel Raviart <emmanuel@raviart.com>
*
* Copyright (C) 2018 Paula Forteza & Emmanuel Raviart
* https://framagit.org/parlement-ouvert/tricoteuses-api
* https://framagit.org/parlement-ouvert/deliasse-api
*
* Tricoteuses-API is free software; you can redistribute it and/or modify
* Deliasse-API is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Tricoteuses-API is distributed in the hope that it will be useful,
* Deliasse-API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
......
/**
* Tricoteuses-API -- A GraphQL server for French Parliament open data
* Deliasse-API -- A GraphQL server for French Parliament open data
* By: Emmanuel Raviart <emmanuel@raviart.com>
*
* Copyright (C) 2018 Paula Forteza & Emmanuel Raviart
* https://framagit.org/parlement-ouvert/tricoteuses-api
* https://framagit.org/parlement-ouvert/deliasse-api
*
* Tricoteuses-API is free software; you can redistribute it and/or modify
* Deliasse-API is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Tricoteuses-API is distributed in the hope that it will be useful,
* Deliasse-API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
......
/**
* Tricoteuses-API -- A GraphQL server for French Parliament open data
* Deliasse-API -- A GraphQL server for French Parliament open data
* By: Emmanuel Raviart <emmanuel@raviart.com>
*
* Copyright (C) 2018 Paula Forteza & Emmanuel Raviart
* https://framagit.org/parlement-ouvert/tricoteuses-api
* https://framagit.org/parlement-ouvert/deliasse-api
*
* Tricoteuses-API is free software; you can redistribute it and/or modify
* Deliasse-API is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Tricoteuses-API is distributed in the hope that it will be useful,
* Deliasse-API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
......@@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require("babel-polyfill") //Must be at the top of the entry point to application.
require("babel-polyfill") //Must be at the top of the entry point to application.
require("babel-core/register")
require("./src/configure")
{
"name": "tricoteuses-api",
"name": "deliasse-api",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
......
{
"name": "tricoteuses-api",
"name": "deliasse-api",
"version": "1.0.0",
"description": "GraphQL server for French Parliament open data",
"main": "server.js",
......@@ -10,7 +10,7 @@
},
"repository": {
"type": "git",
"url": "https://framagit.org/parlement-ouvert/tricoteuses-api.git"
"url": "https://framagit.org/parlement-ouvert/deliasse-api.git"
},
"keywords": [
"ammendment",
......
/**
* Tricoteuses-API -- A GraphQL server for French Parliament open data
* Deliasse-API -- A GraphQL server for French Parliament open data
* By: Emmanuel Raviart <emmanuel@raviart.com>
*
* Copyright (C) 2018 Paula Forteza & Emmanuel Raviart
* https://framagit.org/parlement-ouvert/tricoteuses-api
* https://framagit.org/parlement-ouvert/deliasse-api
*
* Tricoteuses-API is free software; you can redistribute it and/or modify
* Deliasse-API is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Tricoteuses-API is distributed in the hope that it will be useful,
* Deliasse-API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
......@@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require("babel-polyfill") //Must be at the top of the entry point to application.
require("babel-polyfill") //Must be at the top of the entry point to application.
require("babel-core/register")
require("./src/server")
/**
* Tricoteuses-API -- A GraphQL server for French Parliament open data
* Deliasse-API -- A GraphQL server for French Parliament open data
* By: Emmanuel Raviart <emmanuel@raviart.com>
*
* Copyright (C) 2018 Paula Forteza & Emmanuel Raviart
* https://framagit.org/parlement-ouvert/tricoteuses-api
* https://framagit.org/parlement-ouvert/deliasse-api
*
* Tricoteuses-API is free software; you can redistribute it and/or modify
* Deliasse-API is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Tricoteuses-API is distributed in the hope that it will be useful,
* Deliasse-API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
......
/**
* Tricoteuses-API -- A GraphQL server for French Parliament open data
* Deliasse-API -- A GraphQL server for French Parliament open data
* By: Emmanuel Raviart <emmanuel@raviart.com>
*
* Copyright (C) 2018 Paula Forteza & Emmanuel Raviart
* https://framagit.org/parlement-ouvert/tricoteuses-api
* https://framagit.org/parlement-ouvert/deliasse-api
*
* Tricoteuses-API is free software; you can redistribute it and/or modify
* Deliasse-API is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Tricoteuses-API is distributed in the hope that it will be useful,
* Deliasse-API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
......@@ -35,7 +35,7 @@ async function configureDatabases() {
RETURN NEW;
END;
$$ LANGUAGE plpgsql
`,
`
)
try {
await ameliDb.none("DROP TRIGGER amendement_upserted ON amd")
......@@ -45,7 +45,7 @@ async function configureDatabases() {
CREATE TRIGGER amendement_upserted AFTER INSERT OR UPDATE ON amd
FOR EACH ROW
EXECUTE PROCEDURE notify_amendement_upserted()
`,
`
)
// Configure "an" database.
......
/**
* Tricoteuses-API -- A GraphQL server for French Parliament open data
* Deliasse-API -- A GraphQL server for French Parliament open data
* By: Emmanuel Raviart <emmanuel@raviart.com>
*
* Copyright (C) 2018 Paula Forteza & Emmanuel Raviart
* https://framagit.org/parlement-ouvert/tricoteuses-api
* https://framagit.org/parlement-ouvert/deliasse-api
*
* Tricoteuses-API is free software; you can redistribute it and/or modify
* Deliasse-API is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Tricoteuses-API is distributed in the hope that it will be useful,
* Deliasse-API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
......@@ -565,8 +565,8 @@ const resolvers = {
FROM avicom
WHERE id = $1
`,
amd.avcid,
),
amd.avcid
)
)
},
async avg(amd) {
......@@ -579,8 +579,8 @@ const resolvers = {
FROM avigvt
WHERE id = $1
`,
amd.avgid,
),
amd.avgid
)
)
},
async noment(amd) {
......@@ -593,7 +593,7 @@ const resolvers = {
FROM ent
WHERE id = $1
`,
amd.nomentid,
amd.nomentid
)
if (ent === null) return null
switch (ent.typ) {
......@@ -606,7 +606,7 @@ const resolvers = {
FROM cab
WHERE entid = $1
`,
ent.id,
ent.id
)),
})
case "C":
......@@ -618,7 +618,7 @@ const resolvers = {
FROM com_ameli
WHERE entid = $1
`,
ent.id,
ent.id
)),
})
case "E":
......@@ -630,7 +630,7 @@ const resolvers = {
FROM sen_ameli
WHERE entid = $1
`,
ent.id,
ent.id
)),
})
case "G":
......@@ -642,7 +642,7 @@ const resolvers = {
FROM grppol_ameli
WHERE entid = $1
`,
ent.id,
ent.id
)),
})
case "M":
......@@ -654,7 +654,7 @@ const resolvers = {
FROM gvt
WHERE entid = $1
`,
ent.id,
ent.id
)),
})
default:
......@@ -672,8 +672,8 @@ const resolvers = {
FROM sor
WHERE id = $1
`,
amd.sorid,
),
amd.sorid
)
)
},
async sub(amd) {
......@@ -686,8 +686,8 @@ const resolvers = {
FROM sub
WHERE id = $1
`,
amd.subid,
),
amd.subid
)
)
},
async txt(amd) {
......@@ -700,8 +700,8 @@ const resolvers = {
FROM txt_ameli
WHERE id = $1
`,
amd.txtid,
),
amd.txtid
)
)
},
},
......@@ -737,8 +737,8 @@ const resolvers = {
ON id = entid
WHERE id = $1
`,
sen.grpid,
),
sen.grpid
)
)
},
},
......@@ -753,8 +753,8 @@ const resolvers = {
FROM typsub
WHERE id = $1
`,
sub.typid,
),
sub.typid
)
)
},
},
......@@ -766,7 +766,7 @@ const resolvers = {
FROM amd
WHERE txtid = $1
`,
txt.id,
txt.id
)).map(entryToAmeliAmd)
},
async nat(txt) {
......@@ -779,8 +779,8 @@ const resolvers = {
FROM nat
WHERE id = $1
`,
txt.natid,
),
txt.natid
)
)
},
async sesdep(txt) {
......@@ -793,8 +793,8 @@ const resolvers = {
FROM ses
WHERE id = $1
`,
txt.sesdepid,
),
txt.sesdepid
)
)
},
async sesins(txt) {
......@@ -807,8 +807,8 @@ const resolvers = {
FROM ses
WHERE id = $1
`,
txt.sesinsid,
),
txt.sesinsid
)
)
},
async subs(txt) {
......@@ -818,7 +818,7 @@ const resolvers = {
FROM sub
WHERE txtid = $1
`,
txt.id,
txt.id
)).map(entryToAmeliSub)
},
},
......@@ -851,7 +851,7 @@ const resolvers = {
`,
{
legislature,
},
}
)).map(entryToAnDossier)
},
discussion(_, { bibard, bibardSuffixe, legislature, organe }) {
......@@ -862,8 +862,8 @@ const resolvers = {
legislature.toString(),
organe,
bibard + (bibardSuffixe || ""),
"discussion.json",
),
"discussion.json"
)
)
const discussion = JSON.parse(discussionText)
......@@ -872,7 +872,7 @@ const resolvers = {
"assemblee",
legislature.toString(),
organe,
"prochain-a-discuter.json",
"prochain-a-discuter.json"
)
let prochainADiscuterText
try {
......@@ -905,7 +905,7 @@ const resolvers = {
legislature.toString(),
organe,
bibard + (bibardSuffixe || ""),
"pages.json",
"pages.json"
)
let pagesText
try {
......@@ -930,7 +930,7 @@ const resolvers = {
"assemblee",
legislature,
enveloppeAmendement.numero,
organe,
organe
),
auteurGroupe: enveloppeAmendement.auteurGroupe || null,
})),
......@@ -938,7 +938,7 @@ const resolvers = {
},
ordreDuJour(_, { legislature, organe }) {
const text = fs.readFileSync(
path.join(config.data, "assemblee", legislature.toString(), organe, "ordre-du-jour.json"),
path.join(config.data, "assemblee", legislature.toString(), organe, "ordre-du-jour.json")
)
return JSON.parse(text)
},
......@@ -958,8 +958,8 @@ const resolvers = {
num,
sesinsLil,
txttyp,
},
),
}
)
)
},
},
......@@ -977,7 +977,7 @@ const resolvers = {
},
(/* object, variables, context, info */) => {
return true
},
}
),
},
amendementUpserted: {
......@@ -993,7 +993,7 @@ const resolvers = {
},
(/* object, variables, context, info */) => {
return true
},
}
),
},
prochainADiscuterUpserted: {
......@@ -1009,7 +1009,7 @@ const resolvers = {
},
(/* object, variables, context, info */) => {
return true
},
}
),
},
},
......@@ -1154,8 +1154,8 @@ export async function listenToAmeliAmdUpserted() {
FROM amd
WHERE id = $1
`,
data.payload,
),
data.payload
)
)
pubsub.publish("ameliAmdUpserted", amendement)
} else {
......@@ -1194,7 +1194,7 @@ function readAmendement(bibard, bibardSuffixe, chambre, legislature, numero, org
legislature.toString(),
organe,
bibard + (bibardSuffixe || ""),
"amendement-" + numero + ".json",
"amendement-" + numero + ".json"
)
let text
try {
......
/**
* Tricoteuses-API -- A GraphQL server for French Parliament open data
* Deliasse-API -- A GraphQL server for French Parliament open data
* By: Emmanuel Raviart <emmanuel@raviart.com>
*
* Copyright (C) 2018 Paula Forteza & Emmanuel Raviart
* https://framagit.org/parlement-ouvert/tricoteuses-api
* https://framagit.org/parlement-ouvert/deliasse-api
*
* Tricoteuses-API is free software; you can redistribute it and/or modify
* Deliasse-API is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Tricoteuses-API is distributed in the hope that it will be useful,
* Deliasse-API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
......
/**
* Tricoteuses-API -- A GraphQL server for French Parliament open data
* Deliasse-API -- A GraphQL server for French Parliament open data
* By: Emmanuel Raviart <emmanuel@raviart.com>
*
* Copyright (C) 2018 Paula Forteza & Emmanuel Raviart
* https://framagit.org/parlement-ouvert/tricoteuses-api
* https://framagit.org/parlement-ouvert/deliasse-api
*
* Tricoteuses-API is free software; you can redistribute it and/or modify
* Deliasse-API is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Tricoteuses-API is distributed in the hope that it will be useful,
* Deliasse-API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
......@@ -48,7 +48,7 @@ app.use(
graphiqlExpress({
endpointURL: "/graphql",
subscriptionsEndpoint: `${config.wsUrl}/subscriptions`,
}),
})
)
app.use("/graphql", graphqlExpress({ schema: graphqlController.schema }))
......@@ -78,7 +78,7 @@ function startExpress() {
{
server,
path: "/subscriptions",
},
}
)
})
server.timeout = 30 * 60 * 1000 // 30 minutes (in milliseconds)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment