@datadog/mobile-react-native 3.5.2 → 3.5.4
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 +2 -2
- package/android/build.gradle +8 -7
- package/android/src/main/kotlin/com/datadog/reactnative/DdRumImplementation.kt +1 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +0 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt +10 -3
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkReactNativePackage.kt +0 -1
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +124 -49
- package/ios/Sources/DdLogsImplementation.swift +2 -2
- package/ios/Sources/DdSdkConfiguration.swift +0 -1
- package/ios/Sources/SdkVersion.swift +1 -1
- package/lib/commonjs/flags/FlagsClient.js +268 -3
- package/lib/commonjs/flags/FlagsClient.js.map +1 -1
- package/lib/commonjs/flags/configuration/context.js +70 -0
- package/lib/commonjs/flags/configuration/context.js.map +1 -0
- package/lib/commonjs/flags/configuration/index.js +39 -0
- package/lib/commonjs/flags/configuration/index.js.map +1 -0
- package/lib/commonjs/flags/configuration/precomputed.js +172 -0
- package/lib/commonjs/flags/configuration/precomputed.js.map +1 -0
- package/lib/commonjs/flags/configuration/types.js +33 -0
- package/lib/commonjs/flags/configuration/types.js.map +1 -0
- package/lib/commonjs/flags/configuration/wire.js +19 -0
- package/lib/commonjs/flags/configuration/wire.js.map +1 -0
- package/lib/commonjs/flags/internal.js +7 -3
- package/lib/commonjs/flags/internal.js.map +1 -1
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/flags/FlagsClient.js +268 -3
- package/lib/module/flags/FlagsClient.js.map +1 -1
- package/lib/module/flags/configuration/context.js +62 -0
- package/lib/module/flags/configuration/context.js.map +1 -0
- package/lib/module/flags/configuration/index.js +18 -0
- package/lib/module/flags/configuration/index.js.map +1 -0
- package/lib/module/flags/configuration/precomputed.js +165 -0
- package/lib/module/flags/configuration/precomputed.js.map +1 -0
- package/lib/module/flags/configuration/types.js +27 -0
- package/lib/module/flags/configuration/types.js.map +1 -0
- package/lib/module/flags/configuration/wire.js +13 -0
- package/lib/module/flags/configuration/wire.js.map +1 -0
- package/lib/module/flags/internal.js +7 -3
- package/lib/module/flags/internal.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/flags/FlagsClient.d.ts +96 -0
- package/lib/typescript/flags/FlagsClient.d.ts.map +1 -1
- package/lib/typescript/flags/configuration/context.d.ts +20 -0
- package/lib/typescript/flags/configuration/context.d.ts.map +1 -0
- package/lib/typescript/flags/configuration/index.d.ts +5 -0
- package/lib/typescript/flags/configuration/index.d.ts.map +1 -0
- package/lib/typescript/flags/configuration/precomputed.d.ts +25 -0
- package/lib/typescript/flags/configuration/precomputed.d.ts.map +1 -0
- package/lib/typescript/flags/configuration/types.d.ts +24 -0
- package/lib/typescript/flags/configuration/types.d.ts.map +1 -0
- package/lib/typescript/flags/configuration/wire.d.ts +2 -0
- package/lib/typescript/flags/configuration/wire.d.ts.map +1 -0
- package/lib/typescript/flags/internal.d.ts.map +1 -1
- package/lib/typescript/flags/types.d.ts +1 -1
- package/lib/typescript/flags/types.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +4 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +3 -2
- package/src/flags/FlagsClient.ts +305 -3
- package/src/flags/__tests__/FlagsClient.test.ts +596 -0
- package/src/flags/__tests__/internal.test.ts +45 -0
- package/src/flags/configuration/__tests__/context.test.ts +120 -0
- package/src/flags/configuration/__tests__/precomputed.test.ts +301 -0
- package/src/flags/configuration/__tests__/wire.test.ts +127 -0
- package/src/flags/configuration/context.ts +76 -0
- package/src/flags/configuration/index.ts +27 -0
- package/src/flags/configuration/precomputed.ts +215 -0
- package/src/flags/configuration/types.ts +47 -0
- package/src/flags/configuration/wire.ts +15 -0
- package/src/flags/internal.ts +6 -3
- package/src/flags/types.ts +3 -1
- package/src/index.tsx +8 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,165 @@
|
|
|
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 { InternalLog } from '../../InternalLog';
|
|
8
|
+
import { SdkVerbosity } from '../../config/types/SdkVerbosity';
|
|
9
|
+
import { SUPPORTED_VARIATION_TYPES } from './types';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Thrown when a configuration cannot be supported by this SDK (e.g. an obfuscated
|
|
13
|
+
* precomputed payload). Callers translate this into a provider error state rather
|
|
14
|
+
* than silently serving wrong data.
|
|
15
|
+
*/
|
|
16
|
+
export class UnsupportedConfigurationError extends Error {
|
|
17
|
+
constructor(message) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.name = 'UnsupportedConfigurationError';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Decode a precomputed CDN response into the `FlagCacheEntry` map that `FlagsClient`
|
|
25
|
+
* caches and evaluates against — the same shape the native CDN fetch returns today.
|
|
26
|
+
*
|
|
27
|
+
* The mapping is ~1:1. Two transforms are applied per flag:
|
|
28
|
+
* - `value` is the typed `variationValue` as-is (`integer`/`float` are JS `number`s);
|
|
29
|
+
* - a string `variationValue` is derived (JSON for objects, `"true"/"false"` for
|
|
30
|
+
* booleans, `String(...)` otherwise) because native Android exposure tracking
|
|
31
|
+
* rebuilds the flag from the string form.
|
|
32
|
+
*
|
|
33
|
+
* @throws {UnsupportedConfigurationError} if the response is obfuscated, or its envelope is
|
|
34
|
+
* structurally malformed (missing/non-object `data.attributes.flags`).
|
|
35
|
+
*/
|
|
36
|
+
export const decodePrecomputedFlags = response => {
|
|
37
|
+
const attributes = response?.data?.attributes;
|
|
38
|
+
|
|
39
|
+
// `obfuscated` is not part of flagging-core's response type, but the CDN payload
|
|
40
|
+
// carries it. Read it defensively so obfuscated payloads are still rejected:
|
|
41
|
+
// de-hashing keys / decoding values is not implemented here, so fail predictably
|
|
42
|
+
// instead of mis-mapping hashed keys.
|
|
43
|
+
if (attributes?.obfuscated) {
|
|
44
|
+
throw new UnsupportedConfigurationError('Obfuscated precomputed configurations are not supported.');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Validate the response envelope before trusting it. An untrusted wire can be JSON-valid yet
|
|
48
|
+
// structurally malformed (a null/non-object envelope, or a `flags` that is null or an array).
|
|
49
|
+
// Fail predictably so the caller classifies it as an error instead of silently decoding it to
|
|
50
|
+
// an empty — but "ready" — configuration. A genuinely empty `flags: {}` is still accepted.
|
|
51
|
+
const flags = attributes?.flags;
|
|
52
|
+
if (!isFlagsMap(flags)) {
|
|
53
|
+
throw new UnsupportedConfigurationError("Malformed precomputed configuration: 'data.attributes.flags' must be an object.");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// A Map (returned as-is) so a pathological flag keyed "__proto__" is stored as data
|
|
57
|
+
// and later looked up via `.get()` — never hitting the `Object.prototype` "__proto__"
|
|
58
|
+
// setter (on write) or the prototype chain (on read) the way a plain object would.
|
|
59
|
+
const cache = new Map();
|
|
60
|
+
for (const [key, flag] of Object.entries(flags)) {
|
|
61
|
+
const entry = toFlagCacheEntry(key, flag);
|
|
62
|
+
if (entry) {
|
|
63
|
+
cache.set(key, entry);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return cache;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// A well-formed flags container is a plain object (a possibly-empty map of flag key -> flag).
|
|
70
|
+
// `null`, arrays, and primitives are malformed envelopes.
|
|
71
|
+
const isFlagsMap = value => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
72
|
+
const toFlagCacheEntry = (key, flag) => {
|
|
73
|
+
// A malformed payload can carry a non-object flag (e.g. `flags: { "k": null }`).
|
|
74
|
+
// Skip the bad entry with a warning instead of throwing and aborting decoding of
|
|
75
|
+
// the whole configuration.
|
|
76
|
+
if (typeof flag !== 'object' || flag === null) {
|
|
77
|
+
InternalLog.log(`Flag "${key}" is not an object. Omitting it from the configuration.`, SdkVerbosity.WARN);
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const {
|
|
81
|
+
variationType,
|
|
82
|
+
variationValue,
|
|
83
|
+
variationKey,
|
|
84
|
+
allocationKey,
|
|
85
|
+
reason,
|
|
86
|
+
doLog,
|
|
87
|
+
extraLogging
|
|
88
|
+
} = flag;
|
|
89
|
+
if (typeof variationType !== 'string' || !SUPPORTED_VARIATION_TYPES.has(variationType)) {
|
|
90
|
+
InternalLog.log(`Flag "${key}" has an unsupported variation type "${String(variationType)}". Omitting it from the configuration.`, SdkVerbosity.WARN);
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
if (!valueMatchesVariationType(variationValue, variationType)) {
|
|
94
|
+
InternalLog.log(`Flag "${key}" value does not match its variation type "${variationType}". Omitting it from the configuration.`, SdkVerbosity.WARN);
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// The remaining fields feed evaluation and native exposure tracking. A corrupt
|
|
99
|
+
// payload could carry wrong types here, so validate before forwarding them.
|
|
100
|
+
if (typeof allocationKey !== 'string' || typeof variationKey !== 'string' || typeof reason !== 'string' || typeof doLog !== 'boolean' ||
|
|
101
|
+
// `extraLogging` must be a key/value map; an array (also `typeof === 'object'`) would
|
|
102
|
+
// break native exposure tracking that expects an object, so treat it as malformed.
|
|
103
|
+
extraLogging !== undefined && (typeof extraLogging !== 'object' || extraLogging === null || Array.isArray(extraLogging))) {
|
|
104
|
+
InternalLog.log(`Flag "${key}" has malformed metadata. Omitting it from the configuration.`, SdkVerbosity.WARN);
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// `serialId` is intentionally not propagated: `FlagCacheEntry` has no slot for it
|
|
109
|
+
// and the native CDN-fetched snapshot omits it too, so dropping it keeps
|
|
110
|
+
// offline/online parity.
|
|
111
|
+
return {
|
|
112
|
+
key,
|
|
113
|
+
value: variationValue,
|
|
114
|
+
allocationKey,
|
|
115
|
+
variationKey,
|
|
116
|
+
variationType,
|
|
117
|
+
variationValue: stringifyValue(variationValue),
|
|
118
|
+
reason,
|
|
119
|
+
doLog,
|
|
120
|
+
extraLogging: extraLogging ?? {}
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
const valueMatchesVariationType = (value, variationType) => {
|
|
124
|
+
switch (variationType) {
|
|
125
|
+
case 'boolean':
|
|
126
|
+
return typeof value === 'boolean';
|
|
127
|
+
case 'string':
|
|
128
|
+
return typeof value === 'string';
|
|
129
|
+
case 'number':
|
|
130
|
+
case 'float':
|
|
131
|
+
// Reject NaN/Infinity: native parsers can't round-trip them.
|
|
132
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
133
|
+
case 'integer':
|
|
134
|
+
// A fractional value under an integer flag would be truncated/mis-parsed
|
|
135
|
+
// natively, so require a whole number.
|
|
136
|
+
return Number.isInteger(value);
|
|
137
|
+
case 'object':
|
|
138
|
+
// The `object` variation type carries JSON. ffe-service enforces a top-level object at
|
|
139
|
+
// the API layer, so in practice the value is an object; that is not a storage
|
|
140
|
+
// constraint, so a malformed or hand-crafted payload could still carry any JSON value
|
|
141
|
+
// here. Accept it at decode (and stringify it for native tracking); a non-object value
|
|
142
|
+
// is then served the coded default with TYPE_MISMATCH at evaluation — see
|
|
143
|
+
// `FlagsClient.getObjectDetails`. So this only affects malformed wires, never the
|
|
144
|
+
// guaranteed-object values from a real Datadog config.
|
|
145
|
+
return true;
|
|
146
|
+
default:
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Derive the string form of a flag value expected by native Android exposure tracking.
|
|
153
|
+
* Objects/arrays are JSON-encoded; everything else uses `String(...)`, which yields
|
|
154
|
+
* lowercase `"true"/"false"` for booleans.
|
|
155
|
+
*/
|
|
156
|
+
const stringifyValue = value => {
|
|
157
|
+
if (value === null) {
|
|
158
|
+
return 'null';
|
|
159
|
+
}
|
|
160
|
+
if (typeof value === 'object') {
|
|
161
|
+
return JSON.stringify(value);
|
|
162
|
+
}
|
|
163
|
+
return String(value);
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=precomputed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["InternalLog","SdkVerbosity","SUPPORTED_VARIATION_TYPES","UnsupportedConfigurationError","Error","constructor","message","name","decodePrecomputedFlags","response","attributes","data","obfuscated","flags","isFlagsMap","cache","Map","key","flag","Object","entries","entry","toFlagCacheEntry","set","value","Array","isArray","log","WARN","variationType","variationValue","variationKey","allocationKey","reason","doLog","extraLogging","has","String","valueMatchesVariationType","undefined","stringifyValue","Number","isFinite","isInteger","JSON","stringify"],"sourceRoot":"../../../../src","sources":["flags/configuration/precomputed.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,YAAY,QAAQ,iCAAiC;AAO9D,SAASC,yBAAyB,QAAQ,SAAS;;AAEnD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,6BAA6B,SAASC,KAAK,CAAC;EACrDC,WAAWA,CAACC,OAAe,EAAE;IACzB,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,+BAA+B;EAC/C;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAC/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AAQ;MACT,OAAO,OAAOA,KAAK,KAAK,QAAQ;IACpC,KAAK,QAAQ;IACb,KAAK,OAAO;MACR;MACA,OAAO,OAAOA,KAAK,KAAK,QAAQ,IAAIiB,MAAM,CAACC,QAAQ,CAAClB,KAAK,CAAC;IAC9D,KAAK,SAAS;MACV;MACA;MACA,OAAOiB,MAAM,CAACE,SAAS,CAACnB,KAAK,CAAC;IAClC,KAAK,QAAQ;MACT;MACA;MACA;MACA;MACA;MACA;MACA;MACA,OAAO,IAAI;IACf;MACI,OAAO,KAAK;EACpB;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMgB,cAAc,GAAIhB,KAAc,IAAa;EAC/C,IAAIA,KAAK,KAAK,IAAI,EAAE;IAChB,OAAO,MAAM;EACjB;EACA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOoB,IAAI,CAACC,SAAS,CAACrB,KAAK,CAAC;EAChC;EACA,OAAOa,MAAM,CAACb,KAAK,CAAC;AACxB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
* The flag `variationType`s the decoder accepts. `@datadog/flagging-core` models the
|
|
9
|
+
* type as OpenFeature's `boolean | string | number | object`, and the CDN confirms only
|
|
10
|
+
* those are emitted. `integer`/`float` are kept here defensively — the decoder validates
|
|
11
|
+
* untrusted payloads and treats both as JavaScript `number`s.
|
|
12
|
+
*/
|
|
13
|
+
export const SUPPORTED_VARIATION_TYPES = new Set(['boolean', 'string', 'number', 'integer', 'float', 'object']);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The context an evaluation is performed against, as it appears **on the wire**.
|
|
17
|
+
*
|
|
18
|
+
* This is the OpenFeature-shaped context: a flat object with an optional
|
|
19
|
+
* `targetingKey` and arbitrary sibling attributes. It is intentionally different
|
|
20
|
+
* from the SDK's internal `EvaluationContext` (`{ targetingKey, attributes }`);
|
|
21
|
+
* callers must normalize before comparing the two.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
// The wire/precomputed types are re-exported from `@datadog/flagging-core` so this SDK
|
|
25
|
+
// shares the canonical shapes instead of maintaining its own copies. Local names are
|
|
26
|
+
// kept so the rest of the SDK is insulated from the upstream naming.
|
|
27
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SUPPORTED_VARIATION_TYPES","Set"],"sourceRoot":"../../../../src","sources":["flags/configuration/types.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,yBAA8C,GAAG,IAAIC,GAAG,CAAC,CAClE,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,CACX,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
// Wire (de)serialization is reused from `@datadog/flagging-core` (the canonical
|
|
8
|
+
// implementation) rather than reimplemented here. `configurationFromString` is lenient:
|
|
9
|
+
// it returns an empty configuration (`{}`) for malformed input or an unsupported wire
|
|
10
|
+
// version rather than throwing. `configurationToString` is the inverse (its fix from
|
|
11
|
+
// https://github.com/DataDog/openfeature-js-client/pull/331 shipped in flagging-core 2.0.0).
|
|
12
|
+
export { configurationFromString, configurationToString } from '@datadog/flagging-core';
|
|
13
|
+
//# sourceMappingURL=wire.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["configurationFromString","configurationToString"],"sourceRoot":"../../../../src","sources":["flags/configuration/wire.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SACIA,uBAAuB,EACvBC,qBAAqB,QAClB,wBAAwB","ignoreList":[]}
|
|
@@ -13,7 +13,11 @@ export const processEvaluationContext = context => {
|
|
|
13
13
|
|
|
14
14
|
// We should ignore non-primitive values in the context as per FFE SDK requirements OF.3.
|
|
15
15
|
const providedAttributes = context.attributes ?? {};
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
// Accumulate in a Map so reserved keys such as "__proto__" are handled as data
|
|
18
|
+
// instead of hitting the Object.prototype setter (which would silently drop them or
|
|
19
|
+
// pollute the prototype). Object.fromEntries then materializes own properties safely.
|
|
20
|
+
const attributes = new Map();
|
|
17
21
|
for (const [key, value] of Object.entries(providedAttributes)) {
|
|
18
22
|
const isPrimitiveValue = typeof value === 'boolean' || typeof value === 'string' || typeof value === 'number' || value === undefined || value === null;
|
|
19
23
|
if (!isPrimitiveValue) {
|
|
@@ -23,11 +27,11 @@ export const processEvaluationContext = context => {
|
|
|
23
27
|
if (value === undefined) {
|
|
24
28
|
continue;
|
|
25
29
|
}
|
|
26
|
-
attributes
|
|
30
|
+
attributes.set(key, value);
|
|
27
31
|
}
|
|
28
32
|
return {
|
|
29
33
|
targetingKey,
|
|
30
|
-
attributes
|
|
34
|
+
attributes: Object.fromEntries(attributes)
|
|
31
35
|
};
|
|
32
36
|
};
|
|
33
37
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["InternalLog","SdkVerbosity","processEvaluationContext","context","targetingKey","providedAttributes","attributes","key","value","Object","entries","isPrimitiveValue","undefined","log","WARN"],"sourceRoot":"../../../src","sources":["flags/internal.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,YAAY,QAAQ,8BAA8B;AAgB3D,OAAO,MAAMC,wBAAwB,GACjCC,OAA0B,IACN;EACpB,MAAM;IAAEC;EAAa,CAAC,GAAGD,OAAO;;EAEhC;EACA,MAAME,kBAA2C,GAC7CF,OAAO,CAACG,UAAU,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"names":["InternalLog","SdkVerbosity","processEvaluationContext","context","targetingKey","providedAttributes","attributes","Map","key","value","Object","entries","isPrimitiveValue","undefined","log","WARN","set","fromEntries"],"sourceRoot":"../../../src","sources":["flags/internal.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,YAAY,QAAQ,8BAA8B;AAgB3D,OAAO,MAAMC,wBAAwB,GACjCC,OAA0B,IACN;EACpB,MAAM;IAAEC;EAAa,CAAC,GAAGD,OAAO;;EAEhC;EACA,MAAME,kBAA2C,GAC7CF,OAAO,CAACG,UAAU,IAAI,CAAC,CAAC;;EAE5B;EACA;EACA;EACA,MAAMA,UAAU,GAAG,IAAIC,GAAG,CAAyB,CAAC;EAEpD,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACN,kBAAkB,CAAC,EAAE;IAC3D,MAAMO,gBAAgB,GAClB,OAAOH,KAAK,KAAK,SAAS,IAC1B,OAAOA,KAAK,KAAK,QAAQ,IACzB,OAAOA,KAAK,KAAK,QAAQ,IACzBA,KAAK,KAAKI,SAAS,IACnBJ,KAAK,KAAK,IAAI;IAElB,IAAI,CAACG,gBAAgB,EAAE;MACnBZ,WAAW,CAACc,GAAG,CACX,sCAAsCN,GAAG,0EAA0E,EACnHP,YAAY,CAACc,IACjB,CAAC;MAED;IACJ;IAEA,IAAIN,KAAK,KAAKI,SAAS,EAAE;MACrB;IACJ;IAEAP,UAAU,CAACU,GAAG,CAACR,GAAG,EAAEC,KAAuB,CAAC;EAChD;EAEA,OAAO;IACHL,YAAY;IACZE,UAAU,EAAEI,MAAM,CAACO,WAAW,CAACX,UAAU;EAC7C,CAAC;AACL,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -16,6 +16,7 @@ import { SdkVerbosity } from './config/types/SdkVerbosity';
|
|
|
16
16
|
import { TrackingConsent } from './config/types/TrackingConsent';
|
|
17
17
|
import { BatchProcessingLevel, BatchSize, InitializationMode, UploadFrequency, VitalsUpdateFrequency } from './config/types';
|
|
18
18
|
import { DdFlags } from './flags/DdFlags';
|
|
19
|
+
import { configurationFromString, configurationToString } from './flags/configuration';
|
|
19
20
|
import { DdLogs } from './logs/DdLogs';
|
|
20
21
|
import { DdRum } from './rum/DdRum';
|
|
21
22
|
import { DdBabelInteractionTracking } from './rum/instrumentation/interactionTracking/DdBabelInteractionTracking';
|
|
@@ -31,5 +32,5 @@ import { DdTrace } from './trace/DdTrace';
|
|
|
31
32
|
import { ErrorSource, FeatureOperationFailure } from './types';
|
|
32
33
|
import { DefaultTimeProvider } from './utils/time-provider/DefaultTimeProvider';
|
|
33
34
|
import { TimeProvider } from './utils/time-provider/TimeProvider';
|
|
34
|
-
export { DatadogProvider, DatadogProviderConfiguration, FileBasedConfiguration, InitializationMode, DdLogs, DdFlags, DdTrace, DdRum, RumActionType, ErrorSource, FeatureOperationFailure, CoreConfiguration, RumConfiguration, LogsConfiguration, TraceConfiguration, DdSdkReactNative, DdSdk, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity, VitalsUpdateFrequency, PropagatorType, UploadFrequency, BatchSize, BatchProcessingLevel, TimeProvider, DefaultTimeProvider, DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER, DATADOG_GRAPH_QL_OPERATION_NAME_HEADER, DATADOG_GRAPH_QL_VARIABLES_HEADER, DATADOG_GRAPH_QL_PAYLOAD_HEADER, DATADOG_GRAPH_QL_ERROR_HEADER, TracingIdType, TracingIdFormat, DatadogTracingIdentifier, DatadogTracingContext, DdBabelInteractionTracking, __ddExtractText };
|
|
35
|
+
export { DatadogProvider, DatadogProviderConfiguration, FileBasedConfiguration, InitializationMode, DdLogs, DdFlags, configurationFromString, configurationToString, DdTrace, DdRum, RumActionType, ErrorSource, FeatureOperationFailure, CoreConfiguration, RumConfiguration, LogsConfiguration, TraceConfiguration, DdSdkReactNative, DdSdk, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity, VitalsUpdateFrequency, PropagatorType, UploadFrequency, BatchSize, BatchProcessingLevel, TimeProvider, DefaultTimeProvider, DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER, DATADOG_GRAPH_QL_OPERATION_NAME_HEADER, DATADOG_GRAPH_QL_VARIABLES_HEADER, DATADOG_GRAPH_QL_PAYLOAD_HEADER, DATADOG_GRAPH_QL_ERROR_HEADER, TracingIdType, TracingIdFormat, DatadogTracingIdentifier, DatadogTracingContext, DdBabelInteractionTracking, __ddExtractText };
|
|
35
36
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DdSdkReactNative","InternalLog","DatadogProviderConfiguration","FileBasedConfiguration","CoreConfiguration","LogsConfiguration","RumConfiguration","TraceConfiguration","ProxyConfiguration","ProxyType","SdkVerbosity","TrackingConsent","BatchProcessingLevel","BatchSize","InitializationMode","UploadFrequency","VitalsUpdateFrequency","DdFlags","DdLogs","DdRum","DdBabelInteractionTracking","__ddExtractText","DatadogTracingContext","DatadogTracingIdentifier","TracingIdFormat","TracingIdType","DATADOG_GRAPH_QL_OPERATION_NAME_HEADER","DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER","DATADOG_GRAPH_QL_VARIABLES_HEADER","DATADOG_GRAPH_QL_PAYLOAD_HEADER","DATADOG_GRAPH_QL_ERROR_HEADER","PropagatorType","RumActionType","DatadogProvider","DdSdk","DdTrace","ErrorSource","FeatureOperationFailure","DefaultTimeProvider","TimeProvider"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,4BAA4B,QAAQ,uCAAuC;AACpF,SAASC,sBAAsB,QAAQ,iCAAiC;AAIxE,SAASC,iBAAiB,QAAQ,qCAAqC;AAEvE,SAASC,iBAAiB,QAAQ,qCAAqC;AAEvE,SAASC,gBAAgB,QAAQ,oCAAoC;AAErE,SAASC,kBAAkB,QAAQ,sCAAsC;AACzE,SACIC,kBAAkB,EAClBC,SAAS,QACN,mCAAmC;AAC1C,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,eAAe,QAAQ,gCAAgC;AAChE,SACIC,oBAAoB,EACpBC,SAAS,EACTC,kBAAkB,EAClBC,eAAe,EACfC,qBAAqB,QAClB,gBAAgB;AACvB,SAASC,OAAO,QAAQ,iBAAiB;
|
|
1
|
+
{"version":3,"names":["DdSdkReactNative","InternalLog","DatadogProviderConfiguration","FileBasedConfiguration","CoreConfiguration","LogsConfiguration","RumConfiguration","TraceConfiguration","ProxyConfiguration","ProxyType","SdkVerbosity","TrackingConsent","BatchProcessingLevel","BatchSize","InitializationMode","UploadFrequency","VitalsUpdateFrequency","DdFlags","configurationFromString","configurationToString","DdLogs","DdRum","DdBabelInteractionTracking","__ddExtractText","DatadogTracingContext","DatadogTracingIdentifier","TracingIdFormat","TracingIdType","DATADOG_GRAPH_QL_OPERATION_NAME_HEADER","DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER","DATADOG_GRAPH_QL_VARIABLES_HEADER","DATADOG_GRAPH_QL_PAYLOAD_HEADER","DATADOG_GRAPH_QL_ERROR_HEADER","PropagatorType","RumActionType","DatadogProvider","DdSdk","DdTrace","ErrorSource","FeatureOperationFailure","DefaultTimeProvider","TimeProvider"],"sourceRoot":"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AAQ,oCAAoC;AAEjE,SACIN,eAAe,EACfjC,4BAA4B,EAC5BC,sBAAsB,EACtBW,kBAAkB,EAClBM,MAAM,EACNH,OAAO,EACPC,uBAAuB,EACvBC,qBAAqB,EACrBkB,OAAO,EACPhB,KAAK,EACLa,aAAa,EACbI,WAAW,EACXC,uBAAuB,EACvBnC,iBAAiB,EACjBE,gBAAgB,EAChBD,iBAAiB,EACjBE,kBAAkB,EAClBP,gBAAgB,EAChBoC,KAAK,EACLnC,WAAW,EACXO,kBAAkB,EAClBC,SAAS,EACTE,eAAe,EACfD,YAAY,EACZM,qBAAqB,EACrBiB,cAAc,EACdlB,eAAe,EACfF,SAAS,EACTD,oBAAoB,EACpB6B,YAAY,EACZD,mBAAmB,EACnBX,sCAAsC,EACtCD,sCAAsC,EACtCE,iCAAiC,EACjCC,+BAA+B,EAC/BC,6BAA6B,EAC7BL,aAAa,EACbD,eAAe,EACfD,wBAAwB,EACxBD,qBAAqB,EACrBF,0BAA0B,EAC1BC,eAAe","ignoreList":[]}
|
package/lib/module/version.js
CHANGED
|
@@ -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":["../../../src/flags/FlagsClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlagsClient.d.ts","sourceRoot":"","sources":["../../../src/flags/FlagsClient.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACR,wBAAwB,EAE3B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAC5B,iBAAiB,GACjB,oBAAoB,GACpB,SAAS,CAAC;AAEhB;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,mBAAmB,GACzB;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,sBAAsB,CAAA;CAAE,CAAC;AAkB7D,qBAAa,WAAW;IAEpB,OAAO,CAAC,WAAW,CACN;IAEb,OAAO,CAAC,UAAU,CA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AM,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":["../../../../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":["../../../../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":["../../../../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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FlagsConfiguration, PrecomputedConfiguration, PrecomputedConfigurationResponse as FlaggingCorePrecomputedConfigurationResponse, PrecomputedFlag as FlaggingCorePrecomputedFlag } from '@datadog/flagging-core';
|
|
2
|
+
/**
|
|
3
|
+
* The flag `variationType`s the decoder accepts. `@datadog/flagging-core` models the
|
|
4
|
+
* type as OpenFeature's `boolean | string | number | object`, and the CDN confirms only
|
|
5
|
+
* those are emitted. `integer`/`float` are kept here defensively — the decoder validates
|
|
6
|
+
* untrusted payloads and treats both as JavaScript `number`s.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SUPPORTED_VARIATION_TYPES: ReadonlySet<string>;
|
|
9
|
+
/**
|
|
10
|
+
* The context an evaluation is performed against, as it appears **on the wire**.
|
|
11
|
+
*
|
|
12
|
+
* This is the OpenFeature-shaped context: a flat object with an optional
|
|
13
|
+
* `targetingKey` and arbitrary sibling attributes. It is intentionally different
|
|
14
|
+
* from the SDK's internal `EvaluationContext` (`{ targetingKey, attributes }`);
|
|
15
|
+
* callers must normalize before comparing the two.
|
|
16
|
+
*/
|
|
17
|
+
export type WireEvaluationContext = {
|
|
18
|
+
targetingKey?: string;
|
|
19
|
+
} & Record<string, unknown>;
|
|
20
|
+
export type PrecomputedFlag = FlaggingCorePrecomputedFlag;
|
|
21
|
+
export type PrecomputedConfigurationResponse = FlaggingCorePrecomputedConfigurationResponse;
|
|
22
|
+
export type ParsedPrecomputedConfiguration = PrecomputedConfiguration;
|
|
23
|
+
export type ParsedFlagsConfiguration = FlagsConfiguration;
|
|
24
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/flags/configuration/types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACR,kBAAkB,EAClB,wBAAwB,EACxB,gCAAgC,IAAI,4CAA4C,EAChF,eAAe,IAAI,2BAA2B,EACjD,MAAM,wBAAwB,CAAC;AAEhC;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,EAAE,WAAW,CAAC,MAAM,CAOxD,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAK5B,MAAM,MAAM,eAAe,GAAG,2BAA2B,CAAC;AAC1D,MAAM,MAAM,gCAAgC,GAAG,4CAA4C,CAAC;AAC5F,MAAM,MAAM,8BAA8B,GAAG,wBAAwB,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../../../src/flags/configuration/wire.ts"],"names":[],"mappings":"AAWA,OAAO,EACH,uBAAuB,EACvB,qBAAqB,EACxB,MAAM,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/flags/internal.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAkB,MAAM,SAAS,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,eAAO,MAAM,wBAAwB,YACxB,iBAAiB,KAC3B,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/flags/internal.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAkB,MAAM,SAAS,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,eAAO,MAAM,wBAAwB,YACxB,iBAAiB,KAC3B,iBAwCF,CAAC"}
|
|
@@ -155,7 +155,7 @@ export interface EvaluationContext {
|
|
|
155
155
|
*
|
|
156
156
|
* Indicates why a flag evaluation may have failed or returned a default value.
|
|
157
157
|
*/
|
|
158
|
-
type FlagErrorCode = 'PROVIDER_NOT_READY' | 'FLAG_NOT_FOUND' | 'PARSE_ERROR' | 'TYPE_MISMATCH';
|
|
158
|
+
type FlagErrorCode = 'PROVIDER_NOT_READY' | 'FLAG_NOT_FOUND' | 'PARSE_ERROR' | 'TYPE_MISMATCH' | 'INVALID_CONTEXT' | 'GENERAL';
|
|
159
159
|
/**
|
|
160
160
|
* Detailed information about a feature flag evaluation.
|
|
161
161
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/flags/types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,WAAW,WAAW;IACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,EAAE,CAAC,aAAa,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,SAAS,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,WAAW,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;;;;;;;;OASG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;;;;;OASG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,OAAO,GAAG,MA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AG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAC9D,KAAK,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAC/C,KAAK,SAAS,GAAG,SAAS,EAAE,CAAC;AAC7B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,UAAU,GAAG,SAAS,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;;;;;;OAOG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC/C;AAED;;;;GAIG;AACH,KAAK,aAAa,GACZ,oBAAoB,GACpB,gBAAgB,GAChB,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,SAAS,CAAC;AAEhB;;;;;GAKG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC;IAC1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,KAAK,EAAE,CAAC,CAAC;IACT;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -18,6 +18,8 @@ import { TrackingConsent } from './config/types/TrackingConsent';
|
|
|
18
18
|
import { BatchProcessingLevel, BatchSize, InitializationMode, UploadFrequency, VitalsUpdateFrequency } from './config/types';
|
|
19
19
|
import { DdFlags } from './flags/DdFlags';
|
|
20
20
|
import type { FlagsClient } from './flags/FlagsClient';
|
|
21
|
+
import { configurationFromString, configurationToString } from './flags/configuration';
|
|
22
|
+
import type { ParsedFlagsConfiguration } from './flags/configuration';
|
|
21
23
|
import type { FlagsConfiguration, FlagDetails, EvaluationContext, PrimitiveValue } from './flags/types';
|
|
22
24
|
import { DdLogs } from './logs/DdLogs';
|
|
23
25
|
import { DdRum } from './rum/DdRum';
|
|
@@ -36,6 +38,6 @@ import { ErrorSource, FeatureOperationFailure } from './types';
|
|
|
36
38
|
import { DefaultTimeProvider } from './utils/time-provider/DefaultTimeProvider';
|
|
37
39
|
import type { Timestamp } from './utils/time-provider/TimeProvider';
|
|
38
40
|
import { TimeProvider } from './utils/time-provider/TimeProvider';
|
|
39
|
-
export { DatadogProvider, DatadogProviderConfiguration, FileBasedConfiguration, InitializationMode, DdLogs, DdFlags, DdTrace, DdRum, RumActionType, ErrorSource, FeatureOperationFailure, CoreConfiguration, RumConfiguration, LogsConfiguration, TraceConfiguration, DdSdkReactNative, DdSdk, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity, VitalsUpdateFrequency, PropagatorType, UploadFrequency, BatchSize, BatchProcessingLevel, TimeProvider, DefaultTimeProvider, DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER, DATADOG_GRAPH_QL_OPERATION_NAME_HEADER, DATADOG_GRAPH_QL_VARIABLES_HEADER, DATADOG_GRAPH_QL_PAYLOAD_HEADER, DATADOG_GRAPH_QL_ERROR_HEADER, TracingIdType, TracingIdFormat, DatadogTracingIdentifier, DatadogTracingContext, DdBabelInteractionTracking, __ddExtractText };
|
|
40
|
-
export type { Timestamp, FirstPartyHost, AutoInstrumentationConfiguration, PartialInitializationConfiguration, CoreConfigurationOptions, RumConfigurationOptions, LogsConfigurationOptions, TraceConfigurationOptions, FlagsConfiguration, FlagsClient, EvaluationContext, PrimitiveValue, FlagDetails };
|
|
41
|
+
export { DatadogProvider, DatadogProviderConfiguration, FileBasedConfiguration, InitializationMode, DdLogs, DdFlags, configurationFromString, configurationToString, DdTrace, DdRum, RumActionType, ErrorSource, FeatureOperationFailure, CoreConfiguration, RumConfiguration, LogsConfiguration, TraceConfiguration, DdSdkReactNative, DdSdk, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity, VitalsUpdateFrequency, PropagatorType, UploadFrequency, BatchSize, BatchProcessingLevel, TimeProvider, DefaultTimeProvider, DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER, DATADOG_GRAPH_QL_OPERATION_NAME_HEADER, DATADOG_GRAPH_QL_VARIABLES_HEADER, DATADOG_GRAPH_QL_PAYLOAD_HEADER, DATADOG_GRAPH_QL_ERROR_HEADER, TracingIdType, TracingIdFormat, DatadogTracingIdentifier, DatadogTracingContext, DdBabelInteractionTracking, __ddExtractText };
|
|
42
|
+
export type { Timestamp, FirstPartyHost, AutoInstrumentationConfiguration, PartialInitializationConfiguration, CoreConfigurationOptions, RumConfigurationOptions, LogsConfigurationOptions, TraceConfigurationOptions, FlagsConfiguration, FlagsClient, ParsedFlagsConfiguration, EvaluationContext, PrimitiveValue, FlagDetails };
|
|
41
43
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACxG,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,mDAAmD,CAAC;AAC5G,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACzF,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AClB,MAAM,EACN,OAAO,EACP,uBAAuB,EACvB,qBAAqB,EACrB,OAAO,EACP,KAAK,EACL,aAAa,EACb,WAAW,EACX,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,SAAS,EACT,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,EACnB,sCAAsC,EACtC,sCAAsC,EACtC,iCAAiC,EACjC,+BAA+B,EAC/B,6BAA6B,EAC7B,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,eAAe,EAClB,CAAC;AACF,YAAY,EACR,SAAS,EACT,cAAc,EACd,gCAAgC,EAChC,kCAAkC,EAClC,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EACjB,cAAc,EACd,WAAW,EACd,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "3.5.
|
|
1
|
+
export declare const version = "3.5.4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/mobile-react-native",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.4",
|
|
4
4
|
"description": "A client-side React Native module to interact with Datadog",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datadog",
|
|
@@ -116,7 +116,8 @@
|
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
118
|
"dependencies": {
|
|
119
|
+
"@datadog/flagging-core": "~2.0.1",
|
|
119
120
|
"big-integer": "^1.6.52"
|
|
120
121
|
},
|
|
121
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "c0afe3bf819756eab3dd9a32553ec49fae513105"
|
|
122
123
|
}
|