mirror of
https://github.com/betagouv/mon-entreprise
synced 2025-02-09 22:45:01 +00:00
* feat: Ajoute l'iframe crisp ainsi que le bloc custom html * wip * feat: Renomme le dossier standup.. + ajoute la fonction crisp * fix: Install not broken version + add update meta * feat: Ajoute le formulaire * fix: Corrige htmlFor et id * feat: Ajoute la logique pour récupérer nombre de réponses et les issues * fix: uncomment stuff * fix: Retire log * chore: Renomme fonction * chore: Renomme fonction * chore: Renomme fonction * feat: Retire commentaires * fix: Refacto urlParams * chore : Nettoyage de reliquats * fix : Ajoute TextAreaField et utilise TextField * fix: Style issues * fix: Améliore types * feat: Cleaning * feat: Ajoute variable d'env website id * feat: Met à jour README * wip placeholder url * feat: Ajoute une fonction de validation du body * feat: Ajoute validation * chore: update yarn.lock * fix: Add missing secret ref + cleaning
49 lines
1.2 KiB
TypeScript
49 lines
1.2 KiB
TypeScript
import type { MattermostSendMessage } from './mattermost.js'
|
||
|
||
if (!process.env.MONGO_URL) {
|
||
throw new Error('MONGO_URL env var is empty')
|
||
}
|
||
|
||
if (!process.env.CLIENT_ID || !process.env.CLIENT_SECRET) {
|
||
throw new Error('Empty env var CLIENT_ID or CLIENT_SECRET')
|
||
}
|
||
|
||
export const PORT = process.env.PORT || 4000
|
||
export const ORIGIN = process.env.ORIGIN || 'http://localhost:4000'
|
||
export const MONGO_URL = process.env.MONGO_URL
|
||
export const NODE_ENV = process.env.NODE_ENV
|
||
|
||
export const serverUrl = 'https://mattermost.incubateur.net'
|
||
export const clientId = process.env.CLIENT_ID
|
||
export const clientSecret = process.env.CLIENT_SECRET
|
||
export const redirectUri = `${ORIGIN}/oauth`
|
||
|
||
const days = [
|
||
'Lundi',
|
||
'Mardi',
|
||
'Mercredi',
|
||
'Jeudi',
|
||
'Vendredi',
|
||
'Samedi',
|
||
'Dimanche',
|
||
]
|
||
|
||
interface BotConfig {
|
||
channelName: string
|
||
standupDays: string[]
|
||
messageProps: MattermostSendMessage['props']
|
||
}
|
||
|
||
export const botConfig: BotConfig = {
|
||
channelName:
|
||
NODE_ENV !== 'production'
|
||
? 'startup-monentreprise-dev-bot-stand-up'
|
||
: 'startup-monentreprise-stand-up',
|
||
standupDays: days.slice(0, 4),
|
||
messageProps: {
|
||
from_webhook: 'true',
|
||
override_username: 'L’URSSAF est votre amie',
|
||
override_icon_url:
|
||
'https://mon-entreprise.urssaf.fr/favicon/favicon-32x32.png?v=2.0',
|
||
},
|
||
}
|