@visma-swno/gaia-chat-ui 0.0.4
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 +0 -0
- package/README.md +1 -0
- package/dist/components/avatar/avatar.d.ts +13 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -0
- package/dist/components/avatar/avatar.styles.d.ts +2 -0
- package/dist/components/avatar/avatar.styles.d.ts.map +1 -0
- package/dist/components/base.d.ts +7 -0
- package/dist/components/base.d.ts.map +1 -0
- package/dist/components/button/button.d.ts +11 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/button.styles.d.ts +2 -0
- package/dist/components/button/button.styles.d.ts.map +1 -0
- package/dist/components/card/card-content.d.ts +6 -0
- package/dist/components/card/card-content.d.ts.map +1 -0
- package/dist/components/card/card-content.styles.d.ts +2 -0
- package/dist/components/card/card-content.styles.d.ts.map +1 -0
- package/dist/components/card/card-footer.d.ts +6 -0
- package/dist/components/card/card-footer.d.ts.map +1 -0
- package/dist/components/card/card-footer.styles.d.ts +2 -0
- package/dist/components/card/card-footer.styles.d.ts.map +1 -0
- package/dist/components/card/card-header.d.ts +7 -0
- package/dist/components/card/card-header.d.ts.map +1 -0
- package/dist/components/card/card-header.styles.d.ts +2 -0
- package/dist/components/card/card-header.styles.d.ts.map +1 -0
- package/dist/components/card/card.d.ts +6 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/card.styles.d.ts +2 -0
- package/dist/components/card/card.styles.d.ts.map +1 -0
- package/dist/components/chat/chat.d.ts +28 -0
- package/dist/components/chat/chat.d.ts.map +1 -0
- package/dist/components/chat/chat.styles.d.ts +2 -0
- package/dist/components/chat/chat.styles.d.ts.map +1 -0
- package/dist/components/chat-input/chat-input.d.ts +16 -0
- package/dist/components/chat-input/chat-input.d.ts.map +1 -0
- package/dist/components/chat-input/chat-input.styles.d.ts +2 -0
- package/dist/components/chat-input/chat-input.styles.d.ts.map +1 -0
- package/dist/components/chat-message/chat-message.d.ts +19 -0
- package/dist/components/chat-message/chat-message.d.ts.map +1 -0
- package/dist/components/chat-message/chat-message.styles.d.ts +2 -0
- package/dist/components/chat-message/chat-message.styles.d.ts.map +1 -0
- package/dist/components/chat-message/chat-message.utils.d.ts +2 -0
- package/dist/components/chat-message/chat-message.utils.d.ts.map +1 -0
- package/dist/components/chat-message/markdown.styles.d.ts +2 -0
- package/dist/components/chat-message/markdown.styles.d.ts.map +1 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/loader/loader.d.ts +10 -0
- package/dist/components/loader/loader.d.ts.map +1 -0
- package/dist/components/loader/loader.styles.d.ts +2 -0
- package/dist/components/loader/loader.styles.d.ts.map +1 -0
- package/dist/components/menu/menu-item.d.ts +11 -0
- package/dist/components/menu/menu-item.d.ts.map +1 -0
- package/dist/components/menu/menu-item.styles.d.ts +2 -0
- package/dist/components/menu/menu-item.styles.d.ts.map +1 -0
- package/dist/components/menu/menu.d.ts +11 -0
- package/dist/components/menu/menu.d.ts.map +1 -0
- package/dist/components/menu/menu.styles.d.ts +2 -0
- package/dist/components/menu/menu.styles.d.ts.map +1 -0
- package/dist/components/popover/popover.d.ts +18 -0
- package/dist/components/popover/popover.d.ts.map +1 -0
- package/dist/components/popover/popover.styles.d.ts +2 -0
- package/dist/components/popover/popover.styles.d.ts.map +1 -0
- package/dist/components/spacing/spacing.d.ts +7 -0
- package/dist/components/spacing/spacing.d.ts.map +1 -0
- package/dist/components/spacing/spacing.styles.d.ts +2 -0
- package/dist/components/spacing/spacing.styles.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +16 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.styles.d.ts +2 -0
- package/dist/components/tooltip/tooltip.styles.d.ts.map +1 -0
- package/dist/config/constants.d.ts +51 -0
- package/dist/config/constants.d.ts.map +1 -0
- package/dist/constants/icon-map.d.ts +3 -0
- package/dist/constants/icon-map.d.ts.map +1 -0
- package/dist/controllers/chat-controller.d.ts +22 -0
- package/dist/controllers/chat-controller.d.ts.map +1 -0
- package/dist/controllers/support-controller.d.ts +36 -0
- package/dist/controllers/support-controller.d.ts.map +1 -0
- package/dist/gaia-chat-ui.es.js +5403 -0
- package/dist/gaia-chat-ui.es.js.map +1 -0
- package/dist/gaia-chat-ui.umd.js +2313 -0
- package/dist/gaia-chat-ui.umd.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/services/base-service.d.ts +21 -0
- package/dist/services/base-service.d.ts.map +1 -0
- package/dist/services/chat-service.d.ts +14 -0
- package/dist/services/chat-service.d.ts.map +1 -0
- package/dist/services/chat-service.dto.d.ts +12 -0
- package/dist/services/chat-service.dto.d.ts.map +1 -0
- package/dist/services/liveleader-service.d.ts +10 -0
- package/dist/services/liveleader-service.d.ts.map +1 -0
- package/dist/services/liveleader-service.dto.d.ts +109 -0
- package/dist/services/liveleader-service.dto.d.ts.map +1 -0
- package/dist/services/websocket-manager.d.ts +38 -0
- package/dist/services/websocket-manager.d.ts.map +1 -0
- package/dist/styles.d.ts +2 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/types/events.d.ts +9 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/icons.d.ts +2 -0
- package/dist/types/icons.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/interfaces/chat-controller-host.d.ts +9 -0
- package/dist/types/interfaces/chat-controller-host.d.ts.map +1 -0
- package/dist/types/models/chat-message.d.ts +75 -0
- package/dist/types/models/chat-message.d.ts.map +1 -0
- package/dist/types/models/conversation.d.ts +6 -0
- package/dist/types/models/conversation.d.ts.map +1 -0
- package/dist/types/server-sent-events.d.ts +29 -0
- package/dist/types/server-sent-events.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +27 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/object.d.ts +3 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/package.json +85 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface RequestConfig {
|
|
2
|
+
timeout?: number;
|
|
3
|
+
headers?: Record<string, string>;
|
|
4
|
+
}
|
|
5
|
+
export interface ApiError extends Error {
|
|
6
|
+
status?: number;
|
|
7
|
+
response?: Response;
|
|
8
|
+
}
|
|
9
|
+
export declare abstract class BaseService {
|
|
10
|
+
protected baseUrl: string;
|
|
11
|
+
protected defaultHeaders: Record<string, string>;
|
|
12
|
+
constructor(baseUrl?: string);
|
|
13
|
+
setBaseUrl(url: string): void;
|
|
14
|
+
protected request<T>(endpoint: string, options?: RequestInit & RequestConfig): Promise<T>;
|
|
15
|
+
protected get<T>(endpoint: string, config?: RequestConfig): Promise<T>;
|
|
16
|
+
protected post<T>(endpoint: string, data?: unknown, config?: RequestConfig): Promise<T>;
|
|
17
|
+
protected put<T>(endpoint: string, data?: unknown, config?: RequestConfig): Promise<T>;
|
|
18
|
+
protected delete<T>(endpoint: string, config?: RequestConfig): Promise<T>;
|
|
19
|
+
private buildUrl;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=base-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-service.d.ts","sourceRoot":"","sources":["../../src/services/base-service.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,QAAS,SAAQ,KAAK;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,8BAAsB,WAAW;IAC/B,SAAS,CAAC,OAAO,EAAE,MAAM,CAAM;IAC/B,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE9C;gBAEU,OAAO,CAAC,EAAE,MAAM;IAM5B,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;cAIb,OAAO,CAAC,CAAC,EACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,WAAW,GAAG,aAAkB,GACxC,OAAO,CAAC,CAAC,CAAC;cA4CG,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC;cAI5D,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC;cAQ7E,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC;cAQ5E,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC;IAI/E,OAAO,CAAC,QAAQ;CAUjB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseService } from './base-service';
|
|
2
|
+
import { SendMessageRequest, SubmitActionApprovalRequest } from './chat-service.dto';
|
|
3
|
+
import { SSEvent } from '../types/server-sent-events';
|
|
4
|
+
export declare class ChatService extends BaseService {
|
|
5
|
+
private abortController;
|
|
6
|
+
constructor(baseUrl?: string);
|
|
7
|
+
streamMessages(payload: SendMessageRequest): AsyncGenerator<SSEvent, void, unknown>;
|
|
8
|
+
private processStreamResponse;
|
|
9
|
+
private parseSSEChunk;
|
|
10
|
+
private isValidEventType;
|
|
11
|
+
submitActionApproval(payload: SubmitActionApprovalRequest): Promise<void>;
|
|
12
|
+
abort(): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=chat-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-service.d.ts","sourceRoot":"","sources":["../../src/services/chat-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EAAE,OAAO,EAAe,MAAM,4BAA4B,CAAC;AAGlE,qBAAa,WAAY,SAAQ,WAAW;IAC1C,OAAO,CAAC,eAAe,CAAgC;gBAE3C,OAAO,CAAC,EAAE,MAAM;IAIrB,cAAc,CAAC,OAAO,EAAE,kBAAkB,GAAG,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC;YAyC3E,qBAAqB;IAwCpC,OAAO,CAAC,aAAa;IA+BrB,OAAO,CAAC,gBAAgB;IAIlB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IAU/E,KAAK,IAAI,IAAI;CAOd"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type SendMessageRequest = {
|
|
2
|
+
profileId: string;
|
|
3
|
+
conversationId: string | null;
|
|
4
|
+
messageId: string;
|
|
5
|
+
content: string;
|
|
6
|
+
};
|
|
7
|
+
export type SubmitActionApprovalRequest = {
|
|
8
|
+
conversationId: string;
|
|
9
|
+
messageId: string;
|
|
10
|
+
isApproved: boolean;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=chat-service.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-service.dto.d.ts","sourceRoot":"","sources":["../../src/services/chat-service.dto.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseService } from './base-service';
|
|
2
|
+
import { GetGroupByIdResponse, GetOperatorByIdResponse, SendMessageRequest, SendMessageResponse, StartConversationRequest, StartConversationResponse } from './liveleader-service.dto';
|
|
3
|
+
export declare class LiveleaderService extends BaseService {
|
|
4
|
+
constructor(baseUrl?: string);
|
|
5
|
+
startConversation(payload: StartConversationRequest): Promise<StartConversationResponse>;
|
|
6
|
+
sendMessage(payload: SendMessageRequest): Promise<SendMessageResponse>;
|
|
7
|
+
getGroupById(teamId: string): Promise<GetGroupByIdResponse>;
|
|
8
|
+
getOperatorById(operatorId: string): Promise<GetOperatorByIdResponse>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=liveleader-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liveleader-service.d.ts","sourceRoot":"","sources":["../../src/services/liveleader-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAElC,qBAAa,iBAAkB,SAAQ,WAAW;gBACpC,OAAO,CAAC,EAAE,MAAM;IAItB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IA8BxF,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAiCtE,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA0B3D,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;CA2B5E"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export type LiveLeaderMessage = {
|
|
2
|
+
role: 'assistant' | 'visitor';
|
|
3
|
+
text: string;
|
|
4
|
+
time: string;
|
|
5
|
+
};
|
|
6
|
+
type Visitor = {
|
|
7
|
+
name: string;
|
|
8
|
+
email: string;
|
|
9
|
+
data?: object;
|
|
10
|
+
};
|
|
11
|
+
export type StartConversationRequest = {
|
|
12
|
+
teamId: string;
|
|
13
|
+
startUrl: string;
|
|
14
|
+
messages: LiveLeaderMessage[];
|
|
15
|
+
visitor: Visitor;
|
|
16
|
+
routeToPartner: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
export type StartConversationResponse = {
|
|
19
|
+
id: string;
|
|
20
|
+
webSocketUrl: string;
|
|
21
|
+
};
|
|
22
|
+
export type SendMessageRequest = {
|
|
23
|
+
conversationId: string;
|
|
24
|
+
message: LiveLeaderMessage;
|
|
25
|
+
};
|
|
26
|
+
export type SendMessageResponse = {
|
|
27
|
+
text: string;
|
|
28
|
+
time: string;
|
|
29
|
+
id: string;
|
|
30
|
+
role: 'visitor';
|
|
31
|
+
type: 'text';
|
|
32
|
+
};
|
|
33
|
+
export type GetGroupByIdResponse = {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
available: boolean;
|
|
37
|
+
officeHourIntervals: {
|
|
38
|
+
day: number;
|
|
39
|
+
startTime: string;
|
|
40
|
+
endTime: string;
|
|
41
|
+
}[];
|
|
42
|
+
members: {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
email: string;
|
|
46
|
+
}[];
|
|
47
|
+
operatorIds: string[];
|
|
48
|
+
};
|
|
49
|
+
export type GetOperatorByIdResponse = {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
email: string;
|
|
53
|
+
picture: string | null;
|
|
54
|
+
};
|
|
55
|
+
export type WSTextMessage = {
|
|
56
|
+
id: string;
|
|
57
|
+
operatorId: string;
|
|
58
|
+
role: 'operator';
|
|
59
|
+
text: string;
|
|
60
|
+
time: string;
|
|
61
|
+
type: 'text';
|
|
62
|
+
};
|
|
63
|
+
type WSFileMessage = {
|
|
64
|
+
type: 'file';
|
|
65
|
+
time: string;
|
|
66
|
+
id: string;
|
|
67
|
+
role: string;
|
|
68
|
+
fileName: string;
|
|
69
|
+
fileUrl: string;
|
|
70
|
+
};
|
|
71
|
+
type WSTransferOperatorMessage = {
|
|
72
|
+
type: 'transfer';
|
|
73
|
+
time: string;
|
|
74
|
+
operatorId: string;
|
|
75
|
+
targetName: string;
|
|
76
|
+
};
|
|
77
|
+
type WSTransferPartnerMessage = {
|
|
78
|
+
type: 'transfer';
|
|
79
|
+
time: string;
|
|
80
|
+
targetName: string;
|
|
81
|
+
};
|
|
82
|
+
export type WSTypingMessage = {
|
|
83
|
+
conversationId: string;
|
|
84
|
+
id: string;
|
|
85
|
+
operatorId: string;
|
|
86
|
+
role: 'operator';
|
|
87
|
+
time: string;
|
|
88
|
+
type: 'typing';
|
|
89
|
+
};
|
|
90
|
+
type WSCloseMessage = {
|
|
91
|
+
id: string;
|
|
92
|
+
operatorId: string;
|
|
93
|
+
role: 'operator';
|
|
94
|
+
time: string;
|
|
95
|
+
type: 'close';
|
|
96
|
+
};
|
|
97
|
+
export type WSSeenMessage = {
|
|
98
|
+
conversationId: string;
|
|
99
|
+
id: string;
|
|
100
|
+
operatorId: string;
|
|
101
|
+
role: 'operator';
|
|
102
|
+
seenMessageId: string;
|
|
103
|
+
seenMessageTime: string;
|
|
104
|
+
time: string;
|
|
105
|
+
type: 'seen';
|
|
106
|
+
};
|
|
107
|
+
export type WSMessage = WSTextMessage | WSFileMessage | WSCloseMessage | WSTransferOperatorMessage | WSTransferPartnerMessage | WSTypingMessage | WSSeenMessage;
|
|
108
|
+
export {};
|
|
109
|
+
//# sourceMappingURL=liveleader-service.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liveleader-service.dto.d.ts","sourceRoot":"","sources":["../../src/services/liveleader-service.dto.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface WebSocketConfig {
|
|
2
|
+
url: string;
|
|
3
|
+
pingInterval?: number;
|
|
4
|
+
reconnectAttempts?: number;
|
|
5
|
+
reconnectDelay?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface WebSocketMessage {
|
|
8
|
+
type: string;
|
|
9
|
+
data?: unknown;
|
|
10
|
+
}
|
|
11
|
+
export declare class WebSocketManager {
|
|
12
|
+
private ws;
|
|
13
|
+
private config;
|
|
14
|
+
private pingInterval;
|
|
15
|
+
private pingCounter;
|
|
16
|
+
private reconnectAttempts;
|
|
17
|
+
private isManualClose;
|
|
18
|
+
private messageHandlers;
|
|
19
|
+
private connectionHandlers;
|
|
20
|
+
constructor(config: WebSocketConfig);
|
|
21
|
+
connect(): Promise<void>;
|
|
22
|
+
disconnect(reason?: string): void;
|
|
23
|
+
send(message: string | WebSocketMessage): void;
|
|
24
|
+
isConnected(): boolean;
|
|
25
|
+
onMessage<T = unknown>(type: string, handler: (data: T) => void): void;
|
|
26
|
+
offMessage(type: string): void;
|
|
27
|
+
onConnection(handlers: {
|
|
28
|
+
onOpen?: () => void;
|
|
29
|
+
onClose?: (reason?: string) => void;
|
|
30
|
+
onError?: (error: Event) => void;
|
|
31
|
+
}): void;
|
|
32
|
+
private handleMessage;
|
|
33
|
+
private handleClose;
|
|
34
|
+
private attemptReconnect;
|
|
35
|
+
private startPingInterval;
|
|
36
|
+
private stopPingInterval;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=websocket-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket-manager.d.ts","sourceRoot":"","sources":["../../src/services/websocket-manager.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,eAAe,CAAmD;IAC1E,OAAO,CAAC,kBAAkB,CAInB;gBAEK,MAAM,EAAE,eAAe;IASnC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IA0CxB,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAajC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAe9C,WAAW,IAAI,OAAO;IAItB,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,IAAI;IAItE,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI9B,YAAY,CAAC,QAAQ,EAAE;QACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;QACpB,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;QACpC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;KAClC,GAAG,IAAI;IAIR,OAAO,CAAC,aAAa;IA2BrB,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,gBAAgB;IAwBxB,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,gBAAgB;CAMzB"}
|
package/dist/styles.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,yBAqHxB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type ActionApprovalEventDetail = {
|
|
2
|
+
messageId: string;
|
|
3
|
+
isApproved: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare class ActionApprovalEvent extends CustomEvent<ActionApprovalEventDetail> {
|
|
6
|
+
constructor(messageId: string, isApproved: boolean);
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,KAAK,yBAAyB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,qBAAa,mBAAoB,SAAQ,WAAW,CAAC,yBAAyB,CAAC;gBACjE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO;CAGnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/types/icons.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GACZ,UAAU,GACV,gBAAgB,GAChB,MAAM,GACN,UAAU,GACV,MAAM,GACN,KAAK,GACL,YAAY,GACZ,QAAQ,GACR,2BAA2B,GAC3B,YAAY,GACZ,MAAM,GACN,aAAa,GACb,WAAW,GACX,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactiveControllerHost } from '@lit/reactive-element';
|
|
2
|
+
import { Conversation } from '../models/conversation';
|
|
3
|
+
export interface ChatControllerHost extends ReactiveControllerHost {
|
|
4
|
+
conversation: Conversation;
|
|
5
|
+
profileId: string | null;
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=chat-controller-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-controller-host.d.ts","sourceRoot":"","sources":["../../../src/types/interfaces/chat-controller-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB;IAChE,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export type ChatMessageMetadata = {
|
|
2
|
+
threadId: string;
|
|
3
|
+
citations: Citation[];
|
|
4
|
+
operatorId?: string;
|
|
5
|
+
operatorName?: string;
|
|
6
|
+
operatorAvatar?: string;
|
|
7
|
+
};
|
|
8
|
+
type Citation = {
|
|
9
|
+
title: string;
|
|
10
|
+
url: string;
|
|
11
|
+
score: number;
|
|
12
|
+
};
|
|
13
|
+
type BaseChatMessage = {
|
|
14
|
+
id: string;
|
|
15
|
+
role: string;
|
|
16
|
+
status: string;
|
|
17
|
+
content: string;
|
|
18
|
+
timestamp: string;
|
|
19
|
+
};
|
|
20
|
+
export type SystemChatMessage = BaseChatMessage & {
|
|
21
|
+
role: 'system';
|
|
22
|
+
status: 'info' | 'error' | 'warning' | 'success';
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* AI Chat Messages
|
|
26
|
+
*/
|
|
27
|
+
type BaseAIChatMessage = BaseChatMessage & {
|
|
28
|
+
status: 'pending' | 'completed' | 'failed' | 'cancelled' | 'waitingForApproval' | 'approved' | 'declined';
|
|
29
|
+
};
|
|
30
|
+
export type UserChatMessage = BaseAIChatMessage & {
|
|
31
|
+
role: 'user';
|
|
32
|
+
};
|
|
33
|
+
export type ToolChatMessage = BaseAIChatMessage & {
|
|
34
|
+
role: 'tool';
|
|
35
|
+
};
|
|
36
|
+
export type AssistantChatMessage = BaseAIChatMessage & {
|
|
37
|
+
role: 'assistant' | 'operator';
|
|
38
|
+
metadata?: {
|
|
39
|
+
citations?: Citation[];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export type AIChatMessage = AssistantChatMessage | OperatorChatMessage;
|
|
43
|
+
/**
|
|
44
|
+
* Support Chat Messages
|
|
45
|
+
*/
|
|
46
|
+
type BaseSupportChatMessage = BaseChatMessage & {
|
|
47
|
+
status: 'completed' | 'typing';
|
|
48
|
+
};
|
|
49
|
+
export type VisitorChatMessage = BaseSupportChatMessage & {
|
|
50
|
+
role: 'visitor';
|
|
51
|
+
seenTimestamp?: string;
|
|
52
|
+
};
|
|
53
|
+
export type OperatorChatMessage = BaseSupportChatMessage & {
|
|
54
|
+
role: 'operator';
|
|
55
|
+
operatorId: string;
|
|
56
|
+
operatorName: string;
|
|
57
|
+
operatorAvatar: string | null;
|
|
58
|
+
};
|
|
59
|
+
export type SupportChatMessage = VisitorChatMessage | OperatorChatMessage;
|
|
60
|
+
/**
|
|
61
|
+
* Union of all Chat Messages
|
|
62
|
+
*/
|
|
63
|
+
export type ChatMessage = UserChatMessage | ToolChatMessage | AssistantChatMessage | VisitorChatMessage | OperatorChatMessage | SystemChatMessage;
|
|
64
|
+
export type ChatMessageRole = ChatMessage['role'];
|
|
65
|
+
export type ChatMessageStatus = ChatMessage['status'];
|
|
66
|
+
export declare function isAIChatMessage(message: ChatMessage): message is AIChatMessage;
|
|
67
|
+
export declare function isSupportChatMessage(message: ChatMessage): message is SupportChatMessage;
|
|
68
|
+
export declare function isUserChatMessage(message: ChatMessage): message is UserChatMessage;
|
|
69
|
+
export declare function isToolChatMessage(message: ChatMessage): message is ToolChatMessage;
|
|
70
|
+
export declare function isAssistantChatMessage(message: ChatMessage): message is AssistantChatMessage;
|
|
71
|
+
export declare function isSystemChatMessage(message: ChatMessage): message is SystemChatMessage;
|
|
72
|
+
export declare function isVisitorChatMessage(message: ChatMessage): message is VisitorChatMessage;
|
|
73
|
+
export declare function isOperatorChatMessage(message: ChatMessage): message is OperatorChatMessage;
|
|
74
|
+
export {};
|
|
75
|
+
//# sourceMappingURL=chat-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-message.d.ts","sourceRoot":"","sources":["../../../src/types/models/chat-message.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/types/models/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACvC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type UpdateOperation = 'set' | 'append';
|
|
2
|
+
export type SSUpdateEvent = {
|
|
3
|
+
type: 'update';
|
|
4
|
+
data: {
|
|
5
|
+
p?: string;
|
|
6
|
+
o?: UpdateOperation;
|
|
7
|
+
v: unknown;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export type SSErrorEvent = {
|
|
11
|
+
type: 'error';
|
|
12
|
+
data: {
|
|
13
|
+
code: string;
|
|
14
|
+
message: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type SSMessageEvent = {
|
|
18
|
+
type: 'message';
|
|
19
|
+
data: {
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export type SSCloseEvent = {
|
|
24
|
+
type: 'close';
|
|
25
|
+
data: string;
|
|
26
|
+
};
|
|
27
|
+
export type SSEvent = SSUpdateEvent | SSErrorEvent | SSMessageEvent | SSCloseEvent;
|
|
28
|
+
export type SSEventType = SSEvent['type'];
|
|
29
|
+
//# sourceMappingURL=server-sent-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-sent-events.d.ts","sourceRoot":"","sources":["../../src/types/server-sent-events.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE;QACJ,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,eAAe,CAAC;QACpB,CAAC,EAAE,OAAO,CAAC;KACZ,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;AACnF,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare enum LogLevel {
|
|
2
|
+
DEBUG = 0,
|
|
3
|
+
INFO = 1,
|
|
4
|
+
WARN = 2,
|
|
5
|
+
ERROR = 3
|
|
6
|
+
}
|
|
7
|
+
export interface LogEntry {
|
|
8
|
+
level: LogLevel;
|
|
9
|
+
message: string;
|
|
10
|
+
timestamp: Date;
|
|
11
|
+
context?: Record<string, unknown>;
|
|
12
|
+
error?: Error;
|
|
13
|
+
}
|
|
14
|
+
export declare class Logger {
|
|
15
|
+
private static instance;
|
|
16
|
+
private minLevel;
|
|
17
|
+
private constructor();
|
|
18
|
+
static getInstance(): Logger;
|
|
19
|
+
setLevel(level: LogLevel): void;
|
|
20
|
+
private log;
|
|
21
|
+
debug(message: string, context?: Record<string, unknown>): void;
|
|
22
|
+
info(message: string, context?: Record<string, unknown>): void;
|
|
23
|
+
warn(message: string, context?: Record<string, unknown>): void;
|
|
24
|
+
error(message: string, context?: Record<string, unknown>, error?: Error): void;
|
|
25
|
+
}
|
|
26
|
+
export declare const logger: Logger;
|
|
27
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;CACV;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAS;IAChC,OAAO,CAAC,QAAQ,CAA2B;IAE3C,OAAO;IAEP,MAAM,CAAC,WAAW,IAAI,MAAM;IAO5B,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAI/B,OAAO,CAAC,GAAG;IAyCX,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI/D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI9D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI9D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI;CAG/E;AAED,eAAO,MAAM,MAAM,QAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,wBAAgB,2BAA2B,CAAC,CAAC,EAC3C,GAAG,EAAE,CAAC,EACN,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,OAAO,GACb,CAAC,CAsCH"}
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@visma-swno/gaia-chat-ui",
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"description": "Web component library for the Gaia Assistant Chat UI",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/gaia-chat-ui.umd.js",
|
|
7
|
+
"module": "dist/gaia-chat-ui.es.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"LICENSE",
|
|
12
|
+
"README.md",
|
|
13
|
+
"CHANGELOG.md"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"require": "./dist/gaia-chat-ui.umd.js",
|
|
19
|
+
"import": "./dist/gaia-chat-ui.es.js"
|
|
20
|
+
},
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "vite",
|
|
25
|
+
"build": "tsc --emitDeclarationOnly && vite build",
|
|
26
|
+
"preview": "vite preview",
|
|
27
|
+
"lint": "eslint . --ext .ts,.js",
|
|
28
|
+
"lint:fix": "eslint . --ext .ts,.js --fix",
|
|
29
|
+
"format": "prettier --write \"src/**/*.ts\" \"*.{js,json,md}\"",
|
|
30
|
+
"storybook": "storybook dev -p 6006",
|
|
31
|
+
"build-storybook": "storybook build"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"classnames": "^2.5.1",
|
|
35
|
+
"dayjs": "^1.11.13",
|
|
36
|
+
"lucide-static": "^0.510.0",
|
|
37
|
+
"marked": "^15.0.11"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@chromatic-com/storybook": "3",
|
|
41
|
+
"@eslint/js": "^9.27.0",
|
|
42
|
+
"@storybook/addon-a11y": "^8.6.14",
|
|
43
|
+
"@storybook/addon-essentials": "^8.6.14",
|
|
44
|
+
"@storybook/addon-links": "^8.6.14",
|
|
45
|
+
"@storybook/blocks": "8.6.14",
|
|
46
|
+
"@storybook/experimental-addon-test": "8.6.14",
|
|
47
|
+
"@storybook/test": "8.6.14",
|
|
48
|
+
"@storybook/web-components": "^8.6.14",
|
|
49
|
+
"@storybook/web-components-vite": "^8.6.14",
|
|
50
|
+
"@types/node": "^22.15.18",
|
|
51
|
+
"eslint": "^9.27.0",
|
|
52
|
+
"eslint-config-prettier": "^10.1.5",
|
|
53
|
+
"eslint-import-resolver-typescript": "^4.3.5",
|
|
54
|
+
"eslint-plugin-import": "^2.31.0",
|
|
55
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
56
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
57
|
+
"lit": "^3.3.0",
|
|
58
|
+
"prettier": "^3.5.3",
|
|
59
|
+
"sass": "^1.89.0",
|
|
60
|
+
"storybook": "^8.6.14",
|
|
61
|
+
"typescript": "^5.8.3",
|
|
62
|
+
"typescript-eslint": "^8.32.1",
|
|
63
|
+
"vite": "^6.3.5",
|
|
64
|
+
"vite-plugin-dts": "^4.5.4"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"lit": "^3.3.0"
|
|
68
|
+
},
|
|
69
|
+
"keywords": [
|
|
70
|
+
"lit",
|
|
71
|
+
"web-components",
|
|
72
|
+
"typescript",
|
|
73
|
+
"ui-library",
|
|
74
|
+
"vite"
|
|
75
|
+
],
|
|
76
|
+
"author": "Visma Software Nordic",
|
|
77
|
+
"repository": {
|
|
78
|
+
"type": "git",
|
|
79
|
+
"url": "git+https://github.com/visma-swno/vsn-assistant.git"
|
|
80
|
+
},
|
|
81
|
+
"homepage": "https://github.com/visma-swno/vsn-assistant#readme",
|
|
82
|
+
"bugs": {
|
|
83
|
+
"url": "https://github.com/visma-swno/vsn-assistant/issues"
|
|
84
|
+
}
|
|
85
|
+
}
|