@stream-io/node-sdk 0.1.12 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  * Stream API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: v100.4.3
5
+ * The version of the OpenAPI document: v113.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/node-sdk",
3
- "version": "0.1.12",
3
+ "version": "0.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -65,5 +65,6 @@
65
65
  "@types/node": "^20.11.24",
66
66
  "jsonwebtoken": "^9.0.2",
67
67
  "uuid": "^9.0.1"
68
- }
68
+ },
69
+ "enginges": ">=18.0.0"
69
70
  }
package/src/StreamCall.ts CHANGED
@@ -1,26 +1,28 @@
1
1
  import { StreamClient } from './StreamClient';
2
2
  import {
3
- DefaultApi,
3
+ DeleteRecordingRequest,
4
+ DeleteTranscriptionRequest,
4
5
  GetCallRequest,
5
- VideoPinRequest,
6
- VideoUnpinRequest,
6
+ ProductvideoApi,
7
7
  VideoBlockUserRequest,
8
8
  VideoGetOrCreateCallRequest,
9
9
  VideoGoLiveRequest,
10
10
  VideoMuteUsersRequest,
11
+ VideoPinRequest,
12
+ VideoQueryCallMembersRequest,
13
+ VideoStartRecordingRequest,
14
+ VideoStartTranscriptionRequest,
11
15
  VideoUnblockUserRequest,
12
- VideoUpdateCallRequest,
16
+ VideoUnpinRequest,
13
17
  VideoUpdateCallMembersRequest,
18
+ VideoUpdateCallRequest,
14
19
  VideoUpdateUserPermissionsRequest,
15
- VideoQueryMembersRequest,
16
- VideoStartRecordingRequest,
17
- VideoStartTranscriptionRequest,
18
20
  } from './gen/video';
19
21
  import { OmitTypeId } from './types';
20
22
 
