@launchdarkly/js-client-sdk-common 1.9.1-beta.1 → 1.10.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.
Files changed (202) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/{index.cjs → cjs/index.cjs} +1 -1
  3. package/dist/cjs/index.cjs.map +1 -0
  4. package/dist/cjs/package.json +1 -0
  5. package/dist/esm/DataManager.d.ts +65 -0
  6. package/dist/esm/DataManager.d.ts.map +1 -0
  7. package/dist/esm/HookRunner.d.ts +12 -0
  8. package/dist/esm/HookRunner.d.ts.map +1 -0
  9. package/dist/esm/LDClientImpl.d.ts +84 -0
  10. package/dist/esm/LDClientImpl.d.ts.map +1 -0
  11. package/dist/esm/LDEmitter.d.ts +32 -0
  12. package/dist/esm/LDEmitter.d.ts.map +1 -0
  13. package/dist/esm/api/ConnectionMode.d.ts +16 -0
  14. package/dist/esm/api/ConnectionMode.d.ts.map +1 -0
  15. package/dist/esm/api/LDClient.d.ts +315 -0
  16. package/dist/esm/api/LDClient.d.ts.map +1 -0
  17. package/dist/esm/api/LDEvaluationDetail.d.ts +26 -0
  18. package/dist/esm/api/LDEvaluationDetail.d.ts.map +1 -0
  19. package/dist/esm/api/LDIdentifyOptions.d.ts +23 -0
  20. package/dist/esm/api/LDIdentifyOptions.d.ts.map +1 -0
  21. package/dist/esm/api/LDInspection.d.ts +105 -0
  22. package/dist/esm/api/LDInspection.d.ts.map +1 -0
  23. package/dist/esm/api/LDOptions.d.ts +246 -0
  24. package/dist/esm/api/LDOptions.d.ts.map +1 -0
  25. package/dist/esm/api/index.d.ts +8 -0
  26. package/dist/esm/api/index.d.ts.map +1 -0
  27. package/dist/esm/api/integrations/Hooks.d.ts +133 -0
  28. package/dist/esm/api/integrations/Hooks.d.ts.map +1 -0
  29. package/dist/esm/api/integrations/index.d.ts +2 -0
  30. package/dist/esm/api/integrations/index.d.ts.map +1 -0
  31. package/dist/esm/configuration/Configuration.d.ts +86 -0
  32. package/dist/esm/configuration/Configuration.d.ts.map +1 -0
  33. package/dist/esm/configuration/index.d.ts +3 -0
  34. package/dist/esm/configuration/index.d.ts.map +1 -0
  35. package/dist/esm/configuration/validators.d.ts +5 -0
  36. package/dist/esm/configuration/validators.d.ts.map +1 -0
  37. package/dist/esm/context/addAutoEnv.d.ts +31 -0
  38. package/dist/esm/context/addAutoEnv.d.ts.map +1 -0
  39. package/dist/esm/context/ensureKey.d.ts +10 -0
  40. package/dist/esm/context/ensureKey.d.ts.map +1 -0
  41. package/dist/esm/crypto/digest.d.ts +3 -0
  42. package/dist/esm/crypto/digest.d.ts.map +1 -0
  43. package/dist/esm/datasource/DataSourceConfig.d.ts +25 -0
  44. package/dist/esm/datasource/DataSourceConfig.d.ts.map +1 -0
  45. package/dist/esm/datasource/DataSourceEventHandler.d.ts +16 -0
  46. package/dist/esm/datasource/DataSourceEventHandler.d.ts.map +1 -0
  47. package/dist/esm/datasource/DataSourceStatus.d.ts +39 -0
  48. package/dist/esm/datasource/DataSourceStatus.d.ts.map +1 -0
  49. package/dist/esm/datasource/DataSourceStatusErrorInfo.d.ts +8 -0
  50. package/dist/esm/datasource/DataSourceStatusErrorInfo.d.ts.map +1 -0
  51. package/dist/esm/datasource/DataSourceStatusManager.d.ts +40 -0
  52. package/dist/esm/datasource/DataSourceStatusManager.d.ts.map +1 -0
  53. package/dist/esm/datasource/Requestor.d.ts +26 -0
  54. package/dist/esm/datasource/Requestor.d.ts.map +1 -0
  55. package/dist/esm/diagnostics/createDiagnosticsInitConfig.d.ts +16 -0
  56. package/dist/esm/diagnostics/createDiagnosticsInitConfig.d.ts.map +1 -0
  57. package/dist/esm/diagnostics/createDiagnosticsManager.d.ts +5 -0
  58. package/dist/esm/diagnostics/createDiagnosticsManager.d.ts.map +1 -0
  59. package/dist/esm/evaluation/evaluationDetail.d.ts +5 -0
  60. package/dist/esm/evaluation/evaluationDetail.d.ts.map +1 -0
  61. package/dist/esm/events/EventFactory.d.ts +2 -0
  62. package/dist/esm/events/EventFactory.d.ts.map +1 -0
  63. package/dist/esm/events/createEventProcessor.d.ts +5 -0
  64. package/dist/esm/events/createEventProcessor.d.ts.map +1 -0
  65. package/dist/esm/flag-manager/ContextIndex.d.ts +39 -0
  66. package/dist/esm/flag-manager/ContextIndex.d.ts.map +1 -0
  67. package/dist/esm/flag-manager/FlagManager.d.ts +81 -0
  68. package/dist/esm/flag-manager/FlagManager.d.ts.map +1 -0
  69. package/dist/esm/flag-manager/FlagPersistence.d.ts +43 -0
  70. package/dist/esm/flag-manager/FlagPersistence.d.ts.map +1 -0
  71. package/dist/esm/flag-manager/FlagStore.d.ts +29 -0
  72. package/dist/esm/flag-manager/FlagStore.d.ts.map +1 -0
  73. package/dist/esm/flag-manager/FlagUpdater.d.ts +40 -0
  74. package/dist/esm/flag-manager/FlagUpdater.d.ts.map +1 -0
  75. package/dist/esm/flag-manager/ItemDescriptor.d.ts +10 -0
  76. package/dist/esm/flag-manager/ItemDescriptor.d.ts.map +1 -0
  77. package/dist/esm/flag-manager/calculateChangedKeys.d.ts +6 -0
  78. package/dist/esm/flag-manager/calculateChangedKeys.d.ts.map +1 -0
  79. package/dist/esm/index.d.ts +20 -0
  80. package/dist/esm/index.d.ts.map +1 -0
  81. package/dist/{index.mjs → esm/index.mjs} +1 -1
  82. package/dist/esm/index.mjs.map +1 -0
  83. package/dist/esm/inspection/InspectorManager.d.ts +41 -0
  84. package/dist/esm/inspection/InspectorManager.d.ts.map +1 -0
  85. package/dist/esm/inspection/createSafeInspector.d.ts +8 -0
  86. package/dist/esm/inspection/createSafeInspector.d.ts.map +1 -0
  87. package/dist/esm/inspection/getInspectorHook.d.ts +4 -0
  88. package/dist/esm/inspection/getInspectorHook.d.ts.map +1 -0
  89. package/dist/esm/inspection/messages.d.ts +3 -0
  90. package/dist/esm/inspection/messages.d.ts.map +1 -0
  91. package/dist/esm/package.json +1 -0
  92. package/dist/esm/polling/PollingProcessor.d.ts +3 -0
  93. package/dist/esm/polling/PollingProcessor.d.ts.map +1 -0
  94. package/dist/esm/storage/getOrGenerateKey.d.ts +11 -0
  95. package/dist/esm/storage/getOrGenerateKey.d.ts.map +1 -0
  96. package/dist/esm/storage/namespaceUtils.d.ts +20 -0
  97. package/dist/esm/storage/namespaceUtils.d.ts.map +1 -0
  98. package/dist/esm/streaming/StreamingProcessor.d.ts +35 -0
  99. package/dist/esm/streaming/StreamingProcessor.d.ts.map +1 -0
  100. package/dist/esm/streaming/index.d.ts +4 -0
  101. package/dist/esm/streaming/index.d.ts.map +1 -0
  102. package/dist/esm/types/index.d.ts +21 -0
  103. package/dist/esm/types/index.d.ts.map +1 -0
  104. package/package.json +16 -8
  105. package/dist/index.cjs.map +0 -1
  106. package/dist/index.mjs.map +0 -1
  107. /package/dist/{DataManager.d.ts → cjs/DataManager.d.ts} +0 -0
  108. /package/dist/{DataManager.d.ts.map → cjs/DataManager.d.ts.map} +0 -0
  109. /package/dist/{HookRunner.d.ts → cjs/HookRunner.d.ts} +0 -0
  110. /package/dist/{HookRunner.d.ts.map → cjs/HookRunner.d.ts.map} +0 -0
  111. /package/dist/{LDClientImpl.d.ts → cjs/LDClientImpl.d.ts} +0 -0
  112. /package/dist/{LDClientImpl.d.ts.map → cjs/LDClientImpl.d.ts.map} +0 -0
  113. /package/dist/{LDEmitter.d.ts → cjs/LDEmitter.d.ts} +0 -0
  114. /package/dist/{LDEmitter.d.ts.map → cjs/LDEmitter.d.ts.map} +0 -0
  115. /package/dist/{api → cjs/api}/ConnectionMode.d.ts +0 -0
  116. /package/dist/{api → cjs/api}/ConnectionMode.d.ts.map +0 -0
  117. /package/dist/{api → cjs/api}/LDClient.d.ts +0 -0
  118. /package/dist/{api → cjs/api}/LDClient.d.ts.map +0 -0
  119. /package/dist/{api → cjs/api}/LDEvaluationDetail.d.ts +0 -0
  120. /package/dist/{api → cjs/api}/LDEvaluationDetail.d.ts.map +0 -0
  121. /package/dist/{api → cjs/api}/LDIdentifyOptions.d.ts +0 -0
  122. /package/dist/{api → cjs/api}/LDIdentifyOptions.d.ts.map +0 -0
  123. /package/dist/{api → cjs/api}/LDInspection.d.ts +0 -0
  124. /package/dist/{api → cjs/api}/LDInspection.d.ts.map +0 -0
  125. /package/dist/{api → cjs/api}/LDOptions.d.ts +0 -0
  126. /package/dist/{api → cjs/api}/LDOptions.d.ts.map +0 -0
  127. /package/dist/{api → cjs/api}/index.d.ts +0 -0
  128. /package/dist/{api → cjs/api}/index.d.ts.map +0 -0
  129. /package/dist/{api → cjs/api}/integrations/Hooks.d.ts +0 -0
  130. /package/dist/{api → cjs/api}/integrations/Hooks.d.ts.map +0 -0
  131. /package/dist/{api → cjs/api}/integrations/index.d.ts +0 -0
  132. /package/dist/{api → cjs/api}/integrations/index.d.ts.map +0 -0
  133. /package/dist/{configuration → cjs/configuration}/Configuration.d.ts +0 -0
  134. /package/dist/{configuration → cjs/configuration}/Configuration.d.ts.map +0 -0
  135. /package/dist/{configuration → cjs/configuration}/index.d.ts +0 -0
  136. /package/dist/{configuration → cjs/configuration}/index.d.ts.map +0 -0
  137. /package/dist/{configuration → cjs/configuration}/validators.d.ts +0 -0
  138. /package/dist/{configuration → cjs/configuration}/validators.d.ts.map +0 -0
  139. /package/dist/{context → cjs/context}/addAutoEnv.d.ts +0 -0
  140. /package/dist/{context → cjs/context}/addAutoEnv.d.ts.map +0 -0
  141. /package/dist/{context → cjs/context}/ensureKey.d.ts +0 -0
  142. /package/dist/{context → cjs/context}/ensureKey.d.ts.map +0 -0
  143. /package/dist/{crypto → cjs/crypto}/digest.d.ts +0 -0
  144. /package/dist/{crypto → cjs/crypto}/digest.d.ts.map +0 -0
  145. /package/dist/{datasource → cjs/datasource}/DataSourceConfig.d.ts +0 -0
  146. /package/dist/{datasource → cjs/datasource}/DataSourceConfig.d.ts.map +0 -0
  147. /package/dist/{datasource → cjs/datasource}/DataSourceEventHandler.d.ts +0 -0
  148. /package/dist/{datasource → cjs/datasource}/DataSourceEventHandler.d.ts.map +0 -0
  149. /package/dist/{datasource → cjs/datasource}/DataSourceStatus.d.ts +0 -0
  150. /package/dist/{datasource → cjs/datasource}/DataSourceStatus.d.ts.map +0 -0
  151. /package/dist/{datasource → cjs/datasource}/DataSourceStatusErrorInfo.d.ts +0 -0
  152. /package/dist/{datasource → cjs/datasource}/DataSourceStatusErrorInfo.d.ts.map +0 -0
  153. /package/dist/{datasource → cjs/datasource}/DataSourceStatusManager.d.ts +0 -0
  154. /package/dist/{datasource → cjs/datasource}/DataSourceStatusManager.d.ts.map +0 -0
  155. /package/dist/{datasource → cjs/datasource}/Requestor.d.ts +0 -0
  156. /package/dist/{datasource → cjs/datasource}/Requestor.d.ts.map +0 -0
  157. /package/dist/{diagnostics → cjs/diagnostics}/createDiagnosticsInitConfig.d.ts +0 -0
  158. /package/dist/{diagnostics → cjs/diagnostics}/createDiagnosticsInitConfig.d.ts.map +0 -0
  159. /package/dist/{diagnostics → cjs/diagnostics}/createDiagnosticsManager.d.ts +0 -0
  160. /package/dist/{diagnostics → cjs/diagnostics}/createDiagnosticsManager.d.ts.map +0 -0
  161. /package/dist/{evaluation → cjs/evaluation}/evaluationDetail.d.ts +0 -0
  162. /package/dist/{evaluation → cjs/evaluation}/evaluationDetail.d.ts.map +0 -0
  163. /package/dist/{events → cjs/events}/EventFactory.d.ts +0 -0
  164. /package/dist/{events → cjs/events}/EventFactory.d.ts.map +0 -0
  165. /package/dist/{events → cjs/events}/createEventProcessor.d.ts +0 -0
  166. /package/dist/{events → cjs/events}/createEventProcessor.d.ts.map +0 -0
  167. /package/dist/{flag-manager → cjs/flag-manager}/ContextIndex.d.ts +0 -0
  168. /package/dist/{flag-manager → cjs/flag-manager}/ContextIndex.d.ts.map +0 -0
  169. /package/dist/{flag-manager → cjs/flag-manager}/FlagManager.d.ts +0 -0
  170. /package/dist/{flag-manager → cjs/flag-manager}/FlagManager.d.ts.map +0 -0
  171. /package/dist/{flag-manager → cjs/flag-manager}/FlagPersistence.d.ts +0 -0
  172. /package/dist/{flag-manager → cjs/flag-manager}/FlagPersistence.d.ts.map +0 -0
  173. /package/dist/{flag-manager → cjs/flag-manager}/FlagStore.d.ts +0 -0
  174. /package/dist/{flag-manager → cjs/flag-manager}/FlagStore.d.ts.map +0 -0
  175. /package/dist/{flag-manager → cjs/flag-manager}/FlagUpdater.d.ts +0 -0
  176. /package/dist/{flag-manager → cjs/flag-manager}/FlagUpdater.d.ts.map +0 -0
  177. /package/dist/{flag-manager → cjs/flag-manager}/ItemDescriptor.d.ts +0 -0
  178. /package/dist/{flag-manager → cjs/flag-manager}/ItemDescriptor.d.ts.map +0 -0
  179. /package/dist/{flag-manager → cjs/flag-manager}/calculateChangedKeys.d.ts +0 -0
  180. /package/dist/{flag-manager → cjs/flag-manager}/calculateChangedKeys.d.ts.map +0 -0
  181. /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
  182. /package/dist/{index.d.ts.map → cjs/index.d.ts.map} +0 -0
  183. /package/dist/{inspection → cjs/inspection}/InspectorManager.d.ts +0 -0
  184. /package/dist/{inspection → cjs/inspection}/InspectorManager.d.ts.map +0 -0
  185. /package/dist/{inspection → cjs/inspection}/createSafeInspector.d.ts +0 -0
  186. /package/dist/{inspection → cjs/inspection}/createSafeInspector.d.ts.map +0 -0
  187. /package/dist/{inspection → cjs/inspection}/getInspectorHook.d.ts +0 -0
  188. /package/dist/{inspection → cjs/inspection}/getInspectorHook.d.ts.map +0 -0
  189. /package/dist/{inspection → cjs/inspection}/messages.d.ts +0 -0
  190. /package/dist/{inspection → cjs/inspection}/messages.d.ts.map +0 -0
  191. /package/dist/{polling → cjs/polling}/PollingProcessor.d.ts +0 -0
  192. /package/dist/{polling → cjs/polling}/PollingProcessor.d.ts.map +0 -0
  193. /package/dist/{storage → cjs/storage}/getOrGenerateKey.d.ts +0 -0
  194. /package/dist/{storage → cjs/storage}/getOrGenerateKey.d.ts.map +0 -0
  195. /package/dist/{storage → cjs/storage}/namespaceUtils.d.ts +0 -0
  196. /package/dist/{storage → cjs/storage}/namespaceUtils.d.ts.map +0 -0
  197. /package/dist/{streaming → cjs/streaming}/StreamingProcessor.d.ts +0 -0
  198. /package/dist/{streaming → cjs/streaming}/StreamingProcessor.d.ts.map +0 -0
  199. /package/dist/{streaming → cjs/streaming}/index.d.ts +0 -0
  200. /package/dist/{streaming → cjs/streaming}/index.d.ts.map +0 -0
  201. /package/dist/{types → cjs/types}/index.d.ts +0 -0
  202. /package/dist/{types → cjs/types}/index.d.ts.map +0 -0
