2023-05-01 05:05:47 +00:00
// @ts-check
2023-04-30 12:57:30 +00:00
const fs = require ( "fs" )
2023-08-23 12:27:51 +00:00
const assert = require ( "assert" ) . strict
2023-04-30 12:57:30 +00:00
const yaml = require ( "js-yaml" )
2023-05-05 05:29:08 +00:00
/** @ts-ignore @type {import("../types").AppServiceRegistrationConfig} */
const reg = yaml . load ( fs . readFileSync ( "registration.yaml" , "utf8" ) )
2023-09-12 11:08:33 +00:00
reg [ "ooye" ] . invite = ( reg . ooye . invite || [ ] ) . filter ( mxid => mxid . endsWith ( ` : ${ reg . ooye . server _name } ` ) ) // one day I will understand why typescript disagrees with dot notation on this line
2023-08-23 12:27:51 +00:00
assert ( reg . ooye . max _file _size )
assert ( reg . ooye . namespace _prefix )
assert ( reg . ooye . server _name )
2023-09-12 11:08:33 +00:00
2023-08-23 12:27:51 +00:00
module . exports = reg