@n8n/chat 0.5.2 → 0.6.1

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 (50) hide show
  1. package/README.md +6 -0
  2. package/chat.bundle.es.js +670 -677
  3. package/chat.bundle.umd.js +10 -10
  4. package/chat.es.js +6864 -0
  5. package/chat.umd.js +18 -0
  6. package/package.json +9 -40
  7. package/types/src/App.vue.d.ts +0 -8
  8. package/types/src/__stories__/App.stories.d.ts +0 -17
  9. package/types/src/__tests__/index.spec.d.ts +0 -1
  10. package/types/src/__tests__/setup.d.ts +0 -0
  11. package/types/src/__tests__/utils/create.d.ts +0 -5
  12. package/types/src/__tests__/utils/fetch.d.ts +0 -4
  13. package/types/src/__tests__/utils/index.d.ts +0 -3
  14. package/types/src/__tests__/utils/selectors.d.ts +0 -12
  15. package/types/src/api/generic.d.ts +0 -6
  16. package/types/src/api/index.d.ts +0 -2
  17. package/types/src/api/message.d.ts +0 -3
  18. package/types/src/components/Button.vue.d.ts +0 -9
  19. package/types/src/components/Chat.vue.d.ts +0 -2
  20. package/types/src/components/ChatWindow.vue.d.ts +0 -2
  21. package/types/src/components/GetStarted.vue.d.ts +0 -2
  22. package/types/src/components/GetStartedFooter.vue.d.ts +0 -2
  23. package/types/src/components/Input.vue.d.ts +0 -2
  24. package/types/src/components/Layout.vue.d.ts +0 -11
  25. package/types/src/components/Message.vue.d.ts +0 -21
  26. package/types/src/components/MessageTyping.vue.d.ts +0 -15
  27. package/types/src/components/MessagesList.vue.d.ts +0 -14
  28. package/types/src/components/PoweredBy.vue.d.ts +0 -2
  29. package/types/src/components/index.d.ts +0 -10
  30. package/types/src/composables/index.d.ts +0 -3
  31. package/types/src/composables/useChat.d.ts +0 -2
  32. package/types/src/composables/useI18n.d.ts +0 -4
  33. package/types/src/composables/useOptions.d.ts +0 -4
  34. package/types/src/constants/defaults.d.ts +0 -3
  35. package/types/src/constants/index.d.ts +0 -3
  36. package/types/src/constants/localStorage.d.ts +0 -2
  37. package/types/src/constants/symbols.d.ts +0 -4
  38. package/types/src/event-buses/chatEventBus.d.ts +0 -1
  39. package/types/src/event-buses/index.d.ts +0 -1
  40. package/types/src/index.d.ts +0 -2
  41. package/types/src/plugins/chat.d.ts +0 -3
  42. package/types/src/plugins/index.d.ts +0 -1
  43. package/types/src/types/chat.d.ts +0 -11
  44. package/types/src/types/index.d.ts +0 -4
  45. package/types/src/types/messages.d.ts +0 -6
  46. package/types/src/types/options.d.ts +0 -25
  47. package/types/src/types/webhook.d.ts +0 -15
  48. package/types/src/utils/event-bus.d.ts +0 -8
  49. package/types/src/utils/index.d.ts +0 -2
  50. package/types/src/utils/mount.d.ts +0 -1
