@stream-io/node-sdk 0.8.11 → 0.8.13
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 +26 -0
- package/__tests__/docs-snippets/README.md +87 -0
- package/dist/index.cjs.js +233 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.es.mjs +232 -14
- package/dist/index.es.mjs.map +1 -1
- package/dist/src/StreamChannel.d.ts +8 -1
- package/dist/src/StreamChatClient.d.ts +12 -0
- package/dist/src/gen/common/CommonApi.d.ts +2 -1
- package/dist/src/gen/feeds/FeedsApi.d.ts +4 -1
- package/dist/src/gen/models/index.d.ts +581 -11
- package/dist/src/gen/video/VideoApi.d.ts +2 -1
- package/index.ts +2 -0
- package/package.json +6 -1
- package/src/ApiClient.ts +3 -2
- package/src/StreamChannel.ts +23 -1
- package/src/StreamChatClient.ts +29 -1
- package/src/StreamClient.ts +13 -6
- package/src/gen/common/CommonApi.ts +25 -0
- package/src/gen/feeds/FeedsApi.ts +30 -0
- package/src/gen/model-decoders/decoders.ts +118 -2
- package/src/gen/models/index.ts +595 -11
- package/src/gen/moderation/ModerationApi.ts +2 -0
- package/src/gen/video/VideoApi.ts +25 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.13](https://github.com/GetStream/stream-node/compare/v0.8.12...v0.8.13) (2026-10-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add viewer_location to GetOrCreateFeedRequest ([#372](https://github.com/GetStream/stream-node/issues/372)) ([5983bdc](https://github.com/GetStream/stream-node/commit/5983bdcb143fde71ae70d5857b08b4c7677bf8c6))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* SDK issues from running chat docs snippets; chat docs snippet runner ([#373](https://github.com/GetStream/stream-node/issues/373)) ([bd78f75](https://github.com/GetStream/stream-node/commit/bd78f7595d7d4514f08575e8af63378fa3bc6677))
|
|
14
|
+
|
|
15
|
+
## [0.8.12](https://github.com/GetStream/stream-node/compare/v0.8.11...v0.8.12) (2026-10-09)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* add selector time_budget_ms and degraded_selectors ([#371](https://github.com/GetStream/stream-node/issues/371)) ([b60a393](https://github.com/GetStream/stream-node/commit/b60a39319672a283e0e2407102b4f508a7a376d2))
|
|
21
|
+
* update to latest API spec ([#368](https://github.com/GetStream/stream-node/issues/368)) ([f2d53d2](https://github.com/GetStream/stream-node/commit/f2d53d2fa0e7e800bfa04f90f97f434d16ec79b0))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* don't encode validity_in_seconds in user/call token payloads ([#366](https://github.com/GetStream/stream-node/issues/366)) ([e74fad5](https://github.com/GetStream/stream-node/commit/e74fad5d59382f9138a2eadb568edde25501034e))
|
|
27
|
+
* file type in uploadChannelImage/uploadChannelFile methods ([#370](https://github.com/GetStream/stream-node/issues/370)) ([3748509](https://github.com/GetStream/stream-node/commit/3748509b8295cecc98e6917c5811bc405c8f21cd))
|
|
28
|
+
|
|
3
29
|
## [0.8.11](https://github.com/GetStream/stream-node/compare/v0.8.10...v0.8.11) (2026-10-05)
|
|
4
30
|
|
|
5
31
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Docs snippet tests
|
|
2
|
+
|
|
3
|
+
Typed tests that run the server-side Node.js snippets of the chat docs (the pages of the Node sidebar,
|
|
4
|
+
`getstream.io/content/docs/_sidebars/[chat][node].json`) and of the platform docs (the pages of
|
|
5
|
+
`getstream.io/content/docs/_sidebars/[platform][default].json`) against a real Stream app.
|
|
6
|
+
Only fences labelled `Node.js` are in scope (docs fences must always have a label): they are fixed when they are
|
|
7
|
+
wrong. `JavaScript`, `React` and `React Native` fences (client-side code) and `Node.js` fences inside a `<disclosure label="... (no SDK)">` block (reference
|
|
8
|
+
implementations without the SDK) are out of scope and are neither tested nor changed.
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
# credentials: STREAM_API_KEY / STREAM_SECRET in the repo root .env (the node SDK test app, see .env-example)
|
|
12
|
+
yarn test:docs # all docs tests
|
|
13
|
+
yarn test:docs pages/chat/node/01-quick_start/01-backend_quickstart.test.ts # one file
|
|
14
|
+
yarn types:docs # typecheck the docs tests
|
|
15
|
+
yarn test:docs:sync # test regions == docs fences (no network)
|
|
16
|
+
yarn test:docs:sweep # remove docs-test leftovers older than 30 min, incl. channels, and turns off retention policies (DOCS_SWEEP_DRY_RUN=1 to list only, DOCS_SWEEP_MIN_AGE=0 for all)
|
|
17
|
+
yarn eslint __tests__/docs-snippets && npx prettier --check __tests__/docs-snippets # lint
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
These tests hit the network and are not part of `yarn test` (which runs `__tests__/integration`). Don't run them
|
|
21
|
+
at the same time as `yarn test`: both use the same app, and the drift check would see the other suite's changes.
|
|
22
|
+
|
|
23
|
+
## How to add tests?
|
|
24
|
+
|
|
25
|
+
Run the `docs-sync` Claude Code skill (`.claude/skills/docs-sync/SKILL.md`): `/docs-sync [path to the getstream.io checkout]`. It runs `yarn test:docs:sync` against that checkout, adds tests for new `Node.js` snippets, updates existing tests to docs changes (the docs win), and writes fixes for snippets that don't work back to the docs.
|
|
26
|
+
|
|
27
|
+
## Push credentials (optional)
|
|
28
|
+
|
|
29
|
+
`DOCS_PUSH_FIREBASE_CREDENTIALS` in the repo root `.env`: a Firebase service account JSON, on one line. Snippets
|
|
30
|
+
that need real push credentials run in `describe.skipIf(!hasFirebaseCredentials)` (`helpers/push.ts`), so the
|
|
31
|
+
suite passes without it (those tests are reported as skipped). `sampleFirebaseCredentials` (`helpers/push.ts`) is
|
|
32
|
+
the sample service account JSON from the platform push providers page, for snippets with a credentials
|
|
33
|
+
placeholder; when the API rejects it, the snippet needs real credentials and is skipped. Push and webhook tests only call the API and
|
|
34
|
+
check the response, or read the setting back (`getApp`, `listPushProviders`, push preferences, ...). They don't
|
|
35
|
+
check that notifications or webhook events arrive.
|
|
36
|
+
|
|
37
|
+
## Layout
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
pages/chat/<docs section>/<page>.test.ts # chat Node.js snippets, run with the server client
|
|
41
|
+
pages/platform/<docs section>/<page>.test.ts # platform Node.js snippets
|
|
42
|
+
helpers/ # server client, unique ids, cleanup registry, server-side helpers,
|
|
43
|
+
# waits, leak check, app snapshot, push credentials
|
|
44
|
+
env.ts # .env loading (fails without STREAM_API_KEY / STREAM_SECRET)
|
|
45
|
+
setup.ts # per-file leak check and app-settings drift check
|
|
46
|
+
global-setup.ts # end-of-run sweep: removes leftovers of files that failed while loading
|
|
47
|
+
sync/ # `yarn test:docs:sync` (docs fence <-> test region check)
|
|
48
|
+
maintenance/ # `yarn test:docs:sweep`
|
|
49
|
+
docs-snippets-todo.md # open API spec / generator and node SDK issues
|
|
50
|
+
AGENTS.md # test conventions and API quirks, read before working on a page
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The path mirrors the docs path (relative to `content/docs`) without `/_default`, e.g.
|
|
54
|
+
`chat/_default/04-messages/01-send_message.md` maps to `pages/chat/04-messages/01-send_message.test.ts`,
|
|
55
|
+
`chat/node/01-quick_start/...` to `pages/chat/node/01-quick_start/...` and
|
|
56
|
+
`platform/02-identity-and-access/02-users.md` to `pages/platform/02-identity-and-access/02-users.test.ts`.
|
|
57
|
+
|
|
58
|
+
## Conventions
|
|
59
|
+
|
|
60
|
+
The test conventions and the API quirks found so far are in [`AGENTS.md`](AGENTS.md). Read it before working on a page.
|
|
61
|
+
|
|
62
|
+
## Snippet markers and docs sync
|
|
63
|
+
|
|
64
|
+
Each docs fence has exactly one marked region in a test. `yarn test:docs:sync` (no network) compares them, so later edits on either side fail until they agree again:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
// #region snippet docs="chat/node/01-quick_start/01-backend_quickstart.md" heading="Syncing channels" tab="Node.js" index=1
|
|
68
|
+
// COPY: channelId="kung-fu", creatorId="4645"
|
|
69
|
+
const channel = client.chat.channel("messaging", channelId);
|
|
70
|
+
|
|
71
|
+
// create the channel and set created_by to user id 4645
|
|
72
|
+
await channel.getOrCreate({ data: { created_by_id: creatorId } });
|
|
73
|
+
// #endregion snippet
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
- **Fence key**:
|
|
77
|
+
- `docs` is the page path relative to `getstream.io/content/docs/` (`chat/...` or `platform/...`).
|
|
78
|
+
- `heading` is the text of the nearest heading above the fence.
|
|
79
|
+
- `tab` is the fence `label` (or `unlabelled`).
|
|
80
|
+
- `index` is 1-based among fences with the same heading text and tab (default 1).
|
|
81
|
+
- **COPY**: `name="literal"` pairs, applied to the region before comparing (identifier `name` becomes the docs literal). Don't use COPY variables as object keys or shorthand properties.
|
|
82
|
+
- **Comparison**: both sides are formatted with the same prettier options, so quote style and line wrapping don't matter, but any code or comment change does.
|
|
83
|
+
- **Coverage** (checked first): every `Node.js` fence (`js`/`javascript`/`ts`/`typescript`) on the pages of the chat Node sidebar and the platform sidebar (`content/docs/_sidebars/[chat][node].json`, `[platform][default].json`), whether or not the page has tests yet, must have a region (inside `it.skip` if it can't run). `JavaScript` / `React` / `React Native` fences and comment-only fences are ignored.
|
|
84
|
+
- **Labels**: every JS fence on those pages must be labelled `JavaScript`, `React`, `React Native` or `Node.js`; unlabelled or otherwise labelled JS fences fail.
|
|
85
|
+
- **Excluded pages**: `EXCLUDED_PAGES` in `sync/parse.ts` lists sidebar pages that are deliberately not validated, with a reason. Both checks skip them.
|
|
86
|
+
- **`DOCS_SYNC_WRITE=<page path> yarn test:docs:sync`** writes the regions of that page into the docs fences (docs prettier style). Use it to apply a fix to the docs. `DOCS_SYNC_WRITE=1` writes all pages.
|
|
87
|
+
- **`DOCS_DIR`** points at another docs checkout (default: `../getstream.io/content/docs` next to this repo). The check is skipped if the directory doesn't exist.
|
package/dist/index.cjs.js
CHANGED
|
@@ -847,6 +847,26 @@ decoders["AsyncExportErrorEvent"] = (input) => {
|
|
|
847
847
|
}
|
|
848
848
|
}, input);
|
|
849
849
|
};
|
|
850
|
+
decoders["AsyncExportLabelResultsEvent"] = (input) => {
|
|
851
|
+
return decode({
|
|
852
|
+
created_at: {
|
|
853
|
+
type: "DatetimeType",
|
|
854
|
+
isSingle: true
|
|
855
|
+
},
|
|
856
|
+
finished_at: {
|
|
857
|
+
type: "DatetimeType",
|
|
858
|
+
isSingle: true
|
|
859
|
+
},
|
|
860
|
+
started_at: {
|
|
861
|
+
type: "DatetimeType",
|
|
862
|
+
isSingle: true
|
|
863
|
+
},
|
|
864
|
+
received_at: {
|
|
865
|
+
type: "DatetimeType",
|
|
866
|
+
isSingle: true
|
|
867
|
+
}
|
|
868
|
+
}, input);
|
|
869
|
+
};
|
|
850
870
|
decoders["AsyncExportModerationLogsEvent"] = (input) => {
|
|
851
871
|
return decode({
|
|
852
872
|
created_at: {
|
|
@@ -907,6 +927,46 @@ decoders["AsyncExportUsersEvent"] = (input) => {
|
|
|
907
927
|
}
|
|
908
928
|
}, input);
|
|
909
929
|
};
|
|
930
|
+
decoders["AsyncImportErrorEvent"] = (input) => {
|
|
931
|
+
return decode({
|
|
932
|
+
created_at: {
|
|
933
|
+
type: "DatetimeType",
|
|
934
|
+
isSingle: true
|
|
935
|
+
},
|
|
936
|
+
finished_at: {
|
|
937
|
+
type: "DatetimeType",
|
|
938
|
+
isSingle: true
|
|
939
|
+
},
|
|
940
|
+
received_at: {
|
|
941
|
+
type: "DatetimeType",
|
|
942
|
+
isSingle: true
|
|
943
|
+
},
|
|
944
|
+
started_at: {
|
|
945
|
+
type: "DatetimeType",
|
|
946
|
+
isSingle: true
|
|
947
|
+
}
|
|
948
|
+
}, input);
|
|
949
|
+
};
|
|
950
|
+
decoders["AsyncImportSuccessEvent"] = (input) => {
|
|
951
|
+
return decode({
|
|
952
|
+
created_at: {
|
|
953
|
+
type: "DatetimeType",
|
|
954
|
+
isSingle: true
|
|
955
|
+
},
|
|
956
|
+
finished_at: {
|
|
957
|
+
type: "DatetimeType",
|
|
958
|
+
isSingle: true
|
|
959
|
+
},
|
|
960
|
+
received_at: {
|
|
961
|
+
type: "DatetimeType",
|
|
962
|
+
isSingle: true
|
|
963
|
+
},
|
|
964
|
+
started_at: {
|
|
965
|
+
type: "DatetimeType",
|
|
966
|
+
isSingle: true
|
|
967
|
+
}
|
|
968
|
+
}, input);
|
|
969
|
+
};
|
|
910
970
|
decoders["AutomodDetailsResponse"] = (input) => {
|
|
911
971
|
return decode({ result: {
|
|
912
972
|
type: "MessageModerationResult",
|
|
@@ -1623,6 +1683,22 @@ decoders["CallRingEvent"] = (input) => {
|
|
|
1623
1683
|
}
|
|
1624
1684
|
}, input);
|
|
1625
1685
|
};
|
|
1686
|
+
decoders["CallRingSettledEvent"] = (input) => {
|
|
1687
|
+
return decode({
|
|
1688
|
+
created_at: {
|
|
1689
|
+
type: "DatetimeType",
|
|
1690
|
+
isSingle: true
|
|
1691
|
+
},
|
|
1692
|
+
rang_at: {
|
|
1693
|
+
type: "DatetimeType",
|
|
1694
|
+
isSingle: true
|
|
1695
|
+
},
|
|
1696
|
+
settled_at: {
|
|
1697
|
+
type: "DatetimeType",
|
|
1698
|
+
isSingle: true
|
|
1699
|
+
}
|
|
1700
|
+
}, input);
|
|
1701
|
+
};
|
|
1626
1702
|
decoders["CallRtmpBroadcastFailedEvent"] = (input) => {
|
|
1627
1703
|
return decode({ created_at: {
|
|
1628
1704
|
type: "DatetimeType",
|
|
@@ -2803,6 +2879,22 @@ decoders["CommentDeletedEvent"] = (input) => {
|
|
|
2803
2879
|
}
|
|
2804
2880
|
}, input);
|
|
2805
2881
|
};
|
|
2882
|
+
decoders["CommentFeedbackEvent"] = (input) => {
|
|
2883
|
+
return decode({
|
|
2884
|
+
created_at: {
|
|
2885
|
+
type: "DatetimeType",
|
|
2886
|
+
isSingle: true
|
|
2887
|
+
},
|
|
2888
|
+
received_at: {
|
|
2889
|
+
type: "DatetimeType",
|
|
2890
|
+
isSingle: true
|
|
2891
|
+
},
|
|
2892
|
+
user: {
|
|
2893
|
+
type: "UserResponseCommonFields",
|
|
2894
|
+
isSingle: true
|
|
2895
|
+
}
|
|
2896
|
+
}, input);
|
|
2897
|
+
};
|
|
2806
2898
|
decoders["CommentReactionAddedEvent"] = (input) => {
|
|
2807
2899
|
return decode({
|
|
2808
2900
|
created_at: {
|
|
@@ -3729,6 +3821,12 @@ decoders["FeedsReactionResponse"] = (input) => {
|
|
|
3729
3821
|
}
|
|
3730
3822
|
}, input);
|
|
3731
3823
|
};
|
|
3824
|
+
decoders["FeedsRetentionPolicy"] = (input) => {
|
|
3825
|
+
return decode({ enabled_at: {
|
|
3826
|
+
type: "DatetimeType",
|
|
3827
|
+
isSingle: true
|
|
3828
|
+
} }, input);
|
|
3829
|
+
};
|
|
3732
3830
|
decoders["FeedsShareResponse"] = (input) => {
|
|
3733
3831
|
return decode({
|
|
3734
3832
|
created_at: {
|
|
@@ -4239,7 +4337,7 @@ decoders["GetFeedViewResponse"] = (input) => {
|
|
|
4239
4337
|
};
|
|
4240
4338
|
decoders["GetFeedsRetentionPolicyResponse"] = (input) => {
|
|
4241
4339
|
return decode({ policies: {
|
|
4242
|
-
type: "
|
|
4340
|
+
type: "FeedsRetentionPolicy",
|
|
4243
4341
|
isSingle: false
|
|
4244
4342
|
} }, input);
|
|
4245
4343
|
};
|
|
@@ -5967,6 +6065,12 @@ decoders["QueryCallParticipantsResponse"] = (input) => {
|
|
|
5967
6065
|
}
|
|
5968
6066
|
}, input);
|
|
5969
6067
|
};
|
|
6068
|
+
decoders["QueryCallRingAttemptsResponse"] = (input) => {
|
|
6069
|
+
return decode({ ring_attempts: {
|
|
6070
|
+
type: "RingAttemptResponse",
|
|
6071
|
+
isSingle: false
|
|
6072
|
+
} }, input);
|
|
6073
|
+
};
|
|
5970
6074
|
decoders["QueryCallSessionParticipantStatsResponse"] = (input) => {
|
|
5971
6075
|
return decode({
|
|
5972
6076
|
participants: {
|
|
@@ -6703,6 +6807,66 @@ decoders["RevisionHistoryResponse"] = (input) => {
|
|
|
6703
6807
|
isSingle: true
|
|
6704
6808
|
} }, input);
|
|
6705
6809
|
};
|
|
6810
|
+
decoders["RingAttemptResponse"] = (input) => {
|
|
6811
|
+
return decode({
|
|
6812
|
+
created_at: {
|
|
6813
|
+
type: "DatetimeType",
|
|
6814
|
+
isSingle: true
|
|
6815
|
+
},
|
|
6816
|
+
expires_at: {
|
|
6817
|
+
type: "DatetimeType",
|
|
6818
|
+
isSingle: true
|
|
6819
|
+
},
|
|
6820
|
+
targets: {
|
|
6821
|
+
type: "RingTargetResponse",
|
|
6822
|
+
isSingle: false
|
|
6823
|
+
},
|
|
6824
|
+
deleted_at: {
|
|
6825
|
+
type: "DatetimeType",
|
|
6826
|
+
isSingle: true
|
|
6827
|
+
},
|
|
6828
|
+
settled_at: {
|
|
6829
|
+
type: "DatetimeType",
|
|
6830
|
+
isSingle: true
|
|
6831
|
+
}
|
|
6832
|
+
}, input);
|
|
6833
|
+
};
|
|
6834
|
+
decoders["RingDeliveryResponse"] = (input) => {
|
|
6835
|
+
return decode({
|
|
6836
|
+
sent_at: {
|
|
6837
|
+
type: "DatetimeType",
|
|
6838
|
+
isSingle: true
|
|
6839
|
+
},
|
|
6840
|
+
acked_at: {
|
|
6841
|
+
type: "DatetimeType",
|
|
6842
|
+
isSingle: true
|
|
6843
|
+
},
|
|
6844
|
+
displayed_at: {
|
|
6845
|
+
type: "DatetimeType",
|
|
6846
|
+
isSingle: true
|
|
6847
|
+
},
|
|
6848
|
+
fetched_at: {
|
|
6849
|
+
type: "DatetimeType",
|
|
6850
|
+
isSingle: true
|
|
6851
|
+
},
|
|
6852
|
+
provider_accepted_at: {
|
|
6853
|
+
type: "DatetimeType",
|
|
6854
|
+
isSingle: true
|
|
6855
|
+
}
|
|
6856
|
+
}, input);
|
|
6857
|
+
};
|
|
6858
|
+
decoders["RingTargetResponse"] = (input) => {
|
|
6859
|
+
return decode({
|
|
6860
|
+
state_at: {
|
|
6861
|
+
type: "DatetimeType",
|
|
6862
|
+
isSingle: true
|
|
6863
|
+
},
|
|
6864
|
+
deliveries: {
|
|
6865
|
+
type: "RingDeliveryResponse",
|
|
6866
|
+
isSingle: false
|
|
6867
|
+
}
|
|
6868
|
+
}, input);
|
|
6869
|
+
};
|
|
6706
6870
|
decoders["Role"] = (input) => {
|
|
6707
6871
|
return decode({
|
|
6708
6872
|
created_at: {
|
|
@@ -6917,7 +7081,7 @@ decoders["SessionWarningResponse"] = (input) => {
|
|
|
6917
7081
|
};
|
|
6918
7082
|
decoders["SetFeedsRetentionPolicyResponse"] = (input) => {
|
|
6919
7083
|
return decode({ policy: {
|
|
6920
|
-
type: "
|
|
7084
|
+
type: "FeedsRetentionPolicy",
|
|
6921
7085
|
isSingle: true
|
|
6922
7086
|
} }, input);
|
|
6923
7087
|
};
|
|
@@ -8274,6 +8438,16 @@ var CommonApi = class {
|
|
|
8274
8438
|
decoders["UpdateBlockListResponse"]?.(response);
|
|
8275
8439
|
return response;
|
|
8276
8440
|
}
|
|
8441
|
+
async checkGCPPubSub(request) {
|
|
8442
|
+
const body = {
|
|
8443
|
+
gcp_pubsub_event_based_ordering_key_enabled: request?.gcp_pubsub_event_based_ordering_key_enabled,
|
|
8444
|
+
gcp_pubsub_region: request?.gcp_pubsub_region,
|
|
8445
|
+
gcp_pubsub_topic: request?.gcp_pubsub_topic
|
|
8446
|
+
};
|
|
8447
|
+
const response = await this.apiClient.sendRequest("POST", "/api/v2/check_gcp_pubsub", void 0, void 0, body);
|
|
8448
|
+
decoders["CheckGCPPubSubResponse"]?.(response);
|
|
8449
|
+
return response;
|
|
8450
|
+
}
|
|
8277
8451
|
async checkPush(request) {
|
|
8278
8452
|
const body = {
|
|
8279
8453
|
apn_template: request?.apn_template,
|
|
@@ -9055,6 +9229,16 @@ var VideoApi = class {
|
|
|
9055
9229
|
decoders["QueryCallMembersResponse"]?.(response);
|
|
9056
9230
|
return response;
|
|
9057
9231
|
}
|
|
9232
|
+
async queryCallRingAttempts(request) {
|
|
9233
|
+
const body = {
|
|
9234
|
+
id: request?.id,
|
|
9235
|
+
type: request?.type,
|
|
9236
|
+
call_session_id: request?.call_session_id
|
|
9237
|
+
};
|
|
9238
|
+
const response = await this.apiClient.sendRequest("POST", "/api/v2/video/call/ring_attempts", void 0, void 0, body);
|
|
9239
|
+
decoders["QueryCallRingAttemptsResponse"]?.(response);
|
|
9240
|
+
return response;
|
|
9241
|
+
}
|
|
9058
9242
|
async queryCallStats(request) {
|
|
9059
9243
|
const body = {
|
|
9060
9244
|
limit: request?.limit,
|
|
@@ -11609,6 +11793,12 @@ var StreamChannel = class extends ChannelApi {
|
|
|
11609
11793
|
...request?.payload ?? { filter_conditions: {} }
|
|
11610
11794
|
} });
|
|
11611
11795
|
}
|
|
11796
|
+
uploadChannelFile = (request) => {
|
|
11797
|
+
return super.uploadChannelFile(request);
|
|
11798
|
+
};
|
|
11799
|
+
uploadChannelImage = (request) => {
|
|
11800
|
+
return super.uploadChannelImage(request);
|
|
11801
|
+
};
|
|
11612
11802
|
};
|
|
11613
11803
|
//#endregion
|
|
11614
11804
|
//#region src/StreamChatClient.ts
|
|
@@ -11616,6 +11806,12 @@ var StreamChatClient = class extends ChatApi {
|
|
|
11616
11806
|
channel = (type, id) => {
|
|
11617
11807
|
return new StreamChannel(this, type, id);
|
|
11618
11808
|
};
|
|
11809
|
+
uploadChannelFile = (request) => {
|
|
11810
|
+
return super.uploadChannelFile(request);
|
|
11811
|
+
};
|
|
11812
|
+
uploadChannelImage = (request) => {
|
|
11813
|
+
return super.uploadChannelImage(request);
|
|
11814
|
+
};
|
|
11619
11815
|
};
|
|
11620
11816
|
//#endregion
|
|
11621
11817
|
//#region src/gen/moderation/ModerationApi.ts
|
|
@@ -11768,9 +11964,11 @@ var ModerationApi = class {
|
|
|
11768
11964
|
async ban(request) {
|
|
11769
11965
|
const body = {
|
|
11770
11966
|
target_user_id: request?.target_user_id,
|
|
11967
|
+
ban_from_future_channels: request?.ban_from_future_channels,
|
|
11771
11968
|
banned_by_id: request?.banned_by_id,
|
|
11772
11969
|
channel_cid: request?.channel_cid,
|
|
11773
11970
|
delete_messages: request?.delete_messages,
|
|
11971
|
+
delete_reactions: request?.delete_reactions,
|
|
11774
11972
|
ip_ban: request?.ip_ban,
|
|
11775
11973
|
reason: request?.reason,
|
|
11776
11974
|
shadow: request?.shadow,
|
|
@@ -12325,7 +12523,7 @@ var ApiClient = class {
|
|
|
12325
12523
|
const headers = {
|
|
12326
12524
|
Authorization: this.apiConfig.token,
|
|
12327
12525
|
"stream-auth-type": "jwt",
|
|
12328
|
-
"X-Stream-Client": "stream-node-0.8.
|
|
12526
|
+
"X-Stream-Client": "stream-node-0.8.13",
|
|
12329
12527
|
"Accept-Encoding": "gzip",
|
|
12330
12528
|
"x-client-request-id": clientRequestId
|
|
12331
12529
|
};
|
|
@@ -12366,8 +12564,8 @@ var ApiClient = class {
|
|
|
12366
12564
|
clientRequestId,
|
|
12367
12565
|
responseCode: error.status
|
|
12368
12566
|
};
|
|
12369
|
-
if (error.name === "AbortError" || error.name === "TimeoutError") throw new StreamError(`The request was aborted due to to the ${this.apiConfig.timeout}ms timeout, you can set the timeout in the StreamClient constructor`, metadata, void 0, error);
|
|
12370
|
-
else throw new StreamError(`The request failed due to an unexpected error`, metadata, error);
|
|
12567
|
+
if (error.name === "AbortError" || error.name === "TimeoutError") throw new StreamError(`The request was aborted due to to the ${this.apiConfig.timeout}ms timeout, you can set the timeout in the StreamClient constructor`, metadata, void 0, { cause: error });
|
|
12568
|
+
else throw new StreamError(`The request failed due to an unexpected error`, metadata, void 0, { cause: error });
|
|
12371
12569
|
}
|
|
12372
12570
|
};
|
|
12373
12571
|
multipartBodyStringify = (body) => {
|
|
@@ -13002,6 +13200,17 @@ var FeedsApi = class {
|
|
|
13002
13200
|
decoders["UpdateCommentResponse"]?.(response);
|
|
13003
13201
|
return response;
|
|
13004
13202
|
}
|
|
13203
|
+
async commentFeedback(request) {
|
|
13204
|
+
const pathParams = { id: request?.id };
|
|
13205
|
+
const body = {
|
|
13206
|
+
hide: request?.hide,
|
|
13207
|
+
user_id: request?.user_id,
|
|
13208
|
+
user: request?.user
|
|
13209
|
+
};
|
|
13210
|
+
const response = await this.apiClient.sendRequest("POST", "/api/v2/feeds/comments/{id}/feedback", pathParams, void 0, body);
|
|
13211
|
+
decoders["CommentFeedbackResponse"]?.(response);
|
|
13212
|
+
return response;
|
|
13213
|
+
}
|
|
13005
13214
|
async updateCommentPartial(request) {
|
|
13006
13215
|
const pathParams = { id: request?.id };
|
|
13007
13216
|
const body = {
|
|
@@ -13155,6 +13364,7 @@ var FeedsApi = class {
|
|
|
13155
13364
|
user_id: request?.user_id,
|
|
13156
13365
|
view: request?.view,
|
|
13157
13366
|
watch: request?.watch,
|
|
13367
|
+
discard_actors: request?.discard_actors,
|
|
13158
13368
|
data: request?.data,
|
|
13159
13369
|
enrichment_options: request?.enrichment_options,
|
|
13160
13370
|
external_ranking: request?.external_ranking,
|
|
@@ -13164,7 +13374,8 @@ var FeedsApi = class {
|
|
|
13164
13374
|
friend_reactions_options: request?.friend_reactions_options,
|
|
13165
13375
|
interest_weights: request?.interest_weights,
|
|
13166
13376
|
member_pagination: request?.member_pagination,
|
|
13167
|
-
user: request?.user
|
|
13377
|
+
user: request?.user,
|
|
13378
|
+
viewer_location: request?.viewer_location
|
|
13168
13379
|
};
|
|
13169
13380
|
const response = await this.apiClient.sendRequest("POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}", pathParams, queryParams, body);
|
|
13170
13381
|
decoders["GetOrCreateFeedResponse"]?.(response);
|
|
@@ -13715,7 +13926,8 @@ var FeedsApi = class {
|
|
|
13715
13926
|
const body = {
|
|
13716
13927
|
max_age_hours: request?.max_age_hours,
|
|
13717
13928
|
policy: request?.policy,
|
|
13718
|
-
enabled: request?.enabled
|
|
13929
|
+
enabled: request?.enabled,
|
|
13930
|
+
feed_groups: request?.feed_groups
|
|
13719
13931
|
};
|
|
13720
13932
|
const response = await this.apiClient.sendRequest("POST", "/api/v2/feeds/retention_policy", void 0, void 0, body);
|
|
13721
13933
|
decoders["SetFeedsRetentionPolicyResponse"]?.(response);
|
|
@@ -14046,11 +14258,15 @@ var StreamClient = class StreamClient extends CommonApi {
|
|
|
14046
14258
|
* - iat - issued at date of the token, unix timestamp in seconds, by default it's now
|
|
14047
14259
|
*/
|
|
14048
14260
|
generateUserToken = (payload) => {
|
|
14261
|
+
const { validity_in_seconds, ...claims } = payload;
|
|
14049
14262
|
const defaultIat = Math.floor((Date.now() - 1e3) / 1e3);
|
|
14050
|
-
|
|
14051
|
-
const
|
|
14052
|
-
|
|
14053
|
-
|
|
14263
|
+
const iat = claims.iat ?? defaultIat;
|
|
14264
|
+
const exp = claims.exp ?? iat + (validity_in_seconds ?? 3600);
|
|
14265
|
+
return JWTUserToken(this.secret, {
|
|
14266
|
+
...claims,
|
|
14267
|
+
iat,
|
|
14268
|
+
exp
|
|
14269
|
+
});
|
|
14054
14270
|
};
|
|
14055
14271
|
/**
|
|
14056
14272
|
*
|
|
@@ -14060,8 +14276,10 @@ var StreamClient = class StreamClient extends CommonApi {
|
|
|
14060
14276
|
*/
|
|
14061
14277
|
generatePermanentUserToken = (payload) => {
|
|
14062
14278
|
const defaultIat = Math.floor((Date.now() - 1e3) / 1e3);
|
|
14063
|
-
|
|
14064
|
-
|
|
14279
|
+
return JWTUserToken(this.secret, {
|
|
14280
|
+
...payload,
|
|
14281
|
+
iat: payload.iat ?? defaultIat
|
|
14282
|
+
});
|
|
14065
14283
|
};
|
|
14066
14284
|
/**
|
|
14067
14285
|
*
|
|
@@ -14281,8 +14499,10 @@ exports.StreamCall = StreamCall;
|
|
|
14281
14499
|
exports.StreamChannel = StreamChannel;
|
|
14282
14500
|
exports.StreamChatClient = StreamChatClient;
|
|
14283
14501
|
exports.StreamClient = StreamClient;
|
|
14502
|
+
exports.StreamError = StreamError;
|
|
14284
14503
|
exports.StreamFeed = StreamFeed;
|
|
14285
14504
|
exports.StreamFeedsClient = StreamFeedsClient;
|
|
14286
14505
|
exports.StreamVideoClient = StreamVideoClient;
|
|
14506
|
+
exports.verifyAndParseWebhook = verifyAndParseWebhook;
|
|
14287
14507
|
|
|
14288
14508
|
//# sourceMappingURL=index.cjs.js.map
|