@launchdarkly/js-client-sdk-common 1.23.0 → 1.25.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 +37 -0
- package/dist/cjs/DataManager.d.ts +9 -0
- package/dist/cjs/DataManager.d.ts.map +1 -1
- package/dist/cjs/LDClientImpl.d.ts +19 -8
- package/dist/cjs/LDClientImpl.d.ts.map +1 -1
- package/dist/cjs/api/LDOptions.d.ts +17 -5
- package/dist/cjs/api/LDOptions.d.ts.map +1 -1
- package/dist/cjs/api/LDStartOptions.d.ts +19 -0
- package/dist/cjs/api/LDStartOptions.d.ts.map +1 -0
- package/dist/cjs/api/datasource/DataSourceEntry.d.ts +46 -0
- package/dist/cjs/api/datasource/DataSourceEntry.d.ts.map +1 -1
- package/dist/cjs/api/datasource/FDv2ConnectionMode.d.ts +5 -0
- package/dist/cjs/api/datasource/FDv2ConnectionMode.d.ts.map +1 -1
- package/dist/cjs/api/datasource/LDClientDataSystemOptions.d.ts +37 -41
- package/dist/cjs/api/datasource/LDClientDataSystemOptions.d.ts.map +1 -1
- package/dist/cjs/api/datasource/ModeDefinition.d.ts +17 -1
- package/dist/cjs/api/datasource/ModeDefinition.d.ts.map +1 -1
- package/dist/cjs/api/datasource/index.d.ts +2 -2
- package/dist/cjs/api/datasource/index.d.ts.map +1 -1
- 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 +13 -3
- package/dist/cjs/configuration/Configuration.d.ts.map +1 -1
- package/dist/cjs/configuration/validateOptions.d.ts +18 -2
- package/dist/cjs/configuration/validateOptions.d.ts.map +1 -1
- package/dist/cjs/configuration/validators.d.ts +1 -1
- package/dist/cjs/configuration/validators.d.ts.map +1 -1
- package/dist/cjs/datasource/ConnectionModeConfig.d.ts +4 -2
- package/dist/cjs/datasource/ConnectionModeConfig.d.ts.map +1 -1
- package/dist/cjs/datasource/FDv2DataManagerBase.d.ts +87 -0
- package/dist/cjs/datasource/FDv2DataManagerBase.d.ts.map +1 -0
- package/dist/cjs/datasource/LDClientDataSystemOptions.d.ts +37 -3
- package/dist/cjs/datasource/LDClientDataSystemOptions.d.ts.map +1 -1
- package/dist/cjs/datasource/fdv2/CacheInitializer.d.ts.map +1 -1
- package/dist/cjs/index.cjs +1295 -104
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +8 -3
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/esm/DataManager.d.ts +9 -0
- package/dist/esm/DataManager.d.ts.map +1 -1
- package/dist/esm/LDClientImpl.d.ts +19 -8
- package/dist/esm/LDClientImpl.d.ts.map +1 -1
- package/dist/esm/api/LDOptions.d.ts +17 -5
- package/dist/esm/api/LDOptions.d.ts.map +1 -1
- package/dist/esm/api/LDStartOptions.d.ts +19 -0
- package/dist/esm/api/LDStartOptions.d.ts.map +1 -0
- package/dist/esm/api/datasource/DataSourceEntry.d.ts +46 -0
- package/dist/esm/api/datasource/DataSourceEntry.d.ts.map +1 -1
- package/dist/esm/api/datasource/FDv2ConnectionMode.d.ts +5 -0
- package/dist/esm/api/datasource/FDv2ConnectionMode.d.ts.map +1 -1
- package/dist/esm/api/datasource/LDClientDataSystemOptions.d.ts +37 -41
- package/dist/esm/api/datasource/LDClientDataSystemOptions.d.ts.map +1 -1
- package/dist/esm/api/datasource/ModeDefinition.d.ts +17 -1
- package/dist/esm/api/datasource/ModeDefinition.d.ts.map +1 -1
- package/dist/esm/api/datasource/index.d.ts +2 -2
- package/dist/esm/api/datasource/index.d.ts.map +1 -1
- 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 +13 -3
- package/dist/esm/configuration/Configuration.d.ts.map +1 -1
- package/dist/esm/configuration/validateOptions.d.ts +18 -2
- package/dist/esm/configuration/validateOptions.d.ts.map +1 -1
- package/dist/esm/configuration/validators.d.ts +1 -1
- package/dist/esm/configuration/validators.d.ts.map +1 -1
- package/dist/esm/datasource/ConnectionModeConfig.d.ts +4 -2
- package/dist/esm/datasource/ConnectionModeConfig.d.ts.map +1 -1
- package/dist/esm/datasource/FDv2DataManagerBase.d.ts +87 -0
- package/dist/esm/datasource/FDv2DataManagerBase.d.ts.map +1 -0
- package/dist/esm/datasource/LDClientDataSystemOptions.d.ts +37 -3
- package/dist/esm/datasource/LDClientDataSystemOptions.d.ts.map +1 -1
- package/dist/esm/datasource/fdv2/CacheInitializer.d.ts.map +1 -1
- package/dist/esm/index.d.ts +8 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.mjs +1294 -106
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -29,8 +29,18 @@ export default function validateOptions(input: unknown, validatorMap: Record<str
|
|
|
29
29
|
* Creates a validator for nested objects. When used in a validator map,
|
|
30
30
|
* `validateOptions` will recursively validate the nested object's properties.
|
|
31
31
|
* Defaults for nested fields are passed through from the parent.
|
|
32
|
+
*
|
|
33
|
+
* @param validators - Validator map for the nested object's fields.
|
|
34
|
+
* @param options - Optional configuration.
|
|
35
|
+
* @param options.defaults - Built-in defaults for nested fields.
|
|
36
|
+
* @param options.is - Custom `is` predicate. When provided, replaces the
|
|
37
|
+
* default "is object" check. Use this to discriminate between object shapes
|
|
38
|
+
* in an `anyOf` (e.g., matching on a `type` discriminant field).
|
|
32
39
|
*/
|
|
33
|
-
export declare function validatorOf(validators: Record<string, TypeValidator>,
|
|
40
|
+
export declare function validatorOf(validators: Record<string, TypeValidator>, options?: {
|
|
41
|
+
defaults?: Record<string, unknown>;
|
|
42
|
+
is?: (u: unknown) => boolean;
|
|
43
|
+
}): CompoundValidator;
|
|
34
44
|
/**
|
|
35
45
|
* Creates a validator for arrays of discriminated objects. Each item in the
|
|
36
46
|
* array must be an object containing a `discriminant` field whose value
|
|
@@ -80,6 +90,10 @@ export declare function anyOf(...validators: TypeValidator[]): CompoundValidator
|
|
|
80
90
|
*
|
|
81
91
|
* @param keyValidator - Validates that each key is an allowed value.
|
|
82
92
|
* @param valueValidator - Validates each value in the record.
|
|
93
|
+
* @param options - Optional configuration.
|
|
94
|
+
* @param options.defaults - Built-in defaults for the record entries. When
|
|
95
|
+
* provided, takes priority over defaults passed from the parent at
|
|
96
|
+
* validation time (same precedence as {@link validatorOf}).
|
|
83
97
|
*
|
|
84
98
|
* @example
|
|
85
99
|
* ```ts
|
|
@@ -91,5 +105,7 @@ export declare function anyOf(...validators: TypeValidator[]): CompoundValidator
|
|
|
91
105
|
* )
|
|
92
106
|
* ```
|
|
93
107
|
*/
|
|
94
|
-
export declare function recordOf(keyValidator: TypeValidator, valueValidator: TypeValidator
|
|
108
|
+
export declare function recordOf(keyValidator: TypeValidator, valueValidator: TypeValidator, options?: {
|
|
109
|
+
defaults?: Record<string, unknown>;
|
|
110
|
+
}): CompoundValidator;
|
|
95
111
|
//# sourceMappingURL=validateOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateOptions.d.ts","sourceRoot":"","sources":["../../src/configuration/validateOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAGR,aAAa,EAEd,MAAM,6BAA6B,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,QAAQ,CACN,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,QAAQ,EACjB,QAAQ,CAAC,EAAE,OAAO,GACjB;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;CACnC;AAMD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,KAAK,EAAE,OAAO,EACd,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EAC3C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,MAAM,CAAC,EA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AAa,CAAC,CAAC,GAC9D,iBAAiB,CAuCnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,GAAG,UAAU,EAAE,aAAa,EAAE,GAAG,iBAAiB,CAevE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,QAAQ,CACtB,YAAY,EAAE,aAAa,EAC3B,cAAc,EAAE,aAAa,EAC7B,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAC/C,iBAAiB,CAmCnB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TypeValidator } from '@launchdarkly/js-sdk-common';
|
|
2
2
|
import { type LDOptions } from '../api';
|
|
3
|
-
import type
|
|
3
|
+
import { type PlatformDataSystemDefaults } from '../datasource/LDClientDataSystemOptions';
|
|
4
4
|
export interface ValidatorOptions {
|
|
5
5
|
dataSystemDefaults?: PlatformDataSystemDefaults;
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/configuration/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,6BAA6B,CAAC;AAE5E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/configuration/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,6BAA6B,CAAC;AAE5E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,yCAAyC,CAAC;AAGjD,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB,CAAC,EAAE,0BAA0B,CAAC;CACjD;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,CAAC,MAAM,SAAS,EAAE,aAAa,CAAC,CA2CxC"}
|
|
@@ -5,15 +5,17 @@ import type { FDv2ConnectionMode, ModeDefinition } from '../api/datasource';
|
|
|
5
5
|
type ModeTable = {
|
|
6
6
|
readonly [K in FDv2ConnectionMode]: ModeDefinition;
|
|
7
7
|
};
|
|
8
|
+
declare const DEFAULT_FDV1_FALLBACK_POLL_INTERVAL_SECONDS = 300;
|
|
8
9
|
declare const BACKGROUND_POLL_INTERVAL_SECONDS = 3600;
|
|
9
10
|
declare const connectionModeValidator: import("@launchdarkly/js-sdk-common").OneOf;
|
|
10
11
|
declare const modeDefinitionValidators: {
|
|
11
12
|
initializers: import("../configuration/validateOptions").CompoundValidator;
|
|
12
13
|
synchronizers: import("../configuration/validateOptions").CompoundValidator;
|
|
14
|
+
fdv1Fallback: import("../configuration/validateOptions").CompoundValidator;
|
|
13
15
|
};
|
|
14
16
|
declare const MODE_DEFINITION_DEFAULTS: Record<string, unknown>;
|
|
15
|
-
declare const connectionModesValidator: import("../configuration/validateOptions").CompoundValidator;
|
|
16
17
|
declare const MODE_TABLE: ModeTable;
|
|
18
|
+
declare const connectionModesValidator: import("../configuration/validateOptions").CompoundValidator;
|
|
17
19
|
export type { ModeTable };
|
|
18
|
-
export { MODE_TABLE, MODE_DEFINITION_DEFAULTS, BACKGROUND_POLL_INTERVAL_SECONDS, connectionModeValidator, modeDefinitionValidators, connectionModesValidator, };
|
|
20
|
+
export { MODE_TABLE, MODE_DEFINITION_DEFAULTS, DEFAULT_FDV1_FALLBACK_POLL_INTERVAL_SECONDS, BACKGROUND_POLL_INTERVAL_SECONDS, connectionModeValidator, modeDefinitionValidators, connectionModesValidator, };
|
|
19
21
|
//# sourceMappingURL=ConnectionModeConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionModeConfig.d.ts","sourceRoot":"","sources":["../../src/datasource/ConnectionModeConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG5E;;GAEG;AACH,KAAK,SAAS,GAAG;IACf,QAAQ,EAAE,CAAC,IAAI,kBAAkB,GAAG,cAAc;CACnD,CAAC;AAEF,QAAA,MAAM,gCAAgC,OAAO,CAAC;AAG9C,QAAA,MAAM,uBAAuB,6CAM5B,CAAC;
|
|
1
|
+
{"version":3,"file":"ConnectionModeConfig.d.ts","sourceRoot":"","sources":["../../src/datasource/ConnectionModeConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG5E;;GAEG;AACH,KAAK,SAAS,GAAG;IACf,QAAQ,EAAE,CAAC,IAAI,kBAAkB,GAAG,cAAc;CACnD,CAAC;AAEF,QAAA,MAAM,2CAA2C,MAAM,CAAC;AACxD,QAAA,MAAM,gCAAgC,OAAO,CAAC;AAG9C,QAAA,MAAM,uBAAuB,6CAM5B,CAAC;AAuCF,QAAA,MAAM,wBAAwB;;;;CAI7B,CAAC;AAEF,QAAA,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAGrD,CAAC;AAEF,QAAA,MAAM,UAAU,EAAE,SAwBjB,CAAC;AAEF,QAAA,MAAM,wBAAwB,8DAG7B,CAAC;AAEF,YAAY,EAAE,SAAS,EAAE,CAAC;AAC1B,OAAO,EACL,UAAU,EACV,wBAAwB,EACxB,2CAA2C,EAC3C,gCAAgC,EAChC,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,GACzB,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { LDHeaders, Platform } from '@launchdarkly/js-sdk-common';
|
|
2
|
+
import { FDv2ConnectionMode, ModeResolutionTable } from '../api/datasource';
|
|
3
|
+
import { LDIdentifyOptions } from '../api/LDIdentifyOptions';
|
|
4
|
+
import { Configuration } from '../configuration/Configuration';
|
|
5
|
+
import { DataManager } from '../DataManager';
|
|
6
|
+
import { FlagManager } from '../flag-manager/FlagManager';
|
|
7
|
+
import LDEmitter from '../LDEmitter';
|
|
8
|
+
import { ModeTable } from './ConnectionModeConfig';
|
|
9
|
+
import { DataSourceEndpoints } from './Endpoints';
|
|
10
|
+
import { SourceFactoryProvider } from './SourceFactoryProvider';
|
|
11
|
+
import { LifecycleState, NetworkState } from './StateDebounceManager';
|
|
12
|
+
/**
|
|
13
|
+
* Configuration for creating an {@link FDv2DataManagerControl}.
|
|
14
|
+
*/
|
|
15
|
+
export interface FDv2DataManagerBaseConfig {
|
|
16
|
+
platform: Platform;
|
|
17
|
+
flagManager: FlagManager;
|
|
18
|
+
credential: string;
|
|
19
|
+
config: Configuration;
|
|
20
|
+
baseHeaders: LDHeaders;
|
|
21
|
+
emitter: LDEmitter;
|
|
22
|
+
/** Mode resolution table for this platform. */
|
|
23
|
+
transitionTable: ModeResolutionTable;
|
|
24
|
+
/** The configured foreground connection mode. Use {@link resolveForegroundMode} to derive. */
|
|
25
|
+
foregroundMode: FDv2ConnectionMode;
|
|
26
|
+
/** The background connection mode, if any. */
|
|
27
|
+
backgroundMode: FDv2ConnectionMode | undefined;
|
|
28
|
+
/** The mode table mapping modes to data source definitions. */
|
|
29
|
+
modeTable: ModeTable;
|
|
30
|
+
/** Provider that converts DataSourceEntry descriptors to concrete factories. */
|
|
31
|
+
sourceFactoryProvider: SourceFactoryProvider;
|
|
32
|
+
/**
|
|
33
|
+
* Platform-specific function to build query params for each identify call.
|
|
34
|
+
* Browser returns `[{ key: 'auth', value: credential }]` + optional hash.
|
|
35
|
+
* Mobile returns `[]` (uses Authorization header instead).
|
|
36
|
+
*/
|
|
37
|
+
buildQueryParams: (identifyOptions?: LDIdentifyOptions) => {
|
|
38
|
+
key: string;
|
|
39
|
+
value: string;
|
|
40
|
+
}[];
|
|
41
|
+
/**
|
|
42
|
+
* FDv1 endpoint factory for fallback. When provided, a blocked FDv1
|
|
43
|
+
* polling synchronizer slot is automatically appended to every data
|
|
44
|
+
* source. It is activated when an FDv2 response includes the
|
|
45
|
+
* `x-ld-fd-fallback` header.
|
|
46
|
+
*
|
|
47
|
+
* Browser: `browserFdv1Endpoints(clientSideId)`
|
|
48
|
+
* Mobile: `mobileFdv1Endpoints()`
|
|
49
|
+
*/
|
|
50
|
+
fdv1Endpoints?: DataSourceEndpoints;
|
|
51
|
+
/** Fallback condition timeout in ms (default 120s). */
|
|
52
|
+
fallbackTimeoutMs?: number;
|
|
53
|
+
/** Recovery condition timeout in ms (default 300s). */
|
|
54
|
+
recoveryTimeoutMs?: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The public interface returned by {@link createFDv2DataManagerBase}.
|
|
58
|
+
* Extends {@link DataManager} with mode control methods.
|
|
59
|
+
*/
|
|
60
|
+
export interface FDv2DataManagerControl extends DataManager {
|
|
61
|
+
/** Update the pending network state. Goes through debounce. */
|
|
62
|
+
setNetworkState(state: NetworkState): void;
|
|
63
|
+
/** Update the pending lifecycle state. Goes through debounce. */
|
|
64
|
+
setLifecycleState(state: LifecycleState): void;
|
|
65
|
+
/**
|
|
66
|
+
* Set an explicit connection mode override that bypasses all automatic
|
|
67
|
+
* behavior (transition table, streaming, lifecycle). Pass undefined to
|
|
68
|
+
* clear the override and return to automatic behavior.
|
|
69
|
+
*/
|
|
70
|
+
setConnectionMode(mode?: FDv2ConnectionMode): void;
|
|
71
|
+
/** Get the currently resolved connection mode. */
|
|
72
|
+
getCurrentMode(): FDv2ConnectionMode;
|
|
73
|
+
/** The configured default foreground mode (from config, not auto-promoted). */
|
|
74
|
+
readonly configuredForegroundMode: FDv2ConnectionMode;
|
|
75
|
+
/**
|
|
76
|
+
* Set a callback to flush pending analytics events. Called immediately
|
|
77
|
+
* (not debounced) when the lifecycle transitions to background.
|
|
78
|
+
*/
|
|
79
|
+
setFlushCallback(callback: () => void): void;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Creates a shared FDv2 data manager that owns mode resolution, debouncing,
|
|
83
|
+
* selector state, and FDv2DataSource lifecycle. Platform SDKs (browser, RN)
|
|
84
|
+
* wrap this with platform-specific config and event wiring.
|
|
85
|
+
*/
|
|
86
|
+
export declare function createFDv2DataManagerBase(baseConfig: FDv2DataManagerBaseConfig): FDv2DataManagerControl;
|
|
87
|
+
//# sourceMappingURL=FDv2DataManagerBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FDv2DataManagerBase.d.ts","sourceRoot":"","sources":["../../src/datasource/FDv2DataManagerBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EACT,QAAQ,EAET,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,kBAAkB,EAElB,mBAAmB,EAEpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAiB,MAAM,aAAa,CAAC;AAQjE,OAAO,EAAwB,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAEL,cAAc,EACd,YAAY,EAGb,MAAM,wBAAwB,CAAC;AAIhC;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,aAAa,CAAC;IACtB,WAAW,EAAE,SAAS,CAAC;IACvB,OAAO,EAAE,SAAS,CAAC;IAEnB,+CAA+C;IAC/C,eAAe,EAAE,mBAAmB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DataSystemOptions, ManualModeSwitching } from '../api/datasource/LDClientDataSystemOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Internal data system options that extend the public type with fields
|
|
5
|
+
* that are set by platform SDKs but not exposed to end users.
|
|
6
|
+
*/
|
|
7
|
+
export interface InternalDataSystemOptions extends LDClientDataSystemOptions {
|
|
8
|
+
/**
|
|
9
|
+
* The default foreground connection mode for this platform.
|
|
10
|
+
* Populated from platform defaults during validation.
|
|
11
|
+
*/
|
|
12
|
+
foregroundConnectionMode?: FDv2ConnectionMode;
|
|
13
|
+
/**
|
|
14
|
+
* The connection mode to use when the application transitions to the background.
|
|
15
|
+
* Set by platform SDKs (e.g., mobile) via platform defaults.
|
|
16
|
+
*/
|
|
17
|
+
backgroundConnectionMode?: FDv2ConnectionMode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Platform-specific default configuration for the FDv2 data system.
|
|
21
|
+
* Internal to the SDK — not exposed to end users.
|
|
22
|
+
*/
|
|
23
|
+
export interface PlatformDataSystemDefaults {
|
|
24
|
+
/** The default foreground connection mode for this platform. */
|
|
25
|
+
readonly foregroundConnectionMode: FDv2ConnectionMode;
|
|
26
|
+
/** The default background connection mode, if any. */
|
|
27
|
+
readonly backgroundConnectionMode?: FDv2ConnectionMode;
|
|
28
|
+
/** Whether automatic mode switching is enabled by default. */
|
|
29
|
+
readonly automaticModeSwitching: boolean | AutomaticModeSwitchingConfig | ManualModeSwitching;
|
|
30
|
+
}
|
|
2
31
|
declare const dataSystemValidators: {
|
|
3
|
-
initialConnectionMode: import("@launchdarkly/js-sdk-common").OneOf;
|
|
4
32
|
backgroundConnectionMode: import("@launchdarkly/js-sdk-common").OneOf;
|
|
5
33
|
automaticModeSwitching: import("../configuration/validateOptions").CompoundValidator;
|
|
6
34
|
connectionModes: import("../configuration/validateOptions").CompoundValidator;
|
|
@@ -17,5 +45,11 @@ declare const MOBILE_DATA_SYSTEM_DEFAULTS: PlatformDataSystemDefaults;
|
|
|
17
45
|
* Default FDv2 data system configuration for desktop SDKs (Electron, etc.).
|
|
18
46
|
*/
|
|
19
47
|
declare const DESKTOP_DATA_SYSTEM_DEFAULTS: PlatformDataSystemDefaults;
|
|
20
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Resolve the foreground connection mode from a validated data system config
|
|
50
|
+
* and platform defaults. Uses the mode from `ManualModeSwitching` when present,
|
|
51
|
+
* otherwise falls back to the platform default.
|
|
52
|
+
*/
|
|
53
|
+
declare function resolveForegroundMode(dataSystem: InternalDataSystemOptions, defaults: PlatformDataSystemDefaults): FDv2ConnectionMode;
|
|
54
|
+
export { dataSystemValidators, resolveForegroundMode, BROWSER_DATA_SYSTEM_DEFAULTS, MOBILE_DATA_SYSTEM_DEFAULTS, DESKTOP_DATA_SYSTEM_DEFAULTS, };
|
|
21
55
|
//# sourceMappingURL=LDClientDataSystemOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LDClientDataSystemOptions.d.ts","sourceRoot":"","sources":["../../src/datasource/LDClientDataSystemOptions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"LDClientDataSystemOptions.d.ts","sourceRoot":"","sources":["../../src/datasource/LDClientDataSystemOptions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,kBAAkB,MAAM,sCAAsC,CAAC;AAC3E,OAAO,KAAK,EACV,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACpB,MAAM,6CAA6C,CAAC;AAIrD;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,yBAAyB;IAC1E;;;OAGG;IACH,wBAAwB,CAAC,EAAE,kBAAkB,CAAC;IAE9C;;;OAGG;IACH,wBAAwB,CAAC,EAAE,kBAAkB,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,gEAAgE;IAChE,QAAQ,CAAC,wBAAwB,EAAE,kBAAkB,CAAC;IACtD,sDAAsD;IACtD,QAAQ,CAAC,wBAAwB,CAAC,EAAE,kBAAkB,CAAC;IACvD,8DAA8D;IAC9D,QAAQ,CAAC,sBAAsB,EAAE,OAAO,GAAG,4BAA4B,GAAG,mBAAmB,CAAC;CAC/F;AAiBD,QAAA,MAAM,oBAAoB;;;;CAQzB,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,4BAA4B,EAAE,0BAInC,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,2BAA2B,EAAE,0BAIlC,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,4BAA4B,EAAE,0BAInC,CAAC;AAQF;;;;GAIG;AACH,iBAAS,qBAAqB,CAC5B,UAAU,EAAE,yBAAyB,EACrC,QAAQ,EAAE,0BAA0B,GACnC,kBAAkB,CAKpB;AAED,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,GAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CacheInitializer.d.ts","sourceRoot":"","sources":["../../../src/datasource/fdv2/CacheInitializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAY,QAAQ,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"CacheInitializer.d.ts","sourceRoot":"","sources":["../../../src/datasource/fdv2/CacheInitializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAY,QAAQ,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAS3F;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,gDAAgD;IAChD,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,uBAAuB;IACvB,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB"}
|