@@ -1,9 +0,0 @@
1
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
2
- default?(_: {}): any;
3
- }>;
4
- export default _default;
5
- type __VLS_WithTemplateSlots<T, S> = T & {
6
- new (): {
7
- $slots: S;
8
- };
9
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- export default _default;
@@ -1,11 +0,0 @@
1
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
2
- header?(_: {}): any;
3
- default?(_: {}): any;
4
- footer?(_: {}): any;
5
- }>;
6
- export default _default;
7
- type __VLS_WithTemplateSlots<T, S> = T & {
8
- new (): {
9
- $slots: S;
10
- };
11
- };
@@ -1,21 +0,0 @@
1
- import type { ChatMessage } from '../types';
2
- import type { PropType } from 'vue';
3
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
4
- message: {
5
- type: PropType<ChatMessage>;
6
- required: true;
7
- };
8
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
9
- message: {
10
- type: PropType<ChatMessage>;
11
- required: true;
12
- };
13
- }>>, {}, {}>, {
14
- default?(_: {}): any;
15
- }>;
16
- export default _default;
17
- type __VLS_WithTemplateSlots<T, S> = T & {
18
- new (): {
19
- $slots: S;
20
- };
21
- };
@@ -1,15 +0,0 @@
1
- import type { PropType } from 'vue';
2
- declare const _default: import("vue").DefineComponent<{
3
- animation: {
4
- type: PropType<"bouncing" | "scaling">;
5
- default: string;
6
- };
7
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
8
- animation: {
9
- type: PropType<"bouncing" | "scaling">;
10
- default: string;
11
- };
12
- }>>, {
13
- animation: "bouncing" | "scaling";
14
- }, {}>;
15
- export default _default;
@@ -1,14 +0,0 @@
1
- import type { PropType } from 'vue';
2
- import type { ChatMessage } from '../types';
3
- declare const _default: import("vue").DefineComponent<{
4
- messages: {
5
- type: PropType<ChatMessage[]>;
6
- required: true;
7
- };
8
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
9
- messages: {
10
- type: PropType<ChatMessage[]>;
11
- required: true;
12
- };
13
- }>>, {}, {}>;
14
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- export default _default;
@@ -1,10 +0,0 @@
1
- export { default as Button } from './Button.vue';
2
- export { default as Chat } from './Chat.vue';
3
- export { default as ChatWindow } from './ChatWindow.vue';
4
- export { default as GetStarted } from './GetStarted.vue';
5
- export { default as GetStartedFooter } from './GetStartedFooter.vue';
6
- export { default as Input } from './Input.vue';
7
- export { default as Layout } from './Layout.vue';
8
- export { default as Message } from './Message.vue';
9
- export { default as MessagesList } from './MessagesList.vue';
10
- export { default as PoweredBy } from './PoweredBy.vue';
@@ -1,3 +0,0 @@
1
- export * from './useChat';
2
- export * from './useI18n';
3
- export * from './useOptions';
@@ -1,2 +0,0 @@
1
- import type { Chat } from '../types';
2
- export declare function useChat(): Chat;
@@ -1,4 +0,0 @@
1
- export declare function useI18n(): {
2
- t: (key: string) => string;
3
- te: (key: string) => boolean;
4
- };
@@ -1,4 +0,0 @@
1
- import type { ChatOptions } from '../types';
2
- export declare function useOptions(): {
3
- options: ChatOptions;
4
- };
@@ -1,3 +0,0 @@
1
- import type { ChatOptions } from '../types';
2
- export declare const defaultOptions: ChatOptions;
3
- export declare const defaultMountingTarget = "#n8n-chat";
@@ -1,3 +0,0 @@
1
- export * from './defaults';
2
- export * from './localStorage';
3
- export * from './symbols';
@@ -1,2 +0,0 @@
1
- export declare const localStorageNamespace = "n8n-chat";
2
- export declare const localStorageSessionIdKey = "n8n-chat/sessionId";
@@ -1,4 +0,0 @@
1
- import type { InjectionKey } from 'vue';
2
- import type { Chat, ChatOptions } from '../types';
3
- export declare const ChatSymbol: InjectionKey<Chat>;
4
- export declare const ChatOptionsSymbol: InjectionKey<ChatOptions>;
@@ -1 +0,0 @@
1
- export declare const chatEventBus: import('../utils').EventBus;
@@ -1 +0,0 @@
1
- export * from './chatEventBus';
@@ -1,2 +0,0 @@
1
- import type { ChatOptions } from './types';
2
- export declare function createChat(options?: Partial<ChatOptions>): import("vue").App<Element>;
@@ -1,3 +0,0 @@
1
- import type { Plugin } from 'vue';
2
- import type { ChatOptions } from '../types';
3
- export declare const ChatPlugin: Plugin<ChatOptions>;
@@ -1 +0,0 @@
1
- export * from './chat';
@@ -1,11 +0,0 @@
1
- import type { ChatMessage } from '../types/messages';
2
- import type { Ref } from 'vue';
3
- export interface Chat {
4
- initialMessages: Ref<ChatMessage[]>;
5
- messages: Ref<ChatMessage[]>;
6
- currentSessionId: Ref<string | null>;
7
- waitingForResponse: Ref<boolean>;
8
- loadPreviousSession: () => Promise<string | undefined>;
9
- startNewSession: () => Promise<void>;
10
- sendMessage: (text: string) => Promise<void>;
11
- }
@@ -1,4 +0,0 @@
1
- export * from './chat';
2
- export * from './messages';
3
- export * from './options';
4
- export * from './webhook';
@@ -1,6 +0,0 @@
1
- export interface ChatMessage {
2
- id: string;
3
- text: string;
4
- createdAt: string;
5
- sender: 'user' | 'bot';
6
- }
@@ -1,25 +0,0 @@
1
- export interface ChatOptions {
2
- webhookUrl: string;
3
- webhookConfig?: {
4
- method?: 'GET' | 'POST';
5
- headers?: Record<string, string>;
6
- };
7
- target?: string | Element;
8
- mode?: 'window' | 'fullscreen';
9
- showWelcomeScreen?: boolean;
10
- loadPreviousSession?: boolean;
11
- chatInputKey?: string;
12
- chatSessionKey?: string;
13
- defaultLanguage?: 'en';
14
- initialMessages?: string[];
15
- metadata?: Record<string, unknown>;
16
- i18n: Record<string, {
17
- title: string;
18
- subtitle: string;
19
- footer: string;
20
- getStarted: string;
21
- inputPlaceholder: string;
22
- [message: string]: string;
23
- }>;
24
- theme?: {};
25
- }
@@ -1,15 +0,0 @@
1
- export interface LoadPreviousSessionResponseItem {
2
- id: string[];
3
- kwargs: {
4
- content: string;
5
- additional_kwargs: Record<string, unknown>;
6
- };
7
- lc: number;
8
- type: string;
9
- }
10
- export interface LoadPreviousSessionResponse {
11
- data: LoadPreviousSessionResponseItem[];
12
- }
13
- export interface SendMessageResponse {
14
- output: string;
15
- }
@@ -1,8 +0,0 @@
1
- export type CallbackFn = Function;
2
- export type UnregisterFn = () => void;
3
- export interface EventBus {
4
- on: (eventName: string, fn: CallbackFn) => UnregisterFn;
5
- off: (eventName: string, fn: CallbackFn) => void;
6
- emit: <T = Event>(eventName: string, event?: T) => void;
7
- }
8
- export declare function createEventBus(): EventBus;
@@ -1,2 +0,0 @@
1
- export * from './event-bus';
2
- export * from './mount';
@@ -1 +0,0 @@
1
- export declare function createDefaultMountingTarget(mountingTarget: string): void;