@developer_tribe/react-native-comnyx 0.6.2 → 0.7.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.
- package/Comnyx.podspec +1 -1
- package/README.md +192 -16
- package/android/app/build/generated/source/codegen/RCTAppDependencyProvider.h +25 -0
- package/android/app/build/generated/source/codegen/RCTAppDependencyProvider.mm +55 -0
- package/android/app/build/generated/source/codegen/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/android/app/build/generated/source/codegen/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/android/app/build/generated/source/codegen/RCTThirdPartyComponentsProvider.h +16 -0
- package/android/app/build/generated/source/codegen/RCTThirdPartyComponentsProvider.mm +23 -0
- package/android/app/build/generated/source/codegen/ReactAppDependencyProvider.podspec +34 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeAsyncStorageModuleSpec.java +59 -0
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
- package/android/app/build/generated/source/codegen/jni/RNComnyxSpec-generated.cpp +22 -0
- package/android/app/build/generated/source/codegen/jni/RNComnyxSpec.h +24 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +17 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +19 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/rnasyncstorage/rnasyncstorageJSI-generated.cpp +72 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/rnasyncstorage/rnasyncstorageJSI.h +116 -0
- package/android/app/build/generated/source/codegen/jni/rnasyncstorage-generated.cpp +62 -0
- package/android/app/build/generated/source/codegen/jni/rnasyncstorage.h +31 -0
- package/android/build.gradle +13 -1
- package/android/generated/RCTAppDependencyProvider.h +25 -0
- package/android/generated/RCTAppDependencyProvider.mm +55 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/android/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/android/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/android/generated/ReactAppDependencyProvider.podspec +34 -0
- package/android/generated/jni/RNComnyxSpec-generated.cpp +1 -11
- package/android/generated/jni/RNComnyxSpec.h +0 -7
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +0 -11
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +0 -52
- package/android/src/main/AndroidManifestNew.xml +10 -0
- package/android/src/main/java/com/comnyx/ComnyxModule.kt +213 -5
- package/android/src/main/java/com/comnyx/ComnyxPackage.kt +10 -6
- package/android/src/main/java/com/comnyx/src/messaging/ComnyxMessaging.kt +25 -0
- package/android/src/main/java/com/comnyx/src/messaging/firebase/FCM.kt +38 -0
- package/android/src/main/java/com/comnyx/src/messaging/firebase/FirebaseMessagingService.kt +45 -0
- package/android/src/main/java/com/comnyx/src/messaging/notifications/NotificationsService.kt +99 -0
- package/ios/APNService.swift +74 -0
- package/ios/Comnyx-Bridging-Header.h +17 -0
- package/ios/Comnyx.m +18 -0
- package/ios/Comnyx.swift +117 -0
- package/ios/ComnyxMessaging.swift +84 -0
- package/ios/PushService.swift +7 -0
- package/lib/commonjs/NativeComnyx.js +15 -0
- package/lib/commonjs/NativeComnyx.js.map +1 -0
- package/lib/commonjs/api/api.js +14 -4
- package/lib/commonjs/api/api.js.map +1 -1
- package/lib/commonjs/api/customers.js +3 -8
- package/lib/commonjs/api/customers.js.map +1 -1
- package/lib/commonjs/api/index.js +1 -1
- package/lib/commonjs/components/AppText.js +1 -1
- package/lib/commonjs/components/AppText.js.map +1 -1
- package/lib/commonjs/components/ChatList.js +6 -2
- package/lib/commonjs/components/ChatList.js.map +1 -1
- package/lib/commonjs/components/CustomerForm.js +2 -16
- package/lib/commonjs/components/CustomerForm.js.map +1 -1
- package/lib/commonjs/components/EmptyList.js +1 -1
- package/lib/commonjs/components/EmptyList.js.map +1 -1
- package/lib/commonjs/components/MessageInput.js +1 -1
- package/lib/commonjs/components/MessageInput.js.map +1 -1
- package/lib/commonjs/constants/viewabilityConfig.js.map +1 -0
- package/lib/commonjs/hooks/isRtl.js +1 -1
- package/lib/commonjs/hooks/useLocalize.js +1 -1
- package/lib/commonjs/hooks/useLocalize.js.map +1 -1
- package/lib/commonjs/hooks/usePolling.js +1 -1
- package/lib/commonjs/hooks/usePolling.js.map +1 -1
- package/lib/commonjs/hooks/useTheme.js +1 -1
- package/lib/commonjs/hooks/useTheme.js.map +1 -1
- package/lib/commonjs/index.js +12 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notifications/index.js +22 -0
- package/lib/commonjs/notifications/index.js.map +1 -0
- package/lib/commonjs/{Accumulator.js → register/Accumulator.js} +13 -1
- package/lib/commonjs/register/Accumulator.js.map +1 -0
- package/lib/commonjs/{collectData.js → register/collectData.js} +2 -0
- package/lib/commonjs/register/collectData.js.map +1 -0
- package/lib/commonjs/register/index.js +17 -0
- package/lib/commonjs/register/index.js.map +1 -0
- package/lib/commonjs/register/init.js +14 -0
- package/lib/commonjs/register/init.js.map +1 -0
- package/lib/commonjs/register/login.js +25 -0
- package/lib/commonjs/register/login.js.map +1 -0
- package/lib/commonjs/register/logout.js +19 -0
- package/lib/commonjs/register/logout.js.map +1 -0
- package/lib/commonjs/{store.js → store/store.js} +3 -2
- package/lib/commonjs/store/store.js.map +1 -0
- package/lib/commonjs/support/ComnyxSupport.js +118 -0
- package/lib/commonjs/support/ComnyxSupport.js.map +1 -0
- package/lib/commonjs/support/index.js +13 -0
- package/lib/commonjs/support/index.js.map +1 -0
- package/lib/commonjs/utils/scalingUtils.js +1 -1
- package/lib/module/NativeComnyx.js +11 -0
- package/lib/module/NativeComnyx.js.map +1 -0
- package/lib/module/api/api.js +11 -4
- package/lib/module/api/api.js.map +1 -1
- package/lib/module/api/customers.js +3 -7
- package/lib/module/api/customers.js.map +1 -1
- package/lib/module/api/index.js +1 -1
- package/lib/module/api/index.js.map +1 -1
- package/lib/module/components/AppText.js +1 -1
- package/lib/module/components/AppText.js.map +1 -1
- package/lib/module/components/ChatList.js +6 -2
- package/lib/module/components/ChatList.js.map +1 -1
- package/lib/module/components/CustomerForm.js +3 -17
- package/lib/module/components/CustomerForm.js.map +1 -1
- package/lib/module/components/EmptyList.js +1 -1
- package/lib/module/components/EmptyList.js.map +1 -1
- package/lib/module/components/MessageInput.js +1 -1
- package/lib/module/components/MessageInput.js.map +1 -1
- package/lib/module/constants/viewabilityConfig.js.map +1 -0
- package/lib/module/hooks/isRtl.js +1 -1
- package/lib/module/hooks/isRtl.js.map +1 -1
- package/lib/module/hooks/useLocalize.js +1 -1
- package/lib/module/hooks/useLocalize.js.map +1 -1
- package/lib/module/hooks/usePolling.js +1 -1
- package/lib/module/hooks/usePolling.js.map +1 -1
- package/lib/module/hooks/useTheme.js +1 -1
- package/lib/module/hooks/useTheme.js.map +1 -1
- package/lib/module/index.js +9 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/notifications/index.js +20 -0
- package/lib/module/notifications/index.js.map +1 -0
- package/lib/module/{Accumulator.js → register/Accumulator.js} +12 -1
- package/lib/module/register/Accumulator.js.map +1 -0
- package/lib/module/{collectData.js → register/collectData.js} +2 -0
- package/lib/module/register/collectData.js.map +1 -0
- package/lib/module/register/index.js +13 -0
- package/lib/module/register/index.js.map +1 -0
- package/lib/module/register/init.js +10 -0
- package/lib/module/register/init.js.map +1 -0
- package/lib/module/register/login.js +21 -0
- package/lib/module/register/login.js.map +1 -0
- package/lib/module/register/logout.js +15 -0
- package/lib/module/register/logout.js.map +1 -0
- package/lib/module/{store.js → store/store.js} +2 -2
- package/lib/module/store/store.js.map +1 -0
- package/lib/module/support/ComnyxSupport.js +114 -0
- package/lib/module/support/ComnyxSupport.js.map +1 -0
- package/lib/module/support/index.js +4 -0
- package/lib/module/support/index.js.map +1 -0
- package/lib/module/utils/scalingUtils.js +1 -1
- package/lib/module/utils/scalingUtils.js.map +1 -1
- package/lib/typescript/jest.config.d.ts +4 -0
- package/lib/typescript/jest.config.d.ts.map +1 -0
- package/lib/typescript/setup-jest.d.ts +1 -0
- package/lib/typescript/setup-jest.d.ts.map +1 -0
- package/lib/typescript/src/NativeComnyx.d.ts +13 -0
- package/lib/typescript/src/NativeComnyx.d.ts.map +1 -0
- package/lib/typescript/src/api/api.d.ts +7 -0
- package/lib/typescript/src/api/api.d.ts.map +1 -0
- package/lib/typescript/src/api/conversations.d.ts.map +1 -0
- package/lib/typescript/src/api/customers.d.ts +5 -0
- package/lib/typescript/src/api/customers.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → src}/api/index.d.ts +1 -1
- package/lib/typescript/src/api/index.d.ts.map +1 -0
- package/lib/typescript/src/api/messages.d.ts.map +1 -0
- package/lib/typescript/src/components/AppText.d.ts.map +1 -0
- package/lib/typescript/src/components/ChatList.d.ts +5 -0
- package/lib/typescript/src/components/ChatList.d.ts.map +1 -0
- package/lib/typescript/src/components/CustomAlert.d.ts.map +1 -0
- package/lib/typescript/src/components/CustomerForm.d.ts +5 -0
- package/lib/typescript/src/components/CustomerForm.d.ts.map +1 -0
- package/lib/typescript/src/components/EmptyList.d.ts.map +1 -0
- package/lib/typescript/src/components/InitFailed.d.ts.map +1 -0
- package/lib/typescript/src/components/MessageInput.d.ts.map +1 -0
- package/lib/typescript/src/components/MessageItem.d.ts.map +1 -0
- package/lib/typescript/src/components/ScaledSheet.d.ts.map +1 -0
- package/lib/typescript/src/constants/activeOpacity.d.ts.map +1 -0
- package/lib/typescript/src/constants/countries.d.ts.map +1 -0
- package/lib/typescript/src/constants/rtl.d.ts.map +1 -0
- package/lib/typescript/src/constants/translations.d.ts.map +1 -0
- package/lib/typescript/src/constants/viewabilityConfig.d.ts.map +1 -0
- package/lib/typescript/src/data/fake/conversations.d.ts.map +1 -0
- package/lib/typescript/src/data/fake/customers.d.ts.map +1 -0
- package/lib/typescript/src/data/fake/messages.d.ts.map +1 -0
- package/lib/typescript/src/hooks/isRtl.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useLocalize.d.ts.map +1 -0
- package/lib/typescript/src/hooks/usePolling.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useTheme.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useThemeColors.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/notifications/index.d.ts +21 -0
- package/lib/typescript/src/notifications/index.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → src/register}/Accumulator.d.ts +4 -3
- package/lib/typescript/src/register/Accumulator.d.ts.map +1 -0
- package/lib/typescript/src/register/collectData.d.ts.map +1 -0
- package/lib/typescript/src/register/index.d.ts +11 -0
- package/lib/typescript/src/register/index.d.ts.map +1 -0
- package/lib/typescript/src/register/init.d.ts +6 -0
- package/lib/typescript/src/register/init.d.ts.map +1 -0
- package/lib/typescript/src/register/login.d.ts +6 -0
- package/lib/typescript/src/register/login.d.ts.map +1 -0
- package/lib/typescript/src/register/logout.d.ts +2 -0
- package/lib/typescript/src/register/logout.d.ts.map +1 -0
- package/lib/typescript/{module/src → src/store}/store.d.ts +6 -4
- package/lib/typescript/src/store/store.d.ts.map +1 -0
- package/lib/typescript/src/support/ComnyxSupport.d.ts +12 -0
- package/lib/typescript/src/support/ComnyxSupport.d.ts.map +1 -0
- package/lib/typescript/src/support/index.d.ts +2 -0
- package/lib/typescript/src/support/index.d.ts.map +1 -0
- package/lib/typescript/src/types/ApiOptions.d.ts.map +1 -0
- package/lib/typescript/src/types/Conversation.d.ts.map +1 -0
- package/lib/typescript/src/types/Customer.d.ts.map +1 -0
- package/lib/typescript/src/types/GlobalTheme.d.ts.map +1 -0
- package/lib/typescript/src/types/Language.d.ts.map +1 -0
- package/lib/typescript/src/types/LocalizationKeys.d.ts.map +1 -0
- package/lib/typescript/src/types/MessageResponse.d.ts.map +1 -0
- package/lib/typescript/src/types/Theme.d.ts.map +1 -0
- package/lib/typescript/src/utils/date.d.ts.map +1 -0
- package/lib/typescript/src/utils/deepMap.d.ts.map +1 -0
- package/lib/typescript/src/utils/formatDate.d.ts.map +1 -0
- package/lib/typescript/src/utils/scalingUtils.d.ts.map +1 -0
- package/package.json +26 -27
- package/src/NativeComnyx.ts +13 -5
- package/src/api/api.ts +14 -4
- package/src/api/customers.ts +3 -8
- package/src/api/index.ts +1 -1
- package/src/components/AppText.tsx +1 -1
- package/src/components/ChatList.tsx +13 -3
- package/src/components/CustomerForm.tsx +10 -18
- package/src/components/EmptyList.tsx +1 -1
- package/src/components/MessageInput.tsx +1 -1
- package/src/hooks/isRtl.ts +1 -1
- package/src/hooks/useLocalize.ts +1 -1
- package/src/hooks/usePolling.ts +1 -1
- package/src/hooks/useTheme.ts +1 -1
- package/src/index.ts +9 -0
- package/src/notifications/index.ts +50 -0
- package/src/{Accumulator.ts → register/Accumulator.ts} +14 -2
- package/src/{collectData.ts → register/collectData.ts} +1 -0
- package/src/register/index.ts +11 -0
- package/src/register/init.ts +16 -0
- package/src/register/login.ts +24 -0
- package/src/register/logout.ts +13 -0
- package/src/{store.ts → store/store.ts} +7 -7
- package/src/support/ComnyxSupport.tsx +116 -0
- package/src/support/index.ts +1 -0
- package/src/utils/scalingUtils.ts +1 -1
- package/android/generated/java/com/comnyx/NativeComnyxSpec.java +0 -37
- package/ios/Comnyx.h +0 -6
- package/ios/Comnyx.mm +0 -18
- package/ios/generated/RNComnyxSpec/RNComnyxSpec-generated.mm +0 -39
- package/ios/generated/RNComnyxSpec/RNComnyxSpec.h +0 -63
- package/ios/generated/RNComnyxSpecJSI-generated.cpp +0 -28
- package/ios/generated/RNComnyxSpecJSI.h +0 -71
- package/lib/commonjs/Accumulator.js.map +0 -1
- package/lib/commonjs/App.js +0 -78
- package/lib/commonjs/App.js.map +0 -1
- package/lib/commonjs/NativeComnyx.ts +0 -8
- package/lib/commonjs/__dev__.js +0 -29
- package/lib/commonjs/__dev__.js.map +0 -1
- package/lib/commonjs/collectData.js.map +0 -1
- package/lib/commonjs/components/SizeMatter.js +0 -27
- package/lib/commonjs/components/SizeMatter.js.map +0 -1
- package/lib/commonjs/package.json +0 -1
- package/lib/commonjs/register.js +0 -26
- package/lib/commonjs/register.js.map +0 -1
- package/lib/commonjs/store.js.map +0 -1
- package/lib/commonjs/viewabilityConfig.js.map +0 -1
- package/lib/module/Accumulator.js.map +0 -1
- package/lib/module/App.js +0 -74
- package/lib/module/App.js.map +0 -1
- package/lib/module/NativeComnyx.ts +0 -8
- package/lib/module/__dev__.js +0 -29
- package/lib/module/__dev__.js.map +0 -1
- package/lib/module/collectData.js.map +0 -1
- package/lib/module/components/SizeMatter.js +0 -23
- package/lib/module/components/SizeMatter.js.map +0 -1
- package/lib/module/package.json +0 -1
- package/lib/module/register.js +0 -22
- package/lib/module/register.js.map +0 -1
- package/lib/module/store.js.map +0 -1
- package/lib/module/viewabilityConfig.js.map +0 -1
- package/lib/typescript/commonjs/package.json +0 -1
- package/lib/typescript/commonjs/src/Accumulator.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/App.d.ts +0 -12
- package/lib/typescript/commonjs/src/App.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/NativeComnyx.d.ts +0 -7
- package/lib/typescript/commonjs/src/NativeComnyx.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/__dev__.d.ts +0 -2
- package/lib/typescript/commonjs/src/__dev__.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/api/api.d.ts +0 -4
- package/lib/typescript/commonjs/src/api/api.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/api/conversations.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/api/customers.d.ts +0 -6
- package/lib/typescript/commonjs/src/api/customers.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/api/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/api/messages.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/collectData.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/AppText.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/ChatList.d.ts +0 -4
- package/lib/typescript/commonjs/src/components/ChatList.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/CustomAlert.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/CustomerForm.d.ts +0 -4
- package/lib/typescript/commonjs/src/components/CustomerForm.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/EmptyList.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/InitFailed.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/MessageInput.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/MessageItem.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/ScaledSheet.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/SizeMatter.d.ts +0 -7
- package/lib/typescript/commonjs/src/components/SizeMatter.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/constants/activeOpacity.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/constants/countries.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/constants/rtl.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/constants/translations.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/data/fake/conversations.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/data/fake/customers.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/data/fake/messages.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/isRtl.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/useLocalize.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/usePolling.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/useTheme.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/useThemeColors.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/index.d.ts +0 -7
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/register.d.ts +0 -6
- package/lib/typescript/commonjs/src/register.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/store.d.ts +0 -40
- package/lib/typescript/commonjs/src/store.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/ApiOptions.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/Conversation.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/Customer.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/GlobalTheme.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/Language.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/LocalizationKeys.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/MessageResponse.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/Theme.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/date.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/deepMap.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/formatDate.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/scalingUtils.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/viewabilityConfig.d.ts.map +0 -1
- package/lib/typescript/module/package.json +0 -1
- package/lib/typescript/module/src/Accumulator.d.ts +0 -18
- package/lib/typescript/module/src/Accumulator.d.ts.map +0 -1
- package/lib/typescript/module/src/App.d.ts +0 -12
- package/lib/typescript/module/src/App.d.ts.map +0 -1
- package/lib/typescript/module/src/NativeComnyx.d.ts +0 -7
- package/lib/typescript/module/src/NativeComnyx.d.ts.map +0 -1
- package/lib/typescript/module/src/__dev__.d.ts +0 -2
- package/lib/typescript/module/src/__dev__.d.ts.map +0 -1
- package/lib/typescript/module/src/api/api.d.ts +0 -4
- package/lib/typescript/module/src/api/api.d.ts.map +0 -1
- package/lib/typescript/module/src/api/conversations.d.ts +0 -7
- package/lib/typescript/module/src/api/conversations.d.ts.map +0 -1
- package/lib/typescript/module/src/api/customers.d.ts +0 -6
- package/lib/typescript/module/src/api/customers.d.ts.map +0 -1
- package/lib/typescript/module/src/api/index.d.ts +0 -4
- package/lib/typescript/module/src/api/index.d.ts.map +0 -1
- package/lib/typescript/module/src/api/messages.d.ts +0 -4
- package/lib/typescript/module/src/api/messages.d.ts.map +0 -1
- package/lib/typescript/module/src/collectData.d.ts +0 -3
- package/lib/typescript/module/src/collectData.d.ts.map +0 -1
- package/lib/typescript/module/src/components/AppText.d.ts +0 -14
- package/lib/typescript/module/src/components/AppText.d.ts.map +0 -1
- package/lib/typescript/module/src/components/ChatList.d.ts +0 -4
- package/lib/typescript/module/src/components/ChatList.d.ts.map +0 -1
- package/lib/typescript/module/src/components/CustomAlert.d.ts +0 -15
- package/lib/typescript/module/src/components/CustomAlert.d.ts.map +0 -1
- package/lib/typescript/module/src/components/CustomerForm.d.ts +0 -4
- package/lib/typescript/module/src/components/CustomerForm.d.ts.map +0 -1
- package/lib/typescript/module/src/components/EmptyList.d.ts +0 -2
- package/lib/typescript/module/src/components/EmptyList.d.ts.map +0 -1
- package/lib/typescript/module/src/components/InitFailed.d.ts +0 -6
- package/lib/typescript/module/src/components/InitFailed.d.ts.map +0 -1
- package/lib/typescript/module/src/components/MessageInput.d.ts +0 -5
- package/lib/typescript/module/src/components/MessageInput.d.ts.map +0 -1
- package/lib/typescript/module/src/components/MessageItem.d.ts +0 -6
- package/lib/typescript/module/src/components/MessageItem.d.ts.map +0 -1
- package/lib/typescript/module/src/components/ScaledSheet.d.ts +0 -2
- package/lib/typescript/module/src/components/ScaledSheet.d.ts.map +0 -1
- package/lib/typescript/module/src/components/SizeMatter.d.ts +0 -7
- package/lib/typescript/module/src/components/SizeMatter.d.ts.map +0 -1
- package/lib/typescript/module/src/constants/activeOpacity.d.ts +0 -2
- package/lib/typescript/module/src/constants/activeOpacity.d.ts.map +0 -1
- package/lib/typescript/module/src/constants/countries.d.ts +0 -7
- package/lib/typescript/module/src/constants/countries.d.ts.map +0 -1
- package/lib/typescript/module/src/constants/rtl.d.ts +0 -2
- package/lib/typescript/module/src/constants/rtl.d.ts.map +0 -1
- package/lib/typescript/module/src/constants/translations.d.ts +0 -4
- package/lib/typescript/module/src/constants/translations.d.ts.map +0 -1
- package/lib/typescript/module/src/data/fake/conversations.d.ts +0 -5
- package/lib/typescript/module/src/data/fake/conversations.d.ts.map +0 -1
- package/lib/typescript/module/src/data/fake/customers.d.ts +0 -3
- package/lib/typescript/module/src/data/fake/customers.d.ts.map +0 -1
- package/lib/typescript/module/src/data/fake/messages.d.ts +0 -3
- package/lib/typescript/module/src/data/fake/messages.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/isRtl.d.ts +0 -2
- package/lib/typescript/module/src/hooks/isRtl.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/useLocalize.d.ts +0 -3
- package/lib/typescript/module/src/hooks/useLocalize.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/usePolling.d.ts +0 -2
- package/lib/typescript/module/src/hooks/usePolling.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/useTheme.d.ts +0 -3
- package/lib/typescript/module/src/hooks/useTheme.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/useThemeColors.d.ts +0 -3
- package/lib/typescript/module/src/hooks/useThemeColors.d.ts.map +0 -1
- package/lib/typescript/module/src/index.d.ts +0 -7
- package/lib/typescript/module/src/index.d.ts.map +0 -1
- package/lib/typescript/module/src/register.d.ts +0 -6
- package/lib/typescript/module/src/register.d.ts.map +0 -1
- package/lib/typescript/module/src/store.d.ts.map +0 -1
- package/lib/typescript/module/src/types/ApiOptions.d.ts +0 -4
- package/lib/typescript/module/src/types/ApiOptions.d.ts.map +0 -1
- package/lib/typescript/module/src/types/Conversation.d.ts +0 -33
- package/lib/typescript/module/src/types/Conversation.d.ts.map +0 -1
- package/lib/typescript/module/src/types/Customer.d.ts +0 -39
- package/lib/typescript/module/src/types/Customer.d.ts.map +0 -1
- package/lib/typescript/module/src/types/GlobalTheme.d.ts +0 -6
- package/lib/typescript/module/src/types/GlobalTheme.d.ts.map +0 -1
- package/lib/typescript/module/src/types/Language.d.ts +0 -2
- package/lib/typescript/module/src/types/Language.d.ts.map +0 -1
- package/lib/typescript/module/src/types/LocalizationKeys.d.ts +0 -43
- package/lib/typescript/module/src/types/LocalizationKeys.d.ts.map +0 -1
- package/lib/typescript/module/src/types/MessageResponse.d.ts +0 -61
- package/lib/typescript/module/src/types/MessageResponse.d.ts.map +0 -1
- package/lib/typescript/module/src/types/Theme.d.ts +0 -28
- package/lib/typescript/module/src/types/Theme.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/date.d.ts +0 -7
- package/lib/typescript/module/src/utils/date.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/deepMap.d.ts +0 -7
- package/lib/typescript/module/src/utils/deepMap.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/formatDate.d.ts +0 -2
- package/lib/typescript/module/src/utils/formatDate.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/scalingUtils.d.ts +0 -10
- package/lib/typescript/module/src/utils/scalingUtils.d.ts.map +0 -1
- package/lib/typescript/module/src/viewabilityConfig.d.ts +0 -5
- package/lib/typescript/module/src/viewabilityConfig.d.ts.map +0 -1
- package/src/App.tsx +0 -77
- package/src/__dev__.ts +0 -22
- package/src/components/SizeMatter.tsx +0 -22
- package/src/index.tsx +0 -9
- package/src/register.ts +0 -34
- /package/lib/commonjs/{viewabilityConfig.js → constants/viewabilityConfig.js} +0 -0
- /package/lib/module/{viewabilityConfig.js → constants/viewabilityConfig.js} +0 -0
- /package/lib/typescript/{commonjs/src → src}/api/conversations.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/api/messages.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/AppText.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/CustomAlert.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/EmptyList.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/InitFailed.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/MessageInput.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/MessageItem.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/ScaledSheet.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/constants/activeOpacity.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/constants/countries.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/constants/rtl.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/constants/translations.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src/constants}/viewabilityConfig.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/data/fake/conversations.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/data/fake/customers.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/data/fake/messages.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/hooks/isRtl.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/hooks/useLocalize.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/hooks/usePolling.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/hooks/useTheme.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/hooks/useThemeColors.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src/register}/collectData.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/types/ApiOptions.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/types/Conversation.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/types/Customer.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/types/GlobalTheme.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/types/Language.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/types/LocalizationKeys.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/types/MessageResponse.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/types/Theme.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/utils/date.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/utils/deepMap.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/utils/formatDate.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/utils/scalingUtils.d.ts +0 -0
- /package/src/{viewabilityConfig.ts → constants/viewabilityConfig.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../../src/register/logout.ts"],"names":[],"mappings":"AAIA,wBAAsB,MAAM,kBAQ3B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { AppConversationMessage } from '
|
|
3
|
-
import type { LanguageCode } from '
|
|
1
|
+
import type { StateCreator } from 'zustand';
|
|
2
|
+
import type { AppConversationMessage } from '../types/Conversation';
|
|
3
|
+
import type { LanguageCode } from '../types/Language';
|
|
4
|
+
import type { Customer } from '../types/Customer';
|
|
4
5
|
interface AppStoreState {
|
|
5
6
|
baseHeight: number;
|
|
6
7
|
baseWidth: number;
|
|
@@ -13,7 +14,7 @@ interface AppStoreState {
|
|
|
13
14
|
firstMessage: AppConversationMessage | null;
|
|
14
15
|
setData: (cb: (prevData: AppConversationMessage[] | null) => AppConversationMessage[] | null) => void;
|
|
15
16
|
setFirstMessage: (message: AppConversationMessage | null) => void;
|
|
16
|
-
setCustomer: (createCustomerResponse: Customer) => void;
|
|
17
|
+
setCustomer: (createCustomerResponse: Customer | null) => void;
|
|
17
18
|
setLanguage: (language: LanguageCode) => void;
|
|
18
19
|
setTheme: (theme: 'light' | 'dark') => void;
|
|
19
20
|
setFake: (fake: boolean) => void;
|
|
@@ -25,6 +26,7 @@ interface AppStoreState {
|
|
|
25
26
|
formSubmitted: boolean;
|
|
26
27
|
setForm: (form: Customer) => void;
|
|
27
28
|
}
|
|
29
|
+
export declare const storeCreator: StateCreator<AppStoreState>;
|
|
28
30
|
export declare const useAppStore: import("zustand/traditional").UseBoundStoreWithEqualityFn<Omit<import("zustand").StoreApi<AppStoreState>, "persist"> & {
|
|
29
31
|
persist: {
|
|
30
32
|
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<AppStoreState, unknown>>) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/store/store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,UAAU,aAAa;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,sBAAsB,EAAE,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,GAAG,CAAC;IACZ,YAAY,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC5C,OAAO,EAAE,CACP,EAAE,EAAE,CACF,QAAQ,EAAE,sBAAsB,EAAE,GAAG,IAAI,KACtC,sBAAsB,EAAE,GAAG,IAAI,KACjC,IAAI,CAAC;IACV,eAAe,EAAE,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI,KAAK,IAAI,CAAC;IAClE,WAAW,EAAE,CAAC,sBAAsB,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/D,WAAW,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5C,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,SAAS,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,oBAAoB,EAAE,CAAC,MAAM,EAAE;QAC7B,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB,KAAK,IAAI,CAAC;IACX,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;CACnC;AAED,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,aAAa,CA2CnD,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;EAWvB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LanguageCode } from '../types/Language';
|
|
2
|
+
interface SupportComnyxProps {
|
|
3
|
+
language?: LanguageCode;
|
|
4
|
+
theme?: 'light' | 'dark';
|
|
5
|
+
fake?: boolean;
|
|
6
|
+
onBack: () => void;
|
|
7
|
+
themes?: any;
|
|
8
|
+
rtlFix?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function ComnyxSupport({ language, theme, fake, onBack, themes, }: SupportComnyxProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=ComnyxSupport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComnyxSupport.d.ts","sourceRoot":"","sources":["../../../../src/support/ComnyxSupport.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAUtD,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAe,EACf,KAAc,EACd,IAAY,EACZ,MAAM,EACN,MAAM,GACP,EAAE,kBAAkB,2CAwEpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/support/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiOptions.d.ts","sourceRoot":"","sources":["../../../../src/types/ApiOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IAEzB,IAAI,EAAE,OAAO,CAAC;CACf"}
|
|
@@ -0,0 +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,GAAG,GAAG,IAAI,CAAC;IAClB,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IACjB,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;CAC7D;AAED,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,YAAY,CAAC;IACtD,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,IAAI,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAA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QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,sBAAsB,EAAE,qBAAqB,CAAC;CAC/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalTheme.d.ts","sourceRoot":"","sources":["../../../../src/types/GlobalTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Language.d.ts","sourceRoot":"","sources":["../../../../src/types/Language.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GACpB,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalizationKeys.d.ts","source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,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,UAAU,EAAE,WAoBxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,WAoBvB,CAAC;AAEF,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,WAAW,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../../src/utils/date.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,SACxB,IAAI,GAAG,SAAS,KACrB,MAAM,GAAG,SAWX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepMap.d.ts","sourceRoot":"","sources":["../../../../src/utils/deepMap.ts"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,QAAA,MAAM,OAAO,6BAEC,GAAG,wFAkBhB,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDate.d.ts","sourceRoot":"","sources":["../../../../src/utils/formatDate.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,aAAc,MAAM,SAAS,IAAI,GAAG,IAAI,KAAG,MAYjE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalingUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/scalingUtils.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,CAAC,SAAU,MAAM,WAA6C,CAAC;AAC5E,eAAO,MAAM,EAAE,SAAU,MAAM,WAA6C,CAAC;AAC7E,eAAO,MAAM,EAAE,SAAU,MAAM,4BACO,CAAC;AACvC,eAAO,MAAM,GAAG,SAAU,MAAM,4BACc,CAAC;AAE/C,eAAO,MAAM,KAAK,SAPM,MAAM,WAOR,CAAC;AACvB,eAAO,MAAM,aAAa,SAPD,MAAM,WAOA,CAAC;AAChC,eAAO,MAAM,EAAE,SARU,MAAM,WAQX,CAAC;AACrB,eAAO,MAAM,aAAa,SARD,MAAM,4BAQA,CAAC;AAChC,eAAO,MAAM,qBAAqB,SAPR,MAAM,4BAOQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@developer_tribe/react-native-comnyx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "React Native chat component with integrated support panel, enabling real-time customer communication and efficient agent workflow management.",
|
|
5
|
-
"source": "./src/index.
|
|
5
|
+
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
7
7
|
"module": "./lib/module/index.js",
|
|
8
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
11
|
"import": {
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
"cpp",
|
|
26
27
|
"*.podspec",
|
|
27
28
|
"react-native.config.js",
|
|
29
|
+
"!server-scripts",
|
|
28
30
|
"!ios/build",
|
|
29
31
|
"!android/build",
|
|
30
32
|
"!android/gradle",
|
|
@@ -36,8 +38,21 @@
|
|
|
36
38
|
"!**/__mocks__",
|
|
37
39
|
"!**/.*"
|
|
38
40
|
],
|
|
41
|
+
"codegenConfig": {
|
|
42
|
+
"name": "RNComnyxSpec",
|
|
43
|
+
"type": "modules",
|
|
44
|
+
"jsSrcsDir": "src",
|
|
45
|
+
"outputDir": {
|
|
46
|
+
"ios": "ios/generated",
|
|
47
|
+
"android": "android/generated"
|
|
48
|
+
},
|
|
49
|
+
"android": {
|
|
50
|
+
"javaPackageName": "com.comnyx"
|
|
51
|
+
},
|
|
52
|
+
"includesGeneratedCode": true
|
|
53
|
+
},
|
|
39
54
|
"scripts": {
|
|
40
|
-
"test": "jest",
|
|
55
|
+
"test": "jest --config jest.config.ts",
|
|
41
56
|
"typecheck": "tsc",
|
|
42
57
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
43
58
|
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
@@ -69,9 +84,10 @@
|
|
|
69
84
|
"@react-native-community/cli": "15.0.1",
|
|
70
85
|
"@react-native/eslint-config": "^0.73.1",
|
|
71
86
|
"@release-it/conventional-changelog": "^9.0.2",
|
|
87
|
+
"@testing-library/react-native": "^13.2.0",
|
|
72
88
|
"@types/jest": "^29.5.5",
|
|
73
89
|
"@types/react": "^18.2.44",
|
|
74
|
-
"axios": "1.
|
|
90
|
+
"axios": "1.9.0",
|
|
75
91
|
"commitlint": "^19.6.1",
|
|
76
92
|
"del-cli": "^5.1.0",
|
|
77
93
|
"eslint": "^8.51.0",
|
|
@@ -81,9 +97,11 @@
|
|
|
81
97
|
"prettier": "^3.0.3",
|
|
82
98
|
"react": "19.0.0",
|
|
83
99
|
"react-native": "0.78.1",
|
|
84
|
-
"react-native-builder-bob": "^0.
|
|
100
|
+
"react-native-builder-bob": "^0.33.1",
|
|
101
|
+
"react-test-renderer": "^19.0.0",
|
|
85
102
|
"release-it": "^17.10.0",
|
|
86
|
-
"
|
|
103
|
+
"ts-jest": "^29.3.4",
|
|
104
|
+
"ts-node": "^10.9.2",
|
|
87
105
|
"typescript": "5.1.6",
|
|
88
106
|
"use-sync-external-store": "^1.5.0",
|
|
89
107
|
"zustand": "^5.0.3"
|
|
@@ -96,7 +114,6 @@
|
|
|
96
114
|
"react": "*",
|
|
97
115
|
"react-native": "*"
|
|
98
116
|
},
|
|
99
|
-
"packageManager": "yarn@3.6.1",
|
|
100
117
|
"jest": {
|
|
101
118
|
"preset": "react-native",
|
|
102
119
|
"modulePathIgnorePatterns": [
|
|
@@ -163,7 +180,6 @@
|
|
|
163
180
|
"source": "src",
|
|
164
181
|
"output": "lib",
|
|
165
182
|
"targets": [
|
|
166
|
-
"codegen",
|
|
167
183
|
[
|
|
168
184
|
"commonjs",
|
|
169
185
|
{
|
|
@@ -184,28 +200,11 @@
|
|
|
184
200
|
]
|
|
185
201
|
]
|
|
186
202
|
},
|
|
187
|
-
"codegenConfig": {
|
|
188
|
-
"name": "RNComnyxSpec",
|
|
189
|
-
"type": "modules",
|
|
190
|
-
"jsSrcsDir": "src",
|
|
191
|
-
"outputDir": {
|
|
192
|
-
"ios": "ios/generated",
|
|
193
|
-
"android": "android/generated"
|
|
194
|
-
},
|
|
195
|
-
"android": {
|
|
196
|
-
"javaPackageName": "com.comnyx"
|
|
197
|
-
},
|
|
198
|
-
"includesGeneratedCode": true
|
|
199
|
-
},
|
|
200
|
-
"create-react-native-library": {
|
|
201
|
-
"type": "turbo-module",
|
|
202
|
-
"languages": "kotlin-objc",
|
|
203
|
-
"version": "0.48.6"
|
|
204
|
-
},
|
|
205
203
|
"engines": {
|
|
206
204
|
"node": ">=18.0.0"
|
|
207
205
|
},
|
|
208
206
|
"dependencies": {
|
|
209
207
|
"react-hook-form": "^7.55.0"
|
|
210
|
-
}
|
|
208
|
+
},
|
|
209
|
+
"packageManager": "yarn@1.22.19"
|
|
211
210
|
}
|
package/src/NativeComnyx.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
3
2
|
|
|
4
|
-
export
|
|
5
|
-
|
|
3
|
+
export enum NotificationPermissionStatus {
|
|
4
|
+
GRANTED = 'granted',
|
|
5
|
+
DENIED = 'denied',
|
|
6
|
+
BLOCKED = 'blocked',
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
export
|
|
9
|
+
export interface NativeComnyx {
|
|
10
|
+
initialize(): Promise<boolean>;
|
|
11
|
+
checkOptIn(): Promise<NotificationPermissionStatus>;
|
|
12
|
+
optIn(): Promise<NotificationPermissionStatus>;
|
|
13
|
+
linkToSettings(): Promise<boolean>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const nativeComnyx = NativeModules.Comnyx as NativeComnyx;
|
package/src/api/api.ts
CHANGED
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
const axiosInstance = axios.create({
|
|
3
|
-
|
|
4
|
-
baseURL: 'https://stage.comnyx.com',
|
|
3
|
+
baseURL: 'https://api.comnyx.com',
|
|
5
4
|
headers: {
|
|
6
5
|
'Content-Type': 'application/json',
|
|
7
6
|
},
|
|
8
7
|
timeout: 1000,
|
|
9
8
|
});
|
|
10
9
|
|
|
11
|
-
export function
|
|
10
|
+
export function isInitCalled() {
|
|
11
|
+
return !!axiosInstance.defaults.headers.common.Authorization;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function initApi(token: string, baseURL?: string) {
|
|
12
15
|
axiosInstance.defaults.headers.common['Content-Type'] = 'application/json';
|
|
13
16
|
axiosInstance.defaults.headers.common.Authorization = 'Bearer ' + token;
|
|
14
|
-
axiosInstance.defaults.headers.common['external-id'] = externalId;
|
|
15
17
|
axiosInstance.defaults.baseURL = baseURL || axiosInstance.defaults.baseURL;
|
|
16
18
|
}
|
|
17
19
|
|
|
20
|
+
export function setLoginForAxios(externalId: string) {
|
|
21
|
+
axiosInstance.defaults.headers.common['external-id'] = externalId;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function setLogoutForAxios() {
|
|
25
|
+
axiosInstance.defaults.headers.common['external-id'] = null;
|
|
26
|
+
}
|
|
27
|
+
|
|
18
28
|
export { axiosInstance };
|
package/src/api/customers.ts
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import type { CreateCustomerRequest, Customer } from '../types/Customer';
|
|
2
|
-
import type { ApiOptions } from '../types/ApiOptions';
|
|
3
|
-
import { getFakeCustomer } from '../data/fake/customers';
|
|
4
2
|
import { axiosInstance } from './api';
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
// NOTE: This is not a REST API endpoint. Data is collected with debounce and sent to the server at an appropriate time.
|
|
5
|
+
export function updateCustomer(
|
|
7
6
|
customerData: CreateCustomerRequest,
|
|
8
|
-
|
|
9
|
-
externalId: string
|
|
7
|
+
externalId?: string
|
|
10
8
|
): Promise<{ customer: Customer }> {
|
|
11
|
-
if (options.fake) {
|
|
12
|
-
return Promise.resolve({ customer: getFakeCustomer(customerData) });
|
|
13
|
-
}
|
|
14
9
|
console.info('[Comnyx] Adding customer info');
|
|
15
10
|
return axiosInstance
|
|
16
11
|
.post('/api/customers/create', customerData, {
|
package/src/api/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Text } from 'react-native';
|
|
2
2
|
import type { TextProps } from 'react-native';
|
|
3
3
|
import { LocalizationList } from '../constants/translations';
|
|
4
|
-
import { useAppStore } from '../store';
|
|
5
4
|
import { useThemeColors } from '../hooks/useThemeColors';
|
|
6
5
|
import type { LocalizationKeys } from '../types/LocalizationKeys';
|
|
7
6
|
import { useGlobalTheme } from '../hooks/useTheme';
|
|
7
|
+
import { useAppStore } from '../store/store';
|
|
8
8
|
|
|
9
9
|
export type FamilyWeight = Record<Weight, string | undefined>;
|
|
10
10
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState, useMemo } from 'react';
|
|
2
|
-
import { useAppStore } from '../store';
|
|
3
2
|
import {
|
|
4
3
|
SectionList,
|
|
5
4
|
View,
|
|
@@ -23,6 +22,7 @@ import type { LocalizationKeys } from '../types/LocalizationKeys';
|
|
|
23
22
|
import { ScaledSheet } from './ScaledSheet';
|
|
24
23
|
import { formatDate } from '../utils/formatDate';
|
|
25
24
|
import { activeOpacity } from '../constants/activeOpacity';
|
|
25
|
+
import { useAppStore } from '../store/store';
|
|
26
26
|
|
|
27
27
|
const headphonesIcon = require('../assets/headphones-01.png');
|
|
28
28
|
const closeIcon = require('../assets/x-close.png');
|
|
@@ -38,7 +38,13 @@ function LoadingItem() {
|
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export function ChatList({
|
|
41
|
+
export function ChatList({
|
|
42
|
+
initLoading,
|
|
43
|
+
onBack,
|
|
44
|
+
}: {
|
|
45
|
+
initLoading: boolean;
|
|
46
|
+
onBack?: () => void;
|
|
47
|
+
}) {
|
|
42
48
|
const themeColors = useThemeColors();
|
|
43
49
|
const { height: windowHeight } = useWindowDimensions();
|
|
44
50
|
const MESSAGE_MIN_HEIGHT = 60;
|
|
@@ -46,7 +52,11 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
|
|
|
46
52
|
const MESSAGES_PER_PAGE = Math.ceil(
|
|
47
53
|
(windowHeight - FLATLIST_PADDING) / MESSAGE_MIN_HEIGHT
|
|
48
54
|
);
|
|
49
|
-
const [loading, setLoading] = useState(
|
|
55
|
+
const [loading, setLoading] = useState(initLoading);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
setLoading((l) => l && initLoading);
|
|
58
|
+
}, [initLoading]);
|
|
59
|
+
|
|
50
60
|
const { data, setData, customer, language } = useAppStore((s) => ({
|
|
51
61
|
data: s.data,
|
|
52
62
|
setData: s.setData,
|
|
@@ -9,17 +9,16 @@ import {
|
|
|
9
9
|
ActivityIndicator,
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
import { useForm, Controller } from 'react-hook-form';
|
|
12
|
-
import { useAppStore } from '../store';
|
|
13
12
|
import { createCustomer } from '../api';
|
|
14
13
|
import { AppText } from './AppText';
|
|
15
14
|
import { useLocalize } from '../hooks/useLocalize';
|
|
16
15
|
import { useThemeColors } from '../hooks/useThemeColors';
|
|
17
16
|
import CustomPopup from './CustomAlert';
|
|
18
|
-
import {
|
|
17
|
+
import { useState } from 'react';
|
|
19
18
|
import { ScaledSheet } from './ScaledSheet';
|
|
20
19
|
import type { LocalizationKeys } from '../types/LocalizationKeys';
|
|
21
20
|
import { activeOpacity } from '../constants/activeOpacity';
|
|
22
|
-
import {
|
|
21
|
+
import { useAppStore } from '../store/store';
|
|
23
22
|
|
|
24
23
|
interface CustomerFormData {
|
|
25
24
|
name: string;
|
|
@@ -36,13 +35,19 @@ interface InfoButtonProps {
|
|
|
36
35
|
description: string;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
export function CustomerForm({
|
|
38
|
+
export function CustomerForm({
|
|
39
|
+
loading,
|
|
40
|
+
onBack,
|
|
41
|
+
}: {
|
|
42
|
+
loading: boolean;
|
|
43
|
+
onBack: () => void;
|
|
44
|
+
}) {
|
|
40
45
|
const {
|
|
41
46
|
control,
|
|
42
47
|
handleSubmit,
|
|
43
48
|
formState: { errors },
|
|
44
49
|
} = useForm<CustomerFormData>();
|
|
45
|
-
|
|
50
|
+
|
|
46
51
|
const themeColors = useThemeColors();
|
|
47
52
|
const localize = useLocalize();
|
|
48
53
|
|
|
@@ -58,18 +63,6 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
|
|
|
58
63
|
description: 'null',
|
|
59
64
|
});
|
|
60
65
|
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
if (!accumulator.isListenerCalledOnce()) {
|
|
63
|
-
accumulator.flush().then(() => {
|
|
64
|
-
setTimeout(() => {
|
|
65
|
-
setLoading(false);
|
|
66
|
-
}, 100);
|
|
67
|
-
});
|
|
68
|
-
} else {
|
|
69
|
-
setLoading(false);
|
|
70
|
-
}
|
|
71
|
-
}, []);
|
|
72
|
-
|
|
73
66
|
const onSubmit = async (data: CustomerFormData) => {
|
|
74
67
|
try {
|
|
75
68
|
const res = await createCustomer(
|
|
@@ -78,7 +71,6 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
|
|
|
78
71
|
language: 'en',
|
|
79
72
|
customParameters: [],
|
|
80
73
|
},
|
|
81
|
-
{ fake: useAppStore.getState().fake },
|
|
82
74
|
useAppStore.getState().customer?.external_id ?? ''
|
|
83
75
|
);
|
|
84
76
|
if (res) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TextInput, View, Image, TouchableOpacity } from 'react-native';
|
|
2
|
-
import { useAppStore } from '../store';
|
|
3
2
|
import { useState } from 'react';
|
|
4
3
|
import { sendCustomerMessage } from '../api';
|
|
5
4
|
import { useThemeColors } from '../hooks/useThemeColors';
|
|
@@ -7,6 +6,7 @@ import { ScaledSheet } from './ScaledSheet';
|
|
|
7
6
|
import { useLocalize } from '../hooks/useLocalize';
|
|
8
7
|
import { activeOpacity } from '../constants/activeOpacity';
|
|
9
8
|
import { useIsRtl } from '../hooks/isRtl';
|
|
9
|
+
import { useAppStore } from '../store/store';
|
|
10
10
|
|
|
11
11
|
const sendDark = require('../assets/arrow-right.png');
|
|
12
12
|
|
package/src/hooks/isRtl.ts
CHANGED
package/src/hooks/useLocalize.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import { LocalizationList } from '../constants/translations';
|
|
3
|
-
import { useAppStore } from '../store';
|
|
4
3
|
import type { LocalizationKeys } from '../types/LocalizationKeys';
|
|
4
|
+
import { useAppStore } from '../store/store';
|
|
5
5
|
|
|
6
6
|
export function useLocalize() {
|
|
7
7
|
const { language } = useAppStore((s) => ({
|
package/src/hooks/usePolling.ts
CHANGED
package/src/hooks/useTheme.ts
CHANGED
package/src/index.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { Comnyx } from './register';
|
|
2
|
+
export { ComnyxSupport } from './support';
|
|
3
|
+
export { ComnyxNotifications } from './notifications';
|
|
4
|
+
|
|
5
|
+
//types
|
|
6
|
+
export { NotificationPermissionStatus } from './NativeComnyx';
|
|
7
|
+
|
|
8
|
+
//deprecated
|
|
9
|
+
export { registerOneSignalForComnyx } from './register/collectData';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Platform, type EmitterSubscription } from 'react-native';
|
|
2
|
+
import { NativeEventEmitter } from 'react-native';
|
|
3
|
+
import { NativeModules } from 'react-native';
|
|
4
|
+
import { nativeComnyx, type NativeComnyx } from '../NativeComnyx';
|
|
5
|
+
|
|
6
|
+
const comnyxEmitter =
|
|
7
|
+
Platform.OS === 'android'
|
|
8
|
+
? new NativeEventEmitter() //TODO2: fix
|
|
9
|
+
: new NativeEventEmitter(NativeModules.Comnyx);
|
|
10
|
+
|
|
11
|
+
type ComnyxNotificationsEventType =
|
|
12
|
+
| 'TOKEN_INIT'
|
|
13
|
+
| 'TOKEN_FAILED'
|
|
14
|
+
| 'NOTIFICATION_RECEIVED'
|
|
15
|
+
| 'NOTIFICATION_CLICKED';
|
|
16
|
+
|
|
17
|
+
type ComnyxNotificationsEventResult = {
|
|
18
|
+
TOKEN_INIT: {
|
|
19
|
+
type: string;
|
|
20
|
+
token: string;
|
|
21
|
+
};
|
|
22
|
+
TOKEN_FAILED: {
|
|
23
|
+
type: string;
|
|
24
|
+
token: null;
|
|
25
|
+
};
|
|
26
|
+
NOTIFICATION_RECEIVED: unknown;
|
|
27
|
+
NOTIFICATION_CLICKED: unknown;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
interface ComnyxNotificationsType extends NativeComnyx {
|
|
31
|
+
addEventListener<T extends ComnyxNotificationsEventType>(
|
|
32
|
+
event: T,
|
|
33
|
+
listener: (event: ComnyxNotificationsEventResult[T]) => void
|
|
34
|
+
): EmitterSubscription;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const ComnyxNotifications: ComnyxNotificationsType = {
|
|
38
|
+
initialize: nativeComnyx.initialize,
|
|
39
|
+
optIn: nativeComnyx.optIn,
|
|
40
|
+
checkOptIn: nativeComnyx.checkOptIn,
|
|
41
|
+
linkToSettings: nativeComnyx.linkToSettings,
|
|
42
|
+
addEventListener: function <T extends ComnyxNotificationsEventType>(
|
|
43
|
+
eventType: T,
|
|
44
|
+
listener: (event: ComnyxNotificationsEventResult[T]) => void
|
|
45
|
+
): EmitterSubscription {
|
|
46
|
+
return comnyxEmitter.addListener(eventType, (event) => {
|
|
47
|
+
listener(event);
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { CreateCustomerRequest } from '
|
|
1
|
+
import type { CreateCustomerRequest } from '../types/Customer';
|
|
2
2
|
|
|
3
3
|
const ACCUMULATOR_DEBOUNCE_TIME_IN_MS = 3000;
|
|
4
4
|
|
|
5
|
-
class Accumulator {
|
|
5
|
+
export class Accumulator {
|
|
6
6
|
private registerData: CreateCustomerRequest | null = null;
|
|
7
7
|
private __select_time: NodeJS.Timeout | undefined = undefined;
|
|
8
8
|
private listener: ((data: CreateCustomerRequest) => Promise<void>) | null =
|
|
@@ -95,6 +95,18 @@ class Accumulator {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
clear() {
|
|
99
|
+
this.registerData = null;
|
|
100
|
+
if (this.__select_time) {
|
|
101
|
+
clearTimeout(this.__select_time);
|
|
102
|
+
}
|
|
103
|
+
this._isListenerCalledOnce = false;
|
|
104
|
+
}
|
|
105
|
+
//TODO: fix naming -- for testing
|
|
106
|
+
empty() {
|
|
107
|
+
this.registerData = {};
|
|
108
|
+
}
|
|
109
|
+
|
|
98
110
|
get() {
|
|
99
111
|
return this.registerData;
|
|
100
112
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { login } from './login';
|
|
2
|
+
import { collectData } from './collectData';
|
|
3
|
+
import { logout } from './logout';
|
|
4
|
+
import { init } from './init';
|
|
5
|
+
|
|
6
|
+
export const Comnyx = {
|
|
7
|
+
init: init,
|
|
8
|
+
login: login,
|
|
9
|
+
logout: logout,
|
|
10
|
+
collectData: collectData,
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { initApi } from '../api/api';
|
|
2
|
+
|
|
3
|
+
interface InitOptions {
|
|
4
|
+
token: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface ExtendedInitOptions extends InitOptions {
|
|
8
|
+
baseURL?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function init(initOptions: InitOptions) {
|
|
12
|
+
if (!initOptions.token) {
|
|
13
|
+
throw new Error('App token is required');
|
|
14
|
+
}
|
|
15
|
+
initApi(initOptions.token, (initOptions as ExtendedInitOptions).baseURL);
|
|
16
|
+
}
|