@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/cjs/index.cjs
CHANGED
|
@@ -222,6 +222,74 @@ function createAsyncTaskQueue(logger) {
|
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
function isCompoundValidator(v) {
|
|
226
|
+
return 'validate' in v;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Validates an options object against a map of validators and defaults.
|
|
230
|
+
*
|
|
231
|
+
* If `input` is null, undefined, or not an object the defaults are returned
|
|
232
|
+
* (with a warning for non-nullish non-objects).
|
|
233
|
+
*
|
|
234
|
+
* Supports special validator types created by:
|
|
235
|
+
* - {@link validatorOf}: recursively validates nested objects
|
|
236
|
+
* - {@link arrayOf}: validates arrays with per-item validation
|
|
237
|
+
* - {@link anyOf}: accepts the first matching validator from a list
|
|
238
|
+
* - {@link recordOf}: validates objects with dynamic keys
|
|
239
|
+
*/
|
|
240
|
+
function validateOptions(input, validatorMap, defaults, logger, prefix) {
|
|
241
|
+
const result = { ...defaults };
|
|
242
|
+
if (jsSdkCommon.isNullish(input)) {
|
|
243
|
+
return result;
|
|
244
|
+
}
|
|
245
|
+
if (!jsSdkCommon.TypeValidators.Object.is(input)) {
|
|
246
|
+
logger?.warn(jsSdkCommon.OptionMessages.wrongOptionType(prefix ?? 'config', 'object', typeof input));
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
249
|
+
Object.entries(input).forEach(([key, value]) => {
|
|
250
|
+
const validator = validatorMap[key];
|
|
251
|
+
const name = prefix ? `${prefix}.${key}` : key;
|
|
252
|
+
if (!validator) {
|
|
253
|
+
logger?.warn(jsSdkCommon.OptionMessages.unknownOption(name));
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
if (jsSdkCommon.isNullish(value)) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (isCompoundValidator(validator)) {
|
|
260
|
+
const validated = validator.validate(value, name, logger, defaults[key]);
|
|
261
|
+
if (validated !== undefined) {
|
|
262
|
+
result[key] = validated.value;
|
|
263
|
+
}
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (validator.is(value)) {
|
|
267
|
+
result[key] = value;
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
// Validation failed — apply correction or fall back to default.
|
|
271
|
+
const validatorType = validator.getType();
|
|
272
|
+
if (validatorType === 'boolean') {
|
|
273
|
+
logger?.warn(jsSdkCommon.OptionMessages.wrongOptionTypeBoolean(name, typeof value));
|
|
274
|
+
result[key] = !!value;
|
|
275
|
+
}
|
|
276
|
+
else if (validatorType === 'boolean | undefined | null') {
|
|
277
|
+
logger?.warn(jsSdkCommon.OptionMessages.wrongOptionTypeBoolean(name, typeof value));
|
|
278
|
+
if (typeof value !== 'boolean' && typeof value !== 'undefined' && value !== null) {
|
|
279
|
+
result[key] = !!value;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
else if (validator instanceof jsSdkCommon.NumberWithMinimum && jsSdkCommon.TypeValidators.Number.is(value)) {
|
|
283
|
+
logger?.warn(jsSdkCommon.OptionMessages.optionBelowMinimum(name, value, validator.min));
|
|
284
|
+
result[key] = validator.min;
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
logger?.warn(jsSdkCommon.OptionMessages.wrongOptionType(name, validatorType, typeof value));
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
return result;
|
|
291
|
+
}
|
|
292
|
+
|
|
225
293
|
// eslint-disable-next-line max-classes-per-file
|
|
226
294
|
const validators = {
|
|
227
295
|
logger: jsSdkCommon.TypeValidators.Object,
|
|
@@ -291,8 +359,12 @@ class ConfigurationImpl {
|
|
|
291
359
|
this.hooks = [];
|
|
292
360
|
this.inspectors = [];
|
|
293
361
|
this.logger = ensureSafeLogger(pristineOptions.logger);
|
|
294
|
-
const
|
|
295
|
-
|
|
362
|
+
const validated = validateOptions(pristineOptions, validators, {}, this.logger);
|
|
363
|
+
Object.entries(validated).forEach(([k, v]) => {
|
|
364
|
+
if (k !== 'logger') {
|
|
365
|
+
this[k] = v;
|
|
366
|
+
}
|
|
367
|
+
});
|
|
296
368
|
this.serviceEndpoints = new jsSdkCommon.ServiceEndpoints(this.streamUri, this.baseUri, this.eventsUri, internalOptions.analyticsEventPath, internalOptions.diagnosticEventPath, internalOptions.includeAuthorizationHeader, pristineOptions.payloadFilterKey);
|
|
297
369
|
this.useReport = pristineOptions.useReport ?? false;
|
|
298
370
|
this.tags = new jsSdkCommon.ApplicationTags({ application: this.applicationInfo, logger: this.logger });
|
|
@@ -301,44 +373,6 @@ class ConfigurationImpl {
|
|
|
301
373
|
this.credentialType = internalOptions.credentialType;
|
|
302
374
|
this.getImplementationHooks = internalOptions.getImplementationHooks;
|
|
303
375
|
}
|
|
304
|
-
_validateTypesAndNames(pristineOptions) {
|
|
305
|
-
const errors = [];
|
|
306
|
-
Object.entries(pristineOptions).forEach(([k, v]) => {
|
|
307
|
-
const validator = validators[k];
|
|
308
|
-
if (validator) {
|
|
309
|
-
if (!validator.is(v)) {
|
|
310
|
-
const validatorType = validator.getType();
|
|
311
|
-
if (validatorType === 'boolean') {
|
|
312
|
-
errors.push(jsSdkCommon.OptionMessages.wrongOptionTypeBoolean(k, typeof v));
|
|
313
|
-
this[k] = !!v;
|
|
314
|
-
}
|
|
315
|
-
else if (validatorType === 'boolean | undefined | null') {
|
|
316
|
-
errors.push(jsSdkCommon.OptionMessages.wrongOptionTypeBoolean(k, typeof v));
|
|
317
|
-
if (typeof v !== 'boolean' && typeof v !== 'undefined' && v !== null) {
|
|
318
|
-
this[k] = !!v;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
else if (validator instanceof jsSdkCommon.NumberWithMinimum && jsSdkCommon.TypeValidators.Number.is(v)) {
|
|
322
|
-
const { min } = validator;
|
|
323
|
-
errors.push(jsSdkCommon.OptionMessages.optionBelowMinimum(k, v, min));
|
|
324
|
-
this[k] = min;
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
errors.push(jsSdkCommon.OptionMessages.wrongOptionType(k, validator.getType(), typeof v));
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
else if (k === 'logger') ;
|
|
331
|
-
else {
|
|
332
|
-
// if an option is explicitly null, coerce to undefined
|
|
333
|
-
this[k] = v ?? undefined;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
else {
|
|
337
|
-
errors.push(jsSdkCommon.OptionMessages.unknownOption(k));
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
return errors;
|
|
341
|
-
}
|
|
342
376
|
}
|
|
343
377
|
|
|
344
378
|
async function digest(hasher, encoding) {
|
|
@@ -1980,6 +2014,115 @@ function readFlagsFromBootstrap(logger, data) {
|
|
|
1980
2014
|
return ret;
|
|
1981
2015
|
}
|
|
1982
2016
|
|
|
2017
|
+
/**
|
|
2018
|
+
* Creates endpoint paths for browser (client-side ID) FDv1 evaluation.
|
|
2019
|
+
*
|
|
2020
|
+
* @param clientSideId The client-side ID for this environment.
|
|
2021
|
+
*/
|
|
2022
|
+
function browserFdv1Endpoints(clientSideId) {
|
|
2023
|
+
return {
|
|
2024
|
+
polling: () => ({
|
|
2025
|
+
pathGet(encoding, plainContextString) {
|
|
2026
|
+
return `/sdk/evalx/${clientSideId}/contexts/${jsSdkCommon.base64UrlEncode(plainContextString, encoding)}`;
|
|
2027
|
+
},
|
|
2028
|
+
pathReport(_encoding, _plainContextString) {
|
|
2029
|
+
return `/sdk/evalx/${clientSideId}/context`;
|
|
2030
|
+
},
|
|
2031
|
+
pathPost(_encoding, _plainContextString) {
|
|
2032
|
+
throw new Error('Post for FDv1 unsupported.');
|
|
2033
|
+
},
|
|
2034
|
+
pathPing(_encoding, _plainContextString) {
|
|
2035
|
+
throw new Error('Ping for polling unsupported.');
|
|
2036
|
+
},
|
|
2037
|
+
}),
|
|
2038
|
+
streaming: () => ({
|
|
2039
|
+
pathGet(encoding, plainContextString) {
|
|
2040
|
+
return `/eval/${clientSideId}/${jsSdkCommon.base64UrlEncode(plainContextString, encoding)}`;
|
|
2041
|
+
},
|
|
2042
|
+
pathReport(_encoding, _plainContextString) {
|
|
2043
|
+
return `/eval/${clientSideId}`;
|
|
2044
|
+
},
|
|
2045
|
+
pathPost(_encoding, _plainContextString) {
|
|
2046
|
+
throw new Error('Post for FDv1 unsupported.');
|
|
2047
|
+
},
|
|
2048
|
+
pathPing(_encoding, _plainContextString) {
|
|
2049
|
+
return `/ping/${clientSideId}`;
|
|
2050
|
+
},
|
|
2051
|
+
}),
|
|
2052
|
+
};
|
|
2053
|
+
}
|
|
2054
|
+
/**
|
|
2055
|
+
* Creates endpoint paths for mobile (mobile key) FDv1 evaluation.
|
|
2056
|
+
*/
|
|
2057
|
+
function mobileFdv1Endpoints() {
|
|
2058
|
+
return {
|
|
2059
|
+
polling: () => ({
|
|
2060
|
+
pathGet(encoding, plainContextString) {
|
|
2061
|
+
return `/msdk/evalx/contexts/${jsSdkCommon.base64UrlEncode(plainContextString, encoding)}`;
|
|
2062
|
+
},
|
|
2063
|
+
pathReport(_encoding, _plainContextString) {
|
|
2064
|
+
return `/msdk/evalx/context`;
|
|
2065
|
+
},
|
|
2066
|
+
pathPost(_encoding, _plainContextString) {
|
|
2067
|
+
throw new Error('Post for FDv1 unsupported.');
|
|
2068
|
+
},
|
|
2069
|
+
pathPing(_encoding, _plainContextString) {
|
|
2070
|
+
throw new Error('Ping for polling unsupported.');
|
|
2071
|
+
},
|
|
2072
|
+
}),
|
|
2073
|
+
streaming: () => ({
|
|
2074
|
+
pathGet(encoding, plainContextString) {
|
|
2075
|
+
return `/meval/${jsSdkCommon.base64UrlEncode(plainContextString, encoding)}`;
|
|
2076
|
+
},
|
|
2077
|
+
pathReport(_encoding, _plainContextString) {
|
|
2078
|
+
return `/meval`;
|
|
2079
|
+
},
|
|
2080
|
+
pathPost(_encoding, _plainContextString) {
|
|
2081
|
+
throw new Error('Post for FDv1 unsupported.');
|
|
2082
|
+
},
|
|
2083
|
+
pathPing(_encoding, _plainContextString) {
|
|
2084
|
+
return `/mping`;
|
|
2085
|
+
},
|
|
2086
|
+
}),
|
|
2087
|
+
};
|
|
2088
|
+
}
|
|
2089
|
+
/**
|
|
2090
|
+
* Creates endpoint paths for FDv2 evaluation.
|
|
2091
|
+
* Unified for all client-side platforms per CSFDV2 Requirement 2.1.1.
|
|
2092
|
+
*/
|
|
2093
|
+
function fdv2Endpoints() {
|
|
2094
|
+
return {
|
|
2095
|
+
polling: () => ({
|
|
2096
|
+
pathGet(encoding, plainContextString) {
|
|
2097
|
+
return `/sdk/poll/eval/${jsSdkCommon.base64UrlEncode(plainContextString, encoding)}`;
|
|
2098
|
+
},
|
|
2099
|
+
pathReport(_encoding, _plainContextString) {
|
|
2100
|
+
throw new Error('Report for FDv2 unsupported.');
|
|
2101
|
+
},
|
|
2102
|
+
pathPost(_encoding, _plainContextString) {
|
|
2103
|
+
return `/sdk/poll/eval`;
|
|
2104
|
+
},
|
|
2105
|
+
pathPing(_encoding, _plainContextString) {
|
|
2106
|
+
throw new Error('Ping for polling unsupported.');
|
|
2107
|
+
},
|
|
2108
|
+
}),
|
|
2109
|
+
streaming: () => ({
|
|
2110
|
+
pathGet(encoding, plainContextString) {
|
|
2111
|
+
return `/sdk/stream/eval/${jsSdkCommon.base64UrlEncode(plainContextString, encoding)}`;
|
|
2112
|
+
},
|
|
2113
|
+
pathReport(_encoding, _plainContextString) {
|
|
2114
|
+
throw new Error('Report for FDv2 unsupported.');
|
|
2115
|
+
},
|
|
2116
|
+
pathPost(_encoding, _plainContextString) {
|
|
2117
|
+
return `/sdk/stream/eval`;
|
|
2118
|
+
},
|
|
2119
|
+
pathPing(_encoding, _plainContextString) {
|
|
2120
|
+
throw new Error('Ping for streaming unsupported.');
|
|
2121
|
+
},
|
|
2122
|
+
}),
|
|
2123
|
+
};
|
|
2124
|
+
}
|
|
2125
|
+
|
|
1983
2126
|
function createDataSourceEventHandler(flagManager, statusManager, logger) {
|
|
1984
2127
|
return {
|
|
1985
2128
|
async handlePut(context, flags) {
|
|
@@ -2437,9 +2580,13 @@ exports.platform = jsSdkCommon__namespace;
|
|
|
2437
2580
|
exports.BaseDataManager = BaseDataManager;
|
|
2438
2581
|
exports.DataSourceState = DataSourceState;
|
|
2439
2582
|
exports.LDClientImpl = LDClientImpl;
|
|
2583
|
+
exports.browserFdv1Endpoints = browserFdv1Endpoints;
|
|
2584
|
+
exports.fdv2Endpoints = fdv2Endpoints;
|
|
2440
2585
|
exports.makeRequestor = makeRequestor;
|
|
2586
|
+
exports.mobileFdv1Endpoints = mobileFdv1Endpoints;
|
|
2441
2587
|
exports.readFlagsFromBootstrap = readFlagsFromBootstrap;
|
|
2442
2588
|
exports.safeRegisterDebugOverridePlugins = safeRegisterDebugOverridePlugins;
|
|
2589
|
+
exports.validateOptions = validateOptions;
|
|
2443
2590
|
Object.keys(jsSdkCommon).forEach(function (k) {
|
|
2444
2591
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
2445
2592
|
enumerable: true,
|