From 7a7ed04bea13b6800144b6cda787830a496e209e Mon Sep 17 00:00:00 2001 From: Tommaso Barbugli Date: Tue, 5 Nov 2024 13:07:34 +0100 Subject: [PATCH] remove docs for legacy node sdk --- .../docs/api/_common_/async-tasks.mdx | 14 -- .../docs/api/_common_/custom-events.mdx | 13 -- .../docusaurus/docs/api/_common_/rtmp.mdx | 22 --- .../docusaurus/docs/api/_common_/storage.mdx | 71 ---------- .../docusaurus/docs/api/basics/calls.mdx | 100 ------------- .../docs/api/basics/multi-tenant.mdx | 51 ------- .../docs/api/call_types/manage-types.mdx | 11 -- .../docs/api/call_types/permissions.mdx | 28 ---- .../docs/api/moderation/overview.mdx | 48 ------- .../docs/api/recording/recording_calls.mdx | 132 ------------------ .../docs/api/streaming/backstage.mdx | 55 -------- .../api/transcription/transcribing_calls.mdx | 42 ------ 12 files changed, 587 deletions(-) diff --git a/docusaurus/video/docusaurus/docs/api/_common_/async-tasks.mdx b/docusaurus/video/docusaurus/docs/api/_common_/async-tasks.mdx index a0257ea4..1a2501dd 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/async-tasks.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/async-tasks.mdx @@ -45,19 +45,5 @@ curl -X GET https://video.stream-io-api.com/api/v2/tasks/${TASK_ID}?api_key=${AP -H "stream-auth-type: jwt" ``` - - - -```js -// Example of monitoring the status of an async task -// The logic is same for all async tasks -const response = await client.(); - -// you need to poll this endpoint -const taskResponse = await client.getTaskStatus({id: response.task_id}) - -console.log(taskResponse.status === 'completed'); -``` - diff --git a/docusaurus/video/docusaurus/docs/api/_common_/custom-events.mdx b/docusaurus/video/docusaurus/docs/api/_common_/custom-events.mdx index bd9b7112..e0de5a5b 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/custom-events.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/custom-events.mdx @@ -50,18 +50,5 @@ curl -X POST https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CA }' ``` - - - -```js -// send a custom event to all users watching the call -call.sendCustomEvent({ - custom: { - 'render-animation': 'balloons', - }, - user_id: 'john', -}); -``` - diff --git a/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx b/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx index 88c91a97..30496a18 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx @@ -76,27 +76,5 @@ curl -X GET "https://video.stream-io-api.com/api/v2/video/call/livestream/${CALL # Stream key: create a user token ``` - - - -```js -const resp = await call.get(); - -// userId of existing user -const userId = 'jane'; -await client.upsertUsers({ - users: { - [userId]: { - id: userId, - }, - }, -}); -const token = client.createToken(userId); -const rtmpURL = resp.call.ingress.rtmp.address; -const streamKey = token; - -console.log(rtmpURL, streamKey); -``` - diff --git a/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx b/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx index cc81ca4d..d8e0d9b7 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx @@ -144,35 +144,6 @@ curl -X PUT https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE}? }' ``` - - - -```js -// 1. create a new storage with all the required parameters -await serverSideClient.video.createExternalStorage({ - bucket: 'my-bucket', - name: 'my-s3', - storage_type: 's3', - path: 'directory_name/', - aws_s3: { - s3_region: 'us-east-1', - s3_api_key: 'my-access-key', - s3_secret: 'my-secret', - }, -}); - -// 2. (Optional) Check storage configuration for correctness -// In case of any errors, this will throw a ResponseError. -await serverSideClient.video.checkExternalStorage({ - name: 'my-s3', -}); - -// 3. update the call type to use the new storage -await serverSideClient.updateCallType('my-call-type', { - external_storage: 'my-s3', -}); -``` - @@ -262,21 +233,6 @@ curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${C }' ``` - - - -```js -// update the call type to use Stream S3 storage for recordings -await serverSideClient.updateCallType('my-call-type', { - external_storage: 'stream-s3', -}); - -// specify Stream S3 storage when starting call transcribing -await call.startTranscription({ - transcription_external_storage: 'my-storage', -}); -``` - @@ -406,19 +362,6 @@ curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${AP ``` - - - -```js -await serverSideClient.video.createExternalStorage({ - bucket: 'my-bucket', - name: 'my-gcs', - storage_type: 'gcs', - path: 'directory_name/', - gcs_credentials: 'content of the service account file', -}); -``` - @@ -521,19 +464,5 @@ curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${AP }' ``` - - - -```js -await serverSideClient.video.createExternalStorage({ - name: 'my-abs', - storage_type: 'abs', - bucket: 'my-bucket', - path: 'directory_name/', - abs_account_name: '...', - abs_account_key: '...', -}); -``` - diff --git a/docusaurus/video/docusaurus/docs/api/basics/calls.mdx b/docusaurus/video/docusaurus/docs/api/basics/calls.mdx index aa868f5c..d92c9968 100644 --- a/docusaurus/video/docusaurus/docs/api/basics/calls.mdx +++ b/docusaurus/video/docusaurus/docs/api/basics/calls.mdx @@ -275,35 +275,6 @@ curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_ }' ``` - - - -```js -const callType = (await client.video.listCallTypes()).call_types[callTypeName]; -// Remove JOIN_CALL permission from user role -const userGrants = callType.grants['user'].filter( - (c) => c !== VideoOwnCapability.JOIN_CALL, -); -// Make sure JOIN_CALL permission is set for call_member role -const callMemberGrants = callType.grants['call_member']; -if (!callMemberGrants.includes(VideoOwnCapability.JOIN_CALL)) { - callMemberGrants.push(VideoOwnCapability.JOIN_CALL); -} - -// Update the call type with the changes -await client.video.updateCallType(callTypeName, { - grants: { - user: [], - call_member: [ - VideoOwnCapability.JOIN_CALL, - VideoOwnCapability.GET_CALL, - VideoOwnCapability.SEND_AUDIO, - VideoOwnCapability.JOIN_CALL, - ], - }, -}); -``` - @@ -349,13 +320,6 @@ curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${C -H "stream-auth-type: jwt" ``` - - - -```js -await call.endCall(); -``` - @@ -784,32 +748,6 @@ curl -X POST "https://video.stream-io-api.com/api/v2/video/call/members?api_key= }' ``` - - - -```js -// default sorting -call.queryMembers(); - -// sorting and pagination -const queryMembersReq = { - sort: [{ field: 'user_id', direction: 1 }], - limit: 2, -}; -const response = await call.queryMembers(queryMembersReq); - -// loading next page -call.queryMembers({ - ...queryMembersReq, - next: response.next, -}); - -// filtering -call.queryMembers({ - filter_conditions: { role: { $eq: 'admin' } }, -}); -``` - @@ -903,21 +841,6 @@ curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${C }' ``` - - - -```js -await call.pinVideo({ - session_id: 'session-id', - user_id: 'user-id-to-pin', -}); - -await call.unpinVideo({ - session_id: 'session-id', - user_id: 'user-id-to-unpin', -}); -``` - @@ -1038,29 +961,6 @@ curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_ }' ``` - - - -```js -await client.video.updateCallType('default', { - settings: { - limits: { - max_duration_seconds: 3600, - }, - }, -}); - -// Disable the default session timer -await client.video.updateCallType('default', { - name: 'default', - settings: { - limits: { - max_duration_seconds: 0, - }, - }, -}); -``` - diff --git a/docusaurus/video/docusaurus/docs/api/basics/multi-tenant.mdx b/docusaurus/video/docusaurus/docs/api/basics/multi-tenant.mdx index 47b8ca1a..d59fe96f 100644 --- a/docusaurus/video/docusaurus/docs/api/basics/multi-tenant.mdx +++ b/docusaurus/video/docusaurus/docs/api/basics/multi-tenant.mdx @@ -79,20 +79,6 @@ curl -X PATCH "https://video.stream-io-api.com/api/v2/app?api_key=${API_KEY}" \ }' ``` - - - -```js -// shows the current status -const appSettings = await client.getAppSettings(); -console.log(appSettings.app.multi_tenant_enabled); - -// enables teams -client.updateAppSettings({ - multi_tenant_enabled: true, -}); -``` - @@ -160,21 +146,6 @@ curl -X POST https://video.stream-io-api.com/api/v2/users?api_key=${API_KEY} \ }' ``` - - - -```js -client.upsertUsers({ - users: { - ['']: { - id: '', - name: 'Sara', - teams: ['red', 'blue'], - }, - }, -}); -``` - @@ -345,28 +316,6 @@ curl -X GET "https://video.stream-io-api.com/api/v2/users?api_key=${API_KEY}&pay ``` - - -```js -// search for users by name and team -client.queryUsers({ - filter_conditions: { - name: 'Nick', - teams: { $in: ['red', 'blue'] }, - }, -}); - -// search for users that are not part of any team -client.queryUsers({ - filter_conditions: { - name: 'Tom', - teams: null, - }, -}); -``` - - - ## Query Calls diff --git a/docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx b/docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx index 35b73fe4..1c2afd0c 100644 --- a/docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx +++ b/docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx @@ -202,17 +202,6 @@ curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_ }' ``` - - - -```js -client.video.updateCallType('allhands', { - settings: { - audio: { mic_default_on: false, default_device: 'earpiece' }, - }, -}); -``` - diff --git a/docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx b/docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx index 62ca0b3c..3efc5c3e 100644 --- a/docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx +++ b/docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx @@ -140,34 +140,6 @@ curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/default?api_ - - -```js -client.video.createCallType({ - name: '', - grants: { - admin: [ - VideoOwnCapability.SEND_AUDIO, - VideoOwnCapability.SEND_VIDEO, - VideoOwnCapability.MUTE_USERS, - ], - ['customrole']: [ - VideoOwnCapability.SEND_AUDIO, - VideoOwnCapability.SEND_VIDEO, - ], - }, -}); - -// or edit a built-in call type -client.video.updateCallType('default', { - grants: { - /* ... */ - }, -}); -``` - - - ### Built-in roles diff --git a/docusaurus/video/docusaurus/docs/api/moderation/overview.mdx b/docusaurus/video/docusaurus/docs/api/moderation/overview.mdx index ff081035..5fde0cb9 100644 --- a/docusaurus/video/docusaurus/docs/api/moderation/overview.mdx +++ b/docusaurus/video/docusaurus/docs/api/moderation/overview.mdx @@ -506,37 +506,6 @@ curl -X POST https://video.stream-io-api.com/api/v2/moderation/ban?api_key=${API }' ``` - - - -```js -client.banUser({ - target_user_id: '', - user_id: '', - reason: '', -}); - -// remove the ban for a user -client.unbanUser({ - targetUserId: '', -}); - -// ban a user for 30 minutes -client.banUser({ - target_user_id: '', - user_id: '', - timeout: 30, -}); - -// ban a user and all users sharing the same IP -client.banUser({ - target_user_id: '', - user_id: '', - reason: '', - ip_ban: true, -}); -``` - @@ -634,22 +603,5 @@ curl -X POST https://video.stream-io-api.com/api/v2/users/unblock?api_key=${API_ }' ``` - - - -```js -client.blockUsers({ - blocked_user_id: 'bob', - user_id: 'alice', -}); - -client.getBlockedUsers({ userId: 'alice' }); - -client.unblockUsers({ - blocked_user_id: 'bob', - user_id: 'alice', -}); -``` - diff --git a/docusaurus/video/docusaurus/docs/api/recording/recording_calls.mdx b/docusaurus/video/docusaurus/docs/api/recording/recording_calls.mdx index f2325849..023698b5 100644 --- a/docusaurus/video/docusaurus/docs/api/recording/recording_calls.mdx +++ b/docusaurus/video/docusaurus/docs/api/recording/recording_calls.mdx @@ -379,49 +379,6 @@ curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_ }' ``` - - - -```js -// Disable on call level -call.update({ - settings_override: { - recording: { - mode: VideoRecordSettingsRequestModeEnum.DISABLED, - }, - }, -}); - -// Disable on call type level -client.video.updateCallType('', { - settings: { - recording: { - mode: VideoRecordSettingsModeEnum.DISABLED, - }, - }, -}); - -// Enable -call.update({ - settings_override: { - recording: { - mode: VideoRecordSettingsRequestModeEnum.AVAILABLE, - }, - }, -}); - -// Other settings -call.update({ - settings_override: { - recording: { - mode: VideoRecordSettingsRequestModeEnum.AVAILABLE, - audio_only: false, - quality: VideoRecordSettingsRequestQualityEnum._1080P, - }, - }, -}); -``` - @@ -494,22 +451,6 @@ curl -X PATCH "https://video.stream-io-api.com/api/v2/video/call/default/${CALL_ ``` - - -```js -// Enable -call.update({ - settings_override: { - recording: { - mode: VideoRecordSettingsRequestModeEnum.AVAILABLE, - audio_only: true, - }, - }, -}); -``` - - - ## Recording layouts @@ -709,41 +650,6 @@ curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_ }' ``` - - - -```js -const layoutOptions = { - 'logo.image_url': - 'https://theme.zdassets.com/theme_assets/9442057/efc3820e436f9150bc8cf34267fff4df052a1f9c.png', - 'logo.horizontal_position': 'center', - 'title.text': 'Building Stream Video Q&A', - 'title.horizontal_position': 'center', - 'title.color': 'black', - 'participant_label.border_radius': '0px', - 'participant.border_radius': '0px', - 'layout.spotlight.participants_bar_position': 'top', - 'layout.background_color': '#f2f2f2', - 'participant.placeholder_background_color': '#1f1f1f', - 'layout.single-participant.padding_inline': '20%', - 'participant_label.background_color': 'transparent', -}; - -client.video.updateCallType(callTypeName, { - settings: { - recording: { - mode: VideoRecordSettingsRequestModeEnum.AVAILABLE, - audio_only: false, - quality: VideoRecordSettingsRequestQualityEnum._1080P, - layout: { - name: VideoLayoutSettingsNameEnum.SPOTLIGHT, - options: layoutOptions, - }, - }, - }, -}); -``` - @@ -994,25 +900,6 @@ curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_ }' ``` - - - -```js -client.video.updateCallType(callTypeName, { - settings: { - recording: { - mode: VideoRecordSettingsRequestModeEnum.AVAILABLE, - audio_only: false, - quality: VideoRecordSettingsRequestQualityEnum._1080P, - layout: { - name: VideoLayoutSettingsNameEnum.SPOTLIGHT, - external_css_url: 'https://path/to/custom.css', - }, - }, - }, -}); -``` - @@ -1107,25 +994,6 @@ curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_ }' ``` - - - -```js -client.video.updateCallType(callTypeName, { - settings: { - recording: { - mode: VideoRecordSettingsRequestModeEnum.AVAILABLE, - audio_only: false, - quality: VideoRecordSettingsRequestQualityEnum._1080P, - layout: { - name: VideoLayoutSettingsNameEnum.CUSTOM, - external_app_url: 'https://path/to/layout/app', - }, - }, - }, -}); -``` - diff --git a/docusaurus/video/docusaurus/docs/api/streaming/backstage.mdx b/docusaurus/video/docusaurus/docs/api/streaming/backstage.mdx index 500c9a27..386d6f89 100644 --- a/docusaurus/video/docusaurus/docs/api/streaming/backstage.mdx +++ b/docusaurus/video/docusaurus/docs/api/streaming/backstage.mdx @@ -109,25 +109,6 @@ curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${C }' ``` - - - -```js -startsAt = new Date(Date.now() + 30 * 60 * 1000); -client.call('livestream', 'test-outgoing-call').getOrCreate({ - data: { - starts_at: startsAt.toISOString(), - created_by_id: 'john', - settings_override: { - backstage: { - enabled: true, - join_ahead_time_seconds: 300, - }, - }, - }, -}); -``` - @@ -245,31 +226,6 @@ curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_ }' ``` - - - -```js -// call level -call.update({ - settings_override: { - backstage: { - enabled: true, - join_ahead_time_seconds: 300, - }, - }, -}); - -// or call type level -client.video.updateCallType('', { - settings: { - backstage: { - enabled: true, - join_ahead_time_seconds: 300, - }, - }, -}); -``` - @@ -329,17 +285,6 @@ curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_ }' ``` - - - -```js -client.video.updateCallType('', { - grants: { - host: [VideoOwnCapability.JOIN_BACKSTAGE], - }, -}); -``` - diff --git a/docusaurus/video/docusaurus/docs/api/transcription/transcribing_calls.mdx b/docusaurus/video/docusaurus/docs/api/transcription/transcribing_calls.mdx index bcd04f3c..7ef6b580 100644 --- a/docusaurus/video/docusaurus/docs/api/transcription/transcribing_calls.mdx +++ b/docusaurus/video/docusaurus/docs/api/transcription/transcribing_calls.mdx @@ -389,48 +389,6 @@ curl -X PATCH "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE_NAM By default the transcriptions are stored on Stream’s S3 bucket and retained for 2-weeks. You can also configure your application to have transcriptions stored on your own external storage, see the storage section of tis document for more detail. - - - -```js -// Disable on call level -call.update({ - settings_override: { - transcription: { - mode: VideoTranscriptionSettingsRequestModeEnum.DISABLED, - }, - }, -}); - -// Disable on call type level -client.video.updateCallType('', { - settings: { - transcription: { - mode: VideoTranscriptionSettingsModeEnum.DISABLED, - }, - }, -}); - -// Enable -call.update({ - settings_override: { - transcription: { - mode: VideoTranscriptionSettingsRequestModeEnum.AVAILABLE, - }, - }, -}); - -// Other settings -call.update({ - settings_override: { - transcription: { - audio_only: false, - quality: VideoTranscriptionSettingsRequestQualityEnum.AUTO_ON, - }, - }, -}); -``` -