@launchdarkly/js-client-sdk-common 1.15.2 → 1.17.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 +17 -0
- package/dist/cjs/LDClientImpl.d.ts +37 -4
- package/dist/cjs/LDClientImpl.d.ts.map +1 -1
- package/dist/cjs/LDEmitter.d.ts +1 -1
- package/dist/cjs/LDEmitter.d.ts.map +1 -1
- package/dist/cjs/api/LDClient.d.ts +33 -0
- package/dist/cjs/api/LDClient.d.ts.map +1 -1
- package/dist/cjs/api/LDOptions.d.ts +7 -0
- package/dist/cjs/api/LDOptions.d.ts.map +1 -1
- package/dist/cjs/api/LDPlugin.d.ts +16 -0
- package/dist/cjs/api/LDPlugin.d.ts.map +1 -0
- package/dist/cjs/api/LDWaitForInitialization.d.ts +50 -0
- package/dist/cjs/api/LDWaitForInitialization.d.ts.map +1 -0
- package/dist/cjs/api/index.d.ts +2 -0
- package/dist/cjs/api/index.d.ts.map +1 -1
- package/dist/cjs/configuration/Configuration.d.ts +1 -0
- package/dist/cjs/configuration/Configuration.d.ts.map +1 -1
- package/dist/cjs/configuration/validators.d.ts.map +1 -1
- package/dist/cjs/context/createActiveContextTracker.d.ts +49 -0
- package/dist/cjs/context/createActiveContextTracker.d.ts.map +1 -0
- package/dist/cjs/flag-manager/FlagManager.d.ts +70 -1
- package/dist/cjs/flag-manager/FlagManager.d.ts.map +1 -1
- package/dist/cjs/flag-manager/FlagPersistence.d.ts +1 -1
- package/dist/cjs/flag-manager/FlagPersistence.d.ts.map +1 -1
- package/dist/cjs/flag-manager/FlagStore.d.ts +15 -13
- package/dist/cjs/flag-manager/FlagStore.d.ts.map +1 -1
- package/dist/cjs/flag-manager/FlagUpdater.d.ts +35 -7
- package/dist/cjs/flag-manager/FlagUpdater.d.ts.map +1 -1
- package/dist/cjs/index.cjs +347 -121
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/plugins/safeRegisterDebugOverridePlugins.d.ts +12 -0
- package/dist/cjs/plugins/safeRegisterDebugOverridePlugins.d.ts.map +1 -0
- package/dist/esm/LDClientImpl.d.ts +37 -4
- package/dist/esm/LDClientImpl.d.ts.map +1 -1
- package/dist/esm/LDEmitter.d.ts +1 -1
- package/dist/esm/LDEmitter.d.ts.map +1 -1
- package/dist/esm/api/LDClient.d.ts +33 -0
- package/dist/esm/api/LDClient.d.ts.map +1 -1
- package/dist/esm/api/LDOptions.d.ts +7 -0
- package/dist/esm/api/LDOptions.d.ts.map +1 -1
- package/dist/esm/api/LDPlugin.d.ts +16 -0
- package/dist/esm/api/LDPlugin.d.ts.map +1 -0
- package/dist/esm/api/LDWaitForInitialization.d.ts +50 -0
- package/dist/esm/api/LDWaitForInitialization.d.ts.map +1 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/api/index.d.ts.map +1 -1
- package/dist/esm/configuration/Configuration.d.ts +1 -0
- package/dist/esm/configuration/Configuration.d.ts.map +1 -1
- package/dist/esm/configuration/validators.d.ts.map +1 -1
- package/dist/esm/context/createActiveContextTracker.d.ts +49 -0
- package/dist/esm/context/createActiveContextTracker.d.ts.map +1 -0
- package/dist/esm/flag-manager/FlagManager.d.ts +70 -1
- package/dist/esm/flag-manager/FlagManager.d.ts.map +1 -1
- package/dist/esm/flag-manager/FlagPersistence.d.ts +1 -1
- package/dist/esm/flag-manager/FlagPersistence.d.ts.map +1 -1
- package/dist/esm/flag-manager/FlagStore.d.ts +15 -13
- package/dist/esm/flag-manager/FlagStore.d.ts.map +1 -1
- package/dist/esm/flag-manager/FlagUpdater.d.ts +35 -7
- package/dist/esm/flag-manager/FlagUpdater.d.ts.map +1 -1
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.mjs +348 -123
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/plugins/safeRegisterDebugOverridePlugins.d.ts +12 -0
- package/dist/esm/plugins/safeRegisterDebugOverridePlugins.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LDOptions.d.ts","sourceRoot":"","sources":["../../src/api/LDOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,WAAW,SAAS;IACxB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;;;;OAKG;IACH,eAAe,CAAC,EAAE;QAChB;;;;;;;WAOG;QACH,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ;;;;;;;WAOG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB;;;;;WAKG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd;;;;;WAKG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IAEF;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;;OAOG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IAErC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC;IAElB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;;;;;;;;;;;;OAgBG;IACH,iBAAiB,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AE5B;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LDPluginBase as LDPluginBaseCommon } from '@launchdarkly/js-sdk-common';
|
|
2
|
+
import { LDDebugOverride } from '../flag-manager/FlagManager';
|
|
3
|
+
export interface LDPluginBase<TClient, THook> extends LDPluginBaseCommon<TClient, THook> {
|
|
4
|
+
/**
|
|
5
|
+
* An optional function called if the plugin wants to register debug capabilities.
|
|
6
|
+
* This method allows plugins to receive a debug override interface for
|
|
7
|
+
* temporarily overriding flag values during development and testing.
|
|
8
|
+
*
|
|
9
|
+
* @experimental This interface is experimental and intended for use by LaunchDarkly tools at this time.
|
|
10
|
+
* The API may change in future versions.
|
|
11
|
+
*
|
|
12
|
+
* @param debugOverride The debug override interface instance
|
|
13
|
+
*/
|
|
14
|
+
registerDebug?(debugOverride: LDDebugOverride): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=LDPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LDPlugin.d.ts","sourceRoot":"","sources":["../../src/api/LDPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,WAAW,YAAY,CAAC,OAAO,EAAE,KAAK,CAAE,SAAQ,kBAAkB,CAAC,OAAO,EAAE,KAAK,CAAC;IACtF;;;;;;;;;OASG;IACH,aAAa,CAAC,CAAC,aAAa,EAAE,eAAe,GAAG,IAAI,CAAC;CACtD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The waitForInitialization operation failed.
|
|
3
|
+
*/
|
|
4
|
+
export interface LDWaitForInitializationFailed {
|
|
5
|
+
status: 'failed';
|
|
6
|
+
error: Error;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The waitForInitialization operation timed out.
|
|
10
|
+
*/
|
|
11
|
+
export interface LDWaitForInitializationTimeout {
|
|
12
|
+
status: 'timeout';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The waitForInitialization operation completed successfully.
|
|
16
|
+
*/
|
|
17
|
+
export interface LDWaitForInitializationComplete {
|
|
18
|
+
status: 'complete';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The result of the waitForInitialization operation.
|
|
22
|
+
*/
|
|
23
|
+
export type LDWaitForInitializationResult = LDWaitForInitializationFailed | LDWaitForInitializationTimeout | LDWaitForInitializationComplete;
|
|
24
|
+
/**
|
|
25
|
+
* @ignore
|
|
26
|
+
* Currently these options and the waitForInitialization method signiture will mirror the one
|
|
27
|
+
* that is defined in the server common. We will be consolidating this mehod so that it will
|
|
28
|
+
* be common to all sdks in the future.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Options for the waitForInitialization method.
|
|
32
|
+
*/
|
|
33
|
+
export interface LDWaitForInitializationOptions {
|
|
34
|
+
/**
|
|
35
|
+
* The timeout duration in seconds to wait for initialization before resolving the promise.
|
|
36
|
+
* If exceeded, the promise will resolve to a {@link LDWaitForInitializationTimeout} object.
|
|
37
|
+
*
|
|
38
|
+
* If no options are specified on the `waitForInitialization`, the default timeout of 5 seconds will be used.
|
|
39
|
+
*
|
|
40
|
+
* Using a high timeout, or no timeout, is not recommended because it could result in a long
|
|
41
|
+
* delay when conditions prevent successful initialization.
|
|
42
|
+
*
|
|
43
|
+
* A value of 0 will cause the promise to resolve without waiting. In that scenario it would be
|
|
44
|
+
* more effective to not call `waitForInitialization`.
|
|
45
|
+
*
|
|
46
|
+
* @default 5 seconds
|
|
47
|
+
*/
|
|
48
|
+
timeout?: number;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=LDWaitForInitialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LDWaitForInitialization.d.ts","sourceRoot":"","sources":["../../src/api/LDWaitForInitialization.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,QAAQ,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,SAAS,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,UAAU,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,6BAA6B,GACrC,6BAA6B,GAC7B,8BAA8B,GAC9B,+BAA+B,CAAC;AAEpC;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/esm/api/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC"}
|
|
@@ -5,6 +5,7 @@ export interface LDClientInternalOptions extends internal.LDInternalOptions {
|
|
|
5
5
|
trackEventModifier?: (event: internal.InputCustomEvent) => internal.InputCustomEvent;
|
|
6
6
|
getImplementationHooks: (environmentMetadata: LDPluginEnvironmentMetadata) => Hook[];
|
|
7
7
|
credentialType: 'clientSideId' | 'mobileKey';
|
|
8
|
+
getLegacyStorageKeys?: () => string[];
|
|
8
9
|
}
|
|
9
10
|
export interface Configuration {
|
|
10
11
|
readonly logger: LDLogger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../../src/configuration/Configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,2BAA2B,EAI3B,gBAAgB,EAEjB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAKnD,MAAM,WAAW,uBAAwB,SAAQ,QAAQ,CAAC,iBAAiB;IACzE,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,gBAAgB,KAAK,QAAQ,CAAC,gBAAgB,CAAC;IACrF,sBAAsB,EAAE,CAAC,mBAAmB,EAAE,2BAA2B,KAAK,IAAI,EAAE,CAAC;IACrF,cAAc,EAAE,cAAc,GAAG,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../../src/configuration/Configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,2BAA2B,EAI3B,gBAAgB,EAEjB,MAAM,6BAA6B,CAAC;AA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nD,SAAgB,YAAY,EAAE,MAAM,CAA4B;IAEhE,SAAgB,mBAAmB,EAAE,YAAY,GAAG,2BAA2B,CAAC;IAEhF,SAAgB,KAAK,EAAE,IAAI,EAAE,CAAM;IAEnC,SAAgB,UAAU,EAAE,YAAY,EAAE,CAAM;IAEhD,SAAgB,kBAAkB,EAAE,CAClC,KAAK,EAAE,QAAQ,CAAC,gBAAgB,KAC7B,QAAQ,CAAC,gBAAgB,CAAC;IAE/B,SAAgB,cAAc,EAAE,cAAc,GAAG,WAAW,CAAC;IAC7D,SAAgB,sBAAsB,EAAE,CACtC,mBAAmB,EAAE,2BAA2B,KAC7C,IAAI,EAAE,CAAC;IAGZ,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;gBAGnB,eAAe,GAAE,SAAc,EAC/B,eAAe,GAAE,uBAGhB;IAyBH,OAAO,CAAC,sBAAsB;CAuC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/configuration/validators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAkB,MAAM,6BAA6B,CAAC;AAE5E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,QAAA,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,SAAS,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/configuration/validators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAkB,MAAM,6BAA6B,CAAC;AAE5E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,QAAA,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,SAAS,EAAE,aAAa,CAgCtD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Context, LDContext } from '@launchdarkly/js-sdk-common';
|
|
2
|
+
/**
|
|
3
|
+
* ActiveContextTracker is an internal class that helps tracks the current active context
|
|
4
|
+
* used by the client.
|
|
5
|
+
*/
|
|
6
|
+
export interface ActiveContextTracker {
|
|
7
|
+
/**
|
|
8
|
+
* Set the active context and unwrapped context. This will only be called when the passed in context
|
|
9
|
+
* is checked and valid.
|
|
10
|
+
*
|
|
11
|
+
* @param unwrappedContext - The unwrapped context, which is the context as it was passed in to the SDK.
|
|
12
|
+
* @param context - The active context, which is the context as it was checked and validated.
|
|
13
|
+
*/
|
|
14
|
+
set(unwrappedContext: LDContext, context: Context): void;
|
|
15
|
+
/**
|
|
16
|
+
* Get the active context.
|
|
17
|
+
*
|
|
18
|
+
* @returns The active context or undefined if it has not been set.
|
|
19
|
+
*/
|
|
20
|
+
getContext(): Context | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Get the unwrapped context.
|
|
23
|
+
*
|
|
24
|
+
* @returns The unwrapped context or undefined if it has not been set.
|
|
25
|
+
*/
|
|
26
|
+
getUnwrappedContext(): LDContext | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Create a new identification promise. To allow other parts of the SDK to track the identification process.
|
|
29
|
+
*/
|
|
30
|
+
newIdentificationPromise(): {
|
|
31
|
+
identifyPromise: Promise<void>;
|
|
32
|
+
identifyResolve: () => void;
|
|
33
|
+
identifyReject: (err: Error) => void;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Check if the active context is set. Regardless of whether it is valid or not.
|
|
37
|
+
*
|
|
38
|
+
* @returns True if the active context is set, false otherwise.
|
|
39
|
+
*/
|
|
40
|
+
hasContext(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Check if the active context is valid.
|
|
43
|
+
*
|
|
44
|
+
* @returns True if the active context is valid, false otherwise.
|
|
45
|
+
*/
|
|
46
|
+
hasValidContext(): boolean;
|
|
47
|
+
}
|
|
48
|
+
export declare function createActiveContextTracker(): ActiveContextTracker;
|
|
49
|
+
//# sourceMappingURL=createActiveContextTracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createActiveContextTracker.d.ts","sourceRoot":"","sources":["../../src/context/createActiveContextTracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAEjE;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,GAAG,CAAC,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAEzD;;;;OAIG;IACH,UAAU,IAAI,OAAO,GAAG,SAAS,CAAC;IAElC;;;;OAIG;IACH,mBAAmB,IAAI,SAAS,GAAG,SAAS,CAAC;IAE7C;;OAEG;IACH,wBAAwB,IAAI;QAC1B,eAAe,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,eAAe,EAAE,MAAM,IAAI,CAAC;QAC5B,cAAc,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;KACtC,CAAC;IAEF;;;;OAIG;IACH,UAAU,IAAI,OAAO,CAAC;IAEtB;;;;OAIG;IACH,eAAe,IAAI,OAAO,CAAC;CAC5B;AAED,wBAAgB,0BAA0B,IAAI,oBAAoB,CAiCjE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context, LDLogger, Platform } from '@launchdarkly/js-sdk-common';
|
|
1
|
+
import { Context, LDFlagValue, LDLogger, Platform } from '@launchdarkly/js-sdk-common';
|
|
2
2
|
import { FlagsChangeCallback } from './FlagUpdater';
|
|
3
3
|
import { ItemDescriptor } from './ItemDescriptor';
|
|
4
4
|
/**
|
|
@@ -34,6 +34,16 @@ export interface FlagManager {
|
|
|
34
34
|
* Asynchronously load cached values from persistence.
|
|
35
35
|
*/
|
|
36
36
|
loadCached(context: Context): Promise<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Updates in-memory storage with the specified flags without a context
|
|
39
|
+
* or persistent storage. Flags set in this way are considered emphemeral and
|
|
40
|
+
* should be replaced as soon as initialization is done.
|
|
41
|
+
*
|
|
42
|
+
* @param newFlags - cached flags
|
|
43
|
+
*/
|
|
44
|
+
presetFlags(newFlags: {
|
|
45
|
+
[key: string]: ItemDescriptor;
|
|
46
|
+
}): void;
|
|
37
47
|
/**
|
|
38
48
|
* Update in-memory storage with the specified flags, but do not persistent them to cache
|
|
39
49
|
* storage.
|
|
@@ -49,11 +59,59 @@ export interface FlagManager {
|
|
|
49
59
|
* Unregister a flag change callback.
|
|
50
60
|
*/
|
|
51
61
|
off(callback: FlagsChangeCallback): void;
|
|
62
|
+
/**
|
|
63
|
+
* Obtain debug override functions that allows plugins
|
|
64
|
+
* to manipulate the outcome of the flags managed by
|
|
65
|
+
* this manager
|
|
66
|
+
*
|
|
67
|
+
* @experimental This function is experimental and intended for use by LaunchDarkly tools at this time.
|
|
68
|
+
*/
|
|
69
|
+
getDebugOverride?(): LDDebugOverride;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Debug interface for plugins that need to override flag values during development.
|
|
73
|
+
* This interface provides methods to temporarily override flag values that take
|
|
74
|
+
* precedence over the actual flag values from LaunchDarkly. These overrides are
|
|
75
|
+
* useful for testing, development, and debugging scenarios.
|
|
76
|
+
*
|
|
77
|
+
* @experimental This interface is experimental and intended for use by LaunchDarkly tools at this time.
|
|
78
|
+
* The API may change in future versions.
|
|
79
|
+
*/
|
|
80
|
+
export interface LDDebugOverride {
|
|
81
|
+
/**
|
|
82
|
+
* Set an override value for a flag that takes precedence over the real flag value.
|
|
83
|
+
*
|
|
84
|
+
* @param flagKey The flag key.
|
|
85
|
+
* @param value The override value.
|
|
86
|
+
*/
|
|
87
|
+
setOverride(flagKey: string, value: LDFlagValue): void;
|
|
88
|
+
/**
|
|
89
|
+
* Remove an override value for a flag, reverting to the real flag value.
|
|
90
|
+
*
|
|
91
|
+
* @param flagKey The flag key.
|
|
92
|
+
*/
|
|
93
|
+
removeOverride(flagKey: string): void;
|
|
94
|
+
/**
|
|
95
|
+
* Clear all override values, reverting all flags to their real values.
|
|
96
|
+
*/
|
|
97
|
+
clearAllOverrides(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Get all currently active flag overrides.
|
|
100
|
+
*
|
|
101
|
+
* @returns
|
|
102
|
+
* An object containing all active overrides as key-value pairs,
|
|
103
|
+
* where keys are flag keys and values are the overridden flag values.
|
|
104
|
+
* Returns an empty object if no overrides are active.
|
|
105
|
+
*/
|
|
106
|
+
getAllOverrides(): {
|
|
107
|
+
[key: string]: ItemDescriptor;
|
|
108
|
+
};
|
|
52
109
|
}
|
|
53
110
|
export default class DefaultFlagManager implements FlagManager {
|
|
54
111
|
private _flagStore;
|
|
55
112
|
private _flagUpdater;
|
|
56
113
|
private _flagPersistencePromise;
|
|
114
|
+
private _overrides?;
|
|
57
115
|
/**
|
|
58
116
|
* @param platform implementation of various platform provided functionality
|
|
59
117
|
* @param sdkKey that will be used to distinguish different environments
|
|
@@ -67,6 +125,9 @@ export default class DefaultFlagManager implements FlagManager {
|
|
|
67
125
|
getAll(): {
|
|
68
126
|
[key: string]: ItemDescriptor;
|
|
69
127
|
};
|
|
128
|
+
presetFlags(newFlags: {
|
|
129
|
+
[key: string]: ItemDescriptor;
|
|
130
|
+
}): void;
|
|
70
131
|
setBootstrap(context: Context, newFlags: {
|
|
71
132
|
[key: string]: ItemDescriptor;
|
|
72
133
|
}): void;
|
|
@@ -77,5 +138,13 @@ export default class DefaultFlagManager implements FlagManager {
|
|
|
77
138
|
loadCached(context: Context): Promise<boolean>;
|
|
78
139
|
on(callback: FlagsChangeCallback): void;
|
|
79
140
|
off(callback: FlagsChangeCallback): void;
|
|
141
|
+
private _convertValueToOverrideDescripter;
|
|
142
|
+
setOverride(key: string, value: LDFlagValue): void;
|
|
143
|
+
removeOverride(flagKey: string): void;
|
|
144
|
+
clearAllOverrides(): void;
|
|
145
|
+
getAllOverrides(): {
|
|
146
|
+
[key: string]: ItemDescriptor;
|
|
147
|
+
};
|
|
148
|
+
getDebugOverride(): LDDebugOverride;
|
|
80
149
|
}
|
|
81
150
|
//# sourceMappingURL=FlagManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlagManager.d.ts","sourceRoot":"","sources":["../../src/flag-manager/FlagManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"FlagManager.d.ts","sourceRoot":"","sources":["../../src/flag-manager/FlagManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAKvF,OAA0B,EAAE,mBAAmB,EAAe,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;IAE7C;;OAEG;IACH,MAAM,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,CAAC;IAE5C;;;OAGG;IACH,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnF;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE9E;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE/C;;;;;;OAMG;IACH,WAAW,CAAC,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,G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,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,GAAG,IAAI;IAI9D,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,GAAG,IAAI;IAM3E,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlF,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAI7E,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAIpD,EAAE,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI;IAIvC,GAAG,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI;IAIxC,OAAO,CAAC,iCAAiC;IAUzC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW;IAQ3C,cAAc,CAAC,OAAO,EAAE,MAAM;IAe9B,iBAAiB;IAQjB,eAAe;;;IAWf,gBAAgB,IAAI,eAAe;CAQpC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, LDLogger, Platform } from '@launchdarkly/js-sdk-common';
|
|
2
2
|
import FlagStore from './FlagStore';
|
|
3
|
-
import FlagUpdater from './FlagUpdater';
|
|
3
|
+
import { FlagUpdater } from './FlagUpdater';
|
|
4
4
|
import { ItemDescriptor } from './ItemDescriptor';
|
|
5
5
|
/**
|
|
6
6
|
* This class handles persisting and loading flag values from a persistent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlagPersistence.d.ts","sourceRoot":"","sources":["../../src/flag-manager/FlagPersistence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OA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M,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAQnF;;;OAGG;IACG,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;YA4CtC,UAAU;YAqBV,WAAW;CA4B1B"}
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import { ItemDescriptor } from './ItemDescriptor';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* FlagStore used to store flag data in memory.
|
|
4
4
|
*/
|
|
5
5
|
export default interface FlagStore {
|
|
6
|
+
/**
|
|
7
|
+
* Initializes the flag store with the given flags.
|
|
8
|
+
*/
|
|
6
9
|
init(newFlags: {
|
|
7
10
|
[key: string]: ItemDescriptor;
|
|
8
11
|
}): void;
|
|
12
|
+
/**
|
|
13
|
+
* Inserts or updates the flag with the given key and update.
|
|
14
|
+
*/
|
|
9
15
|
insertOrUpdate(key: string, update: ItemDescriptor): void;
|
|
16
|
+
/**
|
|
17
|
+
* Gets the flag with the given key.
|
|
18
|
+
*/
|
|
10
19
|
get(key: string): ItemDescriptor | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Gets all the flags in the flag store.
|
|
22
|
+
*/
|
|
11
23
|
getAll(): {
|
|
12
24
|
[key: string]: ItemDescriptor;
|
|
13
25
|
};
|
|
14
26
|
}
|
|
15
27
|
/**
|
|
16
|
-
*
|
|
28
|
+
* Creates the default implementation of the flag store.
|
|
17
29
|
*/
|
|
18
|
-
export declare
|
|
19
|
-
private _flags;
|
|
20
|
-
init(newFlags: {
|
|
21
|
-
[key: string]: ItemDescriptor;
|
|
22
|
-
}): void;
|
|
23
|
-
insertOrUpdate(key: string, update: ItemDescriptor): void;
|
|
24
|
-
get(key: string): ItemDescriptor | undefined;
|
|
25
|
-
getAll(): {
|
|
26
|
-
[key: string]: ItemDescriptor;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
30
|
+
export declare function createDefaultFlagStore(): FlagStore;
|
|
29
31
|
//# sourceMappingURL=FlagStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlagStore.d.ts","sourceRoot":"","sources":["../../src/flag-manager/FlagStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,OAAO,WAAW,SAAS;IAChC,IAAI,CAAC,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,GAAG,IAAI,CAAC;IACxD,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC1D,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;IAC7C,MAAM,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,CAAC;CAC7C;AAED;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"FlagStore.d.ts","sourceRoot":"","sources":["../../src/flag-manager/FlagStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,OAAO,WAAW,SAAS;IAChC;;OAEG;IACH,IAAI,CAAC,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,GAAG,IAAI,CAAC;IACxD;;OAEG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC1D;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;IAC7C;;OAEG;IACH,MAAM,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,CAAC;CAC7C;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,SAAS,CAyBlD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context, LDLogger } from '@launchdarkly/js-sdk-common';
|
|
2
2
|
import FlagStore from './FlagStore';
|
|
3
3
|
import { ItemDescriptor } from './ItemDescriptor';
|
|
4
|
-
export type FlagChangeType = 'init' | 'patch';
|
|
4
|
+
export type FlagChangeType = 'init' | 'patch' | 'override';
|
|
5
5
|
/**
|
|
6
6
|
* This callback indicates that the details associated with one or more flags
|
|
7
7
|
* have changed.
|
|
@@ -21,20 +21,48 @@ export type FlagsChangeCallback = (context: Context, flagKeys: Array<string>, ty
|
|
|
21
21
|
* It handles versions checking to handle out of order flag updates and
|
|
22
22
|
* also handles flag comparisons for change notification.
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
export interface FlagUpdater {
|
|
25
|
+
/**
|
|
26
|
+
* Handles the flag changes by calling the change callbacks.
|
|
27
|
+
*
|
|
28
|
+
* @param keys keys of the flags that changed
|
|
29
|
+
* @param type type of change that occurred see {@link FlagChangeType}
|
|
30
|
+
*/
|
|
31
|
+
handleFlagChanges(keys: string[], type: FlagChangeType): void;
|
|
32
|
+
/**
|
|
33
|
+
* Initializes the flag updater with the given context and flags.
|
|
34
|
+
* This will be called every time a new context is identified.
|
|
35
|
+
*
|
|
36
|
+
* @param context the context to initialize the flag updater with
|
|
37
|
+
* @param newFlags the flags to initialize the flag updater with
|
|
38
|
+
*/
|
|
30
39
|
init(context: Context, newFlags: {
|
|
31
40
|
[key: string]: ItemDescriptor;
|
|
32
41
|
}): void;
|
|
33
42
|
initCached(context: Context, newFlags: {
|
|
34
43
|
[key: string]: ItemDescriptor;
|
|
35
44
|
}): void;
|
|
45
|
+
/**
|
|
46
|
+
* Upserts the flag with the given key and item.
|
|
47
|
+
*
|
|
48
|
+
* @param context the context to upsert the flag with
|
|
49
|
+
* @param key the key of the flag to upsert
|
|
50
|
+
* @param item the item to upsert the flag with
|
|
51
|
+
* @returns true if the flag was upserted, false otherwise
|
|
52
|
+
*/
|
|
36
53
|
upsert(context: Context, key: string, item: ItemDescriptor): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Registers a callback to be called when the flags change.
|
|
56
|
+
*
|
|
57
|
+
* @param callback the callback to register
|
|
58
|
+
*/
|
|
37
59
|
on(callback: FlagsChangeCallback): void;
|
|
60
|
+
/**
|
|
61
|
+
* Unregisters a callback to be called when the flags change.
|
|
62
|
+
*
|
|
63
|
+
* @param callback the callback to unregister
|
|
64
|
+
*/
|
|
38
65
|
off(callback: FlagsChangeCallback): void;
|
|
39
66
|
}
|
|
67
|
+
export default function createFlagUpdater(_flagStore: FlagStore, _logger: LDLogger): FlagUpdater;
|
|
40
68
|
//# sourceMappingURL=FlagUpdater.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlagUpdater.d.ts","sourceRoot":"","sources":["../../src/flag-manager/FlagUpdater.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FlagUpdater.d.ts","sourceRoot":"","sources":["../../src/flag-manager/FlagUpdater.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;AAE3D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,EACvB,IAAI,EAAE,cAAc,KACjB,IAAI,CAAC;AAEV;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IAE9D;;;;;;OAMG;IACH,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,GAAG,IAAI,CAAC;IAE1E,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,GAAG,IAAI,CAAC;IAEhF;;;;;;;OAOG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC;IAErE;;;;OAIG;IACH,EAAE,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAExC;;;;OAIG;IACH,GAAG,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC1C;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GAAG,WAAW,CAoE/F"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -6,9 +6,10 @@ import LDClientImpl from './LDClientImpl';
|
|
|
6
6
|
import LDEmitter, { EventName } from './LDEmitter';
|
|
7
7
|
export * from '@launchdarkly/js-sdk-common';
|
|
8
8
|
export * as platform from '@launchdarkly/js-sdk-common';
|
|
9
|
-
export type { LDEvaluationDetail, LDEvaluationDetailTyped, LDClient, LDOptions, ConnectionMode, LDIdentifyOptions, Hook, HookMetadata, EvaluationSeriesContext, EvaluationSeriesData, IdentifySeriesContext, IdentifySeriesData, IdentifySeriesResult, IdentifySeriesStatus, TrackSeriesContext, LDInspection, LDIdentifyResult, LDIdentifySuccess, LDIdentifyError, LDIdentifyTimeout, LDIdentifyShed, LDClientIdentifyResult, } from './api';
|
|
9
|
+
export type { LDEvaluationDetail, LDEvaluationDetailTyped, LDClient, LDOptions, ConnectionMode, LDIdentifyOptions, Hook, HookMetadata, EvaluationSeriesContext, EvaluationSeriesData, IdentifySeriesContext, IdentifySeriesData, IdentifySeriesResult, IdentifySeriesStatus, TrackSeriesContext, LDInspection, LDIdentifyResult, LDIdentifySuccess, LDIdentifyError, LDIdentifyTimeout, LDIdentifyShed, LDClientIdentifyResult, LDPluginBase, LDWaitForInitializationOptions, LDWaitForInitializationResult, LDWaitForInitializationComplete, LDWaitForInitializationFailed, LDWaitForInitializationTimeout, } from './api';
|
|
10
10
|
export type { DataManager, DataManagerFactory, ConnectionParams } from './DataManager';
|
|
11
|
-
export type { FlagManager } from './flag-manager/FlagManager';
|
|
11
|
+
export type { FlagManager, LDDebugOverride } from './flag-manager/FlagManager';
|
|
12
|
+
export { safeRegisterDebugOverridePlugins } from './plugins/safeRegisterDebugOverridePlugins';
|
|
12
13
|
export type { Configuration } from './configuration/Configuration';
|
|
13
14
|
export type { LDEmitter };
|
|
14
15
|
export type { ItemDescriptor } from './flag-manager/ItemDescriptor';
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,gBAAgB,EAAE,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,yBAAyB,MAAM,wCAAwC,CAAC;AAC/E,OAAO,SAAS,EAAE,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAA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