@launchdarkly/js-client-sdk-common 1.19.1 → 1.21.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/CHANGELOG.md +33 -0
- package/dist/cjs/api/datasource/DataSourceEntry.d.ts +45 -0
- package/dist/cjs/api/datasource/DataSourceEntry.d.ts.map +1 -0
- package/dist/cjs/api/datasource/FDv2ConnectionMode.d.ts +30 -0
- package/dist/cjs/api/datasource/FDv2ConnectionMode.d.ts.map +1 -0
- package/dist/cjs/api/datasource/LDClientDataSystemOptions.d.ts +75 -0
- package/dist/cjs/api/datasource/LDClientDataSystemOptions.d.ts.map +1 -0
- package/dist/cjs/api/datasource/ModeDefinition.d.ts +21 -0
- package/dist/cjs/api/datasource/ModeDefinition.d.ts.map +1 -0
- package/dist/cjs/api/datasource/index.d.ts +5 -0
- package/dist/cjs/api/datasource/index.d.ts.map +1 -0
- package/dist/cjs/api/index.d.ts +1 -0
- package/dist/cjs/api/index.d.ts.map +1 -1
- package/dist/cjs/configuration/Configuration.d.ts +0 -1
- package/dist/cjs/configuration/Configuration.d.ts.map +1 -1
- package/dist/cjs/configuration/validateOptions.d.ts +95 -0
- package/dist/cjs/configuration/validateOptions.d.ts.map +1 -0
- package/dist/cjs/datasource/ConnectionModeConfig.d.ts +19 -0
- package/dist/cjs/datasource/ConnectionModeConfig.d.ts.map +1 -0
- package/dist/cjs/datasource/DataSourceConfig.d.ts +1 -0
- package/dist/cjs/datasource/DataSourceConfig.d.ts.map +1 -1
- package/dist/cjs/datasource/Endpoints.d.ts +21 -0
- package/dist/cjs/datasource/Endpoints.d.ts.map +1 -0
- package/dist/cjs/datasource/LDClientDataSystemOptions.d.ts +20 -0
- package/dist/cjs/datasource/LDClientDataSystemOptions.d.ts.map +1 -0
- package/dist/cjs/datasource/StateDebounceManager.d.ts +92 -0
- package/dist/cjs/datasource/StateDebounceManager.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/AsyncQueue.d.ts +2 -0
- package/dist/cjs/datasource/fdv2/AsyncQueue.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/Conditions.d.ts +73 -0
- package/dist/cjs/datasource/fdv2/Conditions.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/FDv2DataSource.d.ts +52 -0
- package/dist/cjs/datasource/fdv2/FDv2DataSource.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/FDv2Requestor.d.ts +45 -0
- package/dist/cjs/datasource/fdv2/FDv2Requestor.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/FDv2SourceResult.d.ts +82 -0
- package/dist/cjs/datasource/fdv2/FDv2SourceResult.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/Initializer.d.ts +40 -0
- package/dist/cjs/datasource/fdv2/Initializer.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/PollingBase.d.ts +2 -0
- package/dist/cjs/datasource/fdv2/PollingBase.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/PollingInitializer.d.ts +2 -0
- package/dist/cjs/datasource/fdv2/PollingInitializer.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/PollingSynchronizer.d.ts +2 -0
- package/dist/cjs/datasource/fdv2/PollingSynchronizer.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/SourceManager.d.ts +88 -0
- package/dist/cjs/datasource/fdv2/SourceManager.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/StreamingFDv2Base.d.ts +11 -0
- package/dist/cjs/datasource/fdv2/StreamingFDv2Base.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/StreamingInitializerFDv2.d.ts +2 -0
- package/dist/cjs/datasource/fdv2/StreamingInitializerFDv2.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/StreamingSynchronizerFDv2.d.ts +2 -0
- package/dist/cjs/datasource/fdv2/StreamingSynchronizerFDv2.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/Synchronizer.d.ts +49 -0
- package/dist/cjs/datasource/fdv2/Synchronizer.d.ts.map +1 -0
- package/dist/cjs/datasource/fdv2/index.d.ts +16 -0
- package/dist/cjs/datasource/fdv2/index.d.ts.map +1 -0
- package/dist/cjs/datasource/flagEvalMapper.d.ts +31 -0
- package/dist/cjs/datasource/flagEvalMapper.d.ts.map +1 -0
- package/dist/cjs/index.cjs +187 -40
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/types/index.d.ts +15 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/esm/api/datasource/DataSourceEntry.d.ts +45 -0
- package/dist/esm/api/datasource/DataSourceEntry.d.ts.map +1 -0
- package/dist/esm/api/datasource/FDv2ConnectionMode.d.ts +30 -0
- package/dist/esm/api/datasource/FDv2ConnectionMode.d.ts.map +1 -0
- package/dist/esm/api/datasource/LDClientDataSystemOptions.d.ts +75 -0
- package/dist/esm/api/datasource/LDClientDataSystemOptions.d.ts.map +1 -0
- package/dist/esm/api/datasource/ModeDefinition.d.ts +21 -0
- package/dist/esm/api/datasource/ModeDefinition.d.ts.map +1 -0
- package/dist/esm/api/datasource/index.d.ts +5 -0
- package/dist/esm/api/datasource/index.d.ts.map +1 -0
- package/dist/esm/api/index.d.ts +1 -0
- package/dist/esm/api/index.d.ts.map +1 -1
- package/dist/esm/configuration/Configuration.d.ts +0 -1
- package/dist/esm/configuration/Configuration.d.ts.map +1 -1
- package/dist/esm/configuration/validateOptions.d.ts +95 -0
- package/dist/esm/configuration/validateOptions.d.ts.map +1 -0
- package/dist/esm/datasource/ConnectionModeConfig.d.ts +19 -0
- package/dist/esm/datasource/ConnectionModeConfig.d.ts.map +1 -0
- package/dist/esm/datasource/DataSourceConfig.d.ts +1 -0
- package/dist/esm/datasource/DataSourceConfig.d.ts.map +1 -1
- package/dist/esm/datasource/Endpoints.d.ts +21 -0
- package/dist/esm/datasource/Endpoints.d.ts.map +1 -0
- package/dist/esm/datasource/LDClientDataSystemOptions.d.ts +20 -0
- package/dist/esm/datasource/LDClientDataSystemOptions.d.ts.map +1 -0
- package/dist/esm/datasource/StateDebounceManager.d.ts +92 -0
- package/dist/esm/datasource/StateDebounceManager.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/AsyncQueue.d.ts +2 -0
- package/dist/esm/datasource/fdv2/AsyncQueue.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/Conditions.d.ts +73 -0
- package/dist/esm/datasource/fdv2/Conditions.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/FDv2DataSource.d.ts +52 -0
- package/dist/esm/datasource/fdv2/FDv2DataSource.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/FDv2Requestor.d.ts +45 -0
- package/dist/esm/datasource/fdv2/FDv2Requestor.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/FDv2SourceResult.d.ts +82 -0
- package/dist/esm/datasource/fdv2/FDv2SourceResult.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/Initializer.d.ts +40 -0
- package/dist/esm/datasource/fdv2/Initializer.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/PollingBase.d.ts +2 -0
- package/dist/esm/datasource/fdv2/PollingBase.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/PollingInitializer.d.ts +2 -0
- package/dist/esm/datasource/fdv2/PollingInitializer.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/PollingSynchronizer.d.ts +2 -0
- package/dist/esm/datasource/fdv2/PollingSynchronizer.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/SourceManager.d.ts +88 -0
- package/dist/esm/datasource/fdv2/SourceManager.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/StreamingFDv2Base.d.ts +11 -0
- package/dist/esm/datasource/fdv2/StreamingFDv2Base.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/StreamingInitializerFDv2.d.ts +2 -0
- package/dist/esm/datasource/fdv2/StreamingInitializerFDv2.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/StreamingSynchronizerFDv2.d.ts +2 -0
- package/dist/esm/datasource/fdv2/StreamingSynchronizerFDv2.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/Synchronizer.d.ts +49 -0
- package/dist/esm/datasource/fdv2/Synchronizer.d.ts.map +1 -0
- package/dist/esm/datasource/fdv2/index.d.ts +16 -0
- package/dist/esm/datasource/fdv2/index.d.ts.map +1 -0
- package/dist/esm/datasource/flagEvalMapper.d.ts +31 -0
- package/dist/esm/datasource/flagEvalMapper.d.ts.map +1 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.mjs +185 -42
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/types/index.d.ts +15 -0
- package/dist/esm/types/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPollingUri, TypeValidators,
|
|
1
|
+
import { getPollingUri, isNullish, TypeValidators, OptionMessages, NumberWithMinimum, createSafeLogger, ServiceEndpoints, ApplicationTags, SafeLogger, internal, deepCompact, clone, secondsToMillis, ClientContext, fastDeepEqual, defaultHeaders, Context, LDTimeoutError, AutoEnvAttributes, cancelableTimedPromise, LDClientError, base64UrlEncode, isHttpRecoverable, httpErrorMessage, LDPollingError, DataSourceErrorKind, getStreamingUri, shouldRetry, LDStreamingError } from '@launchdarkly/js-sdk-common';
|
|
2
2
|
export * from '@launchdarkly/js-sdk-common';
|
|
3
3
|
import * as jsSdkCommon from '@launchdarkly/js-sdk-common';
|
|
4
4
|
export { jsSdkCommon as platform };
|
|
@@ -204,6 +204,74 @@ function createAsyncTaskQueue(logger) {
|
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
function isCompoundValidator(v) {
|
|
208
|
+
return 'validate' in v;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Validates an options object against a map of validators and defaults.
|
|
212
|
+
*
|
|
213
|
+
* If `input` is null, undefined, or not an object the defaults are returned
|
|
214
|
+
* (with a warning for non-nullish non-objects).
|
|
215
|
+
*
|
|
216
|
+
* Supports special validator types created by:
|
|
217
|
+
* - {@link validatorOf}: recursively validates nested objects
|
|
218
|
+
* - {@link arrayOf}: validates arrays with per-item validation
|
|
219
|
+
* - {@link anyOf}: accepts the first matching validator from a list
|
|
220
|
+
* - {@link recordOf}: validates objects with dynamic keys
|
|
221
|
+
*/
|
|
222
|
+
function validateOptions(input, validatorMap, defaults, logger, prefix) {
|
|
223
|
+
const result = { ...defaults };
|
|
224
|
+
if (isNullish(input)) {
|
|
225
|
+
return result;
|
|
226
|
+
}
|
|
227
|
+
if (!TypeValidators.Object.is(input)) {
|
|
228
|
+
logger?.warn(OptionMessages.wrongOptionType(prefix ?? 'config', 'object', typeof input));
|
|
229
|
+
return result;
|
|
230
|
+
}
|
|
231
|
+
Object.entries(input).forEach(([key, value]) => {
|
|
232
|
+
const validator = validatorMap[key];
|
|
233
|
+
const name = prefix ? `${prefix}.${key}` : key;
|
|
234
|
+
if (!validator) {
|
|
235
|
+
logger?.warn(OptionMessages.unknownOption(name));
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (isNullish(value)) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
if (isCompoundValidator(validator)) {
|
|
242
|
+
const validated = validator.validate(value, name, logger, defaults[key]);
|
|
243
|
+
if (validated !== undefined) {
|
|
244
|
+
result[key] = validated.value;
|
|
245
|
+
}
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (validator.is(value)) {
|
|
249
|
+
result[key] = value;
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
// Validation failed — apply correction or fall back to default.
|
|
253
|
+
const validatorType = validator.getType();
|
|
254
|
+
if (validatorType === 'boolean') {
|
|
255
|
+
logger?.warn(OptionMessages.wrongOptionTypeBoolean(name, typeof value));
|
|
256
|
+
result[key] = !!value;
|
|
257
|
+
}
|
|
258
|
+
else if (validatorType === 'boolean | undefined | null') {
|
|
259
|
+
logger?.warn(OptionMessages.wrongOptionTypeBoolean(name, typeof value));
|
|
260
|
+
if (typeof value !== 'boolean' && typeof value !== 'undefined' && value !== null) {
|
|
261
|
+
result[key] = !!value;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
else if (validator instanceof NumberWithMinimum && TypeValidators.Number.is(value)) {
|
|
265
|
+
logger?.warn(OptionMessages.optionBelowMinimum(name, value, validator.min));
|
|
266
|
+
result[key] = validator.min;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
logger?.warn(OptionMessages.wrongOptionType(name, validatorType, typeof value));
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
return result;
|
|
273
|
+
}
|
|
274
|
+
|
|
207
275
|
// eslint-disable-next-line max-classes-per-file
|
|
208
276
|
const validators = {
|
|
209
277
|
logger: TypeValidators.Object,
|
|
@@ -273,8 +341,12 @@ class ConfigurationImpl {
|
|
|
273
341
|
this.hooks = [];
|
|
274
342
|
this.inspectors = [];
|
|
275
343
|
this.logger = ensureSafeLogger(pristineOptions.logger);
|
|
276
|
-
const
|
|
277
|
-
|
|
344
|
+
const validated = validateOptions(pristineOptions, validators, {}, this.logger);
|
|
345
|
+
Object.entries(validated).forEach(([k, v]) => {
|
|
346
|
+
if (k !== 'logger') {
|
|
347
|
+
this[k] = v;
|
|
348
|
+
}
|
|
349
|
+
});
|
|
278
350
|
this.serviceEndpoints = new ServiceEndpoints(this.streamUri, this.baseUri, this.eventsUri, internalOptions.analyticsEventPath, internalOptions.diagnosticEventPath, internalOptions.includeAuthorizationHeader, pristineOptions.payloadFilterKey);
|
|
279
351
|
this.useReport = pristineOptions.useReport ?? false;
|
|
280
352
|
this.tags = new ApplicationTags({ application: this.applicationInfo, logger: this.logger });
|
|
@@ -283,44 +355,6 @@ class ConfigurationImpl {
|
|
|
283
355
|
this.credentialType = internalOptions.credentialType;
|
|
284
356
|
this.getImplementationHooks = internalOptions.getImplementationHooks;
|
|
285
357
|
}
|
|
286
|
-
_validateTypesAndNames(pristineOptions) {
|
|
287
|
-
const errors = [];
|
|
288
|
-
Object.entries(pristineOptions).forEach(([k, v]) => {
|
|
289
|
-
const validator = validators[k];
|
|
290
|
-
if (validator) {
|
|
291
|
-
if (!validator.is(v)) {
|
|
292
|
-
const validatorType = validator.getType();
|
|
293
|
-
if (validatorType === 'boolean') {
|
|
294
|
-
errors.push(OptionMessages.wrongOptionTypeBoolean(k, typeof v));
|
|
295
|
-
this[k] = !!v;
|
|
296
|
-
}
|
|
297
|
-
else if (validatorType === 'boolean | undefined | null') {
|
|
298
|
-
errors.push(OptionMessages.wrongOptionTypeBoolean(k, typeof v));
|
|
299
|
-
if (typeof v !== 'boolean' && typeof v !== 'undefined' && v !== null) {
|
|
300
|
-
this[k] = !!v;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
else if (validator instanceof NumberWithMinimum && TypeValidators.Number.is(v)) {
|
|
304
|
-
const { min } = validator;
|
|
305
|
-
errors.push(OptionMessages.optionBelowMinimum(k, v, min));
|
|
306
|
-
this[k] = min;
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
errors.push(OptionMessages.wrongOptionType(k, validator.getType(), typeof v));
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
else if (k === 'logger') ;
|
|
313
|
-
else {
|
|
314
|
-
// if an option is explicitly null, coerce to undefined
|
|
315
|
-
this[k] = v ?? undefined;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
else {
|
|
319
|
-
errors.push(OptionMessages.unknownOption(k));
|
|
320
|
-
}
|
|
321
|
-
});
|
|
322
|
-
return errors;
|
|
323
|
-
}
|
|
324
358
|
}
|
|
325
359
|
|
|
326
360
|
async function digest(hasher, encoding) {
|
|
@@ -1962,6 +1996,115 @@ function readFlagsFromBootstrap(logger, data) {
|
|
|
1962
1996
|
return ret;
|
|
1963
1997
|
}
|
|
1964
1998
|
|
|
1999
|
+
/**
|
|
2000
|
+
* Creates endpoint paths for browser (client-side ID) FDv1 evaluation.
|
|
2001
|
+
*
|
|
2002
|
+
* @param clientSideId The client-side ID for this environment.
|
|
2003
|
+
*/
|
|
2004
|
+
function browserFdv1Endpoints(clientSideId) {
|
|
2005
|
+
return {
|
|
2006
|
+
polling: () => ({
|
|
2007
|
+
pathGet(encoding, plainContextString) {
|
|
2008
|
+
return `/sdk/evalx/${clientSideId}/contexts/${base64UrlEncode(plainContextString, encoding)}`;
|
|
2009
|
+
},
|
|
2010
|
+
pathReport(_encoding, _plainContextString) {
|
|
2011
|
+
return `/sdk/evalx/${clientSideId}/context`;
|
|
2012
|
+
},
|
|
2013
|
+
pathPost(_encoding, _plainContextString) {
|
|
2014
|
+
throw new Error('Post for FDv1 unsupported.');
|
|
2015
|
+
},
|
|
2016
|
+
pathPing(_encoding, _plainContextString) {
|
|
2017
|
+
throw new Error('Ping for polling unsupported.');
|
|
2018
|
+
},
|
|
2019
|
+
}),
|
|
2020
|
+
streaming: () => ({
|
|
2021
|
+
pathGet(encoding, plainContextString) {
|
|
2022
|
+
return `/eval/${clientSideId}/${base64UrlEncode(plainContextString, encoding)}`;
|
|
2023
|
+
},
|
|
2024
|
+
pathReport(_encoding, _plainContextString) {
|
|
2025
|
+
return `/eval/${clientSideId}`;
|
|
2026
|
+
},
|
|
2027
|
+
pathPost(_encoding, _plainContextString) {
|
|
2028
|
+
throw new Error('Post for FDv1 unsupported.');
|
|
2029
|
+
},
|
|
2030
|
+
pathPing(_encoding, _plainContextString) {
|
|
2031
|
+
return `/ping/${clientSideId}`;
|
|
2032
|
+
},
|
|
2033
|
+
}),
|
|
2034
|
+
};
|
|
2035
|
+
}
|
|
2036
|
+
/**
|
|
2037
|
+
* Creates endpoint paths for mobile (mobile key) FDv1 evaluation.
|
|
2038
|
+
*/
|
|
2039
|
+
function mobileFdv1Endpoints() {
|
|
2040
|
+
return {
|
|
2041
|
+
polling: () => ({
|
|
2042
|
+
pathGet(encoding, plainContextString) {
|
|
2043
|
+
return `/msdk/evalx/contexts/${base64UrlEncode(plainContextString, encoding)}`;
|
|
2044
|
+
},
|
|
2045
|
+
pathReport(_encoding, _plainContextString) {
|
|
2046
|
+
return `/msdk/evalx/context`;
|
|
2047
|
+
},
|
|
2048
|
+
pathPost(_encoding, _plainContextString) {
|
|
2049
|
+
throw new Error('Post for FDv1 unsupported.');
|
|
2050
|
+
},
|
|
2051
|
+
pathPing(_encoding, _plainContextString) {
|
|
2052
|
+
throw new Error('Ping for polling unsupported.');
|
|
2053
|
+
},
|
|
2054
|
+
}),
|
|
2055
|
+
streaming: () => ({
|
|
2056
|
+
pathGet(encoding, plainContextString) {
|
|
2057
|
+
return `/meval/${base64UrlEncode(plainContextString, encoding)}`;
|
|
2058
|
+
},
|
|
2059
|
+
pathReport(_encoding, _plainContextString) {
|
|
2060
|
+
return `/meval`;
|
|
2061
|
+
},
|
|
2062
|
+
pathPost(_encoding, _plainContextString) {
|
|
2063
|
+
throw new Error('Post for FDv1 unsupported.');
|
|
2064
|
+
},
|
|
2065
|
+
pathPing(_encoding, _plainContextString) {
|
|
2066
|
+
return `/mping`;
|
|
2067
|
+
},
|
|
2068
|
+
}),
|
|
2069
|
+
};
|
|
2070
|
+
}
|
|
2071
|
+
/**
|
|
2072
|
+
* Creates endpoint paths for FDv2 evaluation.
|
|
2073
|
+
* Unified for all client-side platforms per CSFDV2 Requirement 2.1.1.
|
|
2074
|
+
*/
|
|
2075
|
+
function fdv2Endpoints() {
|
|
2076
|
+
return {
|
|
2077
|
+
polling: () => ({
|
|
2078
|
+
pathGet(encoding, plainContextString) {
|
|
2079
|
+
return `/sdk/poll/eval/${base64UrlEncode(plainContextString, encoding)}`;
|
|
2080
|
+
},
|
|
2081
|
+
pathReport(_encoding, _plainContextString) {
|
|
2082
|
+
throw new Error('Report for FDv2 unsupported.');
|
|
2083
|
+
},
|
|
2084
|
+
pathPost(_encoding, _plainContextString) {
|
|
2085
|
+
return `/sdk/poll/eval`;
|
|
2086
|
+
},
|
|
2087
|
+
pathPing(_encoding, _plainContextString) {
|
|
2088
|
+
throw new Error('Ping for polling unsupported.');
|
|
2089
|
+
},
|
|
2090
|
+
}),
|
|
2091
|
+
streaming: () => ({
|
|
2092
|
+
pathGet(encoding, plainContextString) {
|
|
2093
|
+
return `/sdk/stream/eval/${base64UrlEncode(plainContextString, encoding)}`;
|
|
2094
|
+
},
|
|
2095
|
+
pathReport(_encoding, _plainContextString) {
|
|
2096
|
+
throw new Error('Report for FDv2 unsupported.');
|
|
2097
|
+
},
|
|
2098
|
+
pathPost(_encoding, _plainContextString) {
|
|
2099
|
+
return `/sdk/stream/eval`;
|
|
2100
|
+
},
|
|
2101
|
+
pathPing(_encoding, _plainContextString) {
|
|
2102
|
+
throw new Error('Ping for streaming unsupported.');
|
|
2103
|
+
},
|
|
2104
|
+
}),
|
|
2105
|
+
};
|
|
2106
|
+
}
|
|
2107
|
+
|
|
1965
2108
|
function createDataSourceEventHandler(flagManager, statusManager, logger) {
|
|
1966
2109
|
return {
|
|
1967
2110
|
async handlePut(context, flags) {
|
|
@@ -2415,5 +2558,5 @@ class BaseDataManager {
|
|
|
2415
2558
|
}
|
|
2416
2559
|
}
|
|
2417
2560
|
|
|
2418
|
-
export { BaseDataManager, DataSourceState, LDClientImpl, makeRequestor, readFlagsFromBootstrap, safeRegisterDebugOverridePlugins };
|
|
2561
|
+
export { BaseDataManager, DataSourceState, LDClientImpl, browserFdv1Endpoints, fdv2Endpoints, makeRequestor, mobileFdv1Endpoints, readFlagsFromBootstrap, safeRegisterDebugOverridePlugins, validateOptions };
|
|
2419
2562
|
//# sourceMappingURL=index.mjs.map
|