@deepfrog/pangents-widget 2.2.2 → 3.0.0

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.
Files changed (63) hide show
  1. package/README.md +29 -17
  2. package/dist/Widget.d.ts +4 -1
  3. package/dist/components/ChatbotWidget.d.ts +2 -0
  4. package/dist/components/CountryCodePicker.d.ts +9 -0
  5. package/dist/components/WidgetPopup.d.ts +2 -1
  6. package/dist/context/ChatContext.d.ts +5 -1
  7. package/dist/index.cjs.js +2 -2
  8. package/dist/index.cjs.js.map +1 -1
  9. package/dist/index.es.js +10 -16
  10. package/dist/index.es.js.map +1 -1
  11. package/dist/index.html +837 -0
  12. package/dist/pages/DataAgent/Components/AIAnswerRenderer.d.ts +6 -0
  13. package/dist/pages/DataAgent/Components/ChatHistory.d.ts +14 -0
  14. package/dist/pages/DataAgent/Components/ChatInput.d.ts +10 -0
  15. package/dist/pages/DataAgent/Components/DataAgentHeader.d.ts +8 -0
  16. package/dist/pages/DataAgent/Components/MessageBubble.d.ts +8 -0
  17. package/dist/pages/DataAgent/Components/WelcomeScreen.d.ts +6 -0
  18. package/dist/pages/DataAgent/Components/index.d.ts +5 -0
  19. package/dist/pages/DataAgent/index.d.ts +1 -0
  20. package/dist/pages/DataAgentV2/Components/AIAnswerRenderer.d.ts +6 -0
  21. package/dist/pages/DataAgentV2/Components/ChartRenderer.d.ts +10 -0
  22. package/dist/pages/DataAgentV2/Components/ChatHistory.d.ts +14 -0
  23. package/dist/pages/DataAgentV2/Components/ChatInput.d.ts +34 -0
  24. package/dist/pages/DataAgentV2/Components/DataAgentHeader.d.ts +9 -0
  25. package/dist/pages/DataAgentV2/Components/LoadingStepper.d.ts +5 -0
  26. package/dist/pages/DataAgentV2/Components/MessageBubble.d.ts +9 -0
  27. package/dist/pages/DataAgentV2/Components/WelcomeScreen.d.ts +6 -0
  28. package/dist/pages/DataAgentV2/Components/index.d.ts +5 -0
  29. package/dist/pages/DataAgentV2/index.d.ts +1 -0
  30. package/dist/pages/EmailLeads/LeadAction.d.ts +1 -0
  31. package/dist/pangents-widget.css +1 -1
  32. package/dist/preview-isolation.html +1 -0
  33. package/dist/preview-new.html +1 -0
  34. package/dist/preview-playground.html +792 -0
  35. package/dist/preview-production.html +293 -0
  36. package/dist/preview-staging.html +293 -0
  37. package/dist/preview.html +3 -4
  38. package/dist/services/api/client.d.ts +3 -0
  39. package/dist/services/api/dataAgentService.d.ts +38 -0
  40. package/dist/services/api/dataAgentServiceV2.d.ts +40 -0
  41. package/dist/services/api/emailLeadsService.d.ts +35 -0
  42. package/dist/services/mock/mockDataAgentService.d.ts +34 -0
  43. package/dist/services/mock/mockDataAgentServiceV2.d.ts +34 -0
  44. package/dist/stores/dataAgentStore.d.ts +37 -0
  45. package/dist/stores/dataAgentStoreV2.d.ts +40 -0
  46. package/dist/types/dataAgent.d.ts +37 -0
  47. package/dist/types/dataAgentV2.d.ts +97 -0
  48. package/dist/types/email.d.ts +28 -0
  49. package/dist/types/index.d.ts +0 -2
  50. package/dist/utils/countryCodes.d.ts +11 -0
  51. package/dist/widget-embed-CmAr6iD-.cjs.js +90 -0
  52. package/dist/widget-embed-CmAr6iD-.cjs.js.map +1 -0
  53. package/dist/widget-embed-DgNAEfZX.es.js +83784 -0
  54. package/dist/widget-embed-DgNAEfZX.es.js.map +1 -0
  55. package/dist/widget-embed.cjs.js +2 -2
  56. package/dist/widget-embed.d.ts +3 -0
  57. package/dist/widget-embed.es.js +2 -2
  58. package/dist/widget.js +76792 -23925
  59. package/package.json +5 -1
  60. package/dist/widget-embed-DCSN_j6Y.cjs.js +0 -46
  61. package/dist/widget-embed-DCSN_j6Y.cjs.js.map +0 -1
  62. package/dist/widget-embed-DzLM7DN8.es.js +0 -29838
  63. package/dist/widget-embed-DzLM7DN8.es.js.map +0 -1
