@datadog/mobile-react-native-openfeature 3.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/LICENSE +201 -0
- package/README.md +117 -0
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/provider.js +106 -0
- package/lib/commonjs/provider.js.map +1 -0
- package/lib/module/index.js +9 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/provider.js +99 -0
- package/lib/module/provider.js.map +1 -0
- package/lib/typescript/core/src/DdAttributes.d.ts +20 -0
- package/lib/typescript/core/src/DdAttributes.d.ts.map +1 -0
- package/lib/typescript/core/src/DdSdkReactNative.d.ts +122 -0
- package/lib/typescript/core/src/DdSdkReactNative.d.ts.map +1 -0
- package/lib/typescript/core/src/InternalLog.d.ts +13 -0
- package/lib/typescript/core/src/InternalLog.d.ts.map +1 -0
- package/lib/typescript/core/src/config/DatadogProviderConfiguration.d.ts +12 -0
- package/lib/typescript/core/src/config/DatadogProviderConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/FileBasedConfiguration.d.ts +17 -0
- package/lib/typescript/core/src/config/FileBasedConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/FileBasedConfiguration.type.d.ts +52 -0
- package/lib/typescript/core/src/config/FileBasedConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/core/src/config/async/AutoInstrumentationConfiguration.d.ts +60 -0
- package/lib/typescript/core/src/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/async/PartialInitializationConfiguration.d.ts +47 -0
- package/lib/typescript/core/src/config/async/PartialInitializationConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/async/asyncInitializationHelper.d.ts +5 -0
- package/lib/typescript/core/src/config/async/asyncInitializationHelper.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/CoreConfiguration.d.ts +52 -0
- package/lib/typescript/core/src/config/features/CoreConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/CoreConfiguration.type.d.ts +90 -0
- package/lib/typescript/core/src/config/features/CoreConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/CoreConfigurationNative.d.ts +54 -0
- package/lib/typescript/core/src/config/features/CoreConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/LogsConfiguration.d.ts +17 -0
- package/lib/typescript/core/src/config/features/LogsConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/LogsConfiguration.type.d.ts +24 -0
- package/lib/typescript/core/src/config/features/LogsConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/LogsConfigurationNative.d.ts +6 -0
- package/lib/typescript/core/src/config/features/LogsConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/RumConfiguration.d.ts +66 -0
- package/lib/typescript/core/src/config/features/RumConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/RumConfiguration.type.d.ts +131 -0
- package/lib/typescript/core/src/config/features/RumConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/RumConfigurationNative.d.ts +25 -0
- package/lib/typescript/core/src/config/features/RumConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/TraceConfiguration.d.ts +10 -0
- package/lib/typescript/core/src/config/features/TraceConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/TraceConfiguration.type.d.ts +11 -0
- package/lib/typescript/core/src/config/features/TraceConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/TraceConfigurationNative.d.ts +4 -0
- package/lib/typescript/core/src/config/features/TraceConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/BatchProcessingLevel.d.ts +18 -0
- package/lib/typescript/core/src/config/types/BatchProcessingLevel.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/BatchSize.d.ts +19 -0
- package/lib/typescript/core/src/config/types/BatchSize.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/InitializationMode.d.ts +5 -0
- package/lib/typescript/core/src/config/types/InitializationMode.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/InitializationModeForTelemetry.d.ts +2 -0
- package/lib/typescript/core/src/config/types/InitializationModeForTelemetry.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/ProxyConfiguration.d.ts +49 -0
- package/lib/typescript/core/src/config/types/ProxyConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/SdkVerbosity.d.ts +10 -0
- package/lib/typescript/core/src/config/types/SdkVerbosity.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/TrackingConsent.d.ts +9 -0
- package/lib/typescript/core/src/config/types/TrackingConsent.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/UploadFrequency.d.ts +18 -0
- package/lib/typescript/core/src/config/types/UploadFrequency.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/VitalsUpdateFrequency.d.ts +7 -0
- package/lib/typescript/core/src/config/types/VitalsUpdateFrequency.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/index.d.ts +10 -0
- package/lib/typescript/core/src/config/types/index.d.ts.map +1 -0
- package/lib/typescript/core/src/flags/DdFlags.d.ts +3 -0
- package/lib/typescript/core/src/flags/DdFlags.d.ts.map +1 -0
- package/lib/typescript/core/src/flags/FlagsClient.d.ts +114 -0
- package/lib/typescript/core/src/flags/FlagsClient.d.ts.map +1 -0
- package/lib/typescript/core/src/flags/internal.d.ts +14 -0
- package/lib/typescript/core/src/flags/internal.d.ts.map +1 -0
- package/lib/typescript/core/src/flags/types.d.ts +202 -0
- package/lib/typescript/core/src/flags/types.d.ts.map +1 -0
- package/lib/typescript/core/src/index.d.ts +41 -0
- package/lib/typescript/core/src/index.d.ts.map +1 -0
- package/lib/typescript/core/src/logs/DdLogs.d.ts +24 -0
- package/lib/typescript/core/src/logs/DdLogs.d.ts.map +1 -0
- package/lib/typescript/core/src/logs/eventMapper.d.ts +13 -0
- package/lib/typescript/core/src/logs/eventMapper.d.ts.map +1 -0
- package/lib/typescript/core/src/logs/types.d.ts +74 -0
- package/lib/typescript/core/src/logs/types.d.ts.map +1 -0
- package/lib/typescript/core/src/metro/debugIdResolver.d.ts +3 -0
- package/lib/typescript/core/src/metro/debugIdResolver.d.ts.map +1 -0
- package/lib/typescript/core/src/nativeModulesTypes.d.ts +86 -0
- package/lib/typescript/core/src/nativeModulesTypes.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/DdRum.d.ts +59 -0
- package/lib/typescript/core/src/rum/DdRum.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/constants.d.ts +2 -0
- package/lib/typescript/core/src/rum/constants.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/eventMappers/actionEventMapper.d.ts +22 -0
- package/lib/typescript/core/src/rum/eventMappers/actionEventMapper.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/eventMappers/errorEventMapper.d.ts +24 -0
- package/lib/typescript/core/src/rum/eventMappers/errorEventMapper.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/eventMappers/resourceEventMapper.d.ts +25 -0
- package/lib/typescript/core/src/rum/eventMappers/resourceEventMapper.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/helper.d.ts +10 -0
- package/lib/typescript/core/src/rum/helper.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/DdRumErrorTracking.d.ts +17 -0
- package/lib/typescript/core/src/rum/instrumentation/DdRumErrorTracking.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts +38 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdEventsInterceptor.d.ts +25 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdEventsInterceptor.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts +29 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/EventsInterceptor.d.ts +4 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/EventsInterceptor.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.d.ts +5 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.d.ts +8 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/ddBabelUtils.d.ts +9 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/ddBabelUtils.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/getJsxRuntime.d.ts +2 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/getJsxRuntime.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +23 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts +46 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.d.ts +24 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingIdentifier.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts +121 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +14 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts +20 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts +11 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts +12 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts +9 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts +24 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.d.ts +4 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headers.d.ts +4 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headers.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.d.ts +9 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.d.ts +7 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.d.ts +18 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.d.ts +7 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts +22 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts +6 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.d.ts +3 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts +14 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +28 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/types.d.ts +218 -0
- package/lib/typescript/core/src/rum/types.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts +15 -0
- package/lib/typescript/core/src/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AccountInfoSingleton/types.d.ts +6 -0
- package/lib/typescript/core/src/sdk/AccountInfoSingleton/types.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/attributesEncoding.d.ts +13 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/attributesEncoding.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/defaultEncoders.d.ts +33 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/defaultEncoders.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/errorUtils.d.ts +15 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/errorUtils.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/helpers.d.ts +17 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/helpers.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/types.d.ts +21 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/types.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/utils.d.ts +7 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/utils.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesSingleton/AttributesSingleton.d.ts +17 -0
- package/lib/typescript/core/src/sdk/AttributesSingleton/AttributesSingleton.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesSingleton/types.d.ts +4 -0
- package/lib/typescript/core/src/sdk/AttributesSingleton/types.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DatadogEventEmitter/DatadogBatchedBridgeEventEmitter.d.ts +11 -0
- package/lib/typescript/core/src/sdk/DatadogEventEmitter/DatadogBatchedBridgeEventEmitter.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.d.ts +10 -0
- package/lib/typescript/core/src/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DatadogEventEmitter/DatadogEventEmitter.d.ts +7 -0
- package/lib/typescript/core/src/sdk/DatadogEventEmitter/DatadogEventEmitter.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DatadogEventEmitter/DatadogNativeEventEmitter.d.ts +12 -0
- package/lib/typescript/core/src/sdk/DatadogEventEmitter/DatadogNativeEventEmitter.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.d.ts +14 -0
- package/lib/typescript/core/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.d.ts +6 -0
- package/lib/typescript/core/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/Buffer/BoundedBuffer.d.ts +18 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/Buffer/BoundedBuffer.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/Buffer/BufferSingleton.d.ts +8 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/Buffer/BufferSingleton.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/Buffer/DatadogBuffer.d.ts +21 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/Buffer/DatadogBuffer.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/Buffer/PassThroughBuffer.d.ts +8 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/Buffer/PassThroughBuffer.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/Buffer/bufferNativeCall.d.ts +4 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/Buffer/bufferNativeCall.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/DatadogProvider.d.ts +29 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/DatadogProvider.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/DatadogProviderState.d.ts +9 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/DatadogProviderState.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DdSdk.d.ts +3 -0
- package/lib/typescript/core/src/sdk/DdSdk.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DdSdkInternal.d.ts +39 -0
- package/lib/typescript/core/src/sdk/DdSdkInternal.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/EventMappers/EventMapper.d.ts +27 -0
- package/lib/typescript/core/src/sdk/EventMappers/EventMapper.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/EventMappers/utils/deepClone.d.ts +11 -0
- package/lib/typescript/core/src/sdk/EventMappers/utils/deepClone.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/GlobalState/GlobalState.d.ts +13 -0
- package/lib/typescript/core/src/sdk/GlobalState/GlobalState.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +14 -0
- package/lib/typescript/core/src/sdk/UserInfoSingleton/UserInfoSingleton.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/UserInfoSingleton/types.d.ts +7 -0
- package/lib/typescript/core/src/sdk/UserInfoSingleton/types.d.ts.map +1 -0
- package/lib/typescript/core/src/specs/NativeDdFlags.d.ts +15 -0
- package/lib/typescript/core/src/specs/NativeDdFlags.d.ts.map +1 -0
- package/lib/typescript/core/src/specs/NativeDdLogs.d.ts +70 -0
- package/lib/typescript/core/src/specs/NativeDdLogs.d.ts.map +1 -0
- package/lib/typescript/core/src/specs/NativeDdRum.d.ts +149 -0
- package/lib/typescript/core/src/specs/NativeDdRum.d.ts.map +1 -0
- package/lib/typescript/core/src/specs/NativeDdSdk.d.ts +105 -0
- package/lib/typescript/core/src/specs/NativeDdSdk.d.ts.map +1 -0
- package/lib/typescript/core/src/specs/NativeDdTrace.d.ts +24 -0
- package/lib/typescript/core/src/specs/NativeDdTrace.d.ts.map +1 -0
- package/lib/typescript/core/src/trace/DdTrace.d.ts +3 -0
- package/lib/typescript/core/src/trace/DdTrace.d.ts.map +1 -0
- package/lib/typescript/core/src/types.d.ts +130 -0
- package/lib/typescript/core/src/types.d.ts.map +1 -0
- package/lib/typescript/core/src/utils/Timer.d.ts +22 -0
- package/lib/typescript/core/src/utils/Timer.d.ts.map +1 -0
- package/lib/typescript/core/src/utils/jsUtils.d.ts +2 -0
- package/lib/typescript/core/src/utils/jsUtils.d.ts.map +1 -0
- package/lib/typescript/core/src/utils/longTasksUtils.d.ts +7 -0
- package/lib/typescript/core/src/utils/longTasksUtils.d.ts.map +1 -0
- package/lib/typescript/core/src/utils/singletonUtils.d.ts +2 -0
- package/lib/typescript/core/src/utils/singletonUtils.d.ts.map +1 -0
- package/lib/typescript/core/src/utils/time-provider/DefaultTimeProvider.d.ts +8 -0
- package/lib/typescript/core/src/utils/time-provider/DefaultTimeProvider.d.ts.map +1 -0
- package/lib/typescript/core/src/utils/time-provider/TimeProvider.d.ts +19 -0
- package/lib/typescript/core/src/utils/time-provider/TimeProvider.d.ts.map +1 -0
- package/lib/typescript/core/src/version.d.ts +2 -0
- package/lib/typescript/core/src/version.d.ts.map +1 -0
- package/lib/typescript/react-native-openfeature/src/index.d.ts +5 -0
- package/lib/typescript/react-native-openfeature/src/index.d.ts.map +1 -0
- package/lib/typescript/react-native-openfeature/src/provider.d.ts +27 -0
- package/lib/typescript/react-native-openfeature/src/provider.d.ts.map +1 -0
- package/package.json +87 -0
- package/src/index.ts +11 -0
- package/src/provider.ts +180 -0
package/src/provider.ts
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { DdFlags } from '@datadog/mobile-react-native';
|
|
8
|
+
import type {
|
|
9
|
+
FlagDetails,
|
|
10
|
+
FlagsClient,
|
|
11
|
+
EvaluationContext as DdEvaluationContext
|
|
12
|
+
} from '@datadog/mobile-react-native';
|
|
13
|
+
import { OpenFeatureEventEmitter, ErrorCode } from '@openfeature/web-sdk';
|
|
14
|
+
import type {
|
|
15
|
+
EvaluationContext as OFEvaluationContext,
|
|
16
|
+
JsonValue,
|
|
17
|
+
Logger,
|
|
18
|
+
Paradigm,
|
|
19
|
+
Provider,
|
|
20
|
+
ProviderMetadata,
|
|
21
|
+
ResolutionDetails,
|
|
22
|
+
PrimitiveValue,
|
|
23
|
+
ProviderEventEmitter,
|
|
24
|
+
ProviderEvents
|
|
25
|
+
} from '@openfeature/web-sdk';
|
|
26
|
+
|
|
27
|
+
export interface DatadogOpenFeatureProviderOptions {
|
|
28
|
+
/**
|
|
29
|
+
* The name of the Datadog Flags client to use.
|
|
30
|
+
*
|
|
31
|
+
* Provide this parameter in order to use different Datadog Flags clients for different OpenFeature domains.
|
|
32
|
+
*
|
|
33
|
+
* @default 'default'
|
|
34
|
+
*/
|
|
35
|
+
clientName?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class DatadogOpenFeatureProvider implements Provider {
|
|
39
|
+
readonly runsOn: Paradigm = 'client';
|
|
40
|
+
readonly metadata: ProviderMetadata = {
|
|
41
|
+
name: 'datadog-react-native'
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
private options: DatadogOpenFeatureProviderOptions;
|
|
45
|
+
private flagsClient: FlagsClient;
|
|
46
|
+
|
|
47
|
+
readonly events: ProviderEventEmitter<ProviderEvents> = new OpenFeatureEventEmitter();
|
|
48
|
+
private contextChangePromise = Promise.resolve();
|
|
49
|
+
|
|
50
|
+
constructor(options: DatadogOpenFeatureProviderOptions = {}) {
|
|
51
|
+
if (!options.clientName) {
|
|
52
|
+
options.clientName = 'default';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
this.options = options;
|
|
56
|
+
|
|
57
|
+
this.flagsClient = DdFlags.getClient(this.options.clientName);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async initialize(context: OFEvaluationContext = {}): Promise<void> {
|
|
61
|
+
const ddContext = toDdContext(context);
|
|
62
|
+
this.contextChangePromise = this.flagsClient.setEvaluationContext(
|
|
63
|
+
ddContext
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
await this.contextChangePromise;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async onContextChange(
|
|
70
|
+
_oldContext: OFEvaluationContext,
|
|
71
|
+
newContext: OFEvaluationContext
|
|
72
|
+
): Promise<void> {
|
|
73
|
+
const newDdContext = toDdContext(newContext);
|
|
74
|
+
|
|
75
|
+
// Promise chain in case `onContextChange` is called multiple times.
|
|
76
|
+
this.contextChangePromise = this.contextChangePromise.then(() => {
|
|
77
|
+
return this.flagsClient.setEvaluationContext(newDdContext);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// Wait for the current context change to complete.
|
|
81
|
+
await this.contextChangePromise;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
resolveBooleanEvaluation(
|
|
85
|
+
flagKey: string,
|
|
86
|
+
defaultValue: boolean,
|
|
87
|
+
_context: OFEvaluationContext,
|
|
88
|
+
_logger: Logger
|
|
89
|
+
): ResolutionDetails<boolean> {
|
|
90
|
+
const details = this.flagsClient.getBooleanDetails(
|
|
91
|
+
flagKey,
|
|
92
|
+
defaultValue
|
|
93
|
+
);
|
|
94
|
+
return toFlagResolution(details);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
resolveStringEvaluation(
|
|
98
|
+
flagKey: string,
|
|
99
|
+
defaultValue: string,
|
|
100
|
+
_context: OFEvaluationContext,
|
|
101
|
+
_logger: Logger
|
|
102
|
+
): ResolutionDetails<string> {
|
|
103
|
+
const details = this.flagsClient.getStringDetails(
|
|
104
|
+
flagKey,
|
|
105
|
+
defaultValue
|
|
106
|
+
);
|
|
107
|
+
return toFlagResolution(details);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
resolveNumberEvaluation(
|
|
111
|
+
flagKey: string,
|
|
112
|
+
defaultValue: number,
|
|
113
|
+
_context: OFEvaluationContext,
|
|
114
|
+
_logger: Logger
|
|
115
|
+
): ResolutionDetails<number> {
|
|
116
|
+
const details = this.flagsClient.getNumberDetails(
|
|
117
|
+
flagKey,
|
|
118
|
+
defaultValue
|
|
119
|
+
);
|
|
120
|
+
return toFlagResolution(details);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
resolveObjectEvaluation<T extends JsonValue>(
|
|
124
|
+
flagKey: string,
|
|
125
|
+
defaultValue: T,
|
|
126
|
+
_context: OFEvaluationContext,
|
|
127
|
+
_logger: Logger
|
|
128
|
+
): ResolutionDetails<T> {
|
|
129
|
+
// The OpenFeature spec states that the return value can be any valid JSON value.
|
|
130
|
+
// However, the Datadog Flags feature only supports JSON objects for the JSON feature flag type.
|
|
131
|
+
// Thus, the user should always expect the returned value to be an object instead of any arbitrary JSON value.
|
|
132
|
+
// Also, the user is responsible for providing a proper `defaultValue` that's an object.
|
|
133
|
+
|
|
134
|
+
const details = this.flagsClient.getObjectDetails<T>(
|
|
135
|
+
flagKey,
|
|
136
|
+
defaultValue
|
|
137
|
+
);
|
|
138
|
+
return toFlagResolution(details);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const toDdContext = (context: OFEvaluationContext): DdEvaluationContext => {
|
|
143
|
+
const { targetingKey, ...attributes } = context;
|
|
144
|
+
|
|
145
|
+
// Important ⚠️
|
|
146
|
+
// The Flags SDK doesn't support nested non-primitive values in the evaluation context as per OF.3 FFE SDK requirement.
|
|
147
|
+
// However, we let the SDK handle this inside of FlagsClient since it does this processing anyways.
|
|
148
|
+
const ddContextAttributes = attributes as Record<string, PrimitiveValue>;
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
// Allow flag evaluations without a provided targeting key.
|
|
152
|
+
targetingKey: targetingKey ?? '',
|
|
153
|
+
attributes: ddContextAttributes
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const toFlagResolution = <T>(details: FlagDetails<T>): ResolutionDetails<T> => {
|
|
158
|
+
const {
|
|
159
|
+
value,
|
|
160
|
+
reason,
|
|
161
|
+
variant,
|
|
162
|
+
allocationKey,
|
|
163
|
+
errorCode,
|
|
164
|
+
errorMessage
|
|
165
|
+
} = details;
|
|
166
|
+
|
|
167
|
+
const parsedErrorCode =
|
|
168
|
+
errorCode && (ErrorCode[errorCode as ErrorCode] || ErrorCode.GENERAL);
|
|
169
|
+
|
|
170
|
+
const result: ResolutionDetails<T> = {
|
|
171
|
+
value,
|
|
172
|
+
reason,
|
|
173
|
+
variant,
|
|
174
|
+
flagMetadata: allocationKey ? { allocationKey } : undefined,
|
|
175
|
+
errorCode: parsedErrorCode,
|
|
176
|
+
errorMessage
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
return result;
|
|
180
|
+
};
|