@metarouter/react-native-sdk 0.1.15 → 0.1.17

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.
Files changed (276) hide show
  1. package/README.md +49 -22
  2. package/lib/MetaRouter.d.ts +2 -24
  3. package/lib/MetaRouter.d.ts.map +1 -1
  4. package/lib/MetaRouter.js +5 -52
  5. package/lib/analytics/IdentityManager.d.ts +14 -0
  6. package/lib/analytics/IdentityManager.d.ts.map +1 -0
  7. package/lib/analytics/IdentityManager.js +38 -0
  8. package/lib/analytics/MetaRouterAnalyticsClient.d.ts +45 -0
  9. package/lib/analytics/MetaRouterAnalyticsClient.d.ts.map +1 -0
  10. package/lib/analytics/MetaRouterAnalyticsClient.js +127 -0
  11. package/lib/analytics/enrichEvent.d.ts +3 -0
  12. package/lib/analytics/enrichEvent.d.ts.map +1 -0
  13. package/lib/analytics/enrichEvent.js +14 -0
  14. package/lib/analytics/init.d.ts +5 -0
  15. package/lib/analytics/init.d.ts.map +1 -0
  16. package/lib/analytics/init.js +32 -0
  17. package/lib/analytics/proxy/proxyClient.d.ts +4 -0
  18. package/lib/analytics/proxy/proxyClient.d.ts.map +1 -0
  19. package/lib/{proxyClient.js → analytics/proxy/proxyClient.js} +3 -4
  20. package/lib/analytics/types.d.ts +52 -0
  21. package/lib/analytics/types.d.ts.map +1 -0
  22. package/lib/analytics/types.js +1 -0
  23. package/lib/analytics/utils/anonymousId.d.ts +2 -0
  24. package/lib/analytics/utils/anonymousId.d.ts.map +1 -0
  25. package/lib/analytics/utils/anonymousId.js +11 -0
  26. package/lib/analytics/utils/contextInfo.d.ts +19 -0
  27. package/lib/analytics/utils/contextInfo.d.ts.map +1 -0
  28. package/lib/analytics/utils/contextInfo.js +35 -0
  29. package/lib/analytics/utils/logger.d.ts +4 -0
  30. package/lib/analytics/utils/logger.d.ts.map +1 -0
  31. package/lib/analytics/utils/logger.js +12 -0
  32. package/lib/analytics/utils/retry.d.ts +2 -0
  33. package/lib/analytics/utils/retry.d.ts.map +1 -0
  34. package/lib/analytics/utils/retry.js +17 -0
  35. package/lib/analytics/utils/timezone.d.ts +2 -0
  36. package/lib/analytics/utils/timezone.d.ts.map +1 -0
  37. package/lib/analytics/utils/timezone.js +8 -0
  38. package/lib/index.d.ts +6 -2
  39. package/lib/index.d.ts.map +1 -1
  40. package/lib/index.js +4 -2
  41. package/lib/react/context.d.ts +9 -0
  42. package/lib/react/context.d.ts.map +1 -0
  43. package/lib/react/context.js +12 -0
  44. package/lib/react/useMetaRouter.d.ts +3 -0
  45. package/lib/react/useMetaRouter.d.ts.map +1 -0
  46. package/lib/react/useMetaRouter.js +8 -0
  47. package/lib/types.d.ts +9 -0
  48. package/lib/types.d.ts.map +1 -0
  49. package/lib/types.js +1 -0
  50. package/package.json +11 -12
  51. package/MetaRouterReactNativeSDK.podspec +0 -28
  52. package/android/build/generated/ksp/debug/java/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl.java +0 -244
  53. package/android/build/generated/ksp/debug/java/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl.java +0 -165
  54. package/android/build/generated/source/buildConfig/debug/com/metarouter/reactnativesdk/BuildConfig.java +0 -10
  55. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -7
  56. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
  57. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
  58. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
  59. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  60. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  61. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  62. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
  63. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  64. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/metarouter/reactnativesdk/BuildConfig.class +0 -0
  65. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/metarouter/reactnativesdk/MetaRouterReactNativeSDKPackage.class +0 -0
  66. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.class +0 -0
  67. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageErrorUtil.class +0 -0
  68. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageExpoMigration.class +0 -0
  69. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$1.class +0 -0
  70. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$2.class +0 -0
  71. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$3.class +0 -0
  72. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$4.class +0 -0
  73. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$5.class +0 -0
  74. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule$6.class +0 -0
  75. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStorageModule.class +0 -0
  76. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStoragePackage$1.class +0 -0
  77. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.class +0 -0
  78. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/BuildConfig.class +0 -0
  79. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/NativeAsyncStorageModuleSpec.class +0 -0
  80. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/ReactDatabaseSupplier.class +0 -0
  81. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/SerialExecutor$1.class +0 -0
  82. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/SerialExecutor.class +0 -0
  83. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$1.class +0 -0
  84. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$2.class +0 -0
  85. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$3.class +0 -0
  86. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$4.class +0 -0
  87. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$5.class +0 -0
  88. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$6.class +0 -0
  89. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl$7.class +0 -0
  90. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl.class +0 -0
  91. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl$1.class +0 -0
  92. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl.class +0 -0
  93. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/linusu/RNGetRandomValuesModule.class +0 -0
  94. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/linusu/RNGetRandomValuesPackage.class +0 -0
  95. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
  96. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -7
  97. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -7
  98. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
  99. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
  100. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
  101. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  102. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  103. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  104. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  105. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  106. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  107. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  108. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  109. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  110. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  111. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  112. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  113. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  114. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  115. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  116. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  117. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  118. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  119. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  120. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  121. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  122. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  123. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  124. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  125. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  126. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  127. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  128. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  129. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  130. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  131. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  132. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  133. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  134. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  135. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  136. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab +0 -0
  137. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream +0 -0
  138. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream.len +0 -0
  139. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.len +0 -0
  140. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.values.at +0 -0
  141. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i +0 -0
  142. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i.len +0 -0
  143. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
  144. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
  145. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
  146. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
  147. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
  148. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
  149. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
  150. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  151. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  152. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  153. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  154. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  155. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  156. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  157. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  158. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  159. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  160. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  161. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  162. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  163. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  164. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  165. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  166. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  167. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  168. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  169. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  170. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  171. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  172. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  173. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  174. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  175. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  176. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  177. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  178. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
  179. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  180. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  181. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  182. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  183. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  184. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  185. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  186. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  187. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  188. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  189. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  190. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  191. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  192. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  193. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  194. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  195. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  196. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  197. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  198. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  199. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  200. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  201. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  202. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
  203. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  204. package/android/build/tmp/kotlin-classes/debug/META-INF/metarouter_react-native-sdk_debug.kotlin_module +0 -0
  205. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/ArgumentHelpersKt.class +0 -0
  206. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/AsyncStorageAccess.class +0 -0
  207. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/AsyncStorageError$Companion.class +0 -0
  208. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/AsyncStorageError.class +0 -0
  209. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/Entry.class +0 -0
  210. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/ErrorHelpersKt$createExceptionHandler$$inlined$CoroutineExceptionHandler$1.class +0 -0
  211. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/ErrorHelpersKt.class +0 -0
  212. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/MIGRATION_TO_NEXT.class +0 -0
  213. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDao$DefaultImpls.class +0 -0
  214. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDao$mergeValues$1.class +0 -0
  215. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDao.class +0 -0
  216. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDb$Companion.class +0 -0
  217. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageDb.class +0 -0
  218. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$Companion.class +0 -0
  219. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$clear$1.class +0 -0
  220. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$getAllKeys$1.class +0 -0
  221. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiGet$1.class +0 -0
  222. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiMerge$1.class +0 -0
  223. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiRemove$1.class +0 -0
  224. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule$multiSet$1.class +0 -0
  225. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageModule.class +0 -0
  226. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageSupplier$Companion.class +0 -0
  227. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageSupplier.class +0 -0
  228. package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/asyncstorage/next/StorageSupplierKt.class +0 -0
  229. package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativeModule$onInitialized$1.class +0 -0
  230. package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativeModule$toHexString$1.class +0 -0
  231. package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.class +0 -0
  232. package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativePackage$createNativeModules$1.class +0 -0
  233. package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/AnalyticsReactNativePackage.class +0 -0
  234. package/android/build/tmp/kotlin-classes/debug/com/segmentanalyticsreactnative/ConnectionType.class +0 -0
  235. package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/Sovran$Action.class +0 -0
  236. package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/Sovran$createNativeModules$1.class +0 -0
  237. package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/Sovran.class +0 -0
  238. package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/SovranModule$Companion.class +0 -0
  239. package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/SovranModule$onInitialized$1.class +0 -0
  240. package/android/build/tmp/kotlin-classes/debug/com/sovranreactnative/SovranModule.class +0 -0
  241. package/android/build.gradle +0 -55
  242. package/android/consumer-rules.pro +0 -0
  243. package/android/src/main/java/com/metarouter/reactnativesdk/MetaRouterReactNativeSDKPackage.java +0 -54
  244. package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.java +0 -178
  245. package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageErrorUtil.java +0 -45
  246. package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageExpoMigration.java +0 -154
  247. package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java +0 -410
  248. package/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java +0 -93
  249. package/android/src/main/java/com/reactnativecommunity/asyncstorage/BuildConfig.java +0 -8
  250. package/android/src/main/java/com/reactnativecommunity/asyncstorage/NativeAsyncStorageModuleSpec.java +0 -47
  251. package/android/src/main/java/com/reactnativecommunity/asyncstorage/ReactDatabaseSupplier.java +0 -163
  252. package/android/src/main/java/com/reactnativecommunity/asyncstorage/SerialExecutor.java +0 -40
  253. package/android/src/main/java/com/reactnativecommunity/asyncstorage/build.gradle +0 -122
  254. package/android/src/main/java/com/reactnativecommunity/asyncstorage/config.gradle +0 -125
  255. package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/ArgumentHelpers.kt +0 -86
  256. package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/ErrorHelpers.kt +0 -39
  257. package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageModule.kt +0 -94
  258. package/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageSupplier.kt +0 -161
  259. package/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativeModule.kt +0 -267
  260. package/android/src/main/java/com/segmentanalyticsreactnative/AnalyticsReactNativePackage.kt +0 -43
  261. package/android/src/main/java/com/sovranreactnative/Sovran.kt +0 -45
  262. package/android/src/main/java/com/sovranreactnative/SovranModule.kt +0 -55
  263. package/android/src/main/java/org/linusu/RNGetRandomValuesModule.java +0 -36
  264. package/android/src/main/java/org/linusu/RNGetRandomValuesPackage.java +0 -28
  265. package/lib/MetaRouterPlugin.d.ts +0 -10
  266. package/lib/MetaRouterPlugin.d.ts.map +0 -1
  267. package/lib/MetaRouterPlugin.js +0 -23
  268. package/lib/context.d.ts +0 -8
  269. package/lib/context.d.ts.map +0 -1
  270. package/lib/context.js +0 -9
  271. package/lib/createMetaRouterClient.d.ts +0 -3
  272. package/lib/createMetaRouterClient.d.ts.map +0 -1
  273. package/lib/createMetaRouterClient.js +0 -7
  274. package/lib/proxyClient.d.ts +0 -4
  275. package/lib/proxyClient.d.ts.map +0 -1
  276. package/react-native.config.js +0 -37
