Skip to content

Commit 940a679

Browse files
committed
chore: remove uuid as dep
1 parent 67a77e2 commit 940a679

5 files changed

Lines changed: 5 additions & 32 deletions

File tree

package-lock.json

Lines changed: 1 addition & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,11 @@
6666
"@fastify/cors": "^11.2.0",
6767
"dotenv": "^17.2.3",
6868
"fastify": "^5.7.1",
69-
"ioredis": "^5.9.2",
70-
"uuid": "^14.0.0"
69+
"ioredis": "^5.9.2"
7170
},
7271
"devDependencies": {
7372
"@types/ioredis": "^4.28.10",
7473
"@types/node": "^20.0.0",
75-
"@types/uuid": "^10.0.0",
7674
"prettier": "^3.8.0",
7775
"tsc-alias": "^1.8.16",
7876
"tsx": "^4.21.0",

src/core/errors.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { ErrorCode } from './types/index.js'
2-
import { v4 as uuidv4 } from 'uuid'
32

43
export class OMSSError extends Error {
54
constructor(
65
public code: ErrorCode,
76
public message: string,
87
public statusCode: number,
98
public details?: Record<string, any>,
10-
public traceId: string = uuidv4()
9+
public traceId: string = crypto.randomUUID()
1110
) {
1211
super(message)
1312
this.name = 'OMSSError'

src/core/server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { errorHandler } from '../middleware/error-handler.js'
1414
import { requestLogger } from '../middleware/logger.js'
1515
import { validateContentType } from '../middleware/validation.js'
1616
import { TMDBService } from '../services/tmdb.service.js'
17-
import { v4 as uuidv4 } from 'uuid'
1817
import { StremioController } from '../controllers/stremio.controller.js'
1918
import { MCPController } from 'src/controllers/mcp.controller.js'
2019

@@ -72,7 +71,7 @@ export class OMSSServer {
7271
this.app = Fastify({
7372
logger: false,
7473
requestIdHeader: 'x-request-id',
75-
genReqId: () => uuidv4(),
74+
genReqId: () => crypto.randomUUID(),
7675
trustProxy: true,
7776
})
7877

src/services/source.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { SourceResponse, ProviderResult, ResponseIdMapping, ProviderMediaObject,
44
import { createTMDBValidator } from '../middleware/validation.js'
55
import { OMSSErrors } from '../core/errors.js'
66
import { TMDBService } from '../services/tmdb.service.js'
7-
import { v4 as uuidv4 } from 'uuid'
87
import { StremioService } from './stremio.service.js'
98
import { ProxyService } from './proxy.service.js'
109

@@ -338,7 +337,7 @@ export class SourceService {
338337
const expiresAt = new Date(Date.now() + 2 * 60 * 60 * 1000).toISOString()
339338

340339
return {
341-
responseId: uuidv4(),
340+
responseId: crypto.randomUUID(),
342341
expiresAt,
343342
sources: uniqueSources,
344343
subtitles: uniqueSubtitles,

0 commit comments

Comments
 (0)