cmcts-c-agent-embedding 1.0.7 → 1.0.8-cagent
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/.env +5 -36
- package/.env.example +34 -34
- package/.eslintrc.cjs +14 -14
- package/.prettierignore +3 -3
- package/.prettierrc +8 -8
- package/base.json +21 -21
- package/dist/components/Bot.d.ts +10 -0
- package/dist/components/Bot.d.ts.map +1 -1
- package/dist/components/FeedbackContentDialog.d.ts +3 -0
- package/dist/components/FeedbackContentDialog.d.ts.map +1 -1
- package/dist/components/Toast.d.ts +10 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/bubbles/BotBubble.d.ts +5 -0
- package/dist/components/bubbles/BotBubble.d.ts.map +1 -1
- package/dist/components/bubbles/GuestBubble.d.ts.map +1 -1
- package/dist/components/bubbles/LoadingBubble.d.ts +7 -1
- package/dist/components/bubbles/LoadingBubble.d.ts.map +1 -1
- package/dist/components/bubbles/SourceBubble.d.ts.map +1 -1
- package/dist/components/bubbles/StarterPromptBubble.d.ts.map +1 -1
- package/dist/components/buttons/CopyMessageButton.d.ts +10 -0
- package/dist/components/buttons/CopyMessageButton.d.ts.map +1 -0
- package/dist/components/buttons/EditMessageButton.d.ts +8 -0
- package/dist/components/buttons/EditMessageButton.d.ts.map +1 -0
- package/dist/components/buttons/FeedbackButtons.d.ts +1 -0
- package/dist/components/buttons/FeedbackButtons.d.ts.map +1 -1
- package/dist/components/buttons/PopupToast.d.ts +7 -0
- package/dist/components/buttons/PopupToast.d.ts.map +1 -0
- package/dist/components/buttons/SendButton.d.ts +1 -0
- package/dist/components/buttons/SendButton.d.ts.map +1 -1
- package/dist/components/dialogs/EditMessageDialog.d.ts +9 -0
- package/dist/components/dialogs/EditMessageDialog.d.ts.map +1 -0
- package/dist/components/icons/AddImageIcon.d.ts.map +1 -1
- package/dist/components/icons/CheckIcon.d.ts +3 -0
- package/dist/components/icons/CheckIcon.d.ts.map +1 -0
- package/dist/components/icons/CmcIcon.d.ts +3 -0
- package/dist/components/icons/CmcIcon.d.ts.map +1 -0
- package/dist/components/icons/CopyIcon.d.ts +5 -0
- package/dist/components/icons/CopyIcon.d.ts.map +1 -0
- package/dist/components/icons/EditIcon.d.ts +5 -0
- package/dist/components/icons/EditIcon.d.ts.map +1 -0
- package/dist/components/icons/FullScreenIcon.d.ts +3 -0
- package/dist/components/icons/FullScreenIcon.d.ts.map +1 -0
- package/dist/components/icons/ResetBtn.d.ts +3 -0
- package/dist/components/icons/ResetBtn.d.ts.map +1 -0
- package/dist/components/icons/SendIconOff.d.ts +3 -0
- package/dist/components/icons/SendIconOff.d.ts.map +1 -0
- package/dist/components/icons/SendIconOn.d.ts +3 -0
- package/dist/components/icons/SendIconOn.d.ts.map +1 -0
- package/dist/components/icons/ThumbsDownIcon.d.ts +3 -1
- package/dist/components/icons/ThumbsDownIcon.d.ts.map +1 -1
- package/dist/components/icons/ThumbsUpIcon.d.ts +3 -1
- package/dist/components/icons/ThumbsUpIcon.d.ts.map +1 -1
- package/dist/components/icons/index.d.ts +4 -0
- package/dist/components/icons/index.d.ts.map +1 -1
- package/dist/components/image/PreviewImage.d.ts +5 -0
- package/dist/components/image/PreviewImage.d.ts.map +1 -0
- package/dist/components/inputs/textInput/components/ShortTextInput.d.ts +3 -0
- package/dist/components/inputs/textInput/components/ShortTextInput.d.ts.map +1 -1
- package/dist/components/inputs/textInput/components/TextInput.d.ts +19 -3
- package/dist/components/inputs/textInput/components/TextInput.d.ts.map +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/features/bubble/components/Bubble.d.ts.map +1 -1
- package/dist/features/bubble/types.d.ts +1 -0
- package/dist/features/bubble/types.d.ts.map +1 -1
- package/dist/features/full/components/Full.d.ts.map +1 -1
- package/dist/features/popup/components/Popup.d.ts.map +1 -1
- package/dist/queries/sendMessageQuery.d.ts +47 -1
- package/dist/queries/sendMessageQuery.d.ts.map +1 -1
- package/dist/test/ScrollTest.d.ts +6 -0
- package/dist/test/ScrollTest.d.ts.map +1 -0
- package/dist/test/integrateBotScrollTest.d.ts +74 -0
- package/dist/test/integrateBotScrollTest.d.ts.map +1 -0
- package/dist/utils/googleAnalytics.d.ts +194 -0
- package/dist/utils/googleAnalytics.d.ts.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/scrollTestUtils.d.ts +130 -0
- package/dist/utils/scrollTestUtils.d.ts.map +1 -0
- package/dist/utils/security.d.ts +60 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.test.d.ts +6 -0
- package/dist/utils/security.test.d.ts.map +1 -0
- package/dist/utils/ultimateJsonParser.d.ts +2 -0
- package/dist/utils/ultimateJsonParser.d.ts.map +1 -0
- package/dist/web.d.ts +4 -0
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +1 -1
- package/dist/window.d.ts +2 -0
- package/dist/window.d.ts.map +1 -1
- package/package.json +81 -79
- package/public/index.html +154 -155
- package/.husky/pre-commit +0 -18
- package/.idea/Flowise-share-chatbox.iml +0 -13
- package/.idea/codeStyles/Project.xml +0 -60
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -16
- package/.idea/modules.xml +0 -9
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -7
- package/a.json +0 -57
- package/bun.lockb +0 -0
- package/dist/BubbleChat.d.ts +0 -13
- package/dist/BubbleChat.d.ts.map +0 -1
- package/dist/FullPageChat.d.ts +0 -18
- package/dist/FullPageChat.d.ts.map +0 -1
- package/dist/components/ImageUploadButton.d.ts +0 -11
- package/dist/components/ImageUploadButton.d.ts.map +0 -1
- package/dist/components/RecordAudioButton.d.ts +0 -11
- package/dist/components/RecordAudioButton.d.ts.map +0 -1
- package/dist/components/SendButton.d.ts +0 -12
- package/dist/components/SendButton.d.ts.map +0 -1
- package/dist/index.js +0 -1
- package/test.html +0 -17
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security utilities for XSS prevention and URL validation
|
|
3
|
+
* Provides centralized functions for safe URL handling and input sanitization
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Validates if a URL is safe to use (only allows http and https protocols)
|
|
7
|
+
* Prevents javascript: and other dangerous URL schemes
|
|
8
|
+
*/
|
|
9
|
+
export declare const isValidUrl: (url: string) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Safely encodes URL parameters to prevent injection attacks
|
|
12
|
+
* Encodes special characters that could be used for URL manipulation
|
|
13
|
+
*/
|
|
14
|
+
export declare const safeEncodeURIComponent: (str: string) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Sanitizes file names for safe URL construction
|
|
17
|
+
* Removes or encodes dangerous characters that could be used for path traversal
|
|
18
|
+
*/
|
|
19
|
+
export declare const sanitizeFileName: (fileName: string) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Builds a safe file URL with proper parameter encoding
|
|
22
|
+
* Ensures all URL parameters are properly encoded to prevent injection
|
|
23
|
+
*/
|
|
24
|
+
export declare const buildSafeFileUrl: (apiHost: string, chatflowId: string, chatId: string, fileName: string) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Validates and sanitizes external URLs from user input
|
|
27
|
+
* Returns null if URL is invalid or dangerous
|
|
28
|
+
*/
|
|
29
|
+
export declare const validateExternalUrl: (url: string) => string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Sanitizes CSS content to prevent CSS injection attacks
|
|
32
|
+
* Removes dangerous CSS properties and values that could be used for attacks
|
|
33
|
+
*/
|
|
34
|
+
export declare const sanitizeCSS: (css: string) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Validates phone numbers with timeout protection against ReDoS attacks
|
|
37
|
+
* Uses a simple, efficient pattern that prevents catastrophic backtracking
|
|
38
|
+
*/
|
|
39
|
+
export declare const validatePhoneNumber: (phone: string) => boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Validates and sanitizes string inputs with length and content restrictions
|
|
42
|
+
* Prevents injection attacks and ensures data integrity
|
|
43
|
+
*/
|
|
44
|
+
export declare const validateStringInput: (input: unknown, maxLength?: number, allowedChars?: RegExp) => string | null;
|
|
45
|
+
/**
|
|
46
|
+
* Validates numeric inputs with range constraints
|
|
47
|
+
* Ensures numbers are within safe bounds and prevents NaN/Infinity
|
|
48
|
+
*/
|
|
49
|
+
export declare const validateNumericInput: (input: unknown, min?: number, max?: number) => number | null;
|
|
50
|
+
/**
|
|
51
|
+
* Validates boolean inputs and converts string representations
|
|
52
|
+
* Safely handles various boolean representations
|
|
53
|
+
*/
|
|
54
|
+
export declare const validateBooleanInput: (input: unknown) => boolean | null;
|
|
55
|
+
/**
|
|
56
|
+
* Validates color values (hex, rgb, rgba, named colors)
|
|
57
|
+
* Prevents CSS injection through color values
|
|
58
|
+
*/
|
|
59
|
+
export declare const validateColorInput: (input: unknown) => string | null;
|
|
60
|
+
//# sourceMappingURL=security.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/utils/security.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,OAOxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAAS,MAAM,KAAG,MAIpD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,aAAc,MAAM,KAAG,MAInD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,YAAa,MAAM,cAAc,MAAM,UAAU,MAAM,YAAY,MAAM,KAAG,MAQxG,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MAAM,GAAG,IAW1D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,QAAS,MAAM,KAAG,MA6HzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UAAW,MAAM,KAAG,OAkBnD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UAAW,OAAO,cAAa,MAAM,iBAAwB,MAAM,KAAG,MAAM,GAAG,IAkC9G,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,UAAW,OAAO,QAAQ,MAAM,QAAQ,MAAM,KAAG,MAAM,GAAG,IAyB1F,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,UAAW,OAAO,KAAG,OAAO,GAAG,IAqB/D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,UAAW,OAAO,KAAG,MAAM,GAAG,IAyB5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.test.d.ts","sourceRoot":"","sources":["../../src/utils/security.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqFH,eAAO,MAAM,gBAAgB,YAI5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ultimateJsonParser.d.ts","sourceRoot":"","sources":["../../src/utils/ultimateJsonParser.ts"],"names":[],"mappings":"AAsBA,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAgDzD"}
|
package/dist/web.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ declare const chatbot: {
|
|
|
8
8
|
theme?: import("./features/bubble/types").BubbleTheme | undefined;
|
|
9
9
|
chatwootUrl?: string | undefined;
|
|
10
10
|
roomIds?: Record<string, string> | undefined;
|
|
11
|
+
isUseFAQ?: boolean | undefined;
|
|
12
|
+
onResetChat?: (() => Promise<void>) | undefined;
|
|
11
13
|
} & {
|
|
12
14
|
id?: string | undefined;
|
|
13
15
|
}) => void;
|
|
@@ -20,6 +22,8 @@ declare const chatbot: {
|
|
|
20
22
|
theme?: import("./features/bubble/types").BubbleTheme | undefined;
|
|
21
23
|
chatwootUrl?: string | undefined;
|
|
22
24
|
roomIds?: Record<string, string> | undefined;
|
|
25
|
+
isUseFAQ?: boolean | undefined;
|
|
26
|
+
onResetChat?: (() => Promise<void>) | undefined;
|
|
23
27
|
}) => void;
|
|
24
28
|
destroy: () => void;
|
|
25
29
|
};
|
package/dist/web.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAiB,CAAC;AAI/B,eAAe,OAAO,CAAC"}
|