@@ -1,410 +0,0 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- package com.reactnativecommunity.asyncstorage;
9
-
10
- import android.database.Cursor;
11
- import android.database.sqlite.SQLiteStatement;
12
- import android.os.AsyncTask;
13
-
14
- import com.facebook.common.logging.FLog;
15
- import com.facebook.react.bridge.Arguments;
16
- import com.facebook.react.bridge.Callback;
17
- import com.facebook.react.bridge.GuardedAsyncTask;
18
- import com.facebook.react.bridge.ReactApplicationContext;
19
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
20
- import com.facebook.react.bridge.ReactMethod;
21
- import com.facebook.react.bridge.ReadableArray;
22
- import com.facebook.react.bridge.WritableArray;
23
- import com.facebook.react.bridge.WritableMap;
24
- import com.facebook.react.common.ReactConstants;
25
- import com.facebook.react.common.annotations.VisibleForTesting;
26
- import com.facebook.react.module.annotations.ReactModule;
27
-
28
- import java.util.ArrayDeque;
29
- import java.util.HashSet;
30
- import java.util.concurrent.Executor;
31
- import java.util.concurrent.Executors;
32
-
33
- @ReactModule(name = AsyncStorageModule.NAME)
34
- public final class AsyncStorageModule extends NativeAsyncStorageModuleSpec {
35
-
36
- // changed name to not conflict with AsyncStorage from RN repo
37
- public static final String NAME = "RNCAsyncStorage";
38
-
39
- // SQL variable number limit, defined by SQLITE_LIMIT_VARIABLE_NUMBER:
40
- // https://raw.githubusercontent.com/android/platform_external_sqlite/master/dist/sqlite3.c
41
- private static final int MAX_SQL_KEYS = 999;
42
-
43
- private ReactDatabaseSupplier mReactDatabaseSupplier;
44
- private boolean mShuttingDown = false;
45
-
46
- private final SerialExecutor executor;
47
-
48
- public AsyncStorageModule(ReactApplicationContext reactContext) {
49
- this(
50
- reactContext,
51
- BuildConfig.AsyncStorage_useDedicatedExecutor
52
- ? Executors.newSingleThreadExecutor()
53
- : AsyncTask.THREAD_POOL_EXECUTOR
54
- );
55
- }
56
-
57
- @VisibleForTesting
58
- AsyncStorageModule(ReactApplicationContext reactContext, Executor executor) {
59
- super(reactContext);
60
-
61
- // The migration MUST run before the AsyncStorage database is created for the first time.
62
- AsyncStorageExpoMigration.migrate(reactContext);
63
-
64
- this.executor = new SerialExecutor(executor);
65
-
66
- // Creating the database MUST happen after the migration.
67
- mReactDatabaseSupplier = ReactDatabaseSupplier.getInstance(reactContext);
68
- }
69
-
70
- @Override
71
- public String getName() {
72
- return NAME;
73
- }
74
-
75
- @Override
76
- public void initialize() {
77
- super.initialize();
78
- mShuttingDown = false;
79
- }
80
-
81
- @Override
82
- public void invalidate() {
83
- mShuttingDown = true;
84
- // ensure we close database when activity is destroyed
85
- mReactDatabaseSupplier.closeDatabase();
86
- }
87
-
88
- /**
89
- * Given an array of keys, this returns a map of (key, value) pairs for the keys found, and
90
- * (key, null) for the keys that haven't been found.
91
- */
92
- @ReactMethod
93
- @Override
94
- public void multiGet(final ReadableArray keys, final Callback callback) {
95
- if (keys == null) {
96
- callback.invoke(AsyncStorageErrorUtil.getInvalidKeyError(null), null);
97
- return;
98
- }
99
-
100
- new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {
101
- @Override
102
- protected void doInBackgroundGuarded(Void... params) {
103
- if (!ensureDatabase()) {
104
- callback.invoke(AsyncStorageErrorUtil.getDBError(null), null);
105
- return;
106
- }
107
-
108
- String[] columns = {ReactDatabaseSupplier.KEY_COLUMN, ReactDatabaseSupplier.VALUE_COLUMN};
109
- HashSet<String> keysRemaining = new HashSet<>();
110
- WritableArray data = Arguments.createArray();
111
- for (int keyStart = 0; keyStart < keys.size(); keyStart += MAX_SQL_KEYS) {
112
- int keyCount = Math.min(keys.size() - keyStart, MAX_SQL_KEYS);
113
- Cursor cursor = mReactDatabaseSupplier.get().query(
114
- ReactDatabaseSupplier.TABLE_CATALYST,
115
- columns,
116
- AsyncLocalStorageUtil.buildKeySelection(keyCount),
117
- AsyncLocalStorageUtil.buildKeySelectionArgs(keys, keyStart, keyCount),
118
- null,
119
- null,
120
- null);
121
- keysRemaining.clear();
122
- try {
123
- if (cursor.getCount() != keys.size()) {
124
- // some keys have not been found - insert them with null into the final array
125
- for (int keyIndex = keyStart; keyIndex < keyStart + keyCount; keyIndex++) {
126
- keysRemaining.add(keys.getString(keyIndex));
127
- }
128
- }
129
-
130
- if (cursor.moveToFirst()) {
131
- do {
132
- WritableArray row = Arguments.createArray();
133
- row.pushString(cursor.getString(0));
134
- row.pushString(cursor.getString(1));
135
- data.pushArray(row);
136
- keysRemaining.remove(cursor.getString(0));
137
- } while (cursor.moveToNext());
138
- }
139
- } catch (Exception e) {
140
- FLog.w(ReactConstants.TAG, e.getMessage(), e);
141
- callback.invoke(AsyncStorageErrorUtil.getError(null, e.getMessage()), null);
142
- return;
143
- } finally {
144
- cursor.close();
145
- }
146
-
147
- for (String key : keysRemaining) {
148
- WritableArray row = Arguments.createArray();
149
- row.pushString(key);
150
- row.pushNull();
151
- data.pushArray(row);
152
- }
153
- keysRemaining.clear();
154
- }
155
-
156
- callback.invoke(null, data);
157
- }
158
- }.executeOnExecutor(executor);
159
- }
160
-
161
- /**
162
- * Inserts multiple (key, value) pairs. If one or more of the pairs cannot be inserted, this will
163
- * return AsyncLocalStorageFailure, but all other pairs will have been inserted.
164
- * The insertion will replace conflicting (key, value) pairs.
165
- */
166
- @ReactMethod
167
- @Override
168
- public void multiSet(final ReadableArray keyValueArray, final Callback callback) {
169
- if (keyValueArray.size() == 0) {
170
- callback.invoke();
171
- return;
172
- }
173
-
174
- new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {
175
- @Override
176
- protected void doInBackgroundGuarded(Void... params) {
177
- if (!ensureDatabase()) {
178
- callback.invoke(AsyncStorageErrorUtil.getDBError(null));
179
- return;
180
- }
181
-
182
- String sql = "INSERT OR REPLACE INTO " + ReactDatabaseSupplier.TABLE_CATALYST + " VALUES (?, ?);";
183
- SQLiteStatement statement = mReactDatabaseSupplier.get().compileStatement(sql);
184
- WritableMap error = null;
185
- try {
186
- mReactDatabaseSupplier.get().beginTransaction();
187
- for (int idx=0; idx < keyValueArray.size(); idx++) {
188
- if (keyValueArray.getArray(idx).size() != 2) {
189
- error = AsyncStorageErrorUtil.getInvalidValueError(null);
190
- return;
191
- }
192
- if (keyValueArray.getArray(idx).getString(0) == null) {
193
- error = AsyncStorageErrorUtil.getInvalidKeyError(null);
194
- return;
195
- }
196
- if (keyValueArray.getArray(idx).getString(1) == null) {
197
- error = AsyncStorageErrorUtil.getInvalidValueError(null);
198
- return;
199
- }
200
-
201
- statement.clearBindings();
202
- statement.bindString(1, keyValueArray.getArray(idx).getString(0));
203
- statement.bindString(2, keyValueArray.getArray(idx).getString(1));
204
- statement.execute();
205
- }
206
- mReactDatabaseSupplier.get().setTransactionSuccessful();
207
- } catch (Exception e) {
208
- FLog.w(ReactConstants.TAG, e.getMessage(), e);
209
- error = AsyncStorageErrorUtil.getError(null, e.getMessage());
210
- } finally {
211
- try {
212
- mReactDatabaseSupplier.get().endTransaction();
213
- } catch (Exception e) {
214
- FLog.w(ReactConstants.TAG, e.getMessage(), e);
215
- if (error == null) {
216
- error = AsyncStorageErrorUtil.getError(null, e.getMessage());
217
- }
218
- }
219
- }
220
- if (error != null) {
221
- callback.invoke(error);
222
- } else {
223
- callback.invoke();
224
- }
225
- }
226
- }.executeOnExecutor(executor);
227
- }
228
-
229
- /**
230
- * Removes all rows of the keys given.
231
- */
232
- @ReactMethod
233
- @Override
234
- public void multiRemove(final ReadableArray keys, final Callback callback) {
235
- if (keys.size() == 0) {
236
- callback.invoke();
237
- return;
238
- }
239
-
240
- new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {
241
- @Override
242
- protected void doInBackgroundGuarded(Void... params) {
243
- if (!ensureDatabase()) {
244
- callback.invoke(AsyncStorageErrorUtil.getDBError(null));
245
- return;
246
- }
247
-
248
- WritableMap error = null;
249
- try {
250
- mReactDatabaseSupplier.get().beginTransaction();
251
- for (int keyStart = 0; keyStart < keys.size(); keyStart += MAX_SQL_KEYS) {
252
- int keyCount = Math.min(keys.size() - keyStart, MAX_SQL_KEYS);
253
- mReactDatabaseSupplier.get().delete(
254
- ReactDatabaseSupplier.TABLE_CATALYST,
255
- AsyncLocalStorageUtil.buildKeySelection(keyCount),
256
- AsyncLocalStorageUtil.buildKeySelectionArgs(keys, keyStart, keyCount));
257
- }
258
- mReactDatabaseSupplier.get().setTransactionSuccessful();
259
- } catch (Exception e) {
260
- FLog.w(ReactConstants.TAG, e.getMessage(), e);
261
- error = AsyncStorageErrorUtil.getError(null, e.getMessage());
262
- } finally {
263
- try {
264
- mReactDatabaseSupplier.get().endTransaction();
265
- } catch (Exception e) {
266
- FLog.w(ReactConstants.TAG, e.getMessage(), e);
267
- if (error == null) {
268
- error = AsyncStorageErrorUtil.getError(null, e.getMessage());
269
- }
270
- }
271
- }
272
- if (error != null) {
273
- callback.invoke(error);
274
- } else {
275
- callback.invoke();
276
- }
277
- }
278
- }.executeOnExecutor(executor);
279
- }
280
-
281
- /**
282
- * Given an array of (key, value) pairs, this will merge the given values with the stored values
283
- * of the given keys, if they exist.
284
- */
285
- @ReactMethod
286
- @Override
287
- public void multiMerge(final ReadableArray keyValueArray, final Callback callback) {
288
- new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {
289
- @Override
290
- protected void doInBackgroundGuarded(Void... params) {
291
- if (!ensureDatabase()) {
292
- callback.invoke(AsyncStorageErrorUtil.getDBError(null));
293
- return;
294
- }
295
- WritableMap error = null;
296
- try {
297
- mReactDatabaseSupplier.get().beginTransaction();
298
- for (int idx = 0; idx < keyValueArray.size(); idx++) {
299
- if (keyValueArray.getArray(idx).size() != 2) {
300
- error = AsyncStorageErrorUtil.getInvalidValueError(null);
301
- return;
302
- }
303
-
304
- if (keyValueArray.getArray(idx).getString(0) == null) {
305
- error = AsyncStorageErrorUtil.getInvalidKeyError(null);
306
- return;
307
- }
308
-
309
- if (keyValueArray.getArray(idx).getString(1) == null) {
310
- error = AsyncStorageErrorUtil.getInvalidValueError(null);
311
- return;
312
- }
313
-
314
- if (!AsyncLocalStorageUtil.mergeImpl(
315
- mReactDatabaseSupplier.get(),
316
- keyValueArray.getArray(idx).getString(0),
317
- keyValueArray.getArray(idx).getString(1))) {
318
- error = AsyncStorageErrorUtil.getDBError(null);
319
- return;
320
- }
321
- }
322
- mReactDatabaseSupplier.get().setTransactionSuccessful();
323
- } catch (Exception e) {
324
- FLog.w(ReactConstants.TAG, e.getMessage(), e);
325
- error = AsyncStorageErrorUtil.getError(null, e.getMessage());
326
- } finally {
327
- try {
328
- mReactDatabaseSupplier.get().endTransaction();
329
- } catch (Exception e) {
330
- FLog.w(ReactConstants.TAG, e.getMessage(), e);
331
- if (error == null) {
332
- error = AsyncStorageErrorUtil.getError(null, e.getMessage());
333
- }
334
- }
335
- }
336
- if (error != null) {
337
- callback.invoke(error);
338
- } else {
339
- callback.invoke();
340
- }
341
- }
342
- }.executeOnExecutor(executor);
343
- }
344
-
345
- /**
346
- * Clears the database.
347
- */
348
- @ReactMethod
349
- @Override
350
- public void clear(final Callback callback) {
351
- new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {
352
- @Override
353
- protected void doInBackgroundGuarded(Void... params) {
354
- if (!mReactDatabaseSupplier.ensureDatabase()) {
355
- callback.invoke(AsyncStorageErrorUtil.getDBError(null));
356
- return;
357
- }
358
- try {
359
- mReactDatabaseSupplier.clear();
360
- callback.invoke();
361
- } catch (Exception e) {
362
- FLog.w(ReactConstants.TAG, e.getMessage(), e);
363
- callback.invoke(AsyncStorageErrorUtil.getError(null, e.getMessage()));
364
- }
365
- }
366
- }.executeOnExecutor(executor);
367
- }
368
-
369
- /**
370
- * Returns an array with all keys from the database.
371
- */
372
- @ReactMethod
373
- @Override
374
- public void getAllKeys(final Callback callback) {
375
- new GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {
376
- @Override
377
- protected void doInBackgroundGuarded(Void... params) {
378
- if (!ensureDatabase()) {
379
- callback.invoke(AsyncStorageErrorUtil.getDBError(null), null);
380
- return;
381
- }
382
- WritableArray data = Arguments.createArray();
383
- String[] columns = {ReactDatabaseSupplier.KEY_COLUMN};
384
- Cursor cursor = mReactDatabaseSupplier.get()
385
- .query(ReactDatabaseSupplier.TABLE_CATALYST, columns, null, null, null, null, null);
386
- try {
387
- if (cursor.moveToFirst()) {
388
- do {
389
- data.pushString(cursor.getString(0));
390
- } while (cursor.moveToNext());
391
- }
392
- } catch (Exception e) {
393
- FLog.w(ReactConstants.TAG, e.getMessage(), e);
394
- callback.invoke(AsyncStorageErrorUtil.getError(null, e.getMessage()), null);
395
- return;
396
- } finally {
397
- cursor.close();
398
- }
399
- callback.invoke(null, data);
400
- }
401
- }.executeOnExecutor(executor);
402
- }
403
-
404
- /**
405
- * Verify the database is open for reads and writes.
406
- */
407
- private boolean ensureDatabase() {
408
- return !mShuttingDown && mReactDatabaseSupplier.ensureDatabase();
409
- }
410
- }
@@ -1,93 +0,0 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- package com.reactnativecommunity.asyncstorage;
9
-
10
- import com.facebook.react.TurboReactPackage;
11
- import com.facebook.react.bridge.ModuleSpec;
12
- import com.facebook.react.bridge.JavaScriptModule;
13
- import com.facebook.react.bridge.NativeModule;
14
- import com.facebook.react.bridge.ReactApplicationContext;
15
- import com.facebook.react.module.annotations.ReactModule;
16
- import com.facebook.react.module.annotations.ReactModuleList;
17
- import com.facebook.react.module.model.ReactModuleInfo;
18
- import com.facebook.react.module.model.ReactModuleInfoProvider;
19
- import com.facebook.react.uimanager.ViewManager;
20
- import java.util.Collections;
21
- import java.util.HashMap;
22
- import java.util.List;
23
- import java.util.Map;
24
-
25
- import javax.annotation.Nonnull;
26
-
27
- @ReactModuleList(
28
- nativeModules = {
29
- AsyncStorageModule.class,
30
- }
31
- )
32
- public class AsyncStoragePackage extends TurboReactPackage {
33
-
34
- @Override
35
- public NativeModule getModule(String name, @Nonnull ReactApplicationContext reactContext) {
36
- switch (name) {
37
- case AsyncStorageModule.NAME:
38
- return new AsyncStorageModule(reactContext);
39
- default:
40
- return null;
41
- }
42
- }
43
-
44
- @Override
45
- public ReactModuleInfoProvider getReactModuleInfoProvider() {
46
- try {
47
- Class<?> reactModuleInfoProviderClass =
48
- Class.forName("com.reactnativecommunity.asyncstorage.AsyncStoragePackage$$ReactModuleInfoProvider");
49
- return (ReactModuleInfoProvider) reactModuleInfoProviderClass.newInstance();
50
- } catch (ClassNotFoundException e) {
51
- // ReactModuleSpecProcessor does not run at build-time. Create this ReactModuleInfoProvider by
52
- // hand.
53
- return new ReactModuleInfoProvider() {
54
- @Override
55
- public Map<String, ReactModuleInfo> getReactModuleInfos() {
56
- final Map<String, ReactModuleInfo> reactModuleInfoMap = new HashMap<>();
57
- boolean isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
58
-
59
- Class<? extends NativeModule>[] moduleList =
60
- new Class[] {
61
- AsyncStorageModule.class,
62
- };
63
-
64
- for (Class<? extends NativeModule> moduleClass : moduleList) {
65
- ReactModule reactModule = moduleClass.getAnnotation(ReactModule.class);
66
-
67
- reactModuleInfoMap.put(
68
- reactModule.name(),
69
- new ReactModuleInfo(
70
- reactModule.name(),
71
- moduleClass.getName(),
72
- reactModule.canOverrideExistingModule(),
73
- reactModule.needsEagerInit(),
74
- reactModule.hasConstants(),
75
- reactModule.isCxxModule(),
76
- isTurboModule));
77
- }
78
-
79
- return reactModuleInfoMap;
80
- }
81
- };
82
- } catch (InstantiationException | IllegalAccessException e) {
83
- throw new RuntimeException(
84
- "No ReactModuleInfoProvider for com.reactnativecommunity.asyncstorage.AsyncStoragePackage$$ReactModuleInfoProvider", e);
85
- }
86
- }
87
-
88
- @Override
89
- @SuppressWarnings("rawtypes")
90
- public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
91
- return Collections.emptyList();
92
- }
93
- }
@@ -1,8 +0,0 @@
1
- package com.reactnativecommunity.asyncstorage;
2
-
3
- public final class BuildConfig {
4
- public static final long AsyncStorage_db_size = 6L;
5
- public static final boolean AsyncStorage_useDedicatedExecutor = false;
6
- public static final boolean AsyncStorage_useNextStorage = false;
7
- public static final boolean IS_NEW_ARCHITECTURE_ENABLED = false;
8
- }
@@ -1,47 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Update this file after changing NativeAsyncStorageModule.ts to match the version generated by codegen.
6
- */
7
-
8
- package com.reactnativecommunity.asyncstorage;
9
-
10
- import com.facebook.proguard.annotations.DoNotStrip;
11
- import com.facebook.react.bridge.Callback;
12
- import com.facebook.react.bridge.ReactApplicationContext;
13
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
14
- import com.facebook.react.bridge.ReactMethod;
15
- import com.facebook.react.bridge.ReactModuleWithSpec;
16
- import com.facebook.react.bridge.ReadableArray;
17
- import com.facebook.react.turbomodule.core.interfaces.TurboModule;
18
-
19
- public abstract class NativeAsyncStorageModuleSpec extends ReactContextBaseJavaModule implements ReactModuleWithSpec, TurboModule {
20
- public NativeAsyncStorageModuleSpec(ReactApplicationContext reactContext) {
21
- super(reactContext);
22
- }
23
-
24
- @ReactMethod
25
- @DoNotStrip
26
- public abstract void multiGet(ReadableArray keys, Callback callback);
27
-
28
- @ReactMethod
29
- @DoNotStrip
30
- public abstract void multiSet(ReadableArray kvPairs, Callback callback);
31
-
32
- @ReactMethod
33
- @DoNotStrip
34
- public abstract void multiRemove(ReadableArray keys, Callback callback);
35
-
36
- @ReactMethod
37
- @DoNotStrip
38
- public abstract void multiMerge(ReadableArray kvPairs, Callback callback);
39
-
40
- @ReactMethod
41
- @DoNotStrip
42
- public abstract void getAllKeys(Callback callback);
43
-
44
- @ReactMethod
45
- @DoNotStrip
46
- public abstract void clear(Callback callback);
47
- }