ai-ebm-assistant-v4 0.0.2 → 0.0.3

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/README.md CHANGED
@@ -1 +1,141 @@
1
- # Feature Writer
1
+ # emb-ai
2
+
3
+ ## Project Description
4
+ This project appears to be a web application, likely built with Preact and Vite, featuring an AI Assistant component. It includes custom component generation templates using Plop.
5
+
6
+ ## Setup
7
+
8
+ ### Prerequisites
9
+ - Node.js (v14 or higher recommended)
10
+ - npm or yarn
11
+
12
+ ### Installation
13
+
14
+ 1. Clone the repository:
15
+ ```bash
16
+ git clone <repository_url>
17
+ cd emb-ai
18
+ ```
19
+ 2. Install dependencies:
20
+ ```bash
21
+ npm install
22
+ # or yarn install
23
+ ```
24
+
25
+ ## Available Scripts
26
+
27
+ In the project directory, you can run:
28
+
29
+ ### `npm run dev`
30
+ Runs the app in development mode.
31
+ Open [http://localhost:5173](http://localhost:5173) to view it in the browser.
32
+
33
+ The page will reload if you make edits.
34
+ You will also see any lint errors in the console.
35
+
36
+ ### `npm run build`
37
+ Builds the app for production to the `dist` folder.
38
+ It correctly bundles Preact in production mode and optimizes the build for the best performance.
39
+
40
+ The build is minified and the filenames include the hashes.
41
+ Your app is ready to be deployed!
42
+
43
+ ### `npm run preview`
44
+ Locally previews the production build.
45
+
46
+ ### `npm run generate`
47
+ Runs Plop to generate new components or atoms based on templates.
48
+
49
+ ## Technologies Used
50
+
51
+ - **Preact**: A fast 3.5kB alternative to React with the same ES6 API.
52
+ - **Vite**: A next-generation frontend tooling that provides an extremely fast development experience.
53
+ - **Axios**: Promise-based HTTP client for the browser and Node.js.
54
+ - **Plop**: A micro-generator framework that makes it easy to create new components, modules, or any other repetitive code.
55
+ - **Node.js**: JavaScript runtime environment.
56
+ - **npm / Yarn**: Package managers for JavaScript.
57
+
58
+ ## Publishing to NPM
59
+
60
+ This project's components are designed to be published as an NPM package. There are two primary ways to publish updates:
61
+
62
+ ### Manual Publishing
63
+
64
+ Follow these steps for a manual publishing process:
65
+
66
+ 1. **Build and Commit**: First, build the library and commit your changes.
67
+ ```bash
68
+ npm run build
69
+ git add .
70
+ git commit -m 'Your descriptive commit message'
71
+ ```
72
+ 2. **Update Version**: Increment the package version using one of the following commands:
73
+ - `npm version patch`: For bug fixes.
74
+ - `npm version minor`: For a new component addition.
75
+ - `npm version major`: For a completed feature.
76
+ 3. **NPM Login**: Log in to your NPM account (if not already logged in).
77
+ ```bash
78
+ npm login
79
+ ```
80
+ 4. **Publish**: Publish the package to NPM.
81
+ ```bash
82
+ npm publish --access public
83
+ ```
84
+ 5. **Verify**: Check the version update on the NPM website after publishing.
85
+
86
+ ### Automated Publishing with `publish.sh`
87
+
88
+ To automate the publishing process, you can use the provided `publish.sh` script. Follow these steps:
89
+
90
+ 1. **Set NPM Credentials (Securely!)**: Before running the script, ensure your NPM username, password, and email are set as environment variables. **DO NOT hardcode them in the script or commit them to version control.**
91
+ ```bash
92
+ export NPM_USERNAME="your_username"
93
+ export NPM_PASSWORD="your_password"
94
+ export NPM_EMAIL="your_email@example.com"
95
+ ```
96
+ 2. **Run the Publish Script**: Execute the `publish.sh` script. This will:
97
+ - Install npm dependencies.
98
+ - Stage and commit changes (with a default message).
99
+ - Automatically increment the package version (patch).
100
+ - Build the library.
101
+ - Log in to NPM using the provided environment variables.
102
+ - Publish the package to NPM with public access.
103
+ ```bash
104
+ ./publish.sh
105
+ ```
106
+ 3. **Verify**: Check the version update on the NPM website after publishing.
107
+
108
+ For more details on manual publishing, refer to the [NPM documentation](https://docs.npmjs.com/creating-and-publishing-scoped-public-packages).
109
+
110
+ ## API Structure
111
+
112
+ The project primarily uses `fetch` and `axios` for making API calls. A generic `AxiosCall` utility is available in `src/components/aiAssistant/components/logger/logger.jsx` which can be used for various HTTP methods.
113
+
114
+ - **Read Operations**:
115
+ - Examples like `https://arangodbservice.dev.ainqaplatform.in/api/read_qdmqueries` are used with `POST` requests to fetch data based on specific filters and `queryid`s.
116
+ - Data retrieval often involves passing a `db_name` and a `filter` object in the request body.
117
+
118
+ - **Create, Update, Delete Operations**:
119
+ - While a generic `AxiosCall` exists, explicit examples of dedicated `PUT`, `DELETE`, or `POST` for creation (beyond logging) were not found in the initial scan.
120
+ - It is assumed that new APIs for these operations would leverage the `AxiosCall` utility with appropriate HTTP methods (`POST` for create, `PUT` for update, `DELETE` for delete).
121
+
122
+ - **Pagination**:
123
+ - Current API calls do not explicitly include pagination parameters such as `offset`, `limit`, `page`, or `size`.
124
+ - **Recommendation**: For any API endpoints designed to retrieve a collection of resources ("get all" APIs), it is recommended to implement pagination. A suggested default structure would include `offset` (defaulting to 0) and `limit` (defaulting to 10) parameters to control the number of results returned and the starting point of the collection. The API should also return the `overall count` of items available.
125
+
126
+ ## Project Structure (Initial Observations)
127
+ - `src/`: Contains the main application source code.
128
+ - `app.jsx`: Serves as a playground for developing and testing components in isolation before they are packaged for NPM. It's where new components are integrated and demonstrated.
129
+ - `main.jsx`: Main application entry point for the development server.
130
+ - `components/`: Reusable UI components, intended to be part of the published NPM package.
131
+ - `aiAssistant/`: A significant part of the application, likely an AI-powered chat or assistant interface.
132
+ - `atoms/`: Potentially smaller, more granular components or state management entities.
133
+ - `assets/`: Static assets like images or SVGs.
134
+ - `store/`: Suggests state management (e.g., Zustand, Redux, Context API).
135
+ - `plop-templates/`: Templates for generating new code using Plop.
136
+ - `dist/`: Output directory for production builds.
137
+ - `vite.config.js`: Vite configuration file.
138
+ - `package.json`: Project dependencies and scripts.
139
+
140
+ ## Vite Library Mode
141
+ This project leverages Vite's library mode (`vite build --watch --mode library`) to build components into a shareable NPM package. This configuration optimizes the output for library consumption, making it easy to integrate these components into other projects. The `app.jsx` serves as a development playground to test these components during their creation.
@@ -1,4 +1,4 @@
1
- import { g as c, r as f } from "./index-9407a038.mjs";
1
+ import { g as c, r as f } from "./index-10c86437.mjs";
2
2
  function l(r, n) {
3
3
  for (var o = 0; o < n.length; o++) {
4
4
  const e = n[o];
@@ -22654,11 +22654,15 @@ function require_domCreate() {
22654
22654
  return n ? t.createElement(Be) : {};
22655
22655
  }, _domCreate;
22656
22656
  }
22657
- var _ie8DomDefine = !require_descriptors() && !_fails(function() {
22658
- return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
22659
- return 7;
22660
- } }).a != 7;
22661
- }), isObject$3 = _isObject, _toPrimitive = function(e, t) {
22657
+ var _ie8DomDefine, hasRequired_ie8DomDefine;
22658
+ function require_ie8DomDefine() {
22659
+ return hasRequired_ie8DomDefine || (hasRequired_ie8DomDefine = 1, _ie8DomDefine = !require_descriptors() && !_fails(function() {
22660
+ return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
22661
+ return 7;
22662
+ } }).a != 7;
22663
+ })), _ie8DomDefine;
22664
+ }
22665
+ var isObject$3 = _isObject, _toPrimitive = function(e, t) {
22662
22666
  if (!isObject$3(e))
22663
22667
  return e;
22664
22668
  var n, Be;
@@ -22670,7 +22674,7 @@ function require_objectDp() {
22670
22674
  if (hasRequired_objectDp)
22671
22675
  return _objectDp;
22672
22676
  hasRequired_objectDp = 1;
22673
- var e = _anObject, t = _ie8DomDefine, n = _toPrimitive, Be = Object.defineProperty;
22677
+ var e = _anObject, t = require_ie8DomDefine(), n = _toPrimitive, Be = Object.defineProperty;
22674
22678
  return _objectDp.f = require_descriptors() ? Object.defineProperty : function(Ee, Oe, Re) {
22675
22679
  if (e(Ee), Oe = n(Oe, !0), e(Re), t)
22676
22680
  try {
@@ -22781,12 +22785,14 @@ var _sharedExports = _shared.exports, id$1 = 0, px = Math.random(), _uid = funct
22781
22785
  for (; t.length > Be; )
22782
22786
  has$5(n, Ee = t[Be++]) && (~arrayIndexOf(Ce, Ee) || Ce.push(Ee));
22783
22787
  return Ce;
22784
- }, _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), $keys$1 = _objectKeysInternal, enumBugKeys$1 = _enumBugKeys, _objectKeys = Object.keys || function(t) {
22785
- return $keys$1(t, enumBugKeys$1);
22788
+ }, _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), $keys$2 = _objectKeysInternal, enumBugKeys$1 = _enumBugKeys, _objectKeys = Object.keys || function(t) {
22789
+ return $keys$2(t, enumBugKeys$1);
22786
22790
  }, _objectGops = {};
22787
22791
  _objectGops.f = Object.getOwnPropertySymbols;
22788
- var _objectPie = {};
22789
- _objectPie.f = {}.propertyIsEnumerable;
22792
+ var _objectPie = {}, hasRequired_objectPie;
22793
+ function require_objectPie() {
22794
+ return hasRequired_objectPie || (hasRequired_objectPie = 1, _objectPie.f = {}.propertyIsEnumerable), _objectPie;
22795
+ }
22790
22796
  var defined$1 = _defined, _toObject = function(e) {
22791
22797
  return Object(defined$1(e));
22792
22798
  }, _objectAssign, hasRequired_objectAssign;
@@ -22794,7 +22800,7 @@ function require_objectAssign() {
22794
22800
  if (hasRequired_objectAssign)
22795
22801
  return _objectAssign;
22796
22802
  hasRequired_objectAssign = 1;
22797
- var e = require_descriptors(), t = _objectKeys, n = _objectGops, Be = _objectPie, Ce = _toObject, Ee = require_iobject(), Oe = Object.assign;
22803
+ var e = require_descriptors(), t = _objectKeys, n = _objectGops, Be = require_objectPie(), Ce = _toObject, Ee = require_iobject(), Oe = Object.assign;
22798
22804
  return _objectAssign = !Oe || _fails(function() {
22799
22805
  var Re = {}, Te = {}, Ue = Symbol(), Qe = "abcdefghijklmnopqrst";
22800
22806
  return Re[Ue] = 7, Qe.split("").forEach(function(Me) {
@@ -23002,7 +23008,7 @@ var iterator$2 = _wksExt.f("iterator"), iterator$1 = { default: iterator$2, __es
23002
23008
  }, _metaExports = _meta.exports, core = _coreExports, wksExt$1 = _wksExt, defineProperty = require_objectDp().f, _wksDefine = function(e) {
23003
23009
  var t = core.Symbol || (core.Symbol = {});
23004
23010
  e.charAt(0) != "_" && !(e in t) && defineProperty(t, e, { value: wksExt$1.f(e) });
23005
- }, getKeys = _objectKeys, gOPS = _objectGops, pIE$1 = _objectPie, _enumKeys = function(e) {
23011
+ }, getKeys = _objectKeys, gOPS = _objectGops, pIE$1 = require_objectPie(), _enumKeys = function(e) {
23006
23012
  var t = getKeys(e), n = gOPS.f;
23007
23013
  if (n)
23008
23014
  for (var Be = n(e), Ce = pIE$1.f, Ee = 0, Oe; Be.length > Ee; )
@@ -23010,17 +23016,11 @@ var iterator$2 = _wksExt.f("iterator"), iterator$1 = { default: iterator$2, __es
23010
23016
  return t;
23011
23017
  }, cof = _cof, _isArray = Array.isArray || function(t) {
23012
23018
  return cof(t) == "Array";
23013
- }, _objectGopnExt = {}, _objectGopn = {}, hasRequired_objectGopn;
23014
- function require_objectGopn() {
23015
- if (hasRequired_objectGopn)
23016
- return _objectGopn;
23017
- hasRequired_objectGopn = 1;
23018
- var e = _objectKeysInternal, t = _enumBugKeys.concat("length", "prototype");
23019
- return _objectGopn.f = Object.getOwnPropertyNames || function(Be) {
23020
- return e(Be, t);
23021
- }, _objectGopn;
23022
- }
23023
- var toIObject$2 = _toIobject, gOPN$1 = require_objectGopn().f, toString$3 = {}.toString, windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [], getWindowNames = function(e) {
23019
+ }, _objectGopnExt = {}, _objectGopn = {}, $keys$1 = _objectKeysInternal, hiddenKeys = _enumBugKeys.concat("length", "prototype");
23020
+ _objectGopn.f = Object.getOwnPropertyNames || function(t) {
23021
+ return $keys$1(t, hiddenKeys);
23022
+ };
23023
+ var toIObject$2 = _toIobject, gOPN$1 = _objectGopn.f, toString$3 = {}.toString, windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [], getWindowNames = function(e) {
23024
23024
  try {
23025
23025
  return gOPN$1(e);
23026
23026
  } catch {
@@ -23030,7 +23030,7 @@ var toIObject$2 = _toIobject, gOPN$1 = require_objectGopn().f, toString$3 = {}.t
23030
23030
  _objectGopnExt.f = function(t) {
23031
23031
  return windowNames && toString$3.call(t) == "[object Window]" ? getWindowNames(t) : gOPN$1(toIObject$2(t));
23032
23032
  };
23033
- var _objectGopd = {}, pIE = _objectPie, createDesc$1 = _propertyDesc, toIObject$1 = _toIobject, toPrimitive$1 = _toPrimitive, has$1 = _has$1, IE8_DOM_DEFINE = _ie8DomDefine, gOPD$1 = Object.getOwnPropertyDescriptor;
23033
+ var _objectGopd = {}, pIE = require_objectPie(), createDesc$1 = _propertyDesc, toIObject$1 = _toIobject, toPrimitive$1 = _toPrimitive, has$1 = _has$1, IE8_DOM_DEFINE = require_ie8DomDefine(), gOPD$1 = Object.getOwnPropertyDescriptor;
23034
23034
  _objectGopd.f = require_descriptors() ? gOPD$1 : function(t, n) {
23035
23035
  if (t = toIObject$1(t), n = toPrimitive$1(n, !0), IE8_DOM_DEFINE)
23036
23036
  try {
@@ -23091,7 +23091,7 @@ USE_NATIVE || ($Symbol = function() {
23091
23091
  return DESCRIPTORS && setter && setSymbolDesc(ObjectProto, t, { configurable: !0, set: n }), wrap(t);
23092
23092
  }, redefine($Symbol[PROTOTYPE], "toString", function() {
23093
23093
  return this._k;
23094
- }), $GOPD.f = $getOwnPropertyDescriptor, $DP.f = $defineProperty, require_objectGopn().f = gOPNExt.f = $getOwnPropertyNames, _objectPie.f = $propertyIsEnumerable, $GOPS.f = $getOwnPropertySymbols, DESCRIPTORS && !_library && redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable), wksExt.f = function(e) {
23094
+ }), $GOPD.f = $getOwnPropertyDescriptor, $DP.f = $defineProperty, _objectGopn.f = gOPNExt.f = $getOwnPropertyNames, require_objectPie().f = $propertyIsEnumerable, $GOPS.f = $getOwnPropertySymbols, DESCRIPTORS && !_library && redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable), wksExt.f = function(e) {
23095
23095
  return wrap(wks(e));
23096
23096
  });
23097
23097
  $export$2($export$2.G + $export$2.W + $export$2.F * !USE_NATIVE, { Symbol: $Symbol });
@@ -58479,7 +58479,7 @@ function(e) {
58479
58479
  }, e.loadImageFile = e.loadFile;
58480
58480
  }(E.API), function(e) {
58481
58481
  function t() {
58482
- return (i.html2canvas ? Promise.resolve(i.html2canvas) : import("./html2canvas-b6751efe.mjs").then((Re) => Re.h)).catch(function(Re) {
58482
+ return (i.html2canvas ? Promise.resolve(i.html2canvas) : import("./html2canvas-b8e5c938.mjs").then((Re) => Re.h)).catch(function(Re) {
58483
58483
  return Promise.reject(new Error("Could not load html2canvas: " + Re));
58484
58484
  }).then(function(Re) {
58485
58485
  return Re.default ? Re.default : Re;
@@ -59224,7 +59224,7 @@ function(e) {
59224
59224
  var Ue = Te.getContext("2d");
59225
59225
  Ue.fillStyle = "#fff", Ue.fillRect(0, 0, Te.width, Te.height);
59226
59226
  var Qe = { ignoreMouse: !0, ignoreAnimation: !0, ignoreDimensions: !0 }, Me = this;
59227
- return (i.canvg ? Promise.resolve(i.canvg) : import("./index.es-77c72440.mjs")).catch(function(He) {
59227
+ return (i.canvg ? Promise.resolve(i.canvg) : import("./index.es-f252c33b.mjs")).catch(function(He) {
59228
59228
  return Promise.reject(new Error("Could not load canvg: " + He));
59229
59229
  }).then(function(He) {
59230
59230
  return He.default ? He.default : He;
@@ -1,4 +1,4 @@
1
- import { _ as Ha, c as Qe, g as Lo } from "./index-9407a038.mjs";
1
+ import { _ as Ha, c as Qe, g as Lo } from "./index-10c86437.mjs";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "react-dom";
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { E as i } from "./index-9407a038.mjs";
1
+ import { E as i } from "./index-10c86437.mjs";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "react-dom";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ai-ebm-assistant-v4",
3
3
  "private": false,
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "module": "./dist/index.mjs",
6
6
  "exports": {
7
7
  ".": {
@@ -39,7 +39,7 @@
39
39
  "react-icons": "^4.7.1",
40
40
  "react-lottie": "^1.2.10"
41
41
  },
42
- "peerDependencies":{
42
+ "peerDependencies": {
43
43
  "react": "^18.2.0",
44
44
  "react-dom": "^18.2.0"
45
45
  },