bibot 1.0.57 → 1.0.60

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 ? endpoints.getInferenceURL(bibotProps === null || bibotProps === void 0 ? void 0 : bibotProps.test) : endpoints.getInferenceURL(false);
3728
- var pluginAxiosInstance = createPluginAxiosInstance(baseURL, {}, {
3729
- Authorization: bibotProps.jwt
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
- return createElement(AppProvider, null, createElement(ChatBubbleBiBot, {
4462
- jwt: bibotProps.jwt,
4463
- clientId: bibotProps.clientId,
4464
- client_session_id: bibotProps.client_session_id,
4465
- redirect_notice: bibotProps.redirect_notice,
4466
- test: bibotProps.test
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 };