@snf/access-qa-bot 2.7.3 → 3.0.1
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 +238 -291
- package/dist/access-qa-bot.js +16400 -2
- package/dist/access-qa-bot.js.map +1 -1
- package/dist/access-qa-bot.standalone.js +118 -36
- package/dist/access-qa-bot.standalone.js.map +1 -1
- package/dist/access-qa-bot.umd.cjs +217 -3
- package/dist/access-qa-bot.umd.cjs.map +1 -1
- package/dist/index.d.ts +85 -0
- package/dist/style.css +1 -0
- package/package.json +45 -76
- package/build/asset-manifest.json +0 -15
- package/build/favicon.ico +0 -0
- package/build/index.html +0 -1
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +0 -25
- package/build/robots.txt +0 -3
- package/build/static/css/main.css +0 -2
- package/build/static/css/main.css.map +0 -1
- package/build/static/js/453.chunk.js +0 -2
- package/build/static/js/453.chunk.js.map +0 -1
- package/build/static/js/main.js +0 -3
- package/build/static/js/main.js.LICENSE.txt +0 -67
- package/build/static/js/main.js.map +0 -1
- package/index.d.ts +0 -54
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# ACCESS Q&A Bot
|
|
2
2
|
|
|
3
|
-
A React
|
|
3
|
+
A React wrapper around [@snf/qa-bot-core](https://github.com/necyberteam/qa-bot-core) that adds ACCESS-specific functionality. This package serves two purposes:
|
|
4
|
+
|
|
5
|
+
1. **Production use**: The official Q&A bot for ACCESS websites
|
|
6
|
+
2. **Reference implementation**: An example of how to build organization-specific wrappers around qa-bot-core
|
|
4
7
|
|
|
5
8
|
## Installation
|
|
6
9
|
|
|
@@ -8,401 +11,345 @@ A React component for integrating the ACCESS Q&A Bot into your application. Feat
|
|
|
8
11
|
npm install @snf/access-qa-bot
|
|
9
12
|
```
|
|
10
13
|
|
|
11
|
-
## Developing React App
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install
|
|
15
|
-
npm run start
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Running the Demo
|
|
19
|
-
|
|
20
|
-
This will serve the index.html file in the root directory, which demonstrates different ways to integrate the bot.
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npm run build:lib
|
|
24
|
-
npm run build
|
|
25
|
-
npx serve
|
|
26
|
-
```
|
|
27
|
-
|
|
28
14
|
## Features
|
|
29
15
|
|
|
30
|
-
- **🤖 Intelligent Q&A**: AI-powered responses
|
|
16
|
+
- **🤖 Intelligent Q&A**: AI-powered responses about ACCESS resources and services
|
|
31
17
|
- **🎫 Support Tickets**: Create help tickets for general support, ACCESS login issues, and resource provider login problems
|
|
32
|
-
-
|
|
18
|
+
- **🔒 Security Reporting**: Report security incidents with priority levels and file attachments
|
|
19
|
+
- **📊 Metrics/XDMoD**: Query usage and performance data for ACCESS resources
|
|
20
|
+
- **📎 File Attachments**: Upload screenshots, logs, and documents with tickets
|
|
33
21
|
- **👤 User Pre-population**: Auto-fill forms with user info when logged in
|
|
34
|
-
- **🎨
|
|
22
|
+
- **🎨 Theming**: Customizable colors and branding via qa-bot-core
|
|
35
23
|
- **♿ Accessibility**: Full screen reader support and keyboard navigation
|
|
36
24
|
- **📱 Responsive**: Works on desktop and mobile devices
|
|
37
25
|
|
|
38
26
|
### Display Modes
|
|
39
27
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- **Floating Mode** (default): Shows a chat button that opens/closes a floating chat window
|
|
43
|
-
- **Embedded Mode**: Always visible, embedded directly in the page content
|
|
28
|
+
- **Floating Mode** (default): Chat button that opens/closes a floating window
|
|
29
|
+
- **Embedded Mode**: Always visible, embedded in page content
|
|
44
30
|
|
|
45
31
|
## Available Flows
|
|
46
32
|
|
|
47
|
-
The bot supports several conversation flows:
|
|
48
|
-
|
|
49
33
|
### 🤖 Q&A Flow
|
|
50
34
|
- Ask questions about ACCESS resources, services, and documentation
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
- Users can provide feedback or continue asking questions immediately
|
|
55
|
-
- Requires user to be logged in
|
|
35
|
+
- AI-powered responses with HTML and Markdown formatting
|
|
36
|
+
- Thumbs up/down feedback after each response
|
|
37
|
+
- Requires login (gated by default)
|
|
56
38
|
|
|
57
39
|
### 🎫 Support Ticket Flows
|
|
58
|
-
- **General Help**:
|
|
59
|
-
- **ACCESS Login**:
|
|
60
|
-
- **Resource Login**:
|
|
61
|
-
- All flows support file attachments and
|
|
62
|
-
|
|
63
|
-
### 📝 Feedback Flow
|
|
64
|
-
- Collect user feedback and suggestions
|
|
65
|
-
- Optional file attachments for screenshots or documents
|
|
40
|
+
- **General Help**: Any ACCESS-related issues
|
|
41
|
+
- **ACCESS Login**: Problems logging into access-ci.org
|
|
42
|
+
- **Resource Login**: Problems logging into resource providers (Anvil, Expanse, etc.)
|
|
43
|
+
- All flows support file attachments and integrate with JSM ProForma
|
|
66
44
|
|
|
67
45
|
### 🔒 Security Incident Flow
|
|
68
46
|
- Report security issues, vulnerabilities, and incidents
|
|
69
|
-
-
|
|
70
|
-
- Direct routing to ACCESS cybersecurity team
|
|
71
|
-
-
|
|
72
|
-
- Professional incident tracking with ticket reference links
|
|
73
|
-
- User contact information pre-population when logged in
|
|
47
|
+
- Priority levels: Critical, High, Medium, Low
|
|
48
|
+
- Direct routing to ACCESS cybersecurity team
|
|
49
|
+
- File attachments for evidence
|
|
74
50
|
|
|
75
|
-
|
|
51
|
+
### 📊 Metrics/XDMoD Flow
|
|
52
|
+
- Query usage and performance data
|
|
53
|
+
- Interactive Q&A loop with feedback buttons
|
|
76
54
|
|
|
77
|
-
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Integration Methods
|
|
78
58
|
|
|
79
59
|
### React Component
|
|
80
60
|
|
|
81
|
-
For React applications, import and use the component directly
|
|
82
|
-
- To control the chat programmatically, manage `open` and `isLoggedIn` state in your parent component.
|
|
83
|
-
- Use `onOpenChange` to keep your state in sync with user interactions.
|
|
84
|
-
- You can imperatively add a message to the bot using the `addMessage` function
|
|
61
|
+
For React applications, import and use the component directly:
|
|
85
62
|
|
|
86
|
-
```
|
|
63
|
+
```tsx
|
|
87
64
|
import React, { useRef, useState } from 'react';
|
|
88
|
-
import {
|
|
65
|
+
import { AccessQABot } from '@snf/access-qa-bot';
|
|
89
66
|
|
|
90
67
|
function MyApp() {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<button onClick={handleToggleLogin}>
|
|
120
|
-
Toggle Login State
|
|
121
|
-
</button>
|
|
122
|
-
|
|
123
|
-
<QABot
|
|
124
|
-
ref={botRef} // only needed if you want use the addMessage function
|
|
125
|
-
embedded={false}
|
|
126
|
-
isLoggedIn={isLoggedIn}
|
|
127
|
-
open={chatOpen}
|
|
128
|
-
onOpenChange={setChatOpen}
|
|
129
|
-
welcome="Welcome to the ACCESS Q&A Bot!"
|
|
130
|
-
apiKey={process.env.REACT_APP_API_KEY}
|
|
131
|
-
/>
|
|
132
|
-
</div>
|
|
133
|
-
);
|
|
68
|
+
const [isLoggedIn, setIsLoggedIn] = useState(false);
|
|
69
|
+
const [chatOpen, setChatOpen] = useState(false);
|
|
70
|
+
const botRef = useRef();
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<div className="app">
|
|
74
|
+
<h1>My Application</h1>
|
|
75
|
+
|
|
76
|
+
<button onClick={() => botRef.current?.addMessage("Hello!")}>
|
|
77
|
+
Send Message
|
|
78
|
+
</button>
|
|
79
|
+
|
|
80
|
+
<button onClick={() => setChatOpen(true)}>
|
|
81
|
+
Open Chat
|
|
82
|
+
</button>
|
|
83
|
+
|
|
84
|
+
<AccessQABot
|
|
85
|
+
ref={botRef}
|
|
86
|
+
isLoggedIn={isLoggedIn}
|
|
87
|
+
open={chatOpen}
|
|
88
|
+
onOpenChange={setChatOpen}
|
|
89
|
+
userEmail="user@example.com"
|
|
90
|
+
userName="Jane Doe"
|
|
91
|
+
accessId="jdoe"
|
|
92
|
+
apiKey={process.env.VITE_API_KEY}
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
);
|
|
134
96
|
}
|
|
135
97
|
```
|
|
136
98
|
|
|
137
|
-
#### React
|
|
99
|
+
#### React Props
|
|
138
100
|
|
|
139
101
|
| Property | Type | Default | Description |
|
|
140
102
|
|----------|------|---------|-------------|
|
|
103
|
+
| `isLoggedIn` | boolean | `false` | User login state (gates Q&A, shows login/user icon) |
|
|
141
104
|
| `apiKey` | string | `"demo-key"` | API key for authentication |
|
|
142
|
-
| `embedded` | boolean | `false` |
|
|
143
|
-
| `isLoggedIn` | boolean | `false` | User login state |
|
|
105
|
+
| `embedded` | boolean | `false` | Embedded or floating mode |
|
|
144
106
|
| `loginUrl` | string | `"/login"` | Login redirect URL |
|
|
145
|
-
| `open` | boolean | - |
|
|
146
|
-
| `onOpenChange` | function | - | Chat window state
|
|
147
|
-
| `
|
|
148
|
-
| `
|
|
149
|
-
| `
|
|
150
|
-
| `
|
|
151
|
-
|
|
107
|
+
| `open` | boolean | - | Control chat window (floating mode) |
|
|
108
|
+
| `onOpenChange` | function | - | Chat window state callback |
|
|
109
|
+
| `welcome` | string | - | Custom welcome message |
|
|
110
|
+
| `userEmail` | string | - | Pre-populate email in forms |
|
|
111
|
+
| `userName` | string | - | Pre-populate name in forms |
|
|
112
|
+
| `accessId` | string | - | Pre-populate ACCESS ID in forms |
|
|
113
|
+
|
|
114
|
+
#### Ref Methods
|
|
152
115
|
|
|
153
|
-
|
|
116
|
+
```tsx
|
|
117
|
+
const botRef = useRef<AccessQABotRef>(null);
|
|
154
118
|
|
|
155
|
-
|
|
119
|
+
// Add a message programmatically
|
|
120
|
+
botRef.current?.addMessage("Hello from code!");
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### Standalone JavaScript
|
|
126
|
+
|
|
127
|
+
For plain HTML/JS, use the self-contained standalone bundle:
|
|
156
128
|
|
|
157
129
|
```html
|
|
158
|
-
<script src="https://unpkg.com/@snf/access-qa-bot@
|
|
130
|
+
<script src="https://unpkg.com/@snf/access-qa-bot@3.0.0/dist/access-qa-bot.standalone.js"></script>
|
|
159
131
|
|
|
160
132
|
<div id="qa-bot"></div>
|
|
161
133
|
|
|
162
134
|
<script>
|
|
163
|
-
qaBot({
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
135
|
+
const bot = qaBot({
|
|
136
|
+
target: document.getElementById('qa-bot'),
|
|
137
|
+
isLoggedIn: false,
|
|
138
|
+
embedded: false,
|
|
139
|
+
welcome: "Welcome! How can I help you today?",
|
|
140
|
+
defaultOpen: false,
|
|
168
141
|
});
|
|
169
142
|
</script>
|
|
170
143
|
```
|
|
171
144
|
|
|
172
|
-
> **Note**: Early versions (v0.1.x) supported a "three files" CDN approach using `/build/` directory files. This approach is no longer supported as the build architecture changed from auto-executing scripts to library exports. Use the standalone bundle above instead.
|
|
173
|
-
|
|
174
145
|
#### Programmatic Control
|
|
175
146
|
|
|
176
|
-
|
|
147
|
+
The `qaBot()` function returns a controller object:
|
|
177
148
|
|
|
178
149
|
```javascript
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
welcome: "Custom welcome message!",
|
|
183
|
-
defaultOpen: false,
|
|
150
|
+
const bot = qaBot({
|
|
151
|
+
target: document.getElementById('qa-bot'),
|
|
152
|
+
isLoggedIn: false,
|
|
184
153
|
});
|
|
185
154
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
155
|
+
// Add messages
|
|
156
|
+
bot.addMessage("Hello World!");
|
|
157
|
+
|
|
158
|
+
// Update login state
|
|
159
|
+
bot.setBotIsLoggedIn(true);
|
|
160
|
+
|
|
161
|
+
// Control chat window (floating mode only)
|
|
162
|
+
bot.openChat();
|
|
163
|
+
bot.closeChat();
|
|
164
|
+
bot.toggleChat();
|
|
165
|
+
|
|
192
166
|
// Cleanup
|
|
193
|
-
|
|
167
|
+
bot.destroy();
|
|
194
168
|
```
|
|
195
169
|
|
|
196
|
-
####
|
|
170
|
+
#### Standalone Config
|
|
197
171
|
|
|
198
172
|
| Property | Type | Default | Description |
|
|
199
173
|
|----------|------|---------|-------------|
|
|
200
|
-
| `target` | HTMLElement |
|
|
174
|
+
| `target` | HTMLElement | **required** | DOM element to render into |
|
|
201
175
|
| `apiKey` | string | `"demo-key"` | API key for authentication |
|
|
202
176
|
| `defaultOpen` | boolean | `false` | Initial chat window state |
|
|
203
|
-
| `embedded` | boolean | `false` |
|
|
177
|
+
| `embedded` | boolean | `false` | Embedded or floating mode |
|
|
204
178
|
| `isLoggedIn` | boolean | `false` | User login state |
|
|
205
179
|
| `loginUrl` | string | `"/login"` | Login redirect URL |
|
|
206
|
-
| `ringEffect` | boolean | `false` | Phone ring animation on tooltip |
|
|
207
180
|
| `welcome` | string | - | Welcome message |
|
|
208
|
-
| `userEmail` | string | - |
|
|
209
|
-
| `userName` | string | - |
|
|
210
|
-
| `accessId` | string | - |
|
|
181
|
+
| `userEmail` | string | - | Pre-populate email |
|
|
182
|
+
| `userName` | string | - | Pre-populate name |
|
|
183
|
+
| `accessId` | string | - | Pre-populate ACCESS ID |
|
|
211
184
|
|
|
212
|
-
|
|
185
|
+
---
|
|
213
186
|
|
|
214
|
-
###
|
|
187
|
+
### CDN Usage
|
|
215
188
|
|
|
216
|
-
|
|
189
|
+
#### unpkg (npm-based)
|
|
217
190
|
|
|
218
191
|
```html
|
|
219
|
-
<
|
|
220
|
-
--primary-color: #007bff;
|
|
221
|
-
--secondary-color: #6c757d;
|
|
222
|
-
--font-family: 'Arial', sans-serif;
|
|
223
|
-
"></div>
|
|
192
|
+
<script src="https://unpkg.com/@snf/access-qa-bot@3.0.0/dist/access-qa-bot.standalone.js"></script>
|
|
224
193
|
```
|
|
225
194
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
### Environment Variables
|
|
195
|
+
#### jsdelivr (GitHub-based)
|
|
229
196
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
```bash
|
|
233
|
-
REACT_APP_API_KEY=your-api-key-here
|
|
197
|
+
```html
|
|
198
|
+
<script src="https://cdn.jsdelivr.net/gh/necyberteam/access-qa-bot@v3.0.0/dist/access-qa-bot.standalone.js"></script>
|
|
234
199
|
```
|
|
235
200
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
The bot integrates with the ACCESS Q&A API and JSM (Jira Service Management) for ticket creation. Configure your backend endpoints to handle:
|
|
239
|
-
|
|
240
|
-
- Q&A queries with JSON responses
|
|
241
|
-
- Support ticket creation with ProForma field mapping
|
|
242
|
-
- File upload processing
|
|
243
|
-
- User authentication and session management
|
|
201
|
+
---
|
|
244
202
|
|
|
245
|
-
##
|
|
203
|
+
## Building Your Own Wrapper
|
|
246
204
|
|
|
247
|
-
|
|
205
|
+
This repository demonstrates the **wrapper pattern** for extending qa-bot-core with organization-specific functionality. Use this as a reference for building your own wrapper.
|
|
248
206
|
|
|
249
|
-
|
|
207
|
+
### Architecture
|
|
250
208
|
|
|
251
|
-
```
|
|
252
|
-
|
|
209
|
+
```
|
|
210
|
+
YourWrapper (this pattern)
|
|
211
|
+
└── QABot (from @snf/qa-bot-core)
|
|
212
|
+
└── react-chatbotify
|
|
253
213
|
```
|
|
254
214
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
-
|
|
258
|
-
-
|
|
215
|
+
### What qa-bot-core Provides
|
|
216
|
+
|
|
217
|
+
- Chat UI (floating/embedded modes)
|
|
218
|
+
- Q&A flow with feedback
|
|
219
|
+
- Login state management
|
|
220
|
+
- Theming and branding props
|
|
221
|
+
- `customFlow` prop for extending functionality
|
|
222
|
+
|
|
223
|
+
### What Your Wrapper Adds
|
|
224
|
+
|
|
225
|
+
- Organization-specific flows (tickets, security, etc.)
|
|
226
|
+
- Integration with your backend services (JIRA, APIs)
|
|
227
|
+
- Custom form validation and state management
|
|
228
|
+
- Environment-specific configuration
|
|
229
|
+
|
|
230
|
+
### Key Files to Study
|
|
231
|
+
|
|
232
|
+
| File | Purpose |
|
|
233
|
+
|------|---------|
|
|
234
|
+
| `src/components/AccessQABot.tsx` | Main wrapper component - combines flows, passes props to core |
|
|
235
|
+
| `src/flows/*.ts` | Custom conversation flows using react-chatbotify format |
|
|
236
|
+
| `src/utils/flow-context.ts` | Form state management across flow steps |
|
|
237
|
+
| `src/utils/ticket-api.ts` | Backend integration (JIRA ticket submission) |
|
|
238
|
+
| `src/standalone.tsx` | Standalone JS API wrapper |
|
|
239
|
+
| `src/config/constants.ts` | Environment config and defaults |
|
|
240
|
+
|
|
241
|
+
### Creating Custom Flows
|
|
242
|
+
|
|
243
|
+
Flows use the [react-chatbotify](https://react-chatbotify.com/) format:
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
import { Flow } from 'react-chatbotify';
|
|
247
|
+
|
|
248
|
+
export function createMyFlow(): Flow {
|
|
249
|
+
return {
|
|
250
|
+
my_start: {
|
|
251
|
+
message: "Hello! What would you like to do?",
|
|
252
|
+
options: ["Option A", "Option B"],
|
|
253
|
+
path: (params) => {
|
|
254
|
+
if (params.userInput === "Option A") return "option_a_step";
|
|
255
|
+
return "option_b_step";
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
option_a_step: {
|
|
259
|
+
message: "You chose A!",
|
|
260
|
+
path: "end",
|
|
261
|
+
},
|
|
262
|
+
// ... more steps
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
```
|
|
259
266
|
|
|
260
|
-
###
|
|
267
|
+
### Combining Flows
|
|
261
268
|
|
|
262
|
-
|
|
269
|
+
In your wrapper component:
|
|
263
270
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
- `access-qa-bot.umd.cjs` (CommonJS)
|
|
267
|
-
- `access-qa-bot.standalone.js` (Self-contained for plain HTML)
|
|
271
|
+
```tsx
|
|
272
|
+
import { QABot, applyFlowSettings } from '@snf/qa-bot-core';
|
|
268
273
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
- Maintained for backward compatibility with existing integrations
|
|
274
|
+
const customFlow = useMemo(() => {
|
|
275
|
+
const flow1 = createMenuFlow();
|
|
276
|
+
const flow2 = createTicketFlow();
|
|
277
|
+
const flow3 = createMyCustomFlow();
|
|
274
278
|
|
|
275
|
-
|
|
279
|
+
const combined = { ...flow1, ...flow2, ...flow3 };
|
|
276
280
|
|
|
277
|
-
|
|
281
|
+
// Auto-set chatDisabled based on options/checkboxes
|
|
282
|
+
return applyFlowSettings(combined, { disableOnOptions: true });
|
|
283
|
+
}, [dependencies]);
|
|
278
284
|
|
|
279
|
-
|
|
285
|
+
return (
|
|
286
|
+
<QABot
|
|
287
|
+
isLoggedIn={isLoggedIn}
|
|
288
|
+
customFlow={customFlow}
|
|
289
|
+
// ... other props
|
|
290
|
+
/>
|
|
291
|
+
);
|
|
292
|
+
```
|
|
280
293
|
|
|
281
|
-
|
|
282
|
-
# 1. Update version to beta (without git operations)
|
|
283
|
-
npm version 2.2.0-beta.0 --no-git-tag-version
|
|
294
|
+
---
|
|
284
295
|
|
|
285
|
-
|
|
286
|
-
npm run build:lib
|
|
296
|
+
## Environment Variables
|
|
287
297
|
|
|
288
|
-
|
|
289
|
-
npm publish --tag beta
|
|
298
|
+
Create `.env.local` from `.env.example`:
|
|
290
299
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
300
|
+
```env
|
|
301
|
+
VITE_API_ENDPOINT=https://your-qa-api.com/api/
|
|
302
|
+
VITE_RATING_ENDPOINT=https://your-qa-api.com/rating/
|
|
303
|
+
VITE_NETLIFY_BASE_URL=https://your-ticket-api.netlify.app
|
|
304
|
+
VITE_METRICS_API_ENDPOINT=https://your-metrics-api.com/
|
|
305
|
+
VITE_API_KEY=your_api_key_here
|
|
306
|
+
```
|
|
294
307
|
|
|
295
|
-
|
|
296
|
-
- Fix focus persistence issues between questions
|
|
297
|
-
- Add consistent styling across all interactive elements
|
|
298
|
-
- Enhance screen reader support with ARIA attributes"
|
|
308
|
+
## Development
|
|
299
309
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
```
|
|
310
|
+
```bash
|
|
311
|
+
# Install dependencies
|
|
312
|
+
npm install
|
|
304
313
|
|
|
305
|
-
|
|
314
|
+
# Start dev server
|
|
315
|
+
npm run dev
|
|
306
316
|
|
|
307
|
-
|
|
317
|
+
# Build all outputs (ESM, UMD, standalone)
|
|
318
|
+
npm run build
|
|
308
319
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
npm install @snf/access-qa-bot@beta
|
|
320
|
+
# Build library only (ESM, UMD)
|
|
321
|
+
npm run build:lib
|
|
312
322
|
|
|
313
|
-
#
|
|
314
|
-
npm
|
|
323
|
+
# Type check
|
|
324
|
+
npm run type-check
|
|
315
325
|
```
|
|
316
326
|
|
|
317
|
-
|
|
327
|
+
## Build Outputs
|
|
318
328
|
|
|
319
|
-
|
|
329
|
+
| File | Format | Use Case |
|
|
330
|
+
|------|--------|----------|
|
|
331
|
+
| `dist/access-qa-bot.js` | ESM | npm import (React apps) |
|
|
332
|
+
| `dist/access-qa-bot.umd.cjs` | UMD | CommonJS require |
|
|
333
|
+
| `dist/access-qa-bot.standalone.js` | IIFE | CDN/script tag (bundles Preact) |
|
|
334
|
+
| `dist/style.css` | CSS | Styles (auto-imported by standalone) |
|
|
320
335
|
|
|
321
|
-
|
|
322
|
-
# Option A: Promote existing beta to latest
|
|
323
|
-
npm dist-tag add @snf/access-qa-bot@2.2.0-beta.0 latest
|
|
336
|
+
## Version History
|
|
324
337
|
|
|
325
|
-
|
|
326
|
-
npm version 2.2.0 --no-git-tag-version
|
|
327
|
-
npm run build:lib
|
|
328
|
-
npm publish
|
|
329
|
-
git add package.json
|
|
330
|
-
git commit -m "Release v2.2.0: Stable release with keyboard accessibility"
|
|
331
|
-
git tag v2.2.0
|
|
332
|
-
git push origin main --tags
|
|
333
|
-
```
|
|
338
|
+
This package continues the `@snf/access-qa-bot` npm package:
|
|
334
339
|
|
|
335
|
-
|
|
340
|
+
| Version | Repository | Notes |
|
|
341
|
+
|---------|------------|-------|
|
|
342
|
+
| v0.x - v2.x | [qa-bot](https://github.com/necyberteam/qa-bot) (deprecated) | Original implementation |
|
|
343
|
+
| v3.0.0+ | [access-qa-bot](https://github.com/necyberteam/access-qa-bot) (this repo) | Rewrite using qa-bot-core |
|
|
336
344
|
|
|
337
|
-
|
|
345
|
+
### What's New in v3.0.0
|
|
338
346
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
npm view @snf/access-qa-bot@beta
|
|
347
|
+
- **Architecture**: Now wraps @snf/qa-bot-core instead of embedding all logic
|
|
348
|
+
- **TypeScript**: Full TypeScript rewrite with type definitions
|
|
349
|
+
- **Build**: Vite-based build system (was Rollup + CRA)
|
|
350
|
+
- **Props**: `enabled` → `isLoggedIn` (breaking change)
|
|
351
|
+
- **Flows**: Same user-facing flows, cleaner implementation
|
|
345
352
|
|
|
346
|
-
|
|
347
|
-
npm install @snf/access-qa-bot@beta
|
|
348
|
-
```
|
|
353
|
+
## License
|
|
349
354
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
### Version 2.3.0
|
|
353
|
-
|
|
354
|
-
#### ✨ New Features
|
|
355
|
-
- **Security Incident Reporting**: Complete security incident reporting flow for cybersecurity team
|
|
356
|
-
- **Dedicated Security Routing**: Direct integration with ACCESS cybersecurity team (Service Desk ID: 3)
|
|
357
|
-
- **Professional Security Flow**: Priority levels, detailed incident tracking, and file attachments
|
|
358
|
-
- **Enhanced API Integration**: Expanded API endpoints for security incident submission
|
|
359
|
-
|
|
360
|
-
#### 🔧 Security & Infrastructure
|
|
361
|
-
- **Robust Error Handling**: Comprehensive null checks and error handling across all flows
|
|
362
|
-
- **Security Portal Integration**: Proper routing to dedicated security service desk
|
|
363
|
-
- **File Upload Support**: Attachment support for security evidence and documentation
|
|
364
|
-
|
|
365
|
-
### Version 2.2.0
|
|
366
|
-
|
|
367
|
-
#### ✨ New Features
|
|
368
|
-
- **Integrated Feedback System**: Added thumbs up/down feedback collection after each Q&A response
|
|
369
|
-
- **Seamless User Experience**: Users can provide feedback or continue asking questions without interruption
|
|
370
|
-
- **Smart Flow Routing**: Negative feedback automatically offers direct path to support ticket creation
|
|
371
|
-
- **Feedback Analytics**: Automatic tracking of user satisfaction with API endpoint integration
|
|
372
|
-
- **Responsive Design**: Optimized feedback UI with hover effects and accessibility features
|
|
373
|
-
|
|
374
|
-
#### 🎨 UI/UX Improvements
|
|
375
|
-
- Streamlined Q&A conversation flow with optional feedback prompts
|
|
376
|
-
- Enhanced button styling with smooth animations and brand color consistency
|
|
377
|
-
- Improved input field placeholder text for better user guidance
|
|
378
|
-
- Fixed horizontal scroll bar issues in user message bubbles
|
|
379
|
-
|
|
380
|
-
### Version 2.1.0
|
|
381
|
-
|
|
382
|
-
#### ✨ New Features
|
|
383
|
-
- **Form Context System**: Implemented React Context to solve closure issues and ensure fresh form state
|
|
384
|
-
- **User Info Pre-population**: Added support for pre-filling ticket forms with user email, name, and username when logged in
|
|
385
|
-
- **HTML & Markdown Rendering**: Added support for rich text formatting in Q&A responses
|
|
386
|
-
- **Enhanced Ticket Flows**: Improved all support ticket flows with better user experience
|
|
387
|
-
|
|
388
|
-
#### 🐛 Bug Fixes
|
|
389
|
-
- Fixed React closure issues causing stale form data in ticket summaries
|
|
390
|
-
- Resolved priority and ACCESS ID display issues in ticket forms
|
|
391
|
-
- Fixed form state management across all ticket flows
|
|
392
|
-
|
|
393
|
-
#### 🎨 UI/UX Improvements
|
|
394
|
-
- Updated button text: "Create XXX Ticket" → "Yes, let's create a ticket"
|
|
395
|
-
- Changed "New Chat" button to "Restart" for clarity
|
|
396
|
-
- Improved accessibility with better ARIA labels
|
|
397
|
-
- Enhanced responsive design for mobile devices
|
|
398
|
-
|
|
399
|
-
#### 🔧 Technical Improvements
|
|
400
|
-
- Removed unused helper functions (`getCurrentPriority`, `getCurrentAccessId`)
|
|
401
|
-
- Cleaned up debug console statements for production
|
|
402
|
-
- Added markdown renderer plugin alongside HTML renderer
|
|
403
|
-
- Improved build configuration and updated build directory handling
|
|
404
|
-
|
|
405
|
-
#### 📚 Documentation
|
|
406
|
-
- Updated README with comprehensive feature list and integration examples
|
|
407
|
-
- Added detailed API documentation and configuration options
|
|
408
|
-
- Included changelog for version tracking
|
|
355
|
+
MIT
|