Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • clients/wotwizard-ui
  • manutopik/wotwizard-ui
  • wellno1/wotwizard-ui
3 results
Show changes
Showing
with 1136 additions and 383 deletions
<template>
<aside class="menu shadow position-fixed">
<div class="nav_header pb-3 mb-4">
<nuxt-link :to="localePath('/')" class="d-flex">
<img src="@/assets/img/logo.png" alt="Accueil" class="logo" />
<aside class="menu position-fixed d-flex flex-column border-end">
<div class="mb-4">
<nuxt-link
@click.native="
if (screenwidth < 1200) {
toggleMenu()
}
"
:to="localePath('/')"
class="logo d-flex px-3 pt-3">
<img :src="$icon(512)" alt="Accueil" />
<div>
<h1 class="h2">Wotwizard</h1>
<h1 class="h3">Wotwizard</h1>
<small class="text-muted">{{ $t("slogan") }}</small>
</div>
</nuxt-link>
<div
class="d-flex text-info justify-content-between align-items-baseline mt-3 mx-2">
<div class="">v0.05</div>
<div class="p-3 border-bottom border-2 text-muted">
<ApolloList />
<div class="small mt-2">API graphQL v{{ version }}</div>
<div class="small" v-if="countMax">
{{ $t("bloc.title") }}<span class="font-weight-bold">{{
countMax.number
}}</span>
({{ $d(new Date(countMax.utc0 * 1000), "short") }} {{ $t("time.a") }}
{{ $d(new Date(countMax.utc0 * 1000), "time") }})
({{ $d(new Date(countMax.utc0 * 1000)) }} {{ $t("time.a") }}
{{ new Date(countMax.utc0 * 1000).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) }})
</div>
</div>
<button
type="button"
class="close position-absolute d-xl-none"
aria-label="Close"
@click="toggleMenu">
<span aria-hidden="true">&times;</span>
</button>
class="btn-close position-absolute d-xl-none"
:aria-label="$t('aria.close')"
@click="toggleMenu"></button>
</div>
<nav class="pt-4 rounded">
<nav class="py-2 rounded flex-grow-1">
<NavigationMenuGroup
v-for="menu in menus"
:key="menu.title"
:menu="menu"
@toggleMenu="toggleMenu" />
</nav>
<div class="py-3 text-center">
<button
class="btn btn-secondary btn-sm"
@click="
if (screenwidth < 1200) {
toggleMenu()
}
$router.push(localePath('a-propos'))
">
<solid-terminal-icon
style="width: 0.9rem"
aria-hidden="true" />&nbsp;v{{ version_ww }} |
{{ $t("apropos.title") }}
</button>
</div>
</aside>
</template>
<script>
import pkg from "~/package.json"
import { LAST_BLOCK } from "@/graphql/queries.js"
import { VERSION } from "@/graphql/queries.js"
export default {
data() {
return {
screenwidth: 0,
version_ww: pkg.version
}
},
props: {
menus: Array
},
methods: {
toggleMenu() {
this.$emit("toggleMenu")
},
onResize() {
this.$favourites.fixColumns()
this.screenwidth = window.innerWidth
}
},
apollo: {
$client() {
return this.getApolloClient
},
countMax: {
query: LAST_BLOCK,
error(err) {
this.error = err.message
}
query: LAST_BLOCK
},
version: {
query: VERSION
}
},
mounted() {
this.screenwidth = window.innerWidth
this.$nextTick(function () {
this.onResize()
})
window.addEventListener("resize", this.onResize)
}
}
</script>
<style lang="scss" scoped>
aside {
background: var(--bg-menu-color);
}
nav {
background: var(--background-color-secondary);
overflow-x: hidden;
overflow-y: auto;
scrollbar-width: thin;
}
</style>
<template>
<div class="container pt-5">
<div class="row suivis">
<div class="col">
<div v-if="members && members.length != 0">
<BtnSearch
@erase="search = ''"
v-model="search"
class="col-sm-7 col-md-6 col-lg-5 col-xl-4 mx-auto mb-4" />
<MemberFilter
:selectedStatus.sync="filterStatus"
:selectedCertifStatus.sync="filterCerts"
:type="type" />
<MemberList
defaultSort="date_membership"
:members="filteredMembers"
:id="type" />
<input
type="checkbox"
class="btn-check"
:id="'seeAll' + _uid"
:checked="displayAll"
@click="displayAll = !displayAll" />
<label class="btn mb-3 btn-outline-secondary" :for="'seeAll' + _uid">
<span v-if="!displayAll">{{ $t("suivis.display.all") }}</span>
<span v-else>{{ $t("suivis.display.out") }}</span>
</label>
<button
class="btn btn-danger d-block m-auto mb-3"
v-if="type == 'favoris'"
@click="deleteAllFavorites">
<solid-trash-icon class="icon" aria-hidden="true" />
{{ $t("suivis.supprimer_tous") }}
</button>
</div>
<div class="alert alert-info" v-if="members && members.length == 0">
{{ $t("suivis.none") }}
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
search: "",
filterStatus: [],
filterCerts: "",
displayAll: false,
nbItems: 0
}
},
props: {
type: {
type: String,
default: ""
},
members: {
type: Array,
required: true
}
},
computed: {
filteredMembers() {
return this.members.filter(
(el) =>
(this.displayAll ||
!(
el.status == "MEMBER" &&
this.$options.filters.dateStatus(el.certsLimit) == "success"
)) &&
el.uid.toLowerCase().includes(this.search.toLowerCase()) &&
this.filterStatus.includes(el.status) &&
el.expired == (this.filterCerts == "outdated")
)
}
},
methods: {
deleteAllFavorites() {
if (window.confirm(this.$t("suivis.confirm"))) {
this.$favourites.list = []
localStorage.removeItem("favourites")
}
}
},
mounted() {
this.$emit("update:nbItems", this.filteredMembers.length)
},
watch: {
filteredMembers(n, o) {
this.$emit("update:nbItems", n.length)
},
filterCerts(n, o) {
this.displayAll = n == "outdated"
}
}
}
</script>
<style lang="scss">
.suivis .table-responsive tbody {
max-height: 43.5vh;
}
</style>
{
"AxiomTeam": "https://gql.wotwizard.axiom-team.fr/",
"trentesaux": "https://gql.wotwizard.trentesaux.fr/",
"Pini": "https://wotwizard.pini.fr/"
}
......@@ -25,6 +25,12 @@ export const cache = new InMemoryCache({
return `${object.member.hash}:${object.date}:${object.after}:${object.proba}`
case "GroupId":
return `${object.id.hash}`
case "CertHist":
return `${object.id.uid}:${object.hist[0].block.number}`
case "CertEvent":
return `${object.in}:${object.block.number}`
case "Block":
return `${object.number}`
default:
return defaultDataIdFromObject(object) // fall back to default handling
}
......
import { HttpLink } from 'apollo-link-http'
import { setContext } from 'apollo-link-context'
import { from } from 'apollo-link'
import { ENDPOINT1 } from './endpoints'
import { cache } from '../cache'
export default ctx => {
const ssrMiddleware = setContext((_, { headers }) => {
if (process.client) return headers
return {
headers
}
})
const httpLink = new HttpLink({
uri: ENDPOINT1
})
const link = from([ssrMiddleware, httpLink])
return {
link,
cache,
// https://github.com/nuxt-community/apollo-module/issues/306#issuecomment-607225431
defaultHttpLink: false
}
}
\ No newline at end of file
module.exports = {
ENDPOINT1: 'https://wwgql.coinduf.eu',
ENDPOINT2: 'https://myserver.com'
}
\ No newline at end of file
import { HttpLink } from 'apollo-link-http'
import { setContext } from 'apollo-link-context'
import { from } from 'apollo-link'
import { ENDPOINT2 } from './endpoints'
import { cache } from '../cache'
export default ctx => {
const ssrMiddleware = setContext((_, { headers }) => {
if (process.client) return headers
return {
headers
}
})
const httpLink = new HttpLink({
uri: ENDPOINT2
})
const link = from([ssrMiddleware, httpLink])
return {
link,
cache,
// https://github.com/nuxt-community/apollo-module/issues/306#issuecomment-607225431
defaultHttpLink: false
}
}
\ No newline at end of file
# WotWizard GraphQL TypeSystem
# https://git.duniter.org/gerard94/WotWizard/-/blob/master/Help/TypeSystem.txt
type Query {
......@@ -29,14 +30,14 @@ type Query {
"'wwResult' displays the content of the WotWizard window"
wwResult: WWResult!
"'memEnds' displays the list of members, among the reference list 'group', who are about to loose their memberships, in the increasing order of event dates (bct); 'startFromNow' gives the period (in seconds) before the beginning of the list (0 if absent or null) , and 'period' gives the period covered by the list (infinite if absent or null). If 'group' is null or empty, the reference list is the whole Web Of Trust; if any string in 'group' is empty or doesn't refer to a known identity, it's not taken into account for the calculation, and, furthermore, if it is not empty and unknown, an error is raised"
"'memEnds' displays the list of members, among the reference list 'group', who are about to loose their memberships, in the increasing order of event dates (bct); 'startFromNow' gives the period (in seconds) before the beginning of the list (0 if absent or null) , and 'period' gives the period covered by the list (infinite if absent or null). If 'group' is null or empty, the reference list is the whole Web Of Trust; if any string in 'group' is empty or doesn't refer to an identity known by the blockchain, it's not taken into account for the calculation, and, furthermore, if it is not empty and unknown to the blockchain, an error is raised"
memEnds (group: [String!], startFromNow: Int64, period: Int64): [Identity!]!
"'missEnds' displays the list of identities, among the reference list 'group', who are MISSING and about to be revoked, in the increasing order of event dates (bct); 'startFromNow' gives the period (in seconds) before the beginning of the list (0 if absent or null) , and 'period' gives the period covered by the list (infinite if absent or null). If 'group' is null or empty, the reference list is the whole Web Of Trust; if any string in 'group' is empty or doesn't refer to a known identity, it's not taken into account for the calculation, and, furthermore, if it is not empty and unknown, an error is raised"
"'missEnds' displays the list of identities, among the reference list 'group', who are MISSING and about to be revoked, in the increasing order of event dates (bct); 'startFromNow' gives the period (in seconds) before the beginning of the list (0 if absent or null) , and 'period' gives the period covered by the list (infinite if absent or null). If 'group' is null or empty, the reference list is the whole Web Of Trust; if any string in 'group' is empty or doesn't refer to an identity known by the blockchain, it's not taken into account for the calculation, and, furthermore, if it is not empty and unknown to the blockchain, an error is raised"
missEnds (group: [String!], startFromNow: Int64, period: Int64): [Identity!]!
"'certEnds' displays the list of identities , among the reference list 'group', who are MEMBER or (possibly) MISSING and about to loose their 'ParameterName.sigQty'th oldest certification, in the increasing order of event dates (bct); 'startFromNow' gives the period (in seconds) before the beginning of the list (0 if absent or null) , and 'period' gives the period covered by the list (infinite if absent or null). If 'group' is null or empty, the reference list is the whole Web Of Trust; if any string in 'group' is empty or doesn't refer to a known identity, it's not taken into account for the calculation, and, furthermore, if it is not empty and unknown, an error is raised"
certEnds (group: [String!], startFromNow: Int64, period: Int64, missingIncluded: Boolean! = true): [DatedIdentity!]!
"'certEnds' displays the list of identities , among the reference list 'group', who are MEMBER or (possibly) MISSING and about to loose their 'ParameterName.sigQty'th oldest certification, in the increasing order of event dates (bct); 'startFromNow' gives the period (in seconds) before the beginning of the list (0 if absent or null) , and 'period' gives the period covered by the list (infinite if absent or null). If 'group' is null or empty, the reference list is the whole Web Of Trust; if any string in 'group' is empty or doesn't refer to an identity known by the blockchain, it's not taken into account for the calculation, and, furthermore, if it is not empty and unknown to the blockchain, an error is raised"
certEnds (group: [String!], startFromNow: Int64, period: Int64, missingIncluded: Boolean! = true): [Identity!]!
"'countMin' gives the first block of the blockchain"
countMin: Block!
......@@ -80,16 +81,16 @@ type Query {
"'version' returns a string describing the version of the graphQL server"
version: String!
"'calcDist' returns the distance of the identity whose pseudo is 'uid' when the members 'certifiers' are added to her own certifiers. 'uid' may be any string, even null or empty; if 'uid' is null or empty or doesn't refer to a known identity, it's not taken into account for the calculation, and, furthermore, if it is not null, not empty and unknown, an error is raised; the same for any string in 'certifiers'"
"'calcDist' returns the distance of the identity whose pseudo is 'uid' when the members 'certifiers' are added to her own certifiers. 'uid' may be any string, even null or empty; if 'uid' is null or empty or doesn't refer to a known identity, it's not taken into account for the calculation, and, furthermore, if it is not null, not empty and unknown, an error is raised; the same for any string in 'certifiers', which must also correspond to a member"
calcDist (uid: String, certifiers: [String!]): Distance!
"'calcQual' returns the quality of the identity whose pseudo is 'uid' when the members 'certifiers' are added to her own certifiers. 'uid' may be any string, even null or empty; if 'uid' is null or empty or doesn't refer to a known identity, it's not taken into account for the calculation, and, furthermore, if it is not null, not empty and unknown, an error is raised; the same for any string in 'certifiers'"
"'calcQual' returns the quality of the identity whose pseudo is 'uid' when the members 'certifiers' are added to her own certifiers. 'uid' may be any string, even null or empty; if 'uid' is null or empty or doesn't refer to a known identity, it's not taken into account for the calculation, and, furthermore, if it is not null, not empty and unknown, an error is raised; the same for any string in 'certifiers', which must also correspond to a member"
calcQual (uid: String, certifiers: [String!]): Fraction!
"'bestDist' returns a list of members, among the reference list 'group', who could certify the identity whose pseudo is 'uid', together with the distance such a certification would give to the identity. 'certifiers' is a list of members supposed having already certified the identity in addition to her own certifiers. If 'group' is null or empty, the reference list is the whole Web Of Trust. 'uid' may be any string, even null or empty; if 'uid' is null or empty or doesn't refer to a known identity, it's not taken into account for the calculation, and, furthermore, if it is not null, not empty and unknown, an error is raised; the same for any string in 'group' or 'certifiers', and, furthermore, if the latter is not empty, it should refer to a member. 'answerNb' is the greatest number of answers in the result. If 'answerNb' is null, zero or negative, all answers are returned. Answers are sorted in the decreasing order of 'IdDist.dist.value.ratio'"
"'bestDist' returns a list of members, among the reference list 'group', who could certify the identity whose pseudo is 'uid', together with the distance such a certification would give to the identity. 'certifiers' is a list of members supposed having already certified the identity in addition to her own certifiers. If 'group' is null or empty, the reference list is the whole Web Of Trust. 'uid' may be any string, even null or empty; if 'uid' is null or empty or doesn't refer to an identity known by the blockchain, it's not taken into account for the calculation, and, furthermore, if it is not null, not empty and unknown to the blockchain, an error is raised; the same for any string in 'group' or 'certifiers', and, furthermore, if the latter is not empty, it should refer to a member. 'answerNb' is the greatest number of answers in the result. If 'answerNb' is null, zero or negative, all answers are returned. Answers are sorted in the decreasing order of 'IdDist.dist.value.ratio'"
bestDist (group: [String!], uid: String, certifiers: [String!], answerNb: Int): [IdDist!]!
"'bestQual' returns a list of members, among the reference list 'group', who could certify the identity whose pseudo is 'uid', together with the quality such a certification would give to the identity. 'certifiers' is a list of members supposed having already certified the identity in addition to her own certifiers. If 'group' is null or empty, the reference list is the whole Web Of Trust. 'uid' may be any string, even null or empty; if 'uid' is null or empty or doesn't refer to a known identity, it's not taken into account for the calculation, and, furthermore, if it is not null, not empty and unknown, an error is raised; the same for any string in 'group' or 'certifiers', and, furthermore, if the latter is not empty, it should refer to a member. 'answerNb' is the greatest number of answers in the result. If 'answerNb' is null, zero or negative, all answers are returned. Answers are sorted in the decreasing order of 'IdQual.qual.ratio'"
"'bestQual' returns a list of members, among the reference list 'group', who could certify the identity whose pseudo is 'uid', together with the quality such a certification would give to the identity. 'certifiers' is a list of members supposed having already certified the identity in addition to her own certifiers. If 'group' is null or empty, the reference list is the whole Web Of Trust. 'uid' may be any string, even null or empty; if 'uid' is null or empty or doesn't refer to an identity known by the blockchain, it's not taken into account for the calculation, and, furthermore, if it is not null, not empty and unknown to the blockchain, an error is raised; the same for any string in 'group' or 'certifiers', and, furthermore, if the latter is not empty, it should refer to a member. 'answerNb' is the greatest number of answers in the result. If 'answerNb' is null, zero or negative, all answers are returned. Answers are sorted in the decreasing order of 'IdQual.qual.ratio'"
bestQual (group: [String!], uid: String, certifiers: [String!], answerNb: Int): [IdQual!]!
} #Query
......@@ -123,28 +124,42 @@ type Subscription {
} #Subscription
"Output of Query.filterGroup, used with a list of statuses; 'selected' owns the uid(s) of identities whose statuses are in the list, 'others' owns those who are not in the list, and 'unknown' corresponds to unknown identities."
"Output of Query.filterGroup, used with a list of statuses; 'selected' owns the uid(s) of identities whose statuses are in the list, 'others' owns those who are not in the list, and 'unknown' corresponds to unknown identities; 'duplicate' displays all uid(s) with multiple occurrences in the original list."
type GroupFilter {
selected: [String!]!
others: [Error!]!
unknown: [Error!]!
duplicate: [Error!]!
"List of identities in the group whose statuses have been selected"
selected: [GroupId!]!
"List of identities in the group whose statuses have not been selected"
others: [GroupId!]!
"List of uid(s) in the group who were not found"
unknown: [GroupString!]!
"List of uid(s) with multiple occurrences in the original group"
duplicate: [GroupString!]!
} #Group_Filter
type Error {
mes: String!
path: [FieldOrRank!]!
} #Error
type GroupId {
"Found Identity"
id: Identity!
"Index in the original list, starting from 0"
index: Int!
union FieldOrRank = Field | Rank
} #GroupId
type Field {
name: String!
} #Field
type GroupString {
type Rank {
"Uid whose identity has or has not been found"
uid: String!
"Index in the original list, starting from 0"
index: Int!
} #Rank
} #GroupString
"WoT identity"
type Identity {
......@@ -179,6 +194,9 @@ type Identity {
"Limit date of the membership application; null for REVOKED; limit date before revocation for MISSING"
limitDate: Int64
"Limit date of the 'ParameterName.sigQty'th oldest received certification; or null if less than 'ParameterName.sigQty' certifications received; null for REVOKED and NEWCOMER"
certsLimit: Int64
"Member is leaving? null for REVOKED or NEWCOMER"
isLeaving: Boolean
......@@ -186,7 +204,7 @@ type Identity {
sentry: Boolean
"Active received certifications, sorted by increasing pubkeys"
received_certifications: Received_Certifications!
received_certifications: [Certification!]!
"Active sent certifications, sorted by increasing pubkeys"
sent_certifications: [Certification!]!
......@@ -229,17 +247,6 @@ type Identity {
} #Identity
"The association of 'Identity' and date"
type DatedIdentity {
"Identity"
id: Identity!
"Associated date"
date: Int64!
}
"Status of an identity in WoT"
enum Identity_Status {
......@@ -299,17 +306,6 @@ type IdSearchOutput {
} #IdSearchOutput
"Certifications received by an identity"
type Received_Certifications {
"List of all valid received certifications"
certifications: [Certification!]!
"Limit date of the 'ParameterName.sigQty'th oldest received certification; or null if less than 'ParameterName.sigQty' certifications received"
limit: Int64
} #received_Certifications
"Certification sent by 'from' and received by 'to'"
type Certification {
......@@ -595,7 +591,7 @@ type Forecast {
"Entry or exit of an identity"
type EventId {
member: Identity!
id: Identity!
"Entry or exit; true if entry"
inOut: Boolean!
......@@ -734,16 +730,16 @@ type Fraction {
} #fraction
"64 bits signed integer"
scalar Int64
scalar Int64 @specifiedBy(url: "https://go.dev/ref/spec#Numeric_types")
"Avatar of String"
scalar Hash
scalar Hash @specifiedBy(url: "https://git.duniter.org/nodes/common/doc/blob/master/rfc/0009_Duniter_Blockchain_Protocol_V11.md")
"Avatar of String"
scalar Pubkey
scalar Pubkey @specifiedBy(url: "https://git.duniter.org/nodes/common/doc/blob/master/rfc/0009_Duniter_Blockchain_Protocol_V11.md#public-key")
"Empty result"
scalar Void
"Int, Int64 or Float"
scalar Number
\ No newline at end of file
scalar Number @specifiedBy(url: "https://ieeexplore.ieee.org/document/4610935")
const { HttpLink } = require("apollo-link-http");
const { setContext } = require("apollo-link-context");
const { from } = require("apollo-link");
const { cache } = require("../cache");
const ssrMiddleware = setContext((_, { headers }) => {
if (process.client) return headers;
return { headers };
});
const httpLink = new HttpLink({ uri: "https://gql.wotwizard.axiom-team.fr/" });
const link = from([ssrMiddleware, httpLink]);
module.exports = () => ({
link,
cache,
defaultHttpLink: false
});
const { HttpLink } = require("apollo-link-http");
const { setContext } = require("apollo-link-context");
const { from } = require("apollo-link");
const { cache } = require("../cache");
const ssrMiddleware = setContext((_, { headers }) => {
if (process.client) return headers;
return { headers };
});
const httpLink = new HttpLink({ uri: "https://wotwizard.pini.fr/" });
const link = from([ssrMiddleware, httpLink]);
module.exports = () => ({
link,
cache,
defaultHttpLink: false
});
const { HttpLink } = require("apollo-link-http");
const { setContext } = require("apollo-link-context");
const { from } = require("apollo-link");
const { cache } = require("../cache");
const ssrMiddleware = setContext((_, { headers }) => {
if (process.client) return headers;
return { headers };
});
const httpLink = new HttpLink({ uri: "https://gql.wotwizard.trentesaux.fr/" });
const link = from([ssrMiddleware, httpLink]);
module.exports = () => ({
link,
cache,
defaultHttpLink: false
});
{
"__schema": {
"types": [
{
"kind": "UNION",
"name": "CertifOrDossier",
"possibleTypes": [
{ "name": "MarkedDatedCertification" },
{ "name": "MarkedDossier" }
]
},
{
"kind": "INTERFACE",
"name": "File",
"possibleTypes": [{ "name": "FileS" }]
},
{
"kind": "INTERFACE",
"name": "WWResult",
"possibleTypes": [{ "name": "WWResultS" }]
}
]
}
}
{"__schema":{"types":[{"kind":"UNION","name":"CertifOrDossier","possibleTypes":[{"name":"MarkedDatedCertification"},{"name":"MarkedDossier"}]},{"kind":"INTERFACE","name":"File","possibleTypes":[{"name":"FileS"}]},{"kind":"INTERFACE","name":"WWResult","possibleTypes":[{"name":"WWResultS"}]}]}}
\ No newline at end of file
const fs = require('fs');
const path = require('path');
const endpoints = require('../endpoints.json');
const endpointDir = path.join(__dirname, 'endpoints');
const recreateDirectory = (directory) => {
if (fs.existsSync(directory)) {
fs.rmSync(directory, { recursive: true, force: true });
}
fs.mkdirSync(directory, { recursive: true });
};
recreateDirectory(endpointDir);
const configTemplate = (uri) => `
const { HttpLink } = require("apollo-link-http");
const { setContext } = require("apollo-link-context");
const { from } = require("apollo-link");
const { cache } = require("../cache");
const ssrMiddleware = setContext((_, { headers }) => {
if (process.client) return headers;
return { headers };
});
const httpLink = new HttpLink({ uri: "${uri}" });
const link = from([ssrMiddleware, httpLink]);
module.exports = () => ({
link,
cache,
defaultHttpLink: false
});
`;
Object.keys(endpoints).forEach(key => {
const filePath = path.join(endpointDir, `${key}.js`);
const fileContent = configTemplate(endpoints[key]);
fs.writeFileSync(filePath, fileContent);
});
import gql from "graphql-tag"
export const VERSION = gql`
query Version {
version
}
`
// Pour la sidebar
export const LAST_BLOCK = gql`
query LastBlock {
......@@ -23,7 +29,14 @@ export const LAST_EVENTS = gql`
uid
status
hash
minDatePassed
minDate
certsLimit
limitDate
quality {
__typename
ratio
}
history {
__typename
in
......@@ -32,9 +45,9 @@ export const LAST_EVENTS = gql`
number
}
}
received_certifications {
sent_certifications {
__typename
limit
pending
}
}
inOut
......@@ -43,6 +56,7 @@ export const LAST_EVENTS = gql`
__typename
number
}
number
}
}
`
......@@ -63,11 +77,8 @@ export const NEWCOMERS = gql`
uid
status
hash
certsLimit
limitDate
received_certifications {
__typename
limit
}
}
date
after
......@@ -77,7 +88,7 @@ export const NEWCOMERS = gql`
}
`
// Pour la page membres/index
// Pour la page membre
export const SEARCH_MEMBERS = gql`
query SearchMember($hint: String) {
idSearch(with: { hint: $hint }) {
......@@ -87,18 +98,25 @@ export const SEARCH_MEMBERS = gql`
pubkey
uid
status
minDate
minDatePassed
hash
certsLimit
limitDate
received_certifications {
quality {
__typename
limit
ratio
}
sent_certifications {
__typename
pending
}
}
}
}
`
// Pour la page membres/_hash
// Pour la page membre
export const SEARCH_MEMBER = gql`
query SearchMemberWithHash($hash: Hash!) {
idFromHash(hash: $hash) {
......@@ -107,6 +125,12 @@ export const SEARCH_MEMBER = gql`
isLeaving
sentry
membership_pending
all_certifiersIO {
...IO
}
all_certifiedIO {
...IO
}
distanceE {
__typename
value {
......@@ -125,14 +149,11 @@ export const SEARCH_MEMBER = gql`
}
received_certifications {
__typename
certifications {
__typename
from {
...attr
}
expires_on
pending
from {
...attr
}
expires_on
pending
}
sent_certifications {
__typename
......@@ -148,7 +169,9 @@ export const SEARCH_MEMBER = gql`
__typename
uid
hash
pubkey
status
certsLimit
limitDate
minDate
minDatePassed
......@@ -156,9 +179,24 @@ export const SEARCH_MEMBER = gql`
__typename
ratio
}
received_certifications {
sent_certifications {
__typename
pending
}
}
fragment IO on CertHist {
__typename
id {
...attr
}
hist {
__typename
limit
in
block {
__typename
number
utc0
}
}
}
`
......@@ -174,9 +212,9 @@ export const PARAMS = gql`
}
}
`
// Pour la page favoris
export const FAVORIS = gql`
query getFavoris($group: [String!]!) {
// Pour la page des suivis
export const MEMBERS = gql`
query getMembers($group: [String!]!) {
filterGroup(group: $group) {
__typename
selected {
......@@ -199,27 +237,75 @@ export const FAVORIS = gql`
uid
status
hash
certsLimit
limitDate
received_certifications {
minDatePassed
minDate
quality {
__typename
ratio
}
sent_certifications {
__typename
limit
pending
}
}
`
// Pour la page index
// Pour la page previsions/futures_sorties
export const NEXT_EXITS = gql`
query NextExits($group: [String!], $start: Int64, $period: Int64) {
memEnds (group: $group, startFromNow: $start, period: $period) {
memEnds(group: $group, startFromNow: $start, period: $period) {
__typename
pubkey
uid
status
hash
minDatePassed
minDate
certsLimit
limitDate
received_certifications {
quality {
__typename
limit
ratio
}
sent_certifications {
__typename
pending
}
}
}
`
// Pour la page previsions/futures_sorties
export const NEXT_LOOSE_CERTS = gql`
query NextLoseCerts(
$group: [String!]
$start: Int64
$period: Int64
$missingIncluded: Boolean
) {
certEnds(
group: $group
startFromNow: $start
period: $period
missingIncluded: $missingIncluded
) {
__typename
pubkey
uid
status
hash
minDatePassed
minDate
certsLimit
limitDate
quality {
__typename
ratio
}
sent_certifications {
__typename
pending
}
}
}
......
const { ENDPOINT1 } = require('./clients/endpoints');
const fetch = require('node-fetch');
const fs = require('fs');
const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args));
const fs = require("fs")
fetch(ENDPOINT1, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
variables: {},
query: `
fetch("https://gql.wotwizard.trentesaux.fr/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
variables: {},
query: `
{
__schema {
types {
......@@ -19,21 +18,28 @@ fetch(ENDPOINT1, {
}
}
}
`,
}),
`
})
})
.then(result => result.json())
.then(result => {
const filteredData = result.data.__schema.types.filter(
type => type.possibleTypes !== null
)
result.data.__schema.types = filteredData;
.then((result) => result.json())
.then((result) => {
const filteredData = result.data.__schema.types.filter(
(type) => type.possibleTypes !== null
)
result.data.__schema.types = filteredData
fs.writeFile('./graphql/fragmentTypes.json', JSON.stringify(result.data), err => {
if (err) {
console.error('Error writing fragmentTypes file', err);
} else {
console.log('Fragment types successfully extracted!');
}
});
});
\ No newline at end of file
fs.writeFile(
"./graphql/fragmentTypes.json",
JSON.stringify(result.data),
(err) => {
if (err) {
console.error("Error writing fragmentTypes file", err)
} else {
console.log("Fragment types successfully extracted!")
}
}
)
})
.catch(function (error) {
console.log(error.message)
})
import en from './locales/en.json'
import fr from './locales/fr.json'
import es from './locales/es.json'
import { dateTimeFormats } from './locales/dateTimeFormats'
import { dateTimeFormats } from "./locales/dateTimeFormats"
export default {
fallbackLocale: 'en',
dateTimeFormats,
messages: { en, fr, es }
}
\ No newline at end of file
dateTimeFormats
}
const objTime = {
short: {
day: "2-digit",
month: "2-digit",
year: "2-digit"
},
long: {
day: "numeric",
month: "long",
year: "numeric"
},
hour: {
hour: "numeric"
},
min: {
minute: "2-digit"
},
time: {
hour: "numeric",
minute: "2-digit",
hour12: false
}
}
export const dateTimeFormats = {
'fr': {
short: {
day: 'numeric',
month: 'short',
year: '2-digit'
},
long: {
day: 'numeric',
month: 'long',
year: 'numeric',
},
hour: {
hour: 'numeric'
},
min: {
minute: '2-digit'
},
time: {
hour: 'numeric',
minute: '2-digit',
hour12: false,
}
},
'en': {
short: {
day: 'numeric',
month: 'short',
year: '2-digit'
},
long: {
month: 'long',
day: 'numeric',
year: 'numeric',
},
hour: {
hour: 'numeric'
},
min: {
minute: '2-digit'
},
time: {
hour: 'numeric',
minute: '2-digit',
hour12: true,
}
},
'es': {
short: {
day: 'numeric',
month: 'short',
year: '2-digit'
},
long: {
day: 'numeric',
month: 'long',
year: 'numeric',
},
hour: {
hour: 'numeric'
},
min: {
minute: '2-digit'
},
time: {
hour: 'numeric',
minute: '2-digit',
hour12: false,
}
}
}
\ No newline at end of file
de: objTime,
en: objTime,
es: objTime,
fr: objTime,
it: objTime
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.