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 CHANGED
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import './styles.css';
3
3
  import { BiBotProps } from './types/coreInterfaces';
4
- export declare const BiBot: (bibotProps: BiBotProps) => React.JSX.Element;
4
+ export declare const BiBot: React.FC<BiBotProps>;
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 ? endpoints.getInferenceURL(bibotProps === null || bibotProps === void 0 ? void 0 : bibotProps.test) : endpoints.getInferenceURL(false);
3731
- var pluginAxiosInstance = createPluginAxiosInstance(baseURL, {}, {
3732
- Authorization: bibotProps.jwt
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
- return React.createElement(AppProvider, null, React.createElement(ChatBubbleBiBot, {
4465
- jwt: bibotProps.jwt,
4466
- clientId: bibotProps.clientId,
4467
- client_session_id: bibotProps.client_session_id,
4468
- redirect_notice: bibotProps.redirect_notice,
4469
- test: bibotProps.test
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;