bibot 1.0.57 → 1.0.58
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +34 -11
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +34 -11
- package/dist/index.modern.js.map +1 -1
- package/dist/types/coreInterfaces.d.ts +8 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
@@ -3724,10 +3724,13 @@ var useBiBotChatBot = function useBiBotChatBot(bibotProps) {
|
|
3724
3724
|
var _useContext = useContext(AppContext),
|
3725
3725
|
state = _useContext.state,
|
3726
3726
|
dispatch = _useContext.dispatch;
|
3727
|
-
var baseURL = bibotProps !== null && bibotProps !== void 0 && bibotProps.test
|
3728
|
-
|
3729
|
-
|
3730
|
-
}
|
3727
|
+
var baseURL = endpoints.getInferenceURL(!!(bibotProps !== null && bibotProps !== void 0 && bibotProps.test));
|
3728
|
+
if (bibotProps.internalUserOnly.internalUseOnly && !bibotProps.internalUserOnly.jwt) {
|
3729
|
+
throw new Error('Internal use only requires jwt. Please refer to documentation on https://www.npmjs.com/package/bibot');
|
3730
|
+
}
|
3731
|
+
var pluginAxiosInstance = bibotProps.internalUserOnly.internalUseOnly ? createPluginAxiosInstance(baseURL, {}, {
|
3732
|
+
Authorization: bibotProps.internalUserOnly.jwt
|
3733
|
+
}) : createPluginAxiosInstance(baseURL, {}, {});
|
3731
3734
|
var _useState = useState(true),
|
3732
3735
|
showPredefinedQuestions = _useState[0],
|
3733
3736
|
setShowPredefinedQuestions = _useState[1];
|
@@ -4458,13 +4461,33 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
|
|
4458
4461
|
};
|
4459
4462
|
|
4460
4463
|
var BiBot = function BiBot(bibotProps) {
|
4461
|
-
|
4462
|
-
|
4463
|
-
|
4464
|
-
|
4465
|
-
|
4466
|
-
|
4467
|
-
|
4464
|
+
var clientId = bibotProps.clientId,
|
4465
|
+
client_session_id = bibotProps.client_session_id,
|
4466
|
+
redirect_notice = bibotProps.redirect_notice,
|
4467
|
+
test = bibotProps.test,
|
4468
|
+
internalUserOnly = bibotProps.internalUserOnly;
|
4469
|
+
if (internalUserOnly.internalUseOnly) {
|
4470
|
+
return createElement(AppProvider, null, createElement(ChatBubbleBiBot, {
|
4471
|
+
clientId: clientId,
|
4472
|
+
client_session_id: client_session_id,
|
4473
|
+
redirect_notice: redirect_notice,
|
4474
|
+
test: test,
|
4475
|
+
internalUserOnly: {
|
4476
|
+
internalUseOnly: true,
|
4477
|
+
jwt: internalUserOnly.jwt
|
4478
|
+
}
|
4479
|
+
}));
|
4480
|
+
} else {
|
4481
|
+
return createElement(AppProvider, null, createElement(ChatBubbleBiBot, {
|
4482
|
+
clientId: clientId,
|
4483
|
+
client_session_id: client_session_id,
|
4484
|
+
redirect_notice: redirect_notice,
|
4485
|
+
test: test,
|
4486
|
+
internalUserOnly: {
|
4487
|
+
internalUseOnly: false
|
4488
|
+
}
|
4489
|
+
}));
|
4490
|
+
}
|
4468
4491
|
};
|
4469
4492
|
|
4470
4493
|
export { BiBot };
|