bibot 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. package/.babelrc +7 -0
  2. package/.vscode/settings.json +5 -0
  3. package/README.md +46 -0
  4. package/dist/bibot.d.ts +5 -0
  5. package/dist/bibot.js +173 -0
  6. package/dist/bibot.js.map +1 -0
  7. package/dist/config/appStateEnums.d.ts +3 -0
  8. package/dist/config/appStateEnums.js +10 -0
  9. package/dist/config/appStateEnums.js.map +1 -0
  10. package/dist/config/endpointEnums.d.ts +18 -0
  11. package/dist/config/endpointEnums.js +31 -0
  12. package/dist/config/endpointEnums.js.map +1 -0
  13. package/dist/config/index.d.ts +3 -0
  14. package/dist/config/index.js +38 -0
  15. package/dist/config/index.js.map +1 -0
  16. package/dist/config/statusCode.d.ts +42 -0
  17. package/dist/config/statusCode.js +49 -0
  18. package/dist/config/statusCode.js.map +1 -0
  19. package/dist/context/AppContext.d.ts +8 -0
  20. package/dist/context/AppContext.js +75 -0
  21. package/dist/context/AppContext.js.map +1 -0
  22. package/dist/context/index.d.ts +1 -0
  23. package/dist/context/index.js +16 -0
  24. package/dist/context/index.js.map +1 -0
  25. package/dist/hooks/index.d.ts +3 -0
  26. package/dist/hooks/index.js +38 -0
  27. package/dist/hooks/index.js.map +1 -0
  28. package/dist/hooks/mobileView.d.ts +1 -0
  29. package/dist/hooks/mobileView.js +33 -0
  30. package/dist/hooks/mobileView.js.map +1 -0
  31. package/dist/hooks/useBiBotChatBot.d.ts +29 -0
  32. package/dist/hooks/useBiBotChatBot.js +206 -0
  33. package/dist/hooks/useBiBotChatBot.js.map +1 -0
  34. package/dist/hooks/usePluginFactory.d.ts +1 -0
  35. package/dist/hooks/usePluginFactory.js +62 -0
  36. package/dist/hooks/usePluginFactory.js.map +1 -0
  37. package/dist/index.css +36 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +9 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/reducers/appReducer.d.ts +2 -0
  42. package/dist/reducers/appReducer.js +24 -0
  43. package/dist/reducers/appReducer.js.map +1 -0
  44. package/dist/reducers/index.d.ts +1 -0
  45. package/dist/reducers/index.js +16 -0
  46. package/dist/reducers/index.js.map +1 -0
  47. package/dist/services/index.d.ts +1 -0
  48. package/dist/services/index.js +16 -0
  49. package/dist/services/index.js.map +1 -0
  50. package/dist/services/plugin-api.d.ts +26 -0
  51. package/dist/services/plugin-api.js +185 -0
  52. package/dist/services/plugin-api.js.map +1 -0
  53. package/dist/styles/RegisterPageStyle.css +63 -0
  54. package/dist/styles/adminPortal.css +26 -0
  55. package/dist/styles/appConfig.css +90 -0
  56. package/dist/styles/buttonStyle.css +27 -0
  57. package/dist/styles/chatStyle.css +140 -0
  58. package/dist/styles/index.css +82 -0
  59. package/dist/styles/predefinedStyle.css +35 -0
  60. package/dist/styles/themeStyle.css +42 -0
  61. package/dist/styles/training.css +86 -0
  62. package/dist/types/coreInterfaces.d.ts +51 -0
  63. package/dist/types/coreInterfaces.js +5 -0
  64. package/dist/types/coreInterfaces.js.map +1 -0
  65. package/dist/types/index.d.ts +1 -0
  66. package/dist/types/index.js +16 -0
  67. package/dist/types/index.js.map +1 -0
  68. package/dist/utils/index.d.ts +2 -0
  69. package/dist/utils/index.js +27 -0
  70. package/dist/utils/index.js.map +1 -0
  71. package/dist/utils/sessionManager.d.ts +2 -0
  72. package/dist/utils/sessionManager.js +17 -0
  73. package/dist/utils/sessionManager.js.map +1 -0
  74. package/dist/utils/trimWhitespace.d.ts +2 -0
  75. package/dist/utils/trimWhitespace.js +15 -0
  76. package/dist/utils/trimWhitespace.js.map +1 -0
  77. package/example/README.md +46 -0
  78. package/example/package-lock.json +18173 -0
  79. package/example/package.json +47 -0
  80. package/example/public/favicon.ico +0 -0
  81. package/example/public/index.html +43 -0
  82. package/example/public/logo192.png +0 -0
  83. package/example/public/logo512.png +0 -0
  84. package/example/public/manifest.json +25 -0
  85. package/example/public/robots.txt +3 -0
  86. package/example/src/App.css +38 -0
  87. package/example/src/App.test.tsx +9 -0
  88. package/example/src/App.tsx +28 -0
  89. package/example/src/index.css +13 -0
  90. package/example/src/index.tsx +13 -0
  91. package/example/src/logo.svg +1 -0
  92. package/example/src/react-app-env.d.ts +1 -0
  93. package/example/tsconfig.json +26 -0
  94. package/package.json +30 -8
  95. package/src/bibot.tsx +111 -0
  96. package/src/config/appStateEnums.ts +3 -0
  97. package/src/config/endpointEnums.ts +28 -0
  98. package/src/config/index.ts +5 -0
  99. package/src/config/statusCode.ts +49 -0
  100. package/src/context/AppContext.tsx +66 -0
  101. package/src/context/index.ts +3 -0
  102. package/src/hooks/index.ts +5 -0
  103. package/src/hooks/mobileView.tsx +17 -0
  104. package/src/hooks/useBiBotChatBot.tsx +107 -0
  105. package/src/hooks/usePluginFactory.tsx +38 -0
  106. package/src/index.css +36 -0
  107. package/src/index.tsx +3 -11
  108. package/src/reducers/appReducer.ts +16 -0
  109. package/src/reducers/index.ts +4 -0
  110. package/src/services/index.ts +2 -0
  111. package/src/services/plugin-api.tsx +120 -0
  112. package/src/styles/RegisterPageStyle.css +63 -0
  113. package/src/styles/adminPortal.css +26 -0
  114. package/src/styles/appConfig.css +90 -0
  115. package/src/styles/buttonStyle.css +27 -0
  116. package/src/styles/chatStyle.css +140 -0
  117. package/src/styles/index.css +82 -0
  118. package/src/styles/predefinedStyle.css +35 -0
  119. package/src/styles/themeStyle.css +42 -0
  120. package/src/styles/training.css +86 -0
  121. package/src/types/coreInterfaces.ts +69 -0
  122. package/src/types/index.ts +4 -0
  123. package/src/utils/index.ts +2 -0
  124. package/src/utils/sessionManager.tsx +15 -0
  125. package/src/utils/trimWhitespace.ts +11 -0
  126. package/tsconfig.json +25 -0
  127. package/webpack.config.js +19 -0
  128. package/src/App.tsx +0 -11
