@stream-io/node-sdk 0.7.64 → 0.8.1

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.
@@ -221,7 +221,7 @@ export declare class VideoApi {
221
221
  limit?: number;
222
222
  prev?: string;
223
223
  next?: string;
224
- sort?: SortParamRequest[];
224
+ sort?: Array<SortParamRequest>;
225
225
  filter_conditions?: Record<string, any>;
226
226
  }): Promise<StreamResponse<QueryCallSessionParticipantStatsResponse>>;
227
227
  getCallSessionParticipantStatsTimeline(request: {
@@ -232,7 +232,7 @@ export declare class VideoApi {
232
232
  user_session: string;
233
233
  start_time?: string;
234
234
  end_time?: string;
235
- severity?: string[];
235
+ severity?: Array<string>;
236
236
  }): Promise<StreamResponse<QueryCallSessionParticipantStatsTimelineResponse>>;
237
237
  queryCalls(request?: QueryCallsRequest): Promise<StreamResponse<QueryCallsResponse>>;
238
238
  listCallTypes(): Promise<StreamResponse<ListCallTypeResponse>>;
@@ -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.7.64",
3
+ "version": "0.8.1",
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
- "prepare": "husky install",
23
- "prepublish": "yarn build",
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": "rollup -w -c",
27
- "build": "rm -rf dist && rollup -c",
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 **/*.ts",
30
- "lint:fix": "eslint --fix **/*.ts",
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/**/*ts && prettier src/gen/**/*.ts --write"
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
- "@rollup/plugin-replace": "^6.0.3",
50
- "@rollup/plugin-typescript": "^12.3.0",
52
+ "@eslint/js": "^10.0.1",
51
53
  "@stream-io/openai-realtime-api": "~0.3.3",
52
- "@typescript-eslint/eslint-plugin": "^6.21.0",
53
- "@typescript-eslint/parser": "^6.21.0",
54
- "dotenv": "^17.3.1",
55
- "eslint": "^8.57.1",
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": "^16.3.3",
64
- "prettier": "^3.8.1",
65
- "rollup": "^4.59.0",
66
- "tslib": "^2.8.1",
67
- "typescript": "^5.9.3",
68
- "vite": "^6.4.1",
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": ">=18.0.0"
80
+ "node": ">=22.12.0"
87
81
  },
88
- "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
89
- }
82
+ "packageManager": "yarn@4.18.0"
83
+ }
package/src/ApiClient.ts CHANGED
@@ -82,7 +82,7 @@ export class ApiClient {
82
82
  let error: APIError;
83
83
  try {
84
84
  error = (await response.json()) as APIError;
85
- } catch (_) {
85
+ } catch {
86
86
  throw new StreamError(
87
87
  `Stream error: ${response.status} - ${response.statusText}`,
88
88
  metadata,
@@ -255,7 +255,7 @@ export class StreamClient extends CommonApi {
255
255
 
256
256
  try {
257
257
  return crypto.timingSafeEqual(Buffer.from(hash), Buffer.from(xSignature));
258
- } catch (err) {
258
+ } catch {
259
259
  return false;
260
260
  }
261
261
  };
@@ -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
- // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
5
+
6
6
  /** @ts-ignore Optional dependency */
7
7
  import type {
8
8
  createRealtimeClient,
@@ -6,6 +6,7 @@ import {
6
6
  EventResponse,
7
7
  GetDraftResponse,
8
8
  GetManyMessagesResponse,
9
+ GetPinnedMessagesResponse,
9
10
  HideChannelRequest,
10
11
  HideChannelResponse,
11
12
  MarkReadRequest,
@@ -17,6 +18,7 @@ import {
17
18
  SendMessageResponse,
18
19
  ShowChannelRequest,
19
20
  ShowChannelResponse,
21
+ SortParamRequest,
20
22
  TruncateChannelRequest,
21
23
  TruncateChannelResponse,
22
24
  UpdateChannelPartialRequest,
@@ -64,6 +66,7 @@ export class ChannelApi {
64
66
  messages_id_gt?: string;
65
67
  messages_id_gte?: string;
66
68
  messages_id_around?: string;
69
+ user_id?: string;
67
70
  }): Promise<StreamResponse<ChannelStateResponse>> {
68
71
  if (!this.id) {
69
72
  throw new Error(
@@ -263,8 +266,8 @@ export class ChannelApi {
263
266
  }
264
267
 
265
268
  getManyMessages(request: {
266
- ids: string[];
267
- member_custom_include?: string[];
269
+ ids: Array<string>;
270
+ member_custom_include?: Array<string>;
268
271
  }): Promise<StreamResponse<GetManyMessagesResponse>> {
269
272
  if (!this.id) {
270
273
  throw new Error(
@@ -279,6 +282,36 @@ export class ChannelApi {
279
282
  });
280
283
  }
281
284
 
285
+ getPinnedMessages(request?: {
286
+ limit?: number;
287
+ offset?: number;
288
+ id_gte?: string;
289
+ id_gt?: string;
290
+ id_lte?: string;
291
+ id_lt?: string;
292
+ pinned_at_after_or_equal?: Date;
293
+ pinned_at_after?: Date;
294
+ pinned_at_before_or_equal?: Date;
295
+ pinned_at_before?: Date;
296
+ id_around?: string;
297
+ pinned_at_around?: Date;
298
+ user_id?: string;
299
+ sort?: Array<SortParamRequest>;
300
+ member_custom_include?: Array<string>;
301
+ }): Promise<StreamResponse<GetPinnedMessagesResponse>> {
302
+ if (!this.id) {
303
+ throw new Error(
304
+ `Channel isn't yet created, call getOrCreateDistinctChannel() before this operation`,
305
+ );
306
+ }
307
+
308
+ return this.chatApi.getPinnedMessages({
309
+ id: this.id,
310
+ type: this.type,
311
+ ...request,
312
+ });
313
+ }
314
+
282
315
  getOrCreate(
283
316
  request?: ChannelGetOrCreateRequest,
284
317
  ): Promise<StreamResponse<ChannelStateResponse>> {