@pixygon/chatbot-react 0.1.0 → 0.1.2

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 (2) hide show
  1. package/dist/index.d.ts +13 -3
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,12 @@
1
1
  import * as react from 'react';
2
- import { Api, BaseQueryFn, EndpointDefinitions } from '@reduxjs/toolkit/query';
3
2
 
3
+ /** RTK Query's `Api<...>` type carries `unique symbol` brand fields that
4
+ * make even `Api<any, any, any, any>` reject concrete host APIs. We accept
5
+ * `any` for `apiSlice` on the public surface and rely on the runtime
6
+ * injection inside `injectChatbotEndpoints` to do the wiring. The host's
7
+ * hooks (returned by `createChatbotComponents`) stay fully typed inside
8
+ * pages — only the input is loose. */
9
+ type AnyApi$1 = any;
4
10
  interface ChatbotBrand {
5
11
  /** Display name shown in the embed header, system prompt, etc. */
6
12
  name: string;
@@ -11,7 +17,7 @@ interface ChatbotBrand {
11
17
  }
12
18
  interface ChatbotComponentConfig {
13
19
  /** The host's RTK Query baseApi. Endpoints get injected onto it. */
14
- apiSlice: Api<BaseQueryFn, EndpointDefinitions, string, string>;
20
+ apiSlice: AnyApi$1;
15
21
  /** Path prefix the server router was mounted under. */
16
22
  pathPrefix: string;
17
23
  /** Hook the host implements to surface the active tenant id. */
@@ -32,6 +38,10 @@ interface TenantWithCap {
32
38
  chatCostCapUsdMonthly?: number | null;
33
39
  }
34
40
 
41
+ /** See `context.ts` — `apiSlice` is `any` on the public surface to dodge
42
+ * RTK Query's `unique symbol` brands. Internal logic still uses the host's
43
+ * baseApi at runtime; only the input type is loose. */
44
+ type AnyApi = any;
35
45
  interface KnowledgeDocument {
36
46
  _id: string;
37
47
  tenantId?: string;
@@ -166,7 +176,7 @@ interface SemanticCluster {
166
176
  * The host should add "Knowledge" + "ChatConversation" to baseApi's
167
177
  * tagTypes when constructing it.
168
178
  */
169
- declare function injectChatbotEndpoints(baseApi: Api<BaseQueryFn, EndpointDefinitions, string, string>, opts?: {
179
+ declare function injectChatbotEndpoints(baseApi: AnyApi, opts?: {
170
180
  pathPrefix: string;
171
181
  }): any;
172
182
  type ChatbotHooks = ReturnType<typeof injectChatbotEndpoints>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixygon/chatbot-react",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "React + MUI pages for the Pixygon chatbot: knowledge base admin, chat, analytics, embeddable widget.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",