@datadog/mobile-react-native-openfeature 3.5.3 → 3.6.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/README.md +77 -0
- package/lib/commonjs/coreProvider.js +79 -0
- package/lib/commonjs/coreProvider.js.map +1 -0
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappers.js +50 -0
- package/lib/commonjs/mappers.js.map +1 -0
- package/lib/commonjs/offlineProvider.js +149 -0
- package/lib/commonjs/offlineProvider.js.map +1 -0
- package/lib/commonjs/provider.js +9 -73
- package/lib/commonjs/provider.js.map +1 -1
- package/lib/module/coreProvider.js +72 -0
- package/lib/module/coreProvider.js.map +1 -0
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/mappers.js +42 -0
- package/lib/module/mappers.js.map +1 -0
- package/lib/module/offlineProvider.js +143 -0
- package/lib/module/offlineProvider.js.map +1 -0
- package/lib/module/provider.js +7 -71
- package/lib/module/provider.js.map +1 -1
- package/lib/typescript/core/src/DdSdkReactNative.d.ts.map +1 -1
- package/lib/typescript/core/src/config/FileBasedConfiguration.d.ts.map +1 -1
- package/lib/typescript/core/src/config/FileBasedConfiguration.type.d.ts +1 -0
- package/lib/typescript/core/src/config/FileBasedConfiguration.type.d.ts.map +1 -1
- package/lib/typescript/core/src/config/async/AutoInstrumentationConfiguration.d.ts +2 -0
- package/lib/typescript/core/src/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -1
- package/lib/typescript/core/src/config/features/RumConfiguration.d.ts +2 -0
- package/lib/typescript/core/src/config/features/RumConfiguration.d.ts.map +1 -1
- package/lib/typescript/core/src/config/features/RumConfiguration.type.d.ts +7 -0
- package/lib/typescript/core/src/config/features/RumConfiguration.type.d.ts.map +1 -1
- package/lib/typescript/core/src/flags/FlagsClient.d.ts +96 -0
- package/lib/typescript/core/src/flags/FlagsClient.d.ts.map +1 -1
- package/lib/typescript/core/src/flags/configuration/context.d.ts +20 -0
- package/lib/typescript/core/src/flags/configuration/context.d.ts.map +1 -0
- package/lib/typescript/core/src/flags/configuration/index.d.ts +5 -0
- package/lib/typescript/core/src/flags/configuration/index.d.ts.map +1 -0
- package/lib/typescript/core/src/flags/configuration/precomputed.d.ts +25 -0
- package/lib/typescript/core/src/flags/configuration/precomputed.d.ts.map +1 -0
- package/lib/typescript/core/src/flags/configuration/types.d.ts +24 -0
- package/lib/typescript/core/src/flags/configuration/types.d.ts.map +1 -0
- package/lib/typescript/core/src/flags/configuration/wire.d.ts +2 -0
- package/lib/typescript/core/src/flags/configuration/wire.d.ts.map +1 -0
- package/lib/typescript/core/src/flags/internal.d.ts.map +1 -1
- package/lib/typescript/core/src/flags/types.d.ts +1 -1
- package/lib/typescript/core/src/flags/types.d.ts.map +1 -1
- package/lib/typescript/core/src/index.d.ts +4 -2
- package/lib/typescript/core/src/index.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +3 -2
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.d.ts +29 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/FetchProxyState.d.ts +8 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/FetchProxyState.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.d.ts +20 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/{XHRProxy/DatadogRumResource → common}/ResourceReporter.d.ts +2 -2
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/ResourceReporter.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/internalDevResourceBlocklist.d.ts +3 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/internalDevResourceBlocklist.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/requestHeaders.d.ts +18 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/requestHeaders.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/{XHRProxy/DatadogRumResource → common}/resourceTiming.d.ts +0 -6
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/resourceTiming.d.ts.map +1 -0
- package/lib/typescript/core/src/version.d.ts +1 -1
- package/lib/typescript/react-native-openfeature/src/coreProvider.d.ts +34 -0
- package/lib/typescript/react-native-openfeature/src/coreProvider.d.ts.map +1 -0
- package/lib/typescript/react-native-openfeature/src/index.d.ts +3 -1
- package/lib/typescript/react-native-openfeature/src/index.d.ts.map +1 -1
- package/lib/typescript/react-native-openfeature/src/mappers.d.ts +20 -0
- package/lib/typescript/react-native-openfeature/src/mappers.d.ts.map +1 -0
- package/lib/typescript/react-native-openfeature/src/offlineProvider.d.ts +59 -0
- package/lib/typescript/react-native-openfeature/src/offlineProvider.d.ts.map +1 -0
- package/lib/typescript/react-native-openfeature/src/provider.d.ts +8 -21
- package/lib/typescript/react-native-openfeature/src/provider.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/__tests__/offlineProvider.integration.test.ts +271 -0
- package/src/__tests__/offlineProvider.test.ts +252 -0
- package/src/__tests__/provider.test.ts +74 -0
- package/src/coreProvider.ts +142 -0
- package/src/index.ts +8 -1
- package/src/mappers.ts +47 -0
- package/src/offlineProvider.ts +185 -0
- package/src/provider.ts +10 -139
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.d.ts.map +0 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.d.ts +0 -7
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.d.ts.map +0 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.d.ts.map +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* Convert an OpenFeature evaluation context into the Datadog Flags shape.
|
|
9
|
+
*/
|
|
10
|
+
export const toDdContext = context => {
|
|
11
|
+
const {
|
|
12
|
+
targetingKey,
|
|
13
|
+
...attributes
|
|
14
|
+
} = context;
|
|
15
|
+
|
|
16
|
+
// Important ⚠️
|
|
17
|
+
// The Flags SDK doesn't support nested non-primitive values in the evaluation context as per OF.3 FFE SDK requirement.
|
|
18
|
+
// However, we let the SDK handle this inside of FlagsClient since it does this processing anyways.
|
|
19
|
+
const ddContextAttributes = attributes;
|
|
20
|
+
return {
|
|
21
|
+
// Allow flag evaluations without a provided targeting key.
|
|
22
|
+
targetingKey: targetingKey ?? '',
|
|
23
|
+
attributes: ddContextAttributes
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Whether an OpenFeature evaluation context carries no information — no targeting key and no
|
|
29
|
+
* attributes with a defined value (so `{}` and `{ targetingKey: undefined }` are both empty).
|
|
30
|
+
* Used by the offline provider to avoid overwriting a configuration's embedded context with an
|
|
31
|
+
* empty context stamped by the OpenFeature lifecycle.
|
|
32
|
+
*
|
|
33
|
+
* Note: an explicit `targetingKey: ''` is **not** empty. An empty string is a real (anonymous)
|
|
34
|
+
* targeting key — a distinct subject — not the absence of a context. Only a genuinely absent
|
|
35
|
+
* context (`{}` / `clearContext()`) re-adopts the configuration's embedded context; `{ targetingKey:
|
|
36
|
+
* '' }` is reconciled as a real context, so it must match the precomputed snapshot or the provider
|
|
37
|
+
* enters `ERROR` (serving coded defaults) rather than silently serving another subject's flags.
|
|
38
|
+
*/
|
|
39
|
+
export const isEmptyContext = context => {
|
|
40
|
+
return Object.values(context).every(value => value === undefined);
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=mappers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["toDdContext","context","targetingKey","attributes","ddContextAttributes","isEmptyContext","Object","values","every","value","undefined"],"sourceRoot":"../../src","sources":["mappers.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA,OAAO,MAAMA,WAAW,GACpBC,OAA4B,IACN;EACtB,MAAM;IAAEC,YAAY;IAAE,GAAGC;EAAW,CAAC,GAAGF,OAAO;;EAE/C;EACA;EACA;EACA,MAAMG,mBAAmB,GAAGD,UAA4C;EAExE,OAAO;IACH;IACAD,YAAY,EAAEA,YAAY,IAAI,EAAE;IAChCC,UAAU,EAAEC;EAChB,CAAC;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAIJ,OAA4B,IAAc;EACrE,OAAOK,MAAM,CAACC,MAAM,CAACN,OAAO,CAAC,CAACO,KAAK,CAACC,KAAK,IAAIA,KAAK,KAAKC,SAAS,CAAC;AACrE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,143 @@
|
|
|
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 { ErrorCode, GeneralError, InvalidContextError, ProviderEvents, ProviderNotReadyError } from '@openfeature/web-sdk';
|
|
8
|
+
import { DatadogCoreOpenFeatureProvider } from './coreProvider';
|
|
9
|
+
import { isEmptyContext, toDdContext } from './mappers';
|
|
10
|
+
|
|
11
|
+
// The outcome of a `FlagsClient` reconcile. Derived from the client so the provider maps it to
|
|
12
|
+
// OpenFeature transitions; not part of the package's public API.
|
|
13
|
+
|
|
14
|
+
// A `PROVIDER_ERROR` event payload carrying the spec's top-level error code (§5.1.5). The web-sdk
|
|
15
|
+
// `ErrorEvent` type omits `errorCode`, but the emitter accepts the extra field and
|
|
16
|
+
// `ProviderWrapper` reads it.
|
|
17
|
+
|
|
18
|
+
const OF_ERROR_CODE = {
|
|
19
|
+
INVALID_CONTEXT: ErrorCode.INVALID_CONTEXT,
|
|
20
|
+
PROVIDER_NOT_READY: ErrorCode.PROVIDER_NOT_READY,
|
|
21
|
+
GENERAL: ErrorCode.GENERAL
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* An offline Datadog OpenFeature provider.
|
|
26
|
+
*
|
|
27
|
+
* It behaves like the online `DatadogOpenFeatureProvider` — same flag evaluation and
|
|
28
|
+
* exposure/RUM tracking — **except it never fetches configuration from the network**.
|
|
29
|
+
* Instead of fetching on `initialize`/`onContextChange`, it evaluates against a configuration
|
|
30
|
+
* supplied via {@link DatadogOfflineOpenFeatureProvider.setConfiguration}. A precomputed
|
|
31
|
+
* configuration carries the evaluation context it was computed for, so you should **not** call
|
|
32
|
+
* `OpenFeature.setContext` for the offline precomputed flow — see the class remarks.
|
|
33
|
+
*
|
|
34
|
+
* A runtime context that does not match the configuration's embedded context (compared after
|
|
35
|
+
* normalization) cannot be served (offline never fetches), so it puts the provider into the
|
|
36
|
+
* OpenFeature `ERROR` state and evaluations fall back to your coded defaults (`INVALID_CONTEXT`).
|
|
37
|
+
* An empty *effective* context re-adopts the embedded context and recovers — but note that
|
|
38
|
+
* `clearContext(domain)` falls back to the global context, which may itself be non-empty and
|
|
39
|
+
* mismatching (and would keep the provider in `ERROR`). Load the configuration before setting the
|
|
40
|
+
* provider so it is ready with real flag values from the start:
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* import { OpenFeature } from '@openfeature/web-sdk';
|
|
45
|
+
* import {
|
|
46
|
+
* DatadogOfflineOpenFeatureProvider,
|
|
47
|
+
* configurationFromString
|
|
48
|
+
* } from '@datadog/mobile-react-native-openfeature';
|
|
49
|
+
*
|
|
50
|
+
* const provider = new DatadogOfflineOpenFeatureProvider();
|
|
51
|
+
* provider.setConfiguration(configurationFromString(wire)); // no network
|
|
52
|
+
* await OpenFeature.setProviderAndWait(provider);
|
|
53
|
+
*
|
|
54
|
+
* const client = OpenFeature.getClient();
|
|
55
|
+
* const enabled = client.getBooleanValue('new-feature', false);
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export class DatadogOfflineOpenFeatureProvider extends DatadogCoreOpenFeatureProvider {
|
|
59
|
+
metadata = {
|
|
60
|
+
name: 'datadog-react-native-offline'
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Whether the provider is currently in an error state, so a successful `setConfiguration` must
|
|
64
|
+
// emit `PROVIDER_READY` to recover (a bare `CONFIGURATION_CHANGED` would not clear `ERROR`).
|
|
65
|
+
// It may be set before the provider is registered, so it does not necessarily mirror
|
|
66
|
+
// OpenFeature's status yet.
|
|
67
|
+
configurationInError = false;
|
|
68
|
+
async initialize(context = {}) {
|
|
69
|
+
const result = this.applyContext(context);
|
|
70
|
+
|
|
71
|
+
// OpenFeature derives the initial status from whether `initialize` settles: resolve =>
|
|
72
|
+
// READY, reject => ERROR. Reject when the provider cannot serve — an absent, invalid, or
|
|
73
|
+
// context-mismatched configuration — so it does not start in a misleading READY that only
|
|
74
|
+
// returns default values. Loading a valid configuration later recovers it.
|
|
75
|
+
if (result.status === 'error') {
|
|
76
|
+
throw this.toError(result.errorCode);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
onContextChange(_oldContext, newContext) {
|
|
80
|
+
// Synchronous on purpose. Reconciliation is synchronous, and a synchronous throw makes the
|
|
81
|
+
// Web SDK transition straight to ERROR (skipping the transient RECONCILING state) with no
|
|
82
|
+
// async window in which an interleaved `setConfiguration` could clobber the final status.
|
|
83
|
+
// Returning normally lets the Web SDK set READY — the automatic recovery path.
|
|
84
|
+
const result = this.applyContext(newContext);
|
|
85
|
+
if (result.status === 'error') {
|
|
86
|
+
throw this.toError(result.errorCode);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Load a configuration into the provider for offline evaluation.
|
|
92
|
+
*
|
|
93
|
+
* @param configuration A configuration parsed from a `ConfigurationWire` string via
|
|
94
|
+
* `configurationFromString`.
|
|
95
|
+
*/
|
|
96
|
+
setConfiguration(configuration) {
|
|
97
|
+
const result = this.flagsClient.setConfiguration(configuration);
|
|
98
|
+
if (result.status === 'ready') {
|
|
99
|
+
if (this.configurationInError) {
|
|
100
|
+
// Recover from a prior error: PROVIDER_READY clears the ERROR status (a bare
|
|
101
|
+
// CONFIGURATION_CHANGED would not).
|
|
102
|
+
this.configurationInError = false;
|
|
103
|
+
this.events.emit(ProviderEvents.Ready);
|
|
104
|
+
}
|
|
105
|
+
// The (re)loaded configuration changed the served flags.
|
|
106
|
+
this.events.emit(ProviderEvents.ConfigurationChanged);
|
|
107
|
+
} else {
|
|
108
|
+
this.configurationInError = true;
|
|
109
|
+
const details = {
|
|
110
|
+
message: 'The Datadog offline provider cannot serve the loaded configuration for the current context.',
|
|
111
|
+
errorCode: OF_ERROR_CODE[result.errorCode]
|
|
112
|
+
};
|
|
113
|
+
this.events.emit(ProviderEvents.Error, details);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
applyContext(context) {
|
|
117
|
+
// An empty context means "no external override": clear it so a loaded precomputed
|
|
118
|
+
// configuration is served against its embedded context. Order-independent — the synthetic
|
|
119
|
+
// `initialize({})`, `setContext({})`, and `clearContext()` all re-adopt the embedded
|
|
120
|
+
// context rather than being treated as a mismatch.
|
|
121
|
+
const result = isEmptyContext(context) ? this.flagsClient.resetEvaluationContextWithoutFetching() : this.flagsClient.setEvaluationContextWithoutFetching(toDdContext(context));
|
|
122
|
+
this.configurationInError = result.status === 'error';
|
|
123
|
+
return result;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Map a reconcile error code to the precise OpenFeature error type, so direct callers of
|
|
128
|
+
* `initialize`/`onContextChange` (and `setProviderAndWait`) receive the correct typed error.
|
|
129
|
+
* (Web SDK 1.8.0 drops the code from the lifecycle-generated error *event*, but the thrown
|
|
130
|
+
* error type is still accurate for callers.)
|
|
131
|
+
*/
|
|
132
|
+
toError(errorCode) {
|
|
133
|
+
switch (errorCode) {
|
|
134
|
+
case 'INVALID_CONTEXT':
|
|
135
|
+
return new InvalidContextError('The evaluation context does not match the offline precomputed configuration. Serving default values.');
|
|
136
|
+
case 'PROVIDER_NOT_READY':
|
|
137
|
+
return new ProviderNotReadyError('The Datadog offline provider has no configuration loaded. Provide one via setConfiguration.');
|
|
138
|
+
default:
|
|
139
|
+
return new GeneralError('The Datadog offline provider cannot serve the loaded configuration.');
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=offlineProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ErrorCode","GeneralError","InvalidContextError","ProviderEvents","ProviderNotReadyError","DatadogCoreOpenFeatureProvider","isEmptyContext","toDdContext","OF_ERROR_CODE","INVALID_CONTEXT","PROVIDER_NOT_READY","GENERAL","DatadogOfflineOpenFeatureProvider","metadata","name","configurationInError","initialize","context","result","applyContext","status","toError","errorCode","onContextChange","_oldContext","newContext","setConfiguration","configuration","flagsClient","events","emit","Ready","ConfigurationChanged","details","message","Error","resetEvaluationContextWithoutFetching","setEvaluationContextWithoutFetching"],"sourceRoot":"../../src","sources":["offlineProvider.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAMA,SACIA,SAAS,EACTC,YAAY,EACZC,mBAAmB,EACnBC,cAAc,EACdC,qBAAqB,QAClB,sBAAsB;AAO7B,SAASC,8BAA8B,QAAQ,gBAAgB;AAC/D,SAASC,cAAc,EAAEC,WAAW,QAAQ,WAAW;;AAEvD;AACA;;AAOA;AACA;AACA;;AAGA,MAAMC,aAAwD,GAAG;EAC7DC,eAAe,EAAET,SAAS,CAACS,eAAe;EAC1CC,kBAAkB,EAAEV,SAAS,CAACU,kBAAkB;EAChDC,OAAO,EAAEX,SAAS,CAACW;AACvB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iCAAiC,SAASP,8BAA8B,CAAC;EACzEQ,QAAQ,GAAqB;IAClCC,IAAI,EAAE;EACV,CAAC;;EAED;EACA;EACA;EACA;EACQC,oBAAoB,GAAG,KAAK;EAEpC,MAAMC,UAAUA,CAACC,OAA4B,GAAG,CAAC,CAAC,EAAiB;IAC/D,MAAMC,MAAM,GAAG,IAAI,CAACC,YAAY,CAACF,OAAO,CAAC;;IAEzC;IACA;IACA;IACA;IACA,IAAIC,MAAM,CAACE,MAAM,KAAK,OAAO,EAAE;MAC3B,MAAM,IAAI,CAACC,OAAO,CAACH,MAAM,CAACI,SAAS,CAAC;I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B,GAAGG,MAAM,CAACE,MAAM,KAAK,OAAO;IAErD,OAAOF,MAAM;EACjB;;EAEA;AACJ;AACA;AACA;AACA;AACA;EACYG,OAAOA,CAACC,SAAiC,EAAoB;IACjE,QAAQA,SAAS;MACb,KAAK,iBAAiB;QAClB,OAAO,IAAIpB,mBAAmB,CAC1B,sGACJ,CAAC;MACL,KAAK,oBAAoB;QACrB,OAAO,IAAIE,qBAAqB,CAC5B,6FACJ,CAAC;MACL;QACI,OAAO,IAAIH,YAAY,CACnB,qEACJ,CAAC;IACT;EACJ;AACJ","ignoreList":[]}
|
package/lib/module/provider.js
CHANGED
|
@@ -4,22 +4,17 @@
|
|
|
4
4
|
* Copyright 2016-Present Datadog, Inc.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { DatadogCoreOpenFeatureProvider } from './coreProvider';
|
|
8
|
+
import { toDdContext } from './mappers';
|
|
9
|
+
/**
|
|
10
|
+
* The online Datadog OpenFeature provider. Fetches precomputed flag assignments from Datadog
|
|
11
|
+
* whenever the evaluation context is set or changed.
|
|
12
|
+
*/
|
|
13
|
+
export class DatadogOpenFeatureProvider extends DatadogCoreOpenFeatureProvider {
|
|
11
14
|
metadata = {
|
|
12
15
|
name: 'datadog-react-native'
|
|
13
16
|
};
|
|
14
|
-
events = new OpenFeatureEventEmitter();
|
|
15
17
|
contextChangePromise = Promise.resolve();
|
|
16
|
-
constructor(options = {}) {
|
|
17
|
-
if (!options.clientName) {
|
|
18
|
-
options.clientName = 'default';
|
|
19
|
-
}
|
|
20
|
-
this.options = options;
|
|
21
|
-
this.flagsClient = DdFlags.getClient(this.options.clientName);
|
|
22
|
-
}
|
|
23
18
|
async initialize(context = {}) {
|
|
24
19
|
const ddContext = toDdContext(context);
|
|
25
20
|
this.contextChangePromise = this.flagsClient.setEvaluationContext(ddContext);
|
|
@@ -36,64 +31,5 @@ export class DatadogOpenFeatureProvider {
|
|
|
36
31
|
// Wait for the current context change to complete.
|
|
37
32
|
await this.contextChangePromise;
|
|
38
33
|
}
|
|
39
|
-
resolveBooleanEvaluation(flagKey, defaultValue, _context, _logger) {
|
|
40
|
-
const details = this.flagsClient.getBooleanDetails(flagKey, defaultValue);
|
|
41
|
-
return toFlagResolution(details);
|
|
42
|
-
}
|
|
43
|
-
resolveStringEvaluation(flagKey, defaultValue, _context, _logger) {
|
|
44
|
-
const details = this.flagsClient.getStringDetails(flagKey, defaultValue);
|
|
45
|
-
return toFlagResolution(details);
|
|
46
|
-
}
|
|
47
|
-
resolveNumberEvaluation(flagKey, defaultValue, _context, _logger) {
|
|
48
|
-
const details = this.flagsClient.getNumberDetails(flagKey, defaultValue);
|
|
49
|
-
return toFlagResolution(details);
|
|
50
|
-
}
|
|
51
|
-
resolveObjectEvaluation(flagKey, defaultValue, _context, _logger) {
|
|
52
|
-
// The OpenFeature spec states that the return value can be any valid JSON value.
|
|
53
|
-
// However, the Datadog Flags feature only supports JSON objects for the JSON feature flag type.
|
|
54
|
-
// Thus, the user should always expect the returned value to be an object instead of any arbitrary JSON value.
|
|
55
|
-
// Also, the user is responsible for providing a proper `defaultValue` that's an object.
|
|
56
|
-
|
|
57
|
-
const details = this.flagsClient.getObjectDetails(flagKey, defaultValue);
|
|
58
|
-
return toFlagResolution(details);
|
|
59
|
-
}
|
|
60
34
|
}
|
|
61
|
-
const toDdContext = context => {
|
|
62
|
-
const {
|
|
63
|
-
targetingKey,
|
|
64
|
-
...attributes
|
|
65
|
-
} = context;
|
|
66
|
-
|
|
67
|
-
// Important ⚠️
|
|
68
|
-
// The Flags SDK doesn't support nested non-primitive values in the evaluation context as per OF.3 FFE SDK requirement.
|
|
69
|
-
// However, we let the SDK handle this inside of FlagsClient since it does this processing anyways.
|
|
70
|
-
const ddContextAttributes = attributes;
|
|
71
|
-
return {
|
|
72
|
-
// Allow flag evaluations without a provided targeting key.
|
|
73
|
-
targetingKey: targetingKey ?? '',
|
|
74
|
-
attributes: ddContextAttributes
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
const toFlagResolution = details => {
|
|
78
|
-
const {
|
|
79
|
-
value,
|
|
80
|
-
reason,
|
|
81
|
-
variant,
|
|
82
|
-
allocationKey,
|
|
83
|
-
errorCode,
|
|
84
|
-
errorMessage
|
|
85
|
-
} = details;
|
|
86
|
-
const parsedErrorCode = errorCode && (ErrorCode[errorCode] || ErrorCode.GENERAL);
|
|
87
|
-
const result = {
|
|
88
|
-
value,
|
|
89
|
-
reason,
|
|
90
|
-
variant,
|
|
91
|
-
flagMetadata: allocationKey ? {
|
|
92
|
-
allocationKey
|
|
93
|
-
} : undefined,
|
|
94
|
-
errorCode: parsedErrorCode,
|
|
95
|
-
errorMessage
|
|
96
|
-
};
|
|
97
|
-
return result;
|
|
98
|
-
};
|
|
99
35
|
//# sourceMappingURL=provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["DatadogCoreOpenFeatureProvider","toDdContext","DatadogOpenFeatureProvider","metadata","name","contextChangePromise","Promise","resolve","initialize","context","ddContext","flagsClient","setEvaluationContext","onContextChange","_oldContext","newContext","newDdContext","then"],"sourceRoot":"../../src","sources":["provider.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAOA,SAASA,8BAA8B,QAAQ,gBAAgB;AAC/D,SAASC,WAAW,QAAQ,WAAW;AAIvC;AACA;AACA;AACA;AACA,OAAO,MAAMC,0BAA0B,SAASF,8BAA8B,CAAC;EAClEG,QAAQ,GAAqB;IAClCC,IAAI,EAAE;EACV,CAAC;EAEOC,oBAAoB,GAAGC,OAAO,CAACC,OAAO,CAAC,CAAC;EAEhD,MAAMC,UAAUA,CAACC,OAA4B,GAAG,CAAC,CAAC,EAAiB;IAC/D,MAAMC,SAAS,GAAGT,WAAW,CAACQ,OAAO,CAAC;IACtC,IAAI,CAACJ,oBAAoB,GAAG,IAAI,CAACM,WAAW,CAACC,oB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AE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AA8BvE,qBAAa,sBAAuB,SAAQ,4BAA4B;gBACxD,MAAM,CAAC,EAAE;QACjB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;QACpC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;QAC1C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;KACzC;CAqEJ;AAmBD,eAAO,MAAM,oBAAoB,+BACD,OAAO,KACpC,
|
|
1
|
+
{"version":3,"file":"FileBasedConfiguration.d.ts","sourceRoot":"","sources":["../../../../../../core/src/config/FileBasedConfiguration.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAEnF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AA8BvE,qBAAa,sBAAuB,SAAQ,4BAA4B;gBACxD,MAAM,CAAC,EAAE;QACjB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;QACpC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;QAC1C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;KACzC;CAqEJ;AAmBD,eAAO,MAAM,oBAAoB,+BACD,OAAO,KACpC,iBAyFF,CAAC;AAuBF,eAAO,MAAM,oBAAoB,mBACb,MAAM,KACvB,cAoBF,CAAC"}
|
|
@@ -19,6 +19,7 @@ export interface JsonConfiguration extends CoreConfigurationOptions {
|
|
|
19
19
|
useAccessibilityLabel?: boolean;
|
|
20
20
|
trackInteractions?: boolean;
|
|
21
21
|
trackResources?: boolean;
|
|
22
|
+
trackFetchResources?: boolean;
|
|
22
23
|
trackErrors?: boolean;
|
|
23
24
|
longTaskThresholdMs?: number;
|
|
24
25
|
actionNameAttribute?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileBasedConfiguration.type.d.ts","sourceRoot":"","sources":["../../../../../../core/src/config/FileBasedConfiguration.type.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EACR,oBAAoB,EACpB,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,qBAAqB,EACxB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,iBAAkB,SAAQ,wBAAwB;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE;QACf,aAAa,EAAE,MAAM,CAAC;QACtB,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;QACnC,wBAAwB,CAAC,EAAE,MAAM,CAAC;QAClC,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,wBAAwB,CAAC,EAAE,OAAO,CAAC;QACnC,yBAAyB,CAAC,EAAE,MAAM,CAAC;QACnC,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,yBAAyB,CAAC,EAAE,OAAO,CAAC;QACpC,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,yBAAyB,CAAC,EAAE,OAAO,CAAC;QACpC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;QAC9C,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,kBAAkB,CAAC,EAAE;QACjB,cAAc,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,iBAAiB,CAAC,EAAE;QAChB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;CACL"}
|
|
1
|
+
{"version":3,"file":"FileBasedConfiguration.type.d.ts","sourceRoot":"","sources":["../../../../../../core/src/config/FileBasedConfiguration.type.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mC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CAAC,EAAE,OAAO,CAAC;QACpC,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,yBAAyB,CAAC,EAAE,OAAO,CAAC;QACpC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;QAC9C,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,kBAAkB,CAAC,EAAE;QACjB,cAAc,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,iBAAiB,CAAC,EAAE;QAChB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;CACL"}
|
|
@@ -12,6 +12,7 @@ export type AutoInstrumentationConfiguration = {
|
|
|
12
12
|
readonly rumConfiguration: {
|
|
13
13
|
readonly trackInteractions: boolean;
|
|
14
14
|
readonly trackResources: boolean;
|
|
15
|
+
readonly trackFetchResources?: boolean;
|
|
15
16
|
readonly trackErrors: boolean;
|
|
16
17
|
readonly useAccessibilityLabel?: boolean;
|
|
17
18
|
readonly actionNameAttribute?: string;
|
|
@@ -36,6 +37,7 @@ export type AutoInstrumentationParameters = {
|
|
|
36
37
|
readonly useAccessibilityLabel: boolean;
|
|
37
38
|
readonly trackInteractions: boolean;
|
|
38
39
|
readonly trackResources: boolean;
|
|
40
|
+
readonly trackFetchResources: boolean;
|
|
39
41
|
readonly trackErrors: boolean;
|
|
40
42
|
readonly actionNameAttribute?: string;
|
|
41
43
|
readonly resourceTraceSampleRate?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoInstrumentationConfiguration.d.ts","sourceRoot":"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EAAE;QACxB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;KACnD,CAAC;CACL,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IACxC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QACxB,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;QACxC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;QACpC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;QACjC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;QAC9B,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;QACtC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;QAC1C,QAAQ,CAAC,wBAAwB,CAAC,EAAE,OAAO,CAAC;QAC5C,QAAQ,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;QAC5C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;QACtC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAC;QACrD,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;QACnD,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,GAAG,IAAI,CAAC;QACzD,QAAQ,CAAC,eAAe,EAAE,cAAc,EAAE,CAAC;KAC9C,CAAC;IACF,QAAQ,CAAC,iBAAiB,CAAC,EAAE;QACzB,QAAQ,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;KAClD,CAAC;IACF,QAAQ,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACpD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kDAAkD,aACjD,gCAAgC,KAC3C,
|
|
1
|
+
{"version":3,"file":"AutoInstrumentationConfiguration.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/config/async/AutoInstrumentationConfiguration.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAA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25
|
trackErrors: boolean;
|
|
26
|
+
trackFetchResources: boolean;
|
|
26
27
|
trackFrustrations: boolean;
|
|
27
28
|
trackInteractions: boolean;
|
|
28
29
|
trackMemoryWarnings: boolean;
|
|
@@ -54,6 +55,7 @@ export declare class RumConfiguration implements RumConfigurationType {
|
|
|
54
55
|
sessionSampleRate: number;
|
|
55
56
|
telemetrySampleRate: number;
|
|
56
57
|
trackBackgroundEvents: boolean;
|
|
58
|
+
trackFetchResources: boolean;
|
|
57
59
|
trackFrustrations: boolean;
|
|
58
60
|
trackMemoryWarnings: boolean;
|
|
59
61
|
trackNonFatalAnrs?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RumConfiguration.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/config/features/RumConfiguration.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,KAAK,EACR,uBAAuB,EACvB,oBAAoB,EACvB,MAAM,yBAAyB,CAAC;AAEjC,QAAA,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"RumConfiguration.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/config/features/RumConfiguration.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;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CACF;IAGhC,qBAAqB,EAAE,OAAO,CAAkC;IAGhE,qBAAqB,EAAE,qBAAqB,CAChB;gBAGtB,aAAa,EAAE,MAAM,EACrB,iBAAiB,GAAE,OAAoC,EACvD,cAAc,GAAE,OAAiC,EACjD,WAAW,GAAE,OAA8B,EACpD,OAAO,GAAE,uBAA4B;CAI5C;AAED,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -51,6 +51,13 @@ export interface RumConfigurationOptions {
|
|
|
51
51
|
* Custom mapper to transform RUM error events.
|
|
52
52
|
*/
|
|
53
53
|
errorEventMapper?: ErrorEventMapper | null;
|
|
54
|
+
/**
|
|
55
|
+
* Enables tracking of requests made with native Fetch implementations,
|
|
56
|
+
* such as the global Fetch installed by Expo.
|
|
57
|
+
*
|
|
58
|
+
* This option only takes effect when resource tracking is enabled.
|
|
59
|
+
*/
|
|
60
|
+
trackFetchResources?: boolean;
|
|
54
61
|
/**
|
|
55
62
|
* List of backend hosts used to enable tracing.
|
|
56
63
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RumConfiguration.type.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/config/features/RumConfiguration.type.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,cAAc,CAAC,EAAE,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OAAO,CAAC;IAE9B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CACjD;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GACvD,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"RumConfiguration.type.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/config/features/RumConfiguration.type.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAE7C;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAE3C;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IAEnC;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAErC;;OAEG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAEjD;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CACjD;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GACvD,uBAAuB,CAAC"}
|
|
@@ -1,9 +1,39 @@
|
|
|
1
|
+
import type { ParsedFlagsConfiguration } from './configuration';
|
|
1
2
|
import type { JsonValue, EvaluationContext, FlagDetails } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Error codes an offline configuration result can carry:
|
|
5
|
+
* - `INVALID_CONTEXT`: the active context does not match the precomputed snapshot.
|
|
6
|
+
* - `PROVIDER_NOT_READY`: an offline operation ran with no configuration loaded.
|
|
7
|
+
* - `GENERAL`: the loaded configuration is unusable (malformed/unsupported/undecodable).
|
|
8
|
+
*/
|
|
9
|
+
export type ConfigurationErrorCode = 'INVALID_CONTEXT' | 'PROVIDER_NOT_READY' | 'GENERAL';
|
|
10
|
+
/**
|
|
11
|
+
* Outcome of loading a configuration or reconciling it against the active evaluation context,
|
|
12
|
+
* returned by the offline APIs ({@link FlagsClient.setConfiguration},
|
|
13
|
+
* {@link FlagsClient.setEvaluationContextWithoutFetching},
|
|
14
|
+
* {@link FlagsClient.resetEvaluationContextWithoutFetching}).
|
|
15
|
+
*
|
|
16
|
+
* `'ready'` means the configuration can be served against the active context; `'error'` carries
|
|
17
|
+
* the precise reason so the OpenFeature provider surfaces the correct code and evaluation returns
|
|
18
|
+
* that code with the coded default.
|
|
19
|
+
*
|
|
20
|
+
* @internal Consumers observe OpenFeature provider events/evaluation details, not this result.
|
|
21
|
+
*/
|
|
22
|
+
export type ConfigurationResult = {
|
|
23
|
+
status: 'ready';
|
|
24
|
+
} | {
|
|
25
|
+
status: 'error';
|
|
26
|
+
errorCode: ConfigurationErrorCode;
|
|
27
|
+
};
|
|
2
28
|
export declare class FlagsClient {
|
|
3
29
|
private nativeFlags;
|
|
4
30
|
private clientName;
|
|
31
|
+
private externalContext;
|
|
5
32
|
private evaluationContext;
|
|
6
33
|
private flagsCache;
|
|
34
|
+
private loadedConfiguration;
|
|
35
|
+
private configurationStatus;
|
|
36
|
+
private configurationError;
|
|
7
37
|
constructor(clientName?: string);
|
|
8
38
|
/**
|
|
9
39
|
* Sets the evaluation context for the client.
|
|
@@ -29,6 +59,72 @@ export declare class FlagsClient {
|
|
|
29
59
|
* ```
|
|
30
60
|
*/
|
|
31
61
|
setEvaluationContext: (context: EvaluationContext) => Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Set the evaluation context **without** fetching a configuration from the network, then
|
|
64
|
+
* reconcile the loaded configuration against it.
|
|
65
|
+
*
|
|
66
|
+
* The offline counterpart to {@link setEvaluationContext}: records the active context and
|
|
67
|
+
* reconciles with no native request. A precomputed configuration is single-subject, so a
|
|
68
|
+
* context that does not match the one it was computed for reconciles to an error
|
|
69
|
+
* (`INVALID_CONTEXT`) and evaluation serves defaults. With no configuration loaded the
|
|
70
|
+
* result is `PROVIDER_NOT_READY`. Intended for offline providers that own their
|
|
71
|
+
* configuration via `setConfiguration` and must not fetch on a context change.
|
|
72
|
+
*
|
|
73
|
+
* @param context The evaluation context to associate with the current client.
|
|
74
|
+
*/
|
|
75
|
+
setEvaluationContextWithoutFetching: (context: EvaluationContext) => ConfigurationResult;
|
|
76
|
+
/**
|
|
77
|
+
* Clear any externally-set evaluation context and reconcile.
|
|
78
|
+
*
|
|
79
|
+
* This is the offline counterpart to clearing/omitting an OpenFeature context: it drops the
|
|
80
|
+
* external override so a loaded precomputed configuration is served against **its embedded
|
|
81
|
+
* context** again. Clearing the override (rather than skipping) matters so that a
|
|
82
|
+
* configuration loaded *after* a clear is not judged against a stale override. With no
|
|
83
|
+
* configuration loaded the result is `PROVIDER_NOT_READY`.
|
|
84
|
+
*/
|
|
85
|
+
resetEvaluationContextWithoutFetching: () => ConfigurationResult;
|
|
86
|
+
/**
|
|
87
|
+
* Load a configuration (parsed from a `ConfigurationWire` string via
|
|
88
|
+
* `configurationFromString`) into the client for offline evaluation, then reconcile it
|
|
89
|
+
* against the active context.
|
|
90
|
+
*
|
|
91
|
+
* For a precomputed configuration this decodes the snapshot once and adopts its embedded
|
|
92
|
+
* evaluation context when none is set — **no network request is made**. An unusable
|
|
93
|
+
* configuration reconciles to an error (`GENERAL`); a context mismatch to `INVALID_CONTEXT`.
|
|
94
|
+
*
|
|
95
|
+
* @param configuration The configuration to load.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* const configuration = configurationFromString(wire);
|
|
100
|
+
* flagsClient.setConfiguration(configuration);
|
|
101
|
+
*
|
|
102
|
+
* const value = flagsClient.getBooleanValue('new-feature', false);
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
setConfiguration: (configuration: ParsedFlagsConfiguration) => ConfigurationResult;
|
|
106
|
+
/**
|
|
107
|
+
* Decode a supplied configuration into a {@link LoadedConfigurationState} **once**, capturing
|
|
108
|
+
* whether the load itself is valid (independent of the active context). Later context changes
|
|
109
|
+
* reconcile against this stored state without re-decoding, and can never turn an invalid load
|
|
110
|
+
* into a servable one.
|
|
111
|
+
*
|
|
112
|
+
* FORWARD-COMPAT SEAM: when a rules-based configuration is supported, it must be handled here
|
|
113
|
+
* BEFORE the precomputed guard — rules are context-agnostic and must NOT be classified invalid.
|
|
114
|
+
*/
|
|
115
|
+
private loadConfiguration;
|
|
116
|
+
/**
|
|
117
|
+
* Reconcile the stored {@link LoadedConfigurationState} against the active evaluation context
|
|
118
|
+
* and (re)compute the servable flag cache and configuration status/result.
|
|
119
|
+
*
|
|
120
|
+
* The stored load validity is consulted **before** context compatibility, so a context change
|
|
121
|
+
* can never promote an invalid (or absent) load to `ready`.
|
|
122
|
+
*/
|
|
123
|
+
private reconcile;
|
|
124
|
+
/** The evaluation context a precomputed configuration was computed for (empty if agnostic). */
|
|
125
|
+
private embeddedContext;
|
|
126
|
+
/** Record an error status + message, clear the servable cache, and return the result. */
|
|
127
|
+
private enterError;
|
|
32
128
|
private track;
|
|
33
129
|
private getDetails;
|
|
34
130
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlagsClient.d.ts","sourceRoot":"","sources":["../../../../../../core/src/flags/FlagsClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlagsClient.d.ts","sourceRoot":"","sources":["../../../../../../core/src/flags/FlagsClient.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACR,wBAAwB,EAE3B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAA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O,KACtB,YAAY,OAAO,CAAC,CAErB;IAEF;;;;;OAKG;IACH,gBAAgB,QACP,MAAM,gBACG,MAAM,KACrB,YAAY,MAAM,CAAC,CAEpB;IAEF;;;;;OAKG;IACH,gBAAgB,QACP,MAAM,gBACG,MAAM,KACrB,YAAY,MAAM,CAAC,CAEpB;IAEF;;;;;;;;OAQG;IACH,gBAAgB,6BACP,MAAM,qCAIb;IAEF;;;;;;;;;;OAUG;IACH,eAAe,QAAS,MAAM,gBAAgB,OAAO,KAAG,OAAO,CAE7D;IAEF;;;;;;;;;;OAUG;IACH,cAAc,QAAS,MAAM,gBAAgB,MAAM,KAAG,MAAM,CAE1D;IAEF;;;;;;;;;;OAUG;IACH,cAAc,QAAS,MAAM,gBAAgB,MAAM,KAAG,MAAM,CAE1D;IAEF;;;;;;;;;;OAUG;IACH,cAAc,6BAA8B,MAAM,wBAEhD;CACL"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { EvaluationContext } from '../types';
|
|
2
|
+
import type { WireEvaluationContext } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Normalize a wire (OpenFeature-flat) evaluation context into the SDK's internal
|
|
5
|
+
* `{ targetingKey, attributes }` shape, applying the **same** processing the active
|
|
6
|
+
* context went through (`processEvaluationContext`) so the two are comparable — the
|
|
7
|
+
* flat wire shape and the internal shape are otherwise never equal.
|
|
8
|
+
*/
|
|
9
|
+
export declare const normalizeWireContext: (wireContext: WireEvaluationContext) => EvaluationContext;
|
|
10
|
+
/**
|
|
11
|
+
* Whether a precomputed configuration's embedded context matches the active evaluation
|
|
12
|
+
* context.
|
|
13
|
+
*
|
|
14
|
+
* - A configuration with **no** embedded context is context-agnostic and matches any
|
|
15
|
+
* active context.
|
|
16
|
+
* - Otherwise the embedded context must match the active context exactly (after
|
|
17
|
+
* normalizing both through the same processing).
|
|
18
|
+
*/
|
|
19
|
+
export declare const contextMatchesConfiguration: (wireContext: WireEvaluationContext | undefined, activeContext: EvaluationContext) => boolean;
|
|
20
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/flags/configuration/context.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAkB,MAAM,UAAU,CAAC;AAElE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,gBAChB,qBAAqB,KACnC,iBAUF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,gBACvB,qBAAqB,GAAG,SAAS,iBAC/B,iBAAiB,KACjC,OAMF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { configurationFromString, configurationToString } from './wire';
|
|
2
|
+
export { decodePrecomputedFlags, UnsupportedConfigurationError } from './precomputed';
|
|
3
|
+
export { normalizeWireContext } from './context';
|
|
4
|
+
export type { ParsedFlagsConfiguration, ParsedPrecomputedConfiguration, PrecomputedConfigurationResponse, PrecomputedFlag, WireEvaluationContext } from './types';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/flags/configuration/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AACxE,OAAO,EACH,sBAAsB,EACtB,6BAA6B,EAChC,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,YAAY,EACR,wBAAwB,EACxB,8BAA8B,EAC9B,gCAAgC,EAChC,eAAe,EACf,qBAAqB,EACxB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { FlagCacheEntry } from '../internal';
|
|
2
|
+
import type { PrecomputedConfigurationResponse } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Thrown when a configuration cannot be supported by this SDK (e.g. an obfuscated
|
|
5
|
+
* precomputed payload). Callers translate this into a provider error state rather
|
|
6
|
+
* than silently serving wrong data.
|
|
7
|
+
*/
|
|
8
|
+
export declare class UnsupportedConfigurationError extends Error {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Decode a precomputed CDN response into the `FlagCacheEntry` map that `FlagsClient`
|
|
13
|
+
* caches and evaluates against — the same shape the native CDN fetch returns today.
|
|
14
|
+
*
|
|
15
|
+
* The mapping is ~1:1. Two transforms are applied per flag:
|
|
16
|
+
* - `value` is the typed `variationValue` as-is (`integer`/`float` are JS `number`s);
|
|
17
|
+
* - a string `variationValue` is derived (JSON for objects, `"true"/"false"` for
|
|
18
|
+
* booleans, `String(...)` otherwise) because native Android exposure tracking
|
|
19
|
+
* rebuilds the flag from the string form.
|
|
20
|
+
*
|
|
21
|
+
* @throws {UnsupportedConfigurationError} if the response is obfuscated, or its envelope is
|
|
22
|
+
* structurally malformed (missing/non-object `data.attributes.flags`).
|
|
23
|
+
*/
|
|
24
|
+
export declare const decodePrecomputedFlags: (response: PrecomputedConfigurationResponse) => Map<string, FlagCacheEntry>;
|
|
25
|
+
//# sourceMappingURL=precomputed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"precomputed.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/flags/configuration/precomputed.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,KAAK,EACR,gCAAgC,EAEnC,MAAM,SAAS,CAAC;AAGjB;;;;GAIG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;gBACxC,OAAO,EAAE,MAAM;CAI9B;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,aACrB,gCAAgC,KAC3C,IAAI,MAAM,EAAE,cAAc,CAqC5B,CAAC"}
|