Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare 3.4.0 release #52

Merged
merged 163 commits into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
ad35601
initial move of code from js-client-sdk-private
eli-darkly Oct 30, 2019
abd39cd
changelog note
eli-darkly Oct 30, 2019
d64ad13
rm obsolete comment
eli-darkly Oct 30, 2019
05fa2ea
add npm audit helper
eli-darkly Oct 30, 2019
722b6f4
update babel, jest, rollup
eli-darkly Oct 30, 2019
83156f4
fix rollup config
eli-darkly Oct 30, 2019
c062853
fix ES build, dependency cleanup
eli-darkly Oct 30, 2019
5c0e2ac
add Releaser metadata
eli-darkly Oct 30, 2019
2a16af0
Update babel config to work in `test` without `useBuiltIns`
zmdavis Oct 30, 2019
e333469
Merge pull request #1 from launchdarkly/eb/update-dev-tools
eli-darkly Oct 31, 2019
f09a83a
Merge pull request #3 from launchdarkly/zdavis/babel-config
eli-darkly Oct 31, 2019
55c3852
copyedits
eli-darkly Oct 31, 2019
d361672
fix misnamed directory
eli-darkly Nov 1, 2019
f4eb20a
Merge pull request #2 from launchdarkly/eb/ch48393/initial
eli-darkly Nov 4, 2019
f072529
use spread operator instead of Object.assign
eli-darkly Nov 4, 2019
7c1299e
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
eli-darkly Nov 4, 2019
957f477
Merge pull request #4 from launchdarkly/eb/ch54985/object-assign
eli-darkly Nov 4, 2019
a57c404
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
eli-darkly Nov 4, 2019
1539659
add issue templates
eli-darkly Nov 4, 2019
013c273
add babel-eslint
eli-darkly Nov 4, 2019
db12eca
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
eli-darkly Nov 4, 2019
087773b
merge from public after release
LaunchDarklyCI Nov 4, 2019
5bac01d
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
bwoskow-ld Nov 7, 2019
e145270
add event capacity config property
eli-darkly Dec 3, 2019
34ed8a5
re-add deprecation warning on samplingInterval
eli-darkly Dec 3, 2019
2ef59bc
Merge pull request #5 from launchdarkly/eb/ch57883/event-capacity
eli-darkly Dec 3, 2019
33d0311
Merge pull request #6 from launchdarkly/eb/ch38635/deprecation-comment
eli-darkly Dec 3, 2019
3c3e22a
better config validation
eli-darkly Dec 3, 2019
5cfb5a0
remove rollup-plugins-node-resolve
eli-darkly Dec 4, 2019
3c0794a
use newer Rollup node-resolve plugin
eli-darkly Dec 4, 2019
6385bb7
rm rollup-plugin-includepaths (unused)
eli-darkly Dec 4, 2019
c1b6f09
npm audit fix (handlebars dependency from jest)
eli-darkly Dec 4, 2019
11e46e1
comment
eli-darkly Dec 4, 2019
7cc15ba
copyedit
eli-darkly Dec 4, 2019
c44052b
Merge pull request #7 from launchdarkly/eb/ch57985/config-validation
eli-darkly Dec 4, 2019
9dbb6b2
Merge pull request #8 from launchdarkly/eb/ch57982/rollup-builtins
eli-darkly Dec 4, 2019
1cf982b
use new test helpers + misc test cleanup
eli-darkly Dec 5, 2019
9077edf
clean up stream testing logic
eli-darkly Dec 6, 2019
3f77514
fix hash parameter
eli-darkly Dec 6, 2019
d1fe985
Merge pull request #9 from launchdarkly/eb/ch57131/test-cleanup
eli-darkly Dec 7, 2019
d0de600
linter
eli-darkly Dec 7, 2019
b0168db
Merge pull request #10 from launchdarkly/eb/ch57131/stream-tests
eli-darkly Dec 7, 2019
b489fb2
clearer way to model the config option defaults/types
eli-darkly Dec 9, 2019
a32383c
test improvements
eli-darkly Dec 9, 2019
cdc1e96
change internal param name
eli-darkly Dec 9, 2019
2fcfa79
comment
eli-darkly Dec 9, 2019
88aa416
fix default logger logic
eli-darkly Dec 9, 2019
ceb9e3d
simpler way to enforce minimum values
eli-darkly Dec 10, 2019
58ee382
Merge pull request #12 from launchdarkly/eb/ch57985/config-validation…
eli-darkly Dec 10, 2019
50bc6aa
implement diagnostic events in common JS package (#11)
eli-darkly Dec 11, 2019
53a8590
add support for function type in config options
eli-darkly Dec 12, 2019
0a782ca
add support for function type in config options (#13)
eli-darkly Dec 12, 2019
04130f7
add wrapper metadata options and fix custom header logic
eli-darkly Dec 12, 2019
9491e16
lint
eli-darkly Dec 12, 2019
c9e7d7e
Merge branch 'eb/ch57741/wrapper-desc' into eb/ch57741/diagnostic-wra…
eli-darkly Dec 12, 2019
2610fc7
lint
eli-darkly Dec 12, 2019
fd7e2bb
remove image-loading logic from common code, replace it with an abstr…
eli-darkly Dec 12, 2019
0f28ba9
Merge branch 'eb/ch57741/wrapper-desc' into eb/ch59034/no-image-loading
eli-darkly Dec 12, 2019
f40f19b
Merge branch 'eb/ch59034/no-image-loading' into eb/ch57741/diagnostic…
eli-darkly Dec 12, 2019
5bdb140
Merge branch 'master' into diagnostic-events
eli-darkly Dec 12, 2019
fedb366
Merge branch 'eb/ch57741/diagnostic-wrapper' into diagnostic-events
eli-darkly Dec 12, 2019
385cbcd
add validation for options.streaming
eli-darkly Dec 12, 2019
2affe2f
Merge branch 'eb/ch57741/wrapper-desc' into eb/ch59034/no-image-loading
eli-darkly Dec 12, 2019
9e653e8
typo
eli-darkly Dec 12, 2019
c88839c
rm unused params
eli-darkly Dec 12, 2019
6f50448
merge from public after release
LaunchDarklyCI Dec 13, 2019
b4e0bfd
typo in comment
eli-darkly Dec 13, 2019
c5494b1
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
eli-darkly Dec 13, 2019
6ef084a
Merge pull request #14 from launchdarkly/eb/ch57741/wrapper-desc
eli-darkly Dec 13, 2019
f3815bc
Merge pull request #15 from launchdarkly/eb/ch59034/no-image-loading
eli-darkly Dec 13, 2019
32d767f
misc fixes to merged code from external PR
eli-darkly Dec 13, 2019
7d4f67d
merge from public after release
LaunchDarklyCI Dec 13, 2019
3ba6e27
add event payload ID header
eli-darkly Jan 14, 2020
d9499df
Merge pull request #16 from launchdarkly/eb/ch61092/payload-id
eli-darkly Jan 15, 2020
a670c7f
merge from public after release
LaunchDarklyCI Jan 15, 2020
547b309
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
eli-darkly Jan 30, 2020
15b5072
npm audit fix
eli-darkly Jan 30, 2020
6294b02
change exact dependencies to best-compatible
eli-darkly Jan 30, 2020
f190577
Merge pull request #17 from launchdarkly/eb/ch63559/relax-deps
eli-darkly Feb 1, 2020
7068968
merge from public after release
LaunchDarklyCI Feb 1, 2020
8c42690
standardize linting
eli-darkly Feb 11, 2020
f838fb3
disallow "window" and "document"
eli-darkly Feb 11, 2020
5064c3b
Merge branch 'master' into diagnostic-events
eli-darkly Feb 11, 2020
ade0261
Merge pull request #18 from launchdarkly/eb/ch65303/linting
eli-darkly Feb 11, 2020
8db5bc2
Merge branch 'diagnostic-events'
eli-darkly Feb 11, 2020
b4affad
improve diag event tests + debug logging
eli-darkly Feb 12, 2020
a01e65f
misc cleanup
eli-darkly Feb 12, 2020
7862b29
Merge pull request #19 from launchdarkly/eb/ch57741/diag-tests-fixes
eli-darkly Feb 12, 2020
4140b85
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
eli-darkly Feb 12, 2020
20c655d
fix updating secure mode hash with identify()
eli-darkly Feb 13, 2020
8bf67c4
Merge pull request #20 from launchdarkly/eb/ch65728/identify-hash
eli-darkly Feb 13, 2020
ad44049
merge from public after release
LaunchDarklyCI Feb 13, 2020
232a404
don't omit streamInits.failed when it's false
eli-darkly Feb 14, 2020
bafa8da
Merge pull request #21 from launchdarkly/eb/ch65817/diag-explicit-false
eli-darkly Feb 14, 2020
ab182f0
merge from public after release
LaunchDarklyCI Feb 14, 2020
f954124
clean up init state logic, prevent unhandled rejections
eli-darkly Mar 5, 2020
78db776
lint
eli-darkly Mar 5, 2020
3136564
Merge pull request #22 from launchdarkly/eb/ch68119/init-state-error
eli-darkly Mar 6, 2020
bd3f238
merge from public after release
LaunchDarklyCI Mar 6, 2020
54099c8
less strict matching of json content-type header
eli-darkly Mar 18, 2020
e4c792c
Merge pull request #23 from launchdarkly/eb/ch69815/content-type
eli-darkly Mar 18, 2020
c610ffd
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
eli-darkly Mar 18, 2020
5a323d8
merge from public after release
LaunchDarklyCI Mar 18, 2020
c974e2c
remove unsafe usage of hasOwnProperty
eli-darkly Mar 18, 2020
f5177c7
Merge pull request #24 from launchdarkly/eb/ch69855/has-own-property
eli-darkly Mar 18, 2020
93ee649
merge from public after release
LaunchDarklyCI Mar 18, 2020
e7ee64a
console logger must tolerate console object not always existing
eli-darkly Mar 30, 2020
c2402de
Merge pull request #25 from launchdarkly/eb/ch71507/no-console
eli-darkly Mar 31, 2020
68f359b
merge from public after release
LaunchDarklyCI Mar 31, 2020
a84b943
fix double initialization of diagnostics manager
eli-darkly May 1, 2020
14134c9
Merge pull request #26 from launchdarkly/eb/ch75557/extra-diagnostics
eli-darkly May 1, 2020
bdc9335
merge from public after release
LaunchDarklyCI May 1, 2020
5aac8a2
fix TypeScript declaration for track() and add more TS compilation te…
eli-darkly May 13, 2020
ca937d3
merge from public after release
LaunchDarklyCI May 13, 2020
fc3a857
remove startsWith usage (#28)
bwoskow-ld Jul 10, 2020
88125a7
merge from public after release
LaunchDarklyCI Jul 10, 2020
b572761
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
eli-darkly Aug 5, 2020
1359aaf
prevent poll caused by a stream ping from overwriting later poll for …
eli-darkly Sep 12, 2020
b18f56f
merge from public after release
LaunchDarklyCI Sep 14, 2020
a6037a5
upgrade jest dependency and transitive yargs-parser dependency (#30)
bwoskow-ld Oct 15, 2020
bcb1573
Add null to LDEvaluationDetail.reason type (#31)
msiadak Oct 15, 2020
924213f
Merge branch 'contrib' of github.com:launchdarkly/js-sdk-common
bwoskow-ld Oct 15, 2020
88e42fb
Revert "Add null to LDEvaluationDetail.reason type (#31)"
bwoskow-ld Oct 16, 2020
6c26507
Revert "Add null to LDEvaluationDetail.reason type (#31)"
bwoskow-ld Oct 16, 2020
5125396
Merge branch 'contrib' of github.com:launchdarkly/js-sdk-common
bwoskow-ld Oct 16, 2020
b0f9c53
nullable evaluation reason (#32)
bwoskow-ld Nov 17, 2020
fdd97ee
merge from public after release
LaunchDarklyCI Nov 17, 2020
48bee4d
adding alias event functionality (#33)
bwoskow-ld Jan 20, 2021
7845b9a
set stream read timeout
eli-darkly Jan 26, 2021
f68c5b5
Merge pull request #35 from launchdarkly/eb/ch73764/stream-read-timeout
eli-darkly Jan 26, 2021
b36bb51
merge from public after release
LaunchDarklyCI Jan 26, 2021
efc11b0
Merge branch 'alias' of github.com:launchdarkly/js-sdk-common-private
bwoskow-ld Jan 27, 2021
b53732c
merge from public after release
LaunchDarklyCI Jan 27, 2021
a6ad9c8
Add prepare script (#34)
bwoskow-ld Jan 27, 2021
3911145
add a missing typescript verification (#36)
bwoskow-ld Jan 28, 2021
63c2ddd
Removed the guides link
bwoskow-ld Feb 3, 2021
fea10ae
Merge branch 'master' of github.com:launchdarkly/js-sdk-common into c…
bwoskow-ld Feb 9, 2021
4a5d31c
Correct doc link (#36)
sinchang Feb 9, 2021
72e9801
Merge branch 'contrib' of github.com:launchdarkly/js-sdk-common
bwoskow-ld Feb 9, 2021
0f83533
Fix typo in LDClient.on jsdoc (#37)
Doesntmeananything Mar 18, 2021
b493884
Merge branch 'contrib' of github.com:launchdarkly/js-sdk-common
bwoskow-ld Mar 18, 2021
94400df
add inlineUsersInEvents option in TypeScript (#37)
eli-darkly Apr 1, 2021
8d396dd
merge from public after release
LaunchDarklyCI Apr 1, 2021
4dfbc45
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
bwoskow-ld May 11, 2021
bb60a02
Filter private attributes on debug event users. Send variation for de…
gwhelanLD Jun 7, 2021
aef52df
Merge pull request #38 from launchdarkly/gw/ch110704/debug-private-attrs
gwhelanLD Jun 7, 2021
d7fc275
Merge remote-tracking branch 'public/master'
gwhelanLD Jun 8, 2021
717322a
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
eli-darkly Aug 13, 2021
3b2ff6c
update uuid package version (#39)
eli-darkly Aug 23, 2021
c7b2645
merge from public after release
Aug 23, 2021
e05d244
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
bwoskow-ld Sep 21, 2021
8689021
use Releaser v2 config + newer CI image
eli-darkly Sep 21, 2021
75380ab
Merge pull request #40 from launchdarkly/eb/ch118712/releaser-v2
eli-darkly Sep 21, 2021
fe2bd87
First half, add the type, create the new options, add the new util me…
louis-launchdarkly Sep 24, 2021
d3cb835
Second half, call the tranform util method before calling any HTTP re…
louis-launchdarkly Sep 24, 2021
80f3098
Update the transform to work on a copy of headers instead of mutating it
louis-launchdarkly Sep 29, 2021
decda5f
add comments about removing custom event warning logic in the future
eli-darkly Oct 13, 2021
c0ab7c6
Merge pull request #42 from launchdarkly/eb/sc-124547/deprecate-goals…
eli-darkly Oct 13, 2021
f3b4a9a
revert updating of UUID dependency (#43)
eli-darkly Oct 15, 2021
98f9a86
Merge branch 'master' into lc/sc108033/add-lazily-evaluated-header
eli-darkly Oct 15, 2021
b508c75
Merge branch 'master' of github.com:launchdarkly/js-sdk-common
eli-darkly Oct 15, 2021
37af758
Merge branch 'master' into lc/sc108033/add-lazily-evaluated-header
eli-darkly Oct 15, 2021
b4294d8
Merge pull request #41 from launchdarkly/lc/sc108033/add-lazily-evalu…
louis-launchdarkly Oct 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions docs/typedoc.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/EventSender.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function EventSender(platform, environmentId, options) {
'X-LaunchDarkly-Payload-ID': payloadId,
});
return platform
.httpRequest('POST', url, headers, jsonBody)
.httpRequest('POST', url, utils.transformHeaders(headers, options), jsonBody)
.promise.then(result => {
if (!result) {
// This was a response from a fire-and-forget request, so we won't have a status.
Expand Down
2 changes: 1 addition & 1 deletion src/Requestor.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function Requestor(platform, options, environment) {
activeRequests[endpoint] = coalescer;
}

const req = platform.httpRequest(method, endpoint, headers, body);
const req = platform.httpRequest(method, endpoint, utils.transformHeaders(headers, options), body);
const p = req.promise.then(
result => {
if (result.status === 200) {
Expand Down
3 changes: 2 additions & 1 deletion src/Stream.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as messages from './messages';
import { base64URLEncode, getLDHeaders, objectHasOwnProperty } from './utils';
import { base64URLEncode, getLDHeaders, transformHeaders, objectHasOwnProperty } from './utils';

// The underlying event source implementation is abstracted via the platform object, which should
// have these three properties:
Expand Down Expand Up @@ -104,6 +104,7 @@ export default function Stream(platform, config, environment, diagnosticsAccumul
} else {
url = evalUrlPrefix + '/' + base64URLEncode(JSON.stringify(user));
}
options.headers = transformHeaders(options.headers, config);
if (withReasons) {
query = query + (query ? '&' : '') + 'withReasons=true';
}
Expand Down
17 changes: 17 additions & 0 deletions src/__tests__/EventSender-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,23 @@ describe('EventSender', () => {
expect(r.headers['x-launchdarkly-wrapper']).toEqual('FakeSDK');
});

it('should send transformed headers if requestHeaderTransform function is provided', async () => {
const headerTransform = input => {
const output = { ...input };
output['c'] = '30';
return output;
};
const options = { requestHeaderTransform: headerTransform };
const server = platform.testing.http.newServer();
server.byDefault(respond(202));
const sender = EventSender(platform, envId, options);
const event = { kind: 'identify', key: 'userKey' };
await sender.sendEvents([event], server.url);

const r = await server.nextRequest();
expect(r.headers['c']).toEqual('30');
});

describe('retry on recoverable HTTP error', () => {
const retryableStatuses = [400, 408, 429, 500, 503];
for (const i in retryableStatuses) {
Expand Down
18 changes: 18 additions & 0 deletions src/__tests__/Requestor-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,24 @@ describe('Requestor', () => {
});
});

it('sends transformed headers if requestHeaderTransform function is provided', async () => {
await withServer(async (baseConfig, server) => {
const headerTransform = input => {
const output = { ...input };
output['b'] = '20';
return output;
};
const config = { ...baseConfig, requestHeaderTransform: headerTransform };
const requestor = Requestor(platform, config, env);

await requestor.fetchFlagSettings(user);

expect(server.requests.length()).toEqual(1);
const req = await server.requests.take();
expect(req.headers['b']).toEqual('20');
});
});

it('returns parsed JSON response on success', async () => {
const data = { foo: 'bar' };
await withServer(async (baseConfig, server) => {
Expand Down
14 changes: 14 additions & 0 deletions src/__tests__/Stream-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ describe('Stream', () => {
expect(created.options.headers).toEqual({});
});

it('sends transformed headers if requestHeaderTransform function is provided', async () => {
const headerTransform = input => {
const output = { ...input };
output['a'] = '10';
return output;
};
const config = { ...defaultConfig, requestHeaderTransform: headerTransform };
const stream = new Stream(platform, config, envName);
stream.connect(user, null, {});

const created = await platform.testing.expectStream(makeExpectedStreamUrl(encodedUser));
expect(created.options.headers).toEqual({ ...baseHeaders, a: '10' });
});

it('sets event listeners', async () => {
const stream = new Stream(platform, defaultConfig, envName);
const fn1 = jest.fn();
Expand Down
33 changes: 33 additions & 0 deletions src/__tests__/utils-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
base64URLEncode,
getLDHeaders,
transformHeaders,
getLDUserAgentString,
wrapPromiseCallback,
chunkUserEventsForUrl,
Expand Down Expand Up @@ -79,6 +80,38 @@ describe('utils', () => {
});
});

describe('transformHeaders', () => {
it('does not modify the headers if the option is not available', () => {
const inputHeaders = { a: '1', b: '2' };
const headers = transformHeaders(inputHeaders, {});
expect(headers).toEqual(inputHeaders);
});

it('modifies the headers if the option has a transform', () => {
const inputHeaders = { c: '3', d: '4' };
const outputHeaders = { c: '9', d: '4', e: '5' };
const headerTransform = input => {
const output = { ...input };
output['c'] = '9';
output['e'] = '5';
return output;
};
const headers = transformHeaders(inputHeaders, { requestHeaderTransform: headerTransform });
expect(headers).toEqual(outputHeaders);
});

it('cannot mutate the input header object', () => {
const inputHeaders = { f: '6' };
const expectedInputHeaders = { f: '6' };
const headerMutate = input => {
input['f'] = '7'; // eslint-disable-line no-param-reassign
return input;
};
transformHeaders(inputHeaders, { requestHeaderTransform: headerMutate });
expect(inputHeaders).toEqual(expectedInputHeaders);
});
});

describe('getLDUserAgentString', () => {
it('uses platform user-agent and package version by default', () => {
const platform = stubPlatform.defaults();
Expand Down
1 change: 1 addition & 0 deletions src/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const baseOptionDefs = {
sendEvents: { default: true },
streaming: { type: 'boolean' }, // default for this is undefined, which is different from false
sendLDHeaders: { default: true },
requestHeaderTransform: { type: 'function' },
inlineUsersInEvents: { default: false },
allowFrequentDuplicateEvents: { default: false },
sendEventsOnlyForVariation: { default: false },
Expand Down
7 changes: 7 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ export function getLDHeaders(platform, options) {
return h;
}

export function transformHeaders(headers, options) {
if (!options || !options.requestHeaderTransform) {
return headers;
}
return options.requestHeaderTransform({ ...headers });
}

export function extend(...objects) {
return objects.reduce((acc, obj) => ({ ...acc, ...obj }), {});
}
Expand Down
1 change: 1 addition & 0 deletions test-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var allBaseOptions: ld.LDOptionsBase = {
streaming: true,
useReport: true,
sendLDHeaders: true,
requestHeaderTransform: (x) => x,
evaluationReasons: true,
sendEvents: true,
allAttributesPrivate: true,
Expand Down
8 changes: 8 additions & 0 deletions typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ declare module 'launchdarkly-js-sdk-common' {
*/
sendLDHeaders?: boolean;

/**
* A transform function for dynamic configuration of HTTP headers.
*
* This method will run last in the header generation sequence, so the function should have
* all system generated headers in case those also need to be modified.
*/
requestHeaderTransform?: (headers: Map<string, string>) => Map<string, string>;

/**
* Whether LaunchDarkly should provide additional information about how flag values were
* calculated.
Expand Down