@stream-io/feeds-client 0.3.45 → 0.3.46
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 +14 -4
- package/dist/cjs/react-bindings.js.map +1 -1
- package/dist/es/index.mjs +2 -2
- package/dist/es/react-bindings.mjs +14 -4
- package/dist/es/react-bindings.mjs.map +1 -1
- package/dist/{feeds-client-CN3FjVMk.js → feeds-client-CF1yEox0.js} +24 -2
- package/dist/{feeds-client-CN3FjVMk.js.map → feeds-client-CF1yEox0.js.map} +1 -1
- package/dist/{feeds-client-DK7PXh7g.mjs → feeds-client-CSg4hlZ4.mjs} +24 -2
- package/dist/{feeds-client-DK7PXh7g.mjs.map → feeds-client-CSg4hlZ4.mjs.map} +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts +1 -1
- package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts.map +1 -1
- package/dist/types/feeds-client/feeds-client.d.ts +3 -1
- package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/bindings/react/hooks/useCreateFeedsClient.ts +21 -13
- package/src/feeds-client/feeds-client.ts +31 -0
|
@@ -4010,7 +4010,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
|
|
|
4010
4010
|
};
|
|
4011
4011
|
return result;
|
|
4012
4012
|
};
|
|
4013
|
-
const version = "0.3.
|
|
4013
|
+
const version = "0.3.46";
|
|
4014
4014
|
const axios = axiosImport.default ?? axiosImport;
|
|
4015
4015
|
class ApiClient {
|
|
4016
4016
|
constructor(apiKey, tokenManager, connectionIdManager, options) {
|
|
@@ -7449,6 +7449,28 @@ class FeedsClient extends FeedsApi {
|
|
|
7449
7449
|
});
|
|
7450
7450
|
return Promise.resolve();
|
|
7451
7451
|
};
|
|
7452
|
+
this.connectGuest = async (...args) => {
|
|
7453
|
+
this.checkIfUserIsConnected();
|
|
7454
|
+
const response = await this.createGuest(...args);
|
|
7455
|
+
await this.connectUser(response.user, response.access_token);
|
|
7456
|
+
return response;
|
|
7457
|
+
};
|
|
7458
|
+
this.createGuest = async (...args) => {
|
|
7459
|
+
let shouldDisconnect = false;
|
|
7460
|
+
let response;
|
|
7461
|
+
try {
|
|
7462
|
+
if (!this.state.getLatestValue().is_anonymous || !this.state.getLatestValue().connected_user) {
|
|
7463
|
+
shouldDisconnect = true;
|
|
7464
|
+
await this.connectAnonymous();
|
|
7465
|
+
}
|
|
7466
|
+
response = await super.createGuest(...args);
|
|
7467
|
+
} finally {
|
|
7468
|
+
if (shouldDisconnect) {
|
|
7469
|
+
await this.disconnectUser();
|
|
7470
|
+
}
|
|
7471
|
+
}
|
|
7472
|
+
return response;
|
|
7473
|
+
};
|
|
7452
7474
|
this.connectUser = async (user, tokenProvider) => {
|
|
7453
7475
|
this.checkIfUserIsConnected();
|
|
7454
7476
|
this.tokenManager.setTokenOrProvider(tokenProvider);
|
|
@@ -8071,4 +8093,4 @@ export {
|
|
|
8071
8093
|
shouldUpdateState as s,
|
|
8072
8094
|
uniqueArrayMerge as u
|
|
8073
8095
|
};
|
|
8074
|
-
//# sourceMappingURL=feeds-client-
|
|
8096
|
+
//# sourceMappingURL=feeds-client-CSg4hlZ4.mjs.map
|