@launchdarkly/js-client-sdk-common 1.17.2 → 1.18.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 +7 -0
- package/dist/cjs/DataManager.d.ts +2 -2
- package/dist/cjs/DataManager.d.ts.map +1 -1
- package/dist/cjs/datasource/DataSourceEventHandler.d.ts +4 -6
- package/dist/cjs/datasource/DataSourceEventHandler.d.ts.map +1 -1
- package/dist/cjs/datasource/DataSourceStatus.d.ts +64 -14
- package/dist/cjs/datasource/DataSourceStatus.d.ts.map +1 -1
- package/dist/cjs/datasource/DataSourceStatusManager.d.ts +6 -17
- package/dist/cjs/datasource/DataSourceStatusManager.d.ts.map +1 -1
- package/dist/cjs/datasource/Requestor.d.ts +2 -9
- package/dist/cjs/datasource/Requestor.d.ts.map +1 -1
- package/dist/cjs/flag-manager/bootstrap.d.ts +6 -0
- package/dist/cjs/flag-manager/bootstrap.d.ts.map +1 -0
- package/dist/cjs/index.cjs +156 -150
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/streaming/StreamingProcessor.d.ts +1 -1
- package/dist/cjs/streaming/StreamingProcessor.d.ts.map +1 -1
- package/dist/esm/DataManager.d.ts +2 -2
- package/dist/esm/DataManager.d.ts.map +1 -1
- package/dist/esm/datasource/DataSourceEventHandler.d.ts +4 -6
- package/dist/esm/datasource/DataSourceEventHandler.d.ts.map +1 -1
- package/dist/esm/datasource/DataSourceStatus.d.ts +64 -14
- package/dist/esm/datasource/DataSourceStatus.d.ts.map +1 -1
- package/dist/esm/datasource/DataSourceStatusManager.d.ts +6 -17
- package/dist/esm/datasource/DataSourceStatusManager.d.ts.map +1 -1
- package/dist/esm/datasource/Requestor.d.ts +2 -9
- package/dist/esm/datasource/Requestor.d.ts.map +1 -1
- package/dist/esm/flag-manager/bootstrap.d.ts +6 -0
- package/dist/esm/flag-manager/bootstrap.d.ts.map +1 -0
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.mjs +155 -150
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/streaming/StreamingProcessor.d.ts +1 -1
- package/dist/esm/streaming/StreamingProcessor.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.18.0](https://github.com/launchdarkly/js-core/compare/js-client-sdk-common-v1.17.2...js-client-sdk-common-v1.18.0) (2026-02-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* adding the implementation for main process client ([#1103](https://github.com/launchdarkly/js-core/issues/1103)) ([0abb86c](https://github.com/launchdarkly/js-core/commit/0abb86c6f6ed95a644e671ce967c4be5fd2ad9d4))
|
|
9
|
+
|
|
3
10
|
## [1.17.2](https://github.com/launchdarkly/js-core/compare/js-client-sdk-common-v1.17.1...js-client-sdk-common-v1.17.2) (2026-01-21)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Context, EventName, internal, LDContext, LDHeaders, LDLogger, Platform, ProcessStreamResponse, subsystem } from '@launchdarkly/js-sdk-common';
|
|
2
2
|
import { LDIdentifyOptions } from './api/LDIdentifyOptions';
|
|
3
3
|
import { Configuration } from './configuration/Configuration';
|
|
4
|
-
import DataSourceStatusManager from './datasource/DataSourceStatusManager';
|
|
5
|
-
import Requestor from './datasource/Requestor';
|
|
4
|
+
import { DataSourceStatusManager } from './datasource/DataSourceStatusManager';
|
|
5
|
+
import { Requestor } from './datasource/Requestor';
|
|
6
6
|
import { FlagManager } from './flag-manager/FlagManager';
|
|
7
7
|
import LDEmitter from './LDEmitter';
|
|
8
8
|
import { DataSourcePaths } from './streaming';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataManager.d.ts","sourceRoot":"","sources":["../src/DataManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,qBAAqB,EACrB,SAAS,EACV,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"DataManager.d.ts","sourceRoot":"","sources":["../src/DataManager.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { Context, LDLogger, LDPollingError, LDStreamingError } from '@launchdarkly/js-sdk-common';
|
|
2
2
|
import { FlagManager } from '../flag-manager/FlagManager';
|
|
3
3
|
import { DeleteFlag, Flags, PatchFlag } from '../types';
|
|
4
|
-
import DataSourceStatusManager from './DataSourceStatusManager';
|
|
5
|
-
export
|
|
6
|
-
private readonly _flagManager;
|
|
7
|
-
private readonly _statusManager;
|
|
8
|
-
private readonly _logger;
|
|
9
|
-
constructor(_flagManager: FlagManager, _statusManager: DataSourceStatusManager, _logger: LDLogger);
|
|
4
|
+
import { DataSourceStatusManager } from './DataSourceStatusManager';
|
|
5
|
+
export interface DataSourceEventHandler {
|
|
10
6
|
handlePut(context: Context, flags: Flags): Promise<void>;
|
|
11
7
|
handlePatch(context: Context, patchFlag: PatchFlag): Promise<void>;
|
|
12
8
|
handleDelete(context: Context, deleteFlag: DeleteFlag): Promise<void>;
|
|
13
9
|
handleStreamingError(error: LDStreamingError): void;
|
|
14
10
|
handlePollingError(error: LDPollingError): void;
|
|
15
11
|
}
|
|
12
|
+
export declare function createDataSourceEventHandler(flagManager: FlagManager, statusManager: DataSourceStatusManager, logger: LDLogger): DataSourceEventHandler;
|
|
13
|
+
export default DataSourceEventHandler;
|
|
16
14
|
//# sourceMappingURL=DataSourceEventHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataSourceEventHandler.d.ts","sourceRoot":"","sources":["../../src/datasource/DataSourceEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAElG,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"DataSourceEventHandler.d.ts","sourceRoot":"","sources":["../../src/datasource/DataSourceEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAElG,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACpD,kBAAkB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;CACjD;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,uBAAuB,EACtC,MAAM,EAAE,QAAQ,GACf,sBAAsB,CAmDxB;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,11 +1,54 @@
|
|
|
1
1
|
import DataSourceStatusErrorInfo from './DataSourceStatusErrorInfo';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
2
|
+
/**
|
|
3
|
+
* The initial state of the data source when the SDK is being
|
|
4
|
+
* initialized.
|
|
5
|
+
*
|
|
6
|
+
* If it encounters an error that requires it to retry initialization,
|
|
7
|
+
* the state will remain at Initializing until it either succeeds and
|
|
8
|
+
* becomes {@link DataSourceValidState}, or permanently fails and becomes
|
|
9
|
+
* {@link DataSourceClosedState}.
|
|
10
|
+
*/
|
|
11
|
+
export type DataSourceInitializingState = 'INITIALIZING';
|
|
12
|
+
/**
|
|
13
|
+
* Indicates that the data source is currently operational and has not
|
|
14
|
+
* had any problems since the last time it recieved data.
|
|
15
|
+
*
|
|
16
|
+
* In streaming mode, this means that there is currently an open stream
|
|
17
|
+
* connection and that at least one initial message has been recieved on
|
|
18
|
+
* the stream. In polling mode, this means that the last poll request
|
|
19
|
+
* succeeded.
|
|
20
|
+
*/
|
|
21
|
+
export type DataSourceValidState = 'VALID';
|
|
22
|
+
/**
|
|
23
|
+
* Indicates that the data source encountered an error that it will
|
|
24
|
+
* attempt to recover from.
|
|
25
|
+
*
|
|
26
|
+
* In streaming mode, this means that the stream connection failed, or
|
|
27
|
+
* had to be dropped due to some other error, and will be retried after
|
|
28
|
+
* a backoff delay. In polling mode, it means that the last poll request
|
|
29
|
+
* failed, and a new poll request will be made after the configured
|
|
30
|
+
* polling interval.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Currently, support for this state is unreliable in the client-side SDKs
|
|
34
|
+
* due to limitations with default EventSource implementations. We do not
|
|
35
|
+
* recommend solely relying on this state for your application logic.
|
|
36
|
+
*/
|
|
37
|
+
export type DataSourceInterruptedState = 'INTERRUPTED';
|
|
38
|
+
/**
|
|
39
|
+
* Indicates that the application has told the SDK to stay offline.
|
|
40
|
+
*/
|
|
41
|
+
export type DataSourceSetOfflineState = 'SET_OFFLINE';
|
|
42
|
+
/**
|
|
43
|
+
* Indicates that the data source has been permanently closed.
|
|
44
|
+
*
|
|
45
|
+
* This could be because it encountered an unrecoverable error (for
|
|
46
|
+
* instance, the LaunchDarkly service rejected the client key; an invalid
|
|
47
|
+
* client key will never become valid), or because the SDK client was
|
|
48
|
+
* explicitly shut down.
|
|
49
|
+
*/
|
|
50
|
+
export type DataSourceClosedState = 'CLOSED';
|
|
51
|
+
export type DataSourceState = DataSourceInitializingState | DataSourceValidState | DataSourceInterruptedState | DataSourceSetOfflineState | DataSourceClosedState;
|
|
9
52
|
export default interface DataSourceStatus {
|
|
10
53
|
/**
|
|
11
54
|
* An enumerated value representing the overall current state of the data source.
|
|
@@ -15,19 +58,19 @@ export default interface DataSourceStatus {
|
|
|
15
58
|
* The UNIX epoch timestamp in milliseconds that the value of State most recently changed.
|
|
16
59
|
*
|
|
17
60
|
* The meaning of this depends on the current state:
|
|
18
|
-
* For
|
|
61
|
+
* For 'INITIALIZING', it is the time that the datasource started
|
|
19
62
|
* attempting to retrieve data.
|
|
20
63
|
*
|
|
21
|
-
* For
|
|
64
|
+
* For 'VALID', it is the time that the data source most
|
|
22
65
|
* recently entered a valid state, after previously having been
|
|
23
|
-
*
|
|
24
|
-
*
|
|
66
|
+
* 'INITIALIZING' or an invalid state such as
|
|
67
|
+
* 'INTERRUPTED'.
|
|
25
68
|
*
|
|
26
|
-
* - For
|
|
69
|
+
* - For 'INTERRUPTED', it is the time that the data source
|
|
27
70
|
* most recently entered an error state, after previously having been
|
|
28
|
-
*
|
|
71
|
+
* 'VALID'.
|
|
29
72
|
*
|
|
30
|
-
* For
|
|
73
|
+
* For 'CLOSED', it is the time that the data source
|
|
31
74
|
* encountered an unrecoverable error or that the datasource was explicitly closed.
|
|
32
75
|
*/
|
|
33
76
|
readonly stateSince: number;
|
|
@@ -36,4 +79,11 @@ export default interface DataSourceStatus {
|
|
|
36
79
|
*/
|
|
37
80
|
readonly lastError?: DataSourceStatusErrorInfo;
|
|
38
81
|
}
|
|
82
|
+
export declare const DataSourceState: {
|
|
83
|
+
readonly Initializing: 'INITIALIZING';
|
|
84
|
+
readonly Valid: 'VALID';
|
|
85
|
+
readonly Interrupted: 'INTERRUPTED';
|
|
86
|
+
readonly SetOffline: 'SET_OFFLINE';
|
|
87
|
+
readonly Closed: 'CLOSED';
|
|
88
|
+
};
|
|
39
89
|
//# sourceMappingURL=DataSourceStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataSourceStatus.d.ts","sourceRoot":"","sources":["../../src/datasource/DataSourceStatus.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"DataSourceStatus.d.ts","sourceRoot":"","sources":["../../src/datasource/DataSourceStatus.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AAIpE;;;;;;;;GAQG;AACH,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC;AAEzD;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC;AAE3C;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,0BAA0B,GAAG,aAAa,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,aAAa,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;AAE7C,MAAM,MAAM,eAAe,GACvB,2BAA2B,GAC3B,oBAAoB,GACpB,0BAA0B,GAC1B,yBAAyB,GACzB,qBAAqB,CAAC;AAE1B,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACvC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAEhC;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,yBAAyB,CAAC;CAChD;AAKD,eAAO,MAAM,eAAe,EAAE;IAC5B,QAAQ,CAAC,YAAY,EAAE,cAAc,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAO3B,CAAC"}
|
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
import { DataSourceErrorKind } from '@launchdarkly/js-sdk-common';
|
|
2
2
|
import LDEmitter from '../LDEmitter';
|
|
3
|
-
import DataSourceStatus, { DataSourceState } from './DataSourceStatus';
|
|
3
|
+
import DataSourceStatus, { type DataSourceState } from './DataSourceStatus';
|
|
4
4
|
/**
|
|
5
5
|
* Tracks the current data source status and emits updates when the status changes.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
private _state;
|
|
10
|
-
private _stateSinceMillis;
|
|
11
|
-
private _errorInfo?;
|
|
12
|
-
private _timeStamper;
|
|
13
|
-
constructor(_emitter: LDEmitter, timeStamper?: () => number);
|
|
14
|
-
get status(): DataSourceStatus;
|
|
7
|
+
export interface DataSourceStatusManager {
|
|
8
|
+
readonly status: DataSourceStatus;
|
|
15
9
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @param requestedState to track
|
|
19
|
-
* @param isError to indicate that the state update is a result of an error occurring.
|
|
20
|
-
*/
|
|
21
|
-
private _updateState;
|
|
22
|
-
/**
|
|
23
|
-
* Requests the manager move to the provided state. This request may be ignored
|
|
10
|
+
* Requests the manager move to the provided state. This request may be ignored
|
|
24
11
|
* if the current state cannot transition to the requested state.
|
|
25
12
|
* @param state that is requested
|
|
26
13
|
*/
|
|
@@ -37,4 +24,6 @@ export default class DataSourceStatusManager {
|
|
|
37
24
|
*/
|
|
38
25
|
reportError(kind: DataSourceErrorKind, message: string, statusCode?: number, recoverable?: boolean): void;
|
|
39
26
|
}
|
|
27
|
+
export declare function createDataSourceStatusManager(emitter: LDEmitter, timeStamper?: () => number): DataSourceStatusManager;
|
|
28
|
+
export default DataSourceStatusManager;
|
|
40
29
|
//# sourceMappingURL=DataSourceStatusManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataSourceStatusManager.d.ts","sourceRoot":"","sources":["../../src/datasource/DataSourceStatusManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,gBAAgB,EAAE,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"DataSourceStatusManager.d.ts","sourceRoot":"","sources":["../../src/datasource/DataSourceStatusManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,gBAAgB,EAAE,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG5E;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAElC;;;;OAIG;IACH,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAEjD;;;;;;;;;OASG;IACH,WAAW,CACT,IAAI,EAAE,mBAAmB,EACzB,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,OAAO,GACpB,IAAI,CAAC;CAIT;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,SAAS,EAClB,WAAW,GAAE,MAAM,MAAyB,GAC3C,uBAAuB,CA2DzB;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -8,19 +8,12 @@ export declare class LDRequestError extends Error implements HttpErrorResponse {
|
|
|
8
8
|
* Note: The requestor is implemented independently from polling such that it can be used to
|
|
9
9
|
* make a one-off request.
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
12
|
-
private _requests;
|
|
13
|
-
private readonly _uri;
|
|
14
|
-
private readonly _headers;
|
|
15
|
-
private readonly _method;
|
|
16
|
-
private readonly _body?;
|
|
17
|
-
constructor(_requests: Requests, _uri: string, _headers: {
|
|
18
|
-
[key: string]: string;
|
|
19
|
-
}, _method: string, _body?: string | undefined);
|
|
11
|
+
export interface Requestor {
|
|
20
12
|
requestPayload(): Promise<string>;
|
|
21
13
|
}
|
|
22
14
|
export declare function makeRequestor(plainContextString: string, serviceEndpoints: ServiceEndpoints, paths: DataSourcePaths, requests: Requests, encoding: Encoding, baseHeaders?: LDHeaders, baseQueryParams?: {
|
|
23
15
|
key: string;
|
|
24
16
|
value: string;
|
|
25
17
|
}[], withReasons?: boolean, useReport?: boolean, secureModeHash?: string): Requestor;
|
|
18
|
+
export default Requestor;
|
|
26
19
|
//# sourceMappingURL=Requestor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Requestor.d.ts","sourceRoot":"","sources":["../../src/datasource/Requestor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Requestor.d.ts","sourceRoot":"","sources":["../../src/datasource/Requestor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAMrD,qBAAa,cAAe,SAAQ,KAAM,YAAW,iBAAiB;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEX,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAK7C;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACnC;AAED,wBAAgB,aAAa,CAC3B,kBAAkB,EAAE,MAAM,EAC1B,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,eAAe,EACtB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,WAAW,CAAC,EAAE,SAAS,EACvB,eAAe,CAAC,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,EAClD,WAAW,CAAC,EAAE,OAAO,EACrB,SAAS,CAAC,EAAE,OAAO,EACnB,cAAc,CAAC,EAAE,MAAM,GACtB,SAAS,CA6CX;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/flag-manager/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,QAAQ,EAChB,IAAI,EAAE,GAAG,GACR;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;CAAE,CAyCnC"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -21,18 +21,17 @@ function _interopNamespaceDefault(e) {
|
|
|
21
21
|
|
|
22
22
|
var jsSdkCommon__namespace = /*#__PURE__*/_interopNamespaceDefault(jsSdkCommon);
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
24
|
+
// This is a temporary compat for react native. We should remove this once we
|
|
25
|
+
// major version react native SDK.
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
27
|
+
const DataSourceState = {
|
|
28
|
+
Initializing: 'INITIALIZING',
|
|
29
|
+
Valid: 'VALID',
|
|
30
|
+
Interrupted: 'INTERRUPTED',
|
|
31
|
+
SetOffline: 'SET_OFFLINE',
|
|
32
|
+
Closed: 'CLOSED',
|
|
33
|
+
};
|
|
34
34
|
|
|
35
|
-
// eslint-disable-next-line max-classes-per-file
|
|
36
35
|
function isOk(status) {
|
|
37
36
|
return status >= 200 && status <= 299;
|
|
38
37
|
}
|
|
@@ -43,38 +42,6 @@ class LDRequestError extends Error {
|
|
|
43
42
|
this.name = 'LaunchDarklyRequestError';
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Note: The requestor is implemented independently from polling such that it can be used to
|
|
48
|
-
* make a one-off request.
|
|
49
|
-
*/
|
|
50
|
-
class Requestor {
|
|
51
|
-
constructor(_requests, _uri, _headers, _method, _body) {
|
|
52
|
-
this._requests = _requests;
|
|
53
|
-
this._uri = _uri;
|
|
54
|
-
this._headers = _headers;
|
|
55
|
-
this._method = _method;
|
|
56
|
-
this._body = _body;
|
|
57
|
-
}
|
|
58
|
-
async requestPayload() {
|
|
59
|
-
let status;
|
|
60
|
-
try {
|
|
61
|
-
const res = await this._requests.fetch(this._uri, {
|
|
62
|
-
method: this._method,
|
|
63
|
-
headers: this._headers,
|
|
64
|
-
body: this._body,
|
|
65
|
-
});
|
|
66
|
-
if (isOk(res.status)) {
|
|
67
|
-
return await res.text();
|
|
68
|
-
}
|
|
69
|
-
// Assigning so it can be thrown after the try/catch.
|
|
70
|
-
status = res.status;
|
|
71
|
-
}
|
|
72
|
-
catch (err) {
|
|
73
|
-
throw new LDRequestError(err?.message);
|
|
74
|
-
}
|
|
75
|
-
throw new LDRequestError(`Unexpected status code: ${status}`, status);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
45
|
function makeRequestor(plainContextString, serviceEndpoints, paths, requests, encoding, baseHeaders, baseQueryParams, withReasons, useReport, secureModeHash) {
|
|
79
46
|
let body;
|
|
80
47
|
let method = 'GET';
|
|
@@ -95,7 +62,27 @@ function makeRequestor(plainContextString, serviceEndpoints, paths, requests, en
|
|
|
95
62
|
parameters.push({ key: 'h', value: secureModeHash });
|
|
96
63
|
}
|
|
97
64
|
const uri = jsSdkCommon.getPollingUri(serviceEndpoints, path, parameters);
|
|
98
|
-
return
|
|
65
|
+
return {
|
|
66
|
+
async requestPayload() {
|
|
67
|
+
let status;
|
|
68
|
+
try {
|
|
69
|
+
const res = await requests.fetch(uri, {
|
|
70
|
+
method,
|
|
71
|
+
headers,
|
|
72
|
+
body,
|
|
73
|
+
});
|
|
74
|
+
if (isOk(res.status)) {
|
|
75
|
+
return await res.text();
|
|
76
|
+
}
|
|
77
|
+
// Assigning so it can be thrown after the try/catch.
|
|
78
|
+
status = res.status;
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
throw new LDRequestError(err?.message);
|
|
82
|
+
}
|
|
83
|
+
throw new LDRequestError(`Unexpected status code: ${status}`, status);
|
|
84
|
+
},
|
|
85
|
+
};
|
|
99
86
|
}
|
|
100
87
|
|
|
101
88
|
const duplicateExecutionError = new Error('Task has already been executed or shed. This is likely an implementation error. The task will not be executed again.');
|
|
@@ -1949,117 +1936,135 @@ function safeRegisterDebugOverridePlugins(logger, debugOverride, plugins) {
|
|
|
1949
1936
|
});
|
|
1950
1937
|
}
|
|
1951
1938
|
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
}
|
|
1991
|
-
handleStreamingError(error) {
|
|
1992
|
-
this._statusManager.reportError(error.kind, error.message, error.code, error.recoverable);
|
|
1993
|
-
}
|
|
1994
|
-
handlePollingError(error) {
|
|
1995
|
-
this._statusManager.reportError(error.kind, error.message, error.status, error.recoverable);
|
|
1996
|
-
}
|
|
1939
|
+
function readFlagsFromBootstrap(logger, data) {
|
|
1940
|
+
// If the bootstrap data came from an older server-side SDK, we'll have just a map of keys to values.
|
|
1941
|
+
// Newer SDKs that have an allFlagsState method will provide an extra "$flagsState" key that contains
|
|
1942
|
+
// the rest of the metadata we want. We do it this way for backward compatibility with older JS SDKs.
|
|
1943
|
+
const keys = Object.keys(data);
|
|
1944
|
+
const metadataKey = '$flagsState';
|
|
1945
|
+
const validKey = '$valid';
|
|
1946
|
+
const metadata = data[metadataKey];
|
|
1947
|
+
if (!metadata && keys.length) {
|
|
1948
|
+
logger.warn('LaunchDarkly client was initialized with bootstrap data that did not include flag' +
|
|
1949
|
+
' metadata. Events may not be sent correctly.');
|
|
1950
|
+
}
|
|
1951
|
+
if (data[validKey] === false) {
|
|
1952
|
+
logger.warn('LaunchDarkly bootstrap data is not available because the back end could not read the flags.');
|
|
1953
|
+
}
|
|
1954
|
+
const ret = {};
|
|
1955
|
+
keys.forEach((key) => {
|
|
1956
|
+
if (key !== metadataKey && key !== validKey) {
|
|
1957
|
+
let flag;
|
|
1958
|
+
if (metadata && metadata[key]) {
|
|
1959
|
+
flag = {
|
|
1960
|
+
value: data[key],
|
|
1961
|
+
...metadata[key],
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
else {
|
|
1965
|
+
flag = {
|
|
1966
|
+
value: data[key],
|
|
1967
|
+
version: 0,
|
|
1968
|
+
};
|
|
1969
|
+
}
|
|
1970
|
+
ret[key] = {
|
|
1971
|
+
version: flag.version,
|
|
1972
|
+
flag,
|
|
1973
|
+
};
|
|
1974
|
+
}
|
|
1975
|
+
});
|
|
1976
|
+
return ret;
|
|
1997
1977
|
}
|
|
1998
1978
|
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
1979
|
+
function createDataSourceEventHandler(flagManager, statusManager, logger) {
|
|
1980
|
+
return {
|
|
1981
|
+
async handlePut(context, flags) {
|
|
1982
|
+
logger.debug(`Got PUT: ${Object.keys(flags)}`);
|
|
1983
|
+
// mapping flags to item descriptors
|
|
1984
|
+
const descriptors = Object.entries(flags).reduce((acc, [key, flag]) => {
|
|
1985
|
+
acc[key] = { version: flag.version, flag };
|
|
1986
|
+
return acc;
|
|
1987
|
+
}, {});
|
|
1988
|
+
await flagManager.init(context, descriptors);
|
|
1989
|
+
statusManager.requestStateUpdate('VALID');
|
|
1990
|
+
},
|
|
1991
|
+
async handlePatch(context, patchFlag) {
|
|
1992
|
+
logger.debug(`Got PATCH ${JSON.stringify(patchFlag, null, 2)}`);
|
|
1993
|
+
flagManager.upsert(context, patchFlag.key, {
|
|
1994
|
+
version: patchFlag.version,
|
|
1995
|
+
flag: patchFlag,
|
|
1996
|
+
});
|
|
1997
|
+
},
|
|
1998
|
+
async handleDelete(context, deleteFlag) {
|
|
1999
|
+
logger.debug(`Got DELETE ${JSON.stringify(deleteFlag, null, 2)}`);
|
|
2000
|
+
flagManager.upsert(context, deleteFlag.key, {
|
|
2001
|
+
version: deleteFlag.version,
|
|
2002
|
+
flag: {
|
|
2003
|
+
...deleteFlag,
|
|
2004
|
+
deleted: true,
|
|
2005
|
+
// props below are set to sensible defaults. they are irrelevant
|
|
2006
|
+
// because this flag has been deleted.
|
|
2007
|
+
flagVersion: 0,
|
|
2008
|
+
value: undefined,
|
|
2009
|
+
variation: 0,
|
|
2010
|
+
trackEvents: false,
|
|
2011
|
+
},
|
|
2012
|
+
});
|
|
2013
|
+
},
|
|
2014
|
+
handleStreamingError(error) {
|
|
2015
|
+
statusManager.reportError(error.kind, error.message, error.code, error.recoverable);
|
|
2016
|
+
},
|
|
2017
|
+
handlePollingError(error) {
|
|
2018
|
+
statusManager.reportError(error.kind, error.message, error.status, error.recoverable);
|
|
2019
|
+
},
|
|
2020
|
+
};
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
function createDataSourceStatusManager(emitter, timeStamper = () => Date.now()) {
|
|
2024
|
+
let state = 'CLOSED';
|
|
2025
|
+
let stateSinceMillis = timeStamper();
|
|
2026
|
+
let errorInfo;
|
|
2027
|
+
function getStatus() {
|
|
2010
2028
|
return {
|
|
2011
|
-
state
|
|
2012
|
-
stateSince:
|
|
2013
|
-
lastError:
|
|
2029
|
+
state,
|
|
2030
|
+
stateSince: stateSinceMillis,
|
|
2031
|
+
lastError: errorInfo,
|
|
2014
2032
|
};
|
|
2015
2033
|
}
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
* @param requestedState to track
|
|
2020
|
-
* @param isError to indicate that the state update is a result of an error occurring.
|
|
2021
|
-
*/
|
|
2022
|
-
_updateState(requestedState, isError = false) {
|
|
2023
|
-
const newState = requestedState === exports.DataSourceState.Interrupted && this._state === exports.DataSourceState.Initializing // don't go to interrupted from initializing (recoverable errors when initializing are not noteworthy)
|
|
2024
|
-
? exports.DataSourceState.Initializing
|
|
2034
|
+
function updateState(requestedState, isError = false) {
|
|
2035
|
+
const newState = requestedState === 'INTERRUPTED' && state === 'INITIALIZING' // don't go to interrupted from initializing (recoverable errors when initializing are not noteworthy)
|
|
2036
|
+
? 'INITIALIZING'
|
|
2025
2037
|
: requestedState;
|
|
2026
|
-
const changedState =
|
|
2038
|
+
const changedState = state !== newState;
|
|
2027
2039
|
if (changedState) {
|
|
2028
|
-
|
|
2029
|
-
|
|
2040
|
+
state = newState;
|
|
2041
|
+
stateSinceMillis = timeStamper();
|
|
2030
2042
|
}
|
|
2031
2043
|
if (changedState || isError) {
|
|
2032
|
-
|
|
2044
|
+
emitter.emit('dataSourceStatus', getStatus());
|
|
2033
2045
|
}
|
|
2034
2046
|
}
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
message,
|
|
2057
|
-
statusCode,
|
|
2058
|
-
time: this._timeStamper(),
|
|
2059
|
-
};
|
|
2060
|
-
this._errorInfo = errorInfo;
|
|
2061
|
-
this._updateState(recoverable ? exports.DataSourceState.Interrupted : exports.DataSourceState.Closed, true);
|
|
2062
|
-
}
|
|
2047
|
+
return {
|
|
2048
|
+
get status() {
|
|
2049
|
+
return getStatus();
|
|
2050
|
+
},
|
|
2051
|
+
requestStateUpdate(requestedState) {
|
|
2052
|
+
updateState(requestedState);
|
|
2053
|
+
},
|
|
2054
|
+
reportError(kind, message, statusCode, recoverable = false) {
|
|
2055
|
+
errorInfo = {
|
|
2056
|
+
kind,
|
|
2057
|
+
message,
|
|
2058
|
+
statusCode,
|
|
2059
|
+
time: timeStamper(),
|
|
2060
|
+
};
|
|
2061
|
+
updateState(recoverable ? 'INTERRUPTED' : 'CLOSED', true);
|
|
2062
|
+
},
|
|
2063
|
+
// TODO: SDK-702 - Implement network availability behaviors
|
|
2064
|
+
// setNetworkUnavailable() {
|
|
2065
|
+
// updateState(DataSourceState.NetworkUnavailable);
|
|
2066
|
+
// },
|
|
2067
|
+
};
|
|
2063
2068
|
}
|
|
2064
2069
|
|
|
2065
2070
|
function reportClosed(logger) {
|
|
@@ -2341,8 +2346,8 @@ class BaseDataManager {
|
|
|
2341
2346
|
this.diagnosticsManager = diagnosticsManager;
|
|
2342
2347
|
this.closed = false;
|
|
2343
2348
|
this.logger = config.logger;
|
|
2344
|
-
this.dataSourceStatusManager =
|
|
2345
|
-
this._dataSourceEventHandler =
|
|
2349
|
+
this.dataSourceStatusManager = createDataSourceStatusManager(emitter);
|
|
2350
|
+
this._dataSourceEventHandler = createDataSourceEventHandler(flagManager, this.dataSourceStatusManager, this.config.logger);
|
|
2346
2351
|
}
|
|
2347
2352
|
/**
|
|
2348
2353
|
* Set additional connection parameters for requests polling/streaming.
|
|
@@ -2405,16 +2410,16 @@ class BaseDataManager {
|
|
|
2405
2410
|
return {
|
|
2406
2411
|
start: () => {
|
|
2407
2412
|
// update status before starting processor to ensure potential errors are reported after initializing
|
|
2408
|
-
statusManager.requestStateUpdate(
|
|
2413
|
+
statusManager.requestStateUpdate('INITIALIZING');
|
|
2409
2414
|
processor.start();
|
|
2410
2415
|
},
|
|
2411
2416
|
stop: () => {
|
|
2412
2417
|
processor.stop();
|
|
2413
|
-
statusManager.requestStateUpdate(
|
|
2418
|
+
statusManager.requestStateUpdate('CLOSED');
|
|
2414
2419
|
},
|
|
2415
2420
|
close: () => {
|
|
2416
2421
|
processor.close();
|
|
2417
|
-
statusManager.requestStateUpdate(
|
|
2422
|
+
statusManager.requestStateUpdate('CLOSED');
|
|
2418
2423
|
},
|
|
2419
2424
|
};
|
|
2420
2425
|
}
|
|
@@ -2426,9 +2431,10 @@ class BaseDataManager {
|
|
|
2426
2431
|
|
|
2427
2432
|
exports.platform = jsSdkCommon__namespace;
|
|
2428
2433
|
exports.BaseDataManager = BaseDataManager;
|
|
2434
|
+
exports.DataSourceState = DataSourceState;
|
|
2429
2435
|
exports.LDClientImpl = LDClientImpl;
|
|
2430
|
-
exports.Requestor = Requestor;
|
|
2431
2436
|
exports.makeRequestor = makeRequestor;
|
|
2437
|
+
exports.readFlagsFromBootstrap = readFlagsFromBootstrap;
|
|
2432
2438
|
exports.safeRegisterDebugOverridePlugins = safeRegisterDebugOverridePlugins;
|
|
2433
2439
|
Object.keys(jsSdkCommon).forEach(function (k) {
|
|
2434
2440
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|