@stream-io/node-sdk 0.7.62 → 0.7.64
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.
- package/dist/index.cjs.js +998 -41
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.mjs +998 -41
- package/dist/index.es.mjs.map +1 -1
- package/dist/src/gen/chat/ChannelApi.d.ts +12 -0
- package/dist/src/gen/chat/ChatApi.d.ts +31 -1
- package/dist/src/gen/common/CommonApi.d.ts +18 -2
- package/dist/src/gen/feeds/FeedApi.d.ts +10 -3
- package/dist/src/gen/feeds/FeedsApi.d.ts +42 -4
- package/dist/src/gen/models/index.d.ts +3693 -170
- package/dist/src/gen/moderation/ModerationApi.d.ts +57 -5
- package/dist/src/gen/video/VideoApi.d.ts +6 -1
- package/dist/src/utils/query-params.d.ts +7 -0
- package/package.json +3 -3
- package/src/ApiClient.ts +8 -10
- package/src/gen/chat/ChannelApi.ts +25 -0
- package/src/gen/chat/ChatApi.ts +258 -0
- package/src/gen/common/CommonApi.ts +99 -6
- package/src/gen/feeds/FeedApi.ts +20 -2
- package/src/gen/feeds/FeedsApi.ts +187 -8
- package/src/gen/model-decoders/decoders.ts +506 -22
- package/src/gen/models/index.ts +4750 -136
- package/src/gen/moderation/ModerationApi.ts +626 -14
- package/src/gen/video/VideoApi.ts +44 -0
- package/src/utils/query-params.ts +21 -0
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
GetCallResponse,
|
|
22
22
|
GetCallSessionParticipantStatsDetailsResponse,
|
|
23
23
|
GetCallTypeResponse,
|
|
24
|
+
GetDailyDigestResponse,
|
|
24
25
|
GetEdgesResponse,
|
|
25
26
|
GetOrCreateCallRequest,
|
|
26
27
|
GetOrCreateCallResponse,
|
|
@@ -55,6 +56,8 @@ import {
|
|
|
55
56
|
QueryCallsResponse,
|
|
56
57
|
QueryUserFeedbackRequest,
|
|
57
58
|
QueryUserFeedbackResponse,
|
|
59
|
+
ReportClientEventRequest,
|
|
60
|
+
ReportClientEventResponse,
|
|
58
61
|
ResolveSipAuthRequest,
|
|
59
62
|
ResolveSipAuthResponse,
|
|
60
63
|
ResolveSipInboundRequest,
|
|
@@ -1352,6 +1355,29 @@ export class VideoApi {
|
|
|
1352
1355
|
return { ...response.body, metadata: response.metadata };
|
|
1353
1356
|
}
|
|
1354
1357
|
|
|
1358
|
+
async reportClientCallEvent(
|
|
1359
|
+
request: ReportClientEventRequest,
|
|
1360
|
+
): Promise<StreamResponse<ReportClientEventResponse>> {
|
|
1361
|
+
const body = {
|
|
1362
|
+
events: request?.events,
|
|
1363
|
+
};
|
|
1364
|
+
|
|
1365
|
+
const response = await this.apiClient.sendRequest<
|
|
1366
|
+
StreamResponse<ReportClientEventResponse>
|
|
1367
|
+
>(
|
|
1368
|
+
'POST',
|
|
1369
|
+
'/api/v2/video/call_client_event',
|
|
1370
|
+
undefined,
|
|
1371
|
+
undefined,
|
|
1372
|
+
body,
|
|
1373
|
+
'application/json',
|
|
1374
|
+
);
|
|
1375
|
+
|
|
1376
|
+
decoders.ReportClientEventResponse?.(response.body);
|
|
1377
|
+
|
|
1378
|
+
return { ...response.body, metadata: response.metadata };
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1355
1381
|
async queryCallSessionStats(
|
|
1356
1382
|
request?: QueryCallSessionStatsRequest,
|
|
1357
1383
|
): Promise<StreamResponse<QueryCallSessionStatsResponse>> {
|
|
@@ -1924,4 +1950,22 @@ export class VideoApi {
|
|
|
1924
1950
|
|
|
1925
1951
|
return { ...response.body, metadata: response.metadata };
|
|
1926
1952
|
}
|
|
1953
|
+
|
|
1954
|
+
async getDailyDigest(request?: {
|
|
1955
|
+
date?: string;
|
|
1956
|
+
app_id?: string;
|
|
1957
|
+
}): Promise<StreamResponse<GetDailyDigestResponse>> {
|
|
1958
|
+
const queryParams = {
|
|
1959
|
+
date: request?.date,
|
|
1960
|
+
app_id: request?.app_id,
|
|
1961
|
+
};
|
|
1962
|
+
|
|
1963
|
+
const response = await this.apiClient.sendRequest<
|
|
1964
|
+
StreamResponse<GetDailyDigestResponse>
|
|
1965
|
+
>('GET', '/api/v2/video/stats/daily_digest', undefined, queryParams);
|
|
1966
|
+
|
|
1967
|
+
decoders.GetDailyDigestResponse?.(response.body);
|
|
1968
|
+
|
|
1969
|
+
return { ...response.body, metadata: response.metadata };
|
|
1970
|
+
}
|
|
1927
1971
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const isScalar = (value: any) => {
|
|
2
|
+
const type = typeof value;
|
|
3
|
+
return type === 'string' || type === 'number' || type === 'boolean';
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Scalar arrays go on the wire comma-separated (`ids=a,b`), anything else has
|
|
8
|
+
* to be JSON or it stringifies to `[object Object]`. `null` and `undefined`
|
|
9
|
+
* entries are dropped so that a single empty value can't flip the format.
|
|
10
|
+
*/
|
|
11
|
+
export const stringifyArrayParam = (param: any[]) => {
|
|
12
|
+
const entries = [];
|
|
13
|
+
let allScalar = true;
|
|
14
|
+
for (const entry of param) {
|
|
15
|
+
if (entry == null) continue;
|
|
16
|
+
if (!isScalar(entry)) allScalar = false;
|
|
17
|
+
entries.push(entry);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return allScalar ? entries.join(',') : JSON.stringify(entries);
|
|
21
|
+
};
|