@@ -0,0 +1,293 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>Pangent Widget Demo — Production</title>
7
+
8
+ <style>
9
+ :root {
10
+ --primary: #059669;
11
+ --secondary: #10b981;
12
+ --bg-light: #f0fdf4;
13
+ --bg-dark: #0f172a;
14
+ --text-dark: #0f172a;
15
+ --text-muted: #64748b;
16
+ --radius: 14px;
17
+ }
18
+
19
+ * {
20
+ margin: 0;
21
+ padding: 0;
22
+ box-sizing: border-box;
23
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
24
+ sans-serif;
25
+ }
26
+
27
+ body {
28
+ background: var(--bg-light);
29
+ color: var(--text-dark);
30
+ line-height: 1.6;
31
+ }
32
+
33
+ /* ---------- HERO ---------- */
34
+ .hero {
35
+ min-height: 100vh;
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: center;
39
+ text-align: center;
40
+ padding: 2rem;
41
+ background: linear-gradient(135deg, #059669, #10b981);
42
+ color: #fff;
43
+ }
44
+
45
+ .hero-inner {
46
+ max-width: 720px;
47
+ }
48
+
49
+ .hero h1 {
50
+ font-size: 3rem;
51
+ font-weight: 800;
52
+ margin-bottom: 1rem;
53
+ }
54
+
55
+ .hero p {
56
+ font-size: 1.2rem;
57
+ opacity: 0.95;
58
+ margin-bottom: 2rem;
59
+ }
60
+
61
+ .env-badge {
62
+ display: inline-block;
63
+ padding: 0.4rem 1rem;
64
+ background: rgba(0, 0, 0, 0.2);
65
+ border-radius: 999px;
66
+ font-size: 0.85rem;
67
+ font-weight: 600;
68
+ letter-spacing: 0.05em;
69
+ text-transform: uppercase;
70
+ margin-bottom: 1.5rem;
71
+ }
72
+
73
+ .hero-badge {
74
+ display: inline-block;
75
+ padding: 0.8rem 1.4rem;
76
+ background: rgba(255, 255, 255, 0.15);
77
+ border-radius: 999px;
78
+ font-weight: 500;
79
+ transition: transform 0.25s ease, background 0.25s ease;
80
+ }
81
+
82
+ .hero-badge:hover {
83
+ transform: scale(1.05);
84
+ background: rgba(255, 255, 255, 0.25);
85
+ cursor: pointer;
86
+ }
87
+
88
+ /* ---------- SECTION ---------- */
89
+ .section {
90
+ padding: 5rem 1.5rem;
91
+ }
92
+
93
+ .container {
94
+ max-width: 1100px;
95
+ margin: 0 auto;
96
+ }
97
+
98
+ .section-header {
99
+ text-align: center;
100
+ margin-bottom: 3rem;
101
+ }
102
+
103
+ .section-header h2 {
104
+ font-size: 2.2rem;
105
+ font-weight: 700;
106
+ margin-bottom: 0.8rem;
107
+ }
108
+
109
+ .section-header p {
110
+ color: var(--text-muted);
111
+ max-width: 600px;
112
+ margin: 0 auto;
113
+ }
114
+
115
+ /* ---------- INTEGRATION CARD ---------- */
116
+ .integration-card {
117
+ background: #fff;
118
+ border-radius: var(--radius);
119
+ padding: 2rem;
120
+ box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
121
+ max-width: 900px;
122
+ margin: 0 auto;
123
+ }
124
+
125
+ .steps {
126
+ margin-bottom: 1.5rem;
127
+ padding-left: 1.2rem;
128
+ }
129
+
130
+ .steps li {
131
+ margin-bottom: 0.6rem;
132
+ color: var(--text-dark);
133
+ }
134
+
135
+ .steps code {
136
+ background: #d1fae5;
137
+ padding: 0.15rem 0.4rem;
138
+ border-radius: 6px;
139
+ font-size: 0.9rem;
140
+ }
141
+
142
+ /* ---------- CODE BLOCK ---------- */
143
+ pre {
144
+ background: var(--bg-dark);
145
+ color: #e5e7eb;
146
+ padding: 1.5rem;
147
+ border-radius: 12px;
148
+ overflow-x: auto;
149
+ font-size: 0.9rem;
150
+ }
151
+
152
+ pre code {
153
+ color: #6ee7b7;
154
+ }
155
+
156
+ /* ---------- ENV INFO ---------- */
157
+ .env-info {
158
+ background: #f0fdf4;
159
+ border: 2px solid #10b981;
160
+ border-radius: var(--radius);
161
+ padding: 1.5rem 2rem;
162
+ max-width: 900px;
163
+ margin: 0 auto 2rem;
164
+ }
165
+
166
+ .env-info h3 {
167
+ font-size: 1rem;
168
+ font-weight: 700;
169
+ color: #065f46;
170
+ margin-bottom: 0.5rem;
171
+ }
172
+
173
+ .env-info p {
174
+ font-size: 0.9rem;
175
+ color: #064e3b;
176
+ }
177
+
178
+ .env-info code {
179
+ background: #a7f3d0;
180
+ padding: 0.15rem 0.4rem;
181
+ border-radius: 6px;
182
+ }
183
+
184
+ /* ---------- FOOTER ---------- */
185
+ footer {
186
+ background: #020617;
187
+ color: #94a3b8;
188
+ text-align: center;
189
+ padding: 1.5rem;
190
+ font-size: 0.9rem;
191
+ }
192
+
193
+ /* ---------- RESPONSIVE ---------- */
194
+ @media (max-width: 768px) {
195
+ .hero h1 {
196
+ font-size: 2.2rem;
197
+ }
198
+
199
+ .hero p {
200
+ font-size: 1rem;
201
+ }
202
+ }
203
+ </style>
204
+ </head>
205
+
206
+ <body>
207
+ <!-- HERO -->
208
+ <header class="hero">
209
+ <div class="hero-inner">
210
+ <div class="env-badge">✅ Production Environment</div>
211
+ <h1>Pangent Widget Demo</h1>
212
+ <p>
213
+ Production preview — connected to <strong>app.backend.pangents.ai</strong>.<br />
214
+ Click the chat bubble at the bottom-right corner to start.
215
+ </p>
216
+ <div class="hero-badge">
217
+ 🚀 Click the chat bubble for live demo
218
+ </div>
219
+ </div>
220
+ </header>
221
+
222
+ <!-- INTEGRATION -->
223
+ <section class="section">
224
+ <div class="container">
225
+ <div class="section-header">
226
+ <h2>Integration Steps</h2>
227
+ <p>
228
+ Add the Pangent chatbot to your website in less than a minute.
229
+ Use <code>environment: "production"</code> to point at the production backend.
230
+ </p>
231
+ </div>
232
+
233
+ <div class="env-info">
234
+ <h3>🌐 Production API Endpoint</h3>
235
+ <p>This preview uses <code>environment: "production"</code> which points to <code>https://app.backend.pangents.ai</code>.</p>
236
+ </div>
237
+
238
+ <div class="integration-card">
239
+ <ol class="steps">
240
+ <li>Paste the script just before the <code>&lt;/body&gt;</code> tag.</li>
241
+ <li>Replace the API key with your <strong>Pangent API Key</strong>.</li>
242
+ <li>Set <code>environment: "production"</code> to use the production backend.</li>
243
+ </ol>
244
+
245
+ <pre><code>&lt;script type="module"&gt;
246
+ import Chatbot from "https://chat-widget-gamma-azure.vercel.app/widget.js";
247
+
248
+ Chatbot.init({
249
+ pangentsApiKey: "&lt;api_key&gt;",
250
+ tenantId: "&lt;tenant_id&gt;",
251
+ environment: "production", // development | staging | production
252
+ theme: {
253
+ primaryColor: "#059669",
254
+ headerBg: "#059669",
255
+ headerText: "#ffffff",
256
+ headerTitle: "UltraShip TMS",
257
+ bubbleIcon: "&lt;logo_url&gt;",
258
+ },
259
+ position: "bottom-right",
260
+ margin: "20px",
261
+ });
262
+ &lt;/script&gt;</code></pre>
263
+ </div>
264
+ </div>
265
+ </section>
266
+
267
+ <!-- FOOTER -->
268
+ <footer>
269
+ © 2025 Pangent Demo Site — Production Environment
270
+ </footer>
271
+
272
+ <!-- CHATBOT -->
273
+ <script type="module">
274
+ import Chatbot from "https://chat-widget-gamma-azure.vercel.app/widget.js";
275
+
276
+ Chatbot.init({
277
+ pangentsApiKey: "Ph75vjKOsJbDuPyxR8-wW0_GYYm7ytVF0XQid2GXEZQ",
278
+ tenantId: "69386fa4a5248bcd50a4fdd2",
279
+ environment: "production",
280
+ theme: {
281
+ primaryColor: "#059669",
282
+ headerBg: "#059669",
283
+ headerText: "#ffffff",
284
+ bubbleIcon: "https://app.ultrashiptms.ai/icon.ico?25f91bedca5c761d",
285
+ },
286
+ position: "bottom-right",
287
+ margin: "20px",
288
+ paddingWidgetContainer: "10px 20px",
289
+ zIndex: 9999,
290
+ });
291
+ </script>
292
+ </body>
293
+ </html>
@@ -0,0 +1,293 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>Pangent Widget Demo — Staging</title>
7
+
8
+ <style>
9
+ :root {
10
+ --primary: #d97706;
11
+ --secondary: #f59e0b;
12
+ --bg-light: #fffbeb;
13
+ --bg-dark: #0f172a;
14
+ --text-dark: #0f172a;
15
+ --text-muted: #64748b;
16
+ --radius: 14px;
17
+ }
18
+
19
+ * {
20
+ margin: 0;
21
+ padding: 0;
22
+ box-sizing: border-box;
23
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
24
+ sans-serif;
25
+ }
26
+
27
+ body {
28
+ background: var(--bg-light);
29
+ color: var(--text-dark);
30
+ line-height: 1.6;
31
+ }
32
+
33
+ /* ---------- HERO ---------- */
34
+ .hero {
35
+ min-height: 100vh;
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: center;
39
+ text-align: center;
40
+ padding: 2rem;
41
+ background: linear-gradient(135deg, #d97706, #f59e0b);
42
+ color: #fff;
43
+ }
44
+
45
+ .hero-inner {
46
+ max-width: 720px;
47
+ }
48
+
49
+ .hero h1 {
50
+ font-size: 3rem;
51
+ font-weight: 800;
52
+ margin-bottom: 1rem;
53
+ }
54
+
55
+ .hero p {
56
+ font-size: 1.2rem;
57
+ opacity: 0.95;
58
+ margin-bottom: 2rem;
59
+ }
60
+
61
+ .env-badge {
62
+ display: inline-block;
63
+ padding: 0.4rem 1rem;
64
+ background: rgba(0, 0, 0, 0.2);
65
+ border-radius: 999px;
66
+ font-size: 0.85rem;
67
+ font-weight: 600;
68
+ letter-spacing: 0.05em;
69
+ text-transform: uppercase;
70
+ margin-bottom: 1.5rem;
71
+ }
72
+
73
+ .hero-badge {
74
+ display: inline-block;
75
+ padding: 0.8rem 1.4rem;
76
+ background: rgba(255, 255, 255, 0.15);
77
+ border-radius: 999px;
78
+ font-weight: 500;
79
+ transition: transform 0.25s ease, background 0.25s ease;
80
+ }
81
+
82
+ .hero-badge:hover {
83
+ transform: scale(1.05);
84
+ background: rgba(255, 255, 255, 0.25);
85
+ cursor: pointer;
86
+ }
87
+
88
+ /* ---------- SECTION ---------- */
89
+ .section {
90
+ padding: 5rem 1.5rem;
91
+ }
92
+
93
+ .container {
94
+ max-width: 1100px;
95
+ margin: 0 auto;
96
+ }
97
+
98
+ .section-header {
99
+ text-align: center;
100
+ margin-bottom: 3rem;
101
+ }
102
+
103
+ .section-header h2 {
104
+ font-size: 2.2rem;
105
+ font-weight: 700;
106
+ margin-bottom: 0.8rem;
107
+ }
108
+
109
+ .section-header p {
110
+ color: var(--text-muted);
111
+ max-width: 600px;
112
+ margin: 0 auto;
113
+ }
114
+
115
+ /* ---------- INTEGRATION CARD ---------- */
116
+ .integration-card {
117
+ background: #fff;
118
+ border-radius: var(--radius);
119
+ padding: 2rem;
120
+ box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
121
+ max-width: 900px;
122
+ margin: 0 auto;
123
+ }
124
+
125
+ .steps {
126
+ margin-bottom: 1.5rem;
127
+ padding-left: 1.2rem;
128
+ }
129
+
130
+ .steps li {
131
+ margin-bottom: 0.6rem;
132
+ color: var(--text-dark);
133
+ }
134
+
135
+ .steps code {
136
+ background: #fef3c7;
137
+ padding: 0.15rem 0.4rem;
138
+ border-radius: 6px;
139
+ font-size: 0.9rem;
140
+ }
141
+
142
+ /* ---------- CODE BLOCK ---------- */
143
+ pre {
144
+ background: var(--bg-dark);
145
+ color: #e5e7eb;
146
+ padding: 1.5rem;
147
+ border-radius: 12px;
148
+ overflow-x: auto;
149
+ font-size: 0.9rem;
150
+ }
151
+
152
+ pre code {
153
+ color: #fde68a;
154
+ }
155
+
156
+ /* ---------- ENV INFO ---------- */
157
+ .env-info {
158
+ background: #fffbeb;
159
+ border: 2px solid #f59e0b;
160
+ border-radius: var(--radius);
161
+ padding: 1.5rem 2rem;
162
+ max-width: 900px;
163
+ margin: 0 auto 2rem;
164
+ }
165
+
166
+ .env-info h3 {
167
+ font-size: 1rem;
168
+ font-weight: 700;
169
+ color: #92400e;
170
+ margin-bottom: 0.5rem;
171
+ }
172
+
173
+ .env-info p {
174
+ font-size: 0.9rem;
175
+ color: #78350f;
176
+ }
177
+
178
+ .env-info code {
179
+ background: #fde68a;
180
+ padding: 0.15rem 0.4rem;
181
+ border-radius: 6px;
182
+ }
183
+
184
+ /* ---------- FOOTER ---------- */
185
+ footer {
186
+ background: #020617;
187
+ color: #94a3b8;
188
+ text-align: center;
189
+ padding: 1.5rem;
190
+ font-size: 0.9rem;
191
+ }
192
+
193
+ /* ---------- RESPONSIVE ---------- */
194
+ @media (max-width: 768px) {
195
+ .hero h1 {
196
+ font-size: 2.2rem;
197
+ }
198
+
199
+ .hero p {
200
+ font-size: 1rem;
201
+ }
202
+ }
203
+ </style>
204
+ </head>
205
+
206
+ <body>
207
+ <!-- HERO -->
208
+ <header class="hero">
209
+ <div class="hero-inner">
210
+ <div class="env-badge">⚙️ Staging Environment</div>
211
+ <h1>Pangent Widget Demo</h1>
212
+ <p>
213
+ Staging preview — connected to <strong>stage.backend.pangents.ai</strong>.<br />
214
+ Click the chat bubble at the bottom-right corner to start.
215
+ </p>
216
+ <div class="hero-badge">
217
+ 🚀 Click the chat bubble for live demo
218
+ </div>
219
+ </div>
220
+ </header>
221
+
222
+ <!-- INTEGRATION -->
223
+ <section class="section">
224
+ <div class="container">
225
+ <div class="section-header">
226
+ <h2>Integration Steps</h2>
227
+ <p>
228
+ Add the Pangent chatbot to your website in less than a minute.
229
+ Use <code>environment: "staging"</code> to point at the staging backend.
230
+ </p>
231
+ </div>
232
+
233
+ <div class="env-info">
234
+ <h3>🌐 Staging API Endpoint</h3>
235
+ <p>This preview uses <code>environment: "staging"</code> which points to <code>https://stage.backend.pangents.ai</code>.</p>
236
+ </div>
237
+
238
+ <div class="integration-card">
239
+ <ol class="steps">
240
+ <li>Paste the script just before the <code>&lt;/body&gt;</code> tag.</li>
241
+ <li>Replace the API key with your <strong>Pangent API Key</strong>.</li>
242
+ <li>Set <code>environment: "staging"</code> to use the staging backend.</li>
243
+ </ol>
244
+
245
+ <pre><code>&lt;script type="module"&gt;
246
+ import Chatbot from "https://chat-widget-gamma-azure.vercel.app/widget.js";
247
+
248
+ Chatbot.init({
249
+ pangentsApiKey: "&lt;api_key&gt;",
250
+ tenantId: "&lt;tenant_id&gt;",
251
+ environment: "staging", // development | staging | production
252
+ theme: {
253
+ primaryColor: "#d97706",
254
+ headerBg: "#d97706",
255
+ headerText: "#ffffff",
256
+ headerTitle: "UltraShip TMS",
257
+ bubbleIcon: "&lt;logo_url&gt;",
258
+ },
259
+ position: "bottom-right",
260
+ margin: "20px",
261
+ });
262
+ &lt;/script&gt;</code></pre>
263
+ </div>
264
+ </div>
265
+ </section>
266
+
267
+ <!-- FOOTER -->
268
+ <footer>
269
+ © 2025 Pangent Demo Site — Staging Environment
270
+ </footer>
271
+
272
+ <!-- CHATBOT -->
273
+ <script type="module">
274
+ import Chatbot from "https://chat-widget-gamma-azure.vercel.app/widget.js";
275
+
276
+ Chatbot.init({
277
+ pangentsApiKey: "RFWpcu9pDINvWSBA1EbauIRk9yJWgFNXs73M66cbTJE",
278
+ tenantId: "698db7f2276355eee0a57646",
279
+ environment: "staging",
280
+ theme: {
281
+ primaryColor: "#d97706",
282
+ headerBg: "#d97706",
283
+ headerText: "#ffffff",
284
+ bubbleIcon: "https://app.ultrashiptms.ai/icon.ico?25f91bedca5c761d",
285
+ },
286
+ position: "bottom-right",
287
+ margin: "20px",
288
+ paddingWidgetContainer: "10px 20px",
289
+ zIndex: 9999,
290
+ });
291
+ </script>
292
+ </body>
293
+ </html>
package/dist/preview.html CHANGED
@@ -234,12 +234,11 @@ import Chatbot from "https://chat-widget-gamma-azure.vercel.app/widget.js";
234
234
  primaryColor: "#1e40af",
235
235
  headerBg: "#1e40af",
236
236
  headerText: "#ffffff",
237
- headerTitle: "UltraShip TMS",
238
- headerLogo: null,
239
237
  bubbleIcon: "https://app.ultrashiptms.ai/icon.ico?25f91bedca5c761d",
240
238
  },
241
- position: "bottom-left",
242
- margin: "20px",
239
+ position: "bottom-right",
240
+ margin: "20px", // Margin for the bubble button
241
+ paddingWidgetContainer: "10px 20px", // Margin for the popup container
243
242
  zIndex: 9999,
244
243
  });
