fix missing file

This commit is contained in:
einhorn_b 2024-01-18 19:59:05 +01:00
parent 9e0b1f72e8
commit 54d6eb03c5
3 changed files with 10 additions and 6 deletions

View File

@ -7,7 +7,7 @@ module.exports = {
collectCoverageFrom: ['src/**/*.ts', '!**/node_modules/**', '!src/seeds/**', '!build/**'],
coverageThreshold: {
global: {
lines: 83,
lines: 82,
},
},
setupFiles: ['<rootDir>/test/testSetup.ts'],

View File

@ -0,0 +1,5 @@
export enum ApiVersionType {
V1_0 = '1_0',
V1_1 = '1_1', // currently no changes
V2_0 = '2_0', // not exist
}

View File

@ -8,6 +8,7 @@ import { v4 as uuidv4 } from 'uuid'
import { CONFIG } from '@/config'
import { logger } from '@/server/logger'
import { ApiVersionType } from './ApiVersionType'
const KEY_SECRET_SEEDBYTES = 32
@ -16,11 +17,6 @@ const SUCCESSTIME = 120000
const ERRORTIME = 240000
const ANNOUNCETIME = 30000
enum ApiVersionType {
V1_0 = '1_0',
V1_1 = '1_1', // currently no changes
V2_0 = '2_0', // not exist
}
type CommunityApi = {
api: string
url: string
@ -194,6 +190,9 @@ async function writeFederatedHomeCommunityEntries(pubKey: string): Promise<Commu
const homeApiVersions: CommunityApi[] = CONFIG.FEDERATION_COMMUNITY_APIS.split(',').map(function (
api,
) {
if (!Object.values(ApiVersionType).includes(api as ApiVersionType)) {
throw new Error(`Federation: unknown api version: ${api}`)
}
const comApi: CommunityApi = {
api,
url: CONFIG.FEDERATION_COMMUNITY_URL + '/api/',