@@ -0,0 +1,42 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ .light {
6
+ /* Light mode colors */
7
+ --bg-color: #f0f0f0;
8
+ --text-color: #333;
9
+ --bg-light: #fff;
10
+ --text-light: #333;
11
+ --hover-bg-light: #000;
12
+ --hover-text-light: #fff;
13
+ --expanded-bg-light: #f5f5f5;
14
+ --sidebar-text-light: #333;
15
+ --sidebar-hover-bg-light: #000;
16
+ --sidebar-hover-text-light: #fff;
17
+ --sidebar-expanded-bg-light: #f5f5f5;
18
+ --border-color: blue;
19
+ --highlight-color: #ffcc00;
20
+ --bg-logo: url('/src/assets/logo/preauditai-high-resolution-logo-transparent.png')
21
+ }
22
+
23
+ .dark {
24
+ /* Dark mode colors */
25
+ --bg-color: #333;
26
+ --text-color: #f0f0f0;
27
+ --bg-dark: #333;
28
+ --text-dark: #fff;
29
+ --hover-bg-dark: #555;
30
+ --hover-text-dark: #fff;
31
+ --expanded-bg-dark: #444;
32
+ --sidebar-bg-dark: #333;
33
+ --sidebar-text-dark: #fff;
34
+ --sidebar-hover-bg-dark: #555;
35
+ --sidebar-hover-text-dark: #fff;
36
+ --sidebar-expanded-bg-dark: #444;
37
+ --border-color: blue;
38
+ --highlight-color: #007bff;
39
+ --bg-logo: url('/src/assets/logo/preauditai-high-resolution-logo-black-transparent.png')
40
+ }
41
+
42
+
@@ -0,0 +1,86 @@
1
+ .mainContainer{
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: flex-start;
5
+ }
6
+ .contentContainer{
7
+ width: 100%;
8
+ display: flex;
9
+ justify-content: space-between;
10
+ text-align: start;
11
+ flex-wrap: wrap;
12
+ }
13
+ .fileUploadSection{
14
+ width: 50%;
15
+ }
16
+ .fileInfoSection{
17
+ display: flex;
18
+ width: 40%;
19
+ }
20
+ .fileUploaderContainer{
21
+ border: 3px dotted #929292;
22
+ border-radius: 10px;
23
+ padding: 30px;
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ flex-direction: column;
28
+ width: 100%;
29
+ cursor: pointer;
30
+ }
31
+ .fileUploader{
32
+ width: 100%;
33
+ text-align: start;
34
+ }
35
+
36
+
37
+ /* Media query for screens smaller than 600px */
38
+ @media screen and (max-width: 600px) {
39
+ .fileUploaderContainer{
40
+ background-color: #f2f2f2;
41
+ padding: 30px;
42
+ display: flex;
43
+ align-items: center;
44
+ width: 100%;
45
+ }
46
+ .btn{
47
+ width: 100% !important;
48
+ margin-top: 30px;
49
+ }
50
+ .fileUploadSection{
51
+ width: 100%;
52
+ margin-bottom: 30px;
53
+ }
54
+ .fileInfoSection{
55
+ display: flex;
56
+ width: 100%;
57
+ }
58
+ }
59
+
60
+ /* Media query for screens between 600px and 900px */
61
+ @media screen and (min-width: 600px) and (max-width: 900px) {
62
+ .fileUploaderContainer{
63
+ background-color: #f2f2f2;
64
+ padding: 30px;
65
+ display: flex;
66
+ align-items: center;
67
+ width: 100%;
68
+ }
69
+ .btn{
70
+ width: 100% !important;
71
+ margin-top: 30px;
72
+ }
73
+ .fileUploadSection{
74
+ width: 100%;
75
+ margin-bottom: 30px;
76
+ }
77
+ .fileInfoSection{
78
+ display: flex;
79
+ width: 100%;
80
+ }
81
+ }
82
+
83
+ /* Media query for screens larger than 1200px */
84
+ @media screen and (min-width: 1200px) {
85
+
86
+ }
@@ -0,0 +1,51 @@
1
+ /// <reference types="react" />
2
+ import { type MenuTheme } from 'antd/es/menu';
3
+ import type { appStateEnums } from 'config';
4
+ interface AppStates {
5
+ hideImportantMessages?: boolean;
6
+ collapsed?: boolean;
7
+ chatIsOpen: boolean;
8
+ sessionId: string;
9
+ }
10
+ interface AppContextProps {
11
+ state: AppStates;
12
+ dispatch: React.Dispatch<any>;
13
+ }
14
+ interface AppAction {
15
+ type: appStateEnums;
16
+ theme: MenuTheme;
17
+ hideImportantMessages: boolean;
18
+ collapsed: boolean;
19
+ chatIsOpen: boolean;
20
+ }
21
+ type NotificationType = 'info' | 'warning' | 'success' | 'error';
22
+ interface NOTIFICATION_DT {
23
+ id: number;
24
+ message: string;
25
+ timestamp: number;
26
+ type: NotificationType;
27
+ }
28
+ interface Plan {
29
+ name: string;
30
+ price: string;
31
+ accounts: number | string;
32
+ complianceFrameworks: number | string;
33
+ features: string[];
34
+ }
35
+ interface SUBSCRIPTION {
36
+ tier: 'free' | 'basic' | 'advanced' | 'premium' | null;
37
+ status: 'active' | 'inactive' | null;
38
+ created: number | null;
39
+ next_billing_date?: number | null;
40
+ }
41
+ interface AppconfigType {
42
+ appTitle: string;
43
+ file_name: string | undefined;
44
+ windowColor: string;
45
+ }
46
+ interface docInfoType {
47
+ name: string;
48
+ size: number;
49
+ type: string;
50
+ }
51
+ export type { AppStates, AppAction, AppContextProps, NOTIFICATION_DT, NotificationType, Plan, SUBSCRIPTION, AppconfigType, docInfoType, };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coreInterfaces.js","sourceRoot":"","sources":["../../src/types/coreInterfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export * from './coreInterfaces';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _coreInterfaces = require("./coreInterfaces");
7
+ Object.keys(_coreInterfaces).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _coreInterfaces[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _coreInterfaces[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,iCAAiC;AAEjC,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './trimWhitespace';
2
+ export * from './sessionManager';
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _trimWhitespace = require("./trimWhitespace");
7
+ Object.keys(_trimWhitespace).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _trimWhitespace[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _trimWhitespace[key];
14
+ }
15
+ });
16
+ });
17
+ var _sessionManager = require("./sessionManager");
18
+ Object.keys(_sessionManager).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _sessionManager[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function get() {
24
+ return _sessionManager[key];
25
+ }
26
+ });
27
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,2 @@
1
+ declare const getSessionId: () => string;
2
+ export { getSessionId };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getSessionId = void 0;
7
+ var _uuid = require("uuid");
8
+ var SESSION_KEY = 'bibotUserSessionId';
9
+ var getSessionId = exports.getSessionId = function getSessionId() {
10
+ var sessionId = localStorage.getItem(SESSION_KEY);
11
+ if (sessionId === null) {
12
+ var newSessionId = (0, _uuid.v4)();
13
+ localStorage.setItem(SESSION_KEY, newSessionId);
14
+ return newSessionId;
15
+ }
16
+ return sessionId;
17
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionManager.js","sourceRoot":"","sources":["../../src/utils/sessionManager.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAA;AAEnC,IAAM,WAAW,GAAW,oBAAoB,CAAA;AAEhD,IAAM,YAAY,GAAG;IACnB,IAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IACnD,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;QACvB,IAAM,YAAY,GAAG,MAAM,EAAE,CAAA;QAC7B,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;QAC/C,OAAO,YAAY,CAAA;IACrB,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAED,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ declare const trimWhitespace: (e: any) => any;
2
+ export { trimWhitespace };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.trimWhitespace = void 0;
7
+ var trimWhitespace = exports.trimWhitespace = function trimWhitespace(e) {
8
+ // Check if the event has a target (it's an input event)
9
+ if (e !== null && e !== void 0 && e.target) {
10
+ // If it's a string, trim the whitespace; otherwise, return the value as is
11
+ return typeof e.target.value === 'string' ? e.target.value.trim() : e.target.value;
12
+ }
13
+ // If it's not an input event, return the value as is
14
+ return e;
15
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trimWhitespace.js","sourceRoot":"","sources":["../../src/utils/trimWhitespace.ts"],"names":[],"mappings":"AAAA,IAAM,cAAc,GAAG,UAAC,CAAM;IAC5B,wDAAwD;IACxD,IAAI,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,MAAM,EAAE,CAAC;QACd,2EAA2E;QAC3E,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAA;IACpF,CAAC;IACD,qDAAqD;IACrD,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AAED,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,46 @@
1
+ # Getting Started with Create React App
2
+
3
+ This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4
+
5
+ ## Available Scripts
6
+
7
+ In the project directory, you can run:
8
+
9
+ ### `npm start`
10
+
11
+ Runs the app in the development mode.\
12
+ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13
+
14
+ The page will reload if you make edits.\
15
+ You will also see any lint errors in the console.
16
+
17
+ ### `npm test`
18
+
19
+ Launches the test runner in the interactive watch mode.\
20
+ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21
+
22
+ ### `npm run build`
23
+
24
+ Builds the app for production to the `build` folder.\
25
+ It correctly bundles React in production mode and optimizes the build for the best performance.
26
+
27
+ The build is minified and the filenames include the hashes.\
28
+ Your app is ready to be deployed!
29
+
30
+ See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31
+
32
+ ### `npm run eject`
33
+
34
+ **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35
+
36
+ If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37
+
38
+ Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39
+
40
+ You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41
+
42
+ ## Learn More
43
+
44
+ You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45
+
46
+ To learn React, check out the [React documentation](https://reactjs.org/).