@developer_tribe/react-native-comnyx 0.14.0 → 0.16.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/Comnyx.podspec +10 -2
- package/README.md +50 -0
- package/android/build.gradle +1 -0
- package/android/consumer-rules.pro +23 -0
- package/android/generated/java/com/comnyx/NativeComnyxSpec.java +46 -0
- package/android/generated/jni/RNComnyxSpec-generated.cpp +23 -1
- package/android/generated/jni/RNComnyxSpec.h +7 -0
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +21 -0
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +70 -0
- package/android/src/main/AndroidManifest.xml +11 -1
- package/android/src/main/AndroidManifestNew.xml +11 -1
- package/android/src/main/java/com/comnyx/ComnyxMediaPickerModule.kt +105 -19
- package/android/src/main/java/com/comnyx/ComnyxModule.kt +7 -0
- package/android/src/main/java/com/comnyx/src/messaging/firebase/FirebaseMessagingService.kt +4 -6
- package/android/src/main/res/xml/comnyx_file_paths.xml +12 -0
- package/ios/APNService.swift +9 -9
- package/ios/Comnyx.swift +17 -8
- package/ios/ComnyxMediaPicker.m +6 -0
- package/ios/ComnyxMediaPicker.swift +106 -26
- package/ios/ComnyxMessaging.swift +2 -0
- package/ios/PrivacyInfo.xcprivacy +32 -0
- package/ios/comnyx_post_install.rb +25 -0
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RNComnyxSpec/RNComnyxSpec-generated.mm +53 -0
- package/ios/generated/RNComnyxSpec/RNComnyxSpec.h +67 -0
- package/ios/generated/RNComnyxSpecJSI-generated.cpp +38 -0
- package/ios/generated/RNComnyxSpecJSI.h +89 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/commonjs/NativeComnyxMediaPicker.js +46 -6
- package/lib/commonjs/NativeComnyxMediaPicker.js.map +1 -1
- package/lib/commonjs/api/conversations.js +6 -6
- package/lib/commonjs/api/conversations.js.map +1 -1
- package/lib/commonjs/api/customers.js +3 -2
- package/lib/commonjs/api/customers.js.map +1 -1
- package/lib/commonjs/api/media.js +20 -6
- package/lib/commonjs/api/media.js.map +1 -1
- package/lib/commonjs/api/messages.js +3 -2
- package/lib/commonjs/api/messages.js.map +1 -1
- package/lib/commonjs/assets/gallery.png +0 -0
- package/lib/commonjs/assets/video-play.png +0 -0
- package/lib/commonjs/components/ChatList.js +93 -45
- package/lib/commonjs/components/ChatList.js.map +1 -1
- package/lib/commonjs/components/ComnyxErrorBoundary.js +92 -0
- package/lib/commonjs/components/ComnyxErrorBoundary.js.map +1 -0
- package/lib/commonjs/components/CustomerForm.js +2 -2
- package/lib/commonjs/components/CustomerForm.js.map +1 -1
- package/lib/commonjs/components/MediaMessageItem.js +4 -3
- package/lib/commonjs/components/MediaMessageItem.js.map +1 -1
- package/lib/commonjs/components/MediaPickerButton.js +211 -14
- package/lib/commonjs/components/MediaPickerButton.js.map +1 -1
- package/lib/commonjs/components/MediaViewerModal.js +7 -0
- package/lib/commonjs/components/MediaViewerModal.js.map +1 -1
- package/lib/commonjs/components/MessageInput.js +63 -13
- package/lib/commonjs/components/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageItem.js +1 -2
- package/lib/commonjs/components/MessageItem.js.map +1 -1
- package/lib/commonjs/constants/translations.js +87 -116
- package/lib/commonjs/constants/translations.js.map +1 -1
- package/lib/commonjs/hooks/usePolling.js +25 -21
- package/lib/commonjs/hooks/usePolling.js.map +1 -1
- package/lib/commonjs/hooks/useThemeColors.js +12 -1
- package/lib/commonjs/hooks/useThemeColors.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notifications/initializeNotifications.js +19 -16
- package/lib/commonjs/notifications/initializeNotifications.js.map +1 -1
- package/lib/commonjs/register/Accumulator.js +19 -6
- package/lib/commonjs/register/Accumulator.js.map +1 -1
- package/lib/commonjs/register/collectData.js +1 -1
- package/lib/commonjs/register/collectData.js.map +1 -1
- package/lib/commonjs/store/store.js +6 -0
- package/lib/commonjs/store/store.js.map +1 -1
- package/lib/commonjs/support/ComnyxSupport.js +60 -15
- package/lib/commonjs/support/ComnyxSupport.js.map +1 -1
- package/lib/commonjs/support/SupportConfigContext.js +24 -0
- package/lib/commonjs/support/SupportConfigContext.js.map +1 -0
- package/lib/commonjs/types/Theme.js +30 -2
- package/lib/commonjs/types/Theme.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/NativeComnyxMediaPicker.js +43 -6
- package/lib/module/NativeComnyxMediaPicker.js.map +1 -1
- package/lib/module/api/conversations.js +6 -6
- package/lib/module/api/conversations.js.map +1 -1
- package/lib/module/api/customers.js +3 -2
- package/lib/module/api/customers.js.map +1 -1
- package/lib/module/api/media.js +21 -6
- package/lib/module/api/media.js.map +1 -1
- package/lib/module/api/messages.js +3 -2
- package/lib/module/api/messages.js.map +1 -1
- package/lib/module/assets/gallery.png +0 -0
- package/lib/module/assets/video-play.png +0 -0
- package/lib/module/components/ChatList.js +94 -46
- package/lib/module/components/ChatList.js.map +1 -1
- package/lib/module/components/ComnyxErrorBoundary.js +87 -0
- package/lib/module/components/ComnyxErrorBoundary.js.map +1 -0
- package/lib/module/components/CustomerForm.js +2 -2
- package/lib/module/components/CustomerForm.js.map +1 -1
- package/lib/module/components/MediaMessageItem.js +4 -3
- package/lib/module/components/MediaMessageItem.js.map +1 -1
- package/lib/module/components/MediaPickerButton.js +215 -18
- package/lib/module/components/MediaPickerButton.js.map +1 -1
- package/lib/module/components/MediaViewerModal.js +8 -1
- package/lib/module/components/MediaViewerModal.js.map +1 -1
- package/lib/module/components/MessageInput.js +64 -14
- package/lib/module/components/MessageInput.js.map +1 -1
- package/lib/module/components/MessageItem.js +1 -2
- package/lib/module/components/MessageItem.js.map +1 -1
- package/lib/module/constants/translations.js +87 -116
- package/lib/module/constants/translations.js.map +1 -1
- package/lib/module/hooks/usePolling.js +25 -21
- package/lib/module/hooks/usePolling.js.map +1 -1
- package/lib/module/hooks/useThemeColors.js +13 -2
- package/lib/module/hooks/useThemeColors.js.map +1 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/notifications/initializeNotifications.js +19 -16
- package/lib/module/notifications/initializeNotifications.js.map +1 -1
- package/lib/module/register/Accumulator.js +19 -6
- package/lib/module/register/Accumulator.js.map +1 -1
- package/lib/module/register/collectData.js +1 -1
- package/lib/module/register/collectData.js.map +1 -1
- package/lib/module/store/store.js +6 -0
- package/lib/module/store/store.js.map +1 -1
- package/lib/module/support/ComnyxSupport.js +61 -16
- package/lib/module/support/ComnyxSupport.js.map +1 -1
- package/lib/module/support/SupportConfigContext.js +19 -0
- package/lib/module/support/SupportConfigContext.js.map +1 -0
- package/lib/module/types/Theme.js +30 -2
- package/lib/module/types/Theme.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/src/NativeComnyxMediaPicker.d.ts +11 -0
- package/lib/typescript/src/NativeComnyxMediaPicker.d.ts.map +1 -1
- package/lib/typescript/src/api/conversations.d.ts +2 -2
- package/lib/typescript/src/api/conversations.d.ts.map +1 -1
- package/lib/typescript/src/api/customers.d.ts +1 -1
- package/lib/typescript/src/api/customers.d.ts.map +1 -1
- package/lib/typescript/src/api/media.d.ts +3 -3
- package/lib/typescript/src/api/media.d.ts.map +1 -1
- package/lib/typescript/src/api/messages.d.ts +1 -1
- package/lib/typescript/src/api/messages.d.ts.map +1 -1
- package/lib/typescript/src/components/ChatList.d.ts.map +1 -1
- package/lib/typescript/src/components/ComnyxErrorBoundary.d.ts +18 -0
- package/lib/typescript/src/components/ComnyxErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/src/components/MediaMessageItem.d.ts.map +1 -1
- package/lib/typescript/src/components/MediaPickerButton.d.ts.map +1 -1
- package/lib/typescript/src/components/MediaViewerModal.d.ts.map +1 -1
- package/lib/typescript/src/components/MessageInput.d.ts.map +1 -1
- package/lib/typescript/src/components/MessageItem.d.ts.map +1 -1
- package/lib/typescript/src/constants/translations.d.ts.map +1 -1
- package/lib/typescript/src/hooks/usePolling.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useThemeColors.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/notifications/initializeNotifications.d.ts.map +1 -1
- package/lib/typescript/src/register/Accumulator.d.ts.map +1 -1
- package/lib/typescript/src/register/collectData.d.ts +4 -1
- package/lib/typescript/src/register/collectData.d.ts.map +1 -1
- package/lib/typescript/src/store/store.d.ts +6 -2
- package/lib/typescript/src/store/store.d.ts.map +1 -1
- package/lib/typescript/src/support/ComnyxSupport.d.ts +56 -2
- package/lib/typescript/src/support/ComnyxSupport.d.ts.map +1 -1
- package/lib/typescript/src/support/SupportConfigContext.d.ts +58 -0
- package/lib/typescript/src/support/SupportConfigContext.d.ts.map +1 -0
- package/lib/typescript/src/support/index.d.ts +1 -0
- package/lib/typescript/src/support/index.d.ts.map +1 -1
- package/lib/typescript/src/types/Conversation.d.ts +2 -2
- package/lib/typescript/src/types/Conversation.d.ts.map +1 -1
- package/lib/typescript/src/types/Customer.d.ts +1 -1
- package/lib/typescript/src/types/Customer.d.ts.map +1 -1
- package/lib/typescript/src/types/LocalizationKeys.d.ts +0 -1
- package/lib/typescript/src/types/LocalizationKeys.d.ts.map +1 -1
- package/lib/typescript/src/types/MessageResponse.d.ts +7 -4
- package/lib/typescript/src/types/MessageResponse.d.ts.map +1 -1
- package/lib/typescript/src/types/Theme.d.ts +26 -0
- package/lib/typescript/src/types/Theme.d.ts.map +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +12 -25
- package/src/NativeComnyxMediaPicker.ts +46 -7
- package/src/api/conversations.ts +6 -4
- package/src/api/customers.ts +3 -1
- package/src/api/media.ts +32 -10
- package/src/api/messages.ts +3 -1
- package/src/assets/gallery.png +0 -0
- package/src/assets/video-play.png +0 -0
- package/src/components/ChatList.tsx +115 -55
- package/src/components/ComnyxErrorBoundary.tsx +91 -0
- package/src/components/CustomerForm.tsx +2 -2
- package/src/components/MediaMessageItem.tsx +10 -3
- package/src/components/MediaPickerButton.tsx +238 -17
- package/src/components/MediaViewerModal.tsx +8 -1
- package/src/components/MessageInput.tsx +89 -16
- package/src/components/MessageItem.tsx +12 -14
- package/src/constants/translations.ts +87 -116
- package/src/hooks/usePolling.ts +21 -11
- package/src/hooks/useThemeColors.ts +11 -2
- package/src/index.ts +12 -0
- package/src/notifications/initializeNotifications.ts +22 -20
- package/src/register/Accumulator.ts +26 -9
- package/src/register/collectData.ts +10 -2
- package/src/store/store.ts +11 -3
- package/src/support/ComnyxSupport.tsx +128 -22
- package/src/support/SupportConfigContext.tsx +79 -0
- package/src/support/index.ts +7 -0
- package/src/types/Conversation.ts +2 -2
- package/src/types/Customer.ts +1 -2
- package/src/types/LocalizationKeys.ts +0 -1
- package/src/types/MessageResponse.ts +4 -4
- package/src/types/Theme.ts +38 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { AppConversationMessage } from '../types/Conversation';
|
|
3
|
+
export interface SupportHeaderRenderProps {
|
|
4
|
+
/** Invoke to close the support screen — same callback passed to `onBack`. */
|
|
5
|
+
onBack?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface SupportErrorRenderProps {
|
|
8
|
+
/** Trigger a retry. Safe to call multiple times. */
|
|
9
|
+
retry: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface SupportMessageRenderProps {
|
|
12
|
+
message: AppConversationMessage;
|
|
13
|
+
/** The built-in bubble node — render it as-is, wrap it, or ignore it. */
|
|
14
|
+
defaultNode: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export interface SupportSendPayload {
|
|
17
|
+
/** Plain text content the user is sending. Empty when only media is attached. */
|
|
18
|
+
content: string;
|
|
19
|
+
/** Number of media attachments. 0 for text-only messages. */
|
|
20
|
+
mediaCount: number;
|
|
21
|
+
/** Types of the attached media. Empty for text-only messages. */
|
|
22
|
+
mediaTypes: Array<'image' | 'video'>;
|
|
23
|
+
}
|
|
24
|
+
export interface SupportConfig {
|
|
25
|
+
/**
|
|
26
|
+
* Replace the built-in top header (close button + "Support team / Live" row).
|
|
27
|
+
* Return any React node; returning `null` hides the header entirely.
|
|
28
|
+
*/
|
|
29
|
+
renderHeader?: (props: SupportHeaderRenderProps) => ReactNode;
|
|
30
|
+
/** Replace the built-in empty-state card shown when there are no messages. */
|
|
31
|
+
renderEmptyState?: () => ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Replace the built-in init-failed screen. The `retry` callback re-runs the
|
|
34
|
+
* first-page fetch.
|
|
35
|
+
*/
|
|
36
|
+
renderErrorState?: (props: SupportErrorRenderProps) => ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Replace or wrap individual message bubbles. `defaultNode` is the
|
|
39
|
+
* built-in `<MessageItem />` — return it for no change, wrap it to add
|
|
40
|
+
* decorations (reactions, swipe actions), or substitute a fully custom
|
|
41
|
+
* bubble.
|
|
42
|
+
*/
|
|
43
|
+
renderMessage?: (props: SupportMessageRenderProps) => ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* Called immediately before a message is dispatched to the backend. Throw
|
|
46
|
+
* (or reject the returned promise) to cancel the send — the user's input
|
|
47
|
+
* and any pending media are preserved and the UI re-enables.
|
|
48
|
+
*
|
|
49
|
+
* Use for analytics, rate limiting, moderation, or injecting extra context.
|
|
50
|
+
*/
|
|
51
|
+
onBeforeSend?: (payload: SupportSendPayload) => void | Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
export declare function SupportConfigProvider({ value, children, }: {
|
|
54
|
+
value: SupportConfig;
|
|
55
|
+
children: ReactNode;
|
|
56
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export declare function useSupportConfig(): SupportConfig;
|
|
58
|
+
//# sourceMappingURL=SupportConfigContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupportConfigContext.d.ts","sourceRoot":"","sources":["../../../../src/support/SupportConfigContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,MAAM,WAAW,wBAAwB;IACvC,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,oDAAoD;IACpD,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,sBAAsB,CAAC;IAChC,yEAAyE;IACzE,WAAW,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,UAAU,EAAE,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,SAAS,CAAC;IAC9D,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,SAAS,CAAC;IACnC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,SAAS,CAAC;IACjE;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,SAAS,CAAC;IAChE;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtE;AAMD,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAMA;AAED,wBAAgB,gBAAgB,IAAI,aAAa,CAEhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/support/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/support/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Conversation.d.ts","sourceRoot":"","sources":["../../../../src/types/Conversation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"Conversation.d.ts","sourceRoot":"","sources":["../../../../src/types/Conversation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtB,GAAG,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;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ACb,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,gBAAgB,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Customer.d.ts","sourceRoot":"","sources":["../../../../src/types/Customer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Customer.d.ts","sourceRoot":"","sources":["../../../../src/types/Customer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,8BAA8B;IAC7C,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,8BAA8B,CAAC;CAC5C;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB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;IAC3B,2BAA2B,EAAE,MAAM,CAAC;IACpC,gCAAgC,EAAE,MAAM,CAAC;IACzC,4BAA4B,EAAE,MAAM,CAAC;IACrC,iCAAiC,EAAE,MAAM,CAAC;IAC1C,4BAA4B,EAAE,MAAM,CAAC;IACrC,iCAAiC,EAAE,MAAM,CAAC;IAC1C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,2BAA2B,EAAE,MAAM,CAAC;IACpC,iCAAiC,EAAE,MAAM,CAAC;IAC1C,4BAA4B,EAAE,MAAM,CAAC;IACrC,kCAAkC,EAAE,MAAM,CAAC;IAC3C,qCAAqC,EAAE,MAAM,CAAC;IAC9C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,0BAA0B,EAAE,MAAM,CAAC;IACnC,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;CACjC,CAAC"}
|
|
@@ -6,9 +6,12 @@ export interface MessageResponse {
|
|
|
6
6
|
updated_at: string;
|
|
7
7
|
created_at: string;
|
|
8
8
|
id: number;
|
|
9
|
-
user: null |
|
|
10
|
-
customer: null |
|
|
11
|
-
|
|
9
|
+
user: null | unknown;
|
|
10
|
+
customer: null | {
|
|
11
|
+
name: string;
|
|
12
|
+
profile_photo_url: null;
|
|
13
|
+
};
|
|
14
|
+
bot: null | unknown;
|
|
12
15
|
conversation: {
|
|
13
16
|
id: number;
|
|
14
17
|
project_id: number;
|
|
@@ -55,7 +58,7 @@ export interface MessageResponse {
|
|
|
55
58
|
};
|
|
56
59
|
};
|
|
57
60
|
};
|
|
58
|
-
events:
|
|
61
|
+
events: unknown[];
|
|
59
62
|
};
|
|
60
63
|
}
|
|
61
64
|
//# sourceMappingURL=MessageResponse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageResponse.d.ts","sourceRoot":"","sources":["../../../../src/types/MessageResponse.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE;QACP,eAAe,EAAE,MAAM,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,IAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"MessageResponse.d.ts","sourceRoot":"","sources":["../../../../src/types/MessageResponse.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE;QACP,eAAe,EAAE,MAAM,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;QACrB,QAAQ,EAAE,IAAI,GAAG;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,iBAAiB,EAAE,IAAI,CAAA;SAAE,CAAC;QAC3D,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC;QACpB,YAAY,EAAE;YACZ,EAAE,EAAE,MAAM,CAAC;YACX,UAAU,EAAE,MAAM,CAAC;YACnB,WAAW,EAAE,MAAM,CAAC;YACpB,UAAU,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;YAC1B,QAAQ,EAAE,MAAM,CAAC;YACjB,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE;gBACP,EAAE,EAAE,MAAM,CAAC;gBACX,IAAI,EAAE,MAAM,CAAC;gBACb,eAAe,EAAE,MAAM,CAAC;gBACxB,UAAU,EAAE,MAAM,CAAC;gBACnB,UAAU,EAAE,MAAM,CAAC;gBACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;gBAC1B,IAAI,EAAE,MAAM,CAAC;gBACb,YAAY,EAAE;oBACZ,EAAE,EAAE,MAAM,CAAC;oBACX,IAAI,EAAE,MAAM,CAAC;oBACb,UAAU,EAAE,MAAM,CAAC;oBACnB,UAAU,EAAE,MAAM,CAAC;oBACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;oBAC1B,KAAK,EAAE,KAAK,CAAC;wBACX,EAAE,EAAE,MAAM,CAAC;wBACX,IAAI,EAAE,MAAM,CAAC;wBACb,KAAK,EAAE,MAAM,CAAC;wBACd,iBAAiB,EAAE,IAAI,GAAG,MAAM,CAAC;wBACjC,UAAU,EAAE,MAAM,CAAC;wBACnB,UAAU,EAAE,MAAM,CAAC;wBACnB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;wBACtB,iBAAiB,EAAE,IAAI,GAAG,MAAM,CAAC;wBACjC,yBAAyB,EAAE,IAAI,GAAG,MAAM,CAAC;wBACzC,MAAM,EAAE,OAAO,CAAC;wBAChB,iBAAiB,EAAE,MAAM,CAAC;wBAC1B,KAAK,EAAE;4BACL,eAAe,EAAE,MAAM,CAAC;4BACxB,OAAO,EAAE,MAAM,CAAC;4BAChB,IAAI,EAAE,MAAM,CAAC;4BACb,UAAU,EAAE,MAAM,CAAC;4BACnB,UAAU,EAAE,MAAM,CAAC;yBACpB,CAAC;qBACH,CAAC,CAAC;iBACJ,CAAC;aACH,CAAC;SACH,CAAC;QACF,MAAM,EAAE,OAAO,EAAE,CAAC;KACnB,CAAC;CACH"}
|
|
@@ -18,6 +18,11 @@ export interface ThemeColors {
|
|
|
18
18
|
navy: string;
|
|
19
19
|
lavender: string;
|
|
20
20
|
silver: string;
|
|
21
|
+
link: string;
|
|
22
|
+
toastBackground: string;
|
|
23
|
+
toastText: string;
|
|
24
|
+
playIcon: string;
|
|
25
|
+
videoPlaceholder: string;
|
|
21
26
|
}
|
|
22
27
|
export declare const lightTheme: ThemeColors;
|
|
23
28
|
export declare const darkTheme: ThemeColors;
|
|
@@ -25,4 +30,25 @@ export interface Theme {
|
|
|
25
30
|
light: ThemeColors;
|
|
26
31
|
dark: ThemeColors;
|
|
27
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Partial override for a single theme mode. Consumers can change one or more
|
|
35
|
+
* tokens without redeclaring the whole palette.
|
|
36
|
+
*/
|
|
37
|
+
export type ThemeColorsOverride = Partial<ThemeColors>;
|
|
38
|
+
/**
|
|
39
|
+
* Full override map accepted by `ComnyxSupport.themeOverride`. Any token not
|
|
40
|
+
* provided falls back to the built-in light/dark palette.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* <ComnyxSupport
|
|
44
|
+
* themeOverride={{
|
|
45
|
+
* light: { primary: '#FF6B6B', link: '#FF9999' },
|
|
46
|
+
* dark: { primary: '#FF9999' },
|
|
47
|
+
* }}
|
|
48
|
+
* />
|
|
49
|
+
*/
|
|
50
|
+
export interface ThemeOverrideConfig {
|
|
51
|
+
light?: ThemeColorsOverride;
|
|
52
|
+
dark?: ThemeColorsOverride;
|
|
53
|
+
}
|
|
28
54
|
//# sourceMappingURL=Theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../../src/types/Theme.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CA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G,OAAO,CAAC,WAAW,CAAC,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC5B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.16.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@developer_tribe/react-native-comnyx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "React Native chat component with integrated support panel, enabling real-time customer communication and efficient agent workflow management.",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -8,27 +8,23 @@
|
|
|
8
8
|
"types": "./lib/typescript/src/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"require": {
|
|
16
|
-
"types": "./lib/typescript/src/index.d.ts",
|
|
17
|
-
"default": "./lib/commonjs/index.js"
|
|
18
|
-
}
|
|
11
|
+
"source": "./src/index.ts",
|
|
12
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
13
|
+
"import": "./lib/module/index.js",
|
|
14
|
+
"require": "./lib/commonjs/index.js"
|
|
19
15
|
}
|
|
20
16
|
},
|
|
21
17
|
"files": [
|
|
22
18
|
"src",
|
|
23
19
|
"lib",
|
|
24
20
|
"android",
|
|
21
|
+
"android/consumer-rules.pro",
|
|
25
22
|
"ios",
|
|
26
23
|
"cpp",
|
|
27
24
|
"*.podspec",
|
|
28
25
|
"react-native.config.js",
|
|
29
26
|
"!node_modules",
|
|
30
27
|
"!example",
|
|
31
|
-
"!example820",
|
|
32
28
|
"!server-scripts",
|
|
33
29
|
"!ios/build",
|
|
34
30
|
"!android/build",
|
|
@@ -76,7 +72,7 @@
|
|
|
76
72
|
"@release-it/conventional-changelog": "^9.0.2",
|
|
77
73
|
"@testing-library/react-native": "^13.2.0",
|
|
78
74
|
"@types/jest": "^29.5.5",
|
|
79
|
-
"@types/react": "^
|
|
75
|
+
"@types/react": "^19.2.0",
|
|
80
76
|
"axios": "1.10.0",
|
|
81
77
|
"commitlint": "^19.6.1",
|
|
82
78
|
"del-cli": "^5.1.0",
|
|
@@ -93,30 +89,21 @@
|
|
|
93
89
|
"use-sync-external-store": "^1.5.0",
|
|
94
90
|
"zustand": "^5.0.3",
|
|
95
91
|
"react-hook-form": "^7.66.0",
|
|
96
|
-
"react-native-mmkv": "^4.
|
|
97
|
-
"react-native-nitro-modules": "^0.31.4",
|
|
92
|
+
"react-native-mmkv": "^4.3.1",
|
|
98
93
|
"react-native-safe-area-context": "^5.5.2",
|
|
99
|
-
"react-native": "^0.
|
|
94
|
+
"react-native": "^0.85.1"
|
|
100
95
|
},
|
|
101
96
|
"resolutions": {
|
|
102
|
-
"@types/react": "^
|
|
103
|
-
"react": "19.
|
|
97
|
+
"@types/react": "^19.2.0",
|
|
98
|
+
"react": "19.2.3"
|
|
104
99
|
},
|
|
105
100
|
"peerDependencies": {
|
|
106
101
|
"react": ">=19.0.0",
|
|
107
102
|
"react-native": ">=0.81.0",
|
|
108
103
|
"react-native-mmkv": ">=4.0.0",
|
|
109
|
-
"react-native-nitro-modules": ">=0.31.4",
|
|
110
104
|
"react-native-safe-area-context": ">=5.5.2",
|
|
111
105
|
"react-hook-form": ">=7.66.0"
|
|
112
106
|
},
|
|
113
|
-
"jest": {
|
|
114
|
-
"preset": "react-native",
|
|
115
|
-
"modulePathIgnorePatterns": [
|
|
116
|
-
"<rootDir>/example/node_modules",
|
|
117
|
-
"<rootDir>/lib/"
|
|
118
|
-
]
|
|
119
|
-
},
|
|
120
107
|
"commitlint": {
|
|
121
108
|
"extends": [
|
|
122
109
|
"@commitlint/config-conventional"
|
|
@@ -201,7 +188,7 @@
|
|
|
201
188
|
]
|
|
202
189
|
},
|
|
203
190
|
"engines": {
|
|
204
|
-
"node": ">=
|
|
191
|
+
"node": ">=22.11.0"
|
|
205
192
|
},
|
|
206
193
|
"dependencies": {},
|
|
207
194
|
"packageManager": "yarn@1.22.19+sha512.ff4579ab459bb25aa7c0ff75b62acebe576f6084b36aa842971cf250a5d8c6cd3bc9420b22ce63c7f93a0857bc6ef29291db39c3e7a23aab5adfd5a4dd6c5d71"
|
|
@@ -3,13 +3,7 @@ import type { MediaAsset } from './types/MediaTypes';
|
|
|
3
3
|
|
|
4
4
|
const { ComnyxMediaPicker } = NativeModules;
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
if (!ComnyxMediaPicker) {
|
|
8
|
-
return [];
|
|
9
|
-
}
|
|
10
|
-
const results = await ComnyxMediaPicker.pickMedia();
|
|
11
|
-
if (!results || !Array.isArray(results) || results.length === 0) return [];
|
|
12
|
-
|
|
6
|
+
function mapResults(results: any[]): MediaAsset[] {
|
|
13
7
|
return results.map((result: any) => {
|
|
14
8
|
const isImage =
|
|
15
9
|
result.type === 'image' ||
|
|
@@ -29,6 +23,33 @@ export async function pickMedia(): Promise<MediaAsset[]> {
|
|
|
29
23
|
});
|
|
30
24
|
}
|
|
31
25
|
|
|
26
|
+
export async function pickMedia(): Promise<MediaAsset[]> {
|
|
27
|
+
if (!ComnyxMediaPicker) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
const results = await ComnyxMediaPicker.pickMedia();
|
|
31
|
+
if (!results || !Array.isArray(results) || results.length === 0) return [];
|
|
32
|
+
return mapResults(results);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export async function pickImage(): Promise<MediaAsset[]> {
|
|
36
|
+
if (!ComnyxMediaPicker) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
const results = await ComnyxMediaPicker.pickImage();
|
|
40
|
+
if (!results || !Array.isArray(results) || results.length === 0) return [];
|
|
41
|
+
return mapResults(results);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export async function pickVideo(): Promise<MediaAsset[]> {
|
|
45
|
+
if (!ComnyxMediaPicker) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
const results = await ComnyxMediaPicker.pickVideo();
|
|
49
|
+
if (!results || !Array.isArray(results) || results.length === 0) return [];
|
|
50
|
+
return mapResults(results);
|
|
51
|
+
}
|
|
52
|
+
|
|
32
53
|
export async function openVideo(uri: string): Promise<void> {
|
|
33
54
|
if (!ComnyxMediaPicker) {
|
|
34
55
|
console.warn('[Comnyx] ComnyxMediaPicker native module is not available');
|
|
@@ -54,6 +75,24 @@ export async function deleteTempFile(uri: string): Promise<void> {
|
|
|
54
75
|
return ComnyxMediaPicker.deleteTempFile(uri);
|
|
55
76
|
}
|
|
56
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Android only. Converts a local file URI returned by the picker into a
|
|
80
|
+
* `content://` URI served by the Comnyx FileProvider, suitable for crossing
|
|
81
|
+
* process boundaries (e.g. sharing to another app, system ACTION_VIEW).
|
|
82
|
+
*
|
|
83
|
+
* On iOS, returns the input URI unchanged since iOS does not have the
|
|
84
|
+
* FileUriExposedException problem.
|
|
85
|
+
*/
|
|
86
|
+
export async function getShareableUri(fileUri: string): Promise<string> {
|
|
87
|
+
if (!ComnyxMediaPicker) {
|
|
88
|
+
return fileUri;
|
|
89
|
+
}
|
|
90
|
+
if (typeof ComnyxMediaPicker.getShareableUri !== 'function') {
|
|
91
|
+
return fileUri;
|
|
92
|
+
}
|
|
93
|
+
return ComnyxMediaPicker.getShareableUri(fileUri);
|
|
94
|
+
}
|
|
95
|
+
|
|
57
96
|
export async function cleanupTempFiles(): Promise<void> {
|
|
58
97
|
if (!ComnyxMediaPicker) {
|
|
59
98
|
return;
|
package/src/api/conversations.ts
CHANGED
|
@@ -13,7 +13,8 @@ export function getCustomerConversation(
|
|
|
13
13
|
externalId: string,
|
|
14
14
|
created_at: Date | undefined,
|
|
15
15
|
page: number = 0,
|
|
16
|
-
options: ApiOptions & { per_page?: number }
|
|
16
|
+
options: ApiOptions & { per_page?: number },
|
|
17
|
+
signal?: AbortSignal
|
|
17
18
|
): Promise<ConversationResponse> {
|
|
18
19
|
if (options.fake) {
|
|
19
20
|
return getFakePaginatedConversationResponse(
|
|
@@ -25,10 +26,10 @@ export function getCustomerConversation(
|
|
|
25
26
|
.get<ConversationResponse>(`/api/customers/${externalId}/conversation`, {
|
|
26
27
|
params: {
|
|
27
28
|
page,
|
|
28
|
-
// per_page: PER_PAGE,
|
|
29
29
|
getOld: 1,
|
|
30
30
|
getFrom: dateToUnixTimestamp(created_at),
|
|
31
31
|
},
|
|
32
|
+
signal,
|
|
32
33
|
})
|
|
33
34
|
.then((res) => res.data);
|
|
34
35
|
}
|
|
@@ -36,7 +37,8 @@ export function getCustomerConversation(
|
|
|
36
37
|
export function getNewCustomerConversation(
|
|
37
38
|
externalId: string,
|
|
38
39
|
created_at: Date | undefined,
|
|
39
|
-
options: ApiOptions
|
|
40
|
+
options: ApiOptions,
|
|
41
|
+
signal?: AbortSignal
|
|
40
42
|
): Promise<ConversationResponse> {
|
|
41
43
|
if (options.fake) {
|
|
42
44
|
return getFakeConversationResponse(25, 0, 0, true);
|
|
@@ -45,9 +47,9 @@ export function getNewCustomerConversation(
|
|
|
45
47
|
.get<ConversationResponse>(`/api/customers/${externalId}/conversation`, {
|
|
46
48
|
params: {
|
|
47
49
|
page: 1,
|
|
48
|
-
// per_page: 25,
|
|
49
50
|
getFrom: dateToUnixTimestamp(created_at),
|
|
50
51
|
},
|
|
52
|
+
signal,
|
|
51
53
|
})
|
|
52
54
|
.then((res) => res.data);
|
|
53
55
|
}
|
package/src/api/customers.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { axiosInstance } from './api';
|
|
|
4
4
|
// NOTE: This is not a REST API endpoint. Data is collected with debounce and sent to the server at an appropriate time.
|
|
5
5
|
export function updateCustomer(
|
|
6
6
|
customerData: CreateCustomerRequest,
|
|
7
|
-
externalId?: string
|
|
7
|
+
externalId?: string,
|
|
8
|
+
signal?: AbortSignal
|
|
8
9
|
): Promise<{ customer: Customer }> {
|
|
9
10
|
console.info('[Comnyx] Adding customer info');
|
|
10
11
|
return axiosInstance
|
|
@@ -12,6 +13,7 @@ export function updateCustomer(
|
|
|
12
13
|
headers: {
|
|
13
14
|
'external-id': externalId,
|
|
14
15
|
},
|
|
16
|
+
signal,
|
|
15
17
|
})
|
|
16
18
|
.then((res) => res.data);
|
|
17
19
|
}
|
package/src/api/media.ts
CHANGED
|
@@ -9,19 +9,28 @@ import {
|
|
|
9
9
|
getFakeMediaMessageResponse,
|
|
10
10
|
} from '../data/fake/media';
|
|
11
11
|
|
|
12
|
+
// React Native's XMLHttpRequest.send accepts this shape to stream a file URI
|
|
13
|
+
// without loading it into memory. Not in lib.dom, so typed locally.
|
|
14
|
+
type RNXHRFile = { uri: string; type: string; name: string };
|
|
15
|
+
|
|
12
16
|
export function getUploadUrl(
|
|
13
17
|
fileName: string,
|
|
14
18
|
contentType: string,
|
|
15
|
-
options: ApiOptions
|
|
19
|
+
options: ApiOptions,
|
|
20
|
+
signal?: AbortSignal
|
|
16
21
|
): Promise<UploadUrlResponse> {
|
|
17
22
|
if (options.fake) {
|
|
18
23
|
return getFakeUploadUrlResponse(fileName);
|
|
19
24
|
}
|
|
20
25
|
return axiosInstance
|
|
21
|
-
.post<UploadUrlResponse>(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
.post<UploadUrlResponse>(
|
|
27
|
+
'/api/media/presign',
|
|
28
|
+
{
|
|
29
|
+
fileName,
|
|
30
|
+
fileType: contentType,
|
|
31
|
+
},
|
|
32
|
+
{ signal }
|
|
33
|
+
)
|
|
25
34
|
.then((res) => res.data);
|
|
26
35
|
}
|
|
27
36
|
|
|
@@ -30,14 +39,23 @@ export function uploadFileToS3(
|
|
|
30
39
|
fileUri: string,
|
|
31
40
|
contentType: string,
|
|
32
41
|
onProgress?: (percentage: number) => void,
|
|
33
|
-
options?: ApiOptions
|
|
42
|
+
options?: ApiOptions,
|
|
43
|
+
signal?: AbortSignal
|
|
34
44
|
): Promise<void> {
|
|
35
45
|
if (options?.fake) {
|
|
36
46
|
return fakeUploadToS3(onProgress);
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
return new Promise((resolve, reject) => {
|
|
50
|
+
if (signal?.aborted) {
|
|
51
|
+
reject(new Error('Upload aborted'));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
40
55
|
const xhr = new XMLHttpRequest();
|
|
56
|
+
const onAbort = () => xhr.abort();
|
|
57
|
+
signal?.addEventListener('abort', onAbort);
|
|
58
|
+
const cleanup = () => signal?.removeEventListener('abort', onAbort);
|
|
41
59
|
|
|
42
60
|
xhr.upload.addEventListener('progress', (event) => {
|
|
43
61
|
if (event.lengthComputable && onProgress) {
|
|
@@ -50,6 +68,7 @@ export function uploadFileToS3(
|
|
|
50
68
|
});
|
|
51
69
|
|
|
52
70
|
xhr.addEventListener('load', () => {
|
|
71
|
+
cleanup();
|
|
53
72
|
if (xhr.status >= 200 && xhr.status < 300) {
|
|
54
73
|
resolve();
|
|
55
74
|
} else {
|
|
@@ -59,6 +78,7 @@ export function uploadFileToS3(
|
|
|
59
78
|
});
|
|
60
79
|
|
|
61
80
|
xhr.addEventListener('error', () => {
|
|
81
|
+
cleanup();
|
|
62
82
|
console.error(
|
|
63
83
|
'[Comnyx] Upload XHR error, status:',
|
|
64
84
|
xhr.status,
|
|
@@ -69,20 +89,20 @@ export function uploadFileToS3(
|
|
|
69
89
|
});
|
|
70
90
|
|
|
71
91
|
xhr.addEventListener('abort', () => {
|
|
92
|
+
cleanup();
|
|
72
93
|
reject(new Error('Upload aborted'));
|
|
73
94
|
});
|
|
74
95
|
|
|
75
96
|
xhr.open('PUT', uploadUrl);
|
|
76
97
|
xhr.setRequestHeader('Content-Type', contentType);
|
|
77
98
|
|
|
78
|
-
|
|
79
|
-
const file: any = {
|
|
99
|
+
const file: RNXHRFile = {
|
|
80
100
|
uri: Platform.OS === 'android' ? fileUri : fileUri.replace('file://', ''),
|
|
81
101
|
type: contentType,
|
|
82
102
|
name: fileUri.split('/').pop() || 'file',
|
|
83
103
|
};
|
|
84
104
|
|
|
85
|
-
xhr.send(file);
|
|
105
|
+
xhr.send(file as unknown as Document);
|
|
86
106
|
});
|
|
87
107
|
}
|
|
88
108
|
|
|
@@ -91,7 +111,8 @@ export function sendMediaMessage(
|
|
|
91
111
|
fileUrls: string[],
|
|
92
112
|
mediaType: 'image' | 'video',
|
|
93
113
|
content: string,
|
|
94
|
-
options: ApiOptions
|
|
114
|
+
options: ApiOptions,
|
|
115
|
+
signal?: AbortSignal
|
|
95
116
|
): Promise<MessageResponse> {
|
|
96
117
|
if (options.fake) {
|
|
97
118
|
return getFakeMediaMessageResponse(fileUrls, mediaType);
|
|
@@ -110,6 +131,7 @@ export function sendMediaMessage(
|
|
|
110
131
|
'Accept': 'application/json',
|
|
111
132
|
'Content-Type': 'application/json',
|
|
112
133
|
},
|
|
134
|
+
signal,
|
|
113
135
|
}
|
|
114
136
|
)
|
|
115
137
|
.then((res) => res.data);
|
package/src/api/messages.ts
CHANGED
|
@@ -6,7 +6,8 @@ import { axiosInstance } from './api';
|
|
|
6
6
|
export function sendCustomerMessage(
|
|
7
7
|
externalId: string,
|
|
8
8
|
content: string,
|
|
9
|
-
options: ApiOptions
|
|
9
|
+
options: ApiOptions,
|
|
10
|
+
signal?: AbortSignal
|
|
10
11
|
): Promise<MessageResponse> {
|
|
11
12
|
if (options.fake) {
|
|
12
13
|
return new Promise<MessageResponse>((resolve, _) => {
|
|
@@ -27,6 +28,7 @@ export function sendCustomerMessage(
|
|
|
27
28
|
'Accept': 'application/json',
|
|
28
29
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
29
30
|
},
|
|
31
|
+
signal,
|
|
30
32
|
}
|
|
31
33
|
)
|
|
32
34
|
.then((res) => res.data);
|
|
Binary file
|
|
Binary file
|