@servicetitan/titan-chatbot-api 7.1.1 → 8.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.
- package/CHANGELOG.md +25 -0
- package/dist/api-client/__mocks__/chatbot-api-client.mock.js +21 -47
- package/dist/api-client/__mocks__/chatbot-api-client.mock.js.map +1 -1
- package/dist/api-client/base/chatbot-api-client.js +3 -4
- package/dist/api-client/base/chatbot-api-client.js.map +1 -1
- package/dist/api-client/help-center/__tests__/converter-from-models.test.js +48 -15
- package/dist/api-client/help-center/__tests__/converter-from-models.test.js.map +1 -1
- package/dist/api-client/help-center/__tests__/converter-to-models.test.js +23 -22
- package/dist/api-client/help-center/__tests__/converter-to-models.test.js.map +1 -1
- package/dist/api-client/help-center/chatbot-api-client.js +51 -52
- package/dist/api-client/help-center/chatbot-api-client.js.map +1 -1
- package/dist/api-client/help-center/converter-from-models.js +15 -12
- package/dist/api-client/help-center/converter-from-models.js.map +1 -1
- package/dist/api-client/help-center/converter-to-models.js +29 -26
- package/dist/api-client/help-center/converter-to-models.js.map +1 -1
- package/dist/api-client/help-center/index.d.ts +2 -1
- package/dist/api-client/help-center/index.d.ts.map +1 -1
- package/dist/api-client/help-center/index.js +1 -0
- package/dist/api-client/help-center/index.js.map +1 -1
- package/dist/api-client/help-center/native-client.js +1192 -2884
- package/dist/api-client/help-center/native-client.js.map +1 -1
- package/dist/api-client/index.d.ts +2 -1
- package/dist/api-client/index.d.ts.map +1 -1
- package/dist/api-client/index.js +14 -7
- package/dist/api-client/index.js.map +1 -1
- package/dist/api-client/models/__mocks__/models.mock.js +154 -124
- package/dist/api-client/models/__mocks__/models.mock.js.map +1 -1
- package/dist/api-client/models/index.d.ts +2 -1
- package/dist/api-client/models/index.d.ts.map +1 -1
- package/dist/api-client/models/index.js +8 -7
- package/dist/api-client/models/index.js.map +1 -1
- package/dist/api-client/titan-chat/__tests__/native-client.test.js +6 -6
- package/dist/api-client/titan-chat/__tests__/native-client.test.js.map +1 -1
- package/dist/api-client/titan-chat/chatbot-api-client.js +40 -35
- package/dist/api-client/titan-chat/chatbot-api-client.js.map +1 -1
- package/dist/api-client/titan-chat/index.d.ts +2 -1
- package/dist/api-client/titan-chat/index.d.ts.map +1 -1
- package/dist/api-client/titan-chat/index.js +1 -0
- package/dist/api-client/titan-chat/index.js.map +1 -1
- package/dist/api-client/titan-chat/native-client.d.ts +14 -14
- package/dist/api-client/titan-chat/native-client.d.ts.map +1 -1
- package/dist/api-client/titan-chat/native-client.js +359 -809
- package/dist/api-client/titan-chat/native-client.js.map +1 -1
- package/dist/api-client/utils/__tests__/model-utils.test.js +454 -191
- package/dist/api-client/utils/__tests__/model-utils.test.js.map +1 -1
- package/dist/api-client/utils/model-utils.d.ts.map +1 -1
- package/dist/api-client/utils/model-utils.js +28 -25
- package/dist/api-client/utils/model-utils.js.map +1 -1
- package/dist/hooks/use-customization-chatbot.js +2 -1
- package/dist/hooks/use-customization-chatbot.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/models/chatbot-customizations.js +2 -1
- package/dist/models/chatbot-customizations.js.map +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +2 -1
- package/dist/models/index.js.map +1 -1
- package/dist/stores/__tests__/chatbot-ui-backend.store.test.js +267 -172
- package/dist/stores/__tests__/chatbot-ui-backend.store.test.js.map +1 -1
- package/dist/stores/__tests__/chatbot-ui.store.test.js +61 -64
- package/dist/stores/__tests__/chatbot-ui.store.test.js.map +1 -1
- package/dist/stores/__tests__/filter.store.test.js +243 -116
- package/dist/stores/__tests__/filter.store.test.js.map +1 -1
- package/dist/stores/__tests__/initialize.store.test.js +9 -8
- package/dist/stores/__tests__/initialize.store.test.js.map +1 -1
- package/dist/stores/__tests__/message-feedback-guardrail.store.test.js +8 -7
- package/dist/stores/__tests__/message-feedback-guardrail.store.test.js.map +1 -1
- package/dist/stores/__tests__/message-feedback.store.test.js +34 -27
- package/dist/stores/__tests__/message-feedback.store.test.js.map +1 -1
- package/dist/stores/__tests__/session-feedback.store.test.js +9 -8
- package/dist/stores/__tests__/session-feedback.store.test.js.map +1 -1
- package/dist/stores/chatbot-ui-backend.store.js +171 -240
- package/dist/stores/chatbot-ui-backend.store.js.map +1 -1
- package/dist/stores/chatbot-ui.store.js +73 -46
- package/dist/stores/chatbot-ui.store.js.map +1 -1
- package/dist/stores/filter.store.js +298 -378
- package/dist/stores/filter.store.js.map +1 -1
- package/dist/stores/index.d.ts +5 -3
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +3 -2
- package/dist/stores/index.js.map +1 -1
- package/dist/stores/initialize.store.js +55 -51
- package/dist/stores/initialize.store.js.map +1 -1
- package/dist/stores/message-feedback-base.store.js +2 -1
- package/dist/stores/message-feedback-base.store.js.map +1 -1
- package/dist/stores/message-feedback-guardrail.store.js +50 -47
- package/dist/stores/message-feedback-guardrail.store.js.map +1 -1
- package/dist/stores/message-feedback.store.js +84 -89
- package/dist/stores/message-feedback.store.js.map +1 -1
- package/dist/stores/session-feedback.store.js +46 -39
- package/dist/stores/session-feedback.store.js.map +1 -1
- package/dist/utils/__tests__/axios-utils.test.js +8 -7
- package/dist/utils/__tests__/axios-utils.test.js.map +1 -1
- package/dist/utils/axios-utils.js +9 -7
- package/dist/utils/axios-utils.js.map +1 -1
- package/dist/utils/test-utils.js +5 -5
- package/dist/utils/test-utils.js.map +1 -1
- package/package.json +3 -3
- package/src/api-client/help-center/index.ts +2 -1
- package/src/api-client/help-center/native-client.ts +4 -4
- package/src/api-client/index.ts +2 -6
- package/src/api-client/models/index.ts +15 -13
- package/src/api-client/titan-chat/index.ts +2 -1
- package/src/api-client/titan-chat/native-client.ts +17 -14
- package/src/api-client/utils/model-utils.ts +4 -8
- package/src/index.ts +1 -1
- package/src/models/index.ts +1 -1
- package/src/stores/index.ts +5 -12
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
/* eslint-disable no-restricted-imports */
|
|
2
2
|
import { IBotMessage, IFeedback, IUserMessage } from '../titan-chat/native-client';
|
|
3
|
-
export {
|
|
3
|
+
export type {
|
|
4
4
|
IUserMessage,
|
|
5
|
+
IFeedback,
|
|
6
|
+
IFrontendModel,
|
|
7
|
+
IOption,
|
|
8
|
+
IScoredUrl,
|
|
9
|
+
ISelections,
|
|
10
|
+
ISession,
|
|
11
|
+
IBotMessage,
|
|
12
|
+
IExportHistoryMessage,
|
|
13
|
+
IAgentOption,
|
|
14
|
+
IWorkflowPlan,
|
|
15
|
+
IWorkflowStep,
|
|
16
|
+
IUserInput,
|
|
17
|
+
} from '../titan-chat/native-client';
|
|
18
|
+
export {
|
|
5
19
|
Selections,
|
|
6
20
|
FeedbackOptions,
|
|
7
21
|
FeedbackRatings,
|
|
@@ -9,29 +23,17 @@ export {
|
|
|
9
23
|
ApiException,
|
|
10
24
|
Feedback,
|
|
11
25
|
Option,
|
|
12
|
-
IFeedback,
|
|
13
26
|
FrontendModel,
|
|
14
27
|
UserMessage,
|
|
15
|
-
IFrontendModel,
|
|
16
|
-
IOption,
|
|
17
28
|
OptionType,
|
|
18
29
|
ScoredUrl,
|
|
19
|
-
IScoredUrl,
|
|
20
|
-
ISelections,
|
|
21
|
-
ISession,
|
|
22
30
|
Experience,
|
|
23
|
-
IBotMessage,
|
|
24
31
|
BotMessage,
|
|
25
|
-
IExportHistoryMessage,
|
|
26
32
|
ExportHistoryMessage,
|
|
27
33
|
AgentOption,
|
|
28
|
-
IAgentOption,
|
|
29
34
|
WorkflowPlan,
|
|
30
|
-
IWorkflowPlan,
|
|
31
35
|
WorkflowStep,
|
|
32
|
-
IWorkflowStep,
|
|
33
36
|
UserInput,
|
|
34
|
-
IUserInput,
|
|
35
37
|
} from '../titan-chat/native-client';
|
|
36
38
|
|
|
37
39
|
export interface IBotMessageWithFeedback extends IBotMessage {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { IChatbotClientSettingsTitanChat } from './chatbot-api-client';
|
|
2
|
+
export { ChatbotApiClient } from './chatbot-api-client';
|
|
@@ -1545,8 +1545,8 @@ export interface ISummarizeResponse {
|
|
|
1545
1545
|
|
|
1546
1546
|
/** One user-provided input collected for the workflow. */
|
|
1547
1547
|
export class UserInput implements IUserInput {
|
|
1548
|
-
label
|
|
1549
|
-
value
|
|
1548
|
+
label!: string;
|
|
1549
|
+
value!: string;
|
|
1550
1550
|
|
|
1551
1551
|
constructor(data?: IUserInput) {
|
|
1552
1552
|
if (data) {
|
|
@@ -1580,8 +1580,8 @@ export class UserInput implements IUserInput {
|
|
|
1580
1580
|
|
|
1581
1581
|
/** One user-provided input collected for the workflow. */
|
|
1582
1582
|
export interface IUserInput {
|
|
1583
|
-
label
|
|
1584
|
-
value
|
|
1583
|
+
label: string;
|
|
1584
|
+
value: string;
|
|
1585
1585
|
}
|
|
1586
1586
|
|
|
1587
1587
|
/** User request message. */
|
|
@@ -1652,10 +1652,10 @@ export interface IUserMessage extends IMessage {
|
|
|
1652
1652
|
|
|
1653
1653
|
/** Pre-execution plan for an agentic UI workflow. */
|
|
1654
1654
|
export class WorkflowPlan implements IWorkflowPlan {
|
|
1655
|
-
displayName
|
|
1656
|
-
estimatedRuntimeSec
|
|
1655
|
+
displayName!: string;
|
|
1656
|
+
estimatedRuntimeSec!: number;
|
|
1657
1657
|
inputs?: UserInput[] | undefined;
|
|
1658
|
-
steps
|
|
1658
|
+
steps!: WorkflowStep[];
|
|
1659
1659
|
|
|
1660
1660
|
constructor(data?: IWorkflowPlan) {
|
|
1661
1661
|
if (data) {
|
|
@@ -1663,6 +1663,9 @@ export class WorkflowPlan implements IWorkflowPlan {
|
|
|
1663
1663
|
if (data.hasOwnProperty(property)) (<any>this)[property] = (<any>data)[property];
|
|
1664
1664
|
}
|
|
1665
1665
|
}
|
|
1666
|
+
if (!data) {
|
|
1667
|
+
this.steps = [];
|
|
1668
|
+
}
|
|
1666
1669
|
}
|
|
1667
1670
|
|
|
1668
1671
|
init(_data?: any) {
|
|
@@ -1705,16 +1708,16 @@ export class WorkflowPlan implements IWorkflowPlan {
|
|
|
1705
1708
|
|
|
1706
1709
|
/** Pre-execution plan for an agentic UI workflow. */
|
|
1707
1710
|
export interface IWorkflowPlan {
|
|
1708
|
-
displayName
|
|
1709
|
-
estimatedRuntimeSec
|
|
1711
|
+
displayName: string;
|
|
1712
|
+
estimatedRuntimeSec: number;
|
|
1710
1713
|
inputs?: UserInput[] | undefined;
|
|
1711
|
-
steps
|
|
1714
|
+
steps: WorkflowStep[];
|
|
1712
1715
|
}
|
|
1713
1716
|
|
|
1714
1717
|
/** One step in the workflow's execution plan. `PageUrl` is set on navigation steps only. */
|
|
1715
1718
|
export class WorkflowStep implements IWorkflowStep {
|
|
1716
|
-
number
|
|
1717
|
-
description
|
|
1719
|
+
number!: number;
|
|
1720
|
+
description!: string;
|
|
1718
1721
|
pageUrl?: string | undefined;
|
|
1719
1722
|
|
|
1720
1723
|
constructor(data?: IWorkflowStep) {
|
|
@@ -1751,8 +1754,8 @@ export class WorkflowStep implements IWorkflowStep {
|
|
|
1751
1754
|
|
|
1752
1755
|
/** One step in the workflow's execution plan. `PageUrl` is set on navigation steps only. */
|
|
1753
1756
|
export interface IWorkflowStep {
|
|
1754
|
-
number
|
|
1755
|
-
description
|
|
1757
|
+
number: number;
|
|
1758
|
+
description: string;
|
|
1756
1759
|
pageUrl?: string | undefined;
|
|
1757
1760
|
}
|
|
1758
1761
|
|
|
@@ -11,11 +11,9 @@ export function createSelectionsModel(
|
|
|
11
11
|
const process = (filters: Models.IOption[]): Models.Selections | undefined => {
|
|
12
12
|
let result: Models.Selections | undefined;
|
|
13
13
|
const ensureResult = () => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
}
|
|
14
|
+
result ??= new Models.Selections({
|
|
15
|
+
subOptions: {},
|
|
16
|
+
});
|
|
19
17
|
return result.subOptions!;
|
|
20
18
|
};
|
|
21
19
|
|
|
@@ -74,9 +72,7 @@ export function createSelectionsModel(
|
|
|
74
72
|
subFilterSelection = new Models.Selections({});
|
|
75
73
|
subOptions[filter.key] = subFilterSelection;
|
|
76
74
|
}
|
|
77
|
-
|
|
78
|
-
subFilterSelection.subOptions = {};
|
|
79
|
-
}
|
|
75
|
+
subFilterSelection.subOptions ??= {};
|
|
80
76
|
subFilterSelection.subOptions![key] = value;
|
|
81
77
|
}
|
|
82
78
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-restricted-imports */
|
|
2
2
|
export * from './api-client';
|
|
3
3
|
export * from './stores';
|
|
4
|
-
export * from './models';
|
|
4
|
+
export type * from './models';
|
|
5
5
|
export * from './hooks/use-customization-chatbot';
|
|
6
6
|
export * as NativeClientHC from './api-client/help-center/native-client';
|
|
7
7
|
export * as NativeClientTC from './api-client/titan-chat/native-client';
|
package/src/models/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './chatbot-customizations';
|
|
1
|
+
export type * from './chatbot-customizations';
|
package/src/stores/index.ts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from './chatbot-ui-backend.store';
|
|
6
|
-
export {
|
|
7
|
-
CHATBOT_UI_STORE_TOKEN,
|
|
8
|
-
IChatbotUiStore,
|
|
9
|
-
ChatbotUiStore,
|
|
10
|
-
ChatbotUiEvent,
|
|
11
|
-
} from './chatbot-ui.store';
|
|
1
|
+
export type { IChatbotUiBackendStore } from './chatbot-ui-backend.store';
|
|
2
|
+
export { CHATBOT_UI_BACKEND_STORE_TOKEN, ChatbotUiBackendStore } from './chatbot-ui-backend.store';
|
|
3
|
+
export type { IChatbotUiStore } from './chatbot-ui.store';
|
|
4
|
+
export { CHATBOT_UI_STORE_TOKEN, ChatbotUiStore, ChatbotUiEvent } from './chatbot-ui.store';
|
|
12
5
|
export {
|
|
13
6
|
type IUiFilterOption,
|
|
14
7
|
type IFilterStore,
|
|
@@ -18,4 +11,4 @@ export { InitializeStore, InitializeStoreStatus } from './initialize.store';
|
|
|
18
11
|
export { MessageFeedbackStore } from './message-feedback.store';
|
|
19
12
|
export { MessageFeedbackGuardrailStore } from './message-feedback-guardrail.store';
|
|
20
13
|
export { SessionFeedbackStore } from './session-feedback.store';
|
|
21
|
-
export {
|
|
14
|
+
export type { FeedbackDraft, IMessageFeedbackBaseStore } from './message-feedback-base.store';
|