fix: update TypeScript types and add new dependencies

This commit is contained in:
Timothy Atapagra 2025-08-09 19:35:47 -04:00
parent 1ec8dbeb48
commit 2d44c23e5a
8 changed files with 18 additions and 13 deletions

View file

@ -97,7 +97,7 @@ export const mergeHighlightResolver = authorized<
const mergedColors: string[] = []
try {
const existingHighlights = await authTrx(
const existingHighlights = await authTrx<any[]>(
(tx) =>
tx
.withRepository(highlightRepository)

View file

@ -1,6 +1,6 @@
import gql from 'graphql-tag'
const schema = gql`
const schema: any = gql`
# Scalars
scalar Date

View file

@ -55,8 +55,8 @@ const PORT = process.env.PORT || 4000
export const createApp = async (): Promise<Application> => {
// Dynamically import Express to avoid static require() of ES module
const expressModule = await import('express')
const expressFn = expressModule.default ?? expressModule
const app: Application = expressFn()
const expressFn = expressModule.default || expressModule
const app: Application = (expressFn as any)()
// Initialize Sentry dynamically to avoid static require() of ES module
const Sentry = await import('@sentry/node')
@ -190,7 +190,7 @@ const main = async (): Promise<void> => {
await apolloServer.start()
// Disable ApolloServer's internal body parser since express.json() is applied globally
apolloServer.applyMiddleware({
app,
app: app as any,
path: '/api/graphql',
cors: corsConfig,
bodyParserConfig: false,

View file

@ -36,6 +36,7 @@
"linkedom": "^0.14.16",
"lodash": "^4.17.21",
"luxon": "^3.0.4",
"minimatch": "^10.0.3",
"underscore": "^1.13.6",
"uuid": "^9.0.0"
},

View file

@ -1,9 +1,10 @@
{
"extends": "./../../tsconfig.json",
"extends": "./../../tsconfig.base.json",
"compilerOptions": {
"rootDir": ".",
"declaration": true,
"outDir": "build"
"outDir": "build",
"skipLibCheck": true
},
"include": ["src"]
}

View file

@ -25,11 +25,11 @@
"devDependencies": {
"@types/chai": "^4.3.14",
"@types/html-to-text": "^8.1.1",
"@types/jsonwebtoken": "^9.0.7",
"@types/mocha": "^10.0.6",
"@types/natural": "^5.1.1",
"@types/node": "^14.11.2",
"@types/underscore": "^1.11.4",
"@types/jsonwebtoken": "^9.0.7",
"chai": "^4.3.6",
"eslint-plugin-prettier": "^4.0.0",
"mocha": "^10.0.0"
@ -45,6 +45,7 @@
"jsonwebtoken": "^9.0.2",
"linkedom": "^0.14.12",
"microsoft-cognitiveservices-speech-sdk": "1.30",
"minimatch": "^10.0.3",
"natural": "^6.2.0",
"nodemon": "^2.0.15",
"underscore": "^1.13.4"

View file

@ -44,7 +44,7 @@ export class AzureTextToSpeech implements TextToSpeech {
synthesizer.synthesizing = function (s, e) {
// convert arrayBuffer to stream and write to stream
audioStream?.write(Buffer.from(e.result.audioData))
audioStream?.write(new Uint8Array(e.result.audioData))
}
// The event synthesis completed signals that the synthesis is completed.

View file

@ -1,10 +1,12 @@
{
"extends": "./../../tsconfig.json",
"extends": "./../../tsconfig.base.json",
"compilerOptions": {
"outDir": "build",
"rootDir": ".",
// Generate d.ts files
"declaration": true
"declaration": true,
"skipLibCheck": true,
"strict": false,
"lib": ["ES2020", "esnext.disposable"]
},
"include": ["src", "test"]
"include": ["src"]
}