@inkeep/agents-ui-cloud 0.15.14 → 0.15.16
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/dist/components/hooks/use-base-settings.cjs +1 -1
- package/dist/components/hooks/use-base-settings.js +22 -19
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.js +17 -15
- package/dist/components/types.cjs +1 -0
- package/dist/components/types.js +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +59 -31
- package/dist/index.d.ts +59 -31
- package/dist/index.js +17 -15
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.js +4 -0
- package/package.json +21 -17
- package/dist/components/api/analytics/events.cjs +0 -1
- package/dist/components/api/analytics/events.js +0 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@inkeep/agents-ui"),l=require("../default-settings.cjs"),g=require("./use-user-properties.cjs"),S=require("../utils/transform-source/index.cjs"),d=i=>{const s=o.mergeProps(l.defaultInkeepBaseSettings,i??{}),a=g.useUserProperties(s),{analyticsApiBaseUrl:m,transformSource:u}=s,c={userProperties:a,async onEvent(e){["modal_opened","modal_closed"].includes(e.eventName)},transformSource(e,t,r){const n=u?.(e,t,r);return S.transformInkeepSource?.(n??e,t,r)??n}};return o.mergeProps(s,c)};exports.useBaseSettings=d;
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { mergeProps as
|
|
3
|
-
import { defaultInkeepBaseSettings as
|
|
4
|
-
import { useUserProperties as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import { mergeProps as n } from "@inkeep/agents-ui";
|
|
3
|
+
import { defaultInkeepBaseSettings as c } from "../default-settings.js";
|
|
4
|
+
import { useUserProperties as p } from "./use-user-properties.js";
|
|
5
|
+
import { transformInkeepSource as u } from "../utils/transform-source/index.js";
|
|
6
|
+
const k = (i) => {
|
|
7
|
+
const s = n(
|
|
8
|
+
c,
|
|
9
|
+
i ?? {}
|
|
10
|
+
), a = p(s), {
|
|
11
|
+
analyticsApiBaseUrl: f,
|
|
12
|
+
// privacyPreferences,
|
|
13
|
+
// env,
|
|
14
|
+
transformSource: m
|
|
15
|
+
} = s;
|
|
16
|
+
return n(
|
|
17
|
+
s,
|
|
14
18
|
{
|
|
15
|
-
userProperties:
|
|
19
|
+
userProperties: a,
|
|
16
20
|
async onEvent(e) {
|
|
17
|
-
|
|
18
|
-
t && !s && g({ ...e, userProperties: o }, "", c ?? "");
|
|
21
|
+
["modal_opened", "modal_closed"].includes(e.eventName);
|
|
19
22
|
},
|
|
20
23
|
// we don't have this endpoint in the new api yet so we shouldn't show the feedback buttons
|
|
21
24
|
// async onFeedback(feedback) {
|
|
@@ -30,13 +33,13 @@ const y = (a) => {
|
|
|
30
33
|
// properties: feedback.properties,
|
|
31
34
|
// })
|
|
32
35
|
// },
|
|
33
|
-
transformSource(e, t,
|
|
34
|
-
const
|
|
35
|
-
return
|
|
36
|
+
transformSource(e, t, r) {
|
|
37
|
+
const o = m?.(e, t, r);
|
|
38
|
+
return u?.(o ?? e, t, r) ?? o;
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
);
|
|
39
42
|
};
|
|
40
43
|
export {
|
|
41
|
-
|
|
44
|
+
k as useBaseSettings
|
|
42
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./embedded-chat.cjs"),d=require("./sidebar-chat.cjs"),n=require("./embedded-search-and-chat.cjs"),r=require("./embedded-search.cjs"),o=require("./modal.chat.cjs"),c=require("./modal.search-and-chat.cjs"),h=require("./modal.search.cjs"),e=require("./modal.cjs"),s=require("./chat-button.cjs"),p=require("./chat-button-modal.cjs"),u=require("./searchbar.cjs"),t=require("./utils.cjs"),I=require("./types.cjs");exports.InkeepEmbeddedChat=a.InkeepEmbeddedChat;exports.InkeepSidebarChat=d.InkeepSidebarChat;exports.InkeepEmbeddedSearchAndChat=n.InkeepEmbeddedSearchAndChat;exports.InkeepEmbeddedSearch=r.InkeepEmbeddedSearch;exports.InkeepModalChat=o.InkeepModalChat;exports.InkeepModalSearchAndChat=c.InkeepModalSearchAndChat;exports.InkeepModalSearch=h.InkeepModalSearch;exports.InkeepModal=e.InkeepModal;exports.ModalContent=e.ModalContent;exports.InkeepChatButton=s.InkeepChatButton;exports.InkeepChatButtonModal=p.InkeepChatButtonModal;exports.InkeepSearchBar=u.InkeepSearchBar;exports.composeEventHandlers=t.composeEventHandlers;exports.composeRefs=t.composeRefs;exports.GitHubIssueState=I.GitHubIssueState;
|
package/dist/components/index.js
CHANGED
|
@@ -2,27 +2,29 @@ import { InkeepEmbeddedChat as r } from "./embedded-chat.js";
|
|
|
2
2
|
import { InkeepSidebarChat as p } from "./sidebar-chat.js";
|
|
3
3
|
import { InkeepEmbeddedSearchAndChat as d } from "./embedded-search-and-chat.js";
|
|
4
4
|
import { InkeepEmbeddedSearch as m } from "./embedded-search.js";
|
|
5
|
-
import { InkeepModalChat as
|
|
6
|
-
import { InkeepModalSearchAndChat as
|
|
5
|
+
import { InkeepModalChat as x } from "./modal.chat.js";
|
|
6
|
+
import { InkeepModalSearchAndChat as I } from "./modal.search-and-chat.js";
|
|
7
7
|
import { InkeepModalSearch as C } from "./modal.search.js";
|
|
8
|
-
import { InkeepModal as l, ModalContent as
|
|
9
|
-
import { InkeepChatButton as
|
|
10
|
-
import { InkeepChatButtonModal as
|
|
11
|
-
import { InkeepSearchBar as
|
|
12
|
-
import { composeEventHandlers as
|
|
8
|
+
import { InkeepModal as l, ModalContent as S } from "./modal.js";
|
|
9
|
+
import { InkeepChatButton as M } from "./chat-button.js";
|
|
10
|
+
import { InkeepChatButtonModal as u } from "./chat-button-modal.js";
|
|
11
|
+
import { InkeepSearchBar as B } from "./searchbar.js";
|
|
12
|
+
import { composeEventHandlers as A, composeRefs as H } from "./utils.js";
|
|
13
|
+
import { GitHubIssueState as G } from "./types.js";
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
G as GitHubIssueState,
|
|
16
|
+
M as InkeepChatButton,
|
|
17
|
+
u as InkeepChatButtonModal,
|
|
16
18
|
r as InkeepEmbeddedChat,
|
|
17
19
|
m as InkeepEmbeddedSearch,
|
|
18
20
|
d as InkeepEmbeddedSearchAndChat,
|
|
19
21
|
l as InkeepModal,
|
|
20
|
-
|
|
22
|
+
x as InkeepModalChat,
|
|
21
23
|
C as InkeepModalSearch,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
I as InkeepModalSearchAndChat,
|
|
25
|
+
B as InkeepSearchBar,
|
|
24
26
|
p as InkeepSidebarChat,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
S as ModalContent,
|
|
28
|
+
A as composeEventHandlers,
|
|
29
|
+
H as composeRefs
|
|
28
30
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t=(e=>(e.Closed="CLOSED",e.Open="OPEN",e))(t||{});exports.GitHubIssueState=t;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./components/embedded-chat.cjs"),d=require("./components/sidebar-chat.cjs"),n=require("./components/embedded-search-and-chat.cjs"),r=require("./components/embedded-search.cjs"),o=require("./components/modal.chat.cjs"),c=require("./components/modal.search-and-chat.cjs"),h=require("./components/modal.search.cjs"),e=require("./components/modal.cjs"),s=require("./components/chat-button.cjs"),p=require("./components/chat-button-modal.cjs"),u=require("./components/searchbar.cjs"),t=require("./components/utils.cjs"),I=require("./components/types.cjs");exports.InkeepEmbeddedChat=a.InkeepEmbeddedChat;exports.InkeepSidebarChat=d.InkeepSidebarChat;exports.InkeepEmbeddedSearchAndChat=n.InkeepEmbeddedSearchAndChat;exports.InkeepEmbeddedSearch=r.InkeepEmbeddedSearch;exports.InkeepModalChat=o.InkeepModalChat;exports.InkeepModalSearchAndChat=c.InkeepModalSearchAndChat;exports.InkeepModalSearch=h.InkeepModalSearch;exports.InkeepModal=e.InkeepModal;exports.ModalContent=e.ModalContent;exports.InkeepChatButton=s.InkeepChatButton;exports.InkeepChatButtonModal=p.InkeepChatButtonModal;exports.InkeepSearchBar=u.InkeepSearchBar;exports.composeEventHandlers=t.composeEventHandlers;exports.composeRefs=t.composeRefs;exports.GitHubIssueState=I.GitHubIssueState;
|
package/dist/index.d.cts
CHANGED
|
@@ -2,9 +2,11 @@ import { InkeepAIChatSettings } from '@inkeep/agents-ui/types';
|
|
|
2
2
|
import { InkeepBaseSettings } from '@inkeep/agents-ui/types';
|
|
3
3
|
import { InkeepChatButtonModalProps as InkeepChatButtonModalProps_2 } from '@inkeep/agents-ui';
|
|
4
4
|
import { InkeepChatButtonProps as InkeepChatButtonProps_2 } from '@inkeep/agents-ui';
|
|
5
|
+
import { InkeepComponentInstance } from '@inkeep/agents-ui/types';
|
|
5
6
|
import { InkeepEmbeddedChatProps as InkeepEmbeddedChatProps_2 } from '@inkeep/agents-ui';
|
|
6
7
|
import { InkeepEmbeddedSearchAndChatProps as InkeepEmbeddedSearchAndChatProps_2 } from '@inkeep/agents-ui';
|
|
7
8
|
import { InkeepEmbeddedSearchProps as InkeepEmbeddedSearchProps_2 } from '@inkeep/agents-ui';
|
|
9
|
+
import { InkeepJSComponent } from '@inkeep/agents-ui/types';
|
|
8
10
|
import { InkeepModalSearchAndChatProps as InkeepModalSearchAndChatProps_2 } from '@inkeep/agents-ui';
|
|
9
11
|
import { InkeepSearchBarProps as InkeepSearchBarProps_2 } from '@inkeep/agents-ui';
|
|
10
12
|
import { InkeepSearchSettings } from '@inkeep/agents-ui/types';
|
|
@@ -22,7 +24,7 @@ export declare function composeEventHandlers<E>(originalEventHandler?: (event: E
|
|
|
22
24
|
|
|
23
25
|
export declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) => void;
|
|
24
26
|
|
|
25
|
-
declare enum GitHubIssueState {
|
|
27
|
+
export declare enum GitHubIssueState {
|
|
26
28
|
Closed = "CLOSED",
|
|
27
29
|
Open = "OPEN"
|
|
28
30
|
}
|
|
@@ -32,20 +34,20 @@ export declare function InkeepChatButton(props: InkeepChatButtonProps): JSX.Elem
|
|
|
32
34
|
export declare function InkeepChatButtonModal(props: InkeepChatButtonModalProps): JSX.Element;
|
|
33
35
|
|
|
34
36
|
export declare interface InkeepChatButtonModalProps extends InkeepChatButtonModalProps_2 {
|
|
35
|
-
baseSettings: InkeepChatButtonModalProps_2['baseSettings'] &
|
|
36
|
-
aiChatSettings: InkeepChatButtonModalProps_2['aiChatSettings'] &
|
|
37
|
-
searchSettings: InkeepChatButtonModalProps_2['searchSettings'] &
|
|
37
|
+
baseSettings: InkeepChatButtonModalProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
38
|
+
aiChatSettings: InkeepChatButtonModalProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
39
|
+
searchSettings: InkeepChatButtonModalProps_2['searchSettings'] & InkeepCloudSearchSettings;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
export declare interface InkeepChatButtonProps extends InkeepChatButtonProps_2 {
|
|
41
|
-
baseSettings: InkeepChatButtonProps_2['baseSettings'] &
|
|
42
|
-
aiChatSettings: InkeepChatButtonProps_2['aiChatSettings'] &
|
|
43
|
+
baseSettings: InkeepChatButtonProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
44
|
+
aiChatSettings: InkeepChatButtonProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
declare interface
|
|
47
|
+
export declare interface InkeepCloudAIChatSettings extends InkeepAIChatSettings {
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
declare interface
|
|
50
|
+
export declare interface InkeepCloudBaseSettings extends InkeepBaseSettings {
|
|
49
51
|
/**
|
|
50
52
|
* Custom base URL for analytics API endpoints.
|
|
51
53
|
* Useful when routing analytics requests through a proxy.
|
|
@@ -60,7 +62,24 @@ declare interface InkeepClosedBaseSettings extends InkeepBaseSettings {
|
|
|
60
62
|
env?: 'development' | 'production';
|
|
61
63
|
}
|
|
62
64
|
|
|
63
|
-
declare
|
|
65
|
+
export declare type InkeepCloudComponentInitializer = {
|
|
66
|
+
(props: InkeepCloudComponentProps): InkeepComponentInstance | undefined;
|
|
67
|
+
(targetSelector: string, props: InkeepCloudComponentProps): InkeepComponentInstance | undefined;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export declare type InkeepCloudComponentProps = InkeepCloudSettings & {
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export declare interface InkeepCloudConfig {
|
|
75
|
+
baseSettings: InkeepCloudBaseSettings;
|
|
76
|
+
aiChatSettings: InkeepCloudAIChatSettings;
|
|
77
|
+
searchSettings: InkeepCloudSearchSettings;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export declare type InkeepCloudJS = Partial<Record<InkeepJSComponent, InkeepCloudComponentInitializer>>;
|
|
81
|
+
|
|
82
|
+
export declare interface InkeepCloudSearchSettings extends InkeepSearchSettings {
|
|
64
83
|
/**
|
|
65
84
|
* The API key to use for authenticating with Inkeep's services.
|
|
66
85
|
* Required for accessing Inkeep's API endpoints.
|
|
@@ -85,7 +104,6 @@ declare interface InkeepClosedSearchSettings extends InkeepSearchSettings {
|
|
|
85
104
|
/**
|
|
86
105
|
* Advanced search callback function that handles search with full filter support.
|
|
87
106
|
* This callback handles the complete search implementation with SearchInput.
|
|
88
|
-
* This is used internally by the closed implementation.
|
|
89
107
|
*
|
|
90
108
|
* @param searchInput - The search input containing query and filters
|
|
91
109
|
* @param abortSignal - Signal to abort the search request
|
|
@@ -94,11 +112,18 @@ declare interface InkeepClosedSearchSettings extends InkeepSearchSettings {
|
|
|
94
112
|
onSearchWithFilters?: (searchInput: SearchInput, abortSignal: AbortSignal) => Promise<SearchHit[]>;
|
|
95
113
|
}
|
|
96
114
|
|
|
115
|
+
export declare interface InkeepCloudSettings {
|
|
116
|
+
baseSettings?: InkeepCloudBaseSettings;
|
|
117
|
+
aiChatSettings?: InkeepCloudAIChatSettings;
|
|
118
|
+
searchSettings?: InkeepCloudSearchSettings;
|
|
119
|
+
openSettings?: OpenSettingsModal;
|
|
120
|
+
}
|
|
121
|
+
|
|
97
122
|
export declare function InkeepEmbeddedChat(props: InkeepEmbeddedChatProps): JSX.Element;
|
|
98
123
|
|
|
99
124
|
export declare interface InkeepEmbeddedChatProps extends InkeepEmbeddedChatProps_2 {
|
|
100
|
-
baseSettings: InkeepEmbeddedChatProps_2['baseSettings'] &
|
|
101
|
-
aiChatSettings: InkeepEmbeddedChatProps_2['aiChatSettings'] &
|
|
125
|
+
baseSettings: InkeepEmbeddedChatProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
126
|
+
aiChatSettings: InkeepEmbeddedChatProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
102
127
|
}
|
|
103
128
|
|
|
104
129
|
export declare function InkeepEmbeddedSearch(props: InkeepEmbeddedSearchProps): JSX.Element;
|
|
@@ -106,14 +131,14 @@ export declare function InkeepEmbeddedSearch(props: InkeepEmbeddedSearchProps):
|
|
|
106
131
|
export declare function InkeepEmbeddedSearchAndChat(props: InkeepEmbeddedSearchAndChatProps): JSX.Element;
|
|
107
132
|
|
|
108
133
|
export declare interface InkeepEmbeddedSearchAndChatProps extends InkeepEmbeddedSearchAndChatProps_2 {
|
|
109
|
-
baseSettings: InkeepEmbeddedSearchAndChatProps_2['baseSettings'] &
|
|
110
|
-
aiChatSettings: InkeepEmbeddedSearchAndChatProps_2['aiChatSettings'] &
|
|
111
|
-
searchSettings: InkeepEmbeddedSearchAndChatProps_2['searchSettings'] &
|
|
134
|
+
baseSettings: InkeepEmbeddedSearchAndChatProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
135
|
+
aiChatSettings: InkeepEmbeddedSearchAndChatProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
136
|
+
searchSettings: InkeepEmbeddedSearchAndChatProps_2['searchSettings'] & InkeepCloudSearchSettings;
|
|
112
137
|
}
|
|
113
138
|
|
|
114
139
|
export declare interface InkeepEmbeddedSearchProps extends InkeepEmbeddedSearchProps_2 {
|
|
115
|
-
baseSettings: InkeepEmbeddedSearchProps_2['baseSettings'] &
|
|
116
|
-
searchSettings: InkeepEmbeddedSearchProps_2['searchSettings'] &
|
|
140
|
+
baseSettings: InkeepEmbeddedSearchProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
141
|
+
searchSettings: InkeepEmbeddedSearchProps_2['searchSettings'] & InkeepCloudSearchSettings;
|
|
117
142
|
}
|
|
118
143
|
|
|
119
144
|
export declare function InkeepModal(props: InkeepModalProps): JSX.Element;
|
|
@@ -140,9 +165,9 @@ export declare function InkeepModalSearch(props: InkeepModalSearchProps): JSX.El
|
|
|
140
165
|
export declare function InkeepModalSearchAndChat(props: InkeepModalSearchAndChatProps): JSX.Element;
|
|
141
166
|
|
|
142
167
|
export declare interface InkeepModalSearchAndChatProps extends InkeepModalSearchAndChatProps_2 {
|
|
143
|
-
baseSettings: InkeepModalSearchAndChatProps_2['baseSettings'] &
|
|
144
|
-
aiChatSettings: InkeepModalSearchAndChatProps_2['aiChatSettings'] &
|
|
145
|
-
searchSettings: InkeepModalSearchAndChatProps_2['searchSettings'] &
|
|
168
|
+
baseSettings: InkeepModalSearchAndChatProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
169
|
+
aiChatSettings: InkeepModalSearchAndChatProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
170
|
+
searchSettings: InkeepModalSearchAndChatProps_2['searchSettings'] & InkeepCloudSearchSettings;
|
|
146
171
|
}
|
|
147
172
|
|
|
148
173
|
export declare interface InkeepModalSearchProps extends Omit<InkeepEmbeddedSearchProps_2, 'onToggleView'> {
|
|
@@ -152,19 +177,19 @@ export declare interface InkeepModalSearchProps extends Omit<InkeepEmbeddedSearc
|
|
|
152
177
|
export declare function InkeepSearchBar(props: InkeepSearchBarProps): JSX.Element;
|
|
153
178
|
|
|
154
179
|
export declare interface InkeepSearchBarProps extends InkeepSearchBarProps_2 {
|
|
155
|
-
baseSettings: InkeepSearchBarProps_2['baseSettings'] &
|
|
156
|
-
aiChatSettings: InkeepSearchBarProps_2['aiChatSettings'] &
|
|
157
|
-
searchSettings: InkeepSearchBarProps_2['searchSettings'] &
|
|
180
|
+
baseSettings: InkeepSearchBarProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
181
|
+
aiChatSettings: InkeepSearchBarProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
182
|
+
searchSettings: InkeepSearchBarProps_2['searchSettings'] & InkeepCloudSearchSettings;
|
|
158
183
|
}
|
|
159
184
|
|
|
160
185
|
export declare function InkeepSidebarChat(props: InkeepSidebarChatProps): JSX.Element;
|
|
161
186
|
|
|
162
187
|
export declare interface InkeepSidebarChatProps extends InkeepSidebarChatProps_2 {
|
|
163
|
-
baseSettings: InkeepSidebarChatProps_2['baseSettings'] &
|
|
164
|
-
aiChatSettings: InkeepSidebarChatProps_2['aiChatSettings'] &
|
|
188
|
+
baseSettings: InkeepSidebarChatProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
189
|
+
aiChatSettings: InkeepSidebarChatProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
165
190
|
}
|
|
166
191
|
|
|
167
|
-
declare type InputMaybe<T> = T | null;
|
|
192
|
+
export declare type InputMaybe<T> = T | null;
|
|
168
193
|
|
|
169
194
|
declare interface ModalConfig extends RootConfig {
|
|
170
195
|
/**
|
|
@@ -181,11 +206,11 @@ declare type RecordTypes = 'DocumentationRecord' | 'GitHubIssueRecord' | 'StackO
|
|
|
181
206
|
|
|
182
207
|
declare type RootConfig = RootProviderProps['config'];
|
|
183
208
|
|
|
184
|
-
declare type SearchFiltersInput = {
|
|
209
|
+
export declare type SearchFiltersInput = {
|
|
185
210
|
limit: number;
|
|
186
211
|
};
|
|
187
212
|
|
|
188
|
-
declare interface SearchHit {
|
|
213
|
+
export declare interface SearchHit {
|
|
189
214
|
hitOnRoot: boolean;
|
|
190
215
|
id: string;
|
|
191
216
|
rootRecord: SearchRootRecord;
|
|
@@ -202,12 +227,12 @@ declare interface SearchHit {
|
|
|
202
227
|
};
|
|
203
228
|
}
|
|
204
229
|
|
|
205
|
-
declare type SearchInput = {
|
|
230
|
+
export declare type SearchInput = {
|
|
206
231
|
filters?: InputMaybe<SearchFiltersInput>;
|
|
207
232
|
searchQuery: string;
|
|
208
233
|
};
|
|
209
234
|
|
|
210
|
-
declare interface SearchRootRecord {
|
|
235
|
+
export declare interface SearchRootRecord {
|
|
211
236
|
__typename: RecordTypes;
|
|
212
237
|
id: string;
|
|
213
238
|
title?: string;
|
|
@@ -225,11 +250,14 @@ declare interface SearchRootRecord {
|
|
|
225
250
|
};
|
|
226
251
|
}
|
|
227
252
|
|
|
228
|
-
declare interface TopLevelHeading {
|
|
253
|
+
export declare interface TopLevelHeading {
|
|
229
254
|
anchor?: string | null;
|
|
230
255
|
url?: string | null;
|
|
231
256
|
content: string;
|
|
232
257
|
isMatch?: boolean;
|
|
233
258
|
}
|
|
234
259
|
|
|
260
|
+
|
|
261
|
+
export * from "@inkeep/agents-ui/types";
|
|
262
|
+
|
|
235
263
|
export { }
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ import { InkeepAIChatSettings } from '@inkeep/agents-ui/types';
|
|
|
2
2
|
import { InkeepBaseSettings } from '@inkeep/agents-ui/types';
|
|
3
3
|
import { InkeepChatButtonModalProps as InkeepChatButtonModalProps_2 } from '@inkeep/agents-ui';
|
|
4
4
|
import { InkeepChatButtonProps as InkeepChatButtonProps_2 } from '@inkeep/agents-ui';
|
|
5
|
+
import { InkeepComponentInstance } from '@inkeep/agents-ui/types';
|
|
5
6
|
import { InkeepEmbeddedChatProps as InkeepEmbeddedChatProps_2 } from '@inkeep/agents-ui';
|
|
6
7
|
import { InkeepEmbeddedSearchAndChatProps as InkeepEmbeddedSearchAndChatProps_2 } from '@inkeep/agents-ui';
|
|
7
8
|
import { InkeepEmbeddedSearchProps as InkeepEmbeddedSearchProps_2 } from '@inkeep/agents-ui';
|
|
9
|
+
import { InkeepJSComponent } from '@inkeep/agents-ui/types';
|
|
8
10
|
import { InkeepModalSearchAndChatProps as InkeepModalSearchAndChatProps_2 } from '@inkeep/agents-ui';
|
|
9
11
|
import { InkeepSearchBarProps as InkeepSearchBarProps_2 } from '@inkeep/agents-ui';
|
|
10
12
|
import { InkeepSearchSettings } from '@inkeep/agents-ui/types';
|
|
@@ -22,7 +24,7 @@ export declare function composeEventHandlers<E>(originalEventHandler?: (event: E
|
|
|
22
24
|
|
|
23
25
|
export declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) => void;
|
|
24
26
|
|
|
25
|
-
declare enum GitHubIssueState {
|
|
27
|
+
export declare enum GitHubIssueState {
|
|
26
28
|
Closed = "CLOSED",
|
|
27
29
|
Open = "OPEN"
|
|
28
30
|
}
|
|
@@ -32,20 +34,20 @@ export declare function InkeepChatButton(props: InkeepChatButtonProps): JSX.Elem
|
|
|
32
34
|
export declare function InkeepChatButtonModal(props: InkeepChatButtonModalProps): JSX.Element;
|
|
33
35
|
|
|
34
36
|
export declare interface InkeepChatButtonModalProps extends InkeepChatButtonModalProps_2 {
|
|
35
|
-
baseSettings: InkeepChatButtonModalProps_2['baseSettings'] &
|
|
36
|
-
aiChatSettings: InkeepChatButtonModalProps_2['aiChatSettings'] &
|
|
37
|
-
searchSettings: InkeepChatButtonModalProps_2['searchSettings'] &
|
|
37
|
+
baseSettings: InkeepChatButtonModalProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
38
|
+
aiChatSettings: InkeepChatButtonModalProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
39
|
+
searchSettings: InkeepChatButtonModalProps_2['searchSettings'] & InkeepCloudSearchSettings;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
export declare interface InkeepChatButtonProps extends InkeepChatButtonProps_2 {
|
|
41
|
-
baseSettings: InkeepChatButtonProps_2['baseSettings'] &
|
|
42
|
-
aiChatSettings: InkeepChatButtonProps_2['aiChatSettings'] &
|
|
43
|
+
baseSettings: InkeepChatButtonProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
44
|
+
aiChatSettings: InkeepChatButtonProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
declare interface
|
|
47
|
+
export declare interface InkeepCloudAIChatSettings extends InkeepAIChatSettings {
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
declare interface
|
|
50
|
+
export declare interface InkeepCloudBaseSettings extends InkeepBaseSettings {
|
|
49
51
|
/**
|
|
50
52
|
* Custom base URL for analytics API endpoints.
|
|
51
53
|
* Useful when routing analytics requests through a proxy.
|
|
@@ -60,7 +62,24 @@ declare interface InkeepClosedBaseSettings extends InkeepBaseSettings {
|
|
|
60
62
|
env?: 'development' | 'production';
|
|
61
63
|
}
|
|
62
64
|
|
|
63
|
-
declare
|
|
65
|
+
export declare type InkeepCloudComponentInitializer = {
|
|
66
|
+
(props: InkeepCloudComponentProps): InkeepComponentInstance | undefined;
|
|
67
|
+
(targetSelector: string, props: InkeepCloudComponentProps): InkeepComponentInstance | undefined;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export declare type InkeepCloudComponentProps = InkeepCloudSettings & {
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export declare interface InkeepCloudConfig {
|
|
75
|
+
baseSettings: InkeepCloudBaseSettings;
|
|
76
|
+
aiChatSettings: InkeepCloudAIChatSettings;
|
|
77
|
+
searchSettings: InkeepCloudSearchSettings;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export declare type InkeepCloudJS = Partial<Record<InkeepJSComponent, InkeepCloudComponentInitializer>>;
|
|
81
|
+
|
|
82
|
+
export declare interface InkeepCloudSearchSettings extends InkeepSearchSettings {
|
|
64
83
|
/**
|
|
65
84
|
* The API key to use for authenticating with Inkeep's services.
|
|
66
85
|
* Required for accessing Inkeep's API endpoints.
|
|
@@ -85,7 +104,6 @@ declare interface InkeepClosedSearchSettings extends InkeepSearchSettings {
|
|
|
85
104
|
/**
|
|
86
105
|
* Advanced search callback function that handles search with full filter support.
|
|
87
106
|
* This callback handles the complete search implementation with SearchInput.
|
|
88
|
-
* This is used internally by the closed implementation.
|
|
89
107
|
*
|
|
90
108
|
* @param searchInput - The search input containing query and filters
|
|
91
109
|
* @param abortSignal - Signal to abort the search request
|
|
@@ -94,11 +112,18 @@ declare interface InkeepClosedSearchSettings extends InkeepSearchSettings {
|
|
|
94
112
|
onSearchWithFilters?: (searchInput: SearchInput, abortSignal: AbortSignal) => Promise<SearchHit[]>;
|
|
95
113
|
}
|
|
96
114
|
|
|
115
|
+
export declare interface InkeepCloudSettings {
|
|
116
|
+
baseSettings?: InkeepCloudBaseSettings;
|
|
117
|
+
aiChatSettings?: InkeepCloudAIChatSettings;
|
|
118
|
+
searchSettings?: InkeepCloudSearchSettings;
|
|
119
|
+
openSettings?: OpenSettingsModal;
|
|
120
|
+
}
|
|
121
|
+
|
|
97
122
|
export declare function InkeepEmbeddedChat(props: InkeepEmbeddedChatProps): JSX.Element;
|
|
98
123
|
|
|
99
124
|
export declare interface InkeepEmbeddedChatProps extends InkeepEmbeddedChatProps_2 {
|
|
100
|
-
baseSettings: InkeepEmbeddedChatProps_2['baseSettings'] &
|
|
101
|
-
aiChatSettings: InkeepEmbeddedChatProps_2['aiChatSettings'] &
|
|
125
|
+
baseSettings: InkeepEmbeddedChatProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
126
|
+
aiChatSettings: InkeepEmbeddedChatProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
102
127
|
}
|
|
103
128
|
|
|
104
129
|
export declare function InkeepEmbeddedSearch(props: InkeepEmbeddedSearchProps): JSX.Element;
|
|
@@ -106,14 +131,14 @@ export declare function InkeepEmbeddedSearch(props: InkeepEmbeddedSearchProps):
|
|
|
106
131
|
export declare function InkeepEmbeddedSearchAndChat(props: InkeepEmbeddedSearchAndChatProps): JSX.Element;
|
|
107
132
|
|
|
108
133
|
export declare interface InkeepEmbeddedSearchAndChatProps extends InkeepEmbeddedSearchAndChatProps_2 {
|
|
109
|
-
baseSettings: InkeepEmbeddedSearchAndChatProps_2['baseSettings'] &
|
|
110
|
-
aiChatSettings: InkeepEmbeddedSearchAndChatProps_2['aiChatSettings'] &
|
|
111
|
-
searchSettings: InkeepEmbeddedSearchAndChatProps_2['searchSettings'] &
|
|
134
|
+
baseSettings: InkeepEmbeddedSearchAndChatProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
135
|
+
aiChatSettings: InkeepEmbeddedSearchAndChatProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
136
|
+
searchSettings: InkeepEmbeddedSearchAndChatProps_2['searchSettings'] & InkeepCloudSearchSettings;
|
|
112
137
|
}
|
|
113
138
|
|
|
114
139
|
export declare interface InkeepEmbeddedSearchProps extends InkeepEmbeddedSearchProps_2 {
|
|
115
|
-
baseSettings: InkeepEmbeddedSearchProps_2['baseSettings'] &
|
|
116
|
-
searchSettings: InkeepEmbeddedSearchProps_2['searchSettings'] &
|
|
140
|
+
baseSettings: InkeepEmbeddedSearchProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
141
|
+
searchSettings: InkeepEmbeddedSearchProps_2['searchSettings'] & InkeepCloudSearchSettings;
|
|
117
142
|
}
|
|
118
143
|
|
|
119
144
|
export declare function InkeepModal(props: InkeepModalProps): JSX.Element;
|
|
@@ -140,9 +165,9 @@ export declare function InkeepModalSearch(props: InkeepModalSearchProps): JSX.El
|
|
|
140
165
|
export declare function InkeepModalSearchAndChat(props: InkeepModalSearchAndChatProps): JSX.Element;
|
|
141
166
|
|
|
142
167
|
export declare interface InkeepModalSearchAndChatProps extends InkeepModalSearchAndChatProps_2 {
|
|
143
|
-
baseSettings: InkeepModalSearchAndChatProps_2['baseSettings'] &
|
|
144
|
-
aiChatSettings: InkeepModalSearchAndChatProps_2['aiChatSettings'] &
|
|
145
|
-
searchSettings: InkeepModalSearchAndChatProps_2['searchSettings'] &
|
|
168
|
+
baseSettings: InkeepModalSearchAndChatProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
169
|
+
aiChatSettings: InkeepModalSearchAndChatProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
170
|
+
searchSettings: InkeepModalSearchAndChatProps_2['searchSettings'] & InkeepCloudSearchSettings;
|
|
146
171
|
}
|
|
147
172
|
|
|
148
173
|
export declare interface InkeepModalSearchProps extends Omit<InkeepEmbeddedSearchProps_2, 'onToggleView'> {
|
|
@@ -152,19 +177,19 @@ export declare interface InkeepModalSearchProps extends Omit<InkeepEmbeddedSearc
|
|
|
152
177
|
export declare function InkeepSearchBar(props: InkeepSearchBarProps): JSX.Element;
|
|
153
178
|
|
|
154
179
|
export declare interface InkeepSearchBarProps extends InkeepSearchBarProps_2 {
|
|
155
|
-
baseSettings: InkeepSearchBarProps_2['baseSettings'] &
|
|
156
|
-
aiChatSettings: InkeepSearchBarProps_2['aiChatSettings'] &
|
|
157
|
-
searchSettings: InkeepSearchBarProps_2['searchSettings'] &
|
|
180
|
+
baseSettings: InkeepSearchBarProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
181
|
+
aiChatSettings: InkeepSearchBarProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
182
|
+
searchSettings: InkeepSearchBarProps_2['searchSettings'] & InkeepCloudSearchSettings;
|
|
158
183
|
}
|
|
159
184
|
|
|
160
185
|
export declare function InkeepSidebarChat(props: InkeepSidebarChatProps): JSX.Element;
|
|
161
186
|
|
|
162
187
|
export declare interface InkeepSidebarChatProps extends InkeepSidebarChatProps_2 {
|
|
163
|
-
baseSettings: InkeepSidebarChatProps_2['baseSettings'] &
|
|
164
|
-
aiChatSettings: InkeepSidebarChatProps_2['aiChatSettings'] &
|
|
188
|
+
baseSettings: InkeepSidebarChatProps_2['baseSettings'] & InkeepCloudBaseSettings;
|
|
189
|
+
aiChatSettings: InkeepSidebarChatProps_2['aiChatSettings'] & InkeepCloudAIChatSettings;
|
|
165
190
|
}
|
|
166
191
|
|
|
167
|
-
declare type InputMaybe<T> = T | null;
|
|
192
|
+
export declare type InputMaybe<T> = T | null;
|
|
168
193
|
|
|
169
194
|
declare interface ModalConfig extends RootConfig {
|
|
170
195
|
/**
|
|
@@ -181,11 +206,11 @@ declare type RecordTypes = 'DocumentationRecord' | 'GitHubIssueRecord' | 'StackO
|
|
|
181
206
|
|
|
182
207
|
declare type RootConfig = RootProviderProps['config'];
|
|
183
208
|
|
|
184
|
-
declare type SearchFiltersInput = {
|
|
209
|
+
export declare type SearchFiltersInput = {
|
|
185
210
|
limit: number;
|
|
186
211
|
};
|
|
187
212
|
|
|
188
|
-
declare interface SearchHit {
|
|
213
|
+
export declare interface SearchHit {
|
|
189
214
|
hitOnRoot: boolean;
|
|
190
215
|
id: string;
|
|
191
216
|
rootRecord: SearchRootRecord;
|
|
@@ -202,12 +227,12 @@ declare interface SearchHit {
|
|
|
202
227
|
};
|
|
203
228
|
}
|
|
204
229
|
|
|
205
|
-
declare type SearchInput = {
|
|
230
|
+
export declare type SearchInput = {
|
|
206
231
|
filters?: InputMaybe<SearchFiltersInput>;
|
|
207
232
|
searchQuery: string;
|
|
208
233
|
};
|
|
209
234
|
|
|
210
|
-
declare interface SearchRootRecord {
|
|
235
|
+
export declare interface SearchRootRecord {
|
|
211
236
|
__typename: RecordTypes;
|
|
212
237
|
id: string;
|
|
213
238
|
title?: string;
|
|
@@ -225,11 +250,14 @@ declare interface SearchRootRecord {
|
|
|
225
250
|
};
|
|
226
251
|
}
|
|
227
252
|
|
|
228
|
-
declare interface TopLevelHeading {
|
|
253
|
+
export declare interface TopLevelHeading {
|
|
229
254
|
anchor?: string | null;
|
|
230
255
|
url?: string | null;
|
|
231
256
|
content: string;
|
|
232
257
|
isMatch?: boolean;
|
|
233
258
|
}
|
|
234
259
|
|
|
260
|
+
|
|
261
|
+
export * from "@inkeep/agents-ui/types";
|
|
262
|
+
|
|
235
263
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -2,27 +2,29 @@ import { InkeepEmbeddedChat as r } from "./components/embedded-chat.js";
|
|
|
2
2
|
import { InkeepSidebarChat as p } from "./components/sidebar-chat.js";
|
|
3
3
|
import { InkeepEmbeddedSearchAndChat as d } from "./components/embedded-search-and-chat.js";
|
|
4
4
|
import { InkeepEmbeddedSearch as m } from "./components/embedded-search.js";
|
|
5
|
-
import { InkeepModalChat as
|
|
6
|
-
import { InkeepModalSearchAndChat as
|
|
5
|
+
import { InkeepModalChat as x } from "./components/modal.chat.js";
|
|
6
|
+
import { InkeepModalSearchAndChat as I } from "./components/modal.search-and-chat.js";
|
|
7
7
|
import { InkeepModalSearch as C } from "./components/modal.search.js";
|
|
8
|
-
import { InkeepModal as l, ModalContent as
|
|
9
|
-
import { InkeepChatButton as
|
|
10
|
-
import { InkeepChatButtonModal as
|
|
11
|
-
import { InkeepSearchBar as
|
|
12
|
-
import { composeEventHandlers as
|
|
8
|
+
import { InkeepModal as l, ModalContent as S } from "./components/modal.js";
|
|
9
|
+
import { InkeepChatButton as M } from "./components/chat-button.js";
|
|
10
|
+
import { InkeepChatButtonModal as u } from "./components/chat-button-modal.js";
|
|
11
|
+
import { InkeepSearchBar as B } from "./components/searchbar.js";
|
|
12
|
+
import { composeEventHandlers as A, composeRefs as H } from "./components/utils.js";
|
|
13
|
+
import { GitHubIssueState as G } from "./components/types.js";
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
G as GitHubIssueState,
|
|
16
|
+
M as InkeepChatButton,
|
|
17
|
+
u as InkeepChatButtonModal,
|
|
16
18
|
r as InkeepEmbeddedChat,
|
|
17
19
|
m as InkeepEmbeddedSearch,
|
|
18
20
|
d as InkeepEmbeddedSearchAndChat,
|
|
19
21
|
l as InkeepModal,
|
|
20
|
-
|
|
22
|
+
x as InkeepModalChat,
|
|
21
23
|
C as InkeepModalSearch,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
I as InkeepModalSearchAndChat,
|
|
25
|
+
B as InkeepSearchBar,
|
|
24
26
|
p as InkeepSidebarChat,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
S as ModalContent,
|
|
28
|
+
A as composeEventHandlers,
|
|
29
|
+
H as composeRefs
|
|
28
30
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../components/types.cjs");exports.GitHubIssueState=e.GitHubIssueState;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-ui-cloud",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Inkeep, Inc. Customer License (IICL) v1.1",
|
|
6
6
|
"homepage": "",
|
|
@@ -11,10 +11,28 @@
|
|
|
11
11
|
},
|
|
12
12
|
"type": "module",
|
|
13
13
|
"main": "dist/index.cjs",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"source": "./src/index.ts",
|
|
17
|
+
"import": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"require": {
|
|
22
|
+
"types": "./dist/index.d.cts",
|
|
23
|
+
"default": "./dist/index.cjs"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"./types": {
|
|
27
|
+
"types": "./dist/types/index.d.ts",
|
|
28
|
+
"default": "./dist/types/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
14
32
|
"files": [
|
|
15
33
|
"dist"
|
|
16
34
|
],
|
|
17
|
-
"clean-package": "
|
|
35
|
+
"clean-package": "./clean-package.config.json",
|
|
18
36
|
"publishConfig": {
|
|
19
37
|
"access": "public"
|
|
20
38
|
},
|
|
@@ -22,7 +40,7 @@
|
|
|
22
40
|
"dependencies": {
|
|
23
41
|
"@radix-ui/react-use-controllable-state": "^1.1.0",
|
|
24
42
|
"lucide-react": "^0.503.0",
|
|
25
|
-
"@inkeep/agents-ui": "0.15.
|
|
43
|
+
"@inkeep/agents-ui": "0.15.16"
|
|
26
44
|
},
|
|
27
45
|
"devDependencies": {
|
|
28
46
|
"@biomejs/biome": "1.9.4",
|
|
@@ -49,20 +67,6 @@
|
|
|
49
67
|
},
|
|
50
68
|
"module": "dist/index.js",
|
|
51
69
|
"types": "dist/index.d.ts",
|
|
52
|
-
"exports": {
|
|
53
|
-
".": {
|
|
54
|
-
"source": "./src/index.ts",
|
|
55
|
-
"import": {
|
|
56
|
-
"types": "./dist/index.d.ts",
|
|
57
|
-
"default": "./dist/index.js"
|
|
58
|
-
},
|
|
59
|
-
"require": {
|
|
60
|
-
"types": "./dist/index.d.cts",
|
|
61
|
-
"default": "./dist/index.cjs"
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"./package.json": "./package.json"
|
|
65
|
-
},
|
|
66
70
|
"scripts": {
|
|
67
71
|
"build": "vite build",
|
|
68
72
|
"watch": "vite build --watch",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function a(e,s,i){try{const t=`${i}/events`,r={...e,type:e.eventName};if("searchQuery"in e.properties)r.entityType="search",r.searchQuery=e.properties.searchQuery;else if("messageId"in e.properties)r.entityType="message",r.messageId=e.properties.messageId;else{if(r.entityType="conversation",!e.properties.conversationId)return;r.conversationId=e.properties.conversationId}const o=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify(r)});if(!o.ok){const n=await o.text();throw new Error(`Failed to log event: ${n}`)}}catch(t){console.warn("Error in logEvent:",t)}}exports.logEvent=a;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
async function a(e, s, i) {
|
|
3
|
-
try {
|
|
4
|
-
const o = `${i}/events`, r = {
|
|
5
|
-
...e,
|
|
6
|
-
type: e.eventName
|
|
7
|
-
};
|
|
8
|
-
if ("searchQuery" in e.properties)
|
|
9
|
-
r.entityType = "search", r.searchQuery = e.properties.searchQuery;
|
|
10
|
-
else if ("messageId" in e.properties)
|
|
11
|
-
r.entityType = "message", r.messageId = e.properties.messageId;
|
|
12
|
-
else {
|
|
13
|
-
if (r.entityType = "conversation", !e.properties.conversationId) return;
|
|
14
|
-
r.conversationId = e.properties.conversationId;
|
|
15
|
-
}
|
|
16
|
-
const t = await fetch(o, {
|
|
17
|
-
method: "POST",
|
|
18
|
-
headers: {
|
|
19
|
-
"Content-Type": "application/json",
|
|
20
|
-
Authorization: `Bearer ${s}`
|
|
21
|
-
},
|
|
22
|
-
body: JSON.stringify(r)
|
|
23
|
-
});
|
|
24
|
-
if (!t.ok) {
|
|
25
|
-
const n = await t.text();
|
|
26
|
-
throw new Error(`Failed to log event: ${n}`);
|
|
27
|
-
}
|
|
28
|
-
} catch (o) {
|
|
29
|
-
console.warn("Error in logEvent:", o);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
a as logEvent
|
|
34
|
-
};
|