refactor: replace TypeORM with knex.js

Co-authored-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2025-03-14 23:33:29 +01:00
parent 6e151c8a1b
commit c0ce00b3f9
No known key found for this signature in database
GPG key ID: DB99ADDDC5C0AF82
242 changed files with 4601 additions and 6871 deletions

View file

@ -3,10 +3,10 @@
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import type { ProviderType } from '../../src/api/config/types'
import { ProviderType } from '../../src/api/config/types'
import type { AuthProviderType } from '../../src/api/config/types'
import { AuthProviderType } from '../../src/api/config/types'
const initLoggedOutTestWithCustomAuthProviders = (cy: Cypress.cy, enabledProviders: ProviderType[]) => {
const initLoggedOutTestWithCustomAuthProviders = (cy: Cypress.cy, enabledProviders: AuthProviderType[]) => {
cy.logOut()
cy.loadConfig({
authProviders: enabledProviders
@ -48,7 +48,7 @@ describe('When logged-out ', () => {
it('sign-in button points to login route: internal', () => {
initLoggedOutTestWithCustomAuthProviders(cy, [
{
type: ProviderType.LOCAL
type: AuthProviderType.LOCAL
}
])
cy.getByCypressId('sign-in-button')
@ -60,7 +60,7 @@ describe('When logged-out ', () => {
it('sign-in button points to login route: ldap', () => {
initLoggedOutTestWithCustomAuthProviders(cy, [
{
type: ProviderType.LDAP,
type: AuthProviderType.LDAP,
identifier: 'cy-ldap',
providerName: 'cy LDAP'
}
@ -76,7 +76,7 @@ describe('When logged-out ', () => {
it('sign-in button points to auth-provider', () => {
initLoggedOutTestWithCustomAuthProviders(cy, [
{
type: ProviderType.OIDC,
type: AuthProviderType.OIDC,
identifier: 'github',
providerName: 'GitHub',
theme: 'github'
@ -94,13 +94,13 @@ describe('When logged-out ', () => {
it('sign-in button points to login route', () => {
initLoggedOutTestWithCustomAuthProviders(cy, [
{
type: ProviderType.OIDC,
type: AuthProviderType.OIDC,
identifier: 'github',
providerName: 'GitHub',
theme: 'github'
},
{
type: ProviderType.OIDC,
type: AuthProviderType.OIDC,
identifier: 'gitlab',
providerName: 'GitLab',
theme: 'gitlab'
@ -117,13 +117,13 @@ describe('When logged-out ', () => {
it('sign-in button points to login route', () => {
initLoggedOutTestWithCustomAuthProviders(cy, [
{
type: ProviderType.OIDC,
type: AuthProviderType.OIDC,
identifier: 'github',
providerName: 'GitHub',
theme: 'github'
},
{
type: ProviderType.LOCAL
type: AuthProviderType.LOCAL
}
])
cy.getByCypressId('sign-in-button')

View file

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { ProviderType } from '@hedgedoc/commons'
import { AuthProviderType } from '@hedgedoc/commons'
import { HttpMethod } from '../../src/handler-utils/respond-to-matching-request'
import { IGNORE_MOTD, MOTD_LOCAL_STORAGE_KEY } from '../../src/components/global-dialogs/motd-modal/local-storage-keys'
@ -22,15 +22,15 @@ export const branding = {
export const authProviders = [
{
type: ProviderType.LOCAL
type: AuthProviderType.LOCAL
},
{
type: ProviderType.LDAP,
type: AuthProviderType.LDAP,
identifier: 'test-ldap',
providerName: 'Test LDAP'
},
{
type: ProviderType.OIDC,
type: AuthProviderType.OIDC,
identifier: 'test-oidc',
providerName: 'Test OIDC'
}

View file

@ -15,12 +15,12 @@ const mockMetadata = {
noteId: testNoteId
}
],
primaryAddress: 'mock-note',
primaryAlias: 'mock-note',
title: 'Mock Note',
description: 'Mocked note for testing',
tags: ['test', 'mock', 'cypress'],
updatedAt: '2021-04-24T09:27:51.000Z',
updateUsername: null,
lastUpdatedBy: null,
viewCount: 0,
version: 2,
createdAt: '2021-04-24T09:27:51.000Z',