21
23
  export class StreamCall {
22
24
  private readonly baseRequest: { type: string; id: string };
23
- private readonly apiClient: DefaultApi;
25
+ private readonly apiClient: ProductvideoApi;
24
26
 
25
27
  constructor(
26
28
  private readonly streamClient: StreamClient,
@@ -29,7 +31,7 @@ export class StreamCall {
29
31
  ) {
30
32
  this.baseRequest = { id: this.id, type: this.type };
31
33
  const configuration = this.streamClient.getConfiguration('video');
32
- this.apiClient = new DefaultApi(configuration);
34
+ this.apiClient = new ProductvideoApi(configuration);
33
35
  }
34
36
 
35
37
  blockUser = (videoBlockUserRequest: VideoBlockUserRequest) => {
@@ -71,6 +73,16 @@ export class StreamCall {
71
73
  });
72
74
  };
73
75
 
76
+ deleteRecording = (request: OmitTypeId<DeleteRecordingRequest>) => {
77
+ return this.apiClient.deleteRecording({ ...this.baseRequest, ...request });
78
+ };
79
+
80
+ listTranscriptions = () => {
81
+ return this.apiClient.listTranscriptions({
82
+ ...this.baseRequest,
83
+ });
84
+ };
85
+
74
86
  muteUsers = (videoMuteUsersRequest: VideoMuteUsersRequest) => {
75
87
  return this.apiClient.muteUsers({
76
88
  ...this.baseRequest,
@@ -78,14 +90,14 @@ export class StreamCall {
78
90
  });
79
91
  };
80
92
 
81
- queryMembers = (request?: OmitTypeId<VideoQueryMembersRequest>) => {
82
- return this.apiClient.queryMembers({
83
- videoQueryMembersRequest: { ...(request ?? {}), ...this.baseRequest },
93
+ queryMembers = (request?: OmitTypeId<VideoQueryCallMembersRequest>) => {
94
+ return this.apiClient.queryCallMembers({
95
+ videoQueryCallMembersRequest: { ...(request ?? {}), ...this.baseRequest },
84
96
  });
85
97
  };
86
98
 
87
99
  sendCustomEvent = (event: Record<string, any>) => {
88
- return this.apiClient.sendEvent({
100
+ return this.apiClient.sendCallEvent({
89
101
  videoSendEventRequest: { custom: event },
90
102
  ...this.baseRequest,
91
103
  });
@@ -111,6 +123,13 @@ export class StreamCall {
111
123
  });
112
124
  };
113
125
 
126
+ deleteTranscription = (request: OmitTypeId<DeleteTranscriptionRequest>) => {
127
+ return this.apiClient.deleteTranscription({
128
+ ...this.baseRequest,
129
+ ...request,
130
+ });
131
+ };
132
+
114
133
  stopHLSBroadcasting = () => {
115
134
  return this.apiClient.stopHLSBroadcasting({ ...this.baseRequest });
116
135
  };
@@ -517,18 +517,18 @@ export class StreamClient {
517
517
  queryParamsStringify: (params: HTTPQuery) => {
518
518
  const newParams = [];
519
519
  for (const k in params) {
520
- if (Array.isArray(params[k]) || typeof params[k] === 'object') {
521
- newParams.push(
522
- `${k}=${encodeURIComponent(JSON.stringify(params[k]))}`,
523
- );
520
+ const param = params[k];
521
+ if (Array.isArray(param)) {
522
+ newParams.push(`${k}=${encodeURIComponent(param.join(','))}`);
523
+ } else if (typeof param === 'object') {
524
+ newParams.push(`${k}=${encodeURIComponent(JSON.stringify(param))}`);
524
525
  } else {
525
- const value = params[k];
526
526
  if (
527
- typeof value === 'string' ||
528
- typeof value === 'number' ||
529
- typeof value === 'boolean'
527
+ typeof param === 'string' ||
528
+ typeof param === 'number' ||
529
+ typeof param === 'boolean'
530
530
  ) {
531
- newParams.push(`${k}=${encodeURIComponent(value)}`);
531
+ newParams.push(`${k}=${encodeURIComponent(param)}`);
532
532
  }
533
533
  }
534
534
  }
@@ -2,12 +2,10 @@ import { StreamCall } from './StreamCall';
2
2
  import { StreamClient } from './StreamClient';
3
3
  import {
4
4
  CheckExternalStorageRequest,
5
- DefaultApi,
6
5
  DeleteCallTypeRequest,
7
6
  DeleteExternalStorageRequest,
8
7
  GetCallTypeRequest,
9
- ServerSideApi,
10
- SettingsApi,
8
+ ProductvideoApi,
11
9
  VideoCreateCallTypeRequest,
12
10
  VideoCreateExternalStorageRequest,
13
11
  VideoQueryCallsRequest,
@@ -16,15 +14,11 @@ import {
16
14
  } from './gen/video';
17
15
 
18
16
  export class StreamVideoClient {
19
- private readonly apiClient: DefaultApi;
20
- private readonly videoServerSideApiClient: ServerSideApi;
21
- private readonly settingsApi: SettingsApi;
17
+ private readonly apiClient: ProductvideoApi;
22
18
 
23
19
  constructor(private readonly streamClient: StreamClient) {
24
20
  const configuration = this.streamClient.getConfiguration('video');
25
- this.apiClient = new DefaultApi(configuration);
26
- this.settingsApi = new SettingsApi(configuration);
27
- this.videoServerSideApiClient = new ServerSideApi(configuration);
21
+ this.apiClient = new ProductvideoApi(configuration);
28
22
  }
29
23
 
30
24
  call = (type: string, id: string) => {
@@ -38,60 +32,60 @@ export class StreamVideoClient {
38
32
  };
39
33
 
40
34
  createCallType = (videoCreateCallTypeRequest: VideoCreateCallTypeRequest) => {
41
- return this.videoServerSideApiClient.createCallType({
35
+ return this.apiClient.createCallType({
42
36
  videoCreateCallTypeRequest,
43
37
  });
44
38
  };
45
39
 
46
40
  deleteCallType = (request: DeleteCallTypeRequest) => {
47
- return this.videoServerSideApiClient.deleteCallType(request);
41
+ return this.apiClient.deleteCallType(request);
48
42
  };
49
43
 
50
44
  getCallType = (request: GetCallTypeRequest) => {
51
- return this.videoServerSideApiClient.getCallType(request);
45
+ return this.apiClient.getCallType(request);
52
46
  };
53
47
 
54
48
  listCallTypes = () => {
55
- return this.videoServerSideApiClient.listCallTypes();
49
+ return this.apiClient.listCallTypes();
56
50
  };
57
51
 
58
52
  updateCallType = (
59
53
  name: string,
60
54
  videoUpdateCallTypeRequest: VideoUpdateCallTypeRequest,
61
55
  ) => {
62
- return this.videoServerSideApiClient.updateCallType({
56
+ return this.apiClient.updateCallType({
63
57
  name,
64
58
  videoUpdateCallTypeRequest,
65
59
  });
66
60
  };
67
61
 
68
62
  listExternalStorages = () => {
69
- return this.settingsApi.listExternalStorage();
63
+ return this.apiClient.listExternalStorage();
70
64
  };
71
65
 
72
66
  createExternalStorage = (
73
67
  videoCreateExternalStorageRequest: VideoCreateExternalStorageRequest,
74
68
  ) => {
75
- return this.settingsApi.createExternalStorage({
69
+ return this.apiClient.createExternalStorage({
76
70
  videoCreateExternalStorageRequest,
77
71
  });
78
72
  };
79
73
 
80
74
  deleteExternalStorage = (request: DeleteExternalStorageRequest) => {
81
- return this.settingsApi.deleteExternalStorage(request);
75
+ return this.apiClient.deleteExternalStorage(request);
82
76
  };
83
77
 
84
78
  updateExternalStorage = (
85
79
  name: string,
86
80
  videoUpdateExternalStorageRequest: VideoUpdateExternalStorageRequest,
87
81
  ) => {
88
- return this.videoServerSideApiClient.updateExternalStorage({
82
+ return this.apiClient.updateExternalStorage({
89
83
  name,
90
84
  videoUpdateExternalStorageRequest,
91
85
  });
92
86
  };
93
87
 
94
88
  checkExternalStorage = (request: CheckExternalStorageRequest) => {
95
- return this.videoServerSideApiClient.checkExternalStorage(request);
89
+ return this.apiClient.checkExternalStorage(request);
96
90
  };
97
91
  }
@@ -462,7 +462,7 @@ export class MessagesApi extends runtime.BaseAPI {
462
462
  const queryParameters: any = {};
463
463
 
464
464
  if (requestParameters.ids) {
465
- queryParameters['ids'] = requestParameters.ids.join(',');
465
+ queryParameters['ids'] = requestParameters.ids;
466
466
  }
467
467
 
468
468
  const headerParameters: runtime.HTTPHeaders = {};
@@ -1,7 +1,5 @@
1
1
  .openapi-generator-ignore
2
- apis/DefaultApi.ts
3
- apis/ServerSideApi.ts
4
- apis/SettingsApi.ts
2
+ apis/ProductvideoApi.ts
5
3
  apis/index.ts
6
4
  index.ts
7
5
  models/index.ts