bibot 1.0.3 → 1.0.5
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/dist/components/bibot.js +171 -0
- package/dist/components/bibot.js.map +1 -0
- package/dist/config/appStateEnums.js +5 -10
- package/dist/config/endpointEnums.js +22 -27
- package/dist/config/index.js +5 -38
- package/dist/config/statusCode.js +44 -49
- package/dist/context/AppContext.js +56 -73
- package/dist/context/index.js +3 -16
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.js +4 -38
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/mobileView.js +18 -33
- package/dist/hooks/usePluginFactory.js +77 -60
- package/dist/index.d.ts +2 -1
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/dist/reducers/appReducer.js +22 -24
- package/dist/reducers/index.js +3 -16
- package/dist/services/index.js +3 -16
- package/dist/services/plugin-api.js +182 -179
- package/dist/types/coreInterfaces.d.ts +10 -1
- package/dist/types/coreInterfaces.js +2 -5
- package/dist/types/index.js +3 -16
- package/dist/utils/index.js +3 -27
- package/dist/utils/sessionManager.js +12 -16
- package/dist/utils/trimWhitespace.js +11 -15
- package/package.json +54 -50
- package/.babelrc +0 -7
- package/.vscode/settings.json +0 -5
- package/dist/bibot.js +0 -173
- package/dist/bibot.js.map +0 -1
- package/dist/hooks/useBiBotChatBot.d.ts +0 -29
- package/dist/hooks/useBiBotChatBot.js +0 -206
- package/dist/hooks/useBiBotChatBot.js.map +0 -1
- package/dist/index.css +0 -36
- package/dist/styles/RegisterPageStyle.css +0 -63
- package/dist/styles/adminPortal.css +0 -26
- package/dist/styles/appConfig.css +0 -90
- package/dist/styles/buttonStyle.css +0 -27
- package/dist/styles/chatStyle.css +0 -140
- package/dist/styles/index.css +0 -82
- package/dist/styles/predefinedStyle.css +0 -35
- package/dist/styles/themeStyle.css +0 -42
- package/dist/styles/training.css +0 -86
- package/example/README.md +0 -46
- package/example/package-lock.json +0 -18173
- package/example/package.json +0 -47
- package/example/public/favicon.ico +0 -0
- package/example/public/index.html +0 -43
- package/example/public/logo192.png +0 -0
- package/example/public/logo512.png +0 -0
- package/example/public/manifest.json +0 -25
- package/example/public/robots.txt +0 -3
- package/example/src/App.css +0 -38
- package/example/src/App.test.tsx +0 -9
- package/example/src/App.tsx +0 -28
- package/example/src/index.css +0 -13
- package/example/src/index.tsx +0 -13
- package/example/src/logo.svg +0 -1
- package/example/src/react-app-env.d.ts +0 -1
- package/example/tsconfig.json +0 -26
- package/src/bibot.tsx +0 -111
- package/src/config/appStateEnums.ts +0 -3
- package/src/config/endpointEnums.ts +0 -28
- package/src/config/index.ts +0 -5
- package/src/config/statusCode.ts +0 -49
- package/src/context/AppContext.tsx +0 -66
- package/src/context/index.ts +0 -3
- package/src/hooks/index.ts +0 -5
- package/src/hooks/mobileView.tsx +0 -17
- package/src/hooks/useBiBotChatBot.tsx +0 -107
- package/src/hooks/usePluginFactory.tsx +0 -38
- package/src/index.css +0 -36
- package/src/index.tsx +0 -3
- package/src/reducers/appReducer.ts +0 -16
- package/src/reducers/index.ts +0 -4
- package/src/services/index.ts +0 -2
- package/src/services/plugin-api.tsx +0 -120
- package/src/styles/RegisterPageStyle.css +0 -63
- package/src/styles/adminPortal.css +0 -26
- package/src/styles/appConfig.css +0 -90
- package/src/styles/buttonStyle.css +0 -27
- package/src/styles/chatStyle.css +0 -140
- package/src/styles/index.css +0 -82
- package/src/styles/predefinedStyle.css +0 -35
- package/src/styles/themeStyle.css +0 -42
- package/src/styles/training.css +0 -86
- package/src/types/coreInterfaces.ts +0 -69
- package/src/types/index.ts +0 -4
- package/src/utils/index.ts +0 -2
- package/src/utils/sessionManager.tsx +0 -15
- package/src/utils/trimWhitespace.ts +0 -11
- package/tsconfig.json +0 -25
- package/webpack.config.js +0 -19
- /package/dist/{bibot.d.ts → components/bibot.d.ts} +0 -0
package/dist/hooks/mobileView.js
CHANGED
@@ -1,33 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
var
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
(0, _react.useEffect)(function () {
|
20
|
-
var isMobileDevice = function isMobileDevice() {
|
21
|
-
var screenWidth = window.innerWidth;
|
22
|
-
var mobileThreshold = 768;
|
23
|
-
setIsMobile(screenWidth < mobileThreshold);
|
24
|
-
};
|
25
|
-
isMobileDevice();
|
26
|
-
window.addEventListener('resize', isMobileDevice);
|
27
|
-
return function () {
|
28
|
-
// clean up event listner on when component unmount
|
29
|
-
window.removeEventListener('resize', isMobileDevice);
|
30
|
-
};
|
31
|
-
}, []);
|
32
|
-
return isMobile;
|
33
|
-
}
|
1
|
+
import { useState, useEffect } from 'react';
|
2
|
+
export default function MobileView() {
|
3
|
+
var _a = useState(false), isMobile = _a[0], setIsMobile = _a[1];
|
4
|
+
useEffect(function () {
|
5
|
+
var isMobileDevice = function () {
|
6
|
+
var screenWidth = window.innerWidth;
|
7
|
+
var mobileThreshold = 768;
|
8
|
+
setIsMobile(screenWidth < mobileThreshold);
|
9
|
+
};
|
10
|
+
isMobileDevice();
|
11
|
+
window.addEventListener('resize', isMobileDevice);
|
12
|
+
return function () {
|
13
|
+
window.removeEventListener('resize', isMobileDevice);
|
14
|
+
};
|
15
|
+
}, []);
|
16
|
+
return isMobile;
|
17
|
+
}
|
18
|
+
//# sourceMappingURL=mobileView.js.map
|
@@ -1,62 +1,79 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
var _axios = _interopRequireDefault(require("axios"));
|
8
|
-
var _endpointEnums = require("../config/endpointEnums");
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
11
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
12
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
13
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
14
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
15
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
16
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
17
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
18
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
19
|
-
var inferenceBaseURL = _endpointEnums.endpoints.inference;
|
20
|
-
var createPluginAxiosInstance = exports.createPluginAxiosInstance = function createPluginAxiosInstance() {
|
21
|
-
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
22
|
-
var headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
23
|
-
var instance = _axios["default"].create(_objectSpread({
|
24
|
-
baseURL: inferenceBaseURL,
|
25
|
-
timeout: 60000,
|
26
|
-
// 1 minute
|
27
|
-
headers: _objectSpread({
|
28
|
-
'Content-Type': 'application/json'
|
29
|
-
}, headers)
|
30
|
-
}, params));
|
31
|
-
instance.interceptors.response.use(function (response) {
|
32
|
-
return response;
|
33
|
-
}, /*#__PURE__*/function () {
|
34
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(error) {
|
35
|
-
var errMsg;
|
36
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
37
|
-
while (1) switch (_context.prev = _context.next) {
|
38
|
-
case 0:
|
39
|
-
errMsg = 'An unknown error occurred';
|
40
|
-
if (error.response) {
|
41
|
-
errMsg = error.response.data.message;
|
42
|
-
} else if (error.request) {
|
43
|
-
errMsg = 'No response received from the server.';
|
44
|
-
} else {
|
45
|
-
errMsg = "Error setting up the request: ".concat(error.message);
|
46
|
-
}
|
47
|
-
_context.next = 4;
|
48
|
-
return Promise.reject(new Error(errMsg));
|
49
|
-
case 4:
|
50
|
-
return _context.abrupt("return", _context.sent);
|
51
|
-
case 5:
|
52
|
-
case "end":
|
53
|
-
return _context.stop();
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
2
|
+
__assign = Object.assign || function(t) {
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
+
s = arguments[i];
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
+
t[p] = s[p];
|
54
7
|
}
|
55
|
-
|
56
|
-
}));
|
57
|
-
return function (_x) {
|
58
|
-
return _ref.apply(this, arguments);
|
8
|
+
return t;
|
59
9
|
};
|
60
|
-
|
61
|
-
|
62
|
-
|
10
|
+
return __assign.apply(this, arguments);
|
11
|
+
};
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
19
|
+
});
|
20
|
+
};
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
25
|
+
function step(op) {
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
30
|
+
switch (op[0]) {
|
31
|
+
case 0: case 1: t = op; break;
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
35
|
+
default:
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
40
|
+
if (t[2]) _.ops.pop();
|
41
|
+
_.trys.pop(); continue;
|
42
|
+
}
|
43
|
+
op = body.call(thisArg, _);
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
46
|
+
}
|
47
|
+
};
|
48
|
+
import axios from 'axios';
|
49
|
+
import { endpoints } from '../config/endpointEnums';
|
50
|
+
var inferenceBaseURL = endpoints.inference;
|
51
|
+
export var createPluginAxiosInstance = function (params, headers) {
|
52
|
+
if (params === void 0) { params = {}; }
|
53
|
+
if (headers === void 0) { headers = {}; }
|
54
|
+
var instance = axios.create(__assign({ baseURL: inferenceBaseURL, timeout: 60000, headers: __assign({ 'Content-Type': 'application/json' }, headers) }, params));
|
55
|
+
instance.interceptors.response.use(function (response) {
|
56
|
+
return response;
|
57
|
+
}, function (error) { return __awaiter(void 0, void 0, void 0, function () {
|
58
|
+
var errMsg;
|
59
|
+
return __generator(this, function (_a) {
|
60
|
+
switch (_a.label) {
|
61
|
+
case 0:
|
62
|
+
errMsg = 'An unknown error occurred';
|
63
|
+
if (error.response) {
|
64
|
+
errMsg = error.response.data.message;
|
65
|
+
}
|
66
|
+
else if (error.request) {
|
67
|
+
errMsg = 'No response received from the server.';
|
68
|
+
}
|
69
|
+
else {
|
70
|
+
errMsg = "Error setting up the request: ".concat(error.message);
|
71
|
+
}
|
72
|
+
return [4 /*yield*/, Promise.reject(new Error(errMsg))];
|
73
|
+
case 1: return [2 /*return*/, _a.sent()];
|
74
|
+
}
|
75
|
+
});
|
76
|
+
}); });
|
77
|
+
return instance;
|
78
|
+
};
|
79
|
+
//# sourceMappingURL=usePluginFactory.js.map
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -1,9 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
}
|
6
|
-
|
7
|
-
var _bibot = _interopRequireDefault(require("./bibot"));
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
9
|
-
var _default = exports["default"] = _bibot["default"];
|
1
|
+
import BiBot from "./components/bibot";
|
2
|
+
export default BiBot;
|
3
|
+
export var testPackage = function () {
|
4
|
+
return "Hello World!";
|
5
|
+
};
|
6
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,eAAe,KAAK,CAAC;AAErB,MAAM,CAAC,IAAM,WAAW,GAAG;IACvB,OAAO,cAAc,CAAA;AACzB,CAAC,CAAA"}
|
@@ -1,24 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
}
|
24
|
-
};
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
2
|
+
__assign = Object.assign || function(t) {
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
+
s = arguments[i];
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
+
t[p] = s[p];
|
7
|
+
}
|
8
|
+
return t;
|
9
|
+
};
|
10
|
+
return __assign.apply(this, arguments);
|
11
|
+
};
|
12
|
+
import { appStateEnums } from '../config/appStateEnums';
|
13
|
+
export var appReducer = function (state, action) {
|
14
|
+
console.log('This is the appReducer state', state, action);
|
15
|
+
switch (action.type) {
|
16
|
+
case appStateEnums.BIBOT:
|
17
|
+
return __assign(__assign({}, state), { chatIsOpen: action.chatIsOpen });
|
18
|
+
default:
|
19
|
+
return state;
|
20
|
+
}
|
21
|
+
};
|
22
|
+
//# sourceMappingURL=appReducer.js.map
|
package/dist/reducers/index.js
CHANGED
@@ -1,16 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
var _appReducer = require("./appReducer");
|
7
|
-
Object.keys(_appReducer).forEach(function (key) {
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
9
|
-
if (key in exports && exports[key] === _appReducer[key]) return;
|
10
|
-
Object.defineProperty(exports, key, {
|
11
|
-
enumerable: true,
|
12
|
-
get: function get() {
|
13
|
-
return _appReducer[key];
|
14
|
-
}
|
15
|
-
});
|
16
|
-
});
|
1
|
+
// created from 'create-ts-index'
|
2
|
+
export * from './appReducer';
|
3
|
+
//# sourceMappingURL=index.js.map
|
package/dist/services/index.js
CHANGED
@@ -1,16 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
var _pluginApi = require("./plugin-api");
|
7
|
-
Object.keys(_pluginApi).forEach(function (key) {
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
9
|
-
if (key in exports && exports[key] === _pluginApi[key]) return;
|
10
|
-
Object.defineProperty(exports, key, {
|
11
|
-
enumerable: true,
|
12
|
-
get: function get() {
|
13
|
-
return _pluginApi[key];
|
14
|
-
}
|
15
|
-
});
|
16
|
-
});
|
1
|
+
// export * from './bibot'
|
2
|
+
export * from './plugin-api';
|
3
|
+
//# sourceMappingURL=index.js.map
|