This repository has been archived by the owner on May 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.d.ts
82 lines (73 loc) · 3.25 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Type definitions for launchdarkly-node-server-sdk-dynamodb
/**
* Interface for the DynamoDB feature store component to be used with the LaunchDarkly SDK.
*
* See: https://docs.launchdarkly.com/sdk/concepts/data-stores
*/
declare module 'launchdarkly-node-server-sdk-dynamodb' {
import { LDFeatureStore, LDLogger, LDOptions } from 'launchdarkly-node-server-sdk';
import { BigSegmentStore } from 'launchdarkly-node-server-sdk/interfaces';
import { DynamoDB } from 'aws-sdk';
/**
* Create a feature flag store backed by DynamoDB.
*
* @param tableName The table name in DynamoDB (required). The table must already exist.
* See: https://docs.launchdarkly.com/sdk/features/storing-data/dynamodb
* @param options Additional options for configuring the DynamoDB store's behavior.
*/
export function DynamoDBFeatureStore(
tableName: string,
options?: LDDynamoDBOptions
): (config: LDOptions) => LDFeatureStore;
/**
* Configures a big segment store backed by a Redis instance.
*
* "Big segments" are a specific type of user segments. For more information, read the
* LaunchDarkly documentation about user segments: https://docs.launchdarkly.com/home/users/big-segments
*
* @param tableName The table name in DynamoDB (required). The table must already exist.
* See: https://docs.launchdarkly.com/sdk/features/storing-data/dynamodb
* @param options Additional options for configuring the DynamoDB store's behavior.
*/
export function DynamoDBBigSegmentStore(
tableName: string,
options?: LDDynamoDBOptions
): (config: LDOptions) => BigSegmentStore;
/**
* Options for configuring [[DynamoDBFeatureStore]] or [[DynamoDBBigSegmentStore]].
*/
export interface LDDynamoDBOptions {
/**
* Options to be passed to the DynamoDB client constructor, as defined by the AWS SDK.
*/
clientOptions?: DynamoDB.DocumentClient.DocumentClientOptions & DynamoDB.Types.ClientConfiguration;
/**
* Specifies an existing, already-configured DynamoDB client instance that the feature store
* should use rather than creating one of its own. If you specify an existing client, then the
* clientOptions property is ignored.
*/
dynamoDBClient?: DynamoDB.DocumentClient;
/**
* An optional namespace prefix for all keys stored in DynamoDB. Use this if you are sharing
* the same database table between multiple clients that are for different LaunchDarkly
* environments, to avoid key collisions.
*/
prefix?: string;
/**
* The amount of time, in seconds, that recently read or updated items should remain in an
* in-memory cache. If it is zero, there will be no in-memory caching.
*
* This parameter applies only to [[DynamoDBFeatureStore]]. It is ignored for [[DynamoDBBigSegmentStore]].
* Caching for [[DynamoDBBigSegmentStore]] is configured separately, in the SDK's
* `LDBigSegmentsOptions` type, since it is independent of what database implementation is used.
*
* If omitted, the default value is 15 seconds.
*/
cacheTTL?: number;
/**
* A logger to be used for warnings and errors generated by the feature store. If not specified,
* it will use the SDK's logging configuration.
*/
logger?: LDLogger;
}
}