@stream-io/feeds-client 0.3.37 → 0.3.38
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 +7 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/react-bindings.js +11 -5
- package/dist/cjs/react-bindings.js.map +1 -1
- package/dist/es/index.mjs +2 -2
- package/dist/es/react-bindings.mjs +11 -5
- package/dist/es/react-bindings.mjs.map +1 -1
- package/dist/{feeds-client-CExHb6GS.mjs → feeds-client-B5rMw7wy.mjs} +31 -13
- package/dist/{feeds-client-CExHb6GS.mjs.map → feeds-client-B5rMw7wy.mjs.map} +1 -1
- package/dist/{feeds-client-DEV6_pkH.js → feeds-client-eEru7Ibh.js} +31 -13
- package/dist/{feeds-client-DEV6_pkH.js.map → feeds-client-eEru7Ibh.js.map} +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts +3 -3
- package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts.map +1 -1
- package/dist/types/feeds-client/feeds-client.d.ts +7 -1
- package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/bindings/react/hooks/useCreateFeedsClient.ts +23 -12
- package/src/feeds-client/feeds-client.ts +43 -15
|
@@ -3967,7 +3967,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
|
|
|
3967
3967
|
};
|
|
3968
3968
|
return result;
|
|
3969
3969
|
};
|
|
3970
|
-
const version = "0.3.
|
|
3970
|
+
const version = "0.3.38";
|
|
3971
3971
|
const axios = axiosImport.default ?? axiosImport;
|
|
3972
3972
|
class ApiClient {
|
|
3973
3973
|
constructor(apiKey, tokenManager, connectionIdManager, options) {
|
|
@@ -7355,10 +7355,22 @@ class FeedsClient extends FeedsApi {
|
|
|
7355
7355
|
}
|
|
7356
7356
|
};
|
|
7357
7357
|
this.pollFromState = (id) => this.polls_by_id.get(id);
|
|
7358
|
+
this.connectAnonymous = () => {
|
|
7359
|
+
this.checkIfUserIsConnected();
|
|
7360
|
+
this.connectionIdManager.resolveConnectionidPromise();
|
|
7361
|
+
this.tokenManager.setTokenOrProvider(void 0);
|
|
7362
|
+
this.setGetBatchOwnFieldsThrottlingInterval(
|
|
7363
|
+
this.query_batch_own_fields_throttling_interval
|
|
7364
|
+
);
|
|
7365
|
+
this.state.partialNext({
|
|
7366
|
+
connected_user: void 0,
|
|
7367
|
+
is_anonymous: true,
|
|
7368
|
+
is_ws_connection_healthy: false
|
|
7369
|
+
});
|
|
7370
|
+
return Promise.resolve();
|
|
7371
|
+
};
|
|
7358
7372
|
this.connectUser = async (user, tokenProvider) => {
|
|
7359
|
-
|
|
7360
|
-
throw new Error(`Can't connect a new user, call "disconnectUser" first`);
|
|
7361
|
-
}
|
|
7373
|
+
this.checkIfUserIsConnected();
|
|
7362
7374
|
this.tokenManager.setTokenOrProvider(tokenProvider);
|
|
7363
7375
|
this.setGetBatchOwnFieldsThrottlingInterval(
|
|
7364
7376
|
this.query_batch_own_fields_throttling_interval
|
|
@@ -7531,10 +7543,7 @@ class FeedsClient extends FeedsApi {
|
|
|
7531
7543
|
this.polls_by_id.clear();
|
|
7532
7544
|
this.activeActivities = [];
|
|
7533
7545
|
this.activeFeeds = {};
|
|
7534
|
-
this.state.partialNext(
|
|
7535
|
-
connected_user: void 0,
|
|
7536
|
-
is_ws_connection_healthy: false
|
|
7537
|
-
});
|
|
7546
|
+
this.state.partialNext(this.initialState);
|
|
7538
7547
|
this.cancelGetBatchOwnFieldsTimer();
|
|
7539
7548
|
clearQueuedFeeds();
|
|
7540
7549
|
};
|
|
@@ -7626,10 +7635,7 @@ class FeedsClient extends FeedsApi {
|
|
|
7626
7635
|
}
|
|
7627
7636
|
return feed;
|
|
7628
7637
|
};
|
|
7629
|
-
this.state = new StateStore(
|
|
7630
|
-
connected_user: void 0,
|
|
7631
|
-
is_ws_connection_healthy: false
|
|
7632
|
-
});
|
|
7638
|
+
this.state = new StateStore(this.initialState);
|
|
7633
7639
|
this.moderation = new ModerationClient(apiClient);
|
|
7634
7640
|
this.tokenManager = tokenManager;
|
|
7635
7641
|
this.connectionIdManager = connectionIdManager;
|
|
@@ -7948,6 +7954,18 @@ class FeedsClient extends FeedsApi {
|
|
|
7948
7954
|
feeds.forEach((f) => handleFollowDeleted.bind(f)({ follow }, false));
|
|
7949
7955
|
});
|
|
7950
7956
|
}
|
|
7957
|
+
get initialState() {
|
|
7958
|
+
return {
|
|
7959
|
+
connected_user: void 0,
|
|
7960
|
+
is_anonymous: false,
|
|
7961
|
+
is_ws_connection_healthy: false
|
|
7962
|
+
};
|
|
7963
|
+
}
|
|
7964
|
+
checkIfUserIsConnected() {
|
|
7965
|
+
if (this.state.getLatestValue().connected_user !== void 0 || this.wsConnection || this.state.getLatestValue().is_anonymous) {
|
|
7966
|
+
throw new Error(`Can't connect a new user, call "disconnectUser" first`);
|
|
7967
|
+
}
|
|
7968
|
+
}
|
|
7951
7969
|
}
|
|
7952
7970
|
export {
|
|
7953
7971
|
ActivityWithStateUpdates as A,
|
|
@@ -7972,4 +7990,4 @@ export {
|
|
|
7972
7990
|
shouldUpdateState as s,
|
|
7973
7991
|
uniqueArrayMerge as u
|
|
7974
7992
|
};
|
|
7975
|
-
//# sourceMappingURL=feeds-client-
|
|
7993
|
+
//# sourceMappingURL=feeds-client-B5rMw7wy.mjs.map
|