@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,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#include "RNComnyxSpecJSI.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
static jsi::Value __hostFunction_NativeComnyxCxxSpecJSI_initialize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
+
return static_cast<NativeComnyxCxxSpecJSI *>(&turboModule)->initialize(
|
|
16
|
+
rt
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
static jsi::Value __hostFunction_NativeComnyxCxxSpecJSI_checkOptIn(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
20
|
+
return static_cast<NativeComnyxCxxSpecJSI *>(&turboModule)->checkOptIn(
|
|
21
|
+
rt
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
static jsi::Value __hostFunction_NativeComnyxCxxSpecJSI_optIn(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
25
|
+
return static_cast<NativeComnyxCxxSpecJSI *>(&turboModule)->optIn(
|
|
26
|
+
rt
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
NativeComnyxCxxSpecJSI::NativeComnyxCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
31
|
+
: TurboModule("Comnyx", jsInvoker) {
|
|
32
|
+
methodMap_["initialize"] = MethodMetadata {0, __hostFunction_NativeComnyxCxxSpecJSI_initialize};
|
|
33
|
+
methodMap_["checkOptIn"] = MethodMetadata {0, __hostFunction_NativeComnyxCxxSpecJSI_checkOptIn};
|
|
34
|
+
methodMap_["optIn"] = MethodMetadata {0, __hostFunction_NativeComnyxCxxSpecJSI_optIn};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleH.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <ReactCommon/TurboModule.h>
|
|
13
|
+
#include <react/bridging/Bridging.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class JSI_EXPORT NativeComnyxCxxSpecJSI : public TurboModule {
|
|
19
|
+
protected:
|
|
20
|
+
NativeComnyxCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
|
21
|
+
|
|
22
|
+
public:
|
|
23
|
+
virtual jsi::Value initialize(jsi::Runtime &rt) = 0;
|
|
24
|
+
virtual jsi::Value checkOptIn(jsi::Runtime &rt) = 0;
|
|
25
|
+
virtual jsi::Value optIn(jsi::Runtime &rt) = 0;
|
|
26
|
+
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
template <typename T>
|
|
30
|
+
class JSI_EXPORT NativeComnyxCxxSpec : public TurboModule {
|
|
31
|
+
public:
|
|
32
|
+
jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
|
|
33
|
+
return delegate_.create(rt, propName);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
|
|
37
|
+
return delegate_.getPropertyNames(runtime);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static constexpr std::string_view kModuleName = "Comnyx";
|
|
41
|
+
|
|
42
|
+
protected:
|
|
43
|
+
NativeComnyxCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
|
|
44
|
+
: TurboModule(std::string{NativeComnyxCxxSpec::kModuleName}, jsInvoker),
|
|
45
|
+
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
private:
|
|
49
|
+
class Delegate : public NativeComnyxCxxSpecJSI {
|
|
50
|
+
public:
|
|
51
|
+
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
|
|
52
|
+
NativeComnyxCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
jsi::Value initialize(jsi::Runtime &rt) override {
|
|
57
|
+
static_assert(
|
|
58
|
+
bridging::getParameterCount(&T::initialize) == 1,
|
|
59
|
+
"Expected initialize(...) to have 1 parameters");
|
|
60
|
+
|
|
61
|
+
return bridging::callFromJs<jsi::Value>(
|
|
62
|
+
rt, &T::initialize, jsInvoker_, instance_);
|
|
63
|
+
}
|
|
64
|
+
jsi::Value checkOptIn(jsi::Runtime &rt) override {
|
|
65
|
+
static_assert(
|
|
66
|
+
bridging::getParameterCount(&T::checkOptIn) == 1,
|
|
67
|
+
"Expected checkOptIn(...) to have 1 parameters");
|
|
68
|
+
|
|
69
|
+
return bridging::callFromJs<jsi::Value>(
|
|
70
|
+
rt, &T::checkOptIn, jsInvoker_, instance_);
|
|
71
|
+
}
|
|
72
|
+
jsi::Value optIn(jsi::Runtime &rt) override {
|
|
73
|
+
static_assert(
|
|
74
|
+
bridging::getParameterCount(&T::optIn) == 1,
|
|
75
|
+
"Expected optIn(...) to have 1 parameters");
|
|
76
|
+
|
|
77
|
+
return bridging::callFromJs<jsi::Value>(
|
|
78
|
+
rt, &T::optIn, jsInvoker_, instance_);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
private:
|
|
82
|
+
friend class NativeComnyxCxxSpec;
|
|
83
|
+
T *instance_;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
Delegate delegate_;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
version = "0.78.1"
|
|
7
|
+
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
8
|
+
if version == '1000.0.0'
|
|
9
|
+
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
10
|
+
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
11
|
+
else
|
|
12
|
+
source[:tag] = "v#{version}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
Pod::Spec.new do |s|
|
|
16
|
+
s.name = "ReactAppDependencyProvider"
|
|
17
|
+
s.version = version
|
|
18
|
+
s.summary = "The third party dependency provider for the app"
|
|
19
|
+
s.homepage = "https://reactnative.dev/"
|
|
20
|
+
s.documentation_url = "https://reactnative.dev/"
|
|
21
|
+
s.license = "MIT"
|
|
22
|
+
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
23
|
+
s.platforms = min_supported_versions
|
|
24
|
+
s.source = source
|
|
25
|
+
s.source_files = "**/RCTAppDependencyProvider.{h,mm}"
|
|
26
|
+
|
|
27
|
+
# This guard prevent to install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
+
s.pod_target_xcconfig = {
|
|
29
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
30
|
+
"DEFINES_MODULE" => "YES"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
s.dependency "ReactCodegen"
|
|
34
|
+
end
|
|
@@ -6,18 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.cleanupTempFiles = cleanupTempFiles;
|
|
7
7
|
exports.deleteTempFile = deleteTempFile;
|
|
8
8
|
exports.generateThumbnail = generateThumbnail;
|
|
9
|
+
exports.getShareableUri = getShareableUri;
|
|
9
10
|
exports.openVideo = openVideo;
|
|
11
|
+
exports.pickImage = pickImage;
|
|
10
12
|
exports.pickMedia = pickMedia;
|
|
13
|
+
exports.pickVideo = pickVideo;
|
|
11
14
|
var _reactNative = require("react-native");
|
|
12
15
|
const {
|
|
13
16
|
ComnyxMediaPicker
|
|
14
17
|
} = _reactNative.NativeModules;
|
|
15
|
-
|
|
16
|
-
if (!ComnyxMediaPicker) {
|
|
17
|
-
return [];
|
|
18
|
-
}
|
|
19
|
-
const results = await ComnyxMediaPicker.pickMedia();
|
|
20
|
-
if (!results || !Array.isArray(results) || results.length === 0) return [];
|
|
18
|
+
function mapResults(results) {
|
|
21
19
|
return results.map(result => {
|
|
22
20
|
const isImage = result.type === 'image' || result.mimeType && result.mimeType.startsWith('image');
|
|
23
21
|
return {
|
|
@@ -33,6 +31,30 @@ async function pickMedia() {
|
|
|
33
31
|
};
|
|
34
32
|
});
|
|
35
33
|
}
|
|
34
|
+
async function pickMedia() {
|
|
35
|
+
if (!ComnyxMediaPicker) {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
const results = await ComnyxMediaPicker.pickMedia();
|
|
39
|
+
if (!results || !Array.isArray(results) || results.length === 0) return [];
|
|
40
|
+
return mapResults(results);
|
|
41
|
+
}
|
|
42
|
+
async function pickImage() {
|
|
43
|
+
if (!ComnyxMediaPicker) {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
const results = await ComnyxMediaPicker.pickImage();
|
|
47
|
+
if (!results || !Array.isArray(results) || results.length === 0) return [];
|
|
48
|
+
return mapResults(results);
|
|
49
|
+
}
|
|
50
|
+
async function pickVideo() {
|
|
51
|
+
if (!ComnyxMediaPicker) {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
const results = await ComnyxMediaPicker.pickVideo();
|
|
55
|
+
if (!results || !Array.isArray(results) || results.length === 0) return [];
|
|
56
|
+
return mapResults(results);
|
|
57
|
+
}
|
|
36
58
|
async function openVideo(uri) {
|
|
37
59
|
if (!ComnyxMediaPicker) {
|
|
38
60
|
console.warn('[Comnyx] ComnyxMediaPicker native module is not available');
|
|
@@ -53,6 +75,24 @@ async function deleteTempFile(uri) {
|
|
|
53
75
|
}
|
|
54
76
|
return ComnyxMediaPicker.deleteTempFile(uri);
|
|
55
77
|
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Android only. Converts a local file URI returned by the picker into a
|
|
81
|
+
* `content://` URI served by the Comnyx FileProvider, suitable for crossing
|
|
82
|
+
* process boundaries (e.g. sharing to another app, system ACTION_VIEW).
|
|
83
|
+
*
|
|
84
|
+
* On iOS, returns the input URI unchanged since iOS does not have the
|
|
85
|
+
* FileUriExposedException problem.
|
|
86
|
+
*/
|
|
87
|
+
async function getShareableUri(fileUri) {
|
|
88
|
+
if (!ComnyxMediaPicker) {
|
|
89
|
+
return fileUri;
|
|
90
|
+
}
|
|
91
|
+
if (typeof ComnyxMediaPicker.getShareableUri !== 'function') {
|
|
92
|
+
return fileUri;
|
|
93
|
+
}
|
|
94
|
+
return ComnyxMediaPicker.getShareableUri(fileUri);
|
|
95
|
+
}
|
|
56
96
|
async function cleanupTempFiles() {
|
|
57
97
|
if (!ComnyxMediaPicker) {
|
|
58
98
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","ComnyxMediaPicker","NativeModules","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","ComnyxMediaPicker","NativeModules","mapResults","results","map","result","isImage","type","mimeType","startsWith","uri","fileName","fileSize","width","undefined","height","duration","thumbnailUri","pickMedia","Array","isArray","length","pickImage","pickVideo","openVideo","console","warn","generateThumbnail","videoUrl","deleteTempFile","getShareableUri","fileUri","cleanupTempFiles"],"sourceRoot":"../../src","sources":["NativeComnyxMediaPicker.ts"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,MAAM;EAAEC;AAAkB,CAAC,GAAGC,0BAAa;AAE3C,SAASC,UAAUA,CAACC,OAAc,EAAgB;EAChD,OAAOA,OAAO,CAACC,GAAG,CAAEC,MAAW,IAAK;IAClC,MAAMC,OAAO,GACXD,MAAM,CAACE,IAAI,KAAK,OAAO,IACtBF,MAAM,CAACG,QAAQ,IAAIH,MAAM,CAACG,QAAQ,CAACC,UAAU,C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A,iBAAiB,CAACgC,gBAAgB,CAAC,CAAC;AAC7C","ignoreList":[]}
|
|
@@ -9,29 +9,29 @@ var _conversations = require("../data/fake/conversations.js");
|
|
|
9
9
|
var _api = require("./api.js");
|
|
10
10
|
var _date = require("../utils/date.js");
|
|
11
11
|
const PER_PAGE = 25;
|
|
12
|
-
function getCustomerConversation(externalId, created_at, page = 0, options) {
|
|
12
|
+
function getCustomerConversation(externalId, created_at, page = 0, options, signal) {
|
|
13
13
|
if (options.fake) {
|
|
14
14
|
return (0, _conversations.getFakePaginatedConversationResponse)(page, options.per_page ?? PER_PAGE);
|
|
15
15
|
}
|
|
16
16
|
return _api.axiosInstance.get(`/api/customers/${externalId}/conversation`, {
|
|
17
17
|
params: {
|
|
18
18
|
page,
|
|
19
|
-
// per_page: PER_PAGE,
|
|
20
19
|
getOld: 1,
|
|
21
20
|
getFrom: (0, _date.dateToUnixTimestamp)(created_at)
|
|
22
|
-
}
|
|
21
|
+
},
|
|
22
|
+
signal
|
|
23
23
|
}).then(res => res.data);
|
|
24
24
|
}
|
|
25
|
-
function getNewCustomerConversation(externalId, created_at, options) {
|
|
25
|
+
function getNewCustomerConversation(externalId, created_at, options, signal) {
|
|
26
26
|
if (options.fake) {
|
|
27
27
|
return (0, _conversations.getFakeConversationResponse)(25, 0, 0, true);
|
|
28
28
|
}
|
|
29
29
|
return _api.axiosInstance.get(`/api/customers/${externalId}/conversation`, {
|
|
30
30
|
params: {
|
|
31
31
|
page: 1,
|
|
32
|
-
// per_page: 25,
|
|
33
32
|
getFrom: (0, _date.dateToUnixTimestamp)(created_at)
|
|
34
|
-
}
|
|
33
|
+
},
|
|
34
|
+
signal
|
|
35
35
|
}).then(res => res.data);
|
|
36
36
|
}
|
|
37
37
|
//# sourceMappingURL=conversations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_conversations","require","_api","_date","PER_PAGE","getCustomerConversation","externalId","created_at","page","options","fake","getFakePaginatedConversationResponse","per_page","axiosInstance","get","params","getOld","getFrom","dateToUnixTimestamp","then","res","data","getNewCustomerConversation","getFakeConversationResponse"],"sourceRoot":"../../../src","sources":["api/conversations.ts"],"mappings":";;;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAIA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,MAAMG,QAAQ,GAAG,EAAE;AAEZ,SAASC,uBAAuBA,CACrCC,UAAkB,EAClBC,UAA4B,EAC5BC,IAAY,GAAG,CAAC,EAChBC,OAA2C,
|
|
1
|
+
{"version":3,"names":["_conversations","require","_api","_date","PER_PAGE","getCustomerConversation","externalId","created_at","page","options","signal","fake","getFakePaginatedConversationResponse","per_page","axiosInstance","get","params","getOld","getFrom","dateToUnixTimestamp","then","res","data","getNewCustomerConversation","getFakeConversationResponse"],"sourceRoot":"../../../src","sources":["api/conversations.ts"],"mappings":";;;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAIA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,MAAMG,QAAQ,GAAG,EAAE;AAEZ,SAASC,uBAAuBA,CACrCC,UAAkB,EAClBC,UAA4B,EAC5BC,IAAY,GAAG,CAAC,EAChBC,OAA2C,EAC3CC,MAAoB,EACW;EAC/B,IAAID,OAAO,CAACE,IAAI,EAAE;IAChB,OAAO,IAAAC,mDAAoC,EACzCJ,IAAI,EACJC,OAAO,CAACI,QAAQ,IAAIT,QACtB,CAAC;EACH;EACA,OAAOU,kBAAa,CACjBC,GAAG,CAAuB,kBAAkBT,UAAU,eAAe,EAAE;IACtEU,MAAM,EAAE;MACNR,IAAI;MACJS,MAAM,EAAE,CAAC;MACTC,OAAO,EAAE,IAAAC,yBAAmB,EAACZ,UAAU;IACzC,CAAC;IACDG;EACF,CAAC,CAAC,CACDU,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC;AAC5B;AAEO,SAASC,0BAA0BA,CACxCjB,UAAkB,EAClBC,UAA4B,EAC5BE,OAAmB,EACnBC,MAAoB,EACW;EAC/B,IAAID,OAAO,CAACE,IAAI,EAAE;IAChB,OAAO,IAAAa,0CAA2B,EAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC;EACpD;EACA,OAAOV,kBAAa,CACjBC,GAAG,CAAuB,kBAAkBT,UAAU,eAAe,EAAE;IACtEU,MAAM,EAAE;MACNR,IAAI,EAAE,CAAC;MACPU,OAAO,EAAE,IAAAC,yBAAmB,EAACZ,UAAU;IACzC,CAAC;IACDG;EACF,CAAC,CAAC,CACDU,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -6,12 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.updateCustomer = updateCustomer;
|
|
7
7
|
var _api = require("./api.js");
|
|
8
8
|
// NOTE: This is not a REST API endpoint. Data is collected with debounce and sent to the server at an appropriate time.
|
|
9
|
-
function updateCustomer(customerData, externalId) {
|
|
9
|
+
function updateCustomer(customerData, externalId, signal) {
|
|
10
10
|
console.info('[Comnyx] Adding customer info');
|
|
11
11
|
return _api.axiosInstance.post('/api/customers/create', customerData, {
|
|
12
12
|
headers: {
|
|
13
13
|
'external-id': externalId
|
|
14
|
-
}
|
|
14
|
+
},
|
|
15
|
+
signal
|
|
15
16
|
}).then(res => res.data);
|
|
16
17
|
}
|
|
17
18
|
//# sourceMappingURL=customers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_api","require","updateCustomer","customerData","externalId","console","info","axiosInstance","post","headers","then","res","data"],"sourceRoot":"../../../src","sources":["api/customers.ts"],"mappings":";;;;;;AACA,IAAAA,IAAA,GAAAC,OAAA;AAEA;AACO,SAASC,cAAcA,CAC5BC,YAAmC,EACnCC,UAAmB,
|
|
1
|
+
{"version":3,"names":["_api","require","updateCustomer","customerData","externalId","signal","console","info","axiosInstance","post","headers","then","res","data"],"sourceRoot":"../../../src","sources":["api/customers.ts"],"mappings":";;;;;;AACA,IAAAA,IAAA,GAAAC,OAAA;AAEA;AACO,SAASC,cAAcA,CAC5BC,YAAmC,EACnCC,UAAmB,EACnBC,MAAoB,EACa;EACjCC,OAAO,CAACC,IAAI,CAAC,+BAA+B,CAAC;EAC7C,OAAOC,kBAAa,CACjBC,IAAI,CAAC,uBAAuB,EAAEN,YAAY,EAAE;IAC3CO,OAAO,EAAE;MACP,aAAa,EAAEN;IACjB,CAAC;IACDC;EACF,CAAC,CAAC,CACDM,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -9,21 +9,33 @@ exports.uploadFileToS3 = uploadFileToS3;
|
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
10
|
var _api = require("./api.js");
|
|
11
11
|
var _media = require("../data/fake/media.js");
|
|
12
|
-
|
|
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
|
+
|
|
15
|
+
function getUploadUrl(fileName, contentType, options, signal) {
|
|
13
16
|
if (options.fake) {
|
|
14
17
|
return (0, _media.getFakeUploadUrlResponse)(fileName);
|
|
15
18
|
}
|
|
16
19
|
return _api.axiosInstance.post('/api/media/presign', {
|
|
17
20
|
fileName,
|
|
18
21
|
fileType: contentType
|
|
22
|
+
}, {
|
|
23
|
+
signal
|
|
19
24
|
}).then(res => res.data);
|
|
20
25
|
}
|
|
21
|
-
function uploadFileToS3(uploadUrl, fileUri, contentType, onProgress, options) {
|
|
26
|
+
function uploadFileToS3(uploadUrl, fileUri, contentType, onProgress, options, signal) {
|
|
22
27
|
if (options?.fake) {
|
|
23
28
|
return (0, _media.fakeUploadToS3)(onProgress);
|
|
24
29
|
}
|
|
25
30
|
return new Promise((resolve, reject) => {
|
|
31
|
+
if (signal?.aborted) {
|
|
32
|
+
reject(new Error('Upload aborted'));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
26
35
|
const xhr = new XMLHttpRequest();
|
|
36
|
+
const onAbort = () => xhr.abort();
|
|
37
|
+
signal?.addEventListener('abort', onAbort);
|
|
38
|
+
const cleanup = () => signal?.removeEventListener('abort', onAbort);
|
|
27
39
|
xhr.upload.addEventListener('progress', event => {
|
|
28
40
|
if (event.lengthComputable && onProgress) {
|
|
29
41
|
const percentage = Math.min(100, Math.round(event.loaded / event.total * 100));
|
|
@@ -31,6 +43,7 @@ function uploadFileToS3(uploadUrl, fileUri, contentType, onProgress, options) {
|
|
|
31
43
|
}
|
|
32
44
|
});
|
|
33
45
|
xhr.addEventListener('load', () => {
|
|
46
|
+
cleanup();
|
|
34
47
|
if (xhr.status >= 200 && xhr.status < 300) {
|
|
35
48
|
resolve();
|
|
36
49
|
} else {
|
|
@@ -39,16 +52,16 @@ function uploadFileToS3(uploadUrl, fileUri, contentType, onProgress, options) {
|
|
|
39
52
|
}
|
|
40
53
|
});
|
|
41
54
|
xhr.addEventListener('error', () => {
|
|
55
|
+
cleanup();
|
|
42
56
|
console.error('[Comnyx] Upload XHR error, status:', xhr.status, 'response:', xhr.responseText);
|
|
43
57
|
reject(new Error('Upload failed'));
|
|
44
58
|
});
|
|
45
59
|
xhr.addEventListener('abort', () => {
|
|
60
|
+
cleanup();
|
|
46
61
|
reject(new Error('Upload aborted'));
|
|
47
62
|
});
|
|
48
63
|
xhr.open('PUT', uploadUrl);
|
|
49
64
|
xhr.setRequestHeader('Content-Type', contentType);
|
|
50
|
-
|
|
51
|
-
// React Native supports sending file URIs directly via XHR
|
|
52
65
|
const file = {
|
|
53
66
|
uri: _reactNative.Platform.OS === 'android' ? fileUri : fileUri.replace('file://', ''),
|
|
54
67
|
type: contentType,
|
|
@@ -57,7 +70,7 @@ function uploadFileToS3(uploadUrl, fileUri, contentType, onProgress, options) {
|
|
|
57
70
|
xhr.send(file);
|
|
58
71
|
});
|
|
59
72
|
}
|
|
60
|
-
function sendMediaMessage(externalId, fileUrls, mediaType, content, options) {
|
|
73
|
+
function sendMediaMessage(externalId, fileUrls, mediaType, content, options, signal) {
|
|
61
74
|
if (options.fake) {
|
|
62
75
|
return (0, _media.getFakeMediaMessageResponse)(fileUrls, mediaType);
|
|
63
76
|
}
|
|
@@ -70,7 +83,8 @@ function sendMediaMessage(externalId, fileUrls, mediaType, content, options) {
|
|
|
70
83
|
headers: {
|
|
71
84
|
'Accept': 'application/json',
|
|
72
85
|
'Content-Type': 'application/json'
|
|
73
|
-
}
|
|
86
|
+
},
|
|
87
|
+
signal
|
|
74
88
|
}).then(res => res.data);
|
|
75
89
|
}
|
|
76
90
|
//# sourceMappingURL=media.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_api","_media","getUploadUrl","fileName","contentType","options","fake","getFakeUploadUrlResponse","axiosInstance","post","fileType","then","res","data","uploadFileToS3","uploadUrl","fileUri","onProgress","fakeUploadToS3","Promise","resolve","reject","xhr","XMLHttpRequest","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_api","_media","getUploadUrl","fileName","contentType","options","signal","fake","getFakeUploadUrlResponse","axiosInstance","post","fileType","then","res","data","uploadFileToS3","uploadUrl","fileUri","onProgress","fakeUploadToS3","Promise","resolve","reject","aborted","Error","xhr","XMLHttpRequest","onAbort","abort","addEventListener","cleanup","removeEventListener","upload","event","lengthComputable","percentage","Math","min","round","loaded","total","status","console","error","responseText","open","setRequestHeader","file","uri","Platform","OS","replace","type","name","split","pop","send","sendMediaMessage","externalId","fileUrls","mediaType","content","getFakeMediaMessageResponse","files","media_type","headers"],"sourceRoot":"../../../src","sources":["api/media.ts"],"mappings":";;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAMA;AACA;;AAGO,SAASG,YAAYA,CAC1BC,QAAgB,EAChBC,WAAmB,EACnBC,OAAmB,EACnBC,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,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC,IAAI;IACpC,CAAC;IAED9B,GAAG,CAAC+B,IAAI,CAACT,IAA2B,CAAC;EACvC,CAAC,CAAC;AACJ;AAEO,SAASU,gBAAgBA,CAC9BC,UAAkB,EAClBC,QAAkB,EAClBC,SAA4B,EAC5BC,OAAe,EACfxD,OAAmB,EACnBC,MAAoB,EACM;EAC1B,IAAID,OAAO,CAACE,IAAI,EAAE;IAChB,OAAO,IAAAuD,kCAA2B,EAACH,QAAQ,EAAEC,SAAS,CAAC;EACzD;EACA,OAAOnD,kBAAa,CACjBC,IAAI,CACH,wBAAwB,EACxB;IACEgD,UAAU;IACVG,OAAO;IACPE,KAAK,EAAEJ,QAAQ;IACfK,UAAU,EAAEJ;EACd,CAAC,EACD;IACEK,OAAO,EAAE;MACP,QAAQ,EAAE,kBAAkB;MAC5B,cAAc,EAAE;IAClB,CAAC;IACD3D;EACF,CACF,CAAC,CACAM,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.sendCustomerMessage = sendCustomerMessage;
|
|
7
7
|
var _messages = require("../data/fake/messages.js");
|
|
8
8
|
var _api = require("./api.js");
|
|
9
|
-
function sendCustomerMessage(externalId, content, options) {
|
|
9
|
+
function sendCustomerMessage(externalId, content, options, signal) {
|
|
10
10
|
if (options.fake) {
|
|
11
11
|
return new Promise((resolve, _) => {
|
|
12
12
|
setTimeout(() => {
|
|
@@ -21,7 +21,8 @@ function sendCustomerMessage(externalId, content, options) {
|
|
|
21
21
|
headers: {
|
|
22
22
|
'Accept': 'application/json',
|
|
23
23
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
24
|
-
}
|
|
24
|
+
},
|
|
25
|
+
signal
|
|
25
26
|
}).then(res => res.data);
|
|
26
27
|
}
|
|
27
28
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_messages","require","_api","sendCustomerMessage","externalId","content","options","fake","Promise","resolve","_","setTimeout","getFakeMessageResponse","axiosInstance","post","headers","then","res","data"],"sourceRoot":"../../../src","sources":["api/messages.ts"],"mappings":";;;;;;AAEA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEO,SAASE,mBAAmBA,CACjCC,UAAkB,EAClBC,OAAe,EACfC,OAAmB,
|
|
1
|
+
{"version":3,"names":["_messages","require","_api","sendCustomerMessage","externalId","content","options","signal","fake","Promise","resolve","_","setTimeout","getFakeMessageResponse","axiosInstance","post","headers","then","res","data"],"sourceRoot":"../../../src","sources":["api/messages.ts"],"mappings":";;;;;;AAEA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEO,SAASE,mBAAmBA,CACjCC,UAAkB,EAClBC,OAAe,EACfC,OAAmB,EACnBC,MAAoB,EACM;EAC1B,IAAID,OAAO,CAACE,IAAI,EAAE;IAChB,OAAO,IAAIC,OAAO,CAAkB,CAACC,OAAO,EAAEC,CAAC,KAAK;MAClDC,UAAU,CAAC,MAAM;QACfF,OAAO,CAAC,IAAAG,gCAAsB,EAACR,OAAO,CAAC,CAAC;MAC1C,CAAC,EAAE,GAAG,CAAC;IACT,CAAC,CAAC;EACJ;EACA,OAAOS,kBAAa,CACjBC,IAAI,CACH,wBAAwB,EACxB;IACEX,UAAU;IACVC;EACF,CAAC,EACD;IACEW,OAAO,EAAE;MACP,QAAQ,EAAE,kBAAkB;MAC5B,cAAc,EAAE;IAClB,CAAC;IACDT;EACF,CACF,CAAC,CACAU,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC;AAC5B","ignoreList":[]}
|
|
Binary file
|
|
Binary file
|