@splitsoftware/splitio-commons 3.0.0-rc.5 → 3.0.0-rc.7
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/package.json +1 -1
- package/types/splitio.d.ts +54 -71
package/package.json
CHANGED
package/types/splitio.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ interface ISharedSettings {
|
|
|
26
26
|
* List of feature flag filters. These filters are used to fetch a subset of the feature flag definitions in your environment, in order to reduce the delay of the SDK to be ready.
|
|
27
27
|
*
|
|
28
28
|
* NOTES:
|
|
29
|
-
* - This configuration is only meaningful when the SDK is working in `
|
|
29
|
+
* - This configuration is only meaningful when the SDK is working in `'standalone'` mode.
|
|
30
30
|
* - If `bySet` filter is provided, `byName` and `byPrefix` filters are ignored.
|
|
31
31
|
* - If both `byName` and `byPrefix` filters are provided, the intersection of the two groups of feature flags is fetched.
|
|
32
32
|
*
|
|
@@ -2311,64 +2311,73 @@ declare namespace SplitIO {
|
|
|
2311
2311
|
*/
|
|
2312
2312
|
interface ConfigsClientSettings {
|
|
2313
2313
|
/**
|
|
2314
|
-
*
|
|
2314
|
+
* SDK key used to authenticate with Harness services.
|
|
2315
2315
|
*
|
|
2316
2316
|
* @see {@link https://developer.harness.io/docs/feature-management-experimentation/management-and-administration/account-settings/api-keys/}
|
|
2317
2317
|
*/
|
|
2318
|
-
|
|
2319
|
-
/**
|
|
2320
|
-
* Polling rate for configs and segments refresh, in seconds. Minimum value: 5.
|
|
2321
|
-
*
|
|
2322
|
-
* @defaultValue `60`
|
|
2323
|
-
*/
|
|
2324
|
-
pollingRate?: number;
|
|
2325
|
-
/**
|
|
2326
|
-
* Push rate for events and impressions, in seconds. Minimum value: 60.
|
|
2327
|
-
*
|
|
2328
|
-
* @defaultValue `60`
|
|
2329
|
-
*/
|
|
2330
|
-
pushRate?: number;
|
|
2331
|
-
/**
|
|
2332
|
-
* Maximum queue size for events and impressions. When the queue reaches this size, a flush is triggered. Minimum value: 1000.
|
|
2333
|
-
*
|
|
2334
|
-
* @defaultValue `10000`
|
|
2335
|
-
*/
|
|
2336
|
-
queueSize?: number;
|
|
2337
|
-
/**
|
|
2338
|
-
* Logging level.
|
|
2339
|
-
*
|
|
2340
|
-
* @defaultValue `'NONE'`
|
|
2341
|
-
*/
|
|
2342
|
-
logLevel?: LogLevel;
|
|
2318
|
+
sdkKey: string;
|
|
2343
2319
|
/**
|
|
2344
|
-
*
|
|
2345
|
-
*
|
|
2346
|
-
*
|
|
2347
|
-
*
|
|
2320
|
+
* Log level for SDK logging.
|
|
2321
|
+
* - `'none'`: No logging
|
|
2322
|
+
* - `'error'`: Log errors only
|
|
2323
|
+
* - `'warn'`: Log warnings and errors
|
|
2324
|
+
* - `'info'`: Log info, warnings, and errors
|
|
2325
|
+
* - `'debug'`: Log debug info and above
|
|
2326
|
+
* @defaultValue `'none'`
|
|
2348
2327
|
*/
|
|
2349
|
-
|
|
2328
|
+
logLevel?: 'none' | 'error' | 'warn' | 'info' | 'debug';
|
|
2350
2329
|
/**
|
|
2351
|
-
*
|
|
2330
|
+
* Synchronization configuration.
|
|
2352
2331
|
*/
|
|
2353
|
-
|
|
2332
|
+
sync?: {
|
|
2333
|
+
/**
|
|
2334
|
+
* Polling rate for configs and segments refresh, in seconds. Minimum value: 5.
|
|
2335
|
+
*
|
|
2336
|
+
* @defaultValue `60`
|
|
2337
|
+
*/
|
|
2338
|
+
pollingRate?: number;
|
|
2354
2339
|
/**
|
|
2355
|
-
*
|
|
2340
|
+
* Push rate for events and impressions, in seconds. Minimum value: 60.
|
|
2356
2341
|
*
|
|
2357
|
-
* @defaultValue `
|
|
2342
|
+
* @defaultValue `60`
|
|
2358
2343
|
*/
|
|
2359
|
-
|
|
2344
|
+
pushRate?: number;
|
|
2360
2345
|
/**
|
|
2361
|
-
*
|
|
2346
|
+
* Maximum queue size for events and impressions. When the queue reaches this size, a flush is triggered. Minimum value: 1000.
|
|
2362
2347
|
*
|
|
2363
|
-
* @defaultValue `
|
|
2348
|
+
* @defaultValue `10000`
|
|
2364
2349
|
*/
|
|
2365
|
-
|
|
2350
|
+
queueSize?: number;
|
|
2366
2351
|
/**
|
|
2367
|
-
*
|
|
2352
|
+
* Time in seconds before emitting the `SDK_READY_TIMED_OUT` event.
|
|
2353
|
+
* A value of `-1` disables the timeout and thus the event is never emitted.
|
|
2368
2354
|
*
|
|
2369
|
-
* @defaultValue `
|
|
2355
|
+
* @defaultValue `10`
|
|
2356
|
+
*/
|
|
2357
|
+
readyTimeout?: number;
|
|
2358
|
+
/**
|
|
2359
|
+
* Base URLs used by the SDK for different services.
|
|
2370
2360
|
*/
|
|
2371
|
-
|
|
2361
|
+
serviceEndpoints?: {
|
|
2362
|
+
/**
|
|
2363
|
+
* String property to override the base URL where the SDK will get JWT authentication credentials.
|
|
2364
|
+
*
|
|
2365
|
+
* @defaultValue `'https://auth.split.io'`
|
|
2366
|
+
*/
|
|
2367
|
+
auth?: string;
|
|
2368
|
+
/**
|
|
2369
|
+
* String property to override the base URL where the SDK will get rollout plan related data, like configs and segments definitions.
|
|
2370
|
+
*
|
|
2371
|
+
* @defaultValue `'https://configs.split.io'`
|
|
2372
|
+
*/
|
|
2373
|
+
configs?: string;
|
|
2374
|
+
/**
|
|
2375
|
+
* String property to override the base URL where the SDK will post event-related information like impressions.
|
|
2376
|
+
*
|
|
2377
|
+
* @defaultValue `'https://events.split.io'`
|
|
2378
|
+
*/
|
|
2379
|
+
events?: string;
|
|
2380
|
+
};
|
|
2372
2381
|
};
|
|
2373
2382
|
/**
|
|
2374
2383
|
* Fallback configuration objects returned by the `client.getConfig` method when the SDK is not ready or the provided config name is not found.
|
|
@@ -2379,39 +2388,13 @@ declare namespace SplitIO {
|
|
|
2379
2388
|
* If provided, this object is merged with the options object passed by the SDK for EventSource and Fetch calls.
|
|
2380
2389
|
*/
|
|
2381
2390
|
requestOptions?: {
|
|
2382
|
-
/**
|
|
2383
|
-
* Custom function called before each request, allowing you to add or update headers in SDK HTTP requests.
|
|
2384
|
-
* Some headers, such as `SplitSDKVersion`, are required by the SDK and cannot be overridden.
|
|
2385
|
-
* To pass multiple headers with the same name, combine their values into a single line, separated by commas. Example: `{ 'Authorization': 'value1, value2' }`
|
|
2386
|
-
* Or provide keys with different cases since headers are case-insensitive. Example: `{ 'authorization': 'value1', 'Authorization': 'value2' }`
|
|
2387
|
-
*
|
|
2388
|
-
* @defaultValue `undefined`
|
|
2389
|
-
*
|
|
2390
|
-
* @param context - The context for the request, which contains the `headers` property object representing the current headers in the request.
|
|
2391
|
-
* @returns An object representing a set of headers to be merged with the current headers.
|
|
2392
|
-
*
|
|
2393
|
-
* @example
|
|
2394
|
-
* ```
|
|
2395
|
-
* const client = ConfigsClient({
|
|
2396
|
-
* ...
|
|
2397
|
-
* requestOptions: {
|
|
2398
|
-
* getHeaderOverrides: (context) => {
|
|
2399
|
-
* return {
|
|
2400
|
-
* 'Authorization': context.headers['Authorization'] + ', other-value',
|
|
2401
|
-
* 'custom-header': 'custom-value'
|
|
2402
|
-
* };
|
|
2403
|
-
* }
|
|
2404
|
-
* }
|
|
2405
|
-
* });
|
|
2406
|
-
* ```
|
|
2407
|
-
*/
|
|
2408
|
-
getHeaderOverrides?: (context: { headers: Record<string, string>; }) => Record<string, string>;
|
|
2409
2391
|
/**
|
|
2410
2392
|
* Custom Node.js HTTP(S) Agent used by the SDK for HTTP(S) requests.
|
|
2411
2393
|
*
|
|
2412
2394
|
* You can use it, for example, for certificate pinning or setting a network proxy:
|
|
2413
2395
|
*
|
|
2414
2396
|
* ```
|
|
2397
|
+
* const { ConfigsClient } = require('@splitsoftware/splitio-configs');
|
|
2415
2398
|
* const { HttpsProxyAgent } = require('https-proxy-agent');
|
|
2416
2399
|
*
|
|
2417
2400
|
* const proxyAgent = new HttpsProxyAgent(process.env.HTTPS_PROXY || 'http://10.10.1.10:1080');
|
|
@@ -2469,7 +2452,7 @@ declare namespace SplitIO {
|
|
|
2469
2452
|
/**
|
|
2470
2453
|
* Configs SDK client interface.
|
|
2471
2454
|
*/
|
|
2472
|
-
interface ConfigsClient extends Omit<IStatusInterface, 'ready'> {
|
|
2455
|
+
interface ConfigsClient extends Omit<IStatusInterface, 'ready' | 'whenReadyFromCache'> {
|
|
2473
2456
|
/**
|
|
2474
2457
|
* Destroys the client.
|
|
2475
2458
|
*
|