245
244
  </script>
@@ -1,5 +1,8 @@
1
1
  import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
2
+ export type WidgetEnvironment = 'development' | 'staging' | 'production';
3
+ export declare function resolveBaseUrl(environment?: WidgetEnvironment): string;
2
4
  declare const apiClient: AxiosInstance;
5
+ export declare function setApiBaseUrl(environment?: WidgetEnvironment): void;
3
6
  export declare const api: {
4
7
  get: <T = any>(url: string, config?: AxiosRequestConfig) => Promise<AxiosResponse<T>>;
5
8
  post: <T = any>(url: string, data?: any, config?: AxiosRequestConfig) => Promise<AxiosResponse<T>>;
@@ -0,0 +1,38 @@
1
+ import type { DataAgentConversation } from '../../types/dataAgent';
2
+ export interface DataAgentQueryResponse {
3
+ success: boolean;
4
+ response: string;
5
+ conversationId: string;
6
+ messageId: string;
7
+ }
8
+ export interface DataAgentFeedbackResponse {
9
+ success: boolean;
10
+ message: string;
11
+ }
12
+ export declare class DataAgentService {
13
+ /**
14
+ * Get all conversation history
15
+ */
16
+ static getConversations(): Promise<DataAgentConversation[]>;
17
+ /**
18
+ * Get a specific conversation by ID
19
+ */
20
+ static getConversation(conversationId: string): Promise<DataAgentConversation | null>;
21
+ /**
22
+ * Send a query to the Data Agent
23
+ * Real API: POST /crm/agents/data/chat with { question: string }
24
+ * Response: { question: string, answer: string }
25
+ */
26
+ static sendQuery(query: string, conversationId?: string): Promise<DataAgentQueryResponse>;
27
+ /**
28
+ * Submit feedback for a message
29
+ */
30
+ static submitFeedback(messageId: string, feedback: 'positive' | 'negative'): Promise<DataAgentFeedbackResponse>;
31
+ /**
32
+ * Delete a conversation
33
+ */
34
+ static deleteConversation(conversationId: string): Promise<{
35
+ success: boolean;
36
+ }>;
37
+ }
38
+ export default DataAgentService;
@@ -0,0 +1,40 @@
1
+ import type { ApiChatSession, ApiChatTurn, ChatSessionV2, ChatMessageV2 } from '../../types/dataAgentV2';
2
+ export declare function transformApiSession(s: ApiChatSession): ChatSessionV2;
3
+ export declare function transformTurnToMessages(turn: ApiChatTurn): ChatMessageV2[];
4
+ export declare class DataAgentServiceV2 {
5
+ /**
6
+ * List chat sessions (offset-based pagination)
7
+ * GET /crm/agents/public/data/chat_sessions/
8
+ */
9
+ static getSessions(limit?: number, offset?: number): Promise<{
10
+ sessions: ChatSessionV2[];
11
+ raw: ApiChatSession[];
12
+ }>;
13
+ /**
14
+ * Fetch chat turns for a session (cursor-based pagination)
15
+ * GET /crm/agents/public/data/chat_sessions/{chat_session_id}/turns
16
+ */
17
+ static getTurns(chatSessionId: string, pageSize?: number, cursor?: string): Promise<{
18
+ messages: ChatMessageV2[];
19
+ nextCursor: string | null;
20
+ rawTurns: ApiChatTurn[];
21
+ }>;
22
+ /**
23
+ * Send a chat prompt (new or existing session)
24
+ * POST /crm/agents/public/data/chat/prompt
25
+ * Returns the full turn document
26
+ */
27
+ static sendPrompt(prompt: string, conversationId?: string, mock?: boolean): Promise<{
28
+ messages: ChatMessageV2[];
29
+ chatSessionId: string;
30
+ turnId: string;
31
+ rawTurn: ApiChatTurn;
32
+ }>;
33
+ /**
34
+ * Submit feedback for a turn (placeholder – adjust endpoint when available)
35
+ */
36
+ static submitFeedback(turnId: string, feedback: 'positive' | 'negative'): Promise<{
37
+ success: boolean;
38
+ }>;
39
+ }
40
+ export default DataAgentServiceV2;