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.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -3727,10 +3727,13 @@ var useBiBotChatBot = function useBiBotChatBot(bibotProps) {
|
|
3727
3727
|
var _useContext = React.useContext(AppContext),
|
3728
3728
|
state = _useContext.state,
|
3729
3729
|
dispatch = _useContext.dispatch;
|
3730
|
-
var baseURL = bibotProps !== null && bibotProps !== void 0 && bibotProps.test
|
3731
|
-
|
3732
|
-
|
3733
|
-
}
|
3730
|
+
var baseURL = endpoints.getInferenceURL(!!(bibotProps !== null && bibotProps !== void 0 && bibotProps.test));
|
3731
|
+
if (bibotProps.internalUserOnly.internalUseOnly && !bibotProps.internalUserOnly.jwt) {
|
3732
|
+
throw new Error('Internal use only requires jwt. Please refer to documentation on https://www.npmjs.com/package/bibot');
|
3733
|
+
}
|
3734
|
+
var pluginAxiosInstance = bibotProps.internalUserOnly.internalUseOnly ? createPluginAxiosInstance(baseURL, {}, {
|
3735
|
+
Authorization: bibotProps.internalUserOnly.jwt
|
3736
|
+
}) : createPluginAxiosInstance(baseURL, {}, {});
|
3734
3737
|
var _useState = React.useState(true),
|
3735
3738
|
showPredefinedQuestions = _useState[0],
|
3736
3739
|
setShowPredefinedQuestions = _useState[1];
|
@@ -4461,13 +4464,33 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
|
|
4461
4464
|
};
|
4462
4465
|
|
4463
4466
|
var BiBot = function BiBot(bibotProps) {
|
4464
|
-
|
4465
|
-
|
4466
|
-
|
4467
|
-
|
4468
|
-
|
4469
|
-
|
4470
|
-
|
4467
|
+
var clientId = bibotProps.clientId,
|
4468
|
+
client_session_id = bibotProps.client_session_id,
|
4469
|
+
redirect_notice = bibotProps.redirect_notice,
|
4470
|
+
test = bibotProps.test,
|
4471
|
+
internalUserOnly = bibotProps.internalUserOnly;
|
4472
|
+
if (internalUserOnly.internalUseOnly) {
|
4473
|
+
return React.createElement(AppProvider, null, React.createElement(ChatBubbleBiBot, {
|
4474
|
+
clientId: clientId,
|
4475
|
+
client_session_id: client_session_id,
|
4476
|
+
redirect_notice: redirect_notice,
|
4477
|
+
test: test,
|
4478
|
+
internalUserOnly: {
|
4479
|
+
internalUseOnly: true,
|
4480
|
+
jwt: internalUserOnly.jwt
|
4481
|
+
}
|
4482
|
+
}));
|
4483
|
+
} else {
|
4484
|
+
return React.createElement(AppProvider, null, React.createElement(ChatBubbleBiBot, {
|
4485
|
+
clientId: clientId,
|
4486
|
+
client_session_id: client_session_id,
|
4487
|
+
redirect_notice: redirect_notice,
|
4488
|
+
test: test,
|
4489
|
+
internalUserOnly: {
|
4490
|
+
internalUseOnly: false
|
4491
|
+
}
|
4492
|
+
}));
|
4493
|
+
}
|
4471
4494
|
};
|
4472
4495
|
|
4473
4496
|
exports.BiBot = BiBot;
|