diff --git a/backend/package-lock.json b/backend/package-lock.json index 50e892ef..0d827c1b 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -10,6 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@aws-sdk/client-s3": "3.673.0", + "@openvidu/shared-call-types": "file:openvidu-shared-call-types-1.0.0.tgz", "chalk": "5.3.0", "cors": "2.8.5", "dotenv": "16.4.5", @@ -1148,6 +1149,11 @@ "node": ">= 8" } }, + "node_modules/@openvidu/shared-call-types": { + "version": "1.0.0", + "resolved": "file:openvidu-shared-call-types-1.0.0.tgz", + "integrity": "sha512-mFAw/xgZZ0AyETDyimT28ICQs3uJ1wYEHzL3WqmAsfDJ85+K4RtDn/IWmdeKwq7LxpmFX2Lg5cMZGOFwanbdrw==" + }, "node_modules/@smithy/abort-controller": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-3.1.5.tgz", diff --git a/backend/package.json b/backend/package.json index aca159e1..e6ebfbc1 100644 --- a/backend/package.json +++ b/backend/package.json @@ -31,6 +31,7 @@ }, "dependencies": { "@aws-sdk/client-s3": "3.673.0", + "@openvidu/shared-call-types": "file:openvidu-shared-call-types-1.0.0.tgz", "chalk": "5.3.0", "cors": "2.8.5", "dotenv": "16.4.5", diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ec272561..aad09001 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -18,6 +18,7 @@ "@angular/platform-browser": "18.2.5", "@angular/platform-browser-dynamic": "18.2.5", "@angular/router": "18.2.5", + "@openvidu/shared-call-types": "file:openvidu-shared-call-types-1.0.0.tgz", "core-js": "^3.38.1", "jwt-decode": "^4.0.0", "openvidu-components-angular": "3.0.0-beta3", @@ -4074,6 +4075,11 @@ "node": "^16.13.0 || >=18.0.0" } }, + "node_modules/@openvidu/shared-call-types": { + "version": "1.0.0", + "resolved": "file:openvidu-shared-call-types-1.0.0.tgz", + "integrity": "sha512-mFAw/xgZZ0AyETDyimT28ICQs3uJ1wYEHzL3WqmAsfDJ85+K4RtDn/IWmdeKwq7LxpmFX2Lg5cMZGOFwanbdrw==" + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index dc7e6fb6..9a25dc56 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -10,6 +10,7 @@ "@angular/platform-browser": "18.2.5", "@angular/platform-browser-dynamic": "18.2.5", "@angular/router": "18.2.5", + "@openvidu/shared-call-types": "file:openvidu-shared-call-types-1.0.0.tgz", "core-js": "^3.38.1", "jwt-decode": "^4.0.0", "openvidu-components-angular": "3.0.0-beta3", diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 700ed518..f444cb65 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -23,7 +23,9 @@ // "@guards/*": ["src/app/guards/*"], // "@pages/*": ["src/app/pages/*"], "@environment/*": ["src/environments/*"], - "shared-call-components": ["dist/shared-call-components"] + "shared-call-components": ["dist/shared-call-components"], + "@openvidu/shared-call-types": ["node_modules/@openvidu/shared-call-types"] + }, "useDefineForClassFields": false } diff --git a/types/package-lock.json b/types/package-lock.json new file mode 100644 index 00000000..f5969635 --- /dev/null +++ b/types/package-lock.json @@ -0,0 +1,29 @@ +{ + "name": "types", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "types", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "typescript": "^5.6.3" + } + }, + "node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + } + } +} diff --git a/types/package.json b/types/package.json new file mode 100644 index 00000000..3b9892cd --- /dev/null +++ b/types/package.json @@ -0,0 +1,23 @@ +{ + "name": "@openvidu/shared-call-types", + "version": "1.0.0", + "description": "", + "main": "./dist/index.ts", + "types": "./dist/index.d.ts", + "files": [ + "./dist/**.d.ts", + "./package.json", + "./package-lock.json" + ], + "scripts": { + "build": "tsc", + "sync": "npm run build && npm pack && PACKAGE=$(ls openvidu-shared-call-types-*.tgz) && cp $PACKAGE ../frontend && cp $PACKAGE ../backend && npm install ../frontend/$PACKAGE --prefix ../frontend && npm install ../backend/$PACKAGE --prefix ../backend", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "typescript": "^5.6.3" + } +} diff --git a/types/src/appearance-preferences.ts b/types/src/appearance-preferences.ts new file mode 100644 index 00000000..6fb19bdc --- /dev/null +++ b/types/src/appearance-preferences.ts @@ -0,0 +1,3 @@ +export interface AppearancePreferences { + theme: string; +} \ No newline at end of file diff --git a/types/src/global-preferences.ts b/types/src/global-preferences.ts new file mode 100644 index 00000000..8145fb5e --- /dev/null +++ b/types/src/global-preferences.ts @@ -0,0 +1,8 @@ +import { AppearancePreferences } from './appearance-preferences'; +import { RoomPreferences } from './room-preferences'; + + +export interface GlobalPreferences { + roomPreferences: RoomPreferences; + appearancePreferences: AppearancePreferences; +} diff --git a/types/src/index.ts b/types/src/index.ts new file mode 100644 index 00000000..12a935c9 --- /dev/null +++ b/types/src/index.ts @@ -0,0 +1,3 @@ +export * from './global-preferences'; +export * from './appearance-preferences'; +export * from './room-preferences'; diff --git a/types/src/room-preferences.ts b/types/src/room-preferences.ts new file mode 100644 index 00000000..d9e74011 --- /dev/null +++ b/types/src/room-preferences.ts @@ -0,0 +1,25 @@ +export interface RoomPreferences { + recordingPreferences: RecordingPreferences; + broadcastingPreferences: BroadcastingPreferences; + chatPreferences: ChatPreferences; + virtualBackgroundPreferences: VirtualBackgroundPreferences; +} + +export interface RecordingPreferences { + enabled: boolean; + // outputMode: string; + // hasAudio: boolean; + // hasVideo: boolean; +} + +export interface BroadcastingPreferences { + enabled: boolean; +} + +export interface ChatPreferences { + enabled: boolean; +} + +export interface VirtualBackgroundPreferences { + enabled: boolean; +} diff --git a/types/tsconfig.json b/types/tsconfig.json new file mode 100644 index 00000000..6254a3b9 --- /dev/null +++ b/types/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "./dist", + "module": "commonjs", + "target": "ES6", + "strict": true, + "esModuleInterop": true + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules", "dist"] +}