@stream-io/node-sdk 0.7.64 → 0.8.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.
- package/CHANGELOG.md +848 -0
- package/README.md +0 -2
- package/dist/index.cjs.js +14010 -9857
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.mjs +13984 -9838
- package/dist/index.es.mjs.map +1 -1
- package/dist/src/StreamCall.d.ts +4 -4
- package/dist/src/StreamChannel.d.ts +2 -2
- package/dist/src/StreamClient.d.ts +7 -7
- package/dist/src/StreamFeedsClient.d.ts +4 -4
- package/dist/src/utils/create-token.d.ts +1 -3
- package/package.json +25 -31
- package/src/ApiClient.ts +1 -1
- package/src/StreamClient.ts +1 -1
- package/src/StreamVideoClient.ts +1 -1
- package/src/gen/models/index.ts +9 -52
- package/src/utils/create-token.ts +4 -4
package/dist/src/StreamCall.d.ts
CHANGED
|
@@ -10,10 +10,10 @@ export declare class StreamCall extends CallApi {
|
|
|
10
10
|
data?: CallResponse;
|
|
11
11
|
constructor(videoApi: VideoApi, type: string, id: string, streamClient: StreamClient);
|
|
12
12
|
get cid(): string;
|
|
13
|
-
create: (request?: GetOrCreateCallRequest) => Promise<import("./types").StreamResponse<import("
|
|
14
|
-
queryMembers: (request?: OmitTypeId<QueryCallMembersRequest>) => Promise<import("./types").StreamResponse<import("
|
|
15
|
-
getOrCreate: (request?: GetOrCreateCallRequest) => Promise<import("./types").StreamResponse<import("
|
|
16
|
-
get: () => Promise<import("./types").StreamResponse<import("
|
|
13
|
+
create: (request?: GetOrCreateCallRequest) => Promise<import("./types").StreamResponse<import("..").GetOrCreateCallResponse>>;
|
|
14
|
+
queryMembers: (request?: OmitTypeId<QueryCallMembersRequest>) => Promise<import("./types").StreamResponse<import("..").QueryCallMembersResponse>>;
|
|
15
|
+
getOrCreate: (request?: GetOrCreateCallRequest) => Promise<import("./types").StreamResponse<import("..").GetOrCreateCallResponse>>;
|
|
16
|
+
get: () => Promise<import("./types").StreamResponse<import("..").GetCallResponse>>;
|
|
17
17
|
createSRTCredentials: (userID: string) => {
|
|
18
18
|
address: string;
|
|
19
19
|
};
|
|
@@ -3,8 +3,8 @@ import { ChannelGetOrCreateRequest, QueryMembersPayload } from './gen/models';
|
|
|
3
3
|
import { OmitTypeId } from './types';
|
|
4
4
|
export declare class StreamChannel extends ChannelApi {
|
|
5
5
|
get cid(): string;
|
|
6
|
-
getOrCreate: (channel_get_or_create_request?: ChannelGetOrCreateRequest) => Promise<import("./types").StreamResponse<import("
|
|
6
|
+
getOrCreate: (channel_get_or_create_request?: ChannelGetOrCreateRequest) => Promise<import("./types").StreamResponse<import("..").ChannelStateResponse>>;
|
|
7
7
|
queryMembers(request?: {
|
|
8
8
|
payload?: OmitTypeId<QueryMembersPayload>;
|
|
9
|
-
}): Promise<import("./types").StreamResponse<import("
|
|
9
|
+
}): Promise<import("./types").StreamResponse<import("..").MembersResponse>>;
|
|
10
10
|
}
|
|
@@ -28,16 +28,16 @@ export declare class StreamClient extends CommonApi {
|
|
|
28
28
|
* @param config config object
|
|
29
29
|
*/
|
|
30
30
|
constructor(apiKey: string, secret: string, config?: StreamClientOptions | undefined);
|
|
31
|
-
upsertUsers: (users: UserRequest[]) => Promise<import("./types").StreamResponse<import("
|
|
31
|
+
upsertUsers: (users: UserRequest[]) => Promise<import("./types").StreamResponse<import("..").UpdateUsersResponse>>;
|
|
32
32
|
queryBannedUsers: (request?: {
|
|
33
33
|
payload?: QueryBannedUsersPayload;
|
|
34
|
-
}) => Promise<import("./types").StreamResponse<import("
|
|
34
|
+
}) => Promise<import("./types").StreamResponse<import("..").QueryBannedUsersResponse>>;
|
|
35
35
|
uploadFile: (request: Omit<FileUploadRequest, "file"> & {
|
|
36
36
|
file: File;
|
|
37
|
-
}) => Promise<import("./types").StreamResponse<import("
|
|
37
|
+
}) => Promise<import("./types").StreamResponse<import("..").FileUploadResponse>>;
|
|
38
38
|
uploadImage: (request: Omit<ImageUploadRequest, "file"> & {
|
|
39
39
|
file: File;
|
|
40
|
-
}) => Promise<import("./types").StreamResponse<import("
|
|
40
|
+
}) => Promise<import("./types").StreamResponse<import("..").ImageUploadResponse>>;
|
|
41
41
|
/**
|
|
42
42
|
*
|
|
43
43
|
* @param payload
|
|
@@ -117,7 +117,7 @@ export declare class StreamClient extends CommonApi {
|
|
|
117
117
|
* @throws {InvalidWebhookError} When the signature does not match or
|
|
118
118
|
* the gzip / JSON envelope is malformed.
|
|
119
119
|
*/
|
|
120
|
-
verifyAndParseWebhook: (rawBody: string | Buffer, signature: string) => import("
|
|
120
|
+
verifyAndParseWebhook: (rawBody: string | Buffer, signature: string) => import("..").WHEvent;
|
|
121
121
|
/**
|
|
122
122
|
* Parse an SQS firehose event: decodes the message `Body` (base64 +
|
|
123
123
|
* optional gzip) and returns the parsed typed event. No HMAC
|
|
@@ -126,7 +126,7 @@ export declare class StreamClient extends CommonApi {
|
|
|
126
126
|
* @param messageBody SQS message `Body` string
|
|
127
127
|
* @throws {InvalidWebhookError} When the base64 / gzip envelope is malformed.
|
|
128
128
|
*/
|
|
129
|
-
parseSqs: (messageBody: string) => import("
|
|
129
|
+
parseSqs: (messageBody: string) => import("..").WHEvent;
|
|
130
130
|
/**
|
|
131
131
|
* Parse an SNS-delivered event (unwraps envelope JSON when needed, then
|
|
132
132
|
* same decode path as SQS). No HMAC verification.
|
|
@@ -134,5 +134,5 @@ export declare class StreamClient extends CommonApi {
|
|
|
134
134
|
* @param notificationBody Raw SNS POST body or pre-extracted `Message` string
|
|
135
135
|
* @throws {InvalidWebhookError} When the envelope cannot be decoded.
|
|
136
136
|
*/
|
|
137
|
-
parseSns: (notificationBody: string) => import("
|
|
137
|
+
parseSns: (notificationBody: string) => import("..").WHEvent;
|
|
138
138
|
}
|
|
@@ -3,19 +3,19 @@ import { AddReactionRequest, FollowBatchRequest, QueryFeedsRequest, UnfollowBatc
|
|
|
3
3
|
import { StreamFeed } from './StreamFeed';
|
|
4
4
|
export declare class StreamFeedsClient extends FeedsApi {
|
|
5
5
|
feed: (group: string, id: string) => StreamFeed;
|
|
6
|
-
queryFeeds: (request: QueryFeedsRequest) => Promise<import("./types").StreamResponse<import("
|
|
6
|
+
queryFeeds: (request: QueryFeedsRequest) => Promise<import("./types").StreamResponse<import("..").QueryFeedsResponse>>;
|
|
7
7
|
/**
|
|
8
8
|
* @deprecated Use addActivityReaction instead
|
|
9
9
|
*/
|
|
10
10
|
addReaction: (request: AddReactionRequest & {
|
|
11
11
|
activity_id: string;
|
|
12
|
-
}) => Promise<import("./types").StreamResponse<import("
|
|
12
|
+
}) => Promise<import("./types").StreamResponse<import("..").AddReactionResponse>>;
|
|
13
13
|
/**
|
|
14
14
|
* @deprecated use `getOrCreateFollows` instead
|
|
15
15
|
*/
|
|
16
|
-
followBatch: (request: FollowBatchRequest) => Promise<import("./types").StreamResponse<import("
|
|
16
|
+
followBatch: (request: FollowBatchRequest) => Promise<import("./types").StreamResponse<import("..").FollowBatchResponse>>;
|
|
17
17
|
/**
|
|
18
18
|
* @deprecated use `getOrCreateUnfollows` instead
|
|
19
19
|
*/
|
|
20
|
-
followUnbatch: (request: UnfollowBatchRequest) => Promise<import("./types").StreamResponse<import("
|
|
20
|
+
followUnbatch: (request: UnfollowBatchRequest) => Promise<import("./types").StreamResponse<import("..").UnfollowBatchResponse>>;
|
|
21
21
|
}
|
|
@@ -4,7 +4,5 @@ export declare function JWTUserToken(apiSecret: Secret, payload: {
|
|
|
4
4
|
exp?: number;
|
|
5
5
|
iat: number;
|
|
6
6
|
call_cids?: string[];
|
|
7
|
-
} &
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
}): string;
|
|
7
|
+
} & Record<string, any>): string;
|
|
10
8
|
export declare function JWTServerToken(apiSecret: Secret, jwtOptions?: SignOptions): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/node-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
"url": "https://github.com/GetStream/stream-node.git"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"postinstall": "node -e \"try{require.resolve('husky')}catch{process.exit(0)};require('child_process').execSync('husky',{stdio:'inherit'})\"",
|
|
23
|
+
"prepack": "yarn build",
|
|
24
24
|
"test": "vitest",
|
|
25
25
|
"test:bun": "bun run vitest",
|
|
26
|
-
"start": "
|
|
27
|
-
"build": "rm -rf dist &&
|
|
26
|
+
"start": "vite build --watch",
|
|
27
|
+
"build": "rm -rf dist && vite build && tsc --emitDeclarationOnly -p tsconfig.json",
|
|
28
28
|
"generate:open-api": "./generate-openapi.sh",
|
|
29
|
-
"lint": "eslint
|
|
30
|
-
"lint:fix": "eslint --fix
|
|
29
|
+
"lint": "eslint src __tests__ index.ts",
|
|
30
|
+
"lint:fix": "eslint --fix src __tests__ index.ts",
|
|
31
31
|
"prettier:fix": "prettier . --write",
|
|
32
|
-
"lint:gen": "eslint --fix src/gen
|
|
32
|
+
"lint:gen": "eslint --fix \"src/gen/**/*.ts\" && prettier \"src/gen/**/*.ts\" --write"
|
|
33
33
|
},
|
|
34
34
|
"lint-staged": {
|
|
35
35
|
"**/*": [
|
|
@@ -45,33 +45,27 @@
|
|
|
45
45
|
"LICENSE",
|
|
46
46
|
".readme-assets"
|
|
47
47
|
],
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
48
51
|
"devDependencies": {
|
|
49
|
-
"@
|
|
50
|
-
"@rollup/plugin-typescript": "^12.3.0",
|
|
52
|
+
"@eslint/js": "^10.0.1",
|
|
51
53
|
"@stream-io/openai-realtime-api": "~0.3.3",
|
|
52
|
-
"@
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"eslint": "^
|
|
56
|
-
"eslint-config-prettier": "^9.1.0",
|
|
57
|
-
"eslint-config-standard-with-typescript": "^43.0.1",
|
|
58
|
-
"eslint-plugin-import": "^2.32.0",
|
|
59
|
-
"eslint-plugin-n": "^16.6.2",
|
|
60
|
-
"eslint-plugin-promise": "^6.6.0",
|
|
54
|
+
"@types/node": "^22.20.1",
|
|
55
|
+
"dotenv": "^17.4.2",
|
|
56
|
+
"eslint": "^10.8.1",
|
|
57
|
+
"eslint-config-prettier": "^10.1.8",
|
|
61
58
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
62
59
|
"husky": "^9.1.7",
|
|
63
|
-
"lint-staged": "^
|
|
64
|
-
"prettier": "^3.
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"vitest": "~3.1.4",
|
|
70
|
-
"vitest-mock-extended": "^3.1.0"
|
|
60
|
+
"lint-staged": "^17.3.0",
|
|
61
|
+
"prettier": "^3.9.6",
|
|
62
|
+
"typescript": "~6.0.3",
|
|
63
|
+
"typescript-eslint": "^8.67.0",
|
|
64
|
+
"vite": "^8.2.1",
|
|
65
|
+
"vitest": "~4.1.10"
|
|
71
66
|
},
|
|
72
67
|
"dependencies": {
|
|
73
68
|
"@types/jsonwebtoken": "^9.0.10",
|
|
74
|
-
"@types/node": "^18.3.0",
|
|
75
69
|
"jsonwebtoken": "^9.0.3"
|
|
76
70
|
},
|
|
77
71
|
"peerDependencies": {
|
|
@@ -83,7 +77,7 @@
|
|
|
83
77
|
}
|
|
84
78
|
},
|
|
85
79
|
"engines": {
|
|
86
|
-
"node": ">=
|
|
80
|
+
"node": ">=22.12.0"
|
|
87
81
|
},
|
|
88
|
-
"packageManager": "yarn@
|
|
89
|
-
}
|
|
82
|
+
"packageManager": "yarn@4.18.0"
|
|
83
|
+
}
|
package/src/ApiClient.ts
CHANGED
package/src/StreamClient.ts
CHANGED
package/src/StreamVideoClient.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ApiClient } from './ApiClient';
|
|
|
2
2
|
import { VideoApi } from './gen/video/VideoApi';
|
|
3
3
|
import { StreamCall } from './StreamCall';
|
|
4
4
|
import type { StreamClient } from './StreamClient';
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
/** @ts-ignore Optional dependency */
|
|
7
7
|
import type {
|
|
8
8
|
createRealtimeClient,
|
package/src/gen/models/index.ts
CHANGED
|
@@ -168,12 +168,7 @@ export interface APNSPayload {
|
|
|
168
168
|
|
|
169
169
|
export interface AWSRekognitionRule {
|
|
170
170
|
action:
|
|
171
|
-
| '
|
|
172
|
-
| 'shadow'
|
|
173
|
-
| 'remove'
|
|
174
|
-
| 'bounce'
|
|
175
|
-
| 'bounce_flag'
|
|
176
|
-
| 'bounce_remove';
|
|
171
|
+
'flag' | 'shadow' | 'remove' | 'bounce' | 'bounce_flag' | 'bounce_remove';
|
|
177
172
|
|
|
178
173
|
label: string;
|
|
179
174
|
|
|
@@ -2482,12 +2477,7 @@ export interface AutomodPlatformCircumventionConfig {
|
|
|
2482
2477
|
|
|
2483
2478
|
export interface AutomodRule {
|
|
2484
2479
|
action:
|
|
2485
|
-
| '
|
|
2486
|
-
| 'shadow'
|
|
2487
|
-
| 'remove'
|
|
2488
|
-
| 'bounce'
|
|
2489
|
-
| 'bounce_flag'
|
|
2490
|
-
| 'bounce_remove';
|
|
2480
|
+
'flag' | 'shadow' | 'remove' | 'bounce' | 'bounce_flag' | 'bounce_remove';
|
|
2491
2481
|
|
|
2492
2482
|
label: string;
|
|
2493
2483
|
|
|
@@ -2504,12 +2494,7 @@ export interface AutomodSemanticFiltersConfig {
|
|
|
2504
2494
|
|
|
2505
2495
|
export interface AutomodSemanticFiltersRule {
|
|
2506
2496
|
action:
|
|
2507
|
-
| '
|
|
2508
|
-
| 'shadow'
|
|
2509
|
-
| 'remove'
|
|
2510
|
-
| 'bounce'
|
|
2511
|
-
| 'bounce_flag'
|
|
2512
|
-
| 'bounce_remove';
|
|
2497
|
+
'flag' | 'shadow' | 'remove' | 'bounce' | 'bounce_flag' | 'bounce_remove';
|
|
2513
2498
|
|
|
2514
2499
|
name: string;
|
|
2515
2500
|
|
|
@@ -3344,11 +3329,7 @@ export interface BulkActionAppealsRequest {
|
|
|
3344
3329
|
*/
|
|
3345
3330
|
|
|
3346
3331
|
action_type:
|
|
3347
|
-
| '
|
|
3348
|
-
| 'restore'
|
|
3349
|
-
| 'unblock'
|
|
3350
|
-
| 'mark_reviewed'
|
|
3351
|
-
| 'reject_appeal';
|
|
3332
|
+
'unban' | 'restore' | 'unblock' | 'mark_reviewed' | 'reject_appeal';
|
|
3352
3333
|
|
|
3353
3334
|
/**
|
|
3354
3335
|
* List of appeal UUIDs to process
|
|
@@ -6263,7 +6244,6 @@ export const ChannelOwnCapability = {
|
|
|
6263
6244
|
UPLOAD_FILE: 'upload-file',
|
|
6264
6245
|
} as const;
|
|
6265
6246
|
|
|
6266
|
-
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
6267
6247
|
export type ChannelOwnCapability =
|
|
6268
6248
|
(typeof ChannelOwnCapability)[keyof typeof ChannelOwnCapability];
|
|
6269
6249
|
|
|
@@ -8770,11 +8750,7 @@ export interface CreateFeedGroupRequest {
|
|
|
8770
8750
|
*/
|
|
8771
8751
|
|
|
8772
8752
|
default_visibility?:
|
|
8773
|
-
| '
|
|
8774
|
-
| 'visible'
|
|
8775
|
-
| 'followers'
|
|
8776
|
-
| 'members'
|
|
8777
|
-
| 'private';
|
|
8753
|
+
'public' | 'visible' | 'followers' | 'members' | 'private';
|
|
8778
8754
|
|
|
8779
8755
|
/**
|
|
8780
8756
|
* Configuration for activity processors
|
|
@@ -11086,11 +11062,7 @@ export interface FeedGroupResponse {
|
|
|
11086
11062
|
*/
|
|
11087
11063
|
|
|
11088
11064
|
default_visibility?:
|
|
11089
|
-
| '
|
|
11090
|
-
| 'visible'
|
|
11091
|
-
| 'followers'
|
|
11092
|
-
| 'members'
|
|
11093
|
-
| 'private';
|
|
11065
|
+
'public' | 'visible' | 'followers' | 'members' | 'private';
|
|
11094
11066
|
|
|
11095
11067
|
deleted_at?: Date;
|
|
11096
11068
|
|
|
@@ -11339,7 +11311,6 @@ export const FeedOwnCapability = {
|
|
|
11339
11311
|
UPDATE_OWN_COMMENT: 'update-own-comment',
|
|
11340
11312
|
} as const;
|
|
11341
11313
|
|
|
11342
|
-
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
11343
11314
|
export type FeedOwnCapability =
|
|
11344
11315
|
(typeof FeedOwnCapability)[keyof typeof FeedOwnCapability];
|
|
11345
11316
|
|
|
@@ -13446,11 +13417,7 @@ export interface GetOrCreateFeedGroupRequest {
|
|
|
13446
13417
|
*/
|
|
13447
13418
|
|
|
13448
13419
|
default_visibility?:
|
|
13449
|
-
| '
|
|
13450
|
-
| 'visible'
|
|
13451
|
-
| 'followers'
|
|
13452
|
-
| 'members'
|
|
13453
|
-
| 'private';
|
|
13420
|
+
'public' | 'visible' | 'followers' | 'members' | 'private';
|
|
13454
13421
|
|
|
13455
13422
|
/**
|
|
13456
13423
|
* Configuration for activity processors
|
|
@@ -17981,12 +17948,7 @@ export interface OCRContentParameters {
|
|
|
17981
17948
|
|
|
17982
17949
|
export interface OCRRule {
|
|
17983
17950
|
action:
|
|
17984
|
-
| '
|
|
17985
|
-
| 'shadow'
|
|
17986
|
-
| 'remove'
|
|
17987
|
-
| 'bounce'
|
|
17988
|
-
| 'bounce_flag'
|
|
17989
|
-
| 'bounce_remove';
|
|
17951
|
+
'flag' | 'shadow' | 'remove' | 'bounce' | 'bounce_flag' | 'bounce_remove';
|
|
17990
17952
|
|
|
17991
17953
|
label: string;
|
|
17992
17954
|
}
|
|
@@ -18068,7 +18030,6 @@ export const OwnCapability = {
|
|
|
18068
18030
|
UPDATE_CALL_SETTINGS: 'update-call-settings',
|
|
18069
18031
|
} as const;
|
|
18070
18032
|
|
|
18071
|
-
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
18072
18033
|
export type OwnCapability = (typeof OwnCapability)[keyof typeof OwnCapability];
|
|
18073
18034
|
|
|
18074
18035
|
export interface OwnUserResponse {
|
|
@@ -26872,11 +26833,7 @@ export interface UpdateExternalStorageResponse {
|
|
|
26872
26833
|
|
|
26873
26834
|
export interface UpdateFeedGroupRequest {
|
|
26874
26835
|
default_visibility?:
|
|
26875
|
-
| '
|
|
26876
|
-
| 'visible'
|
|
26877
|
-
| 'followers'
|
|
26878
|
-
| 'members'
|
|
26879
|
-
| 'private';
|
|
26836
|
+
'public' | 'visible' | 'followers' | 'members' | 'private';
|
|
26880
26837
|
|
|
26881
26838
|
/**
|
|
26882
26839
|
* Configuration for activity processors
|
|
@@ -7,19 +7,19 @@ export function JWTUserToken(
|
|
|
7
7
|
exp?: number;
|
|
8
8
|
iat: number;
|
|
9
9
|
call_cids?: string[];
|
|
10
|
-
} &
|
|
10
|
+
} & Record<string, any>,
|
|
11
11
|
) {
|
|
12
12
|
// make sure we return a clear error when jwt is shimmed (ie. browser build)
|
|
13
|
-
if (jwt
|
|
13
|
+
if (jwt?.sign == null) {
|
|
14
14
|
throw Error(
|
|
15
15
|
`Unable to find jwt crypto, if you are getting this error is probably because you are trying to generate tokens on browser or React Native (or other environment where crypto functions are not available). Please Note: token should only be generated server-side.`,
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const opts: SignOptions =
|
|
19
|
+
const opts: SignOptions = {
|
|
20
20
|
algorithm: 'HS256',
|
|
21
21
|
noTimestamp: true,
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
|
|
24
24
|
if (payload.iat) {
|
|
25
25
|
opts.noTimestamp = false;
|