@metarouter/react-native-sdk 0.1.16 → 0.1.18
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/README.md +91 -23
- package/lib/MetaRouter.d.ts +2 -24
- package/lib/MetaRouter.d.ts.map +1 -1
- package/lib/MetaRouter.js +5 -52
- package/lib/analytics/IdentityManager.d.ts +14 -0
- package/lib/analytics/IdentityManager.d.ts.map +1 -0
- package/lib/analytics/IdentityManager.js +51 -0
- package/lib/analytics/MetaRouterAnalyticsClient.d.ts +64 -0
- package/lib/analytics/MetaRouterAnalyticsClient.d.ts.map +1 -0
- package/lib/analytics/MetaRouterAnalyticsClient.js +196 -0
- package/lib/analytics/enrichEvent.d.ts +3 -0
- package/lib/analytics/enrichEvent.d.ts.map +1 -0
- package/lib/analytics/enrichEvent.js +14 -0
- package/lib/analytics/init.d.ts +5 -0
- package/lib/analytics/init.d.ts.map +1 -0
- package/lib/analytics/init.js +36 -0
- package/lib/analytics/proxy/proxyClient.d.ts +4 -0
- package/lib/analytics/proxy/proxyClient.d.ts.map +1 -0
- package/lib/{proxyClient.js → analytics/proxy/proxyClient.js} +3 -4
- package/lib/analytics/types.d.ts +54 -0
- package/lib/analytics/types.d.ts.map +1 -0
- package/lib/analytics/types.js +1 -0
- package/lib/analytics/utils/anonymousId.d.ts +2 -0
- package/lib/analytics/utils/anonymousId.d.ts.map +1 -0
- package/lib/analytics/utils/anonymousId.js +26 -0
- package/lib/analytics/utils/contextInfo.d.ts +19 -0
- package/lib/analytics/utils/contextInfo.d.ts.map +1 -0
- package/lib/analytics/utils/contextInfo.js +35 -0
- package/lib/analytics/utils/logger.d.ts +5 -0
- package/lib/analytics/utils/logger.d.ts.map +1 -0
- package/lib/analytics/utils/logger.js +16 -0
- package/lib/analytics/utils/retry.d.ts +2 -0
- package/lib/analytics/utils/retry.d.ts.map +1 -0
- package/lib/analytics/utils/retry.js +17 -0
- package/lib/analytics/utils/timezone.d.ts +2 -0
- package/lib/analytics/utils/timezone.d.ts.map +1 -0
- package/lib/analytics/utils/timezone.js +8 -0
- package/lib/index.d.ts +7 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -2
- package/lib/react/context.d.ts +8 -0
- package/lib/react/context.d.ts.map +1 -0
- package/lib/react/context.js +5 -0
- package/lib/react/useMetaRouter.d.ts +5 -0
- package/lib/react/useMetaRouter.d.ts.map +1 -0
- package/lib/react/useMetaRouter.js +10 -0
- package/lib/types.d.ts +9 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +1 -0
- package/package.json +11 -12
- package/MetaRouterReactNativeSDK.podspec +0 -26
- package/android/build/generated/ksp/debug/java/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl.java +0 -244
- package/android/build/generated/ksp/debug/java/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl.java +0 -165
- package/android/build/generated/source/buildConfig/debug/com/metarouter/reactnativesdk/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -7
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/metarouter/reactnativesdk/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/metarouter/reactnativesdk/MetaRouterReactNativeSDKPackage.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageErrorUtil.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageExpoMigration.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$2.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$3.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$4.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$5.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$6.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStoragePackage$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/NativeAsyncStorageModuleSpec.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/ReactDatabaseSupplier.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/SerialExecutor$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/SerialExecutor.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$2.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$3.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$4.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$5.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$6.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$7.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/linusu/RNGetRandomValuesModule.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/linusu/RNGetRandomValuesPackage.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -7
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -7
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/metarouter_react-native-sdk_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/ArgumentHelpersKt.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/AsyncStorageAccess.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/AsyncStorageError$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/AsyncStorageError.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/Entry.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/ErrorHelpersKt$createExceptionHandler$$inlined$CoroutineExceptionHandler$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/ErrorHelpersKt.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/MIGRATION_TO_NEXT.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDao$DefaultImpls.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDao$mergeValues$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDao.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDb$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDb.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$clear$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$getAllKeys$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiGet$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiMerge$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiRemove$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiSet$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageSupplier$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageSupplier.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageSupplierKt.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativeModule$onInitialized$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativeModule$toHexString$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativePackage$createNativeModules$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativePackage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/ConnectionType.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/Sovran$Action.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/Sovran$createNativeModules$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/Sovran.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/SovranModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/SovranModule$onInitialized$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/SovranModule.class +0 -0
- package/android/build.gradle +0 -55
- package/android/consumer-rules.pro +0 -0
- package/android/src/main/java/com/metarouter/reactnativesdk/MetaRouterReactNativeSDKPackage.java +0 -54
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.java +0 -178
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageErrorUtil.java +0 -45
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageExpoMigration.java +0 -154
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java +0 -410
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java +0 -93
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/BuildConfig.java +0 -8
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/NativeAsyncStorageModuleSpec.java +0 -47
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/ReactDatabaseSupplier.java +0 -163
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/SerialExecutor.java +0 -40
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/build.gradle +0 -122
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/config.gradle +0 -125
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/ArgumentHelpers.kt +0 -86
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/ErrorHelpers.kt +0 -39
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageModule.kt +0 -94
- package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageSupplier.kt +0 -161
- package/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.kt +0 -267
- package/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativePackage.kt +0 -43
- package/android/src/main/java/com/sovranreactnative/Sovran.kt +0 -45
- package/android/src/main/java/com/sovranreactnative/SovranModule.kt +0 -55
- package/android/src/main/java/org/linusu/RNGetRandomValuesModule.java +0 -36
- package/android/src/main/java/org/linusu/RNGetRandomValuesPackage.java +0 -28
- package/lib/MetaRouterPlugin.d.ts +0 -10
- package/lib/MetaRouterPlugin.d.ts.map +0 -1
- package/lib/MetaRouterPlugin.js +0 -23
- package/lib/context.d.ts +0 -8
- package/lib/context.d.ts.map +0 -1
- package/lib/context.js +0 -9
- package/lib/createMetaRouterClient.d.ts +0 -3
- package/lib/createMetaRouterClient.d.ts.map +0 -1
- package/lib/createMetaRouterClient.js +0 -7
- package/lib/proxyClient.d.ts +0 -4
- package/lib/proxyClient.d.ts.map +0 -1
- package/react-native.config.js +0 -37
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { MetaRouterAnalyticsClient } from './MetaRouterAnalyticsClient';
|
|
2
|
+
import { proxyClient, setRealClient } from './proxy/proxyClient';
|
|
3
|
+
let initialized = false;
|
|
4
|
+
let client = null;
|
|
5
|
+
let analyticsInterface = null;
|
|
6
|
+
export async function initAnalytics(options) {
|
|
7
|
+
if (initialized)
|
|
8
|
+
return analyticsInterface;
|
|
9
|
+
client = new MetaRouterAnalyticsClient(options);
|
|
10
|
+
// Wait for the client to fully initialize (including anonymous ID loading)
|
|
11
|
+
await client.waitForInitialization();
|
|
12
|
+
analyticsInterface = {
|
|
13
|
+
track: (event, props) => client.track(event, props),
|
|
14
|
+
identify: (userId, traits) => client.identify(userId, traits),
|
|
15
|
+
group: (groupId, traits) => client.group(groupId, traits),
|
|
16
|
+
screen: (name, props) => client.screen(name, props),
|
|
17
|
+
alias: (newUserId) => client.alias(newUserId),
|
|
18
|
+
flush: () => client.flush(),
|
|
19
|
+
cleanup: () => client.cleanup(),
|
|
20
|
+
enableDebugLogging: () => client.enableDebugLogging(),
|
|
21
|
+
getDebugInfo: () => client.getDebugInfo(),
|
|
22
|
+
};
|
|
23
|
+
initialized = true;
|
|
24
|
+
setRealClient(analyticsInterface);
|
|
25
|
+
return analyticsInterface;
|
|
26
|
+
}
|
|
27
|
+
export function getAnalyticsClient() {
|
|
28
|
+
return initialized ? analyticsInterface : proxyClient;
|
|
29
|
+
}
|
|
30
|
+
export async function resetAnalytics() {
|
|
31
|
+
await (client === null || client === void 0 ? void 0 : client.cleanup());
|
|
32
|
+
client = null;
|
|
33
|
+
analyticsInterface = null;
|
|
34
|
+
initialized = false;
|
|
35
|
+
setRealClient(null);
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxyClient.d.ts","sourceRoot":"","sources":["../../../src/analytics/proxy/proxyClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAiBnD,eAAO,MAAM,WAAW,EAAE,kBAQzB,CAAC;AAEF,wBAAgB,aAAa,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,QAM9D"}
|
|
@@ -4,7 +4,6 @@ function handleMethodCall(methodName, ...args) {
|
|
|
4
4
|
if (realClient) {
|
|
5
5
|
return realClient[methodName](...args);
|
|
6
6
|
}
|
|
7
|
-
// Queue the call for later execution
|
|
8
7
|
pendingCalls.push(() => {
|
|
9
8
|
if (realClient) {
|
|
10
9
|
realClient[methodName](...args);
|
|
@@ -20,9 +19,9 @@ export const proxyClient = {
|
|
|
20
19
|
flush: () => handleMethodCall('flush'),
|
|
21
20
|
cleanup: () => handleMethodCall('cleanup'),
|
|
22
21
|
};
|
|
23
|
-
export function setRealClient(
|
|
24
|
-
realClient =
|
|
25
|
-
if (
|
|
22
|
+
export function setRealClient(client) {
|
|
23
|
+
realClient = client;
|
|
24
|
+
if (client) {
|
|
26
25
|
pendingCalls.forEach((fn) => fn());
|
|
27
26
|
pendingCalls.length = 0;
|
|
28
27
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type EventType = 'track' | 'identify' | 'group' | 'screen' | 'alias' | 'page';
|
|
2
|
+
export interface EventPayload {
|
|
3
|
+
type: EventType;
|
|
4
|
+
event?: string;
|
|
5
|
+
userId?: string;
|
|
6
|
+
groupId?: string;
|
|
7
|
+
traits?: Record<string, any>;
|
|
8
|
+
properties?: Record<string, any>;
|
|
9
|
+
timestamp?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface InitOptions {
|
|
12
|
+
writeKey: string;
|
|
13
|
+
ingestionEndpoint: string;
|
|
14
|
+
flushInterval?: number;
|
|
15
|
+
debug?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface AnalyticsInterface {
|
|
18
|
+
track: (event: string, props?: Record<string, any>) => void;
|
|
19
|
+
identify: (userId: string, traits?: Record<string, any>) => void;
|
|
20
|
+
group: (groupId: string, traits?: Record<string, any>) => void;
|
|
21
|
+
screen: (name: string, props?: Record<string, any>) => void;
|
|
22
|
+
alias: (newUserId: string) => void;
|
|
23
|
+
flush: () => void;
|
|
24
|
+
cleanup: () => void;
|
|
25
|
+
enableDebugLogging?: () => void;
|
|
26
|
+
getDebugInfo?: () => Record<string, any>;
|
|
27
|
+
}
|
|
28
|
+
export interface EventContext {
|
|
29
|
+
library: {
|
|
30
|
+
name: string;
|
|
31
|
+
version: string;
|
|
32
|
+
};
|
|
33
|
+
locale?: string;
|
|
34
|
+
timezone?: string;
|
|
35
|
+
device: {
|
|
36
|
+
manufacturer: string;
|
|
37
|
+
model: string;
|
|
38
|
+
osName: string;
|
|
39
|
+
osVersion: string;
|
|
40
|
+
};
|
|
41
|
+
app: {
|
|
42
|
+
version: string;
|
|
43
|
+
build: string;
|
|
44
|
+
};
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
}
|
|
47
|
+
export interface EnrichedEventPayload extends EventPayload {
|
|
48
|
+
anonymousId: string;
|
|
49
|
+
messageId: string;
|
|
50
|
+
sentAt: string;
|
|
51
|
+
context: EventContext;
|
|
52
|
+
writeKey: string;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/analytics/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAErF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAC5D,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IACjE,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAC/D,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAC5D,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE;QACN,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,GAAG,EAAE;QACH,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anonymousId.d.ts","sourceRoot":"","sources":["../../../src/analytics/utils/anonymousId.ts"],"names":[],"mappings":"AAMA,wBAAsB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAsBtD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
2
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
+
import { log, warn } from './logger';
|
|
4
|
+
const STORAGE_KEY = 'metarouter:anonymous_id';
|
|
5
|
+
export async function getAnonymousId() {
|
|
6
|
+
try {
|
|
7
|
+
const existing = await AsyncStorage.getItem(STORAGE_KEY);
|
|
8
|
+
if (existing) {
|
|
9
|
+
log('Retrieved existing anonymous ID from storage');
|
|
10
|
+
return existing;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
warn('Failed to read anonymous ID from storage, generating new one', error);
|
|
15
|
+
}
|
|
16
|
+
const anonId = uuidv4();
|
|
17
|
+
log('Generated new anonymous ID:', anonId);
|
|
18
|
+
try {
|
|
19
|
+
await AsyncStorage.setItem(STORAGE_KEY, anonId);
|
|
20
|
+
log('Stored anonymous ID in storage');
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
warn('Failed to store anonymous ID in storage, but continuing with generated ID', error);
|
|
24
|
+
}
|
|
25
|
+
return anonId;
|
|
26
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function getContextInfo(): {
|
|
2
|
+
library: {
|
|
3
|
+
name: string;
|
|
4
|
+
version: string;
|
|
5
|
+
};
|
|
6
|
+
locale: string;
|
|
7
|
+
timezone: string;
|
|
8
|
+
device: {
|
|
9
|
+
manufacturer: any;
|
|
10
|
+
model: any;
|
|
11
|
+
osName: any;
|
|
12
|
+
osVersion: any;
|
|
13
|
+
};
|
|
14
|
+
app: {
|
|
15
|
+
version: any;
|
|
16
|
+
build: any;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=contextInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextInfo.d.ts","sourceRoot":"","sources":["../../../src/analytics/utils/contextInfo.ts"],"names":[],"mappings":"AAUA,wBAAgB,cAAc;;;;;;;;;;;;;;;;;EA0B7B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { getTimeZone } from './timezone';
|
|
2
|
+
import pkg from '../../../package.json';
|
|
3
|
+
let DeviceInfo = null;
|
|
4
|
+
try {
|
|
5
|
+
DeviceInfo = require('react-native-device-info');
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
DeviceInfo = null;
|
|
9
|
+
}
|
|
10
|
+
export function getContextInfo() {
|
|
11
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
12
|
+
let locale = 'en-US';
|
|
13
|
+
if (typeof Intl !== 'undefined' && typeof Intl.DateTimeFormat === 'function') {
|
|
14
|
+
const resolved = Intl.DateTimeFormat().resolvedOptions();
|
|
15
|
+
locale = (_a = resolved.locale) !== null && _a !== void 0 ? _a : locale;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
library: {
|
|
19
|
+
name: 'metarouter-react-native-sdk',
|
|
20
|
+
version: (_b = pkg.version) !== null && _b !== void 0 ? _b : '0.0.0',
|
|
21
|
+
},
|
|
22
|
+
locale,
|
|
23
|
+
timezone: getTimeZone(),
|
|
24
|
+
device: {
|
|
25
|
+
manufacturer: (_d = (_c = DeviceInfo === null || DeviceInfo === void 0 ? void 0 : DeviceInfo.getManufacturer) === null || _c === void 0 ? void 0 : _c.call(DeviceInfo)) !== null && _d !== void 0 ? _d : 'unknown',
|
|
26
|
+
model: (_f = (_e = DeviceInfo === null || DeviceInfo === void 0 ? void 0 : DeviceInfo.getModel) === null || _e === void 0 ? void 0 : _e.call(DeviceInfo)) !== null && _f !== void 0 ? _f : 'unknown',
|
|
27
|
+
osName: (_h = (_g = DeviceInfo === null || DeviceInfo === void 0 ? void 0 : DeviceInfo.getSystemName) === null || _g === void 0 ? void 0 : _g.call(DeviceInfo)) !== null && _h !== void 0 ? _h : 'unknown',
|
|
28
|
+
osVersion: (_k = (_j = DeviceInfo === null || DeviceInfo === void 0 ? void 0 : DeviceInfo.getSystemVersion) === null || _j === void 0 ? void 0 : _j.call(DeviceInfo)) !== null && _k !== void 0 ? _k : 'unknown',
|
|
29
|
+
},
|
|
30
|
+
app: {
|
|
31
|
+
version: (_o = (_m = (_l = DeviceInfo === null || DeviceInfo === void 0 ? void 0 : DeviceInfo.getVersion) === null || _l === void 0 ? void 0 : _l.call(DeviceInfo)) !== null && _m !== void 0 ? _m : pkg.version) !== null && _o !== void 0 ? _o : 'unknown',
|
|
32
|
+
build: (_q = (_p = DeviceInfo === null || DeviceInfo === void 0 ? void 0 : DeviceInfo.getBuildNumber) === null || _p === void 0 ? void 0 : _p.call(DeviceInfo)) !== null && _q !== void 0 ? _q : 'unknown',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/analytics/utils/logger.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,QAE7C;AAED,wBAAgB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,QAEjC;AAED,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,QAGlC;AAED,wBAAgB,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,QAGnC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
let enabled = false;
|
|
2
|
+
export function setDebugLogging(value) {
|
|
3
|
+
enabled = value;
|
|
4
|
+
}
|
|
5
|
+
export function log(...args) {
|
|
6
|
+
if (enabled)
|
|
7
|
+
console.log('[MetaRouter]', ...args);
|
|
8
|
+
}
|
|
9
|
+
export function warn(...args) {
|
|
10
|
+
// Always log warnings, even when debug is disabled
|
|
11
|
+
console.warn('[MetaRouter]', ...args);
|
|
12
|
+
}
|
|
13
|
+
export function error(...args) {
|
|
14
|
+
// Always log errors, even when debug is disabled
|
|
15
|
+
console.error('[MetaRouter]', ...args);
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../src/analytics/utils/retry.ts"],"names":[],"mappings":"AAAA,wBAAsB,gBAAgB,CAAC,CAAC,EACpC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,OAAO,SAAI,EACX,WAAW,SAAO,EAClB,KAAK,IAAI,IAAI,MAAM,qBAA8C,GAChE,OAAO,CAAC,CAAC,CAAC,CAiBZ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export async function retryWithBackoff(fn, retries = 5, baseDelayMs = 1000, sleep = (ms) => new Promise((res) => setTimeout(res, ms))) {
|
|
2
|
+
let attempt = 0;
|
|
3
|
+
while (attempt < retries) {
|
|
4
|
+
try {
|
|
5
|
+
return await fn();
|
|
6
|
+
}
|
|
7
|
+
catch (err) {
|
|
8
|
+
attempt++;
|
|
9
|
+
if (attempt === retries)
|
|
10
|
+
throw err;
|
|
11
|
+
const jitter = Math.random() * 100;
|
|
12
|
+
const delay = baseDelayMs * 2 ** (attempt - 1) + jitter;
|
|
13
|
+
await sleep(delay);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
throw new Error('Exhausted all retries');
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timezone.d.ts","sourceRoot":"","sources":["../../../src/analytics/utils/timezone.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,IAAI,MAAM,CAMlC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { MetaRouter } from "./MetaRouter";
|
|
2
|
+
export default MetaRouter;
|
|
3
|
+
export { MetaRouter };
|
|
4
|
+
export { MetaRouterProvider } from "./react/context";
|
|
5
|
+
export { useMetaRouter } from "./react/useMetaRouter";
|
|
6
|
+
export type { InitOptions, AnalyticsInterface } from "./analytics/types";
|
|
7
|
+
export type { MetaRouterInterface } from "./types";
|
|
3
8
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACzE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { MetaRouter } from "./MetaRouter";
|
|
2
|
+
export default MetaRouter;
|
|
3
|
+
export { MetaRouter };
|
|
4
|
+
export { MetaRouterProvider } from "./react/context";
|
|
5
|
+
export { useMetaRouter } from "./react/useMetaRouter";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import type { MetaRouterInterface } from "../types";
|
|
3
|
+
export declare const MetaRouterContext: React.Context<MetaRouterInterface | null>;
|
|
4
|
+
export declare const MetaRouterProvider: ({ children, instance, }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
instance: MetaRouterInterface;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/react/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,eAAO,MAAM,iBAAiB,2CAE7B,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,yBAGhC;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,mBAAmB,CAAC;CAC/B,sBAMA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMetaRouter.d.ts","sourceRoot":"","sources":["../../src/react/useMetaRouter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,eAAO,MAAM,aAAa,QAAO;IAAE,SAAS,EAAE,kBAAkB,CAAA;CAQ7D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { MetaRouterContext } from "./context";
|
|
3
|
+
export const useMetaRouter = () => {
|
|
4
|
+
const ctx = useContext(MetaRouterContext);
|
|
5
|
+
if (!ctx)
|
|
6
|
+
throw new Error("useMetaRouter must be used within MetaRouterProvider");
|
|
7
|
+
return {
|
|
8
|
+
analytics: ctx.analytics.getClient(),
|
|
9
|
+
};
|
|
10
|
+
};
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { InitOptions, AnalyticsInterface } from "./analytics/types";
|
|
2
|
+
export interface MetaRouterInterface {
|
|
3
|
+
analytics: {
|
|
4
|
+
init: (opts: InitOptions) => Promise<AnalyticsInterface>;
|
|
5
|
+
getClient: () => AnalyticsInterface;
|
|
6
|
+
reset: () => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE;QACT,IAAI,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;QACzD,SAAS,EAAE,MAAM,kBAAkB,CAAC;QACpC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;KAC5B,CAAC;CACH"}
|
package/lib/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metarouter/react-native-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -8,20 +8,17 @@
|
|
|
8
8
|
"import": "./lib/index.js",
|
|
9
9
|
"require": "./lib/index.js",
|
|
10
10
|
"types": "./lib/index.d.ts"
|
|
11
|
-
}
|
|
12
|
-
"./react-native.config.js": "./react-native.config.js"
|
|
11
|
+
}
|
|
13
12
|
},
|
|
14
13
|
"files": [
|
|
15
14
|
"lib",
|
|
16
|
-
"react-native.config.js"
|
|
17
|
-
"MetaRouterReactNativeSDK.podspec",
|
|
18
|
-
"android"
|
|
15
|
+
"react-native.config.js"
|
|
19
16
|
],
|
|
20
17
|
"scripts": {
|
|
21
18
|
"clean": "rm -rf lib",
|
|
22
19
|
"build": "tsc --project tsconfig.build.json",
|
|
23
20
|
"prepare": "npm run build",
|
|
24
|
-
"
|
|
21
|
+
"prePublishOnly": "npm run clean && npm run build",
|
|
25
22
|
"test": "jest"
|
|
26
23
|
},
|
|
27
24
|
"publishConfig": {
|
|
@@ -39,19 +36,21 @@
|
|
|
39
36
|
"url": "https://github.com/metarouterio/react-native-sdk"
|
|
40
37
|
},
|
|
41
38
|
"dependencies": {
|
|
42
|
-
"
|
|
43
|
-
"@segment/analytics-react-native": "^2.21.2",
|
|
44
|
-
"@segment/sovran-react-native": "^1.1.3",
|
|
45
|
-
"react-native-get-random-values": "^1.11.0"
|
|
39
|
+
"uuid": "^11.1.0"
|
|
46
40
|
},
|
|
47
41
|
"peerDependencies": {
|
|
42
|
+
"@react-native-async-storage/async-storage": ">=2.2.0",
|
|
48
43
|
"react": "*",
|
|
49
|
-
"react-native": "*"
|
|
44
|
+
"react-native": "*",
|
|
45
|
+
"react-native-device-info": "^14.0.4"
|
|
50
46
|
},
|
|
51
47
|
"devDependencies": {
|
|
48
|
+
"@react-native-async-storage/async-storage": ">=2.2.0",
|
|
49
|
+
"@types/jest": "^30.0.0",
|
|
52
50
|
"@types/react": "^19.1.8",
|
|
53
51
|
"jest": "^30.0.4",
|
|
54
52
|
"metro-react-native-babel-preset": "^0.77.0",
|
|
53
|
+
"react-native-device-info": "^14.0.4",
|
|
55
54
|
"typescript": "^5.8.3"
|
|
56
55
|
},
|
|
57
56
|
"react-native": "./lib/index.js"
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
Pod::Spec.new do |s|
|
|
2
|
-
s.name = 'MetaRouterReactNativeSDK'
|
|
3
|
-
s.version = '0.1.0'
|
|
4
|
-
s.summary = 'MetaRouter analytics wrapper for React Native'
|
|
5
|
-
s.description = 'MetaRouter analytics SDK that handles event routing.'
|
|
6
|
-
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
|
7
|
-
s.authors = { 'Chris Houdlette' => 'chris@example.com' }
|
|
8
|
-
s.homepage = 'https://github.com/metarouterio/react-native-sdk'
|
|
9
|
-
s.source = { :git => 'https://github.com/metarouterio/react-native-sdk.git', :tag => s.version.to_s }
|
|
10
|
-
|
|
11
|
-
s.platform = :ios, '12.0'
|
|
12
|
-
s.requires_arc = true
|
|
13
|
-
s.swift_version = '5.0'
|
|
14
|
-
|
|
15
|
-
# No need to manually specify source_files if your SDK has no native code
|
|
16
|
-
# s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
17
|
-
|
|
18
|
-
# React Native internals
|
|
19
|
-
s.dependency 'React-Core'
|
|
20
|
-
|
|
21
|
-
# Real native dependencies that you want CocoaPods to fetch and install
|
|
22
|
-
s.dependency 'AnalyticsReactNative', '~> 2.21.2'
|
|
23
|
-
s.dependency 'SovranReactNative', '~> 1.1.3'
|
|
24
|
-
s.dependency 'react-native-get-random-values', '~> 1.11.0'
|
|
25
|
-
s.dependency 'RNCAsyncStorage', '~> 2.2.0'
|
|
26
|
-
end
|