react-native-nitro-amplitude 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.watchmanconfig +6 -0
- package/LICENSE +21 -0
- package/README.md +139 -0
- package/android/CMakeLists.txt +34 -0
- package/android/build.gradle +85 -0
- package/android/consumer-rules.pro +35 -0
- package/android/gradle.properties +4 -0
- package/android/src/main/cpp/AndroidAmplitudeAdapterCpp.cpp +126 -0
- package/android/src/main/cpp/AndroidAmplitudeAdapterCpp.hpp +48 -0
- package/android/src/main/cpp/cpp-adapter.cpp +9 -0
- package/android/src/main/java/com/nitroamplitude/AndroidAmplitudeAdapter.kt +147 -0
- package/android/src/main/java/com/nitroamplitude/NitroAmplitudePackage.kt +24 -0
- package/app.plugin.js +36 -0
- package/cpp/bindings/HybridAmplitudeContext.cpp +83 -0
- package/cpp/bindings/HybridAmplitudeContext.hpp +29 -0
- package/cpp/bindings/HybridAmplitudeStorage.cpp +163 -0
- package/cpp/bindings/HybridAmplitudeStorage.hpp +38 -0
- package/cpp/bindings/HybridAmplitudeWorker.cpp +162 -0
- package/cpp/bindings/HybridAmplitudeWorker.hpp +74 -0
- package/cpp/core/NativeAmplitudeAdapter.hpp +44 -0
- package/ios/IOSAmplitudeAdapterCpp.hpp +37 -0
- package/ios/IOSAmplitudeAdapterCpp.mm +155 -0
- package/lib/commonjs/AmplitudeContext.nitro.js +6 -0
- package/lib/commonjs/AmplitudeContext.nitro.js.map +1 -0
- package/lib/commonjs/AmplitudeStorage.nitro.js +6 -0
- package/lib/commonjs/AmplitudeStorage.nitro.js.map +1 -0
- package/lib/commonjs/AmplitudeWorker.nitro.js +6 -0
- package/lib/commonjs/AmplitudeWorker.nitro.js.map +1 -0
- package/lib/commonjs/analytics/campaign/campaign-tracker.js +105 -0
- package/lib/commonjs/analytics/campaign/campaign-tracker.js.map +1 -0
- package/lib/commonjs/analytics/campaign/types.js +6 -0
- package/lib/commonjs/analytics/campaign/types.js.map +1 -0
- package/lib/commonjs/analytics/config.js +283 -0
- package/lib/commonjs/analytics/config.js.map +1 -0
- package/lib/commonjs/analytics/cookie-migration/index.js +59 -0
- package/lib/commonjs/analytics/cookie-migration/index.js.map +1 -0
- package/lib/commonjs/analytics/index.js +95 -0
- package/lib/commonjs/analytics/index.js.map +1 -0
- package/lib/commonjs/analytics/migration/remnant-data-migration.js +177 -0
- package/lib/commonjs/analytics/migration/remnant-data-migration.js.map +1 -0
- package/lib/commonjs/analytics/nitro-transport.js +31 -0
- package/lib/commonjs/analytics/nitro-transport.js.map +1 -0
- package/lib/commonjs/analytics/plugins/context.js +140 -0
- package/lib/commonjs/analytics/plugins/context.js.map +1 -0
- package/lib/commonjs/analytics/react-native-client.js +352 -0
- package/lib/commonjs/analytics/react-native-client.js.map +1 -0
- package/lib/commonjs/analytics/storage/local-storage.js +73 -0
- package/lib/commonjs/analytics/storage/local-storage.js.map +1 -0
- package/lib/commonjs/analytics/types.js +175 -0
- package/lib/commonjs/analytics/types.js.map +1 -0
- package/lib/commonjs/analytics/typings/browser-snippet.d.js +6 -0
- package/lib/commonjs/analytics/typings/browser-snippet.d.js.map +1 -0
- package/lib/commonjs/analytics/typings/ua-parser.d.js +2 -0
- package/lib/commonjs/analytics/typings/ua-parser.d.js.map +1 -0
- package/lib/commonjs/analytics/utils/platform.js +16 -0
- package/lib/commonjs/analytics/utils/platform.js.map +1 -0
- package/lib/commonjs/analytics/version.js +8 -0
- package/lib/commonjs/analytics/version.js.map +1 -0
- package/lib/commonjs/experiment/experimentClient.js +792 -0
- package/lib/commonjs/experiment/experimentClient.js.map +1 -0
- package/lib/commonjs/experiment/factory.js +77 -0
- package/lib/commonjs/experiment/factory.js.map +1 -0
- package/lib/commonjs/experiment/gen/version.js +9 -0
- package/lib/commonjs/experiment/gen/version.js.map +1 -0
- package/lib/commonjs/experiment/index.js +143 -0
- package/lib/commonjs/experiment/index.js.map +1 -0
- package/lib/commonjs/experiment/integration/NativeExperimentReactNativeClient.js +11 -0
- package/lib/commonjs/experiment/integration/NativeExperimentReactNativeClient.js.map +1 -0
- package/lib/commonjs/experiment/integration/connector.js +67 -0
- package/lib/commonjs/experiment/integration/connector.js.map +1 -0
- package/lib/commonjs/experiment/integration/default.js +92 -0
- package/lib/commonjs/experiment/integration/default.js.map +1 -0
- package/lib/commonjs/experiment/logger/ampLogger.js +80 -0
- package/lib/commonjs/experiment/logger/ampLogger.js.map +1 -0
- package/lib/commonjs/experiment/logger/consoleLogger.js +60 -0
- package/lib/commonjs/experiment/logger/consoleLogger.js.map +1 -0
- package/lib/commonjs/experiment/storage/cache.js +197 -0
- package/lib/commonjs/experiment/storage/cache.js.map +1 -0
- package/lib/commonjs/experiment/storage/local-storage.js +25 -0
- package/lib/commonjs/experiment/storage/local-storage.js.map +1 -0
- package/lib/commonjs/experiment/stubClient.js +46 -0
- package/lib/commonjs/experiment/stubClient.js.map +1 -0
- package/lib/commonjs/experiment/transport/http.js +72 -0
- package/lib/commonjs/experiment/transport/http.js.map +1 -0
- package/lib/commonjs/experiment/types/client.js +6 -0
- package/lib/commonjs/experiment/types/client.js.map +1 -0
- package/lib/commonjs/experiment/types/config.js +67 -0
- package/lib/commonjs/experiment/types/config.js.map +1 -0
- package/lib/commonjs/experiment/types/exposure.js +2 -0
- package/lib/commonjs/experiment/types/exposure.js.map +1 -0
- package/lib/commonjs/experiment/types/logger.js +42 -0
- package/lib/commonjs/experiment/types/logger.js.map +1 -0
- package/lib/commonjs/experiment/types/source.js +54 -0
- package/lib/commonjs/experiment/types/source.js.map +1 -0
- package/lib/commonjs/experiment/types/storage.js +2 -0
- package/lib/commonjs/experiment/types/storage.js.map +1 -0
- package/lib/commonjs/experiment/types/transport.js +2 -0
- package/lib/commonjs/experiment/types/transport.js.map +1 -0
- package/lib/commonjs/experiment/types/user.js +2 -0
- package/lib/commonjs/experiment/types/user.js.map +1 -0
- package/lib/commonjs/experiment/types/variant.js +2 -0
- package/lib/commonjs/experiment/types/variant.js.map +1 -0
- package/lib/commonjs/experiment/util/backoff.js +54 -0
- package/lib/commonjs/experiment/util/backoff.js.map +1 -0
- package/lib/commonjs/experiment/util/base64.js +23 -0
- package/lib/commonjs/experiment/util/base64.js.map +1 -0
- package/lib/commonjs/experiment/util/convert.js +78 -0
- package/lib/commonjs/experiment/util/convert.js.map +1 -0
- package/lib/commonjs/experiment/util/index.js +25 -0
- package/lib/commonjs/experiment/util/index.js.map +1 -0
- package/lib/commonjs/experiment/util/platform.js +16 -0
- package/lib/commonjs/experiment/util/platform.js.map +1 -0
- package/lib/commonjs/experiment/util/randomstring.js +16 -0
- package/lib/commonjs/experiment/util/randomstring.js.map +1 -0
- package/lib/commonjs/experiment/util/userSessionExposureTracker.js +40 -0
- package/lib/commonjs/experiment/util/userSessionExposureTracker.js.map +1 -0
- package/lib/commonjs/index.js +298 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/index.web.js +22 -0
- package/lib/commonjs/index.web.js.map +1 -0
- package/lib/commonjs/native/context.js +43 -0
- package/lib/commonjs/native/context.js.map +1 -0
- package/lib/commonjs/native/http.js +62 -0
- package/lib/commonjs/native/http.js.map +1 -0
- package/lib/commonjs/native/hybrid.js +31 -0
- package/lib/commonjs/native/hybrid.js.map +1 -0
- package/lib/commonjs/native/storage.js +93 -0
- package/lib/commonjs/native/storage.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/AmplitudeContext.nitro.js +4 -0
- package/lib/module/AmplitudeContext.nitro.js.map +1 -0
- package/lib/module/AmplitudeStorage.nitro.js +4 -0
- package/lib/module/AmplitudeStorage.nitro.js.map +1 -0
- package/lib/module/AmplitudeWorker.nitro.js +4 -0
- package/lib/module/AmplitudeWorker.nitro.js.map +1 -0
- package/lib/module/analytics/campaign/campaign-tracker.js +100 -0
- package/lib/module/analytics/campaign/campaign-tracker.js.map +1 -0
- package/lib/module/analytics/campaign/types.js +4 -0
- package/lib/module/analytics/campaign/types.js.map +1 -0
- package/lib/module/analytics/config.js +272 -0
- package/lib/module/analytics/config.js.map +1 -0
- package/lib/module/analytics/cookie-migration/index.js +51 -0
- package/lib/module/analytics/cookie-migration/index.js.map +1 -0
- package/lib/module/analytics/index.js +34 -0
- package/lib/module/analytics/index.js.map +1 -0
- package/lib/module/analytics/migration/remnant-data-migration.js +172 -0
- package/lib/module/analytics/migration/remnant-data-migration.js.map +1 -0
- package/lib/module/analytics/nitro-transport.js +26 -0
- package/lib/module/analytics/nitro-transport.js.map +1 -0
- package/lib/module/analytics/plugins/context.js +134 -0
- package/lib/module/analytics/plugins/context.js.map +1 -0
- package/lib/module/analytics/react-native-client.js +346 -0
- package/lib/module/analytics/react-native-client.js.map +1 -0
- package/lib/module/analytics/storage/local-storage.js +68 -0
- package/lib/module/analytics/storage/local-storage.js.map +1 -0
- package/lib/module/analytics/types.js +4 -0
- package/lib/module/analytics/types.js.map +1 -0
- package/lib/module/analytics/typings/browser-snippet.d.js +4 -0
- package/lib/module/analytics/typings/browser-snippet.d.js.map +1 -0
- package/lib/module/analytics/typings/ua-parser.d.js +2 -0
- package/lib/module/analytics/typings/ua-parser.d.js.map +1 -0
- package/lib/module/analytics/utils/platform.js +10 -0
- package/lib/module/analytics/utils/platform.js.map +1 -0
- package/lib/module/analytics/version.js +4 -0
- package/lib/module/analytics/version.js.map +1 -0
- package/lib/module/experiment/experimentClient.js +788 -0
- package/lib/module/experiment/experimentClient.js.map +1 -0
- package/lib/module/experiment/factory.js +73 -0
- package/lib/module/experiment/factory.js.map +1 -0
- package/lib/module/experiment/gen/version.js +5 -0
- package/lib/module/experiment/gen/version.js.map +1 -0
- package/lib/module/experiment/index.js +16 -0
- package/lib/module/experiment/index.js.map +1 -0
- package/lib/module/experiment/integration/NativeExperimentReactNativeClient.js +7 -0
- package/lib/module/experiment/integration/NativeExperimentReactNativeClient.js.map +1 -0
- package/lib/module/experiment/integration/connector.js +61 -0
- package/lib/module/experiment/integration/connector.js.map +1 -0
- package/lib/module/experiment/integration/default.js +87 -0
- package/lib/module/experiment/integration/default.js.map +1 -0
- package/lib/module/experiment/logger/ampLogger.js +76 -0
- package/lib/module/experiment/logger/ampLogger.js.map +1 -0
- package/lib/module/experiment/logger/consoleLogger.js +55 -0
- package/lib/module/experiment/logger/consoleLogger.js.map +1 -0
- package/lib/module/experiment/storage/cache.js +187 -0
- package/lib/module/experiment/storage/cache.js.map +1 -0
- package/lib/module/experiment/storage/local-storage.js +19 -0
- package/lib/module/experiment/storage/local-storage.js.map +1 -0
- package/lib/module/experiment/stubClient.js +41 -0
- package/lib/module/experiment/stubClient.js.map +1 -0
- package/lib/module/experiment/transport/http.js +66 -0
- package/lib/module/experiment/transport/http.js.map +1 -0
- package/lib/module/experiment/types/client.js +4 -0
- package/lib/module/experiment/types/client.js.map +1 -0
- package/lib/module/experiment/types/config.js +64 -0
- package/lib/module/experiment/types/config.js.map +1 -0
- package/lib/module/experiment/types/exposure.js +2 -0
- package/lib/module/experiment/types/exposure.js.map +1 -0
- package/lib/module/experiment/types/logger.js +39 -0
- package/lib/module/experiment/types/logger.js.map +1 -0
- package/lib/module/experiment/types/source.js +51 -0
- package/lib/module/experiment/types/source.js.map +1 -0
- package/lib/module/experiment/types/storage.js +2 -0
- package/lib/module/experiment/types/storage.js.map +1 -0
- package/lib/module/experiment/types/transport.js +2 -0
- package/lib/module/experiment/types/transport.js.map +1 -0
- package/lib/module/experiment/types/user.js +2 -0
- package/lib/module/experiment/types/user.js.map +1 -0
- package/lib/module/experiment/types/variant.js +2 -0
- package/lib/module/experiment/types/variant.js.map +1 -0
- package/lib/module/experiment/util/backoff.js +49 -0
- package/lib/module/experiment/util/backoff.js.map +1 -0
- package/lib/module/experiment/util/base64.js +16 -0
- package/lib/module/experiment/util/base64.js.map +1 -0
- package/lib/module/experiment/util/convert.js +71 -0
- package/lib/module/experiment/util/convert.js.map +1 -0
- package/lib/module/experiment/util/index.js +17 -0
- package/lib/module/experiment/util/index.js.map +1 -0
- package/lib/module/experiment/util/platform.js +10 -0
- package/lib/module/experiment/util/platform.js.map +1 -0
- package/lib/module/experiment/util/randomstring.js +11 -0
- package/lib/module/experiment/util/randomstring.js.map +1 -0
- package/lib/module/experiment/util/userSessionExposureTracker.js +35 -0
- package/lib/module/experiment/util/userSessionExposureTracker.js.map +1 -0
- package/lib/module/index.js +50 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/index.web.js +14 -0
- package/lib/module/index.web.js.map +1 -0
- package/lib/module/native/context.js +35 -0
- package/lib/module/native/context.js.map +1 -0
- package/lib/module/native/http.js +57 -0
- package/lib/module/native/http.js.map +1 -0
- package/lib/module/native/hybrid.js +24 -0
- package/lib/module/native/hybrid.js.map +1 -0
- package/lib/module/native/storage.js +86 -0
- package/lib/module/native/storage.js.map +1 -0
- package/lib/typescript/AmplitudeContext.nitro.d.ts +17 -0
- package/lib/typescript/AmplitudeContext.nitro.d.ts.map +1 -0
- package/lib/typescript/AmplitudeStorage.nitro.d.ts +17 -0
- package/lib/typescript/AmplitudeStorage.nitro.d.ts.map +1 -0
- package/lib/typescript/AmplitudeWorker.nitro.d.ts +11 -0
- package/lib/typescript/AmplitudeWorker.nitro.d.ts.map +1 -0
- package/lib/typescript/analytics/campaign/campaign-tracker.d.ts +85 -0
- package/lib/typescript/analytics/campaign/campaign-tracker.d.ts.map +1 -0
- package/lib/typescript/analytics/campaign/types.d.ts +11 -0
- package/lib/typescript/analytics/campaign/types.d.ts.map +1 -0
- package/lib/typescript/analytics/config.d.ts +68 -0
- package/lib/typescript/analytics/config.d.ts.map +1 -0
- package/lib/typescript/analytics/cookie-migration/index.d.ts +6 -0
- package/lib/typescript/analytics/cookie-migration/index.d.ts.map +1 -0
- package/lib/typescript/analytics/index.d.ts +7 -0
- package/lib/typescript/analytics/index.d.ts.map +1 -0
- package/lib/typescript/analytics/migration/remnant-data-migration.d.ts +20 -0
- package/lib/typescript/analytics/migration/remnant-data-migration.d.ts.map +1 -0
- package/lib/typescript/analytics/nitro-transport.d.ts +9 -0
- package/lib/typescript/analytics/nitro-transport.d.ts.map +1 -0
- package/lib/typescript/analytics/plugins/context.d.ts +14 -0
- package/lib/typescript/analytics/plugins/context.d.ts.map +1 -0
- package/lib/typescript/analytics/react-native-client.d.ts +55 -0
- package/lib/typescript/analytics/react-native-client.d.ts.map +1 -0
- package/lib/typescript/analytics/storage/local-storage.d.ts +14 -0
- package/lib/typescript/analytics/storage/local-storage.d.ts.map +1 -0
- package/lib/typescript/analytics/types.d.ts +2 -0
- package/lib/typescript/analytics/types.d.ts.map +1 -0
- package/lib/typescript/analytics/utils/platform.d.ts +3 -0
- package/lib/typescript/analytics/utils/platform.d.ts.map +1 -0
- package/lib/typescript/analytics/version.d.ts +2 -0
- package/lib/typescript/analytics/version.d.ts.map +1 -0
- package/lib/typescript/experiment/experimentClient.d.ts +234 -0
- package/lib/typescript/experiment/experimentClient.d.ts.map +1 -0
- package/lib/typescript/experiment/factory.d.ts +11 -0
- package/lib/typescript/experiment/factory.d.ts.map +1 -0
- package/lib/typescript/experiment/gen/version.d.ts +2 -0
- package/lib/typescript/experiment/gen/version.d.ts.map +1 -0
- package/lib/typescript/experiment/index.d.ts +15 -0
- package/lib/typescript/experiment/index.d.ts.map +1 -0
- package/lib/typescript/experiment/integration/NativeExperimentReactNativeClient.d.ts +16 -0
- package/lib/typescript/experiment/integration/NativeExperimentReactNativeClient.d.ts.map +1 -0
- package/lib/typescript/experiment/integration/connector.d.ts +16 -0
- package/lib/typescript/experiment/integration/connector.d.ts.map +1 -0
- package/lib/typescript/experiment/integration/default.d.ts +20 -0
- package/lib/typescript/experiment/integration/default.d.ts.map +1 -0
- package/lib/typescript/experiment/logger/ampLogger.d.ts +47 -0
- package/lib/typescript/experiment/logger/ampLogger.d.ts.map +1 -0
- package/lib/typescript/experiment/logger/consoleLogger.d.ts +40 -0
- package/lib/typescript/experiment/logger/consoleLogger.d.ts.map +1 -0
- package/lib/typescript/experiment/storage/cache.d.ts +35 -0
- package/lib/typescript/experiment/storage/cache.d.ts.map +1 -0
- package/lib/typescript/experiment/storage/local-storage.d.ts +11 -0
- package/lib/typescript/experiment/storage/local-storage.d.ts.map +1 -0
- package/lib/typescript/experiment/stubClient.d.ts +21 -0
- package/lib/typescript/experiment/stubClient.d.ts.map +1 -0
- package/lib/typescript/experiment/transport/http.d.ts +17 -0
- package/lib/typescript/experiment/transport/http.d.ts.map +1 -0
- package/lib/typescript/experiment/types/client.d.ts +36 -0
- package/lib/typescript/experiment/types/client.d.ts.map +1 -0
- package/lib/typescript/experiment/types/config.d.ts +164 -0
- package/lib/typescript/experiment/types/config.d.ts.map +1 -0
- package/lib/typescript/experiment/types/exposure.d.ts +107 -0
- package/lib/typescript/experiment/types/exposure.d.ts.map +1 -0
- package/lib/typescript/experiment/types/logger.d.ts +67 -0
- package/lib/typescript/experiment/types/logger.d.ts.map +1 -0
- package/lib/typescript/experiment/types/source.d.ts +43 -0
- package/lib/typescript/experiment/types/source.d.ts.map +1 -0
- package/lib/typescript/experiment/types/storage.d.ts +7 -0
- package/lib/typescript/experiment/types/storage.d.ts.map +1 -0
- package/lib/typescript/experiment/types/transport.d.ts +8 -0
- package/lib/typescript/experiment/types/transport.d.ts.map +1 -0
- package/lib/typescript/experiment/types/user.d.ts +106 -0
- package/lib/typescript/experiment/types/user.d.ts.map +1 -0
- package/lib/typescript/experiment/types/variant.d.ts +33 -0
- package/lib/typescript/experiment/types/variant.d.ts.map +1 -0
- package/lib/typescript/experiment/util/backoff.d.ts +14 -0
- package/lib/typescript/experiment/util/backoff.d.ts.map +1 -0
- package/lib/typescript/experiment/util/base64.d.ts +3 -0
- package/lib/typescript/experiment/util/base64.d.ts.map +1 -0
- package/lib/typescript/experiment/util/convert.d.ts +7 -0
- package/lib/typescript/experiment/util/convert.d.ts.map +1 -0
- package/lib/typescript/experiment/util/index.d.ts +6 -0
- package/lib/typescript/experiment/util/index.d.ts.map +1 -0
- package/lib/typescript/experiment/util/platform.d.ts +3 -0
- package/lib/typescript/experiment/util/platform.d.ts.map +1 -0
- package/lib/typescript/experiment/util/randomstring.d.ts +2 -0
- package/lib/typescript/experiment/util/randomstring.d.ts.map +1 -0
- package/lib/typescript/experiment/util/userSessionExposureTracker.d.ts +16 -0
- package/lib/typescript/experiment/util/userSessionExposureTracker.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +31 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/index.web.d.ts +12 -0
- package/lib/typescript/index.web.d.ts.map +1 -0
- package/lib/typescript/native/context.d.ts +29 -0
- package/lib/typescript/native/context.d.ts.map +1 -0
- package/lib/typescript/native/http.d.ts +6 -0
- package/lib/typescript/native/http.d.ts.map +1 -0
- package/lib/typescript/native/hybrid.d.ts +8 -0
- package/lib/typescript/native/hybrid.d.ts.map +1 -0
- package/lib/typescript/native/storage.d.ts +29 -0
- package/lib/typescript/native/storage.d.ts.map +1 -0
- package/nitro.json +33 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroAmplitude+autolinking.cmake +83 -0
- package/nitrogen/generated/android/NitroAmplitude+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroAmplitudeOnLoad.cpp +69 -0
- package/nitrogen/generated/android/NitroAmplitudeOnLoad.hpp +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/com/nitroamplitude/NitroAmplitudeOnLoad.kt +35 -0
- package/nitrogen/generated/ios/NitroAmplitude+autolinking.rb +62 -0
- package/nitrogen/generated/ios/NitroAmplitude-Swift-Cxx-Bridge.cpp +17 -0
- package/nitrogen/generated/ios/NitroAmplitude-Swift-Cxx-Bridge.hpp +27 -0
- package/nitrogen/generated/ios/NitroAmplitude-Swift-Cxx-Umbrella.hpp +38 -0
- package/nitrogen/generated/ios/NitroAmplitudeAutolinking.mm +55 -0
- package/nitrogen/generated/ios/NitroAmplitudeAutolinking.swift +16 -0
- package/nitrogen/generated/shared/c++/HybridAmplitudeContextSpec.cpp +25 -0
- package/nitrogen/generated/shared/c++/HybridAmplitudeContextSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridAmplitudeStorageSpec.cpp +30 -0
- package/nitrogen/generated/shared/c++/HybridAmplitudeStorageSpec.hpp +73 -0
- package/nitrogen/generated/shared/c++/HybridAmplitudeWorkerSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridAmplitudeWorkerSpec.hpp +66 -0
- package/package.json +130 -0
- package/react-native-nitro-amplitude.podspec +36 -0
- package/src/AmplitudeContext.nitro.ts +21 -0
- package/src/AmplitudeStorage.nitro.ts +17 -0
- package/src/AmplitudeWorker.nitro.ts +25 -0
- package/src/analytics/campaign/campaign-tracker.ts +162 -0
- package/src/analytics/campaign/types.ts +18 -0
- package/src/analytics/config.ts +373 -0
- package/src/analytics/cookie-migration/index.ts +69 -0
- package/src/analytics/index.ts +36 -0
- package/src/analytics/migration/remnant-data-migration.ts +206 -0
- package/src/analytics/nitro-transport.ts +35 -0
- package/src/analytics/plugins/context.ts +166 -0
- package/src/analytics/react-native-client.ts +573 -0
- package/src/analytics/storage/local-storage.ts +76 -0
- package/src/analytics/types.ts +30 -0
- package/src/analytics/typings/browser-snippet.d.ts +7 -0
- package/src/analytics/typings/ua-parser.d.ts +4 -0
- package/src/analytics/utils/platform.ts +9 -0
- package/src/analytics/version.ts +1 -0
- package/src/experiment/experimentClient.ts +987 -0
- package/src/experiment/factory.ts +86 -0
- package/src/experiment/gen/version.ts +2 -0
- package/src/experiment/index.ts +14 -0
- package/src/experiment/integration/NativeExperimentReactNativeClient.ts +25 -0
- package/src/experiment/integration/connector.ts +82 -0
- package/src/experiment/integration/default.ts +107 -0
- package/src/experiment/logger/ampLogger.ts +76 -0
- package/src/experiment/logger/consoleLogger.ts +54 -0
- package/src/experiment/storage/cache.ts +271 -0
- package/src/experiment/storage/local-storage.ts +23 -0
- package/src/experiment/stubClient.ts +61 -0
- package/src/experiment/transport/http.ts +105 -0
- package/src/experiment/types/client.ts +38 -0
- package/src/experiment/types/config.ts +210 -0
- package/src/experiment/types/exposure.ts +107 -0
- package/src/experiment/types/logger.ts +71 -0
- package/src/experiment/types/source.ts +52 -0
- package/src/experiment/types/storage.ts +6 -0
- package/src/experiment/types/transport.ts +14 -0
- package/src/experiment/types/user.ts +132 -0
- package/src/experiment/types/variant.ts +36 -0
- package/src/experiment/util/backoff.ts +67 -0
- package/src/experiment/util/base64.ts +20 -0
- package/src/experiment/util/convert.ts +78 -0
- package/src/experiment/util/index.ts +23 -0
- package/src/experiment/util/platform.ts +9 -0
- package/src/experiment/util/randomstring.ts +12 -0
- package/src/experiment/util/userSessionExposureTracker.ts +47 -0
- package/src/index.ts +66 -0
- package/src/index.web.ts +19 -0
- package/src/native/context.ts +73 -0
- package/src/native/http.ts +77 -0
- package/src/native/hybrid.ts +32 -0
- package/src/native/storage.ts +107 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { AnalyticsConnector } from "@amplitude/analytics-connector";
|
|
2
|
+
import type { IdentityListener } from "@amplitude/analytics-connector";
|
|
3
|
+
|
|
4
|
+
import { ExperimentClient } from "./experimentClient";
|
|
5
|
+
import {
|
|
6
|
+
ConnectorExposureTrackingProvider,
|
|
7
|
+
ConnectorUserProvider,
|
|
8
|
+
} from "./integration/connector";
|
|
9
|
+
import { Defaults, ExperimentConfig } from "./types/config";
|
|
10
|
+
|
|
11
|
+
const instances: Record<string, ExperimentClient> = {};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initializes a singleton {@link ExperimentClient} identified by the configured
|
|
15
|
+
* instance name.
|
|
16
|
+
*
|
|
17
|
+
* @param apiKey The deployment API Key
|
|
18
|
+
* @param config See {@link ExperimentConfig} for config options
|
|
19
|
+
*/
|
|
20
|
+
const initialize = (
|
|
21
|
+
apiKey: string,
|
|
22
|
+
config?: ExperimentConfig,
|
|
23
|
+
): ExperimentClient => {
|
|
24
|
+
// Store instances by appending the instance name and api key. Allows for
|
|
25
|
+
// initializing multiple default instances for different api keys.
|
|
26
|
+
const instanceName =
|
|
27
|
+
config?.instanceName ?? Defaults.instanceName ?? "$default_instance";
|
|
28
|
+
const instanceKey = `${instanceName}.${apiKey}`;
|
|
29
|
+
if (!instances[instanceKey]) {
|
|
30
|
+
instances[instanceKey] = new ExperimentClient(apiKey, config || {});
|
|
31
|
+
}
|
|
32
|
+
return instances[instanceKey];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Initialize a singleton {@link ExperimentClient} which automatically
|
|
37
|
+
* integrates with the installed and initialized instance of the amplitude
|
|
38
|
+
* analytics SDK.
|
|
39
|
+
*
|
|
40
|
+
* You must be using amplitude-js SDK version 8.17.0+ for this integration to
|
|
41
|
+
* work.
|
|
42
|
+
*
|
|
43
|
+
* @param apiKey The deployment API Key
|
|
44
|
+
* @param config See {@link ExperimentConfig} for config options
|
|
45
|
+
*/
|
|
46
|
+
const initializeWithAmplitudeAnalytics = (
|
|
47
|
+
apiKey: string,
|
|
48
|
+
config?: ExperimentConfig,
|
|
49
|
+
): ExperimentClient => {
|
|
50
|
+
// Store instances by appending the instance name and api key. Allows for
|
|
51
|
+
// initializing multiple default instances for different api keys.
|
|
52
|
+
const instanceName =
|
|
53
|
+
config?.instanceName ?? Defaults.instanceName ?? "$default_instance";
|
|
54
|
+
const instanceKey = `${instanceName}.${apiKey}`;
|
|
55
|
+
const connector = AnalyticsConnector.getInstance(instanceName);
|
|
56
|
+
if (!instances[instanceKey]) {
|
|
57
|
+
config = {
|
|
58
|
+
userProvider: new ConnectorUserProvider(connector.identityStore),
|
|
59
|
+
exposureTrackingProvider: new ConnectorExposureTrackingProvider(
|
|
60
|
+
connector.eventBridge,
|
|
61
|
+
),
|
|
62
|
+
...config,
|
|
63
|
+
};
|
|
64
|
+
instances[instanceKey] = new ExperimentClient(apiKey, config);
|
|
65
|
+
if (config.automaticFetchOnAmplitudeIdentityChange) {
|
|
66
|
+
const client = instances[instanceKey];
|
|
67
|
+
const listener: IdentityListener = () => {
|
|
68
|
+
client.fetchOnIdentityChange();
|
|
69
|
+
};
|
|
70
|
+
connector.identityStore.addIdentityListener(listener);
|
|
71
|
+
client.addStopCallback(() => {
|
|
72
|
+
connector.identityStore.removeIdentityListener(listener);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return instances[instanceKey];
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Provides factory methods for storing singleton instances of {@link ExperimentClient}
|
|
81
|
+
* @category Core Usage
|
|
82
|
+
*/
|
|
83
|
+
export const Experiment = {
|
|
84
|
+
initialize,
|
|
85
|
+
initializeWithAmplitudeAnalytics,
|
|
86
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./types/config";
|
|
2
|
+
export { Experiment } from "./factory";
|
|
3
|
+
export { StubExperimentClient } from "./stubClient";
|
|
4
|
+
export { ExperimentClient } from "./experimentClient";
|
|
5
|
+
export * from "./types/client";
|
|
6
|
+
export { Source } from "./types/source";
|
|
7
|
+
export * from "./types/user";
|
|
8
|
+
export * from "./types/variant";
|
|
9
|
+
export * from "./types/exposure";
|
|
10
|
+
export * from "./types/storage";
|
|
11
|
+
export { LogLevel } from "./types/logger";
|
|
12
|
+
export type { Logger } from "./types/logger";
|
|
13
|
+
export { ConsoleLogger } from "./logger/consoleLogger";
|
|
14
|
+
export { LocalStorage, MemoryStorage } from "./storage/local-storage";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NativeModules, TurboModuleRegistry } from "react-native";
|
|
2
|
+
import type { TurboModule } from "react-native";
|
|
3
|
+
|
|
4
|
+
export interface Spec extends TurboModule {
|
|
5
|
+
getApplicationContext(): Promise<{
|
|
6
|
+
version?: string;
|
|
7
|
+
platform?: string;
|
|
8
|
+
language?: string;
|
|
9
|
+
os?: string;
|
|
10
|
+
device_brand?: string;
|
|
11
|
+
device_manufacturer?: string;
|
|
12
|
+
device_model?: string;
|
|
13
|
+
carrier?: string;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const turboModule = TurboModuleRegistry.get<Spec>(
|
|
18
|
+
"ExperimentReactNativeClient",
|
|
19
|
+
);
|
|
20
|
+
const legacyModule = NativeModules.ExperimentReactNativeClient as
|
|
21
|
+
| Spec
|
|
22
|
+
| undefined
|
|
23
|
+
| null;
|
|
24
|
+
|
|
25
|
+
export default turboModule ?? legacyModule;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { EventBridge, IdentityStore } from "@amplitude/analytics-connector";
|
|
2
|
+
import { safeGlobal } from "@amplitude/experiment-core";
|
|
3
|
+
|
|
4
|
+
import { Exposure, ExposureTrackingProvider } from "../types/exposure";
|
|
5
|
+
import { ExperimentUser, ExperimentUserProvider } from "../types/user";
|
|
6
|
+
|
|
7
|
+
type UserProperties = Record<
|
|
8
|
+
string,
|
|
9
|
+
string | number | boolean | (string | number | boolean)[]
|
|
10
|
+
>;
|
|
11
|
+
|
|
12
|
+
export class ConnectorUserProvider implements ExperimentUserProvider {
|
|
13
|
+
private readonly identityStore: IdentityStore;
|
|
14
|
+
constructor(identityStore: IdentityStore) {
|
|
15
|
+
this.identityStore = identityStore;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async identityReady(ms: number): Promise<void> {
|
|
19
|
+
const identity = this.identityStore.getIdentity();
|
|
20
|
+
if (!identity.userId && !identity.deviceId) {
|
|
21
|
+
return new Promise<void>((resolve, reject) => {
|
|
22
|
+
let timeoutHandle: ReturnType<typeof safeGlobal.setTimeout> | undefined;
|
|
23
|
+
const cleanup = () => {
|
|
24
|
+
if (timeoutHandle != null) {
|
|
25
|
+
safeGlobal.clearTimeout(timeoutHandle);
|
|
26
|
+
timeoutHandle = undefined;
|
|
27
|
+
}
|
|
28
|
+
this.identityStore.removeIdentityListener(listener);
|
|
29
|
+
};
|
|
30
|
+
const listener = () => {
|
|
31
|
+
cleanup();
|
|
32
|
+
resolve();
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
timeoutHandle = safeGlobal.setTimeout(() => {
|
|
36
|
+
cleanup();
|
|
37
|
+
reject(
|
|
38
|
+
Error(
|
|
39
|
+
"Timed out waiting for Amplitude Analytics SDK to initialize. " +
|
|
40
|
+
"You must ensure that the analytics SDK is initialized prior to calling fetch().",
|
|
41
|
+
),
|
|
42
|
+
);
|
|
43
|
+
}, ms);
|
|
44
|
+
this.identityStore.addIdentityListener(listener);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async getUser(): Promise<ExperimentUser> {
|
|
50
|
+
return this.getUserSync();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
getUserSync(): ExperimentUser {
|
|
54
|
+
const identity = this.identityStore.getIdentity();
|
|
55
|
+
let userProperties: UserProperties | undefined;
|
|
56
|
+
try {
|
|
57
|
+
userProperties = identity.userProperties as UserProperties;
|
|
58
|
+
} catch {
|
|
59
|
+
console.warn("[Experiment] failed to cast user properties");
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
user_id: identity.userId,
|
|
63
|
+
device_id: identity.deviceId,
|
|
64
|
+
user_properties: userProperties,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export class ConnectorExposureTrackingProvider implements ExposureTrackingProvider {
|
|
70
|
+
private readonly eventBridge: EventBridge;
|
|
71
|
+
|
|
72
|
+
constructor(eventBridge: EventBridge) {
|
|
73
|
+
this.eventBridge = eventBridge;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
track(exposure: Exposure): void {
|
|
77
|
+
this.eventBridge.logEvent({
|
|
78
|
+
eventType: "$exposure",
|
|
79
|
+
eventProperties: exposure,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AnalyticsConnector,
|
|
3
|
+
ApplicationContext,
|
|
4
|
+
} from "@amplitude/analytics-connector";
|
|
5
|
+
import { Poller } from "@amplitude/experiment-core";
|
|
6
|
+
|
|
7
|
+
import { ExperimentUser, ExperimentUserProvider } from "../types/user";
|
|
8
|
+
import { isNative } from "../util/platform";
|
|
9
|
+
|
|
10
|
+
import { getNativeApplicationContext } from "../../native/context";
|
|
11
|
+
import { ConnectorUserProvider } from "./connector";
|
|
12
|
+
|
|
13
|
+
export class DefaultUserProvider implements ExperimentUserProvider {
|
|
14
|
+
public baseProvider: ExperimentUserProvider | null;
|
|
15
|
+
private readonly applicationContext: ApplicationContext;
|
|
16
|
+
public cachedUser: ExperimentUser = {};
|
|
17
|
+
public cachedApplicationContext?: Record<string, string>;
|
|
18
|
+
private readonly poller: Poller = new Poller(() => this.load(), 1000);
|
|
19
|
+
|
|
20
|
+
constructor(baseProvider: ExperimentUserProvider | null = null) {
|
|
21
|
+
this.baseProvider = baseProvider;
|
|
22
|
+
this.applicationContext =
|
|
23
|
+
AnalyticsConnector.getInstance(
|
|
24
|
+
"context",
|
|
25
|
+
).applicationContextProvider.getApplicationContext();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public start(): void {
|
|
29
|
+
void this.load();
|
|
30
|
+
if (this.shouldPollUserCache()) {
|
|
31
|
+
this.poller.start();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public stop(): void {
|
|
36
|
+
this.poller.stop();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The variant method is not async
|
|
41
|
+
*/
|
|
42
|
+
async load(): Promise<void> {
|
|
43
|
+
try {
|
|
44
|
+
this.cachedUser = await this.getUser();
|
|
45
|
+
} catch {
|
|
46
|
+
this.cachedUser = this.cachedUser || {};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async getApplicationContext(): Promise<Record<string, string>> {
|
|
51
|
+
if (this.cachedApplicationContext) {
|
|
52
|
+
return this.cachedApplicationContext;
|
|
53
|
+
} else if (isNative()) {
|
|
54
|
+
try {
|
|
55
|
+
this.cachedApplicationContext = getNativeApplicationContext({
|
|
56
|
+
adid: true,
|
|
57
|
+
carrier: true,
|
|
58
|
+
deviceManufacturer: true,
|
|
59
|
+
deviceModel: true,
|
|
60
|
+
ipAddress: false,
|
|
61
|
+
language: true,
|
|
62
|
+
osName: true,
|
|
63
|
+
osVersion: true,
|
|
64
|
+
platform: true,
|
|
65
|
+
appSetId: true,
|
|
66
|
+
idfv: true,
|
|
67
|
+
country: true,
|
|
68
|
+
});
|
|
69
|
+
} catch {
|
|
70
|
+
this.cachedApplicationContext = {};
|
|
71
|
+
}
|
|
72
|
+
return this.cachedApplicationContext;
|
|
73
|
+
} else {
|
|
74
|
+
this.cachedApplicationContext = this.applicationContext;
|
|
75
|
+
return this.cachedApplicationContext;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
getUserSync(): ExperimentUser {
|
|
80
|
+
const context = this.cachedApplicationContext ?? {};
|
|
81
|
+
let user: ExperimentUser = this.cachedUser;
|
|
82
|
+
if (this.baseProvider instanceof ConnectorUserProvider) {
|
|
83
|
+
const connectorProvider = this.baseProvider;
|
|
84
|
+
user = connectorProvider.getUserSync();
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
...context,
|
|
88
|
+
...user,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async getUser(): Promise<ExperimentUser> {
|
|
93
|
+
const context = await this.getApplicationContext();
|
|
94
|
+
const baseUser = await this.baseProvider?.getUser();
|
|
95
|
+
return {
|
|
96
|
+
...context,
|
|
97
|
+
...(baseUser ?? {}),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private shouldPollUserCache(): boolean {
|
|
102
|
+
return (
|
|
103
|
+
!!this.baseProvider &&
|
|
104
|
+
!(this.baseProvider instanceof ConnectorUserProvider)
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Logger, LogLevel } from "../types/logger";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Internal logger class that wraps a Logger implementation and handles log level filtering.
|
|
5
|
+
* This class provides a centralized logging mechanism for the Experiment client.
|
|
6
|
+
* @category Logging
|
|
7
|
+
*/
|
|
8
|
+
export class AmpLogger implements Logger {
|
|
9
|
+
private readonly logger: Logger;
|
|
10
|
+
private readonly logLevel: LogLevel;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new AmpLogger instance
|
|
14
|
+
* @param logger The underlying logger implementation to use
|
|
15
|
+
* @param logLevel The minimum log level to output. Messages below this level will be ignored.
|
|
16
|
+
*/
|
|
17
|
+
constructor(logger: Logger, logLevel: LogLevel = LogLevel.Error) {
|
|
18
|
+
this.logger = logger;
|
|
19
|
+
this.logLevel = logLevel;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Log an error message
|
|
24
|
+
* @param message The message to log
|
|
25
|
+
* @param optionalParams Additional parameters to log
|
|
26
|
+
*/
|
|
27
|
+
error(message?: any, ...optionalParams: any[]): void {
|
|
28
|
+
if (this.logLevel >= LogLevel.Error) {
|
|
29
|
+
this.logger.error(message, ...optionalParams);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Log a warning message
|
|
35
|
+
* @param message The message to log
|
|
36
|
+
* @param optionalParams Additional parameters to log
|
|
37
|
+
*/
|
|
38
|
+
warn(message?: any, ...optionalParams: any[]): void {
|
|
39
|
+
if (this.logLevel >= LogLevel.Warn) {
|
|
40
|
+
this.logger.warn(message, ...optionalParams);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Log an informational message
|
|
46
|
+
* @param message The message to log
|
|
47
|
+
* @param optionalParams Additional parameters to log
|
|
48
|
+
*/
|
|
49
|
+
info(message?: any, ...optionalParams: any[]): void {
|
|
50
|
+
if (this.logLevel >= LogLevel.Info) {
|
|
51
|
+
this.logger.info(message, ...optionalParams);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Log a debug message
|
|
57
|
+
* @param message The message to log
|
|
58
|
+
* @param optionalParams Additional parameters to log
|
|
59
|
+
*/
|
|
60
|
+
debug(message?: any, ...optionalParams: any[]): void {
|
|
61
|
+
if (this.logLevel >= LogLevel.Debug) {
|
|
62
|
+
this.logger.debug(message, ...optionalParams);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Log a verbose message
|
|
68
|
+
* @param message The message to log
|
|
69
|
+
* @param optionalParams Additional parameters to log
|
|
70
|
+
*/
|
|
71
|
+
verbose(message?: any, ...optionalParams: any[]): void {
|
|
72
|
+
if (this.logLevel >= LogLevel.Verbose) {
|
|
73
|
+
this.logger.verbose(message, ...optionalParams);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Logger } from "../types/logger";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Default console-based logger implementation.
|
|
5
|
+
* This logger uses the browser's console API to output log messages.
|
|
6
|
+
* Log level filtering is handled by the AmpLogger wrapper class.
|
|
7
|
+
* @category Logging
|
|
8
|
+
*/
|
|
9
|
+
export class ConsoleLogger implements Logger {
|
|
10
|
+
/**
|
|
11
|
+
* Log an error message
|
|
12
|
+
* @param message The message to log
|
|
13
|
+
* @param optionalParams Additional parameters to log
|
|
14
|
+
*/
|
|
15
|
+
error(message?: any, ...optionalParams: any[]): void {
|
|
16
|
+
console.error(message, ...optionalParams);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Log a warning message
|
|
21
|
+
* @param message The message to log
|
|
22
|
+
* @param optionalParams Additional parameters to log
|
|
23
|
+
*/
|
|
24
|
+
warn(message?: any, ...optionalParams: any[]): void {
|
|
25
|
+
console.warn(message, ...optionalParams);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Log an informational message
|
|
30
|
+
* @param message The message to log
|
|
31
|
+
* @param optionalParams Additional parameters to log
|
|
32
|
+
*/
|
|
33
|
+
info(message?: any, ...optionalParams: any[]): void {
|
|
34
|
+
console.info(message, ...optionalParams);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Log a debug message
|
|
39
|
+
* @param message The message to log
|
|
40
|
+
* @param optionalParams Additional parameters to log
|
|
41
|
+
*/
|
|
42
|
+
debug(message?: any, ...optionalParams: any[]): void {
|
|
43
|
+
console.debug(message, ...optionalParams);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Log a verbose message
|
|
48
|
+
* @param message The message to log
|
|
49
|
+
* @param optionalParams Additional parameters to log
|
|
50
|
+
*/
|
|
51
|
+
verbose(message?: any, ...optionalParams: any[]): void {
|
|
52
|
+
console.debug(message, ...optionalParams);
|
|
53
|
+
}
|
|
54
|
+
}
|