diff --git a/package.json b/package.json index 5cc661d..4987aca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xtr-dev/rondevu-server", - "version": "0.2.1", + "version": "0.2.2", "description": "DNS-like WebRTC signaling server with username claiming and service discovery", "main": "dist/index.js", "scripts": { diff --git a/src/storage/d1.ts b/src/storage/d1.ts index 9f0334e..5f94598 100644 --- a/src/storage/d1.ts +++ b/src/storage/d1.ts @@ -1,4 +1,4 @@ -import { randomUUID } from 'crypto'; +// Use Web Crypto API (available globally in Cloudflare Workers) import { Storage, Offer, @@ -402,8 +402,8 @@ export class D1Storage implements Storage { service: Service; indexUuid: string; }> { - const serviceId = randomUUID(); - const indexUuid = randomUUID(); + const serviceId = crypto.randomUUID(); + const indexUuid = crypto.randomUUID(); const now = Date.now(); // Insert service diff --git a/src/storage/sqlite.ts b/src/storage/sqlite.ts index 01bf451..a5eb9ce 100644 --- a/src/storage/sqlite.ts +++ b/src/storage/sqlite.ts @@ -1,5 +1,5 @@ import Database from 'better-sqlite3'; -import { randomUUID } from 'crypto'; +import { randomUUID } from 'node:crypto'; import { Storage, Offer,