@@ -0,0 +1,246 @@
1
+ import type { LDLogger } from '@launchdarkly/js-sdk-common';
2
+ import { Hook } from './integrations/Hooks';
3
+ import { LDInspection } from './LDInspection';
4
+ export interface LDOptions {
5
+ /**
6
+ * Whether all context attributes (except the context key) should be marked as private, and
7
+ * not sent to LaunchDarkly in analytics events.
8
+ *
9
+ * @defaultValue false.
10
+ */
11
+ allAttributesPrivate?: boolean;
12
+ /**
13
+ * Information about the application the LaunchDarkly SDK is running in.
14
+ *
15
+ * These properties are optional and informational. They may be used in LaunchDarkly
16
+ * analytics or other product features.
17
+ */
18
+ applicationInfo?: {
19
+ /**
20
+ * A unique identifier representing the application where the LaunchDarkly SDK is running.
21
+ *
22
+ * This can be specified as any string value as long as it only uses the following characters: ASCII letters,
23
+ * ASCII digits, period, hyphen, underscore. A string containing any other characters will be ignored.
24
+ *
25
+ * Example: `authentication-service`
26
+ */
27
+ id?: string;
28
+ /**
29
+ * A unique identifier representing the version of the application where the LaunchDarkly SDK is running.
30
+ *
31
+ * This can be specified as any string value as long as it only uses the following characters: ASCII letters,
32
+ * ASCII digits, period, hyphen, underscore. A string containing any other characters will be ignored.
33
+ *
34
+ * Example: `1.0.0` (standard version string) or `abcdef` (sha prefix)
35
+ */
36
+ version?: string;
37
+ /**
38
+ * A human-friendly application name representing the application where the LaunchDarkly SDK is running.
39
+ *
40
+ * This can be specified as any string value as long as it only uses the following characters: ASCII letters,
41
+ * ASCII digits, period, hyphen, underscore. A string containing any other characters will be ignored.
42
+ */
43
+ name?: string;
44
+ /**
45
+ * A human-friendly name representing the version of the application where the LaunchDarkly SDK is running.
46
+ *
47
+ * This can be specified as any string value as long as it only uses the following characters: ASCII letters,
48
+ * ASCII digits, period, hyphen, underscore. A string containing any other characters will be ignored.
49
+ */
50
+ versionName?: string;
51
+ };
52
+ /**
53
+ * The base uri for the LaunchDarkly server. Most users should use the default value.
54
+ *
55
+ * @defaultValue https://clientsdk.launchdarkly.com.
56
+ */
57
+ baseUri?: string;
58
+ /**
59
+ * The capacity of the analytics events queue.
60
+ *
61
+ * The client buffers up to this many events in memory before flushing. If the capacity is exceeded
62
+ * before the queue is flushed, events will be discarded. Increasing the capacity means that events
63
+ * are less likely to be discarded, at the cost of consuming more memory. Note that in regular usage
64
+ * flag evaluations do not produce individual events, only summary counts, so you only need a large
65
+ * capacity if you are generating a large number of click, pageview, or identify events (or if you
66
+ * are using the event debugger).
67
+ *
68
+ * @defaultValue 100.
69
+ */
70
+ capacity?: number;
71
+ /**
72
+ * Enables debug logging.
73
+ *
74
+ * @defaultValue false.
75
+ */
76
+ debug?: boolean;
77
+ /**
78
+ * Set to true to opt out of sending diagnostics data.
79
+ *
80
+ * Unless `diagnosticOptOut` is set to true, the client will send some diagnostics data to the LaunchDarkly
81
+ * servers in order to assist in the development of future SDK improvements. These diagnostics consist of
82
+ * an initial payload containing some details of SDK in use, the SDK's configuration, and the platform the
83
+ * SDK is being run on, as well as payloads sent periodically with information on irregular occurrences such
84
+ * as dropped events.
85
+ *
86
+ * @defaultValue false.
87
+ */
88
+ diagnosticOptOut?: boolean;
89
+ /**
90
+ * The interval at which periodic diagnostic data is sent, in seconds.
91
+ *
92
+ * The default is 900 (every 15 minutes) and the minimum value is 6. See {@link diagnosticOptOut}
93
+ * for more information on the diagnostics data being sent.
94
+ *
95
+ * @defaultValue 900s.
96
+ */
97
+ diagnosticRecordingInterval?: number;
98
+ /**
99
+ * The base uri for the LaunchDarkly events server. Most users should use the default value.
100
+ *
101
+ * @defaultValue https://events.launchdarkly.com.
102
+ */
103
+ eventsUri?: string;
104
+ /**
105
+ * The interval in between flushes of the analytics events queue, in seconds.
106
+ *
107
+ * @defaultValue 2s for browser implementations 30s for others.
108
+ */
109
+ flushInterval?: number;
110
+ /**
111
+ * An object that will perform logging for the client.
112
+ *
113
+ * @remarks
114
+ * Set a custom {@link LDLogger} if you want full control of logging behavior.
115
+ *
116
+ * @defaultValue A {@link BasicLogger} which outputs to the console at `info` level.
117
+ */
118
+ logger?: LDLogger;
119
+ /**
120
+ * The maximum number of locally cached contexts. The cache is used to decrease initialization
121
+ * latency and to provide fallback when the SDK cannot reach LaunchDarkly services.
122
+ *
123
+ * @defaultValue 5
124
+ */
125
+ maxCachedContexts?: number;
126
+ /**
127
+ * Specifies a list of attribute names (either built-in or custom) which should be marked as
128
+ * private, and not sent to LaunchDarkly in analytics events. You can also specify this on a
129
+ * per-context basis with {@link LDContextMeta.privateAttributes}.
130
+ *
131
+ * Any contexts sent to LaunchDarkly with this configuration active will have attributes with
132
+ * these names removed in analytic events. This is in addition to any attributes that were
133
+ * marked as private for an individual context with {@link LDContextMeta.privateAttributes}.
134
+ * Setting {@link LDOptions.allAttributesPrivate} to true overrides this.
135
+ *
136
+ * If and only if a parameter starts with a slash, it is interpreted as a slash-delimited path
137
+ * that can denote a nested property within a JSON object. For instance, "/address/street" means
138
+ * that if there is an attribute called "address" that is a JSON object, and one of the object's
139
+ * properties is "street", the "street" property will be redacted from the analytics data but
140
+ * other properties within "address" will still be sent. This syntax also uses the JSON Pointer
141
+ * convention of escaping a literal slash character as "~1" and a tilde as "~0".
142
+ */
143
+ privateAttributes?: Array<string>;
144
+ /**
145
+ * Whether to send analytics events back to LaunchDarkly.
146
+ *
147
+ * @defaultValue true.
148
+ */
149
+ sendEvents?: boolean;
150
+ /**
151
+ * Sets the initial reconnect delay for the streaming connection, in seconds.
152
+ *
153
+ * The streaming service uses a backoff algorithm (with jitter) every time the connection needs
154
+ * to be reestablished. The delay for the first reconnection will start near this value, and then
155
+ * increase exponentially for any subsequent connection failures.
156
+ *
157
+ * @defaultValue 1s.
158
+ */
159
+ streamInitialReconnectDelay?: number;
160
+ /**
161
+ * The base uri for the LaunchDarkly streaming server. Most users should use the default value.
162
+ *
163
+ * @defaultValue https://clientstream.launchdarkly.com.
164
+ */
165
+ streamUri?: string;
166
+ /**
167
+ * The time between polling requests, in seconds. Ignored in streaming mode.
168
+ *
169
+ * The minimum polling interval is 30 seconds.
170
+ */
171
+ pollInterval?: number;
172
+ /**
173
+ * Directs the SDK to use the REPORT method for HTTP requests instead of GET. (Default: `false`)
174
+ *
175
+ * This setting applies both to requests to the streaming service, as well as flag requests when the SDK is in polling
176
+ * mode.
177
+ */
178
+ useReport?: boolean;
179
+ /**
180
+ * Whether LaunchDarkly should provide additional information about how flag values were
181
+ * calculated.
182
+ *
183
+ * The additional information will then be available through the client's
184
+ * {@link LDClient.variationDetail} method. Since this increases the size of network requests,
185
+ * such information is not sent unless you set this option to true.
186
+ *
187
+ * @defaultValue false.
188
+ */
189
+ withReasons?: boolean;
190
+ /**
191
+ * For use by wrapper libraries to set an identifying name for the wrapper being used.
192
+ *
193
+ * This will be sent as diagnostic information to the LaunchDarkly servers to allow recording
194
+ * metrics on the usage of these wrapper libraries.
195
+ */
196
+ wrapperName?: string;
197
+ /**
198
+ * For use by wrapper libraries to set version to be included alongside `wrapperName`.
199
+ *
200
+ * If `wrapperName` is unset, this field will be ignored.
201
+ */
202
+ wrapperVersion?: string;
203
+ /**
204
+ * LaunchDarkly Server SDKs historically downloaded all flag configuration and segments for a particular environment
205
+ * during initialization.
206
+ *
207
+ * For some customers, this is an unacceptably large amount of data, and has contributed to performance issues
208
+ * within their products.
209
+ *
210
+ * Filtered environments aim to solve this problem. By allowing customers to specify subsets of an environment's
211
+ * flags using a filter key, SDKs will initialize faster and use less memory.
212
+ *
213
+ * This payload filter key only applies to the default streaming and polling data sources. It will not affect
214
+ * TestData or FileData data sources, nor will it be applied to any data source provided through the featureStore
215
+ * config property.
216
+ */
217
+ payloadFilterKey?: string;
218
+ /**
219
+ * Initial set of hooks for the client.
220
+ *
221
+ * Hooks provide entrypoints which allow for observation of SDK functions.
222
+ *
223
+ * LaunchDarkly provides integration packages, and most applications will not
224
+ * need to implement their own hooks. Refer to the `@launchdarkly/node-server-sdk-otel`
225
+ * for instrumentation for the `@launchdarkly/node-server-sdk`.
226
+ *
227
+ * Example:
228
+ * ```typescript
229
+ * import { init } from '@launchdarkly/node-server-sdk';
230
+ * import { TheHook } from '@launchdarkly/some-hook';
231
+ *
232
+ * const client = init('my-sdk-key', { hooks: [new TheHook()] });
233
+ * ```
234
+ */
235
+ hooks?: Hook[];
236
+ /**
237
+ * Inspectors can be used for collecting information for monitoring, analytics, and debugging.
238
+ *
239
+ *
240
+ * @deprecated Hooks should be used instead of inspectors and inspectors will be removed in
241
+ * a future version. If you need functionality that is not exposed using hooks, then please
242
+ * let us know through a github issue or support.
243
+ */
244
+ inspectors?: LDInspection[];
245
+ }
246
+ //# sourceMappingURL=LDOptions.d.ts.map
@@ -0,0 +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;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ConnectionMode from './ConnectionMode';
2
+ export * from './LDOptions';
3
+ export * from './LDClient';
4
+ export * from './LDEvaluationDetail';
5
+ export * from './integrations';
6
+ export { ConnectionMode };
7
+ export * from './LDIdentifyOptions';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,133 @@
1
+ import { LDContext } from '@launchdarkly/js-sdk-common';
2
+ import { LDEvaluationDetail } from '../LDEvaluationDetail';
3
+ /**
4
+ * Contextual information provided to evaluation stages.
5
+ */
6
+ export interface EvaluationSeriesContext {
7
+ readonly flagKey: string;
8
+ /**
9
+ * Optional in case evaluations are performed before a context is set.
10
+ */
11
+ readonly context?: LDContext;
12
+ readonly defaultValue: unknown;
13
+ }
14
+ /**
15
+ * Implementation specific hook data for evaluation stages.
16
+ *
17
+ * Hook implementations can use this to store data needed between stages.
18
+ */
19
+ export interface EvaluationSeriesData {
20
+ readonly [index: string]: unknown;
21
+ }
22
+ /**
23
+ * Meta-data about a hook implementation.
24
+ */
25
+ export interface HookMetadata {
26
+ readonly name: string;
27
+ }
28
+ /**
29
+ * Contextual information provided to evaluation stages.
30
+ */
31
+ export interface IdentifySeriesContext {
32
+ readonly context: LDContext;
33
+ /**
34
+ * The timeout, in seconds, associated with the identify operation.
35
+ */
36
+ readonly timeout?: number;
37
+ }
38
+ /**
39
+ * Implementation specific hook data for evaluation stages.
40
+ *
41
+ * Hook implementations can use this to store data needed between stages.
42
+ */
43
+ export interface IdentifySeriesData {
44
+ readonly [index: string]: unknown;
45
+ }
46
+ /**
47
+ * The status an identify operation completed with.
48
+ */
49
+ export type IdentifySeriesStatus = 'completed' | 'error';
50
+ /**
51
+ * The result applies to a single identify operation. An operation may complete
52
+ * with an error and then later complete successfully. Only the first completion
53
+ * will be executed in the evaluation series.
54
+ */
55
+ export interface IdentifySeriesResult {
56
+ status: IdentifySeriesStatus;
57
+ }
58
+ /**
59
+ * Interface for extending SDK functionality via hooks.
60
+ */
61
+ export interface Hook {
62
+ /**
63
+ * Get metadata about the hook implementation.
64
+ */
65
+ getMetadata(): HookMetadata;
66
+ /**
67
+ * This method is called during the execution of a variation method
68
+ * before the flag value has been determined. The method is executed synchronously.
69
+ *
70
+ * @param hookContext Contains information about the evaluation being performed. This is not
71
+ * mutable.
72
+ * @param data A record associated with each stage of hook invocations. Each stage is called with
73
+ * the data of the previous stage for a series. The input record should not be modified.
74
+ * @returns Data to use when executing the next state of the hook in the evaluation series. It is
75
+ * recommended to expand the previous input into the return. This helps ensure your stage remains
76
+ * compatible moving forward as more stages are added.
77
+ * ```js
78
+ * return {...data, "my-new-field": /*my data/*}
79
+ * ```
80
+ */
81
+ beforeEvaluation?(hookContext: EvaluationSeriesContext, data: EvaluationSeriesData): EvaluationSeriesData;
82
+ /**
83
+ * This method is called during the execution of the variation method
84
+ * after the flag value has been determined. The method is executed synchronously.
85
+ *
86
+ * @param hookContext Contains read-only information about the evaluation
87
+ * being performed.
88
+ * @param data A record associated with each stage of hook invocations. Each
89
+ * stage is called with the data of the previous stage for a series.
90
+ * @param detail The result of the evaluation. This value should not be
91
+ * modified.
92
+ * @returns Data to use when executing the next state of the hook in the evaluation series. It is
93
+ * recommended to expand the previous input into the return. This helps ensure your stage remains
94
+ * compatible moving forward as more stages are added.
95
+ * ```js
96
+ * return {...data, "my-new-field": /*my data/*}
97
+ * ```
98
+ */
99
+ afterEvaluation?(hookContext: EvaluationSeriesContext, data: EvaluationSeriesData, detail: LDEvaluationDetail): EvaluationSeriesData;
100
+ /**
101
+ * This method is called during the execution of the identify process before the operation
102
+ * completes, but after any context modifications are performed.
103
+ *
104
+ * @param hookContext Contains information about the evaluation being performed. This is not
105
+ * mutable.
106
+ * @param data A record associated with each stage of hook invocations. Each stage is called with
107
+ * the data of the previous stage for a series. The input record should not be modified.
108
+ * @returns Data to use when executing the next state of the hook in the evaluation series. It is
109
+ * recommended to expand the previous input into the return. This helps ensure your stage remains
110
+ * compatible moving forward as more stages are added.
111
+ * ```js
112
+ * return {...data, "my-new-field": /*my data/*}
113
+ * ```
114
+ */
115
+ beforeIdentify?(hookContext: IdentifySeriesContext, data: IdentifySeriesData): IdentifySeriesData;
116
+ /**
117
+ * This method is called during the execution of the identify process before the operation
118
+ * completes, but after any context modifications are performed.
119
+ *
120
+ * @param hookContext Contains information about the evaluation being performed. This is not
121
+ * mutable.
122
+ * @param data A record associated with each stage of hook invocations. Each stage is called with
123
+ * the data of the previous stage for a series. The input record should not be modified.
124
+ * @returns Data to use when executing the next state of the hook in the evaluation series. It is
125
+ * recommended to expand the previous input into the return. This helps ensure your stage remains
126
+ * compatible moving forward as more stages are added.
127
+ * ```js
128
+ * return {...data, "my-new-field": /*my data/*}
129
+ * ```
130
+ */
131
+ afterIdentify?(hookContext: IdentifySeriesContext, data: IdentifySeriesData, result: IdentifySeriesResult): IdentifySeriesData;
132
+ }
133
+ //# sourceMappingURL=Hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Hooks.d.ts","sourceRoot":"","sources":["../../../src/api/integrations/Hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAOhC;AAED;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ks';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/integrations/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
@@ -0,0 +1,86 @@
1
+ import { ApplicationTags, internal, LDFlagSet, LDLogger, ServiceEndpoints } from '@launchdarkly/js-sdk-common';
2
+ import { Hook, type LDOptions } from '../api';
3
+ import { LDInspection } from '../api/LDInspection';
4
+ export interface LDClientInternalOptions extends internal.LDInternalOptions {
5
+ trackEventModifier?: (event: internal.InputCustomEvent) => internal.InputCustomEvent;
6
+ }
7
+ export interface Configuration {
8
+ readonly logger: LDLogger;
9
+ readonly maxCachedContexts: number;
10
+ readonly capacity: number;
11
+ readonly diagnosticRecordingInterval: number;
12
+ readonly flushInterval: number;
13
+ readonly streamInitialReconnectDelay: number;
14
+ readonly allAttributesPrivate: boolean;
15
+ readonly debug: boolean;
16
+ readonly diagnosticOptOut: boolean;
17
+ readonly sendEvents: boolean;
18
+ readonly sendLDHeaders: boolean;
19
+ readonly useReport: boolean;
20
+ readonly withReasons: boolean;
21
+ readonly privateAttributes: string[];
22
+ readonly tags: ApplicationTags;
23
+ readonly applicationInfo?: {
24
+ id?: string;
25
+ version?: string;
26
+ name?: string;
27
+ versionName?: string;
28
+ };
29
+ readonly bootstrap?: LDFlagSet;
30
+ readonly requestHeaderTransform?: (headers: Map<string, string>) => Map<string, string>;
31
+ readonly stream?: boolean;
32
+ readonly hash?: string;
33
+ readonly wrapperName?: string;
34
+ readonly wrapperVersion?: string;
35
+ readonly serviceEndpoints: ServiceEndpoints;
36
+ readonly pollInterval: number;
37
+ readonly userAgentHeaderName: 'user-agent' | 'x-launchdarkly-user-agent';
38
+ readonly trackEventModifier: (event: internal.InputCustomEvent) => internal.InputCustomEvent;
39
+ readonly hooks: Hook[];
40
+ readonly inspectors: LDInspection[];
41
+ }
42
+ declare const DEFAULT_POLLING: string;
43
+ declare const DEFAULT_STREAM: string;
44
+ export { DEFAULT_POLLING, DEFAULT_STREAM };
45
+ export default class ConfigurationImpl implements Configuration {
46
+ readonly logger: LDLogger;
47
+ private readonly baseUri;
48
+ private readonly eventsUri;
49
+ private readonly streamUri;
50
+ readonly maxCachedContexts = 5;
51
+ readonly capacity = 100;
52
+ readonly diagnosticRecordingInterval = 900;
53
+ readonly flushInterval = 30;
54
+ readonly streamInitialReconnectDelay = 1;
55
+ readonly allAttributesPrivate: boolean;
56
+ readonly debug: boolean;
57
+ readonly diagnosticOptOut: boolean;
58
+ readonly sendEvents: boolean;
59
+ readonly sendLDHeaders: boolean;
60
+ readonly useReport: boolean;
61
+ readonly withReasons: boolean;
62
+ readonly privateAttributes: string[];
63
+ readonly tags: ApplicationTags;
64
+ readonly applicationInfo?: {
65
+ id?: string;
66
+ version?: string;
67
+ name?: string;
68
+ versionName?: string;
69
+ };
70
+ readonly bootstrap?: LDFlagSet;
71
+ readonly requestHeaderTransform?: (headers: Map<string, string>) => Map<string, string>;
72
+ readonly stream?: boolean;
73
+ readonly hash?: string;
74
+ readonly wrapperName?: string;
75
+ readonly wrapperVersion?: string;
76
+ readonly serviceEndpoints: ServiceEndpoints;
77
+ readonly pollInterval: number;
78
+ readonly userAgentHeaderName: 'user-agent' | 'x-launchdarkly-user-agent';
79
+ readonly hooks: Hook[];
80
+ readonly inspectors: LDInspection[];
81
+ readonly trackEventModifier: (event: internal.InputCustomEvent) => internal.InputCustomEvent;
82
+ [index: string]: any;
83
+ constructor(pristineOptions?: LDOptions, internalOptions?: LDClientInternalOptions);
84
+ private _validateTypesAndNames;
85
+ }
86
+ //# sourceMappingURL=Configuration.d.ts.map
@@ -0,0 +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,EAIR,gBAAgB,EAEjB,MAAM,6BAA6B,CAAC;AAErC,OA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AAG,GAAG,CAAC;gBAET,eAAe,GAAE,SAAc,EAAE,eAAe,GAAE,uBAA4B;IAqB1F,OAAO,CAAC,sBAAsB;CAuC/B"}
@@ -0,0 +1,3 @@
1
+ import ConfigurationImpl, { Configuration, DEFAULT_POLLING, DEFAULT_STREAM, LDClientInternalOptions } from './Configuration';
2
+ export { Configuration, ConfigurationImpl, LDClientInternalOptions, DEFAULT_POLLING, DEFAULT_STREAM, };
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configuration/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,EAAE,EACxB,aAAa,EACb,eAAe,EACf,cAAc,EACd,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,cAAc,GACf,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { TypeValidator } from '@launchdarkly/js-sdk-common';
2
+ import { type LDOptions } from '../api';
3
+ declare const validators: Record<keyof LDOptions, TypeValidator>;
4
+ export default validators;
5
+ //# sourceMappingURL=validators.d.ts.map
@@ -0,0 +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,CA+BtD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { LDApplication, LDContext, LDDevice, LDSingleKindContext, Platform } from '@launchdarkly/js-sdk-common';
2
+ import { Configuration } from '../configuration';
3
+ export declare const toMulti: (c: LDSingleKindContext) => {
4
+ [x: string]: string | {
5
+ [attribute: string]: any;
6
+ key: string;
7
+ name?: string | undefined;
8
+ _meta?: import("@launchdarkly/js-sdk-common").LDContextMeta | undefined;
9
+ anonymous?: boolean | undefined;
10
+ };
11
+ kind: string;
12
+ };
13
+ /**
14
+ * Clones the LDApplication object and populates the key, envAttributesVersion, id and version fields.
15
+ *
16
+ * @param crypto
17
+ * @param info
18
+ * @param applicationInfo
19
+ * @param config
20
+ * @return An LDApplication object with populated key, envAttributesVersion, id and version.
21
+ */
22
+ export declare const addApplicationInfo: ({ crypto, info }: Platform, { applicationInfo }: Configuration) => Promise<LDApplication | undefined>;
23
+ /**
24
+ * Clones the LDDevice object and populates the key and envAttributesVersion field.
25
+ *
26
+ * @param platform
27
+ * @return An LDDevice object with populated key and envAttributesVersion.
28
+ */
29
+ export declare const addDeviceInfo: (platform: Platform) => Promise<LDDevice | undefined>;
30
+ export declare const addAutoEnv: (context: LDContext, platform: Platform, config: Configuration) => Promise<LDContext>;
31
+ //# sourceMappingURL=addAutoEnv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addAutoEnv.d.ts","sourceRoot":"","sources":["../../src/context/addAutoEnv.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,EACb,SAAS,EACT,QAAQ,EAER,mBAAmB,EAEnB,QAAQ,EACT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQjD,eAAO,MAAM,OAAO,MAAO,mBAAmB;;;;;;;;;CAO7C,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,qBACX,QAAQ,uBACL,aAAa,KACjC,QAAQ,aAAa,GAAG,SAAS,CA0BnC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,aAAoB,QAAQ,kCA2BrD,CAAC;AAEF,eAAO,MAAM,UAAU,YACZ,SAAS,YACR,QAAQ,UACV,aAAa,KACpB,QAAQ,SAAS,CA2CnB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { LDContext, Platform } from '@launchdarkly/js-sdk-common';
2
+ /**
3
+ * Ensure a key is always present in anonymous contexts. Non-anonymous contexts
4
+ * are not processed and will just be returned as is.
5
+ *
6
+ * @param context
7
+ * @param platform
8
+ */
9
+ export declare const ensureKey: (context: LDContext, platform: Platform) => Promise<LDContext>;
10
+ //# sourceMappingURL=ensureKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensureKey.d.ts","sourceRoot":"","sources":["../../src/context/ensureKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EAKT,QAAQ,EACT,MAAM,6BAA6B,CAAC;AAiDrC;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,YAAmB,SAAS,YAAY,QAAQ,KAAG,QAAQ,SAAS,CAgBzF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Hasher } from '@launchdarkly/js-sdk-common';
2
+ export default function digest(hasher: Hasher, encoding: string): Promise<string>;
3
+ //# sourceMappingURL=digest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../../src/crypto/digest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,wBAA8B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAStF"}
@@ -0,0 +1,25 @@
1
+ import { Encoding, LDHeaders, ServiceEndpoints } from '@launchdarkly/js-sdk-common';
2
+ export interface DataSourceConfig {
3
+ credential: string;
4
+ serviceEndpoints: ServiceEndpoints;
5
+ baseHeaders: LDHeaders;
6
+ withReasons: boolean;
7
+ useReport: boolean;
8
+ paths: DataSourcePaths;
9
+ queryParameters?: {
10
+ key: string;
11
+ value: string;
12
+ }[];
13
+ }
14
+ export interface PollingDataSourceConfig extends DataSourceConfig {
15
+ pollInterval: number;
16
+ }
17
+ export interface StreamingDataSourceConfig extends DataSourceConfig {
18
+ initialRetryDelayMillis: number;
19
+ }
20
+ export interface DataSourcePaths {
21
+ pathGet(encoding: Encoding, plainContextString: string): string;
22
+ pathReport(encoding: Encoding, plainContextString: string): string;
23
+ pathPing(encoding: Encoding, plainContextString: string): string;
24
+ }
25
+ //# sourceMappingURL=DataSourceConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataSourceConfig.d.ts","sourceRoot":"","sources":["../../src/datasource/DataSourceConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpF,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,WAAW,EAAE,SAAS,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,eAAe,CAAC;IACvB,eAAe,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACpD;AAED,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB;IAC/D,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;IACjE,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,eAAe;IAE9B,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAAC;IAEhE,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAAC;IAEnE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAAC;CAClE"}
@@ -0,0 +1,16 @@
1
+ import { Context, LDLogger, LDPollingError, LDStreamingError } from '@launchdarkly/js-sdk-common';
2
+ import { FlagManager } from '../flag-manager/FlagManager';
3
+ import { DeleteFlag, Flags, PatchFlag } from '../types';
4
+ import DataSourceStatusManager from './DataSourceStatusManager';
5
+ export default class DataSourceEventHandler {
6
+ private readonly _flagManager;
7
+ private readonly _statusManager;
8
+ private readonly _logger;
9
+ constructor(_flagManager: FlagManager, _statusManager: DataSourceStatusManager, _logger: LDLogger);
10
+ handlePut(context: Context, flags: Flags): Promise<void>;
11
+ handlePatch(context: Context, patchFlag: PatchFlag): Promise<void>;
12
+ handleDelete(context: Context, deleteFlag: DeleteFlag): Promise<void>;
13
+ handleStreamingError(error: LDStreamingError): void;
14
+ handlePollingError(error: LDPollingError): void;
15
+ }
16
+ //# sourceMappingURL=DataSourceEventHandler.d.ts.map
@@ -0,0 +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;AAExD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,sBAAsB;IAEvC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAFP,YAAY,EAAE,WAAW,EACzB,cAAc,EAAE,uBAAuB,EACvC,OAAO,EAAE,QAAQ;IAG9B,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK;IAexC,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;IAQlD,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU;IAkB3D,oBAAoB,CAAC,KAAK,EAAE,gBAAgB;IAI5C,kBAAkB,CAAC,KAAK,EAAE,cAAc;CAGzC"}