@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
|
@@ -4028,7 +4028,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
|
|
|
4028
4028
|
};
|
|
4029
4029
|
return result;
|
|
4030
4030
|
};
|
|
4031
|
-
const version = "0.3.
|
|
4031
|
+
const version = "0.3.46";
|
|
4032
4032
|
const axios = axiosImport.default ?? axiosImport;
|
|
4033
4033
|
class ApiClient {
|
|
4034
4034
|
constructor(apiKey, tokenManager, connectionIdManager, options) {
|
|
@@ -7467,6 +7467,28 @@ class FeedsClient extends FeedsApi {
|
|
|
7467
7467
|
});
|
|
7468
7468
|
return Promise.resolve();
|
|
7469
7469
|
};
|
|
7470
|
+
this.connectGuest = async (...args) => {
|
|
7471
|
+
this.checkIfUserIsConnected();
|
|
7472
|
+
const response = await this.createGuest(...args);
|
|
7473
|
+
await this.connectUser(response.user, response.access_token);
|
|
7474
|
+
return response;
|
|
7475
|
+
};
|
|
7476
|
+
this.createGuest = async (...args) => {
|
|
7477
|
+
let shouldDisconnect = false;
|
|
7478
|
+
let response;
|
|
7479
|
+
try {
|
|
7480
|
+
if (!this.state.getLatestValue().is_anonymous || !this.state.getLatestValue().connected_user) {
|
|
7481
|
+
shouldDisconnect = true;
|
|
7482
|
+
await this.connectAnonymous();
|
|
7483
|
+
}
|
|
7484
|
+
response = await super.createGuest(...args);
|
|
7485
|
+
} finally {
|
|
7486
|
+
if (shouldDisconnect) {
|
|
7487
|
+
await this.disconnectUser();
|
|
7488
|
+
}
|
|
7489
|
+
}
|
|
7490
|
+
return response;
|
|
7491
|
+
};
|
|
7470
7492
|
this.connectUser = async (user, tokenProvider) => {
|
|
7471
7493
|
this.checkIfUserIsConnected();
|
|
7472
7494
|
this.tokenManager.setTokenOrProvider(tokenProvider);
|
|
@@ -8087,4 +8109,4 @@ exports.replaceUniqueArrayMerge = replaceUniqueArrayMerge;
|
|
|
8087
8109
|
exports.shouldUpdateState = shouldUpdateState;
|
|
8088
8110
|
exports.uniqueArrayMerge = uniqueArrayMerge;
|
|
8089
8111
|
exports.updateEntityInArray = updateEntityInArray;
|
|
8090
|
-
//# sourceMappingURL=feeds-client-
|
|
8112
|
+
//# sourceMappingURL=feeds-client-CF1yEox0.js.map
|