forked from launchdarkly/node-server-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
versioned_data_kind.js
35 lines (30 loc) · 992 Bytes
/
versioned_data_kind.js
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
/*
These objects denote the types of data that can be stored in the feature store and
referenced in the API. If we add another storable data type in the future, as long as it
follows the same pattern (having "key", "version", and "deleted" properties), we only need
to add a corresponding constant here and the existing store should be able to handle it.
Note, for things to work correctly, the "namespace" property must match the key used in
module.exports.
*/
var features = {
namespace: 'features',
streamApiPath: '/flags/',
requestPath: '/sdk/latest-flags/',
priority: 1,
getDependencyKeys: function(flag) {
if (!flag.prerequisites || !flag.prerequisites.length) {
return [];
}
return flag.prerequisites.map(function(p) { return p.key; });
}
};
var segments = {
namespace: 'segments',
streamApiPath: '/segments/',
requestPath: '/sdk/latest-segments/',
priority: 0
};
module.exports = {
features: features,
